iPXE
igbvf_vf.c File Reference
#include "igbvf_vf.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_ONLY)
static s32 igbvf_init_mac_params_vf (struct e1000_hw *hw)
 igbvf_init_mac_params_vf - Inits MAC params @hw: pointer to the HW structure
static s32 igbvf_check_for_link_vf (struct e1000_hw *hw)
 igbvf_check_for_link_vf - Check for link for a virtual interface @hw: pointer to the HW structure
static s32 igbvf_get_link_up_info_vf (struct e1000_hw *hw, u16 *speed, u16 *duplex)
 igbvf_get_link_up_info_vf - Gets link info.
static s32 igbvf_init_hw_vf (struct e1000_hw *hw)
 igbvf_init_hw_vf - Inits the HW @hw: pointer to the HW structure
static s32 igbvf_reset_hw_vf (struct e1000_hw *hw)
 igbvf_reset_hw_vf - Resets the HW @hw: pointer to the HW structure
static void igbvf_update_mc_addr_list_vf (struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count)
 igbvf_update_mc_addr_list_vf - Update Multicast addresses @hw: pointer to the HW structure @mc_addr_list: array of multicast addresses to program @mc_addr_count: number of multicast addresses to program
static void igbvf_rar_set_vf (struct e1000_hw *, u8 *, u32)
static s32 igbvf_read_mac_addr_vf (struct e1000_hw *hw)
 igbvf_read_mac_addr_vf - Read device MAC address @hw: pointer to the HW structure
void igbvf_init_function_pointers_vf (struct e1000_hw *hw)
 igbvf_init_function_pointers_vf - Inits function pointers @hw: pointer to the HW structure
static void igbvf_rar_set_vf (struct e1000_hw *hw, u8 *addr, u32 index __unused)
 igbvf_rar_set_vf - set device MAC address @hw: pointer to the HW structure @addr: pointer to the receive address @index receive address array register
static u32 igbvf_hash_mc_addr_vf (struct e1000_hw *hw, u8 *mc_addr)
 igbvf_hash_mc_addr_vf - Generate a multicast hash value @hw: pointer to the HW structure @mc_addr: pointer to a multicast address
void igbvf_vfta_set_vf (struct e1000_hw *hw, u16 vid, bool set)
 igbvf_vfta_set_vf - Set/Unset vlan filter table address @hw: pointer to the HW structure @vid: determines the vfta register and bit to set/unset @set: if true then set bit, else clear bit
void igbvf_rlpml_set_vf (struct e1000_hw *hw, u16 max_size)
 igbvf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size: value to assign to max frame size
s32 igbvf_promisc_set_vf (struct e1000_hw *hw, enum e1000_promisc_type type)
 igbvf_promisc_set_vf - Set flags for Unicast or Multicast promisc @hw: pointer to the HW structure @uni: boolean indicating unicast promisc status @multi: boolean indicating multicast promisc status

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_ONLY )

References u16, u32, and u8.

◆ igbvf_init_mac_params_vf()

s32 igbvf_init_mac_params_vf ( struct e1000_hw * hw)
static

igbvf_init_mac_params_vf - Inits MAC params @hw: pointer to the HW structure

Definition at line 48 of file igbvf_vf.c.

