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.
16 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_write_msg_read_ack()
17 s32 retval = mbx->ops.write_posted(hw, msg, size); in ixgbevf_write_msg_read_ack()
22 return mbx->ops.read_posted(hw, retmsg, size); in ixgbevf_write_msg_read_ack()
26 * ixgbevf_start_hw_vf - Prepare hardware for Tx/Rx
30 * all on chip counters, initializes receive address registers, multicast
37 hw->adapter_stopped = false; in ixgbevf_start_hw_vf()
43 * ixgbevf_init_hw_vf - virtual function hardware initialization
51 s32 status = hw->mac.ops.start_hw(hw); in ixgbevf_init_hw_vf()
53 hw->mac.ops.get_mac_addr(hw, hw->mac.addr); in ixgbevf_init_hw_vf()
59 * ixgbevf_reset_hw_vf - Performs hardware reset
67 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_reset_hw_vf()
74 hw->mac.ops.stop_adapter(hw); in ixgbevf_reset_hw_vf()
77 hw->api_version = ixgbe_mbox_api_10; in ixgbevf_reset_hw_vf()
83 while (!mbx->ops.check_for_rst(hw) && timeout) { in ixgbevf_reset_hw_vf()
84 timeout--; in ixgbevf_reset_hw_vf()
92 mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; in ixgbevf_reset_hw_vf()
95 mbx->ops.write_posted(hw, msgbuf, 1); in ixgbevf_reset_hw_vf()
101 * on the mac address in word 3 in ixgbevf_reset_hw_vf()
103 ret_val = mbx->ops.read_posted(hw, msgbuf, IXGBE_VF_PERMADDR_MSG_LEN); in ixgbevf_reset_hw_vf()
108 * to indicate that no MAC address has yet been assigned for in ixgbevf_reset_hw_vf()
116 ether_addr_copy(hw->mac.perm_addr, addr); in ixgbevf_reset_hw_vf()
118 hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD]; in ixgbevf_reset_hw_vf()
124 * ixgbevf_hv_reset_hw_vf - reset via Hyper-V
127 * Hyper-V variant; the VF/PF communication is through the PCI
133 struct ixgbevf_adapter *adapter = hw->back; in ixgbevf_hv_reset_hw_vf()
137 pci_read_config_byte(adapter->pdev, in ixgbevf_hv_reset_hw_vf()
139 &hw->mac.perm_addr[i]); in ixgbevf_hv_reset_hw_vf()
142 pr_err("PCI_MMCONFIG needs to be enabled for Hyper-V\n"); in ixgbevf_hv_reset_hw_vf()
143 return -EOPNOTSUPP; in ixgbevf_hv_reset_hw_vf()
148 * ixgbevf_stop_hw_vf - Generic stop Tx/Rx units
165 hw->adapter_stopped = true; in ixgbevf_stop_hw_vf()
168 number_of_queues = hw->mac.max_rx_queues; in ixgbevf_stop_hw_vf()
186 number_of_queues = hw->mac.max_tx_queues; in ixgbevf_stop_hw_vf()
199 * ixgbevf_mta_vector - Determines bit-vector in multicast table to set
201 * @mc_addr: the multicast address
203 * Extracts the 12 bits, from a multicast address, to determine which
204 * bit-vector to set in the multicast table. The hardware uses 12 bits, from
205 * incoming Rx multicast addresses, to determine the bit-vector to check in
206 * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
214 switch (hw->mac.mc_filter_type) { in ixgbevf_mta_vector()
215 case 0: /* use bits [47:36] of the address */ in ixgbevf_mta_vector()
218 case 1: /* use bits [46:35] of the address */ in ixgbevf_mta_vector()
221 case 2: /* use bits [45:34] of the address */ in ixgbevf_mta_vector()
224 case 3: /* use bits [43:32] of the address */ in ixgbevf_mta_vector()
231 /* vector can only be 12-bits or boundary will be exceeded */ in ixgbevf_mta_vector()
237 * ixgbevf_get_mac_addr_vf - Read device MAC address
239 * @mac_addr: pointer to storage for retrieved MAC address
243 ether_addr_copy(mac_addr, hw->mac.perm_addr); in ixgbevf_get_mac_addr_vf()
273 return -ENOMEM; in ixgbevf_set_uc_addr_vf()
281 return -EOPNOTSUPP; in ixgbevf_hv_set_uc_addr_vf()
285 * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents.
293 * if API doesn't support this operation - (-EOPNOTSUPP).
313 switch (hw->api_version) { in ixgbevf_get_reta_locked()
317 if (hw->mac.type < ixgbe_mac_X550_vf) in ixgbevf_get_reta_locked()
321 return -EOPNOTSUPP; in ixgbevf_get_reta_locked()
326 err = hw->mbx.ops.write_posted(hw, msgbuf, 1); in ixgbevf_get_reta_locked()
331 err = hw->mbx.ops.read_posted(hw, msgbuf, dwords + 1); in ixgbevf_get_reta_locked()
338 /* If the operation has been refused by a PF return -EPERM */ in ixgbevf_get_reta_locked()
340 return -EPERM; in ixgbevf_get_reta_locked()
361 * ixgbevf_get_rss_key_locked - get the RSS Random Key
368 * if API doesn't support this operation - (-EOPNOTSUPP).
381 switch (hw->api_version) { in ixgbevf_get_rss_key_locked()
385 if (hw->mac.type < ixgbe_mac_X550_vf) in ixgbevf_get_rss_key_locked()
389 return -EOPNOTSUPP; in ixgbevf_get_rss_key_locked()
393 err = hw->mbx.ops.write_posted(hw, msgbuf, 1); in ixgbevf_get_rss_key_locked()
398 err = hw->mbx.ops.read_posted(hw, msgbuf, 11); in ixgbevf_get_rss_key_locked()
405 /* If the operation has been refused by a PF return -EPERM */ in ixgbevf_get_rss_key_locked()
407 return -EPERM; in ixgbevf_get_rss_key_locked()
422 * ixgbevf_set_rar_vf - set device MAC address
424 * @index: Receive address register to write
425 * @addr: Address to put into receive address register
443 /* if nacked the address was rejected, use "perm_addr" */ in ixgbevf_set_rar_vf()
446 ixgbevf_get_mac_addr_vf(hw, hw->mac.addr); in ixgbevf_set_rar_vf()
454 * ixgbevf_hv_set_rar_vf - set device MAC address Hyper-V variant
456 * @index: Receive address register to write
457 * @addr: Address to put into receive address register
460 * We don't really allow setting the device MAC address. However,
461 * if the address being set is the permanent MAC address we will
467 if (ether_addr_equal(addr, hw->mac.perm_addr)) in ixgbevf_hv_set_rar_vf()
470 return -EOPNOTSUPP; in ixgbevf_hv_set_rar_vf()
474 * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses
493 * It would be unusual for a server to request that many multi-cast in ixgbevf_update_mc_addr_list_vf()
507 if (is_link_local_ether_addr(ha->addr)) in ixgbevf_update_mc_addr_list_vf()
510 vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); in ixgbevf_update_mc_addr_list_vf()
518 * ixgbevf_hv_update_mc_addr_list_vf - stub
522 * Hyper-V variant - just a stub.
527 return -EOPNOTSUPP; in ixgbevf_hv_update_mc_addr_list_vf()
531 * ixgbevf_update_xcast_mode - Update Multicast mode
542 switch (hw->api_version) { in ixgbevf_update_xcast_mode()
546 return -EOPNOTSUPP; in ixgbevf_update_xcast_mode()
552 return -EOPNOTSUPP; in ixgbevf_update_xcast_mode()
565 return -EPERM; in ixgbevf_update_xcast_mode()
571 * ixgbevf_hv_update_xcast_mode - stub
575 * Hyper-V variant - just a stub.
579 return -EOPNOTSUPP; in ixgbevf_hv_update_xcast_mode()
583 * ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
617 * ixgbevf_hv_set_vfta_vf - * Hyper-V variant - just a stub.
626 return -EOPNOTSUPP; in ixgbevf_hv_set_vfta_vf()
630 * ixgbevf_setup_mac_link_vf - Setup MAC link settings
647 * ixgbevf_check_mac_link_vf - Get link/speed status
660 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_check_mac_link_vf()
661 struct ixgbe_mac_info *mac = &hw->mac; in ixgbevf_check_mac_link_vf() local
667 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in ixgbevf_check_mac_link_vf()
668 mac->get_link_status = true; in ixgbevf_check_mac_link_vf()
670 if (!mac->get_link_status) in ixgbevf_check_mac_link_vf()
681 if (mac->type == ixgbe_mac_82599_vf) { in ixgbevf_check_mac_link_vf()
708 if (mbx->ops.read(hw, &in_msg, 1)) in ixgbevf_check_mac_link_vf()
714 ret_val = -1; in ixgbevf_check_mac_link_vf()
719 if (!mbx->timeout) { in ixgbevf_check_mac_link_vf()
720 ret_val = -1; in ixgbevf_check_mac_link_vf()
727 mac->get_link_status = false; in ixgbevf_check_mac_link_vf()
730 *link_up = !mac->get_link_status; in ixgbevf_check_mac_link_vf()
735 * ixgbevf_hv_check_mac_link_vf - check link
741 * Hyper-V variant; there is no mailbox communication.
748 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_hv_check_mac_link_vf()
749 struct ixgbe_mac_info *mac = &hw->mac; in ixgbevf_hv_check_mac_link_vf() local
753 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in ixgbevf_hv_check_mac_link_vf()
754 mac->get_link_status = true; in ixgbevf_hv_check_mac_link_vf()
756 if (!mac->get_link_status) in ixgbevf_hv_check_mac_link_vf()
767 if (mac->type == ixgbe_mac_82599_vf) { in ixgbevf_hv_check_mac_link_vf()
794 mac->get_link_status = false; in ixgbevf_hv_check_mac_link_vf()
797 *link_up = !mac->get_link_status; in ixgbevf_hv_check_mac_link_vf()
802 * ixgbevf_set_rlpml_vf - Set the maximum receive packet length
826 * ixgbevf_hv_set_rlpml_vf - Set the maximum receive packet length
829 * Hyper-V variant.
835 /* If we are on Hyper-V, we implement this functionality in ixgbevf_hv_set_rlpml_vf()
847 * ixgbevf_negotiate_api_version_vf - Negotiate supported API version
867 hw->api_version = api; in ixgbevf_negotiate_api_version_vf()
878 * ixgbevf_hv_negotiate_api_version_vf - Negotiate supported API version
881 * Hyper-V version - only ixgbe_mbox_api_10 supported.
885 /* Hyper-V only supports api version ixgbe_mbox_api_10 */ in ixgbevf_hv_negotiate_api_version_vf()
899 switch (hw->api_version) { in ixgbevf_get_queues()
925 hw->mac.max_tx_queues = msg[IXGBE_VF_TX_QUEUES]; in ixgbevf_get_queues()
926 if (hw->mac.max_tx_queues == 0 || in ixgbevf_get_queues()
927 hw->mac.max_tx_queues > IXGBE_VF_MAX_TX_QUEUES) in ixgbevf_get_queues()
928 hw->mac.max_tx_queues = IXGBE_VF_MAX_TX_QUEUES; in ixgbevf_get_queues()
930 hw->mac.max_rx_queues = msg[IXGBE_VF_RX_QUEUES]; in ixgbevf_get_queues()
931 if (hw->mac.max_rx_queues == 0 || in ixgbevf_get_queues()
932 hw->mac.max_rx_queues > IXGBE_VF_MAX_RX_QUEUES) in ixgbevf_get_queues()
933 hw->mac.max_rx_queues = IXGBE_VF_MAX_RX_QUEUES; in ixgbevf_get_queues()
937 if (*num_tcs > hw->mac.max_rx_queues) in ixgbevf_get_queues()
941 /* default to queue 0 on out-of-bounds queue number */ in ixgbevf_get_queues()
942 if (*default_tc >= hw->mac.max_tx_queues) in ixgbevf_get_queues()
984 .mac = ixgbe_mac_82599_vf,
989 .mac = ixgbe_mac_82599_vf,
994 .mac = ixgbe_mac_X540_vf,
999 .mac = ixgbe_mac_X540_vf,
1004 .mac = ixgbe_mac_X550_vf,
1009 .mac = ixgbe_mac_X550_vf,
1014 .mac = ixgbe_mac_X550EM_x_vf,
1019 .mac = ixgbe_mac_X550EM_x_vf,
1024 .mac = ixgbe_mac_x550em_a_vf,