fm10k_vf.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /* Intel Ethernet Switch Host Interface Driver
  2. * Copyright(c) 2013 - 2015 Intel Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * The full GNU General Public License is included in this distribution in
  14. * the file called "COPYING".
  15. *
  16. * Contact Information:
  17. * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  18. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  19. */
  20. #include "fm10k_vf.h"
  21. /**
  22. * fm10k_stop_hw_vf - Stop Tx/Rx units
  23. * @hw: pointer to hardware structure
  24. *
  25. **/
  26. static s32 fm10k_stop_hw_vf(struct fm10k_hw *hw)
  27. {
  28. u8 *perm_addr = hw->mac.perm_addr;
  29. u32 bal = 0, bah = 0;
  30. s32 err;
  31. u16 i;
  32. /* we need to disable the queues before taking further steps */
  33. err = fm10k_stop_hw_generic(hw);
  34. if (err)
  35. return err;
  36. /* If permanent address is set then we need to restore it */
  37. if (is_valid_ether_addr(perm_addr)) {
  38. bal = (((u32)perm_addr[3]) << 24) |
  39. (((u32)perm_addr[4]) << 16) |
  40. (((u32)perm_addr[5]) << 8);
  41. bah = (((u32)0xFF) << 24) |
  42. (((u32)perm_addr[0]) << 16) |
  43. (((u32)perm_addr[1]) << 8) |
  44. ((u32)perm_addr[2]);
  45. }
  46. /* The queues have already been disabled so we just need to
  47. * update their base address registers
  48. */
  49. for (i = 0; i < hw->mac.max_queues; i++) {
  50. fm10k_write_reg(hw, FM10K_TDBAL(i), bal);
  51. fm10k_write_reg(hw, FM10K_TDBAH(i), bah);
  52. fm10k_write_reg(hw, FM10K_RDBAL(i), bal);
  53. fm10k_write_reg(hw, FM10K_RDBAH(i), bah);
  54. }
  55. return 0;
  56. }
  57. /**
  58. * fm10k_reset_hw_vf - VF hardware reset
  59. * @hw: pointer to hardware structure
  60. *
  61. * This function should return the hardware to a state similar to the
  62. * one it is in after just being initialized.
  63. **/
  64. static s32 fm10k_reset_hw_vf(struct fm10k_hw *hw)
  65. {
  66. s32 err;
  67. /* shut down queues we own and reset DMA configuration */
  68. err = fm10k_stop_hw_vf(hw);
  69. if (err)
  70. return err;
  71. /* Inititate VF reset */
  72. fm10k_write_reg(hw, FM10K_VFCTRL, FM10K_VFCTRL_RST);
  73. /* Flush write and allow 100us for reset to complete */
  74. fm10k_write_flush(hw);
  75. udelay(FM10K_RESET_TIMEOUT);
  76. /* Clear reset bit and verify it was cleared */
  77. fm10k_write_reg(hw, FM10K_VFCTRL, 0);
  78. if (fm10k_read_reg(hw, FM10K_VFCTRL) & FM10K_VFCTRL_RST)
  79. err = FM10K_ERR_RESET_FAILED;
  80. return err;
  81. }
  82. /**
  83. * fm10k_init_hw_vf - VF hardware initialization
  84. * @hw: pointer to hardware structure
  85. *
  86. **/
  87. static s32 fm10k_init_hw_vf(struct fm10k_hw *hw)
  88. {
  89. u32 tqdloc, tqdloc0 = ~fm10k_read_reg(hw, FM10K_TQDLOC(0));
  90. s32 err;
  91. u16 i;
  92. /* assume we always have at least 1 queue */
  93. for (i = 1; tqdloc0 && (i < FM10K_MAX_QUEUES_POOL); i++) {
  94. /* verify the Descriptor cache offsets are increasing */
  95. tqdloc = ~fm10k_read_reg(hw, FM10K_TQDLOC(i));
  96. if (!tqdloc || (tqdloc == tqdloc0))
  97. break;
  98. /* check to verify the PF doesn't own any of our queues */
  99. if (!~fm10k_read_reg(hw, FM10K_TXQCTL(i)) ||
  100. !~fm10k_read_reg(hw, FM10K_RXQCTL(i)))
  101. break;
  102. }
  103. /* shut down queues we own and reset DMA configuration */
  104. err = fm10k_disable_queues_generic(hw, i);
  105. if (err)
  106. return err;
  107. /* record maximum queue count */
  108. hw->mac.max_queues = i;
  109. /* fetch default VLAN */
  110. hw->mac.default_vid = (fm10k_read_reg(hw, FM10K_TXQCTL(0)) &
  111. FM10K_TXQCTL_VID_MASK) >> FM10K_TXQCTL_VID_SHIFT;
  112. return 0;
  113. }
  114. /**
  115. * fm10k_is_slot_appropriate_vf - Indicate appropriate slot for this SKU
  116. * @hw: pointer to hardware structure
  117. *
  118. * Looks at the PCIe bus info to confirm whether or not this slot can support
  119. * the necessary bandwidth for this device. Since the VF has no control over
  120. * the "slot" it is in, always indicate that the slot is appropriate.
  121. **/
  122. static bool fm10k_is_slot_appropriate_vf(struct fm10k_hw *hw)
  123. {
  124. return true;
  125. }
  126. /* This structure defines the attibutes to be parsed below */
  127. const struct fm10k_tlv_attr fm10k_mac_vlan_msg_attr[] = {
  128. FM10K_TLV_ATTR_U32(FM10K_MAC_VLAN_MSG_VLAN),
  129. FM10K_TLV_ATTR_BOOL(FM10K_MAC_VLAN_MSG_SET),
  130. FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_MAC),
  131. FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_DEFAULT_MAC),
  132. FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_MULTICAST),
  133. FM10K_TLV_ATTR_LAST
  134. };
  135. /**
  136. * fm10k_update_vlan_vf - Update status of VLAN ID in VLAN filter table
  137. * @hw: pointer to hardware structure
  138. * @vid: VLAN ID to add to table
  139. * @vsi: Reserved, should always be 0
  140. * @set: Indicates if this is a set or clear operation
  141. *
  142. * This function adds or removes the corresponding VLAN ID from the VLAN
  143. * filter table for this VF.
  144. **/
  145. static s32 fm10k_update_vlan_vf(struct fm10k_hw *hw, u32 vid, u8 vsi, bool set)
  146. {
  147. struct fm10k_mbx_info *mbx = &hw->mbx;
  148. u32 msg[4];
  149. /* verify the index is not set */
  150. if (vsi)
  151. return FM10K_ERR_PARAM;
  152. /* verify upper 4 bits of vid and length are 0 */
  153. if ((vid << 16 | vid) >> 28)
  154. return FM10K_ERR_PARAM;
  155. /* encode set bit into the VLAN ID */
  156. if (!set)
  157. vid |= FM10K_VLAN_CLEAR;
  158. /* generate VLAN request */
  159. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
  160. fm10k_tlv_attr_put_u32(msg, FM10K_MAC_VLAN_MSG_VLAN, vid);
  161. /* load onto outgoing mailbox */
  162. return mbx->ops.enqueue_tx(hw, mbx, msg);
  163. }
  164. /**
  165. * fm10k_msg_mac_vlan_vf - Read device MAC address from mailbox message
  166. * @hw: pointer to the HW structure
  167. * @results: Attributes for message
  168. * @mbx: unused mailbox data
  169. *
  170. * This function should determine the MAC address for the VF
  171. **/
  172. s32 fm10k_msg_mac_vlan_vf(struct fm10k_hw *hw, u32 **results,
  173. struct fm10k_mbx_info *mbx)
  174. {
  175. u8 perm_addr[ETH_ALEN];
  176. u16 vid;
  177. s32 err;
  178. /* record MAC address requested */
  179. err = fm10k_tlv_attr_get_mac_vlan(
  180. results[FM10K_MAC_VLAN_MSG_DEFAULT_MAC],
  181. perm_addr, &vid);
  182. if (err)
  183. return err;
  184. ether_addr_copy(hw->mac.perm_addr, perm_addr);
  185. hw->mac.default_vid = vid & (FM10K_VLAN_TABLE_VID_MAX - 1);
  186. hw->mac.vlan_override = !!(vid & FM10K_VLAN_CLEAR);
  187. return 0;
  188. }
  189. /**
  190. * fm10k_read_mac_addr_vf - Read device MAC address
  191. * @hw: pointer to the HW structure
  192. *
  193. * This function should determine the MAC address for the VF
  194. **/
  195. static s32 fm10k_read_mac_addr_vf(struct fm10k_hw *hw)
  196. {
  197. u8 perm_addr[ETH_ALEN];
  198. u32 base_addr;
  199. base_addr = fm10k_read_reg(hw, FM10K_TDBAL(0));
  200. /* last byte should be 0 */
  201. if (base_addr << 24)
  202. return FM10K_ERR_INVALID_MAC_ADDR;
  203. perm_addr[3] = (u8)(base_addr >> 24);
  204. perm_addr[4] = (u8)(base_addr >> 16);
  205. perm_addr[5] = (u8)(base_addr >> 8);
  206. base_addr = fm10k_read_reg(hw, FM10K_TDBAH(0));
  207. /* first byte should be all 1's */
  208. if ((~base_addr) >> 24)
  209. return FM10K_ERR_INVALID_MAC_ADDR;
  210. perm_addr[0] = (u8)(base_addr >> 16);
  211. perm_addr[1] = (u8)(base_addr >> 8);
  212. perm_addr[2] = (u8)(base_addr);
  213. ether_addr_copy(hw->mac.perm_addr, perm_addr);
  214. ether_addr_copy(hw->mac.addr, perm_addr);
  215. return 0;
  216. }
  217. /**
  218. * fm10k_update_uc_addr_vf - Update device unicast addresses
  219. * @hw: pointer to the HW structure
  220. * @glort: unused
  221. * @mac: MAC address to add/remove from table
  222. * @vid: VLAN ID to add/remove from table
  223. * @add: Indicates if this is an add or remove operation
  224. * @flags: flags field to indicate add and secure - unused
  225. *
  226. * This function is used to add or remove unicast MAC addresses for
  227. * the VF.
  228. **/
  229. static s32 fm10k_update_uc_addr_vf(struct fm10k_hw *hw, u16 glort,
  230. const u8 *mac, u16 vid, bool add, u8 flags)
  231. {
  232. struct fm10k_mbx_info *mbx = &hw->mbx;
  233. u32 msg[7];
  234. /* verify VLAN ID is valid */
  235. if (vid >= FM10K_VLAN_TABLE_VID_MAX)
  236. return FM10K_ERR_PARAM;
  237. /* verify MAC address is valid */
  238. if (!is_valid_ether_addr(mac))
  239. return FM10K_ERR_PARAM;
  240. /* verify we are not locked down on the MAC address */
  241. if (is_valid_ether_addr(hw->mac.perm_addr) &&
  242. memcmp(hw->mac.perm_addr, mac, ETH_ALEN))
  243. return FM10K_ERR_PARAM;
  244. /* add bit to notify us if this is a set or clear operation */
  245. if (!add)
  246. vid |= FM10K_VLAN_CLEAR;
  247. /* generate VLAN request */
  248. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
  249. fm10k_tlv_attr_put_mac_vlan(msg, FM10K_MAC_VLAN_MSG_MAC, mac, vid);
  250. /* load onto outgoing mailbox */
  251. return mbx->ops.enqueue_tx(hw, mbx, msg);
  252. }
  253. /**
  254. * fm10k_update_mc_addr_vf - Update device multicast addresses
  255. * @hw: pointer to the HW structure
  256. * @glort: unused
  257. * @mac: MAC address to add/remove from table
  258. * @vid: VLAN ID to add/remove from table
  259. * @add: Indicates if this is an add or remove operation
  260. *
  261. * This function is used to add or remove multicast MAC addresses for
  262. * the VF.
  263. **/
  264. static s32 fm10k_update_mc_addr_vf(struct fm10k_hw *hw, u16 glort,
  265. const u8 *mac, u16 vid, bool add)
  266. {
  267. struct fm10k_mbx_info *mbx = &hw->mbx;
  268. u32 msg[7];
  269. /* verify VLAN ID is valid */
  270. if (vid >= FM10K_VLAN_TABLE_VID_MAX)
  271. return FM10K_ERR_PARAM;
  272. /* verify multicast address is valid */
  273. if (!is_multicast_ether_addr(mac))
  274. return FM10K_ERR_PARAM;
  275. /* add bit to notify us if this is a set or clear operation */
  276. if (!add)
  277. vid |= FM10K_VLAN_CLEAR;
  278. /* generate VLAN request */
  279. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
  280. fm10k_tlv_attr_put_mac_vlan(msg, FM10K_MAC_VLAN_MSG_MULTICAST,
  281. mac, vid);
  282. /* load onto outgoing mailbox */
  283. return mbx->ops.enqueue_tx(hw, mbx, msg);
  284. }
  285. /**
  286. * fm10k_update_int_moderator_vf - Request update of interrupt moderator list
  287. * @hw: pointer to hardware structure
  288. *
  289. * This function will issue a request to the PF to rescan our MSI-X table
  290. * and to update the interrupt moderator linked list.
  291. **/
  292. static void fm10k_update_int_moderator_vf(struct fm10k_hw *hw)
  293. {
  294. struct fm10k_mbx_info *mbx = &hw->mbx;
  295. u32 msg[1];
  296. /* generate MSI-X request */
  297. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MSIX);
  298. /* load onto outgoing mailbox */
  299. mbx->ops.enqueue_tx(hw, mbx, msg);
  300. }
  301. /* This structure defines the attibutes to be parsed below */
  302. const struct fm10k_tlv_attr fm10k_lport_state_msg_attr[] = {
  303. FM10K_TLV_ATTR_BOOL(FM10K_LPORT_STATE_MSG_DISABLE),
  304. FM10K_TLV_ATTR_U8(FM10K_LPORT_STATE_MSG_XCAST_MODE),
  305. FM10K_TLV_ATTR_BOOL(FM10K_LPORT_STATE_MSG_READY),
  306. FM10K_TLV_ATTR_LAST
  307. };
  308. /**
  309. * fm10k_msg_lport_state_vf - Message handler for lport_state message from PF
  310. * @hw: Pointer to hardware structure
  311. * @results: pointer array containing parsed data
  312. * @mbx: Pointer to mailbox information structure
  313. *
  314. * This handler is meant to capture the indication from the PF that we
  315. * are ready to bring up the interface.
  316. **/
  317. s32 fm10k_msg_lport_state_vf(struct fm10k_hw *hw, u32 **results,
  318. struct fm10k_mbx_info *mbx)
  319. {
  320. hw->mac.dglort_map = !results[FM10K_LPORT_STATE_MSG_READY] ?
  321. FM10K_DGLORTMAP_NONE : FM10K_DGLORTMAP_ZERO;
  322. return 0;
  323. }
  324. /**
  325. * fm10k_update_lport_state_vf - Update device state in lower device
  326. * @hw: pointer to the HW structure
  327. * @glort: unused
  328. * @count: number of logical ports to enable - unused (always 1)
  329. * @enable: boolean value indicating if this is an enable or disable request
  330. *
  331. * Notify the lower device of a state change. If the lower device is
  332. * enabled we can add filters, if it is disabled all filters for this
  333. * logical port are flushed.
  334. **/
  335. static s32 fm10k_update_lport_state_vf(struct fm10k_hw *hw, u16 glort,
  336. u16 count, bool enable)
  337. {
  338. struct fm10k_mbx_info *mbx = &hw->mbx;
  339. u32 msg[2];
  340. /* reset glort mask 0 as we have to wait to be enabled */
  341. hw->mac.dglort_map = FM10K_DGLORTMAP_NONE;
  342. /* generate port state request */
  343. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
  344. if (!enable)
  345. fm10k_tlv_attr_put_bool(msg, FM10K_LPORT_STATE_MSG_DISABLE);
  346. /* load onto outgoing mailbox */
  347. return mbx->ops.enqueue_tx(hw, mbx, msg);
  348. }
  349. /**
  350. * fm10k_update_xcast_mode_vf - Request update of multicast mode
  351. * @hw: pointer to hardware structure
  352. * @glort: unused
  353. * @mode: integer value indicating mode being requested
  354. *
  355. * This function will attempt to request a higher mode for the port
  356. * so that it can enable either multicast, multicast promiscuous, or
  357. * promiscuous mode of operation.
  358. **/
  359. static s32 fm10k_update_xcast_mode_vf(struct fm10k_hw *hw, u16 glort, u8 mode)
  360. {
  361. struct fm10k_mbx_info *mbx = &hw->mbx;
  362. u32 msg[3];
  363. if (mode > FM10K_XCAST_MODE_NONE)
  364. return FM10K_ERR_PARAM;
  365. /* generate message requesting to change xcast mode */
  366. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
  367. fm10k_tlv_attr_put_u8(msg, FM10K_LPORT_STATE_MSG_XCAST_MODE, mode);
  368. /* load onto outgoing mailbox */
  369. return mbx->ops.enqueue_tx(hw, mbx, msg);
  370. }
  371. const struct fm10k_tlv_attr fm10k_1588_msg_attr[] = {
  372. FM10K_TLV_ATTR_U64(FM10K_1588_MSG_TIMESTAMP),
  373. FM10K_TLV_ATTR_LAST
  374. };
  375. /* currently there is no shared 1588 timestamp handler */
  376. /**
  377. * fm10k_update_hw_stats_vf - Updates hardware related statistics of VF
  378. * @hw: pointer to hardware structure
  379. * @stats: pointer to statistics structure
  380. *
  381. * This function collects and aggregates per queue hardware statistics.
  382. **/
  383. static void fm10k_update_hw_stats_vf(struct fm10k_hw *hw,
  384. struct fm10k_hw_stats *stats)
  385. {
  386. fm10k_update_hw_stats_q(hw, stats->q, 0, hw->mac.max_queues);
  387. }
  388. /**
  389. * fm10k_rebind_hw_stats_vf - Resets base for hardware statistics of VF
  390. * @hw: pointer to hardware structure
  391. * @stats: pointer to the stats structure to update
  392. *
  393. * This function resets the base for queue hardware statistics.
  394. **/
  395. static void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw,
  396. struct fm10k_hw_stats *stats)
  397. {
  398. /* Unbind Queue Statistics */
  399. fm10k_unbind_hw_stats_q(stats->q, 0, hw->mac.max_queues);
  400. /* Reinitialize bases for all stats */
  401. fm10k_update_hw_stats_vf(hw, stats);
  402. }
  403. /**
  404. * fm10k_configure_dglort_map_vf - Configures GLORT entry and queues
  405. * @hw: pointer to hardware structure
  406. * @dglort: pointer to dglort configuration structure
  407. *
  408. * Reads the configuration structure contained in dglort_cfg and uses
  409. * that information to then populate a DGLORTMAP/DEC entry and the queues
  410. * to which it has been assigned.
  411. **/
  412. static s32 fm10k_configure_dglort_map_vf(struct fm10k_hw *hw,
  413. struct fm10k_dglort_cfg *dglort)
  414. {
  415. /* verify the dglort pointer */
  416. if (!dglort)
  417. return FM10K_ERR_PARAM;
  418. /* stub for now until we determine correct message for this */
  419. return 0;
  420. }
  421. /**
  422. * fm10k_adjust_systime_vf - Adjust systime frequency
  423. * @hw: pointer to hardware structure
  424. * @ppb: adjustment rate in parts per billion
  425. *
  426. * This function takes an adjustment rate in parts per billion and will
  427. * verify that this value is 0 as the VF cannot support adjusting the
  428. * systime clock.
  429. *
  430. * If the ppb value is non-zero the return is ERR_PARAM else success
  431. **/
  432. static s32 fm10k_adjust_systime_vf(struct fm10k_hw *hw, s32 ppb)
  433. {
  434. /* The VF cannot adjust the clock frequency, however it should
  435. * already have a syntonic clock with whichever host interface is
  436. * running as the master for the host interface clock domain so
  437. * there should be not frequency adjustment necessary.
  438. */
  439. return ppb ? FM10K_ERR_PARAM : 0;
  440. }
  441. /**
  442. * fm10k_read_systime_vf - Reads value of systime registers
  443. * @hw: pointer to the hardware structure
  444. *
  445. * Function reads the content of 2 registers, combined to represent a 64 bit
  446. * value measured in nanoseconds. In order to guarantee the value is accurate
  447. * we check the 32 most significant bits both before and after reading the
  448. * 32 least significant bits to verify they didn't change as we were reading
  449. * the registers.
  450. **/
  451. static u64 fm10k_read_systime_vf(struct fm10k_hw *hw)
  452. {
  453. u32 systime_l, systime_h, systime_tmp;
  454. systime_h = fm10k_read_reg(hw, FM10K_VFSYSTIME + 1);
  455. do {
  456. systime_tmp = systime_h;
  457. systime_l = fm10k_read_reg(hw, FM10K_VFSYSTIME);
  458. systime_h = fm10k_read_reg(hw, FM10K_VFSYSTIME + 1);
  459. } while (systime_tmp != systime_h);
  460. return ((u64)systime_h << 32) | systime_l;
  461. }
  462. static const struct fm10k_msg_data fm10k_msg_data_vf[] = {
  463. FM10K_TLV_MSG_TEST_HANDLER(fm10k_tlv_msg_test),
  464. FM10K_VF_MSG_MAC_VLAN_HANDLER(fm10k_msg_mac_vlan_vf),
  465. FM10K_VF_MSG_LPORT_STATE_HANDLER(fm10k_msg_lport_state_vf),
  466. FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error),
  467. };
  468. static struct fm10k_mac_ops mac_ops_vf = {
  469. .get_bus_info = &fm10k_get_bus_info_generic,
  470. .reset_hw = &fm10k_reset_hw_vf,
  471. .init_hw = &fm10k_init_hw_vf,
  472. .start_hw = &fm10k_start_hw_generic,
  473. .stop_hw = &fm10k_stop_hw_vf,
  474. .is_slot_appropriate = &fm10k_is_slot_appropriate_vf,
  475. .update_vlan = &fm10k_update_vlan_vf,
  476. .read_mac_addr = &fm10k_read_mac_addr_vf,
  477. .update_uc_addr = &fm10k_update_uc_addr_vf,
  478. .update_mc_addr = &fm10k_update_mc_addr_vf,
  479. .update_xcast_mode = &fm10k_update_xcast_mode_vf,
  480. .update_int_moderator = &fm10k_update_int_moderator_vf,
  481. .update_lport_state = &fm10k_update_lport_state_vf,
  482. .update_hw_stats = &fm10k_update_hw_stats_vf,
  483. .rebind_hw_stats = &fm10k_rebind_hw_stats_vf,
  484. .configure_dglort_map = &fm10k_configure_dglort_map_vf,
  485. .get_host_state = &fm10k_get_host_state_generic,
  486. .adjust_systime = &fm10k_adjust_systime_vf,
  487. .read_systime = &fm10k_read_systime_vf,
  488. };
  489. static s32 fm10k_get_invariants_vf(struct fm10k_hw *hw)
  490. {
  491. fm10k_get_invariants_generic(hw);
  492. return fm10k_pfvf_mbx_init(hw, &hw->mbx, fm10k_msg_data_vf, 0);
  493. }
  494. struct fm10k_info fm10k_vf_info = {
  495. .mac = fm10k_mac_vf,
  496. .get_invariants = &fm10k_get_invariants_vf,
  497. .mac_ops = &mac_ops_vf,
  498. };