162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci/* Copyright(c) 1999 - 2018 Intel Corporation. */ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#include "vf.h" 562306a36Sopenharmony_ci#include "ixgbevf.h" 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci/* On Hyper-V, to reset, we need to read from this offset 862306a36Sopenharmony_ci * from the PCI config space. This is the mechanism used on 962306a36Sopenharmony_ci * Hyper-V to support PF/VF communication. 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci#define IXGBE_HV_RESET_OFFSET 0x201 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_cistatic inline s32 ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, u32 *msg, 1462306a36Sopenharmony_ci u32 *retmsg, u16 size) 1562306a36Sopenharmony_ci{ 1662306a36Sopenharmony_ci s32 retval = ixgbevf_write_mbx(hw, msg, size); 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci if (retval) 1962306a36Sopenharmony_ci return retval; 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci return ixgbevf_poll_mbx(hw, retmsg, size); 2262306a36Sopenharmony_ci} 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci/** 2562306a36Sopenharmony_ci * ixgbevf_start_hw_vf - Prepare hardware for Tx/Rx 2662306a36Sopenharmony_ci * @hw: pointer to hardware structure 2762306a36Sopenharmony_ci * 2862306a36Sopenharmony_ci * Starts the hardware by filling the bus info structure and media type, clears 2962306a36Sopenharmony_ci * all on chip counters, initializes receive address registers, multicast 3062306a36Sopenharmony_ci * table, VLAN filter table, calls routine to set up link and flow control 3162306a36Sopenharmony_ci * settings, and leaves transmit and receive units disabled and uninitialized 3262306a36Sopenharmony_ci **/ 3362306a36Sopenharmony_cistatic s32 ixgbevf_start_hw_vf(struct ixgbe_hw *hw) 3462306a36Sopenharmony_ci{ 3562306a36Sopenharmony_ci /* Clear adapter stopped flag */ 3662306a36Sopenharmony_ci hw->adapter_stopped = false; 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci return 0; 3962306a36Sopenharmony_ci} 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci/** 4262306a36Sopenharmony_ci * ixgbevf_init_hw_vf - virtual function hardware initialization 4362306a36Sopenharmony_ci * @hw: pointer to hardware structure 4462306a36Sopenharmony_ci * 4562306a36Sopenharmony_ci * Initialize the hardware by resetting the hardware and then starting 4662306a36Sopenharmony_ci * the hardware 4762306a36Sopenharmony_ci **/ 4862306a36Sopenharmony_cistatic s32 ixgbevf_init_hw_vf(struct ixgbe_hw *hw) 4962306a36Sopenharmony_ci{ 5062306a36Sopenharmony_ci s32 status = hw->mac.ops.start_hw(hw); 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci hw->mac.ops.get_mac_addr(hw, hw->mac.addr); 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci return status; 5562306a36Sopenharmony_ci} 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci/** 5862306a36Sopenharmony_ci * ixgbevf_reset_hw_vf - Performs hardware reset 5962306a36Sopenharmony_ci * @hw: pointer to hardware structure 6062306a36Sopenharmony_ci * 6162306a36Sopenharmony_ci * Resets the hardware by resetting the transmit and receive units, masks and 6262306a36Sopenharmony_ci * clears all interrupts. 6362306a36Sopenharmony_ci **/ 6462306a36Sopenharmony_cistatic s32 ixgbevf_reset_hw_vf(struct ixgbe_hw *hw) 6562306a36Sopenharmony_ci{ 6662306a36Sopenharmony_ci struct ixgbe_mbx_info *mbx = &hw->mbx; 6762306a36Sopenharmony_ci u32 timeout = IXGBE_VF_INIT_TIMEOUT; 6862306a36Sopenharmony_ci u32 msgbuf[IXGBE_VF_PERMADDR_MSG_LEN]; 6962306a36Sopenharmony_ci u8 *addr = (u8 *)(&msgbuf[1]); 7062306a36Sopenharmony_ci s32 ret_val; 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci /* Call adapter stop to disable tx/rx and clear interrupts */ 7362306a36Sopenharmony_ci hw->mac.ops.stop_adapter(hw); 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci /* reset the api version */ 7662306a36Sopenharmony_ci hw->api_version = ixgbe_mbox_api_10; 7762306a36Sopenharmony_ci hw->mbx.ops.init_params(hw); 7862306a36Sopenharmony_ci memcpy(&hw->mbx.ops, &ixgbevf_mbx_ops_legacy, 7962306a36Sopenharmony_ci sizeof(struct ixgbe_mbx_operations)); 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ci IXGBE_WRITE_REG(hw, IXGBE_VFCTRL, IXGBE_CTRL_RST); 8262306a36Sopenharmony_ci IXGBE_WRITE_FLUSH(hw); 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ci /* we cannot reset while the RSTI / RSTD bits are asserted */ 8562306a36Sopenharmony_ci while (!mbx->ops.check_for_rst(hw) && timeout) { 8662306a36Sopenharmony_ci timeout--; 8762306a36Sopenharmony_ci udelay(5); 8862306a36Sopenharmony_ci } 8962306a36Sopenharmony_ci 9062306a36Sopenharmony_ci if (!timeout) 9162306a36Sopenharmony_ci return IXGBE_ERR_RESET_FAILED; 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci /* mailbox timeout can now become active */ 9462306a36Sopenharmony_ci mbx->timeout = IXGBE_VF_MBX_INIT_TIMEOUT; 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_RESET; 9762306a36Sopenharmony_ci ixgbevf_write_mbx(hw, msgbuf, 1); 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci mdelay(10); 10062306a36Sopenharmony_ci 10162306a36Sopenharmony_ci /* set our "perm_addr" based on info provided by PF 10262306a36Sopenharmony_ci * also set up the mc_filter_type which is piggy backed 10362306a36Sopenharmony_ci * on the mac address in word 3 10462306a36Sopenharmony_ci */ 10562306a36Sopenharmony_ci ret_val = ixgbevf_poll_mbx(hw, msgbuf, IXGBE_VF_PERMADDR_MSG_LEN); 10662306a36Sopenharmony_ci if (ret_val) 10762306a36Sopenharmony_ci return ret_val; 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci /* New versions of the PF may NACK the reset return message 11062306a36Sopenharmony_ci * to indicate that no MAC address has yet been assigned for 11162306a36Sopenharmony_ci * the VF. 11262306a36Sopenharmony_ci */ 11362306a36Sopenharmony_ci if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS) && 11462306a36Sopenharmony_ci msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_FAILURE)) 11562306a36Sopenharmony_ci return IXGBE_ERR_INVALID_MAC_ADDR; 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS)) 11862306a36Sopenharmony_ci ether_addr_copy(hw->mac.perm_addr, addr); 11962306a36Sopenharmony_ci 12062306a36Sopenharmony_ci hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD]; 12162306a36Sopenharmony_ci 12262306a36Sopenharmony_ci return 0; 12362306a36Sopenharmony_ci} 12462306a36Sopenharmony_ci 12562306a36Sopenharmony_ci/** 12662306a36Sopenharmony_ci * ixgbevf_hv_reset_hw_vf - reset via Hyper-V 12762306a36Sopenharmony_ci * @hw: pointer to private hardware struct 12862306a36Sopenharmony_ci * 12962306a36Sopenharmony_ci * Hyper-V variant; the VF/PF communication is through the PCI 13062306a36Sopenharmony_ci * config space. 13162306a36Sopenharmony_ci */ 13262306a36Sopenharmony_cistatic s32 ixgbevf_hv_reset_hw_vf(struct ixgbe_hw *hw) 13362306a36Sopenharmony_ci{ 13462306a36Sopenharmony_ci#if IS_ENABLED(CONFIG_PCI_MMCONFIG) 13562306a36Sopenharmony_ci struct ixgbevf_adapter *adapter = hw->back; 13662306a36Sopenharmony_ci int i; 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci for (i = 0; i < 6; i++) 13962306a36Sopenharmony_ci pci_read_config_byte(adapter->pdev, 14062306a36Sopenharmony_ci (i + IXGBE_HV_RESET_OFFSET), 14162306a36Sopenharmony_ci &hw->mac.perm_addr[i]); 14262306a36Sopenharmony_ci return 0; 14362306a36Sopenharmony_ci#else 14462306a36Sopenharmony_ci pr_err("PCI_MMCONFIG needs to be enabled for Hyper-V\n"); 14562306a36Sopenharmony_ci return -EOPNOTSUPP; 14662306a36Sopenharmony_ci#endif 14762306a36Sopenharmony_ci} 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci/** 15062306a36Sopenharmony_ci * ixgbevf_stop_hw_vf - Generic stop Tx/Rx units 15162306a36Sopenharmony_ci * @hw: pointer to hardware structure 15262306a36Sopenharmony_ci * 15362306a36Sopenharmony_ci * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts, 15462306a36Sopenharmony_ci * disables transmit and receive units. The adapter_stopped flag is used by 15562306a36Sopenharmony_ci * the shared code and drivers to determine if the adapter is in a stopped 15662306a36Sopenharmony_ci * state and should not touch the hardware. 15762306a36Sopenharmony_ci **/ 15862306a36Sopenharmony_cistatic s32 ixgbevf_stop_hw_vf(struct ixgbe_hw *hw) 15962306a36Sopenharmony_ci{ 16062306a36Sopenharmony_ci u32 number_of_queues; 16162306a36Sopenharmony_ci u32 reg_val; 16262306a36Sopenharmony_ci u16 i; 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci /* Set the adapter_stopped flag so other driver functions stop touching 16562306a36Sopenharmony_ci * the hardware 16662306a36Sopenharmony_ci */ 16762306a36Sopenharmony_ci hw->adapter_stopped = true; 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci /* Disable the receive unit by stopped each queue */ 17062306a36Sopenharmony_ci number_of_queues = hw->mac.max_rx_queues; 17162306a36Sopenharmony_ci for (i = 0; i < number_of_queues; i++) { 17262306a36Sopenharmony_ci reg_val = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); 17362306a36Sopenharmony_ci if (reg_val & IXGBE_RXDCTL_ENABLE) { 17462306a36Sopenharmony_ci reg_val &= ~IXGBE_RXDCTL_ENABLE; 17562306a36Sopenharmony_ci IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), reg_val); 17662306a36Sopenharmony_ci } 17762306a36Sopenharmony_ci } 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci IXGBE_WRITE_FLUSH(hw); 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci /* Clear interrupt mask to stop from interrupts being generated */ 18262306a36Sopenharmony_ci IXGBE_WRITE_REG(hw, IXGBE_VTEIMC, IXGBE_VF_IRQ_CLEAR_MASK); 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci /* Clear any pending interrupts */ 18562306a36Sopenharmony_ci IXGBE_READ_REG(hw, IXGBE_VTEICR); 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ci /* Disable the transmit unit. Each queue must be disabled. */ 18862306a36Sopenharmony_ci number_of_queues = hw->mac.max_tx_queues; 18962306a36Sopenharmony_ci for (i = 0; i < number_of_queues; i++) { 19062306a36Sopenharmony_ci reg_val = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i)); 19162306a36Sopenharmony_ci if (reg_val & IXGBE_TXDCTL_ENABLE) { 19262306a36Sopenharmony_ci reg_val &= ~IXGBE_TXDCTL_ENABLE; 19362306a36Sopenharmony_ci IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), reg_val); 19462306a36Sopenharmony_ci } 19562306a36Sopenharmony_ci } 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ci return 0; 19862306a36Sopenharmony_ci} 19962306a36Sopenharmony_ci 20062306a36Sopenharmony_ci/** 20162306a36Sopenharmony_ci * ixgbevf_mta_vector - Determines bit-vector in multicast table to set 20262306a36Sopenharmony_ci * @hw: pointer to hardware structure 20362306a36Sopenharmony_ci * @mc_addr: the multicast address 20462306a36Sopenharmony_ci * 20562306a36Sopenharmony_ci * Extracts the 12 bits, from a multicast address, to determine which 20662306a36Sopenharmony_ci * bit-vector to set in the multicast table. The hardware uses 12 bits, from 20762306a36Sopenharmony_ci * incoming Rx multicast addresses, to determine the bit-vector to check in 20862306a36Sopenharmony_ci * the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set 20962306a36Sopenharmony_ci * by the MO field of the MCSTCTRL. The MO field is set during initialization 21062306a36Sopenharmony_ci * to mc_filter_type. 21162306a36Sopenharmony_ci **/ 21262306a36Sopenharmony_cistatic s32 ixgbevf_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr) 21362306a36Sopenharmony_ci{ 21462306a36Sopenharmony_ci u32 vector = 0; 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci switch (hw->mac.mc_filter_type) { 21762306a36Sopenharmony_ci case 0: /* use bits [47:36] of the address */ 21862306a36Sopenharmony_ci vector = ((mc_addr[4] >> 4) | (((u16)mc_addr[5]) << 4)); 21962306a36Sopenharmony_ci break; 22062306a36Sopenharmony_ci case 1: /* use bits [46:35] of the address */ 22162306a36Sopenharmony_ci vector = ((mc_addr[4] >> 3) | (((u16)mc_addr[5]) << 5)); 22262306a36Sopenharmony_ci break; 22362306a36Sopenharmony_ci case 2: /* use bits [45:34] of the address */ 22462306a36Sopenharmony_ci vector = ((mc_addr[4] >> 2) | (((u16)mc_addr[5]) << 6)); 22562306a36Sopenharmony_ci break; 22662306a36Sopenharmony_ci case 3: /* use bits [43:32] of the address */ 22762306a36Sopenharmony_ci vector = ((mc_addr[4]) | (((u16)mc_addr[5]) << 8)); 22862306a36Sopenharmony_ci break; 22962306a36Sopenharmony_ci default: /* Invalid mc_filter_type */ 23062306a36Sopenharmony_ci break; 23162306a36Sopenharmony_ci } 23262306a36Sopenharmony_ci 23362306a36Sopenharmony_ci /* vector can only be 12-bits or boundary will be exceeded */ 23462306a36Sopenharmony_ci vector &= 0xFFF; 23562306a36Sopenharmony_ci return vector; 23662306a36Sopenharmony_ci} 23762306a36Sopenharmony_ci 23862306a36Sopenharmony_ci/** 23962306a36Sopenharmony_ci * ixgbevf_get_mac_addr_vf - Read device MAC address 24062306a36Sopenharmony_ci * @hw: pointer to the HW structure 24162306a36Sopenharmony_ci * @mac_addr: pointer to storage for retrieved MAC address 24262306a36Sopenharmony_ci **/ 24362306a36Sopenharmony_cistatic s32 ixgbevf_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr) 24462306a36Sopenharmony_ci{ 24562306a36Sopenharmony_ci ether_addr_copy(mac_addr, hw->mac.perm_addr); 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ci return 0; 24862306a36Sopenharmony_ci} 24962306a36Sopenharmony_ci 25062306a36Sopenharmony_cistatic s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr) 25162306a36Sopenharmony_ci{ 25262306a36Sopenharmony_ci u32 msgbuf[3], msgbuf_chk; 25362306a36Sopenharmony_ci u8 *msg_addr = (u8 *)(&msgbuf[1]); 25462306a36Sopenharmony_ci s32 ret_val; 25562306a36Sopenharmony_ci 25662306a36Sopenharmony_ci memset(msgbuf, 0, sizeof(msgbuf)); 25762306a36Sopenharmony_ci /* If index is one then this is the start of a new list and needs 25862306a36Sopenharmony_ci * indication to the PF so it can do it's own list management. 25962306a36Sopenharmony_ci * If it is zero then that tells the PF to just clear all of 26062306a36Sopenharmony_ci * this VF's macvlans and there is no new list. 26162306a36Sopenharmony_ci */ 26262306a36Sopenharmony_ci msgbuf[0] |= index << IXGBE_VT_MSGINFO_SHIFT; 26362306a36Sopenharmony_ci msgbuf[0] |= IXGBE_VF_SET_MACVLAN; 26462306a36Sopenharmony_ci msgbuf_chk = msgbuf[0]; 26562306a36Sopenharmony_ci 26662306a36Sopenharmony_ci if (addr) 26762306a36Sopenharmony_ci ether_addr_copy(msg_addr, addr); 26862306a36Sopenharmony_ci 26962306a36Sopenharmony_ci ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 27062306a36Sopenharmony_ci ARRAY_SIZE(msgbuf)); 27162306a36Sopenharmony_ci if (!ret_val) { 27262306a36Sopenharmony_ci msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; 27362306a36Sopenharmony_ci 27462306a36Sopenharmony_ci if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_FAILURE)) 27562306a36Sopenharmony_ci return -ENOMEM; 27662306a36Sopenharmony_ci } 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci return ret_val; 27962306a36Sopenharmony_ci} 28062306a36Sopenharmony_ci 28162306a36Sopenharmony_cistatic s32 ixgbevf_hv_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr) 28262306a36Sopenharmony_ci{ 28362306a36Sopenharmony_ci return -EOPNOTSUPP; 28462306a36Sopenharmony_ci} 28562306a36Sopenharmony_ci 28662306a36Sopenharmony_ci/** 28762306a36Sopenharmony_ci * ixgbevf_get_reta_locked - get the RSS redirection table (RETA) contents. 28862306a36Sopenharmony_ci * @hw: pointer to hardware structure 28962306a36Sopenharmony_ci * @reta: buffer to fill with RETA contents. 29062306a36Sopenharmony_ci * @num_rx_queues: Number of Rx queues configured for this port 29162306a36Sopenharmony_ci * 29262306a36Sopenharmony_ci * The "reta" buffer should be big enough to contain 32 registers. 29362306a36Sopenharmony_ci * 29462306a36Sopenharmony_ci * Returns: 0 on success. 29562306a36Sopenharmony_ci * if API doesn't support this operation - (-EOPNOTSUPP). 29662306a36Sopenharmony_ci */ 29762306a36Sopenharmony_ciint ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues) 29862306a36Sopenharmony_ci{ 29962306a36Sopenharmony_ci int err, i, j; 30062306a36Sopenharmony_ci u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; 30162306a36Sopenharmony_ci u32 *hw_reta = &msgbuf[1]; 30262306a36Sopenharmony_ci u32 mask = 0; 30362306a36Sopenharmony_ci 30462306a36Sopenharmony_ci /* We have to use a mailbox for 82599 and x540 devices only. 30562306a36Sopenharmony_ci * For these devices RETA has 128 entries. 30662306a36Sopenharmony_ci * Also these VFs support up to 4 RSS queues. Therefore PF will compress 30762306a36Sopenharmony_ci * 16 RETA entries in each DWORD giving 2 bits to each entry. 30862306a36Sopenharmony_ci */ 30962306a36Sopenharmony_ci int dwords = IXGBEVF_82599_RETA_SIZE / 16; 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci /* We support the RSS querying for 82599 and x540 devices only. 31262306a36Sopenharmony_ci * Thus return an error if API doesn't support RETA querying or querying 31362306a36Sopenharmony_ci * is not supported for this device type. 31462306a36Sopenharmony_ci */ 31562306a36Sopenharmony_ci switch (hw->api_version) { 31662306a36Sopenharmony_ci case ixgbe_mbox_api_15: 31762306a36Sopenharmony_ci case ixgbe_mbox_api_14: 31862306a36Sopenharmony_ci case ixgbe_mbox_api_13: 31962306a36Sopenharmony_ci case ixgbe_mbox_api_12: 32062306a36Sopenharmony_ci if (hw->mac.type < ixgbe_mac_X550_vf) 32162306a36Sopenharmony_ci break; 32262306a36Sopenharmony_ci fallthrough; 32362306a36Sopenharmony_ci default: 32462306a36Sopenharmony_ci return -EOPNOTSUPP; 32562306a36Sopenharmony_ci } 32662306a36Sopenharmony_ci 32762306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_GET_RETA; 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ci err = ixgbevf_write_mbx(hw, msgbuf, 1); 33062306a36Sopenharmony_ci 33162306a36Sopenharmony_ci if (err) 33262306a36Sopenharmony_ci return err; 33362306a36Sopenharmony_ci 33462306a36Sopenharmony_ci err = ixgbevf_poll_mbx(hw, msgbuf, dwords + 1); 33562306a36Sopenharmony_ci 33662306a36Sopenharmony_ci if (err) 33762306a36Sopenharmony_ci return err; 33862306a36Sopenharmony_ci 33962306a36Sopenharmony_ci msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; 34062306a36Sopenharmony_ci 34162306a36Sopenharmony_ci /* If the operation has been refused by a PF return -EPERM */ 34262306a36Sopenharmony_ci if (msgbuf[0] == (IXGBE_VF_GET_RETA | IXGBE_VT_MSGTYPE_FAILURE)) 34362306a36Sopenharmony_ci return -EPERM; 34462306a36Sopenharmony_ci 34562306a36Sopenharmony_ci /* If we didn't get an ACK there must have been 34662306a36Sopenharmony_ci * some sort of mailbox error so we should treat it 34762306a36Sopenharmony_ci * as such. 34862306a36Sopenharmony_ci */ 34962306a36Sopenharmony_ci if (msgbuf[0] != (IXGBE_VF_GET_RETA | IXGBE_VT_MSGTYPE_SUCCESS)) 35062306a36Sopenharmony_ci return IXGBE_ERR_MBX; 35162306a36Sopenharmony_ci 35262306a36Sopenharmony_ci /* ixgbevf doesn't support more than 2 queues at the moment */ 35362306a36Sopenharmony_ci if (num_rx_queues > 1) 35462306a36Sopenharmony_ci mask = 0x1; 35562306a36Sopenharmony_ci 35662306a36Sopenharmony_ci for (i = 0; i < dwords; i++) 35762306a36Sopenharmony_ci for (j = 0; j < 16; j++) 35862306a36Sopenharmony_ci reta[i * 16 + j] = (hw_reta[i] >> (2 * j)) & mask; 35962306a36Sopenharmony_ci 36062306a36Sopenharmony_ci return 0; 36162306a36Sopenharmony_ci} 36262306a36Sopenharmony_ci 36362306a36Sopenharmony_ci/** 36462306a36Sopenharmony_ci * ixgbevf_get_rss_key_locked - get the RSS Random Key 36562306a36Sopenharmony_ci * @hw: pointer to the HW structure 36662306a36Sopenharmony_ci * @rss_key: buffer to fill with RSS Hash Key contents. 36762306a36Sopenharmony_ci * 36862306a36Sopenharmony_ci * The "rss_key" buffer should be big enough to contain 10 registers. 36962306a36Sopenharmony_ci * 37062306a36Sopenharmony_ci * Returns: 0 on success. 37162306a36Sopenharmony_ci * if API doesn't support this operation - (-EOPNOTSUPP). 37262306a36Sopenharmony_ci */ 37362306a36Sopenharmony_ciint ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key) 37462306a36Sopenharmony_ci{ 37562306a36Sopenharmony_ci int err; 37662306a36Sopenharmony_ci u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; 37762306a36Sopenharmony_ci 37862306a36Sopenharmony_ci /* We currently support the RSS Random Key retrieval for 82599 and x540 37962306a36Sopenharmony_ci * devices only. 38062306a36Sopenharmony_ci * 38162306a36Sopenharmony_ci * Thus return an error if API doesn't support RSS Random Key retrieval 38262306a36Sopenharmony_ci * or if the operation is not supported for this device type. 38362306a36Sopenharmony_ci */ 38462306a36Sopenharmony_ci switch (hw->api_version) { 38562306a36Sopenharmony_ci case ixgbe_mbox_api_15: 38662306a36Sopenharmony_ci case ixgbe_mbox_api_14: 38762306a36Sopenharmony_ci case ixgbe_mbox_api_13: 38862306a36Sopenharmony_ci case ixgbe_mbox_api_12: 38962306a36Sopenharmony_ci if (hw->mac.type < ixgbe_mac_X550_vf) 39062306a36Sopenharmony_ci break; 39162306a36Sopenharmony_ci fallthrough; 39262306a36Sopenharmony_ci default: 39362306a36Sopenharmony_ci return -EOPNOTSUPP; 39462306a36Sopenharmony_ci } 39562306a36Sopenharmony_ci 39662306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_GET_RSS_KEY; 39762306a36Sopenharmony_ci err = ixgbevf_write_mbx(hw, msgbuf, 1); 39862306a36Sopenharmony_ci 39962306a36Sopenharmony_ci if (err) 40062306a36Sopenharmony_ci return err; 40162306a36Sopenharmony_ci 40262306a36Sopenharmony_ci err = ixgbevf_poll_mbx(hw, msgbuf, 11); 40362306a36Sopenharmony_ci 40462306a36Sopenharmony_ci if (err) 40562306a36Sopenharmony_ci return err; 40662306a36Sopenharmony_ci 40762306a36Sopenharmony_ci msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; 40862306a36Sopenharmony_ci 40962306a36Sopenharmony_ci /* If the operation has been refused by a PF return -EPERM */ 41062306a36Sopenharmony_ci if (msgbuf[0] == (IXGBE_VF_GET_RSS_KEY | IXGBE_VT_MSGTYPE_FAILURE)) 41162306a36Sopenharmony_ci return -EPERM; 41262306a36Sopenharmony_ci 41362306a36Sopenharmony_ci /* If we didn't get an ACK there must have been 41462306a36Sopenharmony_ci * some sort of mailbox error so we should treat it 41562306a36Sopenharmony_ci * as such. 41662306a36Sopenharmony_ci */ 41762306a36Sopenharmony_ci if (msgbuf[0] != (IXGBE_VF_GET_RSS_KEY | IXGBE_VT_MSGTYPE_SUCCESS)) 41862306a36Sopenharmony_ci return IXGBE_ERR_MBX; 41962306a36Sopenharmony_ci 42062306a36Sopenharmony_ci memcpy(rss_key, msgbuf + 1, IXGBEVF_RSS_HASH_KEY_SIZE); 42162306a36Sopenharmony_ci 42262306a36Sopenharmony_ci return 0; 42362306a36Sopenharmony_ci} 42462306a36Sopenharmony_ci 42562306a36Sopenharmony_ci/** 42662306a36Sopenharmony_ci * ixgbevf_set_rar_vf - set device MAC address 42762306a36Sopenharmony_ci * @hw: pointer to hardware structure 42862306a36Sopenharmony_ci * @index: Receive address register to write 42962306a36Sopenharmony_ci * @addr: Address to put into receive address register 43062306a36Sopenharmony_ci * @vmdq: Unused in this implementation 43162306a36Sopenharmony_ci **/ 43262306a36Sopenharmony_cistatic s32 ixgbevf_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, 43362306a36Sopenharmony_ci u32 vmdq) 43462306a36Sopenharmony_ci{ 43562306a36Sopenharmony_ci u32 msgbuf[3]; 43662306a36Sopenharmony_ci u8 *msg_addr = (u8 *)(&msgbuf[1]); 43762306a36Sopenharmony_ci s32 ret_val; 43862306a36Sopenharmony_ci 43962306a36Sopenharmony_ci memset(msgbuf, 0, sizeof(msgbuf)); 44062306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_SET_MAC_ADDR; 44162306a36Sopenharmony_ci ether_addr_copy(msg_addr, addr); 44262306a36Sopenharmony_ci 44362306a36Sopenharmony_ci ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 44462306a36Sopenharmony_ci ARRAY_SIZE(msgbuf)); 44562306a36Sopenharmony_ci msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; 44662306a36Sopenharmony_ci 44762306a36Sopenharmony_ci /* if nacked the address was rejected, use "perm_addr" */ 44862306a36Sopenharmony_ci if (!ret_val && 44962306a36Sopenharmony_ci (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_FAILURE))) { 45062306a36Sopenharmony_ci ixgbevf_get_mac_addr_vf(hw, hw->mac.addr); 45162306a36Sopenharmony_ci return IXGBE_ERR_MBX; 45262306a36Sopenharmony_ci } 45362306a36Sopenharmony_ci 45462306a36Sopenharmony_ci return ret_val; 45562306a36Sopenharmony_ci} 45662306a36Sopenharmony_ci 45762306a36Sopenharmony_ci/** 45862306a36Sopenharmony_ci * ixgbevf_hv_set_rar_vf - set device MAC address Hyper-V variant 45962306a36Sopenharmony_ci * @hw: pointer to hardware structure 46062306a36Sopenharmony_ci * @index: Receive address register to write 46162306a36Sopenharmony_ci * @addr: Address to put into receive address register 46262306a36Sopenharmony_ci * @vmdq: Unused in this implementation 46362306a36Sopenharmony_ci * 46462306a36Sopenharmony_ci * We don't really allow setting the device MAC address. However, 46562306a36Sopenharmony_ci * if the address being set is the permanent MAC address we will 46662306a36Sopenharmony_ci * permit that. 46762306a36Sopenharmony_ci **/ 46862306a36Sopenharmony_cistatic s32 ixgbevf_hv_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, 46962306a36Sopenharmony_ci u32 vmdq) 47062306a36Sopenharmony_ci{ 47162306a36Sopenharmony_ci if (ether_addr_equal(addr, hw->mac.perm_addr)) 47262306a36Sopenharmony_ci return 0; 47362306a36Sopenharmony_ci 47462306a36Sopenharmony_ci return -EOPNOTSUPP; 47562306a36Sopenharmony_ci} 47662306a36Sopenharmony_ci 47762306a36Sopenharmony_ci/** 47862306a36Sopenharmony_ci * ixgbevf_update_mc_addr_list_vf - Update Multicast addresses 47962306a36Sopenharmony_ci * @hw: pointer to the HW structure 48062306a36Sopenharmony_ci * @netdev: pointer to net device structure 48162306a36Sopenharmony_ci * 48262306a36Sopenharmony_ci * Updates the Multicast Table Array. 48362306a36Sopenharmony_ci **/ 48462306a36Sopenharmony_cistatic s32 ixgbevf_update_mc_addr_list_vf(struct ixgbe_hw *hw, 48562306a36Sopenharmony_ci struct net_device *netdev) 48662306a36Sopenharmony_ci{ 48762306a36Sopenharmony_ci struct netdev_hw_addr *ha; 48862306a36Sopenharmony_ci u32 msgbuf[IXGBE_VFMAILBOX_SIZE]; 48962306a36Sopenharmony_ci u16 *vector_list = (u16 *)&msgbuf[1]; 49062306a36Sopenharmony_ci u32 cnt, i; 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci /* Each entry in the list uses 1 16 bit word. We have 30 49362306a36Sopenharmony_ci * 16 bit words available in our HW msg buffer (minus 1 for the 49462306a36Sopenharmony_ci * msg type). That's 30 hash values if we pack 'em right. If 49562306a36Sopenharmony_ci * there are more than 30 MC addresses to add then punt the 49662306a36Sopenharmony_ci * extras for now and then add code to handle more than 30 later. 49762306a36Sopenharmony_ci * It would be unusual for a server to request that many multi-cast 49862306a36Sopenharmony_ci * addresses except for in large enterprise network environments. 49962306a36Sopenharmony_ci */ 50062306a36Sopenharmony_ci 50162306a36Sopenharmony_ci cnt = netdev_mc_count(netdev); 50262306a36Sopenharmony_ci if (cnt > 30) 50362306a36Sopenharmony_ci cnt = 30; 50462306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_SET_MULTICAST; 50562306a36Sopenharmony_ci msgbuf[0] |= cnt << IXGBE_VT_MSGINFO_SHIFT; 50662306a36Sopenharmony_ci 50762306a36Sopenharmony_ci i = 0; 50862306a36Sopenharmony_ci netdev_for_each_mc_addr(ha, netdev) { 50962306a36Sopenharmony_ci if (i == cnt) 51062306a36Sopenharmony_ci break; 51162306a36Sopenharmony_ci if (is_link_local_ether_addr(ha->addr)) 51262306a36Sopenharmony_ci continue; 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_ci vector_list[i++] = ixgbevf_mta_vector(hw, ha->addr); 51562306a36Sopenharmony_ci } 51662306a36Sopenharmony_ci 51762306a36Sopenharmony_ci return ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 51862306a36Sopenharmony_ci IXGBE_VFMAILBOX_SIZE); 51962306a36Sopenharmony_ci} 52062306a36Sopenharmony_ci 52162306a36Sopenharmony_ci/** 52262306a36Sopenharmony_ci * ixgbevf_hv_update_mc_addr_list_vf - stub 52362306a36Sopenharmony_ci * @hw: unused 52462306a36Sopenharmony_ci * @netdev: unused 52562306a36Sopenharmony_ci * 52662306a36Sopenharmony_ci * Hyper-V variant - just a stub. 52762306a36Sopenharmony_ci */ 52862306a36Sopenharmony_cistatic s32 ixgbevf_hv_update_mc_addr_list_vf(struct ixgbe_hw *hw, 52962306a36Sopenharmony_ci struct net_device *netdev) 53062306a36Sopenharmony_ci{ 53162306a36Sopenharmony_ci return -EOPNOTSUPP; 53262306a36Sopenharmony_ci} 53362306a36Sopenharmony_ci 53462306a36Sopenharmony_ci/** 53562306a36Sopenharmony_ci * ixgbevf_update_xcast_mode - Update Multicast mode 53662306a36Sopenharmony_ci * @hw: pointer to the HW structure 53762306a36Sopenharmony_ci * @xcast_mode: new multicast mode 53862306a36Sopenharmony_ci * 53962306a36Sopenharmony_ci * Updates the Multicast Mode of VF. 54062306a36Sopenharmony_ci **/ 54162306a36Sopenharmony_cistatic s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) 54262306a36Sopenharmony_ci{ 54362306a36Sopenharmony_ci u32 msgbuf[2]; 54462306a36Sopenharmony_ci s32 err; 54562306a36Sopenharmony_ci 54662306a36Sopenharmony_ci switch (hw->api_version) { 54762306a36Sopenharmony_ci case ixgbe_mbox_api_12: 54862306a36Sopenharmony_ci /* promisc introduced in 1.3 version */ 54962306a36Sopenharmony_ci if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC) 55062306a36Sopenharmony_ci return -EOPNOTSUPP; 55162306a36Sopenharmony_ci fallthrough; 55262306a36Sopenharmony_ci case ixgbe_mbox_api_13: 55362306a36Sopenharmony_ci case ixgbe_mbox_api_14: 55462306a36Sopenharmony_ci case ixgbe_mbox_api_15: 55562306a36Sopenharmony_ci break; 55662306a36Sopenharmony_ci default: 55762306a36Sopenharmony_ci return -EOPNOTSUPP; 55862306a36Sopenharmony_ci } 55962306a36Sopenharmony_ci 56062306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_UPDATE_XCAST_MODE; 56162306a36Sopenharmony_ci msgbuf[1] = xcast_mode; 56262306a36Sopenharmony_ci 56362306a36Sopenharmony_ci err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 56462306a36Sopenharmony_ci ARRAY_SIZE(msgbuf)); 56562306a36Sopenharmony_ci if (err) 56662306a36Sopenharmony_ci return err; 56762306a36Sopenharmony_ci 56862306a36Sopenharmony_ci msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; 56962306a36Sopenharmony_ci if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_FAILURE)) 57062306a36Sopenharmony_ci return -EPERM; 57162306a36Sopenharmony_ci 57262306a36Sopenharmony_ci return 0; 57362306a36Sopenharmony_ci} 57462306a36Sopenharmony_ci 57562306a36Sopenharmony_ci/** 57662306a36Sopenharmony_ci * ixgbevf_hv_update_xcast_mode - stub 57762306a36Sopenharmony_ci * @hw: unused 57862306a36Sopenharmony_ci * @xcast_mode: unused 57962306a36Sopenharmony_ci * 58062306a36Sopenharmony_ci * Hyper-V variant - just a stub. 58162306a36Sopenharmony_ci */ 58262306a36Sopenharmony_cistatic s32 ixgbevf_hv_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) 58362306a36Sopenharmony_ci{ 58462306a36Sopenharmony_ci return -EOPNOTSUPP; 58562306a36Sopenharmony_ci} 58662306a36Sopenharmony_ci 58762306a36Sopenharmony_ci/** 58862306a36Sopenharmony_ci * ixgbevf_get_link_state_vf - Get VF link state from PF 58962306a36Sopenharmony_ci * @hw: pointer to the HW structure 59062306a36Sopenharmony_ci * @link_state: link state storage 59162306a36Sopenharmony_ci * 59262306a36Sopenharmony_ci * Returns state of the operation error or success. 59362306a36Sopenharmony_ci */ 59462306a36Sopenharmony_cistatic s32 ixgbevf_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state) 59562306a36Sopenharmony_ci{ 59662306a36Sopenharmony_ci u32 msgbuf[2]; 59762306a36Sopenharmony_ci s32 ret_val; 59862306a36Sopenharmony_ci s32 err; 59962306a36Sopenharmony_ci 60062306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_GET_LINK_STATE; 60162306a36Sopenharmony_ci msgbuf[1] = 0x0; 60262306a36Sopenharmony_ci 60362306a36Sopenharmony_ci err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2); 60462306a36Sopenharmony_ci 60562306a36Sopenharmony_ci if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) { 60662306a36Sopenharmony_ci ret_val = IXGBE_ERR_MBX; 60762306a36Sopenharmony_ci } else { 60862306a36Sopenharmony_ci ret_val = 0; 60962306a36Sopenharmony_ci *link_state = msgbuf[1]; 61062306a36Sopenharmony_ci } 61162306a36Sopenharmony_ci 61262306a36Sopenharmony_ci return ret_val; 61362306a36Sopenharmony_ci} 61462306a36Sopenharmony_ci 61562306a36Sopenharmony_ci/** 61662306a36Sopenharmony_ci * ixgbevf_hv_get_link_state_vf - * Hyper-V variant - just a stub. 61762306a36Sopenharmony_ci * @hw: unused 61862306a36Sopenharmony_ci * @link_state: unused 61962306a36Sopenharmony_ci * 62062306a36Sopenharmony_ci * Hyper-V variant; there is no mailbox communication. 62162306a36Sopenharmony_ci */ 62262306a36Sopenharmony_cistatic s32 ixgbevf_hv_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state) 62362306a36Sopenharmony_ci{ 62462306a36Sopenharmony_ci return -EOPNOTSUPP; 62562306a36Sopenharmony_ci} 62662306a36Sopenharmony_ci 62762306a36Sopenharmony_ci/** 62862306a36Sopenharmony_ci * ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address 62962306a36Sopenharmony_ci * @hw: pointer to the HW structure 63062306a36Sopenharmony_ci * @vlan: 12 bit VLAN ID 63162306a36Sopenharmony_ci * @vind: unused by VF drivers 63262306a36Sopenharmony_ci * @vlan_on: if true then set bit, else clear bit 63362306a36Sopenharmony_ci **/ 63462306a36Sopenharmony_cistatic s32 ixgbevf_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, 63562306a36Sopenharmony_ci bool vlan_on) 63662306a36Sopenharmony_ci{ 63762306a36Sopenharmony_ci u32 msgbuf[2]; 63862306a36Sopenharmony_ci s32 err; 63962306a36Sopenharmony_ci 64062306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_SET_VLAN; 64162306a36Sopenharmony_ci msgbuf[1] = vlan; 64262306a36Sopenharmony_ci /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */ 64362306a36Sopenharmony_ci msgbuf[0] |= vlan_on << IXGBE_VT_MSGINFO_SHIFT; 64462306a36Sopenharmony_ci 64562306a36Sopenharmony_ci err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 64662306a36Sopenharmony_ci ARRAY_SIZE(msgbuf)); 64762306a36Sopenharmony_ci if (err) 64862306a36Sopenharmony_ci goto mbx_err; 64962306a36Sopenharmony_ci 65062306a36Sopenharmony_ci /* remove extra bits from the message */ 65162306a36Sopenharmony_ci msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; 65262306a36Sopenharmony_ci msgbuf[0] &= ~(0xFF << IXGBE_VT_MSGINFO_SHIFT); 65362306a36Sopenharmony_ci 65462306a36Sopenharmony_ci if (msgbuf[0] != (IXGBE_VF_SET_VLAN | IXGBE_VT_MSGTYPE_SUCCESS)) 65562306a36Sopenharmony_ci err = IXGBE_ERR_INVALID_ARGUMENT; 65662306a36Sopenharmony_ci 65762306a36Sopenharmony_cimbx_err: 65862306a36Sopenharmony_ci return err; 65962306a36Sopenharmony_ci} 66062306a36Sopenharmony_ci 66162306a36Sopenharmony_ci/** 66262306a36Sopenharmony_ci * ixgbevf_hv_set_vfta_vf - * Hyper-V variant - just a stub. 66362306a36Sopenharmony_ci * @hw: unused 66462306a36Sopenharmony_ci * @vlan: unused 66562306a36Sopenharmony_ci * @vind: unused 66662306a36Sopenharmony_ci * @vlan_on: unused 66762306a36Sopenharmony_ci */ 66862306a36Sopenharmony_cistatic s32 ixgbevf_hv_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, 66962306a36Sopenharmony_ci bool vlan_on) 67062306a36Sopenharmony_ci{ 67162306a36Sopenharmony_ci return -EOPNOTSUPP; 67262306a36Sopenharmony_ci} 67362306a36Sopenharmony_ci 67462306a36Sopenharmony_ci/** 67562306a36Sopenharmony_ci * ixgbevf_setup_mac_link_vf - Setup MAC link settings 67662306a36Sopenharmony_ci * @hw: pointer to hardware structure 67762306a36Sopenharmony_ci * @speed: Unused in this implementation 67862306a36Sopenharmony_ci * @autoneg: Unused in this implementation 67962306a36Sopenharmony_ci * @autoneg_wait_to_complete: Unused in this implementation 68062306a36Sopenharmony_ci * 68162306a36Sopenharmony_ci * Do nothing and return success. VF drivers are not allowed to change 68262306a36Sopenharmony_ci * global settings. Maintained for driver compatibility. 68362306a36Sopenharmony_ci **/ 68462306a36Sopenharmony_cistatic s32 ixgbevf_setup_mac_link_vf(struct ixgbe_hw *hw, 68562306a36Sopenharmony_ci ixgbe_link_speed speed, bool autoneg, 68662306a36Sopenharmony_ci bool autoneg_wait_to_complete) 68762306a36Sopenharmony_ci{ 68862306a36Sopenharmony_ci return 0; 68962306a36Sopenharmony_ci} 69062306a36Sopenharmony_ci 69162306a36Sopenharmony_ci/** 69262306a36Sopenharmony_ci * ixgbevf_check_mac_link_vf - Get link/speed status 69362306a36Sopenharmony_ci * @hw: pointer to hardware structure 69462306a36Sopenharmony_ci * @speed: pointer to link speed 69562306a36Sopenharmony_ci * @link_up: true is link is up, false otherwise 69662306a36Sopenharmony_ci * @autoneg_wait_to_complete: unused 69762306a36Sopenharmony_ci * 69862306a36Sopenharmony_ci * Reads the links register to determine if link is up and the current speed 69962306a36Sopenharmony_ci **/ 70062306a36Sopenharmony_cistatic s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw, 70162306a36Sopenharmony_ci ixgbe_link_speed *speed, 70262306a36Sopenharmony_ci bool *link_up, 70362306a36Sopenharmony_ci bool autoneg_wait_to_complete) 70462306a36Sopenharmony_ci{ 70562306a36Sopenharmony_ci struct ixgbe_mbx_info *mbx = &hw->mbx; 70662306a36Sopenharmony_ci struct ixgbe_mac_info *mac = &hw->mac; 70762306a36Sopenharmony_ci s32 ret_val = 0; 70862306a36Sopenharmony_ci u32 links_reg; 70962306a36Sopenharmony_ci u32 in_msg = 0; 71062306a36Sopenharmony_ci 71162306a36Sopenharmony_ci /* If we were hit with a reset drop the link */ 71262306a36Sopenharmony_ci if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) 71362306a36Sopenharmony_ci mac->get_link_status = true; 71462306a36Sopenharmony_ci 71562306a36Sopenharmony_ci if (!mac->get_link_status) 71662306a36Sopenharmony_ci goto out; 71762306a36Sopenharmony_ci 71862306a36Sopenharmony_ci /* if link status is down no point in checking to see if pf is up */ 71962306a36Sopenharmony_ci links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS); 72062306a36Sopenharmony_ci if (!(links_reg & IXGBE_LINKS_UP)) 72162306a36Sopenharmony_ci goto out; 72262306a36Sopenharmony_ci 72362306a36Sopenharmony_ci /* for SFP+ modules and DA cables on 82599 it can take up to 500usecs 72462306a36Sopenharmony_ci * before the link status is correct 72562306a36Sopenharmony_ci */ 72662306a36Sopenharmony_ci if (mac->type == ixgbe_mac_82599_vf) { 72762306a36Sopenharmony_ci int i; 72862306a36Sopenharmony_ci 72962306a36Sopenharmony_ci for (i = 0; i < 5; i++) { 73062306a36Sopenharmony_ci udelay(100); 73162306a36Sopenharmony_ci links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS); 73262306a36Sopenharmony_ci 73362306a36Sopenharmony_ci if (!(links_reg & IXGBE_LINKS_UP)) 73462306a36Sopenharmony_ci goto out; 73562306a36Sopenharmony_ci } 73662306a36Sopenharmony_ci } 73762306a36Sopenharmony_ci 73862306a36Sopenharmony_ci switch (links_reg & IXGBE_LINKS_SPEED_82599) { 73962306a36Sopenharmony_ci case IXGBE_LINKS_SPEED_10G_82599: 74062306a36Sopenharmony_ci *speed = IXGBE_LINK_SPEED_10GB_FULL; 74162306a36Sopenharmony_ci break; 74262306a36Sopenharmony_ci case IXGBE_LINKS_SPEED_1G_82599: 74362306a36Sopenharmony_ci *speed = IXGBE_LINK_SPEED_1GB_FULL; 74462306a36Sopenharmony_ci break; 74562306a36Sopenharmony_ci case IXGBE_LINKS_SPEED_100_82599: 74662306a36Sopenharmony_ci *speed = IXGBE_LINK_SPEED_100_FULL; 74762306a36Sopenharmony_ci break; 74862306a36Sopenharmony_ci } 74962306a36Sopenharmony_ci 75062306a36Sopenharmony_ci /* if the read failed it could just be a mailbox collision, best wait 75162306a36Sopenharmony_ci * until we are called again and don't report an error 75262306a36Sopenharmony_ci */ 75362306a36Sopenharmony_ci if (mbx->ops.read(hw, &in_msg, 1)) { 75462306a36Sopenharmony_ci if (hw->api_version >= ixgbe_mbox_api_15) 75562306a36Sopenharmony_ci mac->get_link_status = false; 75662306a36Sopenharmony_ci goto out; 75762306a36Sopenharmony_ci } 75862306a36Sopenharmony_ci 75962306a36Sopenharmony_ci if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) { 76062306a36Sopenharmony_ci /* msg is not CTS and is NACK we must have lost CTS status */ 76162306a36Sopenharmony_ci if (in_msg & IXGBE_VT_MSGTYPE_FAILURE) 76262306a36Sopenharmony_ci ret_val = -1; 76362306a36Sopenharmony_ci goto out; 76462306a36Sopenharmony_ci } 76562306a36Sopenharmony_ci 76662306a36Sopenharmony_ci /* the pf is talking, if we timed out in the past we reinit */ 76762306a36Sopenharmony_ci if (!mbx->timeout) { 76862306a36Sopenharmony_ci ret_val = -1; 76962306a36Sopenharmony_ci goto out; 77062306a36Sopenharmony_ci } 77162306a36Sopenharmony_ci 77262306a36Sopenharmony_ci /* if we passed all the tests above then the link is up and we no 77362306a36Sopenharmony_ci * longer need to check for link 77462306a36Sopenharmony_ci */ 77562306a36Sopenharmony_ci mac->get_link_status = false; 77662306a36Sopenharmony_ci 77762306a36Sopenharmony_ciout: 77862306a36Sopenharmony_ci *link_up = !mac->get_link_status; 77962306a36Sopenharmony_ci return ret_val; 78062306a36Sopenharmony_ci} 78162306a36Sopenharmony_ci 78262306a36Sopenharmony_ci/** 78362306a36Sopenharmony_ci * ixgbevf_hv_check_mac_link_vf - check link 78462306a36Sopenharmony_ci * @hw: pointer to private hardware struct 78562306a36Sopenharmony_ci * @speed: pointer to link speed 78662306a36Sopenharmony_ci * @link_up: true is link is up, false otherwise 78762306a36Sopenharmony_ci * @autoneg_wait_to_complete: unused 78862306a36Sopenharmony_ci * 78962306a36Sopenharmony_ci * Hyper-V variant; there is no mailbox communication. 79062306a36Sopenharmony_ci */ 79162306a36Sopenharmony_cistatic s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw, 79262306a36Sopenharmony_ci ixgbe_link_speed *speed, 79362306a36Sopenharmony_ci bool *link_up, 79462306a36Sopenharmony_ci bool autoneg_wait_to_complete) 79562306a36Sopenharmony_ci{ 79662306a36Sopenharmony_ci struct ixgbe_mbx_info *mbx = &hw->mbx; 79762306a36Sopenharmony_ci struct ixgbe_mac_info *mac = &hw->mac; 79862306a36Sopenharmony_ci u32 links_reg; 79962306a36Sopenharmony_ci 80062306a36Sopenharmony_ci /* If we were hit with a reset drop the link */ 80162306a36Sopenharmony_ci if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) 80262306a36Sopenharmony_ci mac->get_link_status = true; 80362306a36Sopenharmony_ci 80462306a36Sopenharmony_ci if (!mac->get_link_status) 80562306a36Sopenharmony_ci goto out; 80662306a36Sopenharmony_ci 80762306a36Sopenharmony_ci /* if link status is down no point in checking to see if pf is up */ 80862306a36Sopenharmony_ci links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS); 80962306a36Sopenharmony_ci if (!(links_reg & IXGBE_LINKS_UP)) 81062306a36Sopenharmony_ci goto out; 81162306a36Sopenharmony_ci 81262306a36Sopenharmony_ci /* for SFP+ modules and DA cables on 82599 it can take up to 500usecs 81362306a36Sopenharmony_ci * before the link status is correct 81462306a36Sopenharmony_ci */ 81562306a36Sopenharmony_ci if (mac->type == ixgbe_mac_82599_vf) { 81662306a36Sopenharmony_ci int i; 81762306a36Sopenharmony_ci 81862306a36Sopenharmony_ci for (i = 0; i < 5; i++) { 81962306a36Sopenharmony_ci udelay(100); 82062306a36Sopenharmony_ci links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS); 82162306a36Sopenharmony_ci 82262306a36Sopenharmony_ci if (!(links_reg & IXGBE_LINKS_UP)) 82362306a36Sopenharmony_ci goto out; 82462306a36Sopenharmony_ci } 82562306a36Sopenharmony_ci } 82662306a36Sopenharmony_ci 82762306a36Sopenharmony_ci switch (links_reg & IXGBE_LINKS_SPEED_82599) { 82862306a36Sopenharmony_ci case IXGBE_LINKS_SPEED_10G_82599: 82962306a36Sopenharmony_ci *speed = IXGBE_LINK_SPEED_10GB_FULL; 83062306a36Sopenharmony_ci break; 83162306a36Sopenharmony_ci case IXGBE_LINKS_SPEED_1G_82599: 83262306a36Sopenharmony_ci *speed = IXGBE_LINK_SPEED_1GB_FULL; 83362306a36Sopenharmony_ci break; 83462306a36Sopenharmony_ci case IXGBE_LINKS_SPEED_100_82599: 83562306a36Sopenharmony_ci *speed = IXGBE_LINK_SPEED_100_FULL; 83662306a36Sopenharmony_ci break; 83762306a36Sopenharmony_ci } 83862306a36Sopenharmony_ci 83962306a36Sopenharmony_ci /* if we passed all the tests above then the link is up and we no 84062306a36Sopenharmony_ci * longer need to check for link 84162306a36Sopenharmony_ci */ 84262306a36Sopenharmony_ci mac->get_link_status = false; 84362306a36Sopenharmony_ci 84462306a36Sopenharmony_ciout: 84562306a36Sopenharmony_ci *link_up = !mac->get_link_status; 84662306a36Sopenharmony_ci return 0; 84762306a36Sopenharmony_ci} 84862306a36Sopenharmony_ci 84962306a36Sopenharmony_ci/** 85062306a36Sopenharmony_ci * ixgbevf_set_rlpml_vf - Set the maximum receive packet length 85162306a36Sopenharmony_ci * @hw: pointer to the HW structure 85262306a36Sopenharmony_ci * @max_size: value to assign to max frame size 85362306a36Sopenharmony_ci **/ 85462306a36Sopenharmony_cistatic s32 ixgbevf_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size) 85562306a36Sopenharmony_ci{ 85662306a36Sopenharmony_ci u32 msgbuf[2]; 85762306a36Sopenharmony_ci s32 ret_val; 85862306a36Sopenharmony_ci 85962306a36Sopenharmony_ci msgbuf[0] = IXGBE_VF_SET_LPE; 86062306a36Sopenharmony_ci msgbuf[1] = max_size; 86162306a36Sopenharmony_ci 86262306a36Sopenharmony_ci ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 86362306a36Sopenharmony_ci ARRAY_SIZE(msgbuf)); 86462306a36Sopenharmony_ci if (ret_val) 86562306a36Sopenharmony_ci return ret_val; 86662306a36Sopenharmony_ci if ((msgbuf[0] & IXGBE_VF_SET_LPE) && 86762306a36Sopenharmony_ci (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) 86862306a36Sopenharmony_ci return IXGBE_ERR_MBX; 86962306a36Sopenharmony_ci 87062306a36Sopenharmony_ci return 0; 87162306a36Sopenharmony_ci} 87262306a36Sopenharmony_ci 87362306a36Sopenharmony_ci/** 87462306a36Sopenharmony_ci * ixgbevf_hv_set_rlpml_vf - Set the maximum receive packet length 87562306a36Sopenharmony_ci * @hw: pointer to the HW structure 87662306a36Sopenharmony_ci * @max_size: value to assign to max frame size 87762306a36Sopenharmony_ci * Hyper-V variant. 87862306a36Sopenharmony_ci **/ 87962306a36Sopenharmony_cistatic s32 ixgbevf_hv_set_rlpml_vf(struct ixgbe_hw *hw, u16 max_size) 88062306a36Sopenharmony_ci{ 88162306a36Sopenharmony_ci u32 reg; 88262306a36Sopenharmony_ci 88362306a36Sopenharmony_ci /* If we are on Hyper-V, we implement this functionality 88462306a36Sopenharmony_ci * differently. 88562306a36Sopenharmony_ci */ 88662306a36Sopenharmony_ci reg = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(0)); 88762306a36Sopenharmony_ci /* CRC == 4 */ 88862306a36Sopenharmony_ci reg |= ((max_size + 4) | IXGBE_RXDCTL_RLPML_EN); 88962306a36Sopenharmony_ci IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(0), reg); 89062306a36Sopenharmony_ci 89162306a36Sopenharmony_ci return 0; 89262306a36Sopenharmony_ci} 89362306a36Sopenharmony_ci 89462306a36Sopenharmony_ci/** 89562306a36Sopenharmony_ci * ixgbevf_negotiate_api_version_vf - Negotiate supported API version 89662306a36Sopenharmony_ci * @hw: pointer to the HW structure 89762306a36Sopenharmony_ci * @api: integer containing requested API version 89862306a36Sopenharmony_ci **/ 89962306a36Sopenharmony_cistatic int ixgbevf_negotiate_api_version_vf(struct ixgbe_hw *hw, int api) 90062306a36Sopenharmony_ci{ 90162306a36Sopenharmony_ci int err; 90262306a36Sopenharmony_ci u32 msg[3]; 90362306a36Sopenharmony_ci 90462306a36Sopenharmony_ci /* Negotiate the mailbox API version */ 90562306a36Sopenharmony_ci msg[0] = IXGBE_VF_API_NEGOTIATE; 90662306a36Sopenharmony_ci msg[1] = api; 90762306a36Sopenharmony_ci msg[2] = 0; 90862306a36Sopenharmony_ci 90962306a36Sopenharmony_ci err = ixgbevf_write_msg_read_ack(hw, msg, msg, ARRAY_SIZE(msg)); 91062306a36Sopenharmony_ci if (!err) { 91162306a36Sopenharmony_ci msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; 91262306a36Sopenharmony_ci 91362306a36Sopenharmony_ci /* Store value and return 0 on success */ 91462306a36Sopenharmony_ci if (msg[0] == (IXGBE_VF_API_NEGOTIATE | 91562306a36Sopenharmony_ci IXGBE_VT_MSGTYPE_SUCCESS)) { 91662306a36Sopenharmony_ci hw->api_version = api; 91762306a36Sopenharmony_ci return 0; 91862306a36Sopenharmony_ci } 91962306a36Sopenharmony_ci 92062306a36Sopenharmony_ci err = IXGBE_ERR_INVALID_ARGUMENT; 92162306a36Sopenharmony_ci } 92262306a36Sopenharmony_ci 92362306a36Sopenharmony_ci return err; 92462306a36Sopenharmony_ci} 92562306a36Sopenharmony_ci 92662306a36Sopenharmony_ci/** 92762306a36Sopenharmony_ci * ixgbevf_hv_negotiate_api_version_vf - Negotiate supported API version 92862306a36Sopenharmony_ci * @hw: pointer to the HW structure 92962306a36Sopenharmony_ci * @api: integer containing requested API version 93062306a36Sopenharmony_ci * Hyper-V version - only ixgbe_mbox_api_10 supported. 93162306a36Sopenharmony_ci **/ 93262306a36Sopenharmony_cistatic int ixgbevf_hv_negotiate_api_version_vf(struct ixgbe_hw *hw, int api) 93362306a36Sopenharmony_ci{ 93462306a36Sopenharmony_ci /* Hyper-V only supports api version ixgbe_mbox_api_10 */ 93562306a36Sopenharmony_ci if (api != ixgbe_mbox_api_10) 93662306a36Sopenharmony_ci return IXGBE_ERR_INVALID_ARGUMENT; 93762306a36Sopenharmony_ci 93862306a36Sopenharmony_ci return 0; 93962306a36Sopenharmony_ci} 94062306a36Sopenharmony_ci 94162306a36Sopenharmony_ciint ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, 94262306a36Sopenharmony_ci unsigned int *default_tc) 94362306a36Sopenharmony_ci{ 94462306a36Sopenharmony_ci int err; 94562306a36Sopenharmony_ci u32 msg[5]; 94662306a36Sopenharmony_ci 94762306a36Sopenharmony_ci /* do nothing if API doesn't support ixgbevf_get_queues */ 94862306a36Sopenharmony_ci switch (hw->api_version) { 94962306a36Sopenharmony_ci case ixgbe_mbox_api_11: 95062306a36Sopenharmony_ci case ixgbe_mbox_api_12: 95162306a36Sopenharmony_ci case ixgbe_mbox_api_13: 95262306a36Sopenharmony_ci case ixgbe_mbox_api_14: 95362306a36Sopenharmony_ci case ixgbe_mbox_api_15: 95462306a36Sopenharmony_ci break; 95562306a36Sopenharmony_ci default: 95662306a36Sopenharmony_ci return 0; 95762306a36Sopenharmony_ci } 95862306a36Sopenharmony_ci 95962306a36Sopenharmony_ci /* Fetch queue configuration from the PF */ 96062306a36Sopenharmony_ci msg[0] = IXGBE_VF_GET_QUEUE; 96162306a36Sopenharmony_ci msg[1] = msg[2] = msg[3] = msg[4] = 0; 96262306a36Sopenharmony_ci 96362306a36Sopenharmony_ci err = ixgbevf_write_msg_read_ack(hw, msg, msg, ARRAY_SIZE(msg)); 96462306a36Sopenharmony_ci if (!err) { 96562306a36Sopenharmony_ci msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; 96662306a36Sopenharmony_ci 96762306a36Sopenharmony_ci /* if we didn't get an ACK there must have been 96862306a36Sopenharmony_ci * some sort of mailbox error so we should treat it 96962306a36Sopenharmony_ci * as such 97062306a36Sopenharmony_ci */ 97162306a36Sopenharmony_ci if (msg[0] != (IXGBE_VF_GET_QUEUE | IXGBE_VT_MSGTYPE_SUCCESS)) 97262306a36Sopenharmony_ci return IXGBE_ERR_MBX; 97362306a36Sopenharmony_ci 97462306a36Sopenharmony_ci /* record and validate values from message */ 97562306a36Sopenharmony_ci hw->mac.max_tx_queues = msg[IXGBE_VF_TX_QUEUES]; 97662306a36Sopenharmony_ci if (hw->mac.max_tx_queues == 0 || 97762306a36Sopenharmony_ci hw->mac.max_tx_queues > IXGBE_VF_MAX_TX_QUEUES) 97862306a36Sopenharmony_ci hw->mac.max_tx_queues = IXGBE_VF_MAX_TX_QUEUES; 97962306a36Sopenharmony_ci 98062306a36Sopenharmony_ci hw->mac.max_rx_queues = msg[IXGBE_VF_RX_QUEUES]; 98162306a36Sopenharmony_ci if (hw->mac.max_rx_queues == 0 || 98262306a36Sopenharmony_ci hw->mac.max_rx_queues > IXGBE_VF_MAX_RX_QUEUES) 98362306a36Sopenharmony_ci hw->mac.max_rx_queues = IXGBE_VF_MAX_RX_QUEUES; 98462306a36Sopenharmony_ci 98562306a36Sopenharmony_ci *num_tcs = msg[IXGBE_VF_TRANS_VLAN]; 98662306a36Sopenharmony_ci /* in case of unknown state assume we cannot tag frames */ 98762306a36Sopenharmony_ci if (*num_tcs > hw->mac.max_rx_queues) 98862306a36Sopenharmony_ci *num_tcs = 1; 98962306a36Sopenharmony_ci 99062306a36Sopenharmony_ci *default_tc = msg[IXGBE_VF_DEF_QUEUE]; 99162306a36Sopenharmony_ci /* default to queue 0 on out-of-bounds queue number */ 99262306a36Sopenharmony_ci if (*default_tc >= hw->mac.max_tx_queues) 99362306a36Sopenharmony_ci *default_tc = 0; 99462306a36Sopenharmony_ci } 99562306a36Sopenharmony_ci 99662306a36Sopenharmony_ci return err; 99762306a36Sopenharmony_ci} 99862306a36Sopenharmony_ci 99962306a36Sopenharmony_cistatic const struct ixgbe_mac_operations ixgbevf_mac_ops = { 100062306a36Sopenharmony_ci .init_hw = ixgbevf_init_hw_vf, 100162306a36Sopenharmony_ci .reset_hw = ixgbevf_reset_hw_vf, 100262306a36Sopenharmony_ci .start_hw = ixgbevf_start_hw_vf, 100362306a36Sopenharmony_ci .get_mac_addr = ixgbevf_get_mac_addr_vf, 100462306a36Sopenharmony_ci .stop_adapter = ixgbevf_stop_hw_vf, 100562306a36Sopenharmony_ci .setup_link = ixgbevf_setup_mac_link_vf, 100662306a36Sopenharmony_ci .check_link = ixgbevf_check_mac_link_vf, 100762306a36Sopenharmony_ci .negotiate_api_version = ixgbevf_negotiate_api_version_vf, 100862306a36Sopenharmony_ci .set_rar = ixgbevf_set_rar_vf, 100962306a36Sopenharmony_ci .update_mc_addr_list = ixgbevf_update_mc_addr_list_vf, 101062306a36Sopenharmony_ci .update_xcast_mode = ixgbevf_update_xcast_mode, 101162306a36Sopenharmony_ci .get_link_state = ixgbevf_get_link_state_vf, 101262306a36Sopenharmony_ci .set_uc_addr = ixgbevf_set_uc_addr_vf, 101362306a36Sopenharmony_ci .set_vfta = ixgbevf_set_vfta_vf, 101462306a36Sopenharmony_ci .set_rlpml = ixgbevf_set_rlpml_vf, 101562306a36Sopenharmony_ci}; 101662306a36Sopenharmony_ci 101762306a36Sopenharmony_cistatic const struct ixgbe_mac_operations ixgbevf_hv_mac_ops = { 101862306a36Sopenharmony_ci .init_hw = ixgbevf_init_hw_vf, 101962306a36Sopenharmony_ci .reset_hw = ixgbevf_hv_reset_hw_vf, 102062306a36Sopenharmony_ci .start_hw = ixgbevf_start_hw_vf, 102162306a36Sopenharmony_ci .get_mac_addr = ixgbevf_get_mac_addr_vf, 102262306a36Sopenharmony_ci .stop_adapter = ixgbevf_stop_hw_vf, 102362306a36Sopenharmony_ci .setup_link = ixgbevf_setup_mac_link_vf, 102462306a36Sopenharmony_ci .check_link = ixgbevf_hv_check_mac_link_vf, 102562306a36Sopenharmony_ci .negotiate_api_version = ixgbevf_hv_negotiate_api_version_vf, 102662306a36Sopenharmony_ci .set_rar = ixgbevf_hv_set_rar_vf, 102762306a36Sopenharmony_ci .update_mc_addr_list = ixgbevf_hv_update_mc_addr_list_vf, 102862306a36Sopenharmony_ci .update_xcast_mode = ixgbevf_hv_update_xcast_mode, 102962306a36Sopenharmony_ci .get_link_state = ixgbevf_hv_get_link_state_vf, 103062306a36Sopenharmony_ci .set_uc_addr = ixgbevf_hv_set_uc_addr_vf, 103162306a36Sopenharmony_ci .set_vfta = ixgbevf_hv_set_vfta_vf, 103262306a36Sopenharmony_ci .set_rlpml = ixgbevf_hv_set_rlpml_vf, 103362306a36Sopenharmony_ci}; 103462306a36Sopenharmony_ci 103562306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_82599_vf_info = { 103662306a36Sopenharmony_ci .mac = ixgbe_mac_82599_vf, 103762306a36Sopenharmony_ci .mac_ops = &ixgbevf_mac_ops, 103862306a36Sopenharmony_ci}; 103962306a36Sopenharmony_ci 104062306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_82599_vf_hv_info = { 104162306a36Sopenharmony_ci .mac = ixgbe_mac_82599_vf, 104262306a36Sopenharmony_ci .mac_ops = &ixgbevf_hv_mac_ops, 104362306a36Sopenharmony_ci}; 104462306a36Sopenharmony_ci 104562306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_X540_vf_info = { 104662306a36Sopenharmony_ci .mac = ixgbe_mac_X540_vf, 104762306a36Sopenharmony_ci .mac_ops = &ixgbevf_mac_ops, 104862306a36Sopenharmony_ci}; 104962306a36Sopenharmony_ci 105062306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_X540_vf_hv_info = { 105162306a36Sopenharmony_ci .mac = ixgbe_mac_X540_vf, 105262306a36Sopenharmony_ci .mac_ops = &ixgbevf_hv_mac_ops, 105362306a36Sopenharmony_ci}; 105462306a36Sopenharmony_ci 105562306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_X550_vf_info = { 105662306a36Sopenharmony_ci .mac = ixgbe_mac_X550_vf, 105762306a36Sopenharmony_ci .mac_ops = &ixgbevf_mac_ops, 105862306a36Sopenharmony_ci}; 105962306a36Sopenharmony_ci 106062306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_X550_vf_hv_info = { 106162306a36Sopenharmony_ci .mac = ixgbe_mac_X550_vf, 106262306a36Sopenharmony_ci .mac_ops = &ixgbevf_hv_mac_ops, 106362306a36Sopenharmony_ci}; 106462306a36Sopenharmony_ci 106562306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_X550EM_x_vf_info = { 106662306a36Sopenharmony_ci .mac = ixgbe_mac_X550EM_x_vf, 106762306a36Sopenharmony_ci .mac_ops = &ixgbevf_mac_ops, 106862306a36Sopenharmony_ci}; 106962306a36Sopenharmony_ci 107062306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_X550EM_x_vf_hv_info = { 107162306a36Sopenharmony_ci .mac = ixgbe_mac_X550EM_x_vf, 107262306a36Sopenharmony_ci .mac_ops = &ixgbevf_hv_mac_ops, 107362306a36Sopenharmony_ci}; 107462306a36Sopenharmony_ci 107562306a36Sopenharmony_ciconst struct ixgbevf_info ixgbevf_x550em_a_vf_info = { 107662306a36Sopenharmony_ci .mac = ixgbe_mac_x550em_a_vf, 107762306a36Sopenharmony_ci .mac_ops = &ixgbevf_mac_ops, 107862306a36Sopenharmony_ci}; 1079