49{
50 struct e1000_mac_info *mac = &hw->mac;
51
52 DEBUGFUNC("igbvf_init_mac_params_vf");
53
54 /* VF's have no MTA Registers - PF feature only */
55 mac->mta_reg_count = 128;
56 /* VF's have no access to RAR entries */
57 mac->rar_entry_count = 1;
58
59 /* Function pointers */
60 /* reset */
61 mac->ops.reset_hw = igbvf_reset_hw_vf;
62 /* hw initialization */
63 mac->ops.init_hw = igbvf_init_hw_vf;
64 /* check for link */
65 mac->ops.check_for_link = igbvf_check_for_link_vf;
66 /* link info */
67 mac->ops.get_link_up_info = igbvf_get_link_up_info_vf;
68 /* multicast address update */
69 mac->ops.update_mc_addr_list = igbvf_update_mc_addr_list_vf;
70 /* set mac address */
71 mac->ops.rar_set = igbvf_rar_set_vf;
72 /* read mac address */
73 mac->ops.read_mac_addr = igbvf_read_mac_addr_vf;
74
75
76 return E1000_SUCCESS;
77}
uint8_t mac[ETH_ALEN]
MAC address.
Definition ena.h:13
#define E1000_SUCCESS
#define DEBUGFUNC(F)
Definition igbvf_osdep.h:68
static s32 igbvf_reset_hw_vf(struct e1000_hw *hw)
igbvf_reset_hw_vf - Resets the HW @hw: pointer to the HW structure
Definition igbvf_vf.c:137
static s32 igbvf_check_for_link_vf(struct e1000_hw *hw)
igbvf_check_for_link_vf - Check for link for a virtual interface @hw: pointer to the HW structure
Definition igbvf_vf.c:402
static void igbvf_rar_set_vf(struct e1000_hw *, u8 *, u32)
static s32 igbvf_read_mac_addr_vf(struct e1000_hw *)
igbvf_read_mac_addr_vf - Read device MAC address @hw: pointer to the HW structure
Definition igbvf_vf.c:384
static void igbvf_update_mc_addr_list_vf(struct e1000_hw *hw, u8 *, u32)
igbvf_update_mc_addr_list_vf - Update Multicast addresses @hw: pointer to the HW structure @mc_addr_l...
Definition igbvf_vf.c:266
static s32 igbvf_init_hw_vf(struct e1000_hw *hw)
igbvf_init_hw_vf - Inits the HW @hw: pointer to the HW structure
Definition igbvf_vf.c:186
static s32 igbvf_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed, u16 *duplex)
igbvf_get_link_up_info_vf - Gets link info.
Definition igbvf_vf.c:100
Definition hw.c:16

References DEBUGFUNC, E1000_SUCCESS, igbvf_check_for_link_vf(), igbvf_get_link_up_info_vf(), igbvf_init_hw_vf(), igbvf_rar_set_vf(), igbvf_read_mac_addr_vf(), igbvf_reset_hw_vf(), igbvf_update_mc_addr_list_vf(), and mac.

Referenced by igbvf_init_function_pointers_vf().

◆ igbvf_check_for_link_vf()

s32 igbvf_check_for_link_vf ( struct e1000_hw * hw)
static

igbvf_check_for_link_vf - Check for link for a virtual interface @hw: pointer to the HW structure

Checks to see if the underlying PF is still talking to the VF and if it is then it reports the link state to the hardware, otherwise it reports link down and returns an error.

Definition at line 402 of file igbvf_vf.c.

403{
404 struct e1000_mbx_info *mbx = &hw->mbx;
405 struct e1000_mac_info *mac = &hw->mac;
406 s32 ret_val = E1000_SUCCESS;
407 u32 in_msg = 0;
408
409 DEBUGFUNC("igbvf_check_for_link_vf");
410
411 /*
412 * We only want to run this if there has been a rst asserted.
413 * in this case that could mean a link change, device reset,
414 * or a virtual function reset
415 */
416
417 /* If we were hit with a reset drop the link */
418 if (!mbx->ops.check_for_rst(hw, 0))
419 mac->get_link_status = true;
420
421 if (!mac->get_link_status)
422 goto out;
423
424 /* if link status is down no point in checking to see if pf is up */
426 goto out;
427
428 /* if the read failed it could just be a mailbox collision, best wait
429 * until we are called again and don't report an error */
430 if (mbx->ops.read(hw, &in_msg, 1, 0))
431 goto out;
432
433 /* if incoming message isn't clear to send we are waiting on response */
434 if (!(in_msg & E1000_VT_MSGTYPE_CTS)) {
435 /* message is not CTS and is NACK we have lost CTS status */
436 if (in_msg & E1000_VT_MSGTYPE_NACK)
437 ret_val = -E1000_ERR_MAC_INIT;
438 goto out;
439 }
440
441 /* at this point we know the PF is talking to us, check and see if
442 * we are still accepting timeout or if we had a timeout failure.
443 * if we failed then we will need to reinit */
444 if (!mbx->timeout) {
445 ret_val = -E1000_ERR_MAC_INIT;
446 goto out;
447 }
448
449 /* if we passed all the tests above then the link is up and we no
450 * longer need to check for link */
451 mac->get_link_status = false;
452
453out:
454 return ret_val;
455}
__be32 out[4]
Definition CIB_PRM.h:8
#define E1000_STATUS_LU
#define E1000_ERR_MAC_INIT
#define E1000_VT_MSGTYPE_CTS
Definition igbvf_mbx.h:59
#define E1000_VT_MSGTYPE_NACK
Definition igbvf_mbx.h:58
#define E1000_READ_REG(a, reg)
Definition igbvf_osdep.h:76
#define E1000_STATUS
Definition igbvf_regs.h:36
int32_t s32
Definition stdint.h:23
struct e1000_mbx_operations ops
Definition igbvf_vf.h:298
s32(* check_for_rst)(struct e1000_hw *, u16)
Definition igbvf_vf.h:285
s32(* read)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:279
#define u32
Definition vga.h:21

