Lines Matching +full:mac +full:- +full:s
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009 - 2018 Intel Corporation. */
20 * e1000_init_mac_params_vf - Inits MAC params
25 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_vf() local
27 /* VF's have no MTA Registers - PF feature only */ in e1000_init_mac_params_vf()
28 mac->mta_reg_count = 128; in e1000_init_mac_params_vf()
29 /* VF's have no access to RAR entries */ in e1000_init_mac_params_vf()
30 mac->rar_entry_count = 1; in e1000_init_mac_params_vf()
34 mac->ops.reset_hw = e1000_reset_hw_vf; in e1000_init_mac_params_vf()
36 mac->ops.init_hw = e1000_init_hw_vf; in e1000_init_mac_params_vf()
38 mac->ops.check_for_link = e1000_check_for_link_vf; in e1000_init_mac_params_vf()
40 mac->ops.get_link_up_info = e1000_get_link_up_info_vf; in e1000_init_mac_params_vf()
42 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_vf; in e1000_init_mac_params_vf()
43 /* set mac address */ in e1000_init_mac_params_vf()
44 mac->ops.rar_set = e1000_rar_set_vf; in e1000_init_mac_params_vf()
45 /* read mac address */ in e1000_init_mac_params_vf()
46 mac->ops.read_mac_addr = e1000_read_mac_addr_vf; in e1000_init_mac_params_vf()
47 /* set mac filter */ in e1000_init_mac_params_vf()
48 mac->ops.set_uc_addr = e1000_set_uc_addr_vf; in e1000_init_mac_params_vf()
50 mac->ops.set_vfta = e1000_set_vfta_vf; in e1000_init_mac_params_vf()
56 * e1000_init_function_pointers_vf - Inits function pointers
61 hw->mac.ops.init_params = e1000_init_mac_params_vf; in e1000_init_function_pointers_vf()
62 hw->mbx.ops.init_params = e1000_init_mbx_params_vf; in e1000_init_function_pointers_vf()
66 * e1000_get_link_up_info_vf - Gets link info.
72 * the status register's data which is often stale and inaccurate.
96 * e1000_reset_hw_vf - Resets the HW
99 * VF's provide a function level reset. This is done using bit 26 of ctrl_reg.
104 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_reset_hw_vf()
106 u32 ret_val = -E1000_ERR_MAC_INIT; in e1000_reset_hw_vf()
116 while (!mbx->ops.check_for_rst(hw) && timeout) { in e1000_reset_hw_vf()
117 timeout--; in e1000_reset_hw_vf()
123 mbx->timeout = E1000_VF_MBX_INIT_TIMEOUT; in e1000_reset_hw_vf()
127 mbx->ops.write_posted(hw, msgbuf, 1); in e1000_reset_hw_vf()
132 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); in e1000_reset_hw_vf()
136 memcpy(hw->mac.perm_addr, addr, ETH_ALEN); in e1000_reset_hw_vf()
138 ret_val = -E1000_ERR_MAC_INIT; in e1000_reset_hw_vf()
146 * e1000_init_hw_vf - Inits the HW
153 /* attempt to set and restore our mac address */ in e1000_init_hw_vf()
154 e1000_rar_set_vf(hw, hw->mac.addr, 0); in e1000_init_hw_vf()
160 * e1000_hash_mc_addr_vf - Generate a multicast hash value
174 hash_mask = (hw->mac.mta_reg_count * 32) - 1; in e1000_hash_mc_addr_vf()
176 /* The bit_shift is the number of left-shifts in e1000_hash_mc_addr_vf()
182 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | in e1000_hash_mc_addr_vf()
189 * e1000_update_mc_addr_list_vf - Update Multicast addresses
198 * The parameter rar_count will usually be hw->mac.rar_entry_count
205 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_update_mc_addr_list_vf()
214 * msg type). That's 30 hash values if we pack 'em right. If in e1000_update_mc_addr_list_vf()
217 * It would be unusual for a server to request that many multi-cast in e1000_update_mc_addr_list_vf()
231 ret_val = mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE); in e1000_update_mc_addr_list_vf()
233 mbx->ops.read_posted(hw, msgbuf, 1); in e1000_update_mc_addr_list_vf()
237 * e1000_set_vfta_vf - Set/Unset vlan filter table address
244 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_set_vfta_vf()
254 mbx->ops.write_posted(hw, msgbuf, 2); in e1000_set_vfta_vf()
256 err = mbx->ops.read_posted(hw, msgbuf, 2); in e1000_set_vfta_vf()
262 err = -E1000_ERR_MAC_INIT; in e1000_set_vfta_vf()
268 * e1000_rlpml_set_vf - Set the maximum receive packet length
274 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_rlpml_set_vf()
281 ret_val = mbx->ops.write_posted(hw, msgbuf, 2); in e1000_rlpml_set_vf()
283 mbx->ops.read_posted(hw, msgbuf, 1); in e1000_rlpml_set_vf()
287 * e1000_rar_set_vf - set device MAC address
294 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_rar_set_vf()
302 ret_val = mbx->ops.write_posted(hw, msgbuf, 3); in e1000_rar_set_vf()
305 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); in e1000_rar_set_vf()
316 * e1000_read_mac_addr_vf - Read device MAC address
321 memcpy(hw->mac.addr, hw->mac.perm_addr, ETH_ALEN); in e1000_read_mac_addr_vf()
327 * e1000_set_uc_addr_vf - Set or clear unicast filters
330 * @addr: pointer to the filter MAC address
334 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_set_uc_addr_vf()
347 ret_val = mbx->ops.write_posted(hw, msgbuf, 3); in e1000_set_uc_addr_vf()
350 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); in e1000_set_uc_addr_vf()
358 return -ENOSPC; in e1000_set_uc_addr_vf()
365 * e1000_check_for_link_vf - Check for link for a virtual interface
374 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_check_for_link_vf()
375 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_link_vf() local
385 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in e1000_check_for_link_vf()
386 mac->get_link_status = true; in e1000_check_for_link_vf()
388 if (!mac->get_link_status) in e1000_check_for_link_vf()
398 if (mbx->ops.read(hw, &in_msg, 1)) in e1000_check_for_link_vf()
405 ret_val = -E1000_ERR_MAC_INIT; in e1000_check_for_link_vf()
410 if (!mbx->timeout) { in e1000_check_for_link_vf()
411 ret_val = -E1000_ERR_MAC_INIT; in e1000_check_for_link_vf()
418 mac->get_link_status = false; in e1000_check_for_link_vf()