fm10k_vf.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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. /* verify we have at least 1 queue */
  93. if (!~fm10k_read_reg(hw, FM10K_TXQCTL(0)) ||
  94. !~fm10k_read_reg(hw, FM10K_RXQCTL(0))) {
  95. err = FM10K_ERR_NO_RESOURCES;
  96. goto reset_max_queues;
  97. }
  98. /* determine how many queues we have */
  99. for (i = 1; tqdloc0 && (i < FM10K_MAX_QUEUES_POOL); i++) {
  100. /* verify the Descriptor cache offsets are increasing */
  101. tqdloc = ~fm10k_read_reg(hw, FM10K_TQDLOC(i));
  102. if (!tqdloc || (tqdloc == tqdloc0))
  103. break;
  104. /* check to verify the PF doesn't own any of our queues */
  105. if (!~fm10k_read_reg(hw, FM10K_TXQCTL(i)) ||
  106. !~fm10k_read_reg(hw, FM10K_RXQCTL(i)))
  107. break;
  108. }
  109. /* shut down queues we own and reset DMA configuration */
  110. err = fm10k_disable_queues_generic(hw, i);
  111. if (err)
  112. goto reset_max_queues;
  113. /* record maximum queue count */
  114. hw->mac.max_queues = i;
  115. /* fetch default VLAN */
  116. hw->mac.default_vid = (fm10k_read_reg(hw, FM10K_TXQCTL(0)) &
  117. FM10K_TXQCTL_VID_MASK) >> FM10K_TXQCTL_VID_SHIFT;
  118. return 0;
  119. reset_max_queues:
  120. hw->mac.max_queues = 0;
  121. return err;
  122. }
  123. /* This structure defines the attibutes to be parsed below */
  124. const struct fm10k_tlv_attr fm10k_mac_vlan_msg_attr[] = {
  125. FM10K_TLV_ATTR_U32(FM10K_MAC_VLAN_MSG_VLAN),
  126. FM10K_TLV_ATTR_BOOL(FM10K_MAC_VLAN_MSG_SET),
  127. FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_MAC),
  128. FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_DEFAULT_MAC),
  129. FM10K_TLV_ATTR_MAC_ADDR(FM10K_MAC_VLAN_MSG_MULTICAST),
  130. FM10K_TLV_ATTR_LAST
  131. };
  132. /**
  133. * fm10k_update_vlan_vf - Update status of VLAN ID in VLAN filter table
  134. * @hw: pointer to hardware structure
  135. * @vid: VLAN ID to add to table
  136. * @vsi: Reserved, should always be 0
  137. * @set: Indicates if this is a set or clear operation
  138. *
  139. * This function adds or removes the corresponding VLAN ID from the VLAN
  140. * filter table for this VF.
  141. **/
  142. static s32 fm10k_update_vlan_vf(struct fm10k_hw *hw, u32 vid, u8 vsi, bool set)
  143. {
  144. struct fm10k_mbx_info *mbx = &hw->mbx;
  145. u32 msg[4];
  146. /* verify the index is not set */
  147. if (vsi)
  148. return FM10K_ERR_PARAM;
  149. /* verify upper 4 bits of vid and length are 0 */
  150. if ((vid << 16 | vid) >> 28)
  151. return FM10K_ERR_PARAM;
  152. /* encode set bit into the VLAN ID */
  153. if (!set)
  154. vid |= FM10K_VLAN_CLEAR;
  155. /* generate VLAN request */
  156. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
  157. fm10k_tlv_attr_put_u32(msg, FM10K_MAC_VLAN_MSG_VLAN, vid);
  158. /* load onto outgoing mailbox */
  159. return mbx->ops.enqueue_tx(hw, mbx, msg);
  160. }
  161. /**
  162. * fm10k_msg_mac_vlan_vf - Read device MAC address from mailbox message
  163. * @hw: pointer to the HW structure
  164. * @results: Attributes for message
  165. * @mbx: unused mailbox data
  166. *
  167. * This function should determine the MAC address for the VF
  168. **/
  169. s32 fm10k_msg_mac_vlan_vf(struct fm10k_hw *hw, u32 **results,
  170. struct fm10k_mbx_info *mbx)
  171. {
  172. u8 perm_addr[ETH_ALEN];
  173. u16 vid;
  174. s32 err;
  175. /* record MAC address requested */
  176. err = fm10k_tlv_attr_get_mac_vlan(
  177. results[FM10K_MAC_VLAN_MSG_DEFAULT_MAC],
  178. perm_addr, &vid);
  179. if (err)
  180. return err;
  181. ether_addr_copy(hw->mac.perm_addr, perm_addr);
  182. hw->mac.default_vid = vid & (FM10K_VLAN_TABLE_VID_MAX - 1);
  183. hw->mac.vlan_override = !!(vid & FM10K_VLAN_CLEAR);
  184. return 0;
  185. }
  186. /**
  187. * fm10k_read_mac_addr_vf - Read device MAC address
  188. * @hw: pointer to the HW structure
  189. *
  190. * This function should determine the MAC address for the VF
  191. **/
  192. static s32 fm10k_read_mac_addr_vf(struct fm10k_hw *hw)
  193. {
  194. u8 perm_addr[ETH_ALEN];
  195. u32 base_addr;
  196. base_addr = fm10k_read_reg(hw, FM10K_TDBAL(0));
  197. /* last byte should be 0 */
  198. if (base_addr << 24)
  199. return FM10K_ERR_INVALID_MAC_ADDR;
  200. perm_addr[3] = (u8)(base_addr >> 24);
  201. perm_addr[4] = (u8)(base_addr >> 16);
  202. perm_addr[5] = (u8)(base_addr >> 8);
  203. base_addr = fm10k_read_reg(hw, FM10K_TDBAH(0));
  204. /* first byte should be all 1's */
  205. if ((~base_addr) >> 24)
  206. return FM10K_ERR_INVALID_MAC_ADDR;
  207. perm_addr[0] = (u8)(base_addr >> 16);
  208. perm_addr[1] = (u8)(base_addr >> 8);
  209. perm_addr[2] = (u8)(base_addr);
  210. ether_addr_copy(hw->mac.perm_addr, perm_addr);
  211. ether_addr_copy(hw->mac.addr, perm_addr);
  212. return 0;
  213. }
  214. /**
  215. * fm10k_update_uc_addr_vf - Update device unicast addresses
  216. * @hw: pointer to the HW structure
  217. * @glort: unused
  218. * @mac: MAC address to add/remove from table
  219. * @vid: VLAN ID to add/remove from table
  220. * @add: Indicates if this is an add or remove operation
  221. * @flags: flags field to indicate add and secure - unused
  222. *
  223. * This function is used to add or remove unicast MAC addresses for
  224. * the VF.
  225. **/
  226. static s32 fm10k_update_uc_addr_vf(struct fm10k_hw *hw, u16 glort,
  227. const u8 *mac, u16 vid, bool add, u8 flags)
  228. {
  229. struct fm10k_mbx_info *mbx = &hw->mbx;
  230. u32 msg[7];
  231. /* verify VLAN ID is valid */
  232. if (vid >= FM10K_VLAN_TABLE_VID_MAX)
  233. return FM10K_ERR_PARAM;
  234. /* verify MAC address is valid */
  235. if (!is_valid_ether_addr(mac))
  236. return FM10K_ERR_PARAM;
  237. /* verify we are not locked down on the MAC address */
  238. if (is_valid_ether_addr(hw->mac.perm_addr) &&
  239. memcmp(hw->mac.perm_addr, mac, ETH_ALEN))
  240. return FM10K_ERR_PARAM;
  241. /* add bit to notify us if this is a set or clear operation */
  242. if (!add)
  243. vid |= FM10K_VLAN_CLEAR;
  244. /* generate VLAN request */
  245. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
  246. fm10k_tlv_attr_put_mac_vlan(msg, FM10K_MAC_VLAN_MSG_MAC, mac, vid);
  247. /* load onto outgoing mailbox */
  248. return mbx->ops.enqueue_tx(hw, mbx, msg);
  249. }
  250. /**
  251. * fm10k_update_mc_addr_vf - Update device multicast addresses
  252. * @hw: pointer to the HW structure
  253. * @glort: unused
  254. * @mac: MAC address to add/remove from table
  255. * @vid: VLAN ID to add/remove from table
  256. * @add: Indicates if this is an add or remove operation
  257. *
  258. * This function is used to add or remove multicast MAC addresses for
  259. * the VF.
  260. **/
  261. static s32 fm10k_update_mc_addr_vf(struct fm10k_hw *hw, u16 glort,
  262. const u8 *mac, u16 vid, bool add)
  263. {
  264. struct fm10k_mbx_info *mbx = &hw->mbx;
  265. u32 msg[7];
  266. /* verify VLAN ID is valid */
  267. if (vid >= FM10K_VLAN_TABLE_VID_MAX)
  268. return FM10K_ERR_PARAM;
  269. /* verify multicast address is valid */
  270. if (!is_multicast_ether_addr(mac))
  271. return FM10K_ERR_PARAM;
  272. /* add bit to notify us if this is a set or clear operation */
  273. if (!add)
  274. vid |= FM10K_VLAN_CLEAR;
  275. /* generate VLAN request */
  276. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MAC_VLAN);
  277. fm10k_tlv_attr_put_mac_vlan(msg, FM10K_MAC_VLAN_MSG_MULTICAST,
  278. mac, vid);
  279. /* load onto outgoing mailbox */
  280. return mbx->ops.enqueue_tx(hw, mbx, msg);
  281. }
  282. /**
  283. * fm10k_update_int_moderator_vf - Request update of interrupt moderator list
  284. * @hw: pointer to hardware structure
  285. *
  286. * This function will issue a request to the PF to rescan our MSI-X table
  287. * and to update the interrupt moderator linked list.
  288. **/
  289. static void fm10k_update_int_moderator_vf(struct fm10k_hw *hw)
  290. {
  291. struct fm10k_mbx_info *mbx = &hw->mbx;
  292. u32 msg[1];
  293. /* generate MSI-X request */
  294. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_MSIX);
  295. /* load onto outgoing mailbox */
  296. mbx->ops.enqueue_tx(hw, mbx, msg);
  297. }
  298. /* This structure defines the attibutes to be parsed below */
  299. const struct fm10k_tlv_attr fm10k_lport_state_msg_attr[] = {
  300. FM10K_TLV_ATTR_BOOL(FM10K_LPORT_STATE_MSG_DISABLE),
  301. FM10K_TLV_ATTR_U8(FM10K_LPORT_STATE_MSG_XCAST_MODE),
  302. FM10K_TLV_ATTR_BOOL(FM10K_LPORT_STATE_MSG_READY),
  303. FM10K_TLV_ATTR_LAST
  304. };
  305. /**
  306. * fm10k_msg_lport_state_vf - Message handler for lport_state message from PF
  307. * @hw: Pointer to hardware structure
  308. * @results: pointer array containing parsed data
  309. * @mbx: Pointer to mailbox information structure
  310. *
  311. * This handler is meant to capture the indication from the PF that we
  312. * are ready to bring up the interface.
  313. **/
  314. s32 fm10k_msg_lport_state_vf(struct fm10k_hw *hw, u32 **results,
  315. struct fm10k_mbx_info *mbx)
  316. {
  317. hw->mac.dglort_map = !results[FM10K_LPORT_STATE_MSG_READY] ?
  318. FM10K_DGLORTMAP_NONE : FM10K_DGLORTMAP_ZERO;
  319. return 0;
  320. }
  321. /**
  322. * fm10k_update_lport_state_vf - Update device state in lower device
  323. * @hw: pointer to the HW structure
  324. * @glort: unused
  325. * @count: number of logical ports to enable - unused (always 1)
  326. * @enable: boolean value indicating if this is an enable or disable request
  327. *
  328. * Notify the lower device of a state change. If the lower device is
  329. * enabled we can add filters, if it is disabled all filters for this
  330. * logical port are flushed.
  331. **/
  332. static s32 fm10k_update_lport_state_vf(struct fm10k_hw *hw, u16 glort,
  333. u16 count, bool enable)
  334. {
  335. struct fm10k_mbx_info *mbx = &hw->mbx;
  336. u32 msg[2];
  337. /* reset glort mask 0 as we have to wait to be enabled */
  338. hw->mac.dglort_map = FM10K_DGLORTMAP_NONE;
  339. /* generate port state request */
  340. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
  341. if (!enable)
  342. fm10k_tlv_attr_put_bool(msg, FM10K_LPORT_STATE_MSG_DISABLE);
  343. /* load onto outgoing mailbox */
  344. return mbx->ops.enqueue_tx(hw, mbx, msg);
  345. }
  346. /**
  347. * fm10k_update_xcast_mode_vf - Request update of multicast mode
  348. * @hw: pointer to hardware structure
  349. * @glort: unused
  350. * @mode: integer value indicating mode being requested
  351. *
  352. * This function will attempt to request a higher mode for the port
  353. * so that it can enable either multicast, multicast promiscuous, or
  354. * promiscuous mode of operation.
  355. **/
  356. static s32 fm10k_update_xcast_mode_vf(struct fm10k_hw *hw, u16 glort, u8 mode)
  357. {
  358. struct fm10k_mbx_info *mbx = &hw->mbx;
  359. u32 msg[3];
  360. if (mode > FM10K_XCAST_MODE_NONE)
  361. return FM10K_ERR_PARAM;
  362. /* generate message requesting to change xcast mode */
  363. fm10k_tlv_msg_init(msg, FM10K_VF_MSG_ID_LPORT_STATE);
  364. fm10k_tlv_attr_put_u8(msg, FM10K_LPORT_STATE_MSG_XCAST_MODE, mode);
  365. /* load onto outgoing mailbox */
  366. return mbx->ops.enqueue_tx(hw, mbx, msg);
  367. }
  368. const struct fm10k_tlv_attr fm10k_1588_msg_attr[] = {
  369. FM10K_TLV_ATTR_U64(FM10K_1588_MSG_TIMESTAMP),
  370. FM10K_TLV_ATTR_LAST
  371. };
  372. /* currently there is no shared 1588 timestamp handler */
  373. /**
  374. * fm10k_update_hw_stats_vf - Updates hardware related statistics of VF
  375. * @hw: pointer to hardware structure
  376. * @stats: pointer to statistics structure
  377. *
  378. * This function collects and aggregates per queue hardware statistics.
  379. **/
  380. static void fm10k_update_hw_stats_vf(struct fm10k_hw *hw,
  381. struct fm10k_hw_stats *stats)
  382. {
  383. fm10k_update_hw_stats_q(hw, stats->q, 0, hw->mac.max_queues);
  384. }
  385. /**
  386. * fm10k_rebind_hw_stats_vf - Resets base for hardware statistics of VF
  387. * @hw: pointer to hardware structure
  388. * @stats: pointer to the stats structure to update
  389. *
  390. * This function resets the base for queue hardware statistics.
  391. **/
  392. static void fm10k_rebind_hw_stats_vf(struct fm10k_hw *hw,
  393. struct fm10k_hw_stats *stats)
  394. {
  395. /* Unbind Queue Statistics */
  396. fm10k_unbind_hw_stats_q(stats->q, 0, hw->mac.max_queues);
  397. /* Reinitialize bases for all stats */
  398. fm10k_update_hw_stats_vf(hw, stats);
  399. }
  400. /**
  401. * fm10k_configure_dglort_map_vf - Configures GLORT entry and queues
  402. * @hw: pointer to hardware structure
  403. * @dglort: pointer to dglort configuration structure
  404. *
  405. * Reads the configuration structure contained in dglort_cfg and uses
  406. * that information to then populate a DGLORTMAP/DEC entry and the queues
  407. * to which it has been assigned.
  408. **/
  409. static s32 fm10k_configure_dglort_map_vf(struct fm10k_hw *hw,
  410. struct fm10k_dglort_cfg *dglort)
  411. {
  412. /* verify the dglort pointer */
  413. if (!dglort)
  414. return FM10K_ERR_PARAM;
  415. /* stub for now until we determine correct message for this */
  416. return 0;
  417. }
  418. /**
  419. * fm10k_adjust_systime_vf - Adjust systime frequency
  420. * @hw: pointer to hardware structure
  421. * @ppb: adjustment rate in parts per billion
  422. *
  423. * This function takes an adjustment rate in parts per billion and will
  424. * verify that this value is 0 as the VF cannot support adjusting the
  425. * systime clock.
  426. *
  427. * If the ppb value is non-zero the return is ERR_PARAM else success
  428. **/
  429. static s32 fm10k_adjust_systime_vf(struct fm10k_hw *hw, s32 ppb)
  430. {
  431. /* The VF cannot adjust the clock frequency, however it should
  432. * already have a syntonic clock with whichever host interface is
  433. * running as the master for the host interface clock domain so
  434. * there should be not frequency adjustment necessary.
  435. */
  436. return ppb ? FM10K_ERR_PARAM : 0;
  437. }
  438. /**
  439. * fm10k_read_systime_vf - Reads value of systime registers
  440. * @hw: pointer to the hardware structure
  441. *
  442. * Function reads the content of 2 registers, combined to represent a 64 bit
  443. * value measured in nanoseconds. In order to guarantee the value is accurate
  444. * we check the 32 most significant bits both before and after reading the
  445. * 32 least significant bits to verify they didn't change as we were reading
  446. * the registers.
  447. **/
  448. static u64 fm10k_read_systime_vf(struct fm10k_hw *hw)
  449. {
  450. u32 systime_l, systime_h, systime_tmp;
  451. systime_h = fm10k_read_reg(hw, FM10K_VFSYSTIME + 1);
  452. do {
  453. systime_tmp = systime_h;
  454. systime_l = fm10k_read_reg(hw, FM10K_VFSYSTIME);
  455. systime_h = fm10k_read_reg(hw, FM10K_VFSYSTIME + 1);
  456. } while (systime_tmp != systime_h);
  457. return ((u64)systime_h << 32) | systime_l;
  458. }
  459. static const struct fm10k_msg_data fm10k_msg_data_vf[] = {
  460. FM10K_TLV_MSG_TEST_HANDLER(fm10k_tlv_msg_test),
  461. FM10K_VF_MSG_MAC_VLAN_HANDLER(fm10k_msg_mac_vlan_vf),
  462. FM10K_VF_MSG_LPORT_STATE_HANDLER(fm10k_msg_lport_state_vf),
  463. FM10K_TLV_MSG_ERROR_HANDLER(fm10k_tlv_msg_error),
  464. };
  465. static struct fm10k_mac_ops mac_ops_vf = {
  466. .get_bus_info = &fm10k_get_bus_info_generic,
  467. .reset_hw = &fm10k_reset_hw_vf,
  468. .init_hw = &fm10k_init_hw_vf,
  469. .start_hw = &fm10k_start_hw_generic,
  470. .stop_hw = &fm10k_stop_hw_vf,
  471. .update_vlan = &fm10k_update_vlan_vf,
  472. .read_mac_addr = &fm10k_read_mac_addr_vf,
  473. .update_uc_addr = &fm10k_update_uc_addr_vf,
  474. .update_mc_addr = &fm10k_update_mc_addr_vf,
  475. .update_xcast_mode = &fm10k_update_xcast_mode_vf,
  476. .update_int_moderator = &fm10k_update_int_moderator_vf,
  477. .update_lport_state = &fm10k_update_lport_state_vf,
  478. .update_hw_stats = &fm10k_update_hw_stats_vf,
  479. .rebind_hw_stats = &fm10k_rebind_hw_stats_vf,
  480. .configure_dglort_map = &fm10k_configure_dglort_map_vf,
  481. .get_host_state = &fm10k_get_host_state_generic,
  482. .adjust_systime = &fm10k_adjust_systime_vf,
  483. .read_systime = &fm10k_read_systime_vf,
  484. };
  485. static s32 fm10k_get_invariants_vf(struct fm10k_hw *hw)
  486. {
  487. fm10k_get_invariants_generic(hw);
  488. return fm10k_pfvf_mbx_init(hw, &hw->mbx, fm10k_msg_data_vf, 0);
  489. }
  490. struct fm10k_info fm10k_vf_info = {
  491. .mac = fm10k_mac_vf,
  492. .get_invariants = &fm10k_get_invariants_vf,
  493. .mac_ops = &mac_ops_vf,
  494. };