References e1000_mbx_operations::check_for_rst, DEBUGFUNC, E1000_ERR_MAC_INIT, E1000_READ_REG, E1000_STATUS, E1000_STATUS_LU, E1000_SUCCESS, E1000_VT_MSGTYPE_CTS, E1000_VT_MSGTYPE_NACK, mac, e1000_mbx_info::ops, out, e1000_mbx_operations::read, e1000_mbx_info::timeout, and u32.

Referenced by igbvf_init_mac_params_vf().

◆ igbvf_get_link_up_info_vf()

s32 igbvf_get_link_up_info_vf ( struct e1000_hw * hw,
u16 * speed,
u16 * duplex )
static

igbvf_get_link_up_info_vf - Gets link info.

@hw: pointer to the HW structure @speed: pointer to 16 bit value to store link speed. @duplex: pointer to 16 bit value to store duplex.

Since we cannot read the PHY and get accurate link info, we must rely upon the status register's data which is often stale and inaccurate.

Definition at line 100 of file igbvf_vf.c.

102{
103 s32 status;
104
105 DEBUGFUNC("igbvf_get_link_up_info_vf");
106
109 *speed = SPEED_1000;
110 DEBUGOUT("1000 Mbs, ");
111 } else if (status & E1000_STATUS_SPEED_100) {
112 *speed = SPEED_100;
113 DEBUGOUT("100 Mbs, ");
114 } else {
115 *speed = SPEED_10;
116 DEBUGOUT("10 Mbs, ");
117 }
118
119 if (status & E1000_STATUS_FD) {
121 DEBUGOUT("Full Duplex\n");
122 } else {
124 DEBUGOUT("Half Duplex\n");
125 }
126
127 return E1000_SUCCESS;
128}
#define SPEED_100
Definition atl1e.h:51
#define SPEED_1000
Definition atl1e.h:52
#define HALF_DUPLEX
Definition atl1e.h:53
#define SPEED_10
Definition atl1e.h:50
#define FULL_DUPLEX
Definition atl1e.h:54
uint8_t status
Status.
Definition ena.h:5
#define E1000_STATUS_SPEED_1000
#define E1000_STATUS_SPEED_100
#define E1000_STATUS_FD
#define DEBUGOUT(S)
Definition igbvf_osdep.h:65
duplex
Definition nic.h:40

References DEBUGFUNC, DEBUGOUT, E1000_READ_REG, E1000_STATUS, E1000_STATUS_FD, E1000_STATUS_SPEED_100, E1000_STATUS_SPEED_1000, E1000_SUCCESS, FULL_DUPLEX, HALF_DUPLEX, SPEED_10, SPEED_100, SPEED_1000, status, and u16.

Referenced by igbvf_init_mac_params_vf().

◆ igbvf_init_hw_vf()

s32 igbvf_init_hw_vf ( struct e1000_hw * hw)
static

igbvf_init_hw_vf - Inits the HW @hw: pointer to the HW structure

Not much to do here except clear the PF Reset indication if there is one.

