Lines Matching +full:mac +full:- +full:address
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009 - 2018 Intel Corporation. */
22 * e1000_init_mac_params_vf - Inits MAC params
27 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_vf() local
29 /* VF's have no MTA Registers - PF feature only */ in e1000_init_mac_params_vf()
30 mac->mta_reg_count = 128; in e1000_init_mac_params_vf()
32 mac->rar_entry_count = 1; in e1000_init_mac_params_vf()
36 mac->ops.reset_hw = e1000_reset_hw_vf; in e1000_init_mac_params_vf()
38 mac->ops.init_hw = e1000_init_hw_vf; in e1000_init_mac_params_vf()
40 mac->ops.check_for_link = e1000_check_for_link_vf; in e1000_init_mac_params_vf()
42 mac->ops.get_link_up_info = e1000_get_link_up_info_vf; in e1000_init_mac_params_vf()
43 /* multicast address update */ in e1000_init_mac_params_vf()
44 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_vf; in e1000_init_mac_params_vf()
45 /* set mac address */ in e1000_init_mac_params_vf()
46 mac->ops.rar_set = e1000_rar_set_vf; in e1000_init_mac_params_vf()
47 /* read mac address */ in e1000_init_mac_params_vf()
48 mac->ops.read_mac_addr = e1000_read_mac_addr_vf; in e1000_init_mac_params_vf()
49 /* set mac filter */ in e1000_init_mac_params_vf()
50 mac->ops.set_uc_addr = e1000_set_uc_addr_vf; in e1000_init_mac_params_vf()
52 mac->ops.set_vfta = e1000_set_vfta_vf; in e1000_init_mac_params_vf()
58 * e1000_init_function_pointers_vf - Inits function pointers
63 hw->mac.ops.init_params = e1000_init_mac_params_vf; in e1000_init_function_pointers_vf()
64 hw->mbx.ops.init_params = e1000_init_mbx_params_vf; in e1000_init_function_pointers_vf()
68 * e1000_get_link_up_info_vf - Gets link info.
98 * e1000_reset_hw_vf - Resets the HW
106 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_reset_hw_vf()
108 u32 ret_val = -E1000_ERR_MAC_INIT; in e1000_reset_hw_vf()
118 while (!mbx->ops.check_for_rst(hw) && timeout) { in e1000_reset_hw_vf()
119 timeout--; in e1000_reset_hw_vf()
125 mbx->timeout = E1000_VF_MBX_INIT_TIMEOUT; in e1000_reset_hw_vf()
129 mbx->ops.write_posted(hw, msgbuf, 1); in e1000_reset_hw_vf()
134 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); in e1000_reset_hw_vf()
138 memcpy(hw->mac.perm_addr, addr, ETH_ALEN); in e1000_reset_hw_vf()
141 eth_zero_addr(hw->mac.perm_addr); in e1000_reset_hw_vf()
144 ret_val = -E1000_ERR_MAC_INIT; in e1000_reset_hw_vf()
153 * e1000_init_hw_vf - Inits the HW
160 /* attempt to set and restore our mac address */ in e1000_init_hw_vf()
161 e1000_rar_set_vf(hw, hw->mac.addr, 0); in e1000_init_hw_vf()
167 * e1000_hash_mc_addr_vf - Generate a multicast hash value
169 * @mc_addr: pointer to a multicast address
171 * Generates a multicast address hash value which is used to determine
172 * the multicast filter table array address and new table value. See
181 hash_mask = (hw->mac.mta_reg_count * 32) - 1; in e1000_hash_mc_addr_vf()
183 /* The bit_shift is the number of left-shifts in e1000_hash_mc_addr_vf()
189 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) | in e1000_hash_mc_addr_vf()
196 * e1000_update_mc_addr_list_vf - Update Multicast addresses
201 * @rar_count: total number of supported Receive Address Registers
203 * Updates the Receive Address Registers and Multicast Table Array.
205 * The parameter rar_count will usually be hw->mac.rar_entry_count
212 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_update_mc_addr_list_vf()
224 * It would be unusual for a server to request that many multi-cast in e1000_update_mc_addr_list_vf()
238 ret_val = mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE); in e1000_update_mc_addr_list_vf()
240 mbx->ops.read_posted(hw, msgbuf, 1); in e1000_update_mc_addr_list_vf()
244 * e1000_set_vfta_vf - Set/Unset vlan filter table address
251 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_set_vfta_vf()
261 mbx->ops.write_posted(hw, msgbuf, 2); in e1000_set_vfta_vf()
263 err = mbx->ops.read_posted(hw, msgbuf, 2); in e1000_set_vfta_vf()
269 err = -E1000_ERR_MAC_INIT; in e1000_set_vfta_vf()
275 * e1000_rlpml_set_vf - Set the maximum receive packet length
281 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_rlpml_set_vf()
288 ret_val = mbx->ops.write_posted(hw, msgbuf, 2); in e1000_rlpml_set_vf()
290 mbx->ops.read_posted(hw, msgbuf, 1); in e1000_rlpml_set_vf()
294 * e1000_rar_set_vf - set device MAC address
296 * @addr: pointer to the receive address
297 * @index: receive address array register
301 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_rar_set_vf()
309 ret_val = mbx->ops.write_posted(hw, msgbuf, 3); in e1000_rar_set_vf()
312 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); in e1000_rar_set_vf()
316 /* if nacked the address was rejected, use "perm_addr" */ in e1000_rar_set_vf()
323 * e1000_read_mac_addr_vf - Read device MAC address
328 memcpy(hw->mac.addr, hw->mac.perm_addr, ETH_ALEN); in e1000_read_mac_addr_vf()
334 * e1000_set_uc_addr_vf - Set or clear unicast filters
337 * @addr: pointer to the filter MAC address
341 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_set_uc_addr_vf()
354 ret_val = mbx->ops.write_posted(hw, msgbuf, 3); in e1000_set_uc_addr_vf()
357 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); in e1000_set_uc_addr_vf()
365 return -ENOSPC; in e1000_set_uc_addr_vf()
372 * e1000_check_for_link_vf - Check for link for a virtual interface
381 struct e1000_mbx_info *mbx = &hw->mbx; in e1000_check_for_link_vf()
382 struct e1000_mac_info *mac = &hw->mac; in e1000_check_for_link_vf() local
392 if (!mbx->ops.check_for_rst(hw) || !mbx->timeout) in e1000_check_for_link_vf()
393 mac->get_link_status = true; in e1000_check_for_link_vf()
395 if (!mac->get_link_status) in e1000_check_for_link_vf()
405 if (mbx->ops.read(hw, &in_msg, 1)) in e1000_check_for_link_vf()
412 ret_val = -E1000_ERR_MAC_INIT; in e1000_check_for_link_vf()
417 if (!mbx->timeout) { in e1000_check_for_link_vf()
418 ret_val = -E1000_ERR_MAC_INIT; in e1000_check_for_link_vf()
425 mac->get_link_status = false; in e1000_check_for_link_vf()