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 * Hyper-V variant; the VF/PF communication is through the PCI
131 struct ixgbevf_adapter *adapter = hw->back; in ixgbevf_hv_reset_hw_vf()
135 pci_read_config_byte(adapter->pdev, in ixgbevf_hv_reset_hw_vf()
137 &hw->mac.perm_addr[i]); in ixgbevf_hv_reset_hw_vf()
140 pr_err("PCI_MMCONFIG needs to be enabled for Hyper-V\n"); in ixgbevf_hv_reset_hw_vf()
141 return -EOPNOTSUPP; in ixgbevf_hv_reset_hw_vf()
146 * ixgbevf_stop_hw_vf - Generic stop Tx/Rx units
163 hw->adapter_stopped = true; in ixgbevf_stop_hw_vf()
166 number_of_queues = hw->mac.max_rx_queues; in ixgbevf_stop_hw_vf()
184 number_of_queues = hw->mac.max_tx_queues; in ixgbevf_stop_hw_vf()
197 * ixgbevf_mta_vector - Determines bit-vector in multicast table to set
199 * @mc_addr: the multicast address
201 * Extracts the 12 bits, from a multicast address, to determine which
202 * bit-vector to set in the multicast table. The hardware uses 12 bits, from
203 * incoming Rx multicast addresses, to determine the bit-vector to check in
204 * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set
212 switch (hw->mac.mc_filter_type) { in ixgbevf_mta_vector()
213 case 0: /* use bits [47:36] of the address */ in ixgbevf_mta_vector()
216 case 1: /* use bits [46:35] of the address */ in ixgbevf_mta_vector()
219 case 2: /* use bits [45:34] of the address */ in ixgbevf_mta_vector()
222 case 3: /* use bits [43:32] of the address */ in ixgbevf_mta_vector()
229 /* vector can only be 12-bits or boundary will be exceeded */ in ixgbevf_mta_vector()
235 * ixgbevf_get_mac_addr_vf - Read device MAC address
237 * @mac_addr: pointer to storage for retrieved MAC address
241 ether_addr_copy(mac_addr, hw->mac.perm_addr); in ixgbevf_get_mac_addr_vf()
271 return -ENOMEM; in ixgbevf_set_uc_addr_vf()
279 return -EOPNOTSUPP; in ixgbevf_hv_set_uc_addr_vf()
283 * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents.
291 * if API doesn't support this operation - (-EOPNOTSUPP).
311 switch (hw->api_version) { in ixgbevf_get_reta_locked()
315 if (hw->mac.type < ixgbe_mac_X550_vf) in ixgbevf_get_reta_locked()
319 return -EOPNOTSUPP; in ixgbevf_get_reta_locked()
324 err = hw->mbx.ops.write_posted(hw, msgbuf, 1); in ixgbevf_get_reta_locked()
329 err = hw->mbx.ops.read_posted(hw, msgbuf, dwords + 1); in ixgbevf_get_reta_locked()
336 /* If the operation has been refused by a PF return -EPERM */ in ixgbevf_get_reta_locked()
338 return -EPERM; in ixgbevf_get_reta_locked()
359 * ixgbevf_get_rss_key_locked - get the RSS Random Key
366 * if API doesn't support this operation - (-EOPNOTSUPP).
379 switch (hw->api_version) { in ixgbevf_get_rss_key_locked()
383 if (hw->mac.type < ixgbe_mac_X550_vf) in ixgbevf_get_rss_key_locked()
387 return -EOPNOTSUPP; in ixgbevf_get_rss_key_locked()
391 err = hw->mbx.ops.write_posted(hw, msgbuf, 1); in ixgbevf_get_rss_key_locked()
396 err = hw->mbx.ops.read_posted(hw, msgbuf, 11); in ixgbevf_get_rss_key_locked()
403 /* If the operation has been refused by a PF return -EPERM */ in ixgbevf_get_rss_key_locked()
405 return -EPERM; in ixgbevf_get_rss_key_locked()
420 * ixgbevf_set_rar_vf - set device MAC address
422 * @index: Receive address register to write
423 * @addr: Address to put into receive address register
441 /* if nacked the address was rejected, use "perm_addr" */ in ixgbevf_set_rar_vf()
444 ixgbevf_get_mac_addr_vf(hw, hw->mac.addr); in ixgbevf_set_rar_vf()
452 * ixgbevf_hv_set_rar_vf - set device MAC address Hyper-V variant
454 * @index: Receive address register to write
455 * @addr: Address to put into receive address register
458 * We don't really allow setting the device MAC address. However,
459 * if the address being set is the permanent MAC address we will
465 if (ether_addr_equal(addr, hw->mac.perm_addr)) in ixgbevf_hv_set_rar_vf()
468 return -EOPNOTSUPP; in ixgbevf_hv_set_rar_vf()
472 * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses
491 * It would be unusual for a server to request that many multi-cast in ixgbevf_update_mc_addr_list_vf()
505 if (is_link_local_ether_addr(ha->addr)) in ixgbevf_update_mc_addr_list_vf()
508 vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); in ixgbevf_update_mc_addr_list_vf()
516 * Hyper-V variant - just a stub.
523 return -EOPNOTSUPP; in ixgbevf_hv_update_mc_addr_list_vf()
527 * ixgbevf_update_xcast_mode - Update Multicast mode
538 switch (hw->api_version) { in ixgbevf_update_xcast_mode()
542 return -EOPNOTSUPP; in ixgbevf_update_xcast_mode()
548 return -EOPNOTSUPP; in ixgbevf_update_xcast_mode()
561 return -EPERM; in ixgbevf_update_xcast_mode()
567 * Hyper-V variant - just a stub.
573 return -EOPNOTSUPP; in ixgbevf_hv_update_xcast_mode()
577 * ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
611 * Hyper-V variant - just a stub.
620 return -EOPNOTSUPP; in ixgbevf_hv_set_vfta_vf()
624 * ixgbevf_setup_mac_link_vf - Setup MAC link settings
641 * ixgbevf_check_mac_link_vf - Get link/speed status
654 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_check_mac_link_vf()
655 struct ixgbe_mac_info *mac = &hw->mac; in ixgbevf_check_mac_link_vf() local
661 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in ixgbevf_check_mac_link_vf()
662 mac->get_link_status = true; in ixgbevf_check_mac_link_vf()
664 if (!mac->get_link_status) in ixgbevf_check_mac_link_vf()
675 if (mac->type == ixgbe_mac_82599_vf) { in ixgbevf_check_mac_link_vf()
702 if (mbx->ops.read(hw, &in_msg, 1)) in ixgbevf_check_mac_link_vf()
708 ret_val = -1; in ixgbevf_check_mac_link_vf()
713 if (!mbx->timeout) { in ixgbevf_check_mac_link_vf()
714 ret_val = -1; in ixgbevf_check_mac_link_vf()
721 mac->get_link_status = false; in ixgbevf_check_mac_link_vf()
724 *link_up = !mac->get_link_status; in ixgbevf_check_mac_link_vf()
729 * Hyper-V variant; there is no mailbox communication.
740 struct ixgbe_mbx_info *mbx = &hw->mbx; in ixgbevf_hv_check_mac_link_vf()
741 struct ixgbe_mac_info *mac = &hw->mac; in ixgbevf_hv_check_mac_link_vf() local
745 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in ixgbevf_hv_check_mac_link_vf()
746 mac->get_link_status = true; in ixgbevf_hv_check_mac_link_vf()
748 if (!mac->get_link_status) in ixgbevf_hv_check_mac_link_vf()
759 if (mac->type == ixgbe_mac_82599_vf) { in ixgbevf_hv_check_mac_link_vf()
786 mac->get_link_status = false; in ixgbevf_hv_check_mac_link_vf()
789 *link_up = !mac->get_link_status; in ixgbevf_hv_check_mac_link_vf()
794 * ixgbevf_set_rlpml_vf - Set the maximum receive packet length
818 * ixgbevf_hv_set_rlpml_vf - Set the maximum receive packet length
821 * Hyper-V variant.
827 /* If we are on Hyper-V, we implement this functionality in ixgbevf_hv_set_rlpml_vf()
839 * ixgbevf_negotiate_api_version_vf - Negotiate supported API version
859 hw->api_version = api; in ixgbevf_negotiate_api_version_vf()
870 * ixgbevf_hv_negotiate_api_version_vf - Negotiate supported API version
873 * Hyper-V version - only ixgbe_mbox_api_10 supported.
877 /* Hyper-V only supports api version ixgbe_mbox_api_10 */ in ixgbevf_hv_negotiate_api_version_vf()
891 switch (hw->api_version) { in ixgbevf_get_queues()
917 hw->mac.max_tx_queues = msg[IXGBE_VF_TX_QUEUES]; in ixgbevf_get_queues()
918 if (hw->mac.max_tx_queues == 0 || in ixgbevf_get_queues()
919 hw->mac.max_tx_queues > IXGBE_VF_MAX_TX_QUEUES) in ixgbevf_get_queues()
920 hw->mac.max_tx_queues = IXGBE_VF_MAX_TX_QUEUES; in ixgbevf_get_queues()
922 hw->mac.max_rx_queues = msg[IXGBE_VF_RX_QUEUES]; in ixgbevf_get_queues()
923 if (hw->mac.max_rx_queues == 0 || in ixgbevf_get_queues()
924 hw->mac.max_rx_queues > IXGBE_VF_MAX_RX_QUEUES) in ixgbevf_get_queues()
925 hw->mac.max_rx_queues = IXGBE_VF_MAX_RX_QUEUES; in ixgbevf_get_queues()
929 if (*num_tcs > hw->mac.max_rx_queues) in ixgbevf_get_queues()
933 /* default to queue 0 on out-of-bounds queue number */ in ixgbevf_get_queues()
934 if (*default_tc >= hw->mac.max_tx_queues) in ixgbevf_get_queues()
976 .mac = ixgbe_mac_82599_vf,
981 .mac = ixgbe_mac_82599_vf,
986 .mac = ixgbe_mac_X540_vf,
991 .mac = ixgbe_mac_X540_vf,
996 .mac = ixgbe_mac_X550_vf,
1001 .mac = ixgbe_mac_X550_vf,
1006 .mac = ixgbe_mac_X550EM_x_vf,
1011 .mac = ixgbe_mac_X550EM_x_vf,
1016 .mac = ixgbe_mac_x550em_a_vf,