qed_mcp.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. /* QLogic qed NIC Driver
  2. * Copyright (c) 2015 QLogic Corporation
  3. *
  4. * This software is available under the terms of the GNU General Public License
  5. * (GPL) Version 2, available from the file COPYING in the main directory of
  6. * this source tree.
  7. */
  8. #ifndef _QED_MCP_H
  9. #define _QED_MCP_H
  10. #include <linux/types.h>
  11. #include <linux/delay.h>
  12. #include <linux/slab.h>
  13. #include <linux/spinlock.h>
  14. #include "qed_hsi.h"
  15. struct qed_mcp_link_speed_params {
  16. bool autoneg;
  17. u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
  18. u32 forced_speed; /* In Mb/s */
  19. };
  20. struct qed_mcp_link_pause_params {
  21. bool autoneg;
  22. bool forced_rx;
  23. bool forced_tx;
  24. };
  25. struct qed_mcp_link_params {
  26. struct qed_mcp_link_speed_params speed;
  27. struct qed_mcp_link_pause_params pause;
  28. u32 loopback_mode;
  29. };
  30. struct qed_mcp_link_capabilities {
  31. u32 speed_capabilities;
  32. };
  33. struct qed_mcp_link_state {
  34. bool link_up;
  35. u32 min_pf_rate;
  36. /* Actual link speed in Mb/s */
  37. u32 line_speed;
  38. /* PF max speed in Mb/s, deduced from line_speed
  39. * according to PF max bandwidth configuration.
  40. */
  41. u32 speed;
  42. bool full_duplex;
  43. bool an;
  44. bool an_complete;
  45. bool parallel_detection;
  46. bool pfc_enabled;
  47. #define QED_LINK_PARTNER_SPEED_1G_HD BIT(0)
  48. #define QED_LINK_PARTNER_SPEED_1G_FD BIT(1)
  49. #define QED_LINK_PARTNER_SPEED_10G BIT(2)
  50. #define QED_LINK_PARTNER_SPEED_20G BIT(3)
  51. #define QED_LINK_PARTNER_SPEED_25G BIT(4)
  52. #define QED_LINK_PARTNER_SPEED_40G BIT(5)
  53. #define QED_LINK_PARTNER_SPEED_50G BIT(6)
  54. #define QED_LINK_PARTNER_SPEED_100G BIT(7)
  55. u32 partner_adv_speed;
  56. bool partner_tx_flow_ctrl_en;
  57. bool partner_rx_flow_ctrl_en;
  58. #define QED_LINK_PARTNER_SYMMETRIC_PAUSE (1)
  59. #define QED_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
  60. #define QED_LINK_PARTNER_BOTH_PAUSE (3)
  61. u8 partner_adv_pause;
  62. bool sfp_tx_fault;
  63. };
  64. struct qed_mcp_function_info {
  65. u8 pause_on_host;
  66. enum qed_pci_personality protocol;
  67. u8 bandwidth_min;
  68. u8 bandwidth_max;
  69. u8 mac[ETH_ALEN];
  70. u64 wwn_port;
  71. u64 wwn_node;
  72. #define QED_MCP_VLAN_UNSET (0xffff)
  73. u16 ovlan;
  74. u16 mtu;
  75. };
  76. struct qed_mcp_nvm_common {
  77. u32 offset;
  78. u32 param;
  79. u32 resp;
  80. u32 cmd;
  81. };
  82. struct qed_mcp_drv_version {
  83. u32 version;
  84. u8 name[MCP_DRV_VER_STR_SIZE - 4];
  85. };
  86. struct qed_mcp_lan_stats {
  87. u64 ucast_rx_pkts;
  88. u64 ucast_tx_pkts;
  89. u32 fcs_err;
  90. };
  91. struct qed_mcp_fcoe_stats {
  92. u64 rx_pkts;
  93. u64 tx_pkts;
  94. u32 fcs_err;
  95. u32 login_failure;
  96. };
  97. struct qed_mcp_iscsi_stats {
  98. u64 rx_pdus;
  99. u64 tx_pdus;
  100. u64 rx_bytes;
  101. u64 tx_bytes;
  102. };
  103. struct qed_mcp_rdma_stats {
  104. u64 rx_pkts;
  105. u64 tx_pkts;
  106. u64 rx_bytes;
  107. u64 tx_byts;
  108. };
  109. enum qed_mcp_protocol_type {
  110. QED_MCP_LAN_STATS,
  111. QED_MCP_FCOE_STATS,
  112. QED_MCP_ISCSI_STATS,
  113. QED_MCP_RDMA_STATS
  114. };
  115. union qed_mcp_protocol_stats {
  116. struct qed_mcp_lan_stats lan_stats;
  117. struct qed_mcp_fcoe_stats fcoe_stats;
  118. struct qed_mcp_iscsi_stats iscsi_stats;
  119. struct qed_mcp_rdma_stats rdma_stats;
  120. };
  121. enum qed_ov_eswitch {
  122. QED_OV_ESWITCH_NONE,
  123. QED_OV_ESWITCH_VEB,
  124. QED_OV_ESWITCH_VEPA
  125. };
  126. enum qed_ov_client {
  127. QED_OV_CLIENT_DRV,
  128. QED_OV_CLIENT_USER,
  129. QED_OV_CLIENT_VENDOR_SPEC
  130. };
  131. enum qed_ov_driver_state {
  132. QED_OV_DRIVER_STATE_NOT_LOADED,
  133. QED_OV_DRIVER_STATE_DISABLED,
  134. QED_OV_DRIVER_STATE_ACTIVE
  135. };
  136. enum qed_ov_wol {
  137. QED_OV_WOL_DEFAULT,
  138. QED_OV_WOL_DISABLED,
  139. QED_OV_WOL_ENABLED
  140. };
  141. /**
  142. * @brief - returns the link params of the hw function
  143. *
  144. * @param p_hwfn
  145. *
  146. * @returns pointer to link params
  147. */
  148. struct qed_mcp_link_params *qed_mcp_get_link_params(struct qed_hwfn *);
  149. /**
  150. * @brief - return the link state of the hw function
  151. *
  152. * @param p_hwfn
  153. *
  154. * @returns pointer to link state
  155. */
  156. struct qed_mcp_link_state *qed_mcp_get_link_state(struct qed_hwfn *);
  157. /**
  158. * @brief - return the link capabilities of the hw function
  159. *
  160. * @param p_hwfn
  161. *
  162. * @returns pointer to link capabilities
  163. */
  164. struct qed_mcp_link_capabilities
  165. *qed_mcp_get_link_capabilities(struct qed_hwfn *p_hwfn);
  166. /**
  167. * @brief Request the MFW to set the the link according to 'link_input'.
  168. *
  169. * @param p_hwfn
  170. * @param p_ptt
  171. * @param b_up - raise link if `true'. Reset link if `false'.
  172. *
  173. * @return int
  174. */
  175. int qed_mcp_set_link(struct qed_hwfn *p_hwfn,
  176. struct qed_ptt *p_ptt,
  177. bool b_up);
  178. /**
  179. * @brief Get the management firmware version value
  180. *
  181. * @param p_hwfn
  182. * @param p_ptt
  183. * @param p_mfw_ver - mfw version value
  184. * @param p_running_bundle_id - image id in nvram; Optional.
  185. *
  186. * @return int - 0 - operation was successful.
  187. */
  188. int qed_mcp_get_mfw_ver(struct qed_hwfn *p_hwfn,
  189. struct qed_ptt *p_ptt,
  190. u32 *p_mfw_ver, u32 *p_running_bundle_id);
  191. /**
  192. * @brief Get media type value of the port.
  193. *
  194. * @param cdev - qed dev pointer
  195. * @param mfw_ver - media type value
  196. *
  197. * @return int -
  198. * 0 - Operation was successul.
  199. * -EBUSY - Operation failed
  200. */
  201. int qed_mcp_get_media_type(struct qed_dev *cdev,
  202. u32 *media_type);
  203. /**
  204. * @brief General function for sending commands to the MCP
  205. * mailbox. It acquire mutex lock for the entire
  206. * operation, from sending the request until the MCP
  207. * response. Waiting for MCP response will be checked up
  208. * to 5 seconds every 5ms.
  209. *
  210. * @param p_hwfn - hw function
  211. * @param p_ptt - PTT required for register access
  212. * @param cmd - command to be sent to the MCP.
  213. * @param param - Optional param
  214. * @param o_mcp_resp - The MCP response code (exclude sequence).
  215. * @param o_mcp_param- Optional parameter provided by the MCP
  216. * response
  217. * @return int - 0 - operation
  218. * was successul.
  219. */
  220. int qed_mcp_cmd(struct qed_hwfn *p_hwfn,
  221. struct qed_ptt *p_ptt,
  222. u32 cmd,
  223. u32 param,
  224. u32 *o_mcp_resp,
  225. u32 *o_mcp_param);
  226. /**
  227. * @brief - drains the nig, allowing completion to pass in case of pauses.
  228. * (Should be called only from sleepable context)
  229. *
  230. * @param p_hwfn
  231. * @param p_ptt
  232. */
  233. int qed_mcp_drain(struct qed_hwfn *p_hwfn,
  234. struct qed_ptt *p_ptt);
  235. /**
  236. * @brief Get the flash size value
  237. *
  238. * @param p_hwfn
  239. * @param p_ptt
  240. * @param p_flash_size - flash size in bytes to be filled.
  241. *
  242. * @return int - 0 - operation was successul.
  243. */
  244. int qed_mcp_get_flash_size(struct qed_hwfn *p_hwfn,
  245. struct qed_ptt *p_ptt,
  246. u32 *p_flash_size);
  247. /**
  248. * @brief Send driver version to MFW
  249. *
  250. * @param p_hwfn
  251. * @param p_ptt
  252. * @param version - Version value
  253. * @param name - Protocol driver name
  254. *
  255. * @return int - 0 - operation was successul.
  256. */
  257. int
  258. qed_mcp_send_drv_version(struct qed_hwfn *p_hwfn,
  259. struct qed_ptt *p_ptt,
  260. struct qed_mcp_drv_version *p_ver);
  261. /**
  262. * @brief Notify MFW about the change in base device properties
  263. *
  264. * @param p_hwfn
  265. * @param p_ptt
  266. * @param client - qed client type
  267. *
  268. * @return int - 0 - operation was successful.
  269. */
  270. int qed_mcp_ov_update_current_config(struct qed_hwfn *p_hwfn,
  271. struct qed_ptt *p_ptt,
  272. enum qed_ov_client client);
  273. /**
  274. * @brief Notify MFW about the driver state
  275. *
  276. * @param p_hwfn
  277. * @param p_ptt
  278. * @param drv_state - Driver state
  279. *
  280. * @return int - 0 - operation was successful.
  281. */
  282. int qed_mcp_ov_update_driver_state(struct qed_hwfn *p_hwfn,
  283. struct qed_ptt *p_ptt,
  284. enum qed_ov_driver_state drv_state);
  285. /**
  286. * @brief Send MTU size to MFW
  287. *
  288. * @param p_hwfn
  289. * @param p_ptt
  290. * @param mtu - MTU size
  291. *
  292. * @return int - 0 - operation was successful.
  293. */
  294. int qed_mcp_ov_update_mtu(struct qed_hwfn *p_hwfn,
  295. struct qed_ptt *p_ptt, u16 mtu);
  296. /**
  297. * @brief Send MAC address to MFW
  298. *
  299. * @param p_hwfn
  300. * @param p_ptt
  301. * @param mac - MAC address
  302. *
  303. * @return int - 0 - operation was successful.
  304. */
  305. int qed_mcp_ov_update_mac(struct qed_hwfn *p_hwfn,
  306. struct qed_ptt *p_ptt, u8 *mac);
  307. /**
  308. * @brief Send WOL mode to MFW
  309. *
  310. * @param p_hwfn
  311. * @param p_ptt
  312. * @param wol - WOL mode
  313. *
  314. * @return int - 0 - operation was successful.
  315. */
  316. int qed_mcp_ov_update_wol(struct qed_hwfn *p_hwfn,
  317. struct qed_ptt *p_ptt,
  318. enum qed_ov_wol wol);
  319. /**
  320. * @brief Set LED status
  321. *
  322. * @param p_hwfn
  323. * @param p_ptt
  324. * @param mode - LED mode
  325. *
  326. * @return int - 0 - operation was successful.
  327. */
  328. int qed_mcp_set_led(struct qed_hwfn *p_hwfn,
  329. struct qed_ptt *p_ptt,
  330. enum qed_led_mode mode);
  331. /**
  332. * @brief Read from nvm
  333. *
  334. * @param cdev
  335. * @param addr - nvm offset
  336. * @param p_buf - nvm read buffer
  337. * @param len - buffer len
  338. *
  339. * @return int - 0 - operation was successful.
  340. */
  341. int qed_mcp_nvm_read(struct qed_dev *cdev, u32 addr, u8 *p_buf, u32 len);
  342. /**
  343. * @brief Bist register test
  344. *
  345. * @param p_hwfn - hw function
  346. * @param p_ptt - PTT required for register access
  347. *
  348. * @return int - 0 - operation was successful.
  349. */
  350. int qed_mcp_bist_register_test(struct qed_hwfn *p_hwfn,
  351. struct qed_ptt *p_ptt);
  352. /**
  353. * @brief Bist clock test
  354. *
  355. * @param p_hwfn - hw function
  356. * @param p_ptt - PTT required for register access
  357. *
  358. * @return int - 0 - operation was successful.
  359. */
  360. int qed_mcp_bist_clock_test(struct qed_hwfn *p_hwfn,
  361. struct qed_ptt *p_ptt);
  362. /**
  363. * @brief Bist nvm test - get number of images
  364. *
  365. * @param p_hwfn - hw function
  366. * @param p_ptt - PTT required for register access
  367. * @param num_images - number of images if operation was
  368. * successful. 0 if not.
  369. *
  370. * @return int - 0 - operation was successful.
  371. */
  372. int qed_mcp_bist_nvm_test_get_num_images(struct qed_hwfn *p_hwfn,
  373. struct qed_ptt *p_ptt,
  374. u32 *num_images);
  375. /**
  376. * @brief Bist nvm test - get image attributes by index
  377. *
  378. * @param p_hwfn - hw function
  379. * @param p_ptt - PTT required for register access
  380. * @param p_image_att - Attributes of image
  381. * @param image_index - Index of image to get information for
  382. *
  383. * @return int - 0 - operation was successful.
  384. */
  385. int qed_mcp_bist_nvm_test_get_image_att(struct qed_hwfn *p_hwfn,
  386. struct qed_ptt *p_ptt,
  387. struct bist_nvm_image_att *p_image_att,
  388. u32 image_index);
  389. /* Using hwfn number (and not pf_num) is required since in CMT mode,
  390. * same pf_num may be used by two different hwfn
  391. * TODO - this shouldn't really be in .h file, but until all fields
  392. * required during hw-init will be placed in their correct place in shmem
  393. * we need it in qed_dev.c [for readin the nvram reflection in shmem].
  394. */
  395. #define MCP_PF_ID_BY_REL(p_hwfn, rel_pfid) (QED_IS_BB((p_hwfn)->cdev) ? \
  396. ((rel_pfid) | \
  397. ((p_hwfn)->abs_pf_id & 1) << 3) : \
  398. rel_pfid)
  399. #define MCP_PF_ID(p_hwfn) MCP_PF_ID_BY_REL(p_hwfn, (p_hwfn)->rel_pf_id)
  400. /* TODO - this is only correct as long as only BB is supported, and
  401. * no port-swapping is implemented; Afterwards we'll need to fix it.
  402. */
  403. #define MFW_PORT(_p_hwfn) ((_p_hwfn)->abs_pf_id % \
  404. ((_p_hwfn)->cdev->num_ports_in_engines * 2))
  405. struct qed_mcp_info {
  406. spinlock_t lock;
  407. bool block_mb_sending;
  408. u32 public_base;
  409. u32 drv_mb_addr;
  410. u32 mfw_mb_addr;
  411. u32 port_addr;
  412. u16 drv_mb_seq;
  413. u16 drv_pulse_seq;
  414. struct qed_mcp_link_params link_input;
  415. struct qed_mcp_link_state link_output;
  416. struct qed_mcp_link_capabilities link_capabilities;
  417. struct qed_mcp_function_info func_info;
  418. u8 *mfw_mb_cur;
  419. u8 *mfw_mb_shadow;
  420. u16 mfw_mb_length;
  421. u16 mcp_hist;
  422. };
  423. struct qed_mcp_mb_params {
  424. u32 cmd;
  425. u32 param;
  426. union drv_union_data *p_data_src;
  427. union drv_union_data *p_data_dst;
  428. u32 mcp_resp;
  429. u32 mcp_param;
  430. };
  431. /**
  432. * @brief Initialize the interface with the MCP
  433. *
  434. * @param p_hwfn - HW func
  435. * @param p_ptt - PTT required for register access
  436. *
  437. * @return int
  438. */
  439. int qed_mcp_cmd_init(struct qed_hwfn *p_hwfn,
  440. struct qed_ptt *p_ptt);
  441. /**
  442. * @brief Initialize the port interface with the MCP
  443. *
  444. * @param p_hwfn
  445. * @param p_ptt
  446. * Can only be called after `num_ports_in_engines' is set
  447. */
  448. void qed_mcp_cmd_port_init(struct qed_hwfn *p_hwfn,
  449. struct qed_ptt *p_ptt);
  450. /**
  451. * @brief Releases resources allocated during the init process.
  452. *
  453. * @param p_hwfn - HW func
  454. * @param p_ptt - PTT required for register access
  455. *
  456. * @return int
  457. */
  458. int qed_mcp_free(struct qed_hwfn *p_hwfn);
  459. /**
  460. * @brief This function is called from the DPC context. After
  461. * pointing PTT to the mfw mb, check for events sent by the MCP
  462. * to the driver and ack them. In case a critical event
  463. * detected, it will be handled here, otherwise the work will be
  464. * queued to a sleepable work-queue.
  465. *
  466. * @param p_hwfn - HW function
  467. * @param p_ptt - PTT required for register access
  468. * @return int - 0 - operation
  469. * was successul.
  470. */
  471. int qed_mcp_handle_events(struct qed_hwfn *p_hwfn,
  472. struct qed_ptt *p_ptt);
  473. /**
  474. * @brief Sends a LOAD_REQ to the MFW, and in case operation
  475. * succeed, returns whether this PF is the first on the
  476. * chip/engine/port or function. This function should be
  477. * called when driver is ready to accept MFW events after
  478. * Storms initializations are done.
  479. *
  480. * @param p_hwfn - hw function
  481. * @param p_ptt - PTT required for register access
  482. * @param p_load_code - The MCP response param containing one
  483. * of the following:
  484. * FW_MSG_CODE_DRV_LOAD_ENGINE
  485. * FW_MSG_CODE_DRV_LOAD_PORT
  486. * FW_MSG_CODE_DRV_LOAD_FUNCTION
  487. * @return int -
  488. * 0 - Operation was successul.
  489. * -EBUSY - Operation failed
  490. */
  491. int qed_mcp_load_req(struct qed_hwfn *p_hwfn,
  492. struct qed_ptt *p_ptt,
  493. u32 *p_load_code);
  494. /**
  495. * @brief Read the MFW mailbox into Current buffer.
  496. *
  497. * @param p_hwfn
  498. * @param p_ptt
  499. */
  500. void qed_mcp_read_mb(struct qed_hwfn *p_hwfn,
  501. struct qed_ptt *p_ptt);
  502. /**
  503. * @brief Ack to mfw that driver finished FLR process for VFs
  504. *
  505. * @param p_hwfn
  506. * @param p_ptt
  507. * @param vfs_to_ack - bit mask of all engine VFs for which the PF acks.
  508. *
  509. * @param return int - 0 upon success.
  510. */
  511. int qed_mcp_ack_vf_flr(struct qed_hwfn *p_hwfn,
  512. struct qed_ptt *p_ptt, u32 *vfs_to_ack);
  513. /**
  514. * @brief - calls during init to read shmem of all function-related info.
  515. *
  516. * @param p_hwfn
  517. *
  518. * @param return 0 upon success.
  519. */
  520. int qed_mcp_fill_shmem_func_info(struct qed_hwfn *p_hwfn,
  521. struct qed_ptt *p_ptt);
  522. /**
  523. * @brief - Reset the MCP using mailbox command.
  524. *
  525. * @param p_hwfn
  526. * @param p_ptt
  527. *
  528. * @param return 0 upon success.
  529. */
  530. int qed_mcp_reset(struct qed_hwfn *p_hwfn,
  531. struct qed_ptt *p_ptt);
  532. /**
  533. * @brief - Sends an NVM read command request to the MFW to get
  534. * a buffer.
  535. *
  536. * @param p_hwfn
  537. * @param p_ptt
  538. * @param cmd - Command: DRV_MSG_CODE_NVM_GET_FILE_DATA or
  539. * DRV_MSG_CODE_NVM_READ_NVRAM commands
  540. * @param param - [0:23] - Offset [24:31] - Size
  541. * @param o_mcp_resp - MCP response
  542. * @param o_mcp_param - MCP response param
  543. * @param o_txn_size - Buffer size output
  544. * @param o_buf - Pointer to the buffer returned by the MFW.
  545. *
  546. * @param return 0 upon success.
  547. */
  548. int qed_mcp_nvm_rd_cmd(struct qed_hwfn *p_hwfn,
  549. struct qed_ptt *p_ptt,
  550. u32 cmd,
  551. u32 param,
  552. u32 *o_mcp_resp,
  553. u32 *o_mcp_param, u32 *o_txn_size, u32 *o_buf);
  554. /**
  555. * @brief indicates whether the MFW objects [under mcp_info] are accessible
  556. *
  557. * @param p_hwfn
  558. *
  559. * @return true iff MFW is running and mcp_info is initialized
  560. */
  561. bool qed_mcp_is_init(struct qed_hwfn *p_hwfn);
  562. /**
  563. * @brief request MFW to configure MSI-X for a VF
  564. *
  565. * @param p_hwfn
  566. * @param p_ptt
  567. * @param vf_id - absolute inside engine
  568. * @param num_sbs - number of entries to request
  569. *
  570. * @return int
  571. */
  572. int qed_mcp_config_vf_msix(struct qed_hwfn *p_hwfn,
  573. struct qed_ptt *p_ptt, u8 vf_id, u8 num);
  574. /**
  575. * @brief - Halt the MCP.
  576. *
  577. * @param p_hwfn
  578. * @param p_ptt
  579. *
  580. * @param return 0 upon success.
  581. */
  582. int qed_mcp_halt(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
  583. /**
  584. * @brief - Wake up the MCP.
  585. *
  586. * @param p_hwfn
  587. * @param p_ptt
  588. *
  589. * @param return 0 upon success.
  590. */
  591. int qed_mcp_resume(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
  592. int qed_configure_pf_min_bandwidth(struct qed_dev *cdev, u8 min_bw);
  593. int qed_configure_pf_max_bandwidth(struct qed_dev *cdev, u8 max_bw);
  594. int __qed_configure_pf_max_bandwidth(struct qed_hwfn *p_hwfn,
  595. struct qed_ptt *p_ptt,
  596. struct qed_mcp_link_state *p_link,
  597. u8 max_bw);
  598. int __qed_configure_pf_min_bandwidth(struct qed_hwfn *p_hwfn,
  599. struct qed_ptt *p_ptt,
  600. struct qed_mcp_link_state *p_link,
  601. u8 min_bw);
  602. int qed_mcp_mask_parities(struct qed_hwfn *p_hwfn,
  603. struct qed_ptt *p_ptt, u32 mask_parities);
  604. /**
  605. * @brief Send eswitch mode to MFW
  606. *
  607. * @param p_hwfn
  608. * @param p_ptt
  609. * @param eswitch - eswitch mode
  610. *
  611. * @return int - 0 - operation was successful.
  612. */
  613. int qed_mcp_ov_update_eswitch(struct qed_hwfn *p_hwfn,
  614. struct qed_ptt *p_ptt,
  615. enum qed_ov_eswitch eswitch);
  616. /**
  617. * @brief - Gets the MFW allocation info for the given resource
  618. *
  619. * @param p_hwfn
  620. * @param p_ptt
  621. * @param p_resc_info - descriptor of requested resource
  622. * @param p_mcp_resp
  623. * @param p_mcp_param
  624. *
  625. * @return int - 0 - operation was successful.
  626. */
  627. int qed_mcp_get_resc_info(struct qed_hwfn *p_hwfn,
  628. struct qed_ptt *p_ptt,
  629. struct resource_info *p_resc_info,
  630. u32 *p_mcp_resp, u32 *p_mcp_param);
  631. #endif