Lines Matching +full:mac +full:- +full:address

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
7 /* On Hyper-V, to reset, we need to read from this offset
9 * Hyper-V to support PF/VF communication.
25 * ixgbevf_start_hw_vf - Prepare hardware for Tx/Rx
29 * all on chip counters, initializes receive address registers, multicast
36 hw->adapter_stopped = false; in ixgbevf_start_hw_vf()
42 * ixgbevf_init_hw_vf - virtual function hardware initialization
50 s32 status = hw->mac.ops.start_hw(hw); in ixgbevf_init_hw_vf()
52 hw->mac.ops.get_mac_addr(hw, hw->mac.addr); in ixgbevf_init_hw_vf()
58 * ixgbevf_reset_hw_vf - Performs hardware reset
66 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_reset_hw_vf()
73 hw->mac.ops.stop_adapter(hw); in ixgbevf_reset_hw_vf()
76 hw->api_version = ixgbe_mbox_api_10; in ixgbevf_reset_hw_vf()
77 hw->mbx.ops.init_params(hw); in ixgbevf_reset_hw_vf()
78 memcpy(&hw->mbx.ops, &ixgbevf_mbx_ops_legacy, in ixgbevf_reset_hw_vf()
85 while (!mbx->ops.check_for_rst(hw) && timeout) { in ixgbevf_reset_hw_vf()
86 timeout--; in ixgbevf_reset_hw_vf()
94 mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; in ixgbevf_reset_hw_vf()
103 * on the mac address in word 3 in ixgbevf_reset_hw_vf()
110 * to indicate that no MAC address has yet been assigned for in ixgbevf_reset_hw_vf()
118 ether_addr_copy(hw->mac.perm_addr, addr); in ixgbevf_reset_hw_vf()
120 hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD]; in ixgbevf_reset_hw_vf()
126 * ixgbevf_hv_reset_hw_vf - reset via Hyper-V
129 * Hyper-V variant; the VF/PF communication is through the PCI
135 struct ixgbevf_adapter *adapter = hw->back; in ixgbevf_hv_reset_hw_vf()
139 pci_read_config_byte(adapter->pdev, in ixgbevf_hv_reset_hw_vf()
141 &hw->mac.perm_addr[i]); in ixgbevf_hv_reset_hw_vf()
144 pr_err("PCI_MMCONFIG needs to be enabled for Hyper-V\n"); in ixgbevf_hv_reset_hw_vf()
145 return -EOPNOTSUPP; in ixgbevf_hv_reset_hw_vf()
150 * ixgbevf_stop_hw_vf - Generic stop Tx/Rx units
167 hw->adapter_stopped = true; in ixgbevf_stop_hw_vf()
170 number_of_queues = hw->mac.max_rx_queues; in ixgbevf_stop_hw_vf()
188 number_of_queues = hw->mac.max_tx_queues; in ixgbevf_stop_hw_vf()
201 * ixgbevf_mta_vector - Determines bit-vector in multicast table to set
203 * @mc_addr: the multicast address
205 * Extracts the 12 bits, from a multicast address, to determine which
206 * bit-vector to set in the multicast table. The hardware uses 12 bits, from
207 * incoming Rx multicast addresses, to determine the bit-vector to check in
208 * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
216 switch (hw->mac.mc_filter_type) { in ixgbevf_mta_vector()
217 case 0: /* use bits [47:36] of the address */ in ixgbevf_mta_vector()
220 case 1: /* use bits [46:35] of the address */ in ixgbevf_mta_vector()
223 case 2: /* use bits [45:34] of the address */ in ixgbevf_mta_vector()
226 case 3: /* use bits [43:32] of the address */ in ixgbevf_mta_vector()
233 /* vector can only be 12-bits or boundary will be exceeded */ in ixgbevf_mta_vector()
239 * ixgbevf_get_mac_addr_vf - Read device MAC address
241 * @mac_addr: pointer to storage for retrieved MAC address
245 ether_addr_copy(mac_addr, hw->mac.perm_addr); in ixgbevf_get_mac_addr_vf()
275 return -ENOMEM; in ixgbevf_set_uc_addr_vf()
283 return -EOPNOTSUPP; in ixgbevf_hv_set_uc_addr_vf()
287 * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents.
295 * if API doesn't support this operation - (-EOPNOTSUPP).
315 switch (hw->api_version) { in ixgbevf_get_reta_locked()
320 if (hw->mac.type < ixgbe_mac_X550_vf) in ixgbevf_get_reta_locked()
324 return -EOPNOTSUPP; in ixgbevf_get_reta_locked()
341 /* If the operation has been refused by a PF return -EPERM */ in ixgbevf_get_reta_locked()
343 return -EPERM; in ixgbevf_get_reta_locked()
364 * ixgbevf_get_rss_key_locked - get the RSS Random Key
371 * if API doesn't support this operation - (-EOPNOTSUPP).
384 switch (hw->api_version) { in ixgbevf_get_rss_key_locked()
389 if (hw->mac.type < ixgbe_mac_X550_vf) in ixgbevf_get_rss_key_locked()
393 return -EOPNOTSUPP; in ixgbevf_get_rss_key_locked()
409 /* If the operation has been refused by a PF return -EPERM */ in ixgbevf_get_rss_key_locked()
411 return -EPERM; in ixgbevf_get_rss_key_locked()
426 * ixgbevf_set_rar_vf - set device MAC address
428 * @index: Receive address register to write
429 * @addr: Address to put into receive address register
447 /* if nacked the address was rejected, use "perm_addr" */ in ixgbevf_set_rar_vf()
450 ixgbevf_get_mac_addr_vf(hw, hw->mac.addr); in ixgbevf_set_rar_vf()
458 * ixgbevf_hv_set_rar_vf - set device MAC address Hyper-V variant
460 * @index: Receive address register to write
461 * @addr: Address to put into receive address register
464 * We don't really allow setting the device MAC address. However,
465 * if the address being set is the permanent MAC address we will
471 if (ether_addr_equal(addr, hw->mac.perm_addr)) in ixgbevf_hv_set_rar_vf()
474 return -EOPNOTSUPP; in ixgbevf_hv_set_rar_vf()
478 * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses
497 * It would be unusual for a server to request that many multi-cast in ixgbevf_update_mc_addr_list_vf()
511 if (is_link_local_ether_addr(ha->addr)) in ixgbevf_update_mc_addr_list_vf()
514 vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); in ixgbevf_update_mc_addr_list_vf()
522 * ixgbevf_hv_update_mc_addr_list_vf - stub
526 * Hyper-V variant - just a stub.
531 return -EOPNOTSUPP; in ixgbevf_hv_update_mc_addr_list_vf()
535 * ixgbevf_update_xcast_mode - Update Multicast mode
546 switch (hw->api_version) { in ixgbevf_update_xcast_mode()
550 return -EOPNOTSUPP; in ixgbevf_update_xcast_mode()
557 return -EOPNOTSUPP; in ixgbevf_update_xcast_mode()
570 return -EPERM; in ixgbevf_update_xcast_mode()
576 * ixgbevf_hv_update_xcast_mode - stub
580 * Hyper-V variant - just a stub.
584 return -EOPNOTSUPP; in ixgbevf_hv_update_xcast_mode()
588 * ixgbevf_get_link_state_vf - Get VF link state from PF
616 * ixgbevf_hv_get_link_state_vf - * Hyper-V variant - just a stub.
620 * Hyper-V variant; there is no mailbox communication.
624 return -EOPNOTSUPP; in ixgbevf_hv_get_link_state_vf()
628 * ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
662 * ixgbevf_hv_set_vfta_vf - * Hyper-V variant - just a stub.
671 return -EOPNOTSUPP; in ixgbevf_hv_set_vfta_vf()
675 * ixgbevf_setup_mac_link_vf - Setup MAC link settings
692 * ixgbevf_check_mac_link_vf - Get link/speed status
705 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_check_mac_link_vf()
706 struct ixgbe_mac_info *mac = &hw->mac; in ixgbevf_check_mac_link_vf() local
712 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in ixgbevf_check_mac_link_vf()
713 mac->get_link_status = true; in ixgbevf_check_mac_link_vf()
715 if (!mac->get_link_status) in ixgbevf_check_mac_link_vf()
726 if (mac->type == ixgbe_mac_82599_vf) { in ixgbevf_check_mac_link_vf()
753 if (mbx->ops.read(hw, &in_msg, 1)) { in ixgbevf_check_mac_link_vf()
754 if (hw->api_version >= ixgbe_mbox_api_15) in ixgbevf_check_mac_link_vf()
755 mac->get_link_status = false; in ixgbevf_check_mac_link_vf()
762 ret_val = -1; in ixgbevf_check_mac_link_vf()
767 if (!mbx->timeout) { in ixgbevf_check_mac_link_vf()
768 ret_val = -1; in ixgbevf_check_mac_link_vf()
775 mac->get_link_status = false; in ixgbevf_check_mac_link_vf()
778 *link_up = !mac->get_link_status; in ixgbevf_check_mac_link_vf()
783 * ixgbevf_hv_check_mac_link_vf - check link
789 * Hyper-V variant; there is no mailbox communication.
796 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_hv_check_mac_link_vf()
797 struct ixgbe_mac_info *mac = &hw->mac; in ixgbevf_hv_check_mac_link_vf() local
801 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in ixgbevf_hv_check_mac_link_vf()
802 mac->get_link_status = true; in ixgbevf_hv_check_mac_link_vf()
804 if (!mac->get_link_status) in ixgbevf_hv_check_mac_link_vf()
815 if (mac->type == ixgbe_mac_82599_vf) { in ixgbevf_hv_check_mac_link_vf()
842 mac->get_link_status = false; in ixgbevf_hv_check_mac_link_vf()
845 *link_up = !mac->get_link_status; in ixgbevf_hv_check_mac_link_vf()
850 * ixgbevf_set_rlpml_vf - Set the maximum receive packet length
874 * ixgbevf_hv_set_rlpml_vf - Set the maximum receive packet length
877 * Hyper-V variant.
883 /* If we are on Hyper-V, we implement this functionality in ixgbevf_hv_set_rlpml_vf()
895 * ixgbevf_negotiate_api_version_vf - Negotiate supported API version
916 hw->api_version = api; in ixgbevf_negotiate_api_version_vf()
927 * ixgbevf_hv_negotiate_api_version_vf - Negotiate supported API version
930 * Hyper-V version - only ixgbe_mbox_api_10 supported.
934 /* Hyper-V only supports api version ixgbe_mbox_api_10 */ in ixgbevf_hv_negotiate_api_version_vf()
948 switch (hw->api_version) { in ixgbevf_get_queues()
975 hw->mac.max_tx_queues = msg[IXGBE_VF_TX_QUEUES]; in ixgbevf_get_queues()
976 if (hw->mac.max_tx_queues == 0 || in ixgbevf_get_queues()
977 hw->mac.max_tx_queues > IXGBE_VF_MAX_TX_QUEUES) in ixgbevf_get_queues()
978 hw->mac.max_tx_queues = IXGBE_VF_MAX_TX_QUEUES; in ixgbevf_get_queues()
980 hw->mac.max_rx_queues = msg[IXGBE_VF_RX_QUEUES]; in ixgbevf_get_queues()
981 if (hw->mac.max_rx_queues == 0 || in ixgbevf_get_queues()
982 hw->mac.max_rx_queues > IXGBE_VF_MAX_RX_QUEUES) in ixgbevf_get_queues()
983 hw->mac.max_rx_queues = IXGBE_VF_MAX_RX_QUEUES; in ixgbevf_get_queues()
987 if (*num_tcs > hw->mac.max_rx_queues) in ixgbevf_get_queues()
991 /* default to queue 0 on out-of-bounds queue number */ in ixgbevf_get_queues()
992 if (*default_tc >= hw->mac.max_tx_queues) in ixgbevf_get_queues()
1036 .mac = ixgbe_mac_82599_vf,
1041 .mac = ixgbe_mac_82599_vf,
1046 .mac = ixgbe_mac_X540_vf,
1051 .mac = ixgbe_mac_X540_vf,
1056 .mac = ixgbe_mac_X550_vf,
1061 .mac = ixgbe_mac_X550_vf,
1066 .mac = ixgbe_mac_X550EM_x_vf,
1071 .mac = ixgbe_mac_X550EM_x_vf,
1076 .mac = ixgbe_mac_x550em_a_vf,