Lines Matching +full:hw +full:- +full:device +full:- +full:address
2 SPDX-License-Identifier: BSD-3-Clause
4 Copyright (c) 2001-2020, Intel Corporation
39 static s32 e1000_init_phy_params_vf(struct e1000_hw *hw);
40 static s32 e1000_init_nvm_params_vf(struct e1000_hw *hw);
41 static void e1000_release_vf(struct e1000_hw *hw);
42 static s32 e1000_acquire_vf(struct e1000_hw *hw);
43 static s32 e1000_setup_link_vf(struct e1000_hw *hw);
44 static s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw);
45 static s32 e1000_init_mac_params_vf(struct e1000_hw *hw);
46 static s32 e1000_check_for_link_vf(struct e1000_hw *hw);
47 static s32 e1000_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed,
49 static s32 e1000_init_hw_vf(struct e1000_hw *hw);
50 static s32 e1000_reset_hw_vf(struct e1000_hw *hw);
51 static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, u8 *, u32);
56 * e1000_init_phy_params_vf - Inits PHY params
57 * @hw: pointer to the HW structure
59 * Doesn't do much - there's no PHY available to the VF.
61 static s32 e1000_init_phy_params_vf(struct e1000_hw *hw) in e1000_init_phy_params_vf() argument
64 hw->phy.type = e1000_phy_vf; in e1000_init_phy_params_vf()
65 hw->phy.ops.acquire = e1000_acquire_vf; in e1000_init_phy_params_vf()
66 hw->phy.ops.release = e1000_release_vf; in e1000_init_phy_params_vf()
72 * e1000_init_nvm_params_vf - Inits NVM params
73 * @hw: pointer to the HW structure
75 * Doesn't do much - there's no NVM available to the VF.
77 static s32 e1000_init_nvm_params_vf(struct e1000_hw *hw) in e1000_init_nvm_params_vf() argument
80 hw->nvm.type = e1000_nvm_none; in e1000_init_nvm_params_vf()
81 hw->nvm.ops.acquire = e1000_acquire_vf; in e1000_init_nvm_params_vf()
82 hw->nvm.ops.release = e1000_release_vf; in e1000_init_nvm_params_vf()
88 * e1000_init_mac_params_vf - Inits MAC params
89 * @hw: pointer to the HW structure
91 static s32 e1000_init_mac_params_vf(struct e1000_hw *hw) in e1000_init_mac_params_vf() argument
93 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_vf()
103 hw->phy.media_type = e1000_media_type_unknown; in e1000_init_mac_params_vf()
106 mac->asf_firmware_present = false; in e1000_init_mac_params_vf()
108 mac->arc_subsystem_valid = false; in e1000_init_mac_params_vf()
110 mac->adaptive_ifs = false; in e1000_init_mac_params_vf()
111 /* VF's have no MTA Registers - PF feature only */ in e1000_init_mac_params_vf()
112 mac->mta_reg_count = 128; in e1000_init_mac_params_vf()
114 mac->rar_entry_count = 1; in e1000_init_mac_params_vf()
118 mac->ops.setup_link = e1000_setup_link_vf; in e1000_init_mac_params_vf()
120 mac->ops.get_bus_info = e1000_get_bus_info_pcie_vf; in e1000_init_mac_params_vf()
122 mac->ops.reset_hw = e1000_reset_hw_vf; in e1000_init_mac_params_vf()
123 /* hw initialization */ in e1000_init_mac_params_vf()
124 mac->ops.init_hw = e1000_init_hw_vf; in e1000_init_mac_params_vf()
126 mac->ops.check_for_link = e1000_check_for_link_vf; in e1000_init_mac_params_vf()
128 mac->ops.get_link_up_info = e1000_get_link_up_info_vf; in e1000_init_mac_params_vf()
129 /* multicast address update */ in e1000_init_mac_params_vf()
130 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_vf; in e1000_init_mac_params_vf()
131 /* set mac address */ in e1000_init_mac_params_vf()
132 mac->ops.rar_set = e1000_rar_set_vf; in e1000_init_mac_params_vf()
133 /* read mac address */ in e1000_init_mac_params_vf()
134 mac->ops.read_mac_addr = e1000_read_mac_addr_vf; in e1000_init_mac_params_vf()
141 * e1000_init_function_pointers_vf - Inits function pointers
142 * @hw: pointer to the HW structure
144 void e1000_init_function_pointers_vf(struct e1000_hw *hw) in e1000_init_function_pointers_vf() argument
148 hw->mac.ops.init_params = e1000_init_mac_params_vf; in e1000_init_function_pointers_vf()
149 hw->nvm.ops.init_params = e1000_init_nvm_params_vf; in e1000_init_function_pointers_vf()
150 hw->phy.ops.init_params = e1000_init_phy_params_vf; in e1000_init_function_pointers_vf()
151 hw->mbx.ops.init_params = e1000_init_mbx_params_vf; in e1000_init_function_pointers_vf()
155 * e1000_acquire_vf - Acquire rights to access PHY or NVM.
156 * @hw: pointer to the HW structure
162 static s32 e1000_acquire_vf(struct e1000_hw E1000_UNUSEDARG *hw) in e1000_acquire_vf() argument
164 return -E1000_ERR_PHY; in e1000_acquire_vf()
168 * e1000_release_vf - Release PHY or NVM
169 * @hw: pointer to the HW structure
175 static void e1000_release_vf(struct e1000_hw E1000_UNUSEDARG *hw) in e1000_release_vf() argument
181 * e1000_setup_link_vf - Sets up link.
182 * @hw: pointer to the HW structure
186 static s32 e1000_setup_link_vf(struct e1000_hw E1000_UNUSEDARG *hw) in e1000_setup_link_vf() argument
194 * e1000_get_bus_info_pcie_vf - Gets the bus info.
195 * @hw: pointer to the HW structure
199 static s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw) in e1000_get_bus_info_pcie_vf() argument
201 struct e1000_bus_info *bus = &hw->bus; in e1000_get_bus_info_pcie_vf()
205 /* Do not set type PCI-E because we don't want disable master to run */ in e1000_get_bus_info_pcie_vf()
206 bus->type = e1000_bus_type_reserved; in e1000_get_bus_info_pcie_vf()
207 bus->speed = e1000_bus_speed_2500; in e1000_get_bus_info_pcie_vf()
213 * e1000_get_link_up_info_vf - Gets link info.
214 * @hw: pointer to the HW structure
221 static s32 e1000_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed, in e1000_get_link_up_info_vf() argument
228 status = E1000_READ_REG(hw, E1000_STATUS); in e1000_get_link_up_info_vf()
252 * e1000_reset_hw_vf - Resets the HW
253 * @hw: pointer to the HW structure
258 static s32 e1000_reset_hw_vf(struct e1000_hw *hw) in e1000_reset_hw_vf() argument
260 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_reset_hw_vf()
262 s32 ret_val = -E1000_ERR_MAC_INIT; in e1000_reset_hw_vf()
269 ctrl = E1000_READ_REG(hw, E1000_CTRL); in e1000_reset_hw_vf()
270 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); in e1000_reset_hw_vf()
273 while (!mbx->ops.check_for_rst(hw, 0) && timeout) { in e1000_reset_hw_vf()
274 timeout--; in e1000_reset_hw_vf()
280 mbx->timeout = E1000_VF_MBX_INIT_TIMEOUT; in e1000_reset_hw_vf()
283 mbx->ops.write_posted(hw, msgbuf, 1, 0); in e1000_reset_hw_vf()
288 ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0); in e1000_reset_hw_vf()
292 memcpy(hw->mac.perm_addr, addr, 6); in e1000_reset_hw_vf()
294 ret_val = -E1000_ERR_MAC_INIT; in e1000_reset_hw_vf()
302 * e1000_init_hw_vf - Inits the HW
303 * @hw: pointer to the HW structure
307 static s32 e1000_init_hw_vf(struct e1000_hw *hw) in e1000_init_hw_vf() argument
311 /* attempt to set and restore our mac address */ in e1000_init_hw_vf()
312 e1000_rar_set_vf(hw, hw->mac.addr, 0); in e1000_init_hw_vf()
318 * e1000_rar_set_vf - set device MAC address
319 * @hw: pointer to the HW structure
320 * @addr: pointer to the receive address
321 * @index receive address array register
323 static int e1000_rar_set_vf(struct e1000_hw *hw, u8 *addr, in e1000_rar_set_vf() argument
326 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_rar_set_vf()
334 ret_val = mbx->ops.write_posted(hw, msgbuf, 3, 0); in e1000_rar_set_vf()
337 ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0); in e1000_rar_set_vf()
341 /* if nacked the address was rejected, use "perm_addr" */ in e1000_rar_set_vf()
344 e1000_read_mac_addr_vf(hw); in e1000_rar_set_vf()
350 * e1000_hash_mc_addr_vf - Generate a multicast hash value
351 * @hw: pointer to the HW structure
352 * @mc_addr: pointer to a multicast address
354 * Generates a multicast address hash value which is used to determine
355 * the multicast filter table array address and new table value.
357 static u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr) in e1000_hash_mc_addr_vf() argument
365 hash_mask = (hw->mac.mta_reg_count * 32) - 1; in e1000_hash_mc_addr_vf()
368 * The bit_shift is the number of left-shifts in e1000_hash_mc_addr_vf()
374 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | in e1000_hash_mc_addr_vf()
380 static void e1000_write_msg_read_ack(struct e1000_hw *hw, in e1000_write_msg_read_ack() argument
383 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_write_msg_read_ack()
385 s32 retval = mbx->ops.write_posted(hw, msg, size, 0); in e1000_write_msg_read_ack()
388 mbx->ops.read_posted(hw, retmsg, E1000_VFMAILBOX_SIZE, 0); in e1000_write_msg_read_ack()
392 * e1000_update_mc_addr_list_vf - Update Multicast addresses
393 * @hw: pointer to the HW structure
400 void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, in e1000_update_mc_addr_list_vf() argument
411 * 16 bit words available in our HW msg buffer (minus 1 for the in e1000_update_mc_addr_list_vf()
415 * It would be unusual for a server to request that many multi-cast in e1000_update_mc_addr_list_vf()
431 hash_value = e1000_hash_mc_addr_vf(hw, mc_addr_list); in e1000_update_mc_addr_list_vf()
437 e1000_write_msg_read_ack(hw, msgbuf, E1000_VFMAILBOX_SIZE); in e1000_update_mc_addr_list_vf()
441 * e1000_vfta_set_vf - Set/Unset vlan filter table address
442 * @hw: pointer to the HW structure
446 void e1000_vfta_set_vf(struct e1000_hw *hw, u16 vid, bool set) in e1000_vfta_set_vf() argument
456 e1000_write_msg_read_ack(hw, msgbuf, 2); in e1000_vfta_set_vf()
459 /** e1000_rlpml_set_vf - Set the maximum receive packet length
460 * @hw: pointer to the HW structure
463 void e1000_rlpml_set_vf(struct e1000_hw *hw, u16 max_size) in e1000_rlpml_set_vf() argument
470 e1000_write_msg_read_ack(hw, msgbuf, 2); in e1000_rlpml_set_vf()
474 * e1000_promisc_set_vf - Set flags for Unicast or Multicast promisc
475 * @hw: pointer to the HW structure
479 s32 e1000_promisc_set_vf(struct e1000_hw *hw, enum e1000_promisc_type type) in e1000_promisc_set_vf() argument
481 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_promisc_set_vf()
498 return -E1000_ERR_MAC_INIT; in e1000_promisc_set_vf()
501 ret_val = mbx->ops.write_posted(hw, &msgbuf, 1, 0); in e1000_promisc_set_vf()
504 ret_val = mbx->ops.read_posted(hw, &msgbuf, 1, 0); in e1000_promisc_set_vf()
507 ret_val = -E1000_ERR_MAC_INIT; in e1000_promisc_set_vf()
513 * e1000_read_mac_addr_vf - Read device MAC address
514 * @hw: pointer to the HW structure
516 static s32 e1000_read_mac_addr_vf(struct e1000_hw *hw) in e1000_read_mac_addr_vf() argument
521 hw->mac.addr[i] = hw->mac.perm_addr[i]; in e1000_read_mac_addr_vf()
527 * e1000_check_for_link_vf - Check for link for a virtual interface
528 * @hw: pointer to the HW structure
534 static s32 e1000_check_for_link_vf(struct e1000_hw *hw) in e1000_check_for_link_vf() argument
536 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_check_for_link_vf()
537 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_link_vf()
545 * in this case that could mean a link change, device reset, in e1000_check_for_link_vf()
550 if (!mbx->ops.check_for_rst(hw, 0) || !mbx->timeout) in e1000_check_for_link_vf()
551 mac->get_link_status = true; in e1000_check_for_link_vf()
553 if (!mac->get_link_status) in e1000_check_for_link_vf()
557 if (!(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) in e1000_check_for_link_vf()
562 if (mbx->ops.read(hw, &in_msg, 1, 0)) in e1000_check_for_link_vf()
569 ret_val = -E1000_ERR_MAC_INIT; in e1000_check_for_link_vf()
576 if (!mbx->timeout) { in e1000_check_for_link_vf()
577 ret_val = -E1000_ERR_MAC_INIT; in e1000_check_for_link_vf()
583 mac->get_link_status = false; in e1000_check_for_link_vf()