1 /*******************************************************************************
3 Copyright (c) 2013 - 2015, Intel Corporation
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
32 ***************************************************************************/
37 * fm10k_stop_hw_vf - Stop Tx/Rx units
38 * @hw: pointer to hardware structure
41 STATIC s32 fm10k_stop_hw_vf(struct fm10k_hw *hw)
43 u8 *perm_addr = hw->mac.perm_addr;
44 u32 bal = 0, bah = 0, tdlen;
48 DEBUGFUNC("fm10k_stop_hw_vf");
50 /* we need to disable the queues before taking further steps */
51 err = fm10k_stop_hw_generic(hw);
52 if (err && err != FM10K_ERR_REQUESTS_PENDING)
55 /* If permanent address is set then we need to restore it */
56 if (IS_VALID_ETHER_ADDR(perm_addr)) {
57 bal = (((u32)perm_addr[3]) << 24) |
58 (((u32)perm_addr[4]) << 16) |
59 (((u32)perm_addr[5]) << 8);
60 bah = (((u32)0xFF) << 24) |
61 (((u32)perm_addr[0]) << 16) |
62 (((u32)perm_addr[1]) << 8) |
66 /* restore default itr_scale for next VF initialization */
67 tdlen = hw->mac.itr_scale << FM10K_TDLEN_ITR_SCALE_SHIFT;
69 /* The queues have already been disabled so we just need to
70 * update their base address registers
72 for (i = 0; i < hw->mac.max_queues; i++) {
73 FM10K_WRITE_REG(hw, FM10K_TDBAL(i), bal);
74 FM10K_WRITE_REG(hw, FM10K_TDBAH(i), bah);
75 FM10K_WRITE_REG(hw, FM10K_RDBAL(i), bal);
76 FM10K_WRITE_REG(hw, FM10K_RDBAH(i), bah);
77 /* Restore ITR scale in software-defined mechanism in TDLEN
78 * for next VF initialization. See definition of
79 * FM10K_TDLEN_ITR_SCALE_SHIFT for more details on the use of
82 FM10K_WRITE_REG(hw, FM10K_TDLEN(i), tdlen);
89 * fm10k_reset_hw_vf - VF hardware reset
90 * @hw: pointer to hardware structure
92 * This function should return the hardware to a state similar to the
93 * one it is in after just being initialized.
95 STATIC s32 fm10k_reset_hw_vf(struct fm10k_hw *hw)
99 DEBUGFUNC("fm10k_reset_hw_vf");
101 /* shut down queues we own and reset DMA configuration */
102 err = fm10k_stop_hw_vf(hw);
103 if (err == FM10K_ERR_REQUESTS_PENDING)
104 hw->mac.reset_while_pending++;
108 /* Inititate VF reset */
109 FM10K_WRITE_REG(hw, FM10K_VFCTRL, FM10K_VFCTRL_RST);
111 /* Flush write and allow 100us for reset to complete */
112 FM10K_WRITE_FLUSH(hw);
113 usec_delay(FM10K_RESET_TIMEOUT);
115 /* Clear reset bit and verify it was cleared */
116 FM10K_WRITE_REG(hw, FM10K_VFCTRL, 0);
117 if (FM10K_READ_REG(hw, FM10K_VFCTRL) & FM10K_VFCTRL_RST)
118 return FM10K_ERR_RESET_FAILED;
120 return FM10K_SUCCESS;
124 * fm10k_init_hw_vf - VF hardware initialization
125 * @hw: pointer to hardware structure
128 STATIC s32 fm10k_init_hw_vf(struct fm10k_hw *hw)
130 u32 tqdloc, tqdloc0 = ~FM10K_READ_REG(hw, FM10K_TQDLOC(0));
134 DEBUGFUNC("fm10k_init_hw_vf");
136 /* verify we have at least 1 queue */
137 if (!~FM10K_READ_REG(hw, FM10K_TXQCTL(0)) ||
138 !~FM10K_READ_REG(hw, FM10K_RXQCTL(0))) {
139 err = FM10K_ERR_NO_RESOURCES;
140 goto reset_max_queues;
143 /* determine how many queues we have */
144 for (i = 1; tqdloc0 && (i < FM10K_MAX_QUEUES_POOL); i++) {
145 /* verify the Descriptor cache offsets are increasing */
146 tqdloc = ~FM10K_READ_REG(hw, FM10K_TQDLOC(i));
147 if (!tqdloc || (tqdloc == tqdloc0))
150 /* check to verify the PF doesn't own any of our queues */
151 if (!~FM10K_READ_REG(hw, FM10K_TXQCTL(i)) ||
152 !~FM10K_READ_REG(hw, FM10K_RXQCTL(i)))
156 /* shut down queues we own and reset DMA configuration */
157 err = fm10k_disable_queues_generic(hw, i);
159 goto reset_max_queues;
161 /* record maximum queue count */
162 hw->mac.max_queues = i;
164 /* fetch default VLAN and ITR scale */
165 hw->mac.default_vid = (FM10K_READ_REG(hw, FM10K_TXQCTL(0)) &
166 FM10K_TXQCTL_VID_MASK) >> FM10K_TXQCTL_VID_SHIFT;
167 /* Read the ITR scale from TDLEN. See the definition of
168 * FM10K_TDLEN_ITR_SCALE_SHIFT for more information about how TDLEN is
171 hw->mac.itr_scale = (FM10K_READ_REG(hw, FM10K_TDLEN(0)) &
172 FM10K_TDLEN_ITR_SCALE_MASK) >>
173 FM10K_TDLEN_ITR_SCALE_SHIFT;
175 return FM10K_SUCCESS;
178 hw->mac.max_queues = 0;
183 #ifndef NO_IS_SLOT_APPROPRIATE_CHECK
185 * fm10k_is_slot_appropriate_vf - Indicate appropriate slot for this SKU
186 * @hw: pointer to hardware structure
188 * Looks at the PCIe bus info to confirm whether or not this slot can support
189 * the necessary bandwidth for this device. Since the VF has no control over
190 * the "slot" it is in, always indicate that the slot is appropriate.
192 STATIC bool fm10k_is_slot_appropriate_vf(struct fm10k_hw *hw)
194 UNREFERENCED_1PARAMETER(hw);
195 DEBUGFUNC("fm10k_is_slot_appropriate_vf");
201 /* This structure defines the attibutes to be parsed below */
202 const struct fm10k_tlv_attr fm10k_mac_vlan_msg_attr[] = {
203 FM10K_TLV_ATTR_U32(FM10K_MAC_VLAN_MSG_VLAN),
204 FM10K_TLV_ATTR_BOOL(FM10K_MAC_VLAN_MSG_SET),
205 FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_MAC),
206 FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_DEFAULT_MAC),
207 FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_MULTICAST),
212 * fm10k_update_vlan_vf - Update status of VLAN ID in VLAN filter table
213 * @hw: pointer to hardware structure
214 * @vid: VLAN ID to add to table
215 * @vsi: Reserved, should always be 0
216 * @set: Indicates if this is a set or clear operation
218 * This function adds or removes the corresponding VLAN ID from the VLAN
219 * filter table for this VF.
221 STATIC s32 fm10k_update_vlan_vf(struct fm10k_hw *hw, u32 vid, u8 vsi, bool set)
223 struct fm10k_mbx_info *mbx = &hw->mbx;
226 /* verify the index is not set */
228 return FM10K_ERR_PARAM;
230 /* clever trick to verify reserved bits in both vid and length */
231 if ((vid << 16 | vid) >> 28)
232 return FM10K_ERR_PARAM;
234 /* encode set bit into the VLAN ID */
236 vid |= FM10K_VLAN_CLEAR;
238 /* generate VLAN request */
239 fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
240 fm10k_tlv_attr_put_u32(msg, FM10K_MAC_VLAN_MSG_VLAN, vid);
242 /* load onto outgoing mailbox */
243 return mbx->ops.enqueue_tx(hw, mbx, msg);
247 * fm10k_msg_mac_vlan_vf - Read device MAC address from mailbox message
248 * @hw: pointer to the HW structure
249 * @results: Attributes for message
250 * @mbx: unused mailbox data
252 * This function should determine the MAC address for the VF
254 s32 fm10k_msg_mac_vlan_vf(struct fm10k_hw *hw, u32 **results,
255 struct fm10k_mbx_info *mbx)
257 u8 perm_addr[ETH_ALEN];
261 UNREFERENCED_1PARAMETER(mbx);
262 DEBUGFUNC("fm10k_msg_mac_vlan_vf");
264 /* record MAC address requested */
265 err = fm10k_tlv_attr_get_mac_vlan(
266 results[FM10K_MAC_VLAN_MSG_DEFAULT_MAC],
271 memcpy(hw->mac.perm_addr, perm_addr, ETH_ALEN);
272 hw->mac.default_vid = vid & (FM10K_VLAN_TABLE_VID_MAX - 1);
273 hw->mac.vlan_override = !!(vid & FM10K_VLAN_OVERRIDE);
275 return FM10K_SUCCESS;
279 * fm10k_read_mac_addr_vf - Read device MAC address
280 * @hw: pointer to the HW structure
282 * This function should determine the MAC address for the VF
284 STATIC s32 fm10k_read_mac_addr_vf(struct fm10k_hw *hw)
286 u8 perm_addr[ETH_ALEN];
289 DEBUGFUNC("fm10k_read_mac_addr_vf");
291 base_addr = FM10K_READ_REG(hw, FM10K_TDBAL(0));
293 /* last byte should be 0 */
295 return FM10K_ERR_INVALID_MAC_ADDR;
297 perm_addr[3] = (u8)(base_addr >> 24);
298 perm_addr[4] = (u8)(base_addr >> 16);
299 perm_addr[5] = (u8)(base_addr >> 8);
301 base_addr = FM10K_READ_REG(hw, FM10K_TDBAH(0));
303 /* first byte should be all 1's */
304 if ((~base_addr) >> 24)
305 return FM10K_ERR_INVALID_MAC_ADDR;
307 perm_addr[0] = (u8)(base_addr >> 16);
308 perm_addr[1] = (u8)(base_addr >> 8);
309 perm_addr[2] = (u8)(base_addr);
311 memcpy(hw->mac.perm_addr, perm_addr, ETH_ALEN);
312 memcpy(hw->mac.addr, perm_addr, ETH_ALEN);
314 return FM10K_SUCCESS;
318 * fm10k_update_uc_addr_vf - Update device unicast addresses
319 * @hw: pointer to the HW structure
321 * @mac: MAC address to add/remove from table
322 * @vid: VLAN ID to add/remove from table
323 * @add: Indicates if this is an add or remove operation
324 * @flags: flags field to indicate add and secure - unused
326 * This function is used to add or remove unicast MAC addresses for
329 STATIC s32 fm10k_update_uc_addr_vf(struct fm10k_hw *hw, u16 glort,
330 const u8 *mac, u16 vid, bool add, u8 flags)
332 struct fm10k_mbx_info *mbx = &hw->mbx;
335 DEBUGFUNC("fm10k_update_uc_addr_vf");
337 UNREFERENCED_2PARAMETER(glort, flags);
339 /* verify VLAN ID is valid */
340 if (vid >= FM10K_VLAN_TABLE_VID_MAX)
341 return FM10K_ERR_PARAM;
343 /* verify MAC address is valid */
344 if (!IS_VALID_ETHER_ADDR(mac))
345 return FM10K_ERR_PARAM;
347 /* verify we are not locked down on the MAC address */
348 if (IS_VALID_ETHER_ADDR(hw->mac.perm_addr) &&
349 memcmp(hw->mac.perm_addr, mac, ETH_ALEN))
350 return FM10K_ERR_PARAM;
352 /* add bit to notify us if this is a set or clear operation */
354 vid |= FM10K_VLAN_CLEAR;
356 /* generate VLAN request */
357 fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
358 fm10k_tlv_attr_put_mac_vlan(msg, FM10K_MAC_VLAN_MSG_MAC, mac, vid);
360 /* load onto outgoing mailbox */
361 return mbx->ops.enqueue_tx(hw, mbx, msg);
365 * fm10k_update_mc_addr_vf - Update device multicast addresses
366 * @hw: pointer to the HW structure
368 * @mac: MAC address to add/remove from table
369 * @vid: VLAN ID to add/remove from table
370 * @add: Indicates if this is an add or remove operation
372 * This function is used to add or remove multicast MAC addresses for
375 STATIC s32 fm10k_update_mc_addr_vf(struct fm10k_hw *hw, u16 glort,
376 const u8 *mac, u16 vid, bool add)
378 struct fm10k_mbx_info *mbx = &hw->mbx;
381 DEBUGFUNC("fm10k_update_uc_addr_vf");
383 UNREFERENCED_1PARAMETER(glort);
385 /* verify VLAN ID is valid */
386 if (vid >= FM10K_VLAN_TABLE_VID_MAX)
387 return FM10K_ERR_PARAM;
389 /* verify multicast address is valid */
390 if (!IS_MULTICAST_ETHER_ADDR(mac))
391 return FM10K_ERR_PARAM;
393 /* add bit to notify us if this is a set or clear operation */
395 vid |= FM10K_VLAN_CLEAR;
397 /* generate VLAN request */
398 fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
399 fm10k_tlv_attr_put_mac_vlan(msg, FM10K_MAC_VLAN_MSG_MULTICAST,
402 /* load onto outgoing mailbox */
403 return mbx->ops.enqueue_tx(hw, mbx, msg);
407 * fm10k_update_int_moderator_vf - Request update of interrupt moderator list
408 * @hw: pointer to hardware structure
410 * This function will issue a request to the PF to rescan our MSI-X table
411 * and to update the interrupt moderator linked list.
413 STATIC void fm10k_update_int_moderator_vf(struct fm10k_hw *hw)
415 struct fm10k_mbx_info *mbx = &hw->mbx;
418 /* generate MSI-X request */
419 fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MSIX);
421 /* load onto outgoing mailbox */
422 mbx->ops.enqueue_tx(hw, mbx, msg);
425 /* This structure defines the attibutes to be parsed below */
426 const struct fm10k_tlv_attr fm10k_lport_state_msg_attr[] = {
427 FM10K_TLV_ATTR_BOOL(FM10K_LPORT_STATE_MSG_DISABLE),
428 FM10K_TLV_ATTR_U8(FM10K_LPORT_STATE_MSG_XCAST_MODE),
429 FM10K_TLV_ATTR_BOOL(FM10K_LPORT_STATE_MSG_READY),
434 * fm10k_msg_lport_state_vf - Message handler for lport_state message from PF
435 * @hw: Pointer to hardware structure
436 * @results: pointer array containing parsed data
437 * @mbx: Pointer to mailbox information structure
439 * This handler is meant to capture the indication from the PF that we
440 * are ready to bring up the interface.
442 s32 fm10k_msg_lport_state_vf(struct fm10k_hw *hw, u32 **results,
443 struct fm10k_mbx_info *mbx)
445 UNREFERENCED_1PARAMETER(mbx);
446 DEBUGFUNC("fm10k_msg_lport_state_vf");
448 hw->mac.dglort_map = !results[FM10K_LPORT_STATE_MSG_READY] ?
449 FM10K_DGLORTMAP_NONE : FM10K_DGLORTMAP_ZERO;
451 return FM10K_SUCCESS;
455 * fm10k_update_lport_state_vf - Update device state in lower device
456 * @hw: pointer to the HW structure
458 * @count: number of logical ports to enable - unused (always 1)
459 * @enable: boolean value indicating if this is an enable or disable request
461 * Notify the lower device of a state change. If the lower device is
462 * enabled we can add filters, if it is disabled all filters for this
463 * logical port are flushed.
465 STATIC s32 fm10k_update_lport_state_vf(struct fm10k_hw *hw, u16 glort,
466 u16 count, bool enable)
468 struct fm10k_mbx_info *mbx = &hw->mbx;
471 UNREFERENCED_2PARAMETER(glort, count);
472 DEBUGFUNC("fm10k_update_lport_state_vf");
474 /* reset glort mask 0 as we have to wait to be enabled */
475 hw->mac.dglort_map = FM10K_DGLORTMAP_NONE;
477 /* generate port state request */
478 fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
480 fm10k_tlv_attr_put_bool(msg, FM10K_LPORT_STATE_MSG_DISABLE);
482 /* load onto outgoing mailbox */
483 return mbx->ops.enqueue_tx(hw, mbx, msg);
487 * fm10k_update_xcast_mode_vf - Request update of multicast mode
488 * @hw: pointer to hardware structure
490 * @mode: integer value indicating mode being requested
492 * This function will attempt to request a higher mode for the port
493 * so that it can enable either multicast, multicast promiscuous, or
494 * promiscuous mode of operation.
496 STATIC s32 fm10k_update_xcast_mode_vf(struct fm10k_hw *hw, u16 glort, u8 mode)
498 struct fm10k_mbx_info *mbx = &hw->mbx;
501 UNREFERENCED_1PARAMETER(glort);
502 DEBUGFUNC("fm10k_update_xcast_mode_vf");
504 if (mode > FM10K_XCAST_MODE_NONE)
505 return FM10K_ERR_PARAM;
507 /* generate message requesting to change xcast mode */
508 fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
509 fm10k_tlv_attr_put_u8(msg, FM10K_LPORT_STATE_MSG_XCAST_MODE, mode);
511 /* load onto outgoing mailbox */
512 return mbx->ops.enqueue_tx(hw, mbx, msg);
515 const struct fm10k_tlv_attr fm10k_1588_msg_attr[] = {
516 FM10K_TLV_ATTR_U64(FM10K_1588_MSG_CLK_OFFSET),
520 /* currently there is no shared 1588 message handler */
523 * fm10k_update_hw_stats_vf - Updates hardware related statistics of VF
524 * @hw: pointer to hardware structure
525 * @stats: pointer to statistics structure
527 * This function collects and aggregates per queue hardware statistics.
529 STATIC void fm10k_update_hw_stats_vf(struct fm10k_hw *hw,
530 struct fm10k_hw_stats *stats)
532 DEBUGFUNC("fm10k_update_hw_stats_vf");
534 fm10k_update_hw_stats_q(hw, stats->q, 0, hw->mac.max_queues);
538 * fm10k_rebind_hw_stats_vf - Resets base for hardware statistics of VF
539 * @hw: pointer to hardware structure
540 * @stats: pointer to the stats structure to update
542 * This function resets the base for queue hardware statistics.
544 STATIC void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw,
545 struct fm10k_hw_stats *stats)
547 DEBUGFUNC("fm10k_rebind_hw_stats_vf");
549 /* Unbind Queue Statistics */
550 fm10k_unbind_hw_stats_q(stats->q, 0, hw->mac.max_queues);
552 /* Reinitialize bases for all stats */
553 fm10k_update_hw_stats_vf(hw, stats);
557 * fm10k_configure_dglort_map_vf - Configures GLORT entry and queues
558 * @hw: pointer to hardware structure
559 * @dglort: pointer to dglort configuration structure
561 * Reads the configuration structure contained in dglort_cfg and uses
562 * that information to then populate a DGLORTMAP/DEC entry and the queues
563 * to which it has been assigned.
565 STATIC s32 fm10k_configure_dglort_map_vf(struct fm10k_hw *hw,
566 struct fm10k_dglort_cfg *dglort)
568 UNREFERENCED_1PARAMETER(hw);
569 DEBUGFUNC("fm10k_configure_dglort_map_vf");
571 /* verify the dglort pointer */
573 return FM10K_ERR_PARAM;
575 /* stub for now until we determine correct message for this */
577 return FM10K_SUCCESS;
581 * fm10k_adjust_systime_vf - Adjust systime frequency
582 * @hw: pointer to hardware structure
583 * @ppb: adjustment rate in parts per billion
585 * This function takes an adjustment rate in parts per billion and will
586 * verify that this value is 0 as the VF cannot support adjusting the
589 * If the ppb value is non-zero the return is ERR_PARAM else success
591 STATIC s32 fm10k_adjust_systime_vf(struct fm10k_hw *hw, s32 ppb)
593 UNREFERENCED_1PARAMETER(hw);
594 DEBUGFUNC("fm10k_adjust_systime_vf");
596 /* The VF cannot adjust the clock frequency, however it should
597 * already have a syntonic clock with whichever host interface is
598 * running as the master for the host interface clock domain so
599 * there should be not frequency adjustment necessary.
601 return ppb ? FM10K_ERR_PARAM : FM10K_SUCCESS;
605 * fm10k_read_systime_vf - Reads value of systime registers
606 * @hw: pointer to the hardware structure
608 * Function reads the content of 2 registers, combined to represent a 64 bit
609 * value measured in nanoseconds. In order to guarantee the value is accurate
610 * we check the 32 most significant bits both before and after reading the
611 * 32 least significant bits to verify they didn't change as we were reading
614 static u64 fm10k_read_systime_vf(struct fm10k_hw *hw)
616 u32 systime_l, systime_h, systime_tmp;
618 systime_h = fm10k_read_reg(hw, FM10K_VFSYSTIME + 1);
621 systime_tmp = systime_h;
622 systime_l = fm10k_read_reg(hw, FM10K_VFSYSTIME);
623 systime_h = fm10k_read_reg(hw, FM10K_VFSYSTIME + 1);
624 } while (systime_tmp != systime_h);
626 return ((u64)systime_h << 32) | systime_l;
629 static const struct fm10k_msg_data fm10k_msg_data_vf[] = {
630 FM10K_TLV_MSG_TEST_HANDLER(fm10k_tlv_msg_test),
631 FM10K_VF_MSG_MAC_VLAN_HANDLER(fm10k_msg_mac_vlan_vf),
632 FM10K_VF_MSG_LPORT_STATE_HANDLER(fm10k_msg_lport_state_vf),
633 FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error),
637 * fm10k_init_ops_vf - Inits func ptrs and MAC type
638 * @hw: pointer to hardware structure
640 * Initialize the function pointers and assign the MAC type for VF.
641 * Does not touch the hardware.
643 s32 fm10k_init_ops_vf(struct fm10k_hw *hw)
645 struct fm10k_mac_info *mac = &hw->mac;
647 DEBUGFUNC("fm10k_init_ops_vf");
649 fm10k_init_ops_generic(hw);
651 mac->ops.reset_hw = &fm10k_reset_hw_vf;
652 mac->ops.init_hw = &fm10k_init_hw_vf;
653 mac->ops.start_hw = &fm10k_start_hw_generic;
654 mac->ops.stop_hw = &fm10k_stop_hw_vf;
655 #ifndef NO_IS_SLOT_APPROPRIATE_CHECK
656 mac->ops.is_slot_appropriate = &fm10k_is_slot_appropriate_vf;
658 mac->ops.update_vlan = &fm10k_update_vlan_vf;
659 mac->ops.read_mac_addr = &fm10k_read_mac_addr_vf;
660 mac->ops.update_uc_addr = &fm10k_update_uc_addr_vf;
661 mac->ops.update_mc_addr = &fm10k_update_mc_addr_vf;
662 mac->ops.update_xcast_mode = &fm10k_update_xcast_mode_vf;
663 mac->ops.update_int_moderator = &fm10k_update_int_moderator_vf;
664 mac->ops.update_lport_state = &fm10k_update_lport_state_vf;
665 mac->ops.update_hw_stats = &fm10k_update_hw_stats_vf;
666 mac->ops.rebind_hw_stats = &fm10k_rebind_hw_stats_vf;
667 mac->ops.configure_dglort_map = &fm10k_configure_dglort_map_vf;
668 mac->ops.get_host_state = &fm10k_get_host_state_generic;
669 mac->ops.adjust_systime = &fm10k_adjust_systime_vf;
670 mac->ops.read_systime = &fm10k_read_systime_vf;
672 mac->max_msix_vectors = fm10k_get_pcie_msix_count_generic(hw);
674 return fm10k_pfvf_mbx_init(hw, &hw->mbx, fm10k_msg_data_vf, 0);