Definition at line 186 of file igbvf_vf.c.

187{
188 DEBUGFUNC("igbvf_init_hw_vf");
189
190 /* attempt to set and restore our mac address */
191 igbvf_rar_set_vf(hw, hw->mac.addr, 0);
192
193 return E1000_SUCCESS;
194}

References DEBUGFUNC, E1000_SUCCESS, and igbvf_rar_set_vf().

Referenced by igbvf_init_mac_params_vf().

◆ igbvf_reset_hw_vf()

s32 igbvf_reset_hw_vf ( struct e1000_hw * hw)
static

igbvf_reset_hw_vf - Resets the HW @hw: pointer to the HW structure

VF's provide a function level reset. This is done using bit 26 of ctrl_reg. This is all the reset we can perform on a VF.

Definition at line 137 of file igbvf_vf.c.

138{
139 struct e1000_mbx_info *mbx = &hw->mbx;
141 s32 ret_val = -E1000_ERR_MAC_INIT;
142 u32 ctrl, msgbuf[3];
143 u8 *addr = (u8 *)(&msgbuf[1]);
144
145 DEBUGFUNC("igbvf_reset_hw_vf");
146
147 DEBUGOUT("Issuing a function level reset to MAC\n");
150
151 /* we cannot reset while the RSTI / RSTD bits are asserted */
152 while (!mbx->ops.check_for_rst(hw, 0) && timeout) {
153 timeout--;
154 usec_delay(5);
155 }
156
157 if (timeout) {
158 /* mailbox timeout can now become active */
160
161 msgbuf[0] = E1000_VF_RESET;
162 mbx->ops.write_posted(hw, msgbuf, 1, 0);
163
164 msec_delay(10);
165
166 /* set our "perm_addr" based on info provided by PF */
167 ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0);
168 if (!ret_val) {
169 if (msgbuf[0] == (E1000_VF_RESET |
171 memcpy(hw->mac.perm_addr, addr, 6);
172 else
173 ret_val = -E1000_ERR_MAC_INIT;
174 }
175 }
176
177 return ret_val;
178}
void timeout(int)
uint8_t ctrl
Ring control.
Definition dwmac.h:7
uint32_t addr
Buffer address.
Definition dwmac.h:9
#define E1000_CTRL_RST
#define E1000_VF_MBX_INIT_TIMEOUT
Definition igbvf_mbx.h:78
#define E1000_VF_RESET
Definition igbvf_mbx.h:64
#define E1000_VT_MSGTYPE_ACK
Definition igbvf_mbx.h:57
#define u8
Definition igbvf_osdep.h:40
#define msec_delay(x)
Definition igbvf_osdep.h:57
#define usec_delay(x)
Definition igbvf_osdep.h:56
#define E1000_WRITE_REG(a, reg, value)
Definition igbvf_osdep.h:73
#define E1000_CTRL
Definition igbvf_regs.h:34
#define E1000_VF_INIT_TIMEOUT
Definition igbvf_vf.h:59
void * memcpy(void *dest, const void *src, size_t len) __nonnull
s32(* read_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:281
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:282

References addr, e1000_mbx_operations::check_for_rst, ctrl, DEBUGFUNC, DEBUGOUT, E1000_CTRL, E1000_CTRL_RST, E1000_ERR_MAC_INIT, E1000_READ_REG, E1000_VF_INIT_TIMEOUT, E1000_VF_MBX_INIT_TIMEOUT, E1000_VF_RESET, E1000_VT_MSGTYPE_ACK, E1000_WRITE_REG, memcpy(), msec_delay, e1000_mbx_info::ops, e1000_mbx_operations::read_posted, e1000_mbx_info::timeout, timeout(), u32, u8, usec_delay, and e1000_mbx_operations::write_posted.

Referenced by igbvf_init_mac_params_vf().

◆ igbvf_update_mc_addr_list_vf()

void igbvf_update_mc_addr_list_vf ( struct e1000_hw * hw,
u8 * mc_addr_list,
u32 mc_addr_count )
static

igbvf_update_mc_addr_list_vf - Update Multicast addresses @hw: pointer to the HW structure @mc_addr_list: array of multicast addresses to program @mc_addr_count: number of multicast addresses to program

Updates the Multicast Table Array. The caller must have a packed mc_addr_list of multicast addresses.

Definition at line 266 of file igbvf_vf.c.

268{
269 struct e1000_mbx_info *mbx = &hw->mbx;
271 u16 *hash_list = (u16 *)&msgbuf[1];
272 u32 hash_value;
273 u32 i;
274
275 DEBUGFUNC("igbvf_update_mc_addr_list_vf");
276
277 /* Each entry in the list uses 1 16 bit word. We have 30
278 * 16 bit words available in our HW msg buffer (minus 1 for the
279 * msg type). That's 30 hash values if we pack 'em right. If
280 * there are more than 30 MC addresses to add then punt the
281 * extras for now and then add code to handle more than 30 later.
282 * It would be unusual for a server to request that many multi-cast
283 * addresses except for in large enterprise network environments.
284 */
285
286 DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count);
287
288 msgbuf[0] = E1000_VF_SET_MULTICAST;
289
290 if (mc_addr_count > 30) {
292 mc_addr_count = 30;
293 }
294
295 msgbuf[0] |= mc_addr_count << E1000_VT_MSGINFO_SHIFT;
296
297 for (i = 0; i < mc_addr_count; i++) {
298 hash_value = igbvf_hash_mc_addr_vf(hw, mc_addr_list);
299 DEBUGOUT1("Hash value = 0x%03X\n", hash_value);
300 hash_list[i] = hash_value & 0x0FFF;
301 mc_addr_list += ETH_ADDR_LEN;
302 }
303
304 mbx->ops.write_posted(hw, msgbuf, E1000_VFMAILBOX_SIZE, 0);
305}
#define ETH_ADDR_LEN
#define E1000_VFMAILBOX_SIZE
Definition igbvf_mbx.h:51
#define E1000_VF_SET_MULTICAST_OVERFLOW
Definition igbvf_mbx.h:68
#define E1000_VT_MSGINFO_SHIFT
Definition igbvf_mbx.h:60
#define E1000_VF_SET_MULTICAST
Definition igbvf_mbx.h:66
#define DEBUGOUT1(S, A...)
Definition igbvf_osdep.h:66
static u32 igbvf_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
igbvf_hash_mc_addr_vf - Generate a multicast hash value @hw: pointer to the HW structure @mc_addr: po...
Definition igbvf_vf.c:234
#define u16
Definition vga.h:20

References DEBUGFUNC, DEBUGOUT1, E1000_VF_SET_MULTICAST, E1000_VF_SET_MULTICAST_OVERFLOW, E1000_VFMAILBOX_SIZE, E1000_VT_MSGINFO_SHIFT, ETH_ADDR_LEN, igbvf_hash_mc_addr_vf(), e1000_mbx_info::ops, u16, u32, u8, and e1000_mbx_operations::write_posted.

Referenced by igbvf_init_mac_params_vf().

◆ igbvf_rar_set_vf() [1/2]

void igbvf_rar_set_vf ( struct e1000_hw * ,
u8 * ,
u32  )
static

References u32, and u8.

Referenced by igbvf_init_hw_vf(), and igbvf_init_mac_params_vf().

◆ igbvf_read_mac_addr_vf()

s32 igbvf_read_mac_addr_vf ( struct e1000_hw * hw)
static

igbvf_read_mac_addr_vf - Read device MAC address @hw: pointer to the HW structure

Definition at line 384 of file igbvf_vf.c.

385{
386 int i;
387
388 for (i = 0; i < ETH_ADDR_LEN; i++)
389 hw->mac.addr[i] = hw->mac.perm_addr[i];
390
391 return E1000_SUCCESS;
392}

References E1000_SUCCESS, and ETH_ADDR_LEN.

Referenced by igbvf_init_mac_params_vf(), and igbvf_rar_set_vf().

◆ igbvf_init_function_pointers_vf()

void igbvf_init_function_pointers_vf ( struct e1000_hw * hw)

igbvf_init_function_pointers_vf - Inits function pointers @hw: pointer to the HW structure

Definition at line 83 of file igbvf_vf.c.

84{
85 DEBUGFUNC("igbvf_init_function_pointers_vf");
86
87 hw->mac.ops.init_params = igbvf_init_mac_params_vf;
88 hw->mbx.ops.init_params = igbvf_init_mbx_params_vf;
89}
s32 igbvf_init_mbx_params_vf(struct e1000_hw *hw)
igbvf_init_mbx_params_vf - set initial values for vf mailbox @hw: pointer to the HW structure
Definition igbvf_mbx.c:377
static s32 igbvf_init_mac_params_vf(struct e1000_hw *hw)
igbvf_init_mac_params_vf - Inits MAC params @hw: pointer to the HW structure
Definition igbvf_vf.c:48

References DEBUGFUNC, igbvf_init_mac_params_vf(), and igbvf_init_mbx_params_vf().

Referenced by igbvf_sw_init().

◆ igbvf_rar_set_vf() [2/2]

void igbvf_rar_set_vf ( struct e1000_hw * hw,
u8 * addr,
u32 index __unused )
static

igbvf_rar_set_vf - set device MAC address @hw: pointer to the HW structure @addr: pointer to the receive address @index receive address array register

Definition at line 202 of file igbvf_vf.c.

203{
204 struct e1000_mbx_info *mbx = &hw->mbx;
205 u32 msgbuf[3];
206 u8 *msg_addr = (u8 *)(&msgbuf[1]);
207 s32 ret_val;
208
209 memset(msgbuf, 0, 12);
210 msgbuf[0] = E1000_VF_SET_MAC_ADDR;
211 memcpy(msg_addr, addr, 6);
212 ret_val = mbx->ops.write_posted(hw, msgbuf, 3, 0);
213
214 if (!ret_val)
215 ret_val = mbx->ops.read_posted(hw, msgbuf, 3, 0);
216
217 msgbuf[0] &= ~E1000_VT_MSGTYPE_CTS;
218
219 /* if nacked the address was rejected, use "perm_addr" */
220 if (!ret_val &&
223}
#define E1000_VF_SET_MAC_ADDR
Definition igbvf_mbx.h:65
void * memset(void *dest, int character, size_t len) __nonnull

References __unused, addr, E1000_VF_SET_MAC_ADDR, E1000_VT_MSGTYPE_CTS, E1000_VT_MSGTYPE_NACK, igbvf_read_mac_addr_vf(), index, memcpy(), memset(), e1000_mbx_info::ops, e1000_mbx_operations::read_posted, u32, u8, and e1000_mbx_operations::write_posted.

◆ igbvf_hash_mc_addr_vf()

u32 igbvf_hash_mc_addr_vf ( struct e1000_hw * hw,
u8 * mc_addr )
static

igbvf_hash_mc_addr_vf - Generate a multicast hash value @hw: pointer to the HW structure @mc_addr: pointer to a multicast address

Generates a multicast address hash value which is used to determine the multicast filter table array address and new table value. See igbvf_mta_set_generic()

Definition at line 234 of file igbvf_vf.c.

235{
236 u32 hash_value, hash_mask;
237 u8 bit_shift = 0;
238
239 DEBUGFUNC("igbvf_hash_mc_addr_generic");
240
241 /* Register count multiplied by bits per register */
242 hash_mask = (hw->mac.mta_reg_count * 32) - 1;
243
244 /*
245 * The bit_shift is the number of left-shifts
246 * where 0xFF would still fall within the hash mask.
247 */
248 while (hash_mask >> bit_shift != 0xFF)
249 bit_shift++;
250
251 hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
252 (((u16) mc_addr[5]) << bit_shift)));
253
254 return hash_value;
255}

