37 static void e1000_update_mc_addr_list_vf(
struct e1000_hw *
hw,
u8 *,
40 static s32 e1000_read_mac_addr_vf(
struct e1000_hw *);
58 mac->
ops.reset_hw = e1000_reset_hw_vf;
60 mac->
ops.init_hw = e1000_init_hw_vf;
62 mac->
ops.check_for_link = e1000_check_for_link_vf;
64 mac->
ops.get_link_up_info = e1000_get_link_up_info_vf;
66 mac->
ops.update_mc_addr_list = e1000_update_mc_addr_list_vf;
68 mac->
ops.rar_set = e1000_rar_set_vf;
70 mac->
ops.read_mac_addr = e1000_read_mac_addr_vf;
72 mac->
ops.set_vfta = e1000_set_vfta_vf;
83 hw->
mac.ops.init_params = e1000_init_mac_params_vf;
138 while (!mbx->
ops.check_for_rst(hw) &&
timeout) {
149 mbx->
ops.write_posted(hw, msgbuf, 1);
154 ret_val = mbx->
ops.read_posted(hw, msgbuf, 3);
175 e1000_rar_set_vf(hw, hw->
mac.addr, 0);
189 static u32 e1000_hash_mc_addr_vf(
struct e1000_hw *hw,
u8 *mc_addr)
191 u32 hash_value, hash_mask;
195 hash_mask = (hw->
mac.mta_reg_count * 32) - 1;
201 while (hash_mask >> bit_shift != 0xFF)
204 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
205 (((
u16) mc_addr[5]) << bit_shift)));
223 static void e1000_update_mc_addr_list_vf(
struct e1000_hw *hw,
224 u8 *mc_addr_list,
u32 mc_addr_count,
225 u32 rar_used_count,
u32 rar_count)
229 u16 *hash_list = (
u16 *)&msgbuf[1];
242 cnt = (mc_addr_count > 30) ? 30 : mc_addr_count;
246 for (i = 0; i <
cnt; i++) {
247 hash_value = e1000_hash_mc_addr_vf(hw, mc_addr_list);
248 hash_list[
i] = hash_value & 0x0FFFF;
273 mbx->
ops.write_posted(hw, msgbuf, 2);
275 err = mbx->
ops.read_posted(hw, msgbuf, 2);
299 mbx->
ops.write_posted(hw, msgbuf, 2);
317 memcpy(msg_addr, addr, 6);
318 ret_val = mbx->
ops.write_posted(hw, msgbuf, 3);
321 ret_val = mbx->
ops.read_posted(hw, msgbuf, 3);
328 e1000_read_mac_addr_vf(hw);
335 static s32 e1000_read_mac_addr_vf(
struct e1000_hw *hw)
350 static s32 e1000_check_for_link_vf(
struct e1000_hw *hw)
364 if (!mbx->
ops.check_for_rst(hw) || !mbx->
timeout)
376 if (mbx->
ops.read(hw, &in_msg, 1))