be_cmds.h 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151
  1. /*
  2. * Copyright (C) 2005 - 2011 Emulex
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License version 2
  7. * as published by the Free Software Foundation. The full GNU General
  8. * Public License is included in this distribution in the file called COPYING.
  9. *
  10. * Contact Information:
  11. * linux-drivers@emulex.com
  12. *
  13. * Emulex
  14. * 3333 Susan Street
  15. * Costa Mesa, CA 92626
  16. */
  17. /*
  18. * The driver sends configuration and managements command requests to the
  19. * firmware in the BE. These requests are communicated to the processor
  20. * using Work Request Blocks (WRBs) submitted to the MCC-WRB ring or via one
  21. * WRB inside a MAILBOX.
  22. * The commands are serviced by the ARM processor in the BladeEngine's MPU.
  23. */
  24. struct be_sge {
  25. u32 pa_lo;
  26. u32 pa_hi;
  27. u32 len;
  28. };
  29. #define MCC_WRB_EMBEDDED_MASK 1 /* bit 0 of dword 0*/
  30. #define MCC_WRB_SGE_CNT_SHIFT 3 /* bits 3 - 7 of dword 0 */
  31. #define MCC_WRB_SGE_CNT_MASK 0x1F /* bits 3 - 7 of dword 0 */
  32. struct be_mcc_wrb {
  33. u32 embedded; /* dword 0 */
  34. u32 payload_length; /* dword 1 */
  35. u32 tag0; /* dword 2 */
  36. u32 tag1; /* dword 3 */
  37. u32 rsvd; /* dword 4 */
  38. union {
  39. u8 embedded_payload[236]; /* used by embedded cmds */
  40. struct be_sge sgl[19]; /* used by non-embedded cmds */
  41. } payload;
  42. };
  43. #define CQE_FLAGS_VALID_MASK (1 << 31)
  44. #define CQE_FLAGS_ASYNC_MASK (1 << 30)
  45. #define CQE_FLAGS_COMPLETED_MASK (1 << 28)
  46. #define CQE_FLAGS_CONSUMED_MASK (1 << 27)
  47. /* Completion Status */
  48. enum {
  49. MCC_STATUS_SUCCESS = 0x0,
  50. /* The client does not have sufficient privileges to execute the command */
  51. MCC_STATUS_INSUFFICIENT_PRIVILEGES = 0x1,
  52. /* A parameter in the command was invalid. */
  53. MCC_STATUS_INVALID_PARAMETER = 0x2,
  54. /* There are insufficient chip resources to execute the command */
  55. MCC_STATUS_INSUFFICIENT_RESOURCES = 0x3,
  56. /* The command is completing because the queue was getting flushed */
  57. MCC_STATUS_QUEUE_FLUSHING = 0x4,
  58. /* The command is completing with a DMA error */
  59. MCC_STATUS_DMA_FAILED = 0x5,
  60. MCC_STATUS_NOT_SUPPORTED = 66
  61. };
  62. #define CQE_STATUS_COMPL_MASK 0xFFFF
  63. #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
  64. #define CQE_STATUS_EXTD_MASK 0xFFFF
  65. #define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */
  66. struct be_mcc_compl {
  67. u32 status; /* dword 0 */
  68. u32 tag0; /* dword 1 */
  69. u32 tag1; /* dword 2 */
  70. u32 flags; /* dword 3 */
  71. };
  72. /* When the async bit of mcc_compl is set, the last 4 bytes of
  73. * mcc_compl is interpreted as follows:
  74. */
  75. #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
  76. #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
  77. #define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16
  78. #define ASYNC_TRAILER_EVENT_TYPE_MASK 0xFF
  79. #define ASYNC_EVENT_CODE_LINK_STATE 0x1
  80. #define ASYNC_EVENT_CODE_GRP_5 0x5
  81. #define ASYNC_EVENT_QOS_SPEED 0x1
  82. #define ASYNC_EVENT_COS_PRIORITY 0x2
  83. #define ASYNC_EVENT_PVID_STATE 0x3
  84. struct be_async_event_trailer {
  85. u32 code;
  86. };
  87. enum {
  88. ASYNC_EVENT_LINK_DOWN = 0x0,
  89. ASYNC_EVENT_LINK_UP = 0x1
  90. };
  91. /* When the event code of an async trailer is link-state, the mcc_compl
  92. * must be interpreted as follows
  93. */
  94. struct be_async_event_link_state {
  95. u8 physical_port;
  96. u8 port_link_status;
  97. u8 port_duplex;
  98. u8 port_speed;
  99. u8 port_fault;
  100. u8 rsvd0[7];
  101. struct be_async_event_trailer trailer;
  102. } __packed;
  103. /* When the event code of an async trailer is GRP-5 and event_type is QOS_SPEED
  104. * the mcc_compl must be interpreted as follows
  105. */
  106. struct be_async_event_grp5_qos_link_speed {
  107. u8 physical_port;
  108. u8 rsvd[5];
  109. u16 qos_link_speed;
  110. u32 event_tag;
  111. struct be_async_event_trailer trailer;
  112. } __packed;
  113. /* When the event code of an async trailer is GRP5 and event type is
  114. * CoS-Priority, the mcc_compl must be interpreted as follows
  115. */
  116. struct be_async_event_grp5_cos_priority {
  117. u8 physical_port;
  118. u8 available_priority_bmap;
  119. u8 reco_default_priority;
  120. u8 valid;
  121. u8 rsvd0;
  122. u8 event_tag;
  123. struct be_async_event_trailer trailer;
  124. } __packed;
  125. /* When the event code of an async trailer is GRP5 and event type is
  126. * PVID state, the mcc_compl must be interpreted as follows
  127. */
  128. struct be_async_event_grp5_pvid_state {
  129. u8 enabled;
  130. u8 rsvd0;
  131. u16 tag;
  132. u32 event_tag;
  133. u32 rsvd1;
  134. struct be_async_event_trailer trailer;
  135. } __packed;
  136. struct be_mcc_mailbox {
  137. struct be_mcc_wrb wrb;
  138. struct be_mcc_compl compl;
  139. };
  140. #define CMD_SUBSYSTEM_COMMON 0x1
  141. #define CMD_SUBSYSTEM_ETH 0x3
  142. #define CMD_SUBSYSTEM_LOWLEVEL 0xb
  143. #define OPCODE_COMMON_NTWK_MAC_QUERY 1
  144. #define OPCODE_COMMON_NTWK_MAC_SET 2
  145. #define OPCODE_COMMON_NTWK_MULTICAST_SET 3
  146. #define OPCODE_COMMON_NTWK_VLAN_CONFIG 4
  147. #define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
  148. #define OPCODE_COMMON_READ_FLASHROM 6
  149. #define OPCODE_COMMON_WRITE_FLASHROM 7
  150. #define OPCODE_COMMON_CQ_CREATE 12
  151. #define OPCODE_COMMON_EQ_CREATE 13
  152. #define OPCODE_COMMON_MCC_CREATE 21
  153. #define OPCODE_COMMON_SET_QOS 28
  154. #define OPCODE_COMMON_MCC_CREATE_EXT 90
  155. #define OPCODE_COMMON_SEEPROM_READ 30
  156. #define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
  157. #define OPCODE_COMMON_NTWK_RX_FILTER 34
  158. #define OPCODE_COMMON_GET_FW_VERSION 35
  159. #define OPCODE_COMMON_SET_FLOW_CONTROL 36
  160. #define OPCODE_COMMON_GET_FLOW_CONTROL 37
  161. #define OPCODE_COMMON_SET_FRAME_SIZE 39
  162. #define OPCODE_COMMON_MODIFY_EQ_DELAY 41
  163. #define OPCODE_COMMON_FIRMWARE_CONFIG 42
  164. #define OPCODE_COMMON_NTWK_INTERFACE_CREATE 50
  165. #define OPCODE_COMMON_NTWK_INTERFACE_DESTROY 51
  166. #define OPCODE_COMMON_MCC_DESTROY 53
  167. #define OPCODE_COMMON_CQ_DESTROY 54
  168. #define OPCODE_COMMON_EQ_DESTROY 55
  169. #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
  170. #define OPCODE_COMMON_NTWK_PMAC_ADD 59
  171. #define OPCODE_COMMON_NTWK_PMAC_DEL 60
  172. #define OPCODE_COMMON_FUNCTION_RESET 61
  173. #define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69
  174. #define OPCODE_COMMON_GET_BEACON_STATE 70
  175. #define OPCODE_COMMON_READ_TRANSRECV_DATA 73
  176. #define OPCODE_COMMON_GET_PHY_DETAILS 102
  177. #define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
  178. #define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
  179. #define OPCODE_ETH_RSS_CONFIG 1
  180. #define OPCODE_ETH_ACPI_CONFIG 2
  181. #define OPCODE_ETH_PROMISCUOUS 3
  182. #define OPCODE_ETH_GET_STATISTICS 4
  183. #define OPCODE_ETH_TX_CREATE 7
  184. #define OPCODE_ETH_RX_CREATE 8
  185. #define OPCODE_ETH_TX_DESTROY 9
  186. #define OPCODE_ETH_RX_DESTROY 10
  187. #define OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG 12
  188. #define OPCODE_LOWLEVEL_HOST_DDR_DMA 17
  189. #define OPCODE_LOWLEVEL_LOOPBACK_TEST 18
  190. #define OPCODE_LOWLEVEL_SET_LOOPBACK_MODE 19
  191. struct be_cmd_req_hdr {
  192. u8 opcode; /* dword 0 */
  193. u8 subsystem; /* dword 0 */
  194. u8 port_number; /* dword 0 */
  195. u8 domain; /* dword 0 */
  196. u32 timeout; /* dword 1 */
  197. u32 request_length; /* dword 2 */
  198. u8 version; /* dword 3 */
  199. u8 rsvd[3]; /* dword 3 */
  200. };
  201. #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
  202. #define RESP_HDR_INFO_SUBSYS_SHIFT 8 /* bits 8 - 15 */
  203. struct be_cmd_resp_hdr {
  204. u32 info; /* dword 0 */
  205. u32 status; /* dword 1 */
  206. u32 response_length; /* dword 2 */
  207. u32 actual_resp_len; /* dword 3 */
  208. };
  209. struct phys_addr {
  210. u32 lo;
  211. u32 hi;
  212. };
  213. /**************************
  214. * BE Command definitions *
  215. **************************/
  216. /* Pseudo amap definition in which each bit of the actual structure is defined
  217. * as a byte: used to calculate offset/shift/mask of each field */
  218. struct amap_eq_context {
  219. u8 cidx[13]; /* dword 0*/
  220. u8 rsvd0[3]; /* dword 0*/
  221. u8 epidx[13]; /* dword 0*/
  222. u8 valid; /* dword 0*/
  223. u8 rsvd1; /* dword 0*/
  224. u8 size; /* dword 0*/
  225. u8 pidx[13]; /* dword 1*/
  226. u8 rsvd2[3]; /* dword 1*/
  227. u8 pd[10]; /* dword 1*/
  228. u8 count[3]; /* dword 1*/
  229. u8 solevent; /* dword 1*/
  230. u8 stalled; /* dword 1*/
  231. u8 armed; /* dword 1*/
  232. u8 rsvd3[4]; /* dword 2*/
  233. u8 func[8]; /* dword 2*/
  234. u8 rsvd4; /* dword 2*/
  235. u8 delaymult[10]; /* dword 2*/
  236. u8 rsvd5[2]; /* dword 2*/
  237. u8 phase[2]; /* dword 2*/
  238. u8 nodelay; /* dword 2*/
  239. u8 rsvd6[4]; /* dword 2*/
  240. u8 rsvd7[32]; /* dword 3*/
  241. } __packed;
  242. struct be_cmd_req_eq_create {
  243. struct be_cmd_req_hdr hdr;
  244. u16 num_pages; /* sword */
  245. u16 rsvd0; /* sword */
  246. u8 context[sizeof(struct amap_eq_context) / 8];
  247. struct phys_addr pages[8];
  248. } __packed;
  249. struct be_cmd_resp_eq_create {
  250. struct be_cmd_resp_hdr resp_hdr;
  251. u16 eq_id; /* sword */
  252. u16 rsvd0; /* sword */
  253. } __packed;
  254. /******************** Mac query ***************************/
  255. enum {
  256. MAC_ADDRESS_TYPE_STORAGE = 0x0,
  257. MAC_ADDRESS_TYPE_NETWORK = 0x1,
  258. MAC_ADDRESS_TYPE_PD = 0x2,
  259. MAC_ADDRESS_TYPE_MANAGEMENT = 0x3
  260. };
  261. struct mac_addr {
  262. u16 size_of_struct;
  263. u8 addr[ETH_ALEN];
  264. } __packed;
  265. struct be_cmd_req_mac_query {
  266. struct be_cmd_req_hdr hdr;
  267. u8 type;
  268. u8 permanent;
  269. u16 if_id;
  270. } __packed;
  271. struct be_cmd_resp_mac_query {
  272. struct be_cmd_resp_hdr hdr;
  273. struct mac_addr mac;
  274. };
  275. /******************** PMac Add ***************************/
  276. struct be_cmd_req_pmac_add {
  277. struct be_cmd_req_hdr hdr;
  278. u32 if_id;
  279. u8 mac_address[ETH_ALEN];
  280. u8 rsvd0[2];
  281. } __packed;
  282. struct be_cmd_resp_pmac_add {
  283. struct be_cmd_resp_hdr hdr;
  284. u32 pmac_id;
  285. };
  286. /******************** PMac Del ***************************/
  287. struct be_cmd_req_pmac_del {
  288. struct be_cmd_req_hdr hdr;
  289. u32 if_id;
  290. u32 pmac_id;
  291. };
  292. /******************** Create CQ ***************************/
  293. /* Pseudo amap definition in which each bit of the actual structure is defined
  294. * as a byte: used to calculate offset/shift/mask of each field */
  295. struct amap_cq_context_be {
  296. u8 cidx[11]; /* dword 0*/
  297. u8 rsvd0; /* dword 0*/
  298. u8 coalescwm[2]; /* dword 0*/
  299. u8 nodelay; /* dword 0*/
  300. u8 epidx[11]; /* dword 0*/
  301. u8 rsvd1; /* dword 0*/
  302. u8 count[2]; /* dword 0*/
  303. u8 valid; /* dword 0*/
  304. u8 solevent; /* dword 0*/
  305. u8 eventable; /* dword 0*/
  306. u8 pidx[11]; /* dword 1*/
  307. u8 rsvd2; /* dword 1*/
  308. u8 pd[10]; /* dword 1*/
  309. u8 eqid[8]; /* dword 1*/
  310. u8 stalled; /* dword 1*/
  311. u8 armed; /* dword 1*/
  312. u8 rsvd3[4]; /* dword 2*/
  313. u8 func[8]; /* dword 2*/
  314. u8 rsvd4[20]; /* dword 2*/
  315. u8 rsvd5[32]; /* dword 3*/
  316. } __packed;
  317. struct amap_cq_context_lancer {
  318. u8 rsvd0[12]; /* dword 0*/
  319. u8 coalescwm[2]; /* dword 0*/
  320. u8 nodelay; /* dword 0*/
  321. u8 rsvd1[12]; /* dword 0*/
  322. u8 count[2]; /* dword 0*/
  323. u8 valid; /* dword 0*/
  324. u8 rsvd2; /* dword 0*/
  325. u8 eventable; /* dword 0*/
  326. u8 eqid[16]; /* dword 1*/
  327. u8 rsvd3[15]; /* dword 1*/
  328. u8 armed; /* dword 1*/
  329. u8 rsvd4[32]; /* dword 2*/
  330. u8 rsvd5[32]; /* dword 3*/
  331. } __packed;
  332. struct be_cmd_req_cq_create {
  333. struct be_cmd_req_hdr hdr;
  334. u16 num_pages;
  335. u8 page_size;
  336. u8 rsvd0;
  337. u8 context[sizeof(struct amap_cq_context_be) / 8];
  338. struct phys_addr pages[8];
  339. } __packed;
  340. struct be_cmd_resp_cq_create {
  341. struct be_cmd_resp_hdr hdr;
  342. u16 cq_id;
  343. u16 rsvd0;
  344. } __packed;
  345. /******************** Create MCCQ ***************************/
  346. /* Pseudo amap definition in which each bit of the actual structure is defined
  347. * as a byte: used to calculate offset/shift/mask of each field */
  348. struct amap_mcc_context_be {
  349. u8 con_index[14];
  350. u8 rsvd0[2];
  351. u8 ring_size[4];
  352. u8 fetch_wrb;
  353. u8 fetch_r2t;
  354. u8 cq_id[10];
  355. u8 prod_index[14];
  356. u8 fid[8];
  357. u8 pdid[9];
  358. u8 valid;
  359. u8 rsvd1[32];
  360. u8 rsvd2[32];
  361. } __packed;
  362. struct amap_mcc_context_lancer {
  363. u8 async_cq_id[16];
  364. u8 ring_size[4];
  365. u8 rsvd0[12];
  366. u8 rsvd1[31];
  367. u8 valid;
  368. u8 async_cq_valid[1];
  369. u8 rsvd2[31];
  370. u8 rsvd3[32];
  371. } __packed;
  372. struct be_cmd_req_mcc_create {
  373. struct be_cmd_req_hdr hdr;
  374. u16 num_pages;
  375. u16 cq_id;
  376. u32 async_event_bitmap[1];
  377. u8 context[sizeof(struct amap_mcc_context_be) / 8];
  378. struct phys_addr pages[8];
  379. } __packed;
  380. struct be_cmd_resp_mcc_create {
  381. struct be_cmd_resp_hdr hdr;
  382. u16 id;
  383. u16 rsvd0;
  384. } __packed;
  385. /******************** Create TxQ ***************************/
  386. #define BE_ETH_TX_RING_TYPE_STANDARD 2
  387. #define BE_ULP1_NUM 1
  388. /* Pseudo amap definition in which each bit of the actual structure is defined
  389. * as a byte: used to calculate offset/shift/mask of each field */
  390. struct amap_tx_context {
  391. u8 if_id[16]; /* dword 0 */
  392. u8 tx_ring_size[4]; /* dword 0 */
  393. u8 rsvd1[26]; /* dword 0 */
  394. u8 pci_func_id[8]; /* dword 1 */
  395. u8 rsvd2[9]; /* dword 1 */
  396. u8 ctx_valid; /* dword 1 */
  397. u8 cq_id_send[16]; /* dword 2 */
  398. u8 rsvd3[16]; /* dword 2 */
  399. u8 rsvd4[32]; /* dword 3 */
  400. u8 rsvd5[32]; /* dword 4 */
  401. u8 rsvd6[32]; /* dword 5 */
  402. u8 rsvd7[32]; /* dword 6 */
  403. u8 rsvd8[32]; /* dword 7 */
  404. u8 rsvd9[32]; /* dword 8 */
  405. u8 rsvd10[32]; /* dword 9 */
  406. u8 rsvd11[32]; /* dword 10 */
  407. u8 rsvd12[32]; /* dword 11 */
  408. u8 rsvd13[32]; /* dword 12 */
  409. u8 rsvd14[32]; /* dword 13 */
  410. u8 rsvd15[32]; /* dword 14 */
  411. u8 rsvd16[32]; /* dword 15 */
  412. } __packed;
  413. struct be_cmd_req_eth_tx_create {
  414. struct be_cmd_req_hdr hdr;
  415. u8 num_pages;
  416. u8 ulp_num;
  417. u8 type;
  418. u8 bound_port;
  419. u8 context[sizeof(struct amap_tx_context) / 8];
  420. struct phys_addr pages[8];
  421. } __packed;
  422. struct be_cmd_resp_eth_tx_create {
  423. struct be_cmd_resp_hdr hdr;
  424. u16 cid;
  425. u16 rsvd0;
  426. } __packed;
  427. /******************** Create RxQ ***************************/
  428. struct be_cmd_req_eth_rx_create {
  429. struct be_cmd_req_hdr hdr;
  430. u16 cq_id;
  431. u8 frag_size;
  432. u8 num_pages;
  433. struct phys_addr pages[2];
  434. u32 interface_id;
  435. u16 max_frame_size;
  436. u16 rsvd0;
  437. u32 rss_queue;
  438. } __packed;
  439. struct be_cmd_resp_eth_rx_create {
  440. struct be_cmd_resp_hdr hdr;
  441. u16 id;
  442. u8 rss_id;
  443. u8 rsvd0;
  444. } __packed;
  445. /******************** Q Destroy ***************************/
  446. /* Type of Queue to be destroyed */
  447. enum {
  448. QTYPE_EQ = 1,
  449. QTYPE_CQ,
  450. QTYPE_TXQ,
  451. QTYPE_RXQ,
  452. QTYPE_MCCQ
  453. };
  454. struct be_cmd_req_q_destroy {
  455. struct be_cmd_req_hdr hdr;
  456. u16 id;
  457. u16 bypass_flush; /* valid only for rx q destroy */
  458. } __packed;
  459. /************ I/f Create (it's actually I/f Config Create)**********/
  460. /* Capability flags for the i/f */
  461. enum be_if_flags {
  462. BE_IF_FLAGS_RSS = 0x4,
  463. BE_IF_FLAGS_PROMISCUOUS = 0x8,
  464. BE_IF_FLAGS_BROADCAST = 0x10,
  465. BE_IF_FLAGS_UNTAGGED = 0x20,
  466. BE_IF_FLAGS_ULP = 0x40,
  467. BE_IF_FLAGS_VLAN_PROMISCUOUS = 0x80,
  468. BE_IF_FLAGS_VLAN = 0x100,
  469. BE_IF_FLAGS_MCAST_PROMISCUOUS = 0x200,
  470. BE_IF_FLAGS_PASS_L2_ERRORS = 0x400,
  471. BE_IF_FLAGS_PASS_L3L4_ERRORS = 0x800,
  472. BE_IF_FLAGS_MULTICAST = 0x1000
  473. };
  474. /* An RX interface is an object with one or more MAC addresses and
  475. * filtering capabilities. */
  476. struct be_cmd_req_if_create {
  477. struct be_cmd_req_hdr hdr;
  478. u32 version; /* ignore currently */
  479. u32 capability_flags;
  480. u32 enable_flags;
  481. u8 mac_addr[ETH_ALEN];
  482. u8 rsvd0;
  483. u8 pmac_invalid; /* if set, don't attach the mac addr to the i/f */
  484. u32 vlan_tag; /* not used currently */
  485. } __packed;
  486. struct be_cmd_resp_if_create {
  487. struct be_cmd_resp_hdr hdr;
  488. u32 interface_id;
  489. u32 pmac_id;
  490. };
  491. /****** I/f Destroy(it's actually I/f Config Destroy )**********/
  492. struct be_cmd_req_if_destroy {
  493. struct be_cmd_req_hdr hdr;
  494. u32 interface_id;
  495. };
  496. /*************** HW Stats Get **********************************/
  497. struct be_port_rxf_stats {
  498. u32 rx_bytes_lsd; /* dword 0*/
  499. u32 rx_bytes_msd; /* dword 1*/
  500. u32 rx_total_frames; /* dword 2*/
  501. u32 rx_unicast_frames; /* dword 3*/
  502. u32 rx_multicast_frames; /* dword 4*/
  503. u32 rx_broadcast_frames; /* dword 5*/
  504. u32 rx_crc_errors; /* dword 6*/
  505. u32 rx_alignment_symbol_errors; /* dword 7*/
  506. u32 rx_pause_frames; /* dword 8*/
  507. u32 rx_control_frames; /* dword 9*/
  508. u32 rx_in_range_errors; /* dword 10*/
  509. u32 rx_out_range_errors; /* dword 11*/
  510. u32 rx_frame_too_long; /* dword 12*/
  511. u32 rx_address_match_errors; /* dword 13*/
  512. u32 rx_vlan_mismatch; /* dword 14*/
  513. u32 rx_dropped_too_small; /* dword 15*/
  514. u32 rx_dropped_too_short; /* dword 16*/
  515. u32 rx_dropped_header_too_small; /* dword 17*/
  516. u32 rx_dropped_tcp_length; /* dword 18*/
  517. u32 rx_dropped_runt; /* dword 19*/
  518. u32 rx_64_byte_packets; /* dword 20*/
  519. u32 rx_65_127_byte_packets; /* dword 21*/
  520. u32 rx_128_256_byte_packets; /* dword 22*/
  521. u32 rx_256_511_byte_packets; /* dword 23*/
  522. u32 rx_512_1023_byte_packets; /* dword 24*/
  523. u32 rx_1024_1518_byte_packets; /* dword 25*/
  524. u32 rx_1519_2047_byte_packets; /* dword 26*/
  525. u32 rx_2048_4095_byte_packets; /* dword 27*/
  526. u32 rx_4096_8191_byte_packets; /* dword 28*/
  527. u32 rx_8192_9216_byte_packets; /* dword 29*/
  528. u32 rx_ip_checksum_errs; /* dword 30*/
  529. u32 rx_tcp_checksum_errs; /* dword 31*/
  530. u32 rx_udp_checksum_errs; /* dword 32*/
  531. u32 rx_non_rss_packets; /* dword 33*/
  532. u32 rx_ipv4_packets; /* dword 34*/
  533. u32 rx_ipv6_packets; /* dword 35*/
  534. u32 rx_ipv4_bytes_lsd; /* dword 36*/
  535. u32 rx_ipv4_bytes_msd; /* dword 37*/
  536. u32 rx_ipv6_bytes_lsd; /* dword 38*/
  537. u32 rx_ipv6_bytes_msd; /* dword 39*/
  538. u32 rx_chute1_packets; /* dword 40*/
  539. u32 rx_chute2_packets; /* dword 41*/
  540. u32 rx_chute3_packets; /* dword 42*/
  541. u32 rx_management_packets; /* dword 43*/
  542. u32 rx_switched_unicast_packets; /* dword 44*/
  543. u32 rx_switched_multicast_packets; /* dword 45*/
  544. u32 rx_switched_broadcast_packets; /* dword 46*/
  545. u32 tx_bytes_lsd; /* dword 47*/
  546. u32 tx_bytes_msd; /* dword 48*/
  547. u32 tx_unicastframes; /* dword 49*/
  548. u32 tx_multicastframes; /* dword 50*/
  549. u32 tx_broadcastframes; /* dword 51*/
  550. u32 tx_pauseframes; /* dword 52*/
  551. u32 tx_controlframes; /* dword 53*/
  552. u32 tx_64_byte_packets; /* dword 54*/
  553. u32 tx_65_127_byte_packets; /* dword 55*/
  554. u32 tx_128_256_byte_packets; /* dword 56*/
  555. u32 tx_256_511_byte_packets; /* dword 57*/
  556. u32 tx_512_1023_byte_packets; /* dword 58*/
  557. u32 tx_1024_1518_byte_packets; /* dword 59*/
  558. u32 tx_1519_2047_byte_packets; /* dword 60*/
  559. u32 tx_2048_4095_byte_packets; /* dword 61*/
  560. u32 tx_4096_8191_byte_packets; /* dword 62*/
  561. u32 tx_8192_9216_byte_packets; /* dword 63*/
  562. u32 rx_fifo_overflow; /* dword 64*/
  563. u32 rx_input_fifo_overflow; /* dword 65*/
  564. };
  565. struct be_rxf_stats {
  566. struct be_port_rxf_stats port[2];
  567. u32 rx_drops_no_pbuf; /* dword 132*/
  568. u32 rx_drops_no_txpb; /* dword 133*/
  569. u32 rx_drops_no_erx_descr; /* dword 134*/
  570. u32 rx_drops_no_tpre_descr; /* dword 135*/
  571. u32 management_rx_port_packets; /* dword 136*/
  572. u32 management_rx_port_bytes; /* dword 137*/
  573. u32 management_rx_port_pause_frames; /* dword 138*/
  574. u32 management_rx_port_errors; /* dword 139*/
  575. u32 management_tx_port_packets; /* dword 140*/
  576. u32 management_tx_port_bytes; /* dword 141*/
  577. u32 management_tx_port_pause; /* dword 142*/
  578. u32 management_rx_port_rxfifo_overflow; /* dword 143*/
  579. u32 rx_drops_too_many_frags; /* dword 144*/
  580. u32 rx_drops_invalid_ring; /* dword 145*/
  581. u32 forwarded_packets; /* dword 146*/
  582. u32 rx_drops_mtu; /* dword 147*/
  583. u32 rsvd0[7];
  584. u32 port0_jabber_events;
  585. u32 port1_jabber_events;
  586. u32 rsvd1[6];
  587. };
  588. struct be_erx_stats {
  589. u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/
  590. u32 debug_wdma_sent_hold; /* dword 44*/
  591. u32 debug_wdma_pbfree_sent_hold; /* dword 45*/
  592. u32 debug_wdma_zerobyte_pbfree_sent_hold; /* dword 46*/
  593. u32 debug_pmem_pbuf_dealloc; /* dword 47*/
  594. };
  595. struct be_pmem_stats {
  596. u32 eth_red_drops;
  597. u32 rsvd[4];
  598. };
  599. struct be_hw_stats {
  600. struct be_rxf_stats rxf;
  601. u32 rsvd[48];
  602. struct be_erx_stats erx;
  603. struct be_pmem_stats pmem;
  604. };
  605. struct be_cmd_req_get_stats {
  606. struct be_cmd_req_hdr hdr;
  607. u8 rsvd[sizeof(struct be_hw_stats)];
  608. };
  609. struct be_cmd_resp_get_stats {
  610. struct be_cmd_resp_hdr hdr;
  611. struct be_hw_stats hw_stats;
  612. };
  613. struct be_cmd_req_get_cntl_addnl_attribs {
  614. struct be_cmd_req_hdr hdr;
  615. u8 rsvd[8];
  616. };
  617. struct be_cmd_resp_get_cntl_addnl_attribs {
  618. struct be_cmd_resp_hdr hdr;
  619. u16 ipl_file_number;
  620. u8 ipl_file_version;
  621. u8 rsvd0;
  622. u8 on_die_temperature; /* in degrees centigrade*/
  623. u8 rsvd1[3];
  624. };
  625. struct be_cmd_req_vlan_config {
  626. struct be_cmd_req_hdr hdr;
  627. u8 interface_id;
  628. u8 promiscuous;
  629. u8 untagged;
  630. u8 num_vlan;
  631. u16 normal_vlan[64];
  632. } __packed;
  633. struct be_cmd_req_promiscuous_config {
  634. struct be_cmd_req_hdr hdr;
  635. u8 port0_promiscuous;
  636. u8 port1_promiscuous;
  637. u16 rsvd0;
  638. } __packed;
  639. /******************** Multicast MAC Config *******************/
  640. #define BE_MAX_MC 64 /* set mcast promisc if > 64 */
  641. struct macaddr {
  642. u8 byte[ETH_ALEN];
  643. };
  644. struct be_cmd_req_mcast_mac_config {
  645. struct be_cmd_req_hdr hdr;
  646. u16 num_mac;
  647. u8 promiscuous;
  648. u8 interface_id;
  649. struct macaddr mac[BE_MAX_MC];
  650. } __packed;
  651. static inline struct be_hw_stats *
  652. hw_stats_from_cmd(struct be_cmd_resp_get_stats *cmd)
  653. {
  654. return &cmd->hw_stats;
  655. }
  656. /******************** Link Status Query *******************/
  657. struct be_cmd_req_link_status {
  658. struct be_cmd_req_hdr hdr;
  659. u32 rsvd;
  660. };
  661. enum {
  662. PHY_LINK_DUPLEX_NONE = 0x0,
  663. PHY_LINK_DUPLEX_HALF = 0x1,
  664. PHY_LINK_DUPLEX_FULL = 0x2
  665. };
  666. enum {
  667. PHY_LINK_SPEED_ZERO = 0x0, /* => No link */
  668. PHY_LINK_SPEED_10MBPS = 0x1,
  669. PHY_LINK_SPEED_100MBPS = 0x2,
  670. PHY_LINK_SPEED_1GBPS = 0x3,
  671. PHY_LINK_SPEED_10GBPS = 0x4
  672. };
  673. struct be_cmd_resp_link_status {
  674. struct be_cmd_resp_hdr hdr;
  675. u8 physical_port;
  676. u8 mac_duplex;
  677. u8 mac_speed;
  678. u8 mac_fault;
  679. u8 mgmt_mac_duplex;
  680. u8 mgmt_mac_speed;
  681. u16 link_speed;
  682. u32 rsvd0;
  683. } __packed;
  684. /******************** Port Identification ***************************/
  685. /* Identifies the type of port attached to NIC */
  686. struct be_cmd_req_port_type {
  687. struct be_cmd_req_hdr hdr;
  688. u32 page_num;
  689. u32 port;
  690. };
  691. enum {
  692. TR_PAGE_A0 = 0xa0,
  693. TR_PAGE_A2 = 0xa2
  694. };
  695. struct be_cmd_resp_port_type {
  696. struct be_cmd_resp_hdr hdr;
  697. u32 page_num;
  698. u32 port;
  699. struct data {
  700. u8 identifier;
  701. u8 identifier_ext;
  702. u8 connector;
  703. u8 transceiver[8];
  704. u8 rsvd0[3];
  705. u8 length_km;
  706. u8 length_hm;
  707. u8 length_om1;
  708. u8 length_om2;
  709. u8 length_cu;
  710. u8 length_cu_m;
  711. u8 vendor_name[16];
  712. u8 rsvd;
  713. u8 vendor_oui[3];
  714. u8 vendor_pn[16];
  715. u8 vendor_rev[4];
  716. } data;
  717. };
  718. /******************** Get FW Version *******************/
  719. struct be_cmd_req_get_fw_version {
  720. struct be_cmd_req_hdr hdr;
  721. u8 rsvd0[FW_VER_LEN];
  722. u8 rsvd1[FW_VER_LEN];
  723. } __packed;
  724. struct be_cmd_resp_get_fw_version {
  725. struct be_cmd_resp_hdr hdr;
  726. u8 firmware_version_string[FW_VER_LEN];
  727. u8 fw_on_flash_version_string[FW_VER_LEN];
  728. } __packed;
  729. /******************** Set Flow Contrl *******************/
  730. struct be_cmd_req_set_flow_control {
  731. struct be_cmd_req_hdr hdr;
  732. u16 tx_flow_control;
  733. u16 rx_flow_control;
  734. } __packed;
  735. /******************** Get Flow Contrl *******************/
  736. struct be_cmd_req_get_flow_control {
  737. struct be_cmd_req_hdr hdr;
  738. u32 rsvd;
  739. };
  740. struct be_cmd_resp_get_flow_control {
  741. struct be_cmd_resp_hdr hdr;
  742. u16 tx_flow_control;
  743. u16 rx_flow_control;
  744. } __packed;
  745. /******************** Modify EQ Delay *******************/
  746. struct be_cmd_req_modify_eq_delay {
  747. struct be_cmd_req_hdr hdr;
  748. u32 num_eq;
  749. struct {
  750. u32 eq_id;
  751. u32 phase;
  752. u32 delay_multiplier;
  753. } delay[8];
  754. } __packed;
  755. struct be_cmd_resp_modify_eq_delay {
  756. struct be_cmd_resp_hdr hdr;
  757. u32 rsvd0;
  758. } __packed;
  759. /******************** Get FW Config *******************/
  760. #define BE_FUNCTION_CAPS_RSS 0x2
  761. struct be_cmd_req_query_fw_cfg {
  762. struct be_cmd_req_hdr hdr;
  763. u32 rsvd[31];
  764. };
  765. struct be_cmd_resp_query_fw_cfg {
  766. struct be_cmd_resp_hdr hdr;
  767. u32 be_config_number;
  768. u32 asic_revision;
  769. u32 phys_port;
  770. u32 function_mode;
  771. u32 rsvd[26];
  772. u32 function_caps;
  773. };
  774. /******************** RSS Config *******************/
  775. /* RSS types */
  776. #define RSS_ENABLE_NONE 0x0
  777. #define RSS_ENABLE_IPV4 0x1
  778. #define RSS_ENABLE_TCP_IPV4 0x2
  779. #define RSS_ENABLE_IPV6 0x4
  780. #define RSS_ENABLE_TCP_IPV6 0x8
  781. struct be_cmd_req_rss_config {
  782. struct be_cmd_req_hdr hdr;
  783. u32 if_id;
  784. u16 enable_rss;
  785. u16 cpu_table_size_log2;
  786. u32 hash[10];
  787. u8 cpu_table[128];
  788. u8 flush;
  789. u8 rsvd0[3];
  790. };
  791. /******************** Port Beacon ***************************/
  792. #define BEACON_STATE_ENABLED 0x1
  793. #define BEACON_STATE_DISABLED 0x0
  794. struct be_cmd_req_enable_disable_beacon {
  795. struct be_cmd_req_hdr hdr;
  796. u8 port_num;
  797. u8 beacon_state;
  798. u8 beacon_duration;
  799. u8 status_duration;
  800. } __packed;
  801. struct be_cmd_resp_enable_disable_beacon {
  802. struct be_cmd_resp_hdr resp_hdr;
  803. u32 rsvd0;
  804. } __packed;
  805. struct be_cmd_req_get_beacon_state {
  806. struct be_cmd_req_hdr hdr;
  807. u8 port_num;
  808. u8 rsvd0;
  809. u16 rsvd1;
  810. } __packed;
  811. struct be_cmd_resp_get_beacon_state {
  812. struct be_cmd_resp_hdr resp_hdr;
  813. u8 beacon_state;
  814. u8 rsvd0[3];
  815. } __packed;
  816. /****************** Firmware Flash ******************/
  817. struct flashrom_params {
  818. u32 op_code;
  819. u32 op_type;
  820. u32 data_buf_size;
  821. u32 offset;
  822. u8 data_buf[4];
  823. };
  824. struct be_cmd_write_flashrom {
  825. struct be_cmd_req_hdr hdr;
  826. struct flashrom_params params;
  827. };
  828. /************************ WOL *******************************/
  829. struct be_cmd_req_acpi_wol_magic_config{
  830. struct be_cmd_req_hdr hdr;
  831. u32 rsvd0[145];
  832. u8 magic_mac[6];
  833. u8 rsvd2[2];
  834. } __packed;
  835. /********************** LoopBack test *********************/
  836. struct be_cmd_req_loopback_test {
  837. struct be_cmd_req_hdr hdr;
  838. u32 loopback_type;
  839. u32 num_pkts;
  840. u64 pattern;
  841. u32 src_port;
  842. u32 dest_port;
  843. u32 pkt_size;
  844. };
  845. struct be_cmd_resp_loopback_test {
  846. struct be_cmd_resp_hdr resp_hdr;
  847. u32 status;
  848. u32 num_txfer;
  849. u32 num_rx;
  850. u32 miscomp_off;
  851. u32 ticks_compl;
  852. };
  853. struct be_cmd_req_set_lmode {
  854. struct be_cmd_req_hdr hdr;
  855. u8 src_port;
  856. u8 dest_port;
  857. u8 loopback_type;
  858. u8 loopback_state;
  859. };
  860. struct be_cmd_resp_set_lmode {
  861. struct be_cmd_resp_hdr resp_hdr;
  862. u8 rsvd0[4];
  863. };
  864. /********************** DDR DMA test *********************/
  865. struct be_cmd_req_ddrdma_test {
  866. struct be_cmd_req_hdr hdr;
  867. u64 pattern;
  868. u32 byte_count;
  869. u32 rsvd0;
  870. u8 snd_buff[4096];
  871. u8 rsvd1[4096];
  872. };
  873. struct be_cmd_resp_ddrdma_test {
  874. struct be_cmd_resp_hdr hdr;
  875. u64 pattern;
  876. u32 byte_cnt;
  877. u32 snd_err;
  878. u8 rsvd0[4096];
  879. u8 rcv_buff[4096];
  880. };
  881. /*********************** SEEPROM Read ***********************/
  882. #define BE_READ_SEEPROM_LEN 1024
  883. struct be_cmd_req_seeprom_read {
  884. struct be_cmd_req_hdr hdr;
  885. u8 rsvd0[BE_READ_SEEPROM_LEN];
  886. };
  887. struct be_cmd_resp_seeprom_read {
  888. struct be_cmd_req_hdr hdr;
  889. u8 seeprom_data[BE_READ_SEEPROM_LEN];
  890. };
  891. enum {
  892. PHY_TYPE_CX4_10GB = 0,
  893. PHY_TYPE_XFP_10GB,
  894. PHY_TYPE_SFP_1GB,
  895. PHY_TYPE_SFP_PLUS_10GB,
  896. PHY_TYPE_KR_10GB,
  897. PHY_TYPE_KX4_10GB,
  898. PHY_TYPE_BASET_10GB,
  899. PHY_TYPE_BASET_1GB,
  900. PHY_TYPE_DISABLED = 255
  901. };
  902. struct be_cmd_req_get_phy_info {
  903. struct be_cmd_req_hdr hdr;
  904. u8 rsvd0[24];
  905. };
  906. struct be_cmd_resp_get_phy_info {
  907. struct be_cmd_req_hdr hdr;
  908. u16 phy_type;
  909. u16 interface_type;
  910. u32 misc_params;
  911. u32 future_use[4];
  912. };
  913. /*********************** Set QOS ***********************/
  914. #define BE_QOS_BITS_NIC 1
  915. struct be_cmd_req_set_qos {
  916. struct be_cmd_req_hdr hdr;
  917. u32 valid_bits;
  918. u32 max_bps_nic;
  919. u32 rsvd[7];
  920. };
  921. struct be_cmd_resp_set_qos {
  922. struct be_cmd_resp_hdr hdr;
  923. u32 rsvd;
  924. };
  925. /*********************** Controller Attributes ***********************/
  926. struct be_cmd_req_cntl_attribs {
  927. struct be_cmd_req_hdr hdr;
  928. };
  929. struct be_cmd_resp_cntl_attribs {
  930. struct be_cmd_resp_hdr hdr;
  931. struct mgmt_controller_attrib attribs;
  932. };
  933. /*********************** Set driver function ***********************/
  934. #define CAPABILITY_SW_TIMESTAMPS 2
  935. #define CAPABILITY_BE3_NATIVE_ERX_API 4
  936. struct be_cmd_req_set_func_cap {
  937. struct be_cmd_req_hdr hdr;
  938. u32 valid_cap_flags;
  939. u32 cap_flags;
  940. u8 rsvd[212];
  941. };
  942. struct be_cmd_resp_set_func_cap {
  943. struct be_cmd_resp_hdr hdr;
  944. u32 valid_cap_flags;
  945. u32 cap_flags;
  946. u8 rsvd[212];
  947. };
  948. extern int be_pci_fnum_get(struct be_adapter *adapter);
  949. extern int be_cmd_POST(struct be_adapter *adapter);
  950. extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
  951. u8 type, bool permanent, u32 if_handle);
  952. extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
  953. u32 if_id, u32 *pmac_id, u32 domain);
  954. extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id,
  955. u32 pmac_id, u32 domain);
  956. extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags,
  957. u32 en_flags, u8 *mac, bool pmac_invalid,
  958. u32 *if_handle, u32 *pmac_id, u32 domain);
  959. extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle,
  960. u32 domain);
  961. extern int be_cmd_eq_create(struct be_adapter *adapter,
  962. struct be_queue_info *eq, int eq_delay);
  963. extern int be_cmd_cq_create(struct be_adapter *adapter,
  964. struct be_queue_info *cq, struct be_queue_info *eq,
  965. bool sol_evts, bool no_delay,
  966. int num_cqe_dma_coalesce);
  967. extern int be_cmd_mccq_create(struct be_adapter *adapter,
  968. struct be_queue_info *mccq,
  969. struct be_queue_info *cq);
  970. extern int be_cmd_txq_create(struct be_adapter *adapter,
  971. struct be_queue_info *txq,
  972. struct be_queue_info *cq);
  973. extern int be_cmd_rxq_create(struct be_adapter *adapter,
  974. struct be_queue_info *rxq, u16 cq_id,
  975. u16 frag_size, u16 max_frame_size, u32 if_id,
  976. u32 rss, u8 *rss_id);
  977. extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
  978. int type);
  979. extern int be_cmd_link_status_query(struct be_adapter *adapter,
  980. bool *link_up, u8 *mac_speed, u16 *link_speed);
  981. extern int be_cmd_reset(struct be_adapter *adapter);
  982. extern int be_cmd_get_stats(struct be_adapter *adapter,
  983. struct be_dma_mem *nonemb_cmd);
  984. extern int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver);
  985. extern int be_cmd_modify_eqd(struct be_adapter *adapter, u32 eq_id, u32 eqd);
  986. extern int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id,
  987. u16 *vtag_array, u32 num, bool untagged,
  988. bool promiscuous);
  989. extern int be_cmd_promiscuous_config(struct be_adapter *adapter,
  990. u8 port_num, bool en);
  991. extern int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id,
  992. struct net_device *netdev, struct be_dma_mem *mem);
  993. extern int be_cmd_set_flow_control(struct be_adapter *adapter,
  994. u32 tx_fc, u32 rx_fc);
  995. extern int be_cmd_get_flow_control(struct be_adapter *adapter,
  996. u32 *tx_fc, u32 *rx_fc);
  997. extern int be_cmd_query_fw_cfg(struct be_adapter *adapter,
  998. u32 *port_num, u32 *function_mode, u32 *function_caps);
  999. extern int be_cmd_reset_function(struct be_adapter *adapter);
  1000. extern int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
  1001. u16 table_size);
  1002. extern int be_process_mcc(struct be_adapter *adapter, int *status);
  1003. extern int be_cmd_set_beacon_state(struct be_adapter *adapter,
  1004. u8 port_num, u8 beacon, u8 status, u8 state);
  1005. extern int be_cmd_get_beacon_state(struct be_adapter *adapter,
  1006. u8 port_num, u32 *state);
  1007. extern int be_cmd_write_flashrom(struct be_adapter *adapter,
  1008. struct be_dma_mem *cmd, u32 flash_oper,
  1009. u32 flash_opcode, u32 buf_size);
  1010. int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
  1011. int offset);
  1012. extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
  1013. struct be_dma_mem *nonemb_cmd);
  1014. extern int be_cmd_fw_init(struct be_adapter *adapter);
  1015. extern int be_cmd_fw_clean(struct be_adapter *adapter);
  1016. extern void be_async_mcc_enable(struct be_adapter *adapter);
  1017. extern void be_async_mcc_disable(struct be_adapter *adapter);
  1018. extern int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
  1019. u32 loopback_type, u32 pkt_size,
  1020. u32 num_pkts, u64 pattern);
  1021. extern int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
  1022. u32 byte_cnt, struct be_dma_mem *cmd);
  1023. extern int be_cmd_get_seeprom_data(struct be_adapter *adapter,
  1024. struct be_dma_mem *nonemb_cmd);
  1025. extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
  1026. u8 loopback_type, u8 enable);
  1027. extern int be_cmd_get_phy_info(struct be_adapter *adapter,
  1028. struct be_dma_mem *cmd);
  1029. extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);
  1030. extern void be_detect_dump_ue(struct be_adapter *adapter);
  1031. extern int be_cmd_get_die_temperature(struct be_adapter *adapter);
  1032. extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter);
  1033. extern int be_cmd_check_native_mode(struct be_adapter *adapter);