References DEBUGFUNC, u16, u32, and u8.

Referenced by igbvf_update_mc_addr_list_vf().

◆ igbvf_vfta_set_vf()

void igbvf_vfta_set_vf ( struct e1000_hw * hw,
u16 vid,
bool set )

igbvf_vfta_set_vf - Set/Unset vlan filter table address @hw: pointer to the HW structure @vid: determines the vfta register and bit to set/unset @set: if true then set bit, else clear bit

Definition at line 313 of file igbvf_vf.c.

314{
315 struct e1000_mbx_info *mbx = &hw->mbx;
316 u32 msgbuf[2];
317
318 msgbuf[0] = E1000_VF_SET_VLAN;
319 msgbuf[1] = vid;
320 /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */
321 if (set)
322 msgbuf[0] |= E1000_VF_SET_VLAN_ADD;
323
324 mbx->ops.write_posted(hw, msgbuf, 2, 0);
325}
#define E1000_VF_SET_VLAN_ADD
Definition igbvf_mbx.h:70
#define E1000_VF_SET_VLAN
Definition igbvf_mbx.h:69
struct option_descriptor set[0]
Definition nvo_cmd.c:112

References E1000_VF_SET_VLAN, E1000_VF_SET_VLAN_ADD, e1000_mbx_info::ops, set, u16, u32, and e1000_mbx_operations::write_posted.

◆ igbvf_rlpml_set_vf()

void igbvf_rlpml_set_vf ( struct e1000_hw * hw,
u16 max_size )

igbvf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size: value to assign to max frame size

Definition at line 331 of file igbvf_vf.c.

332{
333 struct e1000_mbx_info *mbx = &hw->mbx;
334 u32 msgbuf[2];
335
336 msgbuf[0] = E1000_VF_SET_LPE;
337 msgbuf[1] = max_size;
338
339 mbx->ops.write_posted(hw, msgbuf, 2, 0);
340}
#define E1000_VF_SET_LPE
Definition igbvf_mbx.h:71

References E1000_VF_SET_LPE, e1000_mbx_info::ops, u16, u32, and e1000_mbx_operations::write_posted.

Referenced by igbvf_configure_rx().

◆ igbvf_promisc_set_vf()

s32 igbvf_promisc_set_vf ( struct e1000_hw * hw,
enum e1000_promisc_type type )

igbvf_promisc_set_vf - Set flags for Unicast or Multicast promisc @hw: pointer to the HW structure @uni: boolean indicating unicast promisc status @multi: boolean indicating multicast promisc status

Definition at line 348 of file igbvf_vf.c.

349{
350 struct e1000_mbx_info *mbx = &hw->mbx;
351 u32 msgbuf = E1000_VF_SET_PROMISC;
352 s32 ret_val;
353
354 switch (type) {
357 break;
360 /* Fall through */
364 break;
365 default:
366 return -E1000_ERR_MAC_INIT;
367 }
368
369 ret_val = mbx->ops.write_posted(hw, &msgbuf, 1, 0);
370
371 if (!ret_val)
372 ret_val = mbx->ops.read_posted(hw, &msgbuf, 1, 0);
373
374 if (!ret_val && !(msgbuf & E1000_VT_MSGTYPE_ACK))
375 ret_val = -E1000_ERR_MAC_INIT;
376
377 return ret_val;
378}
uint32_t type
Operating system type.
Definition ena.h:1
#define E1000_VF_SET_PROMISC_UNICAST
Definition igbvf_mbx.h:73
#define E1000_VF_SET_PROMISC
Definition igbvf_mbx.h:72
#define E1000_VF_SET_PROMISC_MULTICAST
Definition igbvf_mbx.h:74
@ e1000_promisc_enabled
Definition igbvf_vf.h:337
@ e1000_promisc_unicast
Definition igbvf_vf.h:335
@ e1000_promisc_disabled
Definition igbvf_vf.h:334
@ e1000_promisc_multicast
Definition igbvf_vf.h:336

References E1000_ERR_MAC_INIT, e1000_promisc_disabled, e1000_promisc_enabled, e1000_promisc_multicast, e1000_promisc_unicast, E1000_VF_SET_PROMISC, E1000_VF_SET_PROMISC_MULTICAST, E1000_VF_SET_PROMISC_UNICAST, E1000_VT_MSGTYPE_ACK, e1000_mbx_info::ops, e1000_mbx_operations::read_posted, type, u32, and e1000_mbx_operations::write_posted.