be_cmds.h 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768
  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 = 0,
  50. MCC_STATUS_FAILED = 1,
  51. MCC_STATUS_ILLEGAL_REQUEST = 2,
  52. MCC_STATUS_ILLEGAL_FIELD = 3,
  53. MCC_STATUS_INSUFFICIENT_BUFFER = 4,
  54. MCC_STATUS_UNAUTHORIZED_REQUEST = 5,
  55. MCC_STATUS_NOT_SUPPORTED = 66
  56. };
  57. #define CQE_STATUS_COMPL_MASK 0xFFFF
  58. #define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
  59. #define CQE_STATUS_EXTD_MASK 0xFFFF
  60. #define CQE_STATUS_EXTD_SHIFT 16 /* bits 16 - 31 */
  61. struct be_mcc_compl {
  62. u32 status; /* dword 0 */
  63. u32 tag0; /* dword 1 */
  64. u32 tag1; /* dword 2 */
  65. u32 flags; /* dword 3 */
  66. };
  67. /* When the async bit of mcc_compl is set, the last 4 bytes of
  68. * mcc_compl is interpreted as follows:
  69. */
  70. #define ASYNC_TRAILER_EVENT_CODE_SHIFT 8 /* bits 8 - 15 */
  71. #define ASYNC_TRAILER_EVENT_CODE_MASK 0xFF
  72. #define ASYNC_TRAILER_EVENT_TYPE_SHIFT 16
  73. #define ASYNC_TRAILER_EVENT_TYPE_MASK 0xFF
  74. #define ASYNC_EVENT_CODE_LINK_STATE 0x1
  75. #define ASYNC_EVENT_CODE_GRP_5 0x5
  76. #define ASYNC_EVENT_QOS_SPEED 0x1
  77. #define ASYNC_EVENT_COS_PRIORITY 0x2
  78. #define ASYNC_EVENT_PVID_STATE 0x3
  79. struct be_async_event_trailer {
  80. u32 code;
  81. };
  82. enum {
  83. LINK_DOWN = 0x0,
  84. LINK_UP = 0x1
  85. };
  86. #define LINK_STATUS_MASK 0x1
  87. /* When the event code of an async trailer is link-state, the mcc_compl
  88. * must be interpreted as follows
  89. */
  90. struct be_async_event_link_state {
  91. u8 physical_port;
  92. u8 port_link_status;
  93. u8 port_duplex;
  94. u8 port_speed;
  95. u8 port_fault;
  96. u8 rsvd0[7];
  97. struct be_async_event_trailer trailer;
  98. } __packed;
  99. /* When the event code of an async trailer is GRP-5 and event_type is QOS_SPEED
  100. * the mcc_compl must be interpreted as follows
  101. */
  102. struct be_async_event_grp5_qos_link_speed {
  103. u8 physical_port;
  104. u8 rsvd[5];
  105. u16 qos_link_speed;
  106. u32 event_tag;
  107. struct be_async_event_trailer trailer;
  108. } __packed;
  109. /* When the event code of an async trailer is GRP5 and event type is
  110. * CoS-Priority, the mcc_compl must be interpreted as follows
  111. */
  112. struct be_async_event_grp5_cos_priority {
  113. u8 physical_port;
  114. u8 available_priority_bmap;
  115. u8 reco_default_priority;
  116. u8 valid;
  117. u8 rsvd0;
  118. u8 event_tag;
  119. struct be_async_event_trailer trailer;
  120. } __packed;
  121. /* When the event code of an async trailer is GRP5 and event type is
  122. * PVID state, the mcc_compl must be interpreted as follows
  123. */
  124. struct be_async_event_grp5_pvid_state {
  125. u8 enabled;
  126. u8 rsvd0;
  127. u16 tag;
  128. u32 event_tag;
  129. u32 rsvd1;
  130. struct be_async_event_trailer trailer;
  131. } __packed;
  132. struct be_mcc_mailbox {
  133. struct be_mcc_wrb wrb;
  134. struct be_mcc_compl compl;
  135. };
  136. #define CMD_SUBSYSTEM_COMMON 0x1
  137. #define CMD_SUBSYSTEM_ETH 0x3
  138. #define CMD_SUBSYSTEM_LOWLEVEL 0xb
  139. #define OPCODE_COMMON_NTWK_MAC_QUERY 1
  140. #define OPCODE_COMMON_NTWK_MAC_SET 2
  141. #define OPCODE_COMMON_NTWK_MULTICAST_SET 3
  142. #define OPCODE_COMMON_NTWK_VLAN_CONFIG 4
  143. #define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
  144. #define OPCODE_COMMON_READ_FLASHROM 6
  145. #define OPCODE_COMMON_WRITE_FLASHROM 7
  146. #define OPCODE_COMMON_CQ_CREATE 12
  147. #define OPCODE_COMMON_EQ_CREATE 13
  148. #define OPCODE_COMMON_MCC_CREATE 21
  149. #define OPCODE_COMMON_SET_QOS 28
  150. #define OPCODE_COMMON_MCC_CREATE_EXT 90
  151. #define OPCODE_COMMON_SEEPROM_READ 30
  152. #define OPCODE_COMMON_GET_CNTL_ATTRIBUTES 32
  153. #define OPCODE_COMMON_NTWK_RX_FILTER 34
  154. #define OPCODE_COMMON_GET_FW_VERSION 35
  155. #define OPCODE_COMMON_SET_FLOW_CONTROL 36
  156. #define OPCODE_COMMON_GET_FLOW_CONTROL 37
  157. #define OPCODE_COMMON_SET_FRAME_SIZE 39
  158. #define OPCODE_COMMON_MODIFY_EQ_DELAY 41
  159. #define OPCODE_COMMON_FIRMWARE_CONFIG 42
  160. #define OPCODE_COMMON_NTWK_INTERFACE_CREATE 50
  161. #define OPCODE_COMMON_NTWK_INTERFACE_DESTROY 51
  162. #define OPCODE_COMMON_MCC_DESTROY 53
  163. #define OPCODE_COMMON_CQ_DESTROY 54
  164. #define OPCODE_COMMON_EQ_DESTROY 55
  165. #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
  166. #define OPCODE_COMMON_NTWK_PMAC_ADD 59
  167. #define OPCODE_COMMON_NTWK_PMAC_DEL 60
  168. #define OPCODE_COMMON_FUNCTION_RESET 61
  169. #define OPCODE_COMMON_MANAGE_FAT 68
  170. #define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69
  171. #define OPCODE_COMMON_GET_BEACON_STATE 70
  172. #define OPCODE_COMMON_READ_TRANSRECV_DATA 73
  173. #define OPCODE_COMMON_GET_PHY_DETAILS 102
  174. #define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
  175. #define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
  176. #define OPCODE_COMMON_GET_EXT_FAT_CAPABILITES 125
  177. #define OPCODE_COMMON_SET_EXT_FAT_CAPABILITES 126
  178. #define OPCODE_COMMON_GET_MAC_LIST 147
  179. #define OPCODE_COMMON_SET_MAC_LIST 148
  180. #define OPCODE_COMMON_GET_HSW_CONFIG 152
  181. #define OPCODE_COMMON_SET_HSW_CONFIG 153
  182. #define OPCODE_COMMON_READ_OBJECT 171
  183. #define OPCODE_COMMON_WRITE_OBJECT 172
  184. #define OPCODE_ETH_RSS_CONFIG 1
  185. #define OPCODE_ETH_ACPI_CONFIG 2
  186. #define OPCODE_ETH_PROMISCUOUS 3
  187. #define OPCODE_ETH_GET_STATISTICS 4
  188. #define OPCODE_ETH_TX_CREATE 7
  189. #define OPCODE_ETH_RX_CREATE 8
  190. #define OPCODE_ETH_TX_DESTROY 9
  191. #define OPCODE_ETH_RX_DESTROY 10
  192. #define OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG 12
  193. #define OPCODE_ETH_GET_PPORT_STATS 18
  194. #define OPCODE_LOWLEVEL_HOST_DDR_DMA 17
  195. #define OPCODE_LOWLEVEL_LOOPBACK_TEST 18
  196. #define OPCODE_LOWLEVEL_SET_LOOPBACK_MODE 19
  197. struct be_cmd_req_hdr {
  198. u8 opcode; /* dword 0 */
  199. u8 subsystem; /* dword 0 */
  200. u8 port_number; /* dword 0 */
  201. u8 domain; /* dword 0 */
  202. u32 timeout; /* dword 1 */
  203. u32 request_length; /* dword 2 */
  204. u8 version; /* dword 3 */
  205. u8 rsvd[3]; /* dword 3 */
  206. };
  207. #define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
  208. #define RESP_HDR_INFO_SUBSYS_SHIFT 8 /* bits 8 - 15 */
  209. struct be_cmd_resp_hdr {
  210. u8 opcode; /* dword 0 */
  211. u8 subsystem; /* dword 0 */
  212. u8 rsvd[2]; /* dword 0 */
  213. u8 status; /* dword 1 */
  214. u8 add_status; /* dword 1 */
  215. u8 rsvd1[2]; /* dword 1 */
  216. u32 response_length; /* dword 2 */
  217. u32 actual_resp_len; /* dword 3 */
  218. };
  219. struct phys_addr {
  220. u32 lo;
  221. u32 hi;
  222. };
  223. /**************************
  224. * BE Command definitions *
  225. **************************/
  226. /* Pseudo amap definition in which each bit of the actual structure is defined
  227. * as a byte: used to calculate offset/shift/mask of each field */
  228. struct amap_eq_context {
  229. u8 cidx[13]; /* dword 0*/
  230. u8 rsvd0[3]; /* dword 0*/
  231. u8 epidx[13]; /* dword 0*/
  232. u8 valid; /* dword 0*/
  233. u8 rsvd1; /* dword 0*/
  234. u8 size; /* dword 0*/
  235. u8 pidx[13]; /* dword 1*/
  236. u8 rsvd2[3]; /* dword 1*/
  237. u8 pd[10]; /* dword 1*/
  238. u8 count[3]; /* dword 1*/
  239. u8 solevent; /* dword 1*/
  240. u8 stalled; /* dword 1*/
  241. u8 armed; /* dword 1*/
  242. u8 rsvd3[4]; /* dword 2*/
  243. u8 func[8]; /* dword 2*/
  244. u8 rsvd4; /* dword 2*/
  245. u8 delaymult[10]; /* dword 2*/
  246. u8 rsvd5[2]; /* dword 2*/
  247. u8 phase[2]; /* dword 2*/
  248. u8 nodelay; /* dword 2*/
  249. u8 rsvd6[4]; /* dword 2*/
  250. u8 rsvd7[32]; /* dword 3*/
  251. } __packed;
  252. struct be_cmd_req_eq_create {
  253. struct be_cmd_req_hdr hdr;
  254. u16 num_pages; /* sword */
  255. u16 rsvd0; /* sword */
  256. u8 context[sizeof(struct amap_eq_context) / 8];
  257. struct phys_addr pages[8];
  258. } __packed;
  259. struct be_cmd_resp_eq_create {
  260. struct be_cmd_resp_hdr resp_hdr;
  261. u16 eq_id; /* sword */
  262. u16 rsvd0; /* sword */
  263. } __packed;
  264. /******************** Mac query ***************************/
  265. enum {
  266. MAC_ADDRESS_TYPE_STORAGE = 0x0,
  267. MAC_ADDRESS_TYPE_NETWORK = 0x1,
  268. MAC_ADDRESS_TYPE_PD = 0x2,
  269. MAC_ADDRESS_TYPE_MANAGEMENT = 0x3
  270. };
  271. struct mac_addr {
  272. u16 size_of_struct;
  273. u8 addr[ETH_ALEN];
  274. } __packed;
  275. struct be_cmd_req_mac_query {
  276. struct be_cmd_req_hdr hdr;
  277. u8 type;
  278. u8 permanent;
  279. u16 if_id;
  280. u32 pmac_id;
  281. } __packed;
  282. struct be_cmd_resp_mac_query {
  283. struct be_cmd_resp_hdr hdr;
  284. struct mac_addr mac;
  285. };
  286. /******************** PMac Add ***************************/
  287. struct be_cmd_req_pmac_add {
  288. struct be_cmd_req_hdr hdr;
  289. u32 if_id;
  290. u8 mac_address[ETH_ALEN];
  291. u8 rsvd0[2];
  292. } __packed;
  293. struct be_cmd_resp_pmac_add {
  294. struct be_cmd_resp_hdr hdr;
  295. u32 pmac_id;
  296. };
  297. /******************** PMac Del ***************************/
  298. struct be_cmd_req_pmac_del {
  299. struct be_cmd_req_hdr hdr;
  300. u32 if_id;
  301. u32 pmac_id;
  302. };
  303. /******************** Create CQ ***************************/
  304. /* Pseudo amap definition in which each bit of the actual structure is defined
  305. * as a byte: used to calculate offset/shift/mask of each field */
  306. struct amap_cq_context_be {
  307. u8 cidx[11]; /* dword 0*/
  308. u8 rsvd0; /* dword 0*/
  309. u8 coalescwm[2]; /* dword 0*/
  310. u8 nodelay; /* dword 0*/
  311. u8 epidx[11]; /* dword 0*/
  312. u8 rsvd1; /* dword 0*/
  313. u8 count[2]; /* dword 0*/
  314. u8 valid; /* dword 0*/
  315. u8 solevent; /* dword 0*/
  316. u8 eventable; /* dword 0*/
  317. u8 pidx[11]; /* dword 1*/
  318. u8 rsvd2; /* dword 1*/
  319. u8 pd[10]; /* dword 1*/
  320. u8 eqid[8]; /* dword 1*/
  321. u8 stalled; /* dword 1*/
  322. u8 armed; /* dword 1*/
  323. u8 rsvd3[4]; /* dword 2*/
  324. u8 func[8]; /* dword 2*/
  325. u8 rsvd4[20]; /* dword 2*/
  326. u8 rsvd5[32]; /* dword 3*/
  327. } __packed;
  328. struct amap_cq_context_lancer {
  329. u8 rsvd0[12]; /* dword 0*/
  330. u8 coalescwm[2]; /* dword 0*/
  331. u8 nodelay; /* dword 0*/
  332. u8 rsvd1[12]; /* dword 0*/
  333. u8 count[2]; /* dword 0*/
  334. u8 valid; /* dword 0*/
  335. u8 rsvd2; /* dword 0*/
  336. u8 eventable; /* dword 0*/
  337. u8 eqid[16]; /* dword 1*/
  338. u8 rsvd3[15]; /* dword 1*/
  339. u8 armed; /* dword 1*/
  340. u8 rsvd4[32]; /* dword 2*/
  341. u8 rsvd5[32]; /* dword 3*/
  342. } __packed;
  343. struct be_cmd_req_cq_create {
  344. struct be_cmd_req_hdr hdr;
  345. u16 num_pages;
  346. u8 page_size;
  347. u8 rsvd0;
  348. u8 context[sizeof(struct amap_cq_context_be) / 8];
  349. struct phys_addr pages[8];
  350. } __packed;
  351. struct be_cmd_resp_cq_create {
  352. struct be_cmd_resp_hdr hdr;
  353. u16 cq_id;
  354. u16 rsvd0;
  355. } __packed;
  356. struct be_cmd_req_get_fat {
  357. struct be_cmd_req_hdr hdr;
  358. u32 fat_operation;
  359. u32 read_log_offset;
  360. u32 read_log_length;
  361. u32 data_buffer_size;
  362. u32 data_buffer[1];
  363. } __packed;
  364. struct be_cmd_resp_get_fat {
  365. struct be_cmd_resp_hdr hdr;
  366. u32 log_size;
  367. u32 read_log_length;
  368. u32 rsvd[2];
  369. u32 data_buffer[1];
  370. } __packed;
  371. /******************** Create MCCQ ***************************/
  372. /* Pseudo amap definition in which each bit of the actual structure is defined
  373. * as a byte: used to calculate offset/shift/mask of each field */
  374. struct amap_mcc_context_be {
  375. u8 con_index[14];
  376. u8 rsvd0[2];
  377. u8 ring_size[4];
  378. u8 fetch_wrb;
  379. u8 fetch_r2t;
  380. u8 cq_id[10];
  381. u8 prod_index[14];
  382. u8 fid[8];
  383. u8 pdid[9];
  384. u8 valid;
  385. u8 rsvd1[32];
  386. u8 rsvd2[32];
  387. } __packed;
  388. struct amap_mcc_context_lancer {
  389. u8 async_cq_id[16];
  390. u8 ring_size[4];
  391. u8 rsvd0[12];
  392. u8 rsvd1[31];
  393. u8 valid;
  394. u8 async_cq_valid[1];
  395. u8 rsvd2[31];
  396. u8 rsvd3[32];
  397. } __packed;
  398. struct be_cmd_req_mcc_create {
  399. struct be_cmd_req_hdr hdr;
  400. u16 num_pages;
  401. u16 cq_id;
  402. u8 context[sizeof(struct amap_mcc_context_be) / 8];
  403. struct phys_addr pages[8];
  404. } __packed;
  405. struct be_cmd_req_mcc_ext_create {
  406. struct be_cmd_req_hdr hdr;
  407. u16 num_pages;
  408. u16 cq_id;
  409. u32 async_event_bitmap[1];
  410. u8 context[sizeof(struct amap_mcc_context_be) / 8];
  411. struct phys_addr pages[8];
  412. } __packed;
  413. struct be_cmd_resp_mcc_create {
  414. struct be_cmd_resp_hdr hdr;
  415. u16 id;
  416. u16 rsvd0;
  417. } __packed;
  418. /******************** Create TxQ ***************************/
  419. #define BE_ETH_TX_RING_TYPE_STANDARD 2
  420. #define BE_ULP1_NUM 1
  421. /* Pseudo amap definition in which each bit of the actual structure is defined
  422. * as a byte: used to calculate offset/shift/mask of each field */
  423. struct amap_tx_context {
  424. u8 if_id[16]; /* dword 0 */
  425. u8 tx_ring_size[4]; /* dword 0 */
  426. u8 rsvd1[26]; /* dword 0 */
  427. u8 pci_func_id[8]; /* dword 1 */
  428. u8 rsvd2[9]; /* dword 1 */
  429. u8 ctx_valid; /* dword 1 */
  430. u8 cq_id_send[16]; /* dword 2 */
  431. u8 rsvd3[16]; /* dword 2 */
  432. u8 rsvd4[32]; /* dword 3 */
  433. u8 rsvd5[32]; /* dword 4 */
  434. u8 rsvd6[32]; /* dword 5 */
  435. u8 rsvd7[32]; /* dword 6 */
  436. u8 rsvd8[32]; /* dword 7 */
  437. u8 rsvd9[32]; /* dword 8 */
  438. u8 rsvd10[32]; /* dword 9 */
  439. u8 rsvd11[32]; /* dword 10 */
  440. u8 rsvd12[32]; /* dword 11 */
  441. u8 rsvd13[32]; /* dword 12 */
  442. u8 rsvd14[32]; /* dword 13 */
  443. u8 rsvd15[32]; /* dword 14 */
  444. u8 rsvd16[32]; /* dword 15 */
  445. } __packed;
  446. struct be_cmd_req_eth_tx_create {
  447. struct be_cmd_req_hdr hdr;
  448. u8 num_pages;
  449. u8 ulp_num;
  450. u8 type;
  451. u8 bound_port;
  452. u8 context[sizeof(struct amap_tx_context) / 8];
  453. struct phys_addr pages[8];
  454. } __packed;
  455. struct be_cmd_resp_eth_tx_create {
  456. struct be_cmd_resp_hdr hdr;
  457. u16 cid;
  458. u16 rsvd0;
  459. } __packed;
  460. /******************** Create RxQ ***************************/
  461. struct be_cmd_req_eth_rx_create {
  462. struct be_cmd_req_hdr hdr;
  463. u16 cq_id;
  464. u8 frag_size;
  465. u8 num_pages;
  466. struct phys_addr pages[2];
  467. u32 interface_id;
  468. u16 max_frame_size;
  469. u16 rsvd0;
  470. u32 rss_queue;
  471. } __packed;
  472. struct be_cmd_resp_eth_rx_create {
  473. struct be_cmd_resp_hdr hdr;
  474. u16 id;
  475. u8 rss_id;
  476. u8 rsvd0;
  477. } __packed;
  478. /******************** Q Destroy ***************************/
  479. /* Type of Queue to be destroyed */
  480. enum {
  481. QTYPE_EQ = 1,
  482. QTYPE_CQ,
  483. QTYPE_TXQ,
  484. QTYPE_RXQ,
  485. QTYPE_MCCQ
  486. };
  487. struct be_cmd_req_q_destroy {
  488. struct be_cmd_req_hdr hdr;
  489. u16 id;
  490. u16 bypass_flush; /* valid only for rx q destroy */
  491. } __packed;
  492. /************ I/f Create (it's actually I/f Config Create)**********/
  493. /* Capability flags for the i/f */
  494. enum be_if_flags {
  495. BE_IF_FLAGS_RSS = 0x4,
  496. BE_IF_FLAGS_PROMISCUOUS = 0x8,
  497. BE_IF_FLAGS_BROADCAST = 0x10,
  498. BE_IF_FLAGS_UNTAGGED = 0x20,
  499. BE_IF_FLAGS_ULP = 0x40,
  500. BE_IF_FLAGS_VLAN_PROMISCUOUS = 0x80,
  501. BE_IF_FLAGS_VLAN = 0x100,
  502. BE_IF_FLAGS_MCAST_PROMISCUOUS = 0x200,
  503. BE_IF_FLAGS_PASS_L2_ERRORS = 0x400,
  504. BE_IF_FLAGS_PASS_L3L4_ERRORS = 0x800,
  505. BE_IF_FLAGS_MULTICAST = 0x1000
  506. };
  507. /* An RX interface is an object with one or more MAC addresses and
  508. * filtering capabilities. */
  509. struct be_cmd_req_if_create {
  510. struct be_cmd_req_hdr hdr;
  511. u32 version; /* ignore currently */
  512. u32 capability_flags;
  513. u32 enable_flags;
  514. u8 mac_addr[ETH_ALEN];
  515. u8 rsvd0;
  516. u8 pmac_invalid; /* if set, don't attach the mac addr to the i/f */
  517. u32 vlan_tag; /* not used currently */
  518. } __packed;
  519. struct be_cmd_resp_if_create {
  520. struct be_cmd_resp_hdr hdr;
  521. u32 interface_id;
  522. u32 pmac_id;
  523. };
  524. /****** I/f Destroy(it's actually I/f Config Destroy )**********/
  525. struct be_cmd_req_if_destroy {
  526. struct be_cmd_req_hdr hdr;
  527. u32 interface_id;
  528. };
  529. /*************** HW Stats Get **********************************/
  530. struct be_port_rxf_stats_v0 {
  531. u32 rx_bytes_lsd; /* dword 0*/
  532. u32 rx_bytes_msd; /* dword 1*/
  533. u32 rx_total_frames; /* dword 2*/
  534. u32 rx_unicast_frames; /* dword 3*/
  535. u32 rx_multicast_frames; /* dword 4*/
  536. u32 rx_broadcast_frames; /* dword 5*/
  537. u32 rx_crc_errors; /* dword 6*/
  538. u32 rx_alignment_symbol_errors; /* dword 7*/
  539. u32 rx_pause_frames; /* dword 8*/
  540. u32 rx_control_frames; /* dword 9*/
  541. u32 rx_in_range_errors; /* dword 10*/
  542. u32 rx_out_range_errors; /* dword 11*/
  543. u32 rx_frame_too_long; /* dword 12*/
  544. u32 rx_address_mismatch_drops; /* dword 13*/
  545. u32 rx_vlan_mismatch_drops; /* dword 14*/
  546. u32 rx_dropped_too_small; /* dword 15*/
  547. u32 rx_dropped_too_short; /* dword 16*/
  548. u32 rx_dropped_header_too_small; /* dword 17*/
  549. u32 rx_dropped_tcp_length; /* dword 18*/
  550. u32 rx_dropped_runt; /* dword 19*/
  551. u32 rx_64_byte_packets; /* dword 20*/
  552. u32 rx_65_127_byte_packets; /* dword 21*/
  553. u32 rx_128_256_byte_packets; /* dword 22*/
  554. u32 rx_256_511_byte_packets; /* dword 23*/
  555. u32 rx_512_1023_byte_packets; /* dword 24*/
  556. u32 rx_1024_1518_byte_packets; /* dword 25*/
  557. u32 rx_1519_2047_byte_packets; /* dword 26*/
  558. u32 rx_2048_4095_byte_packets; /* dword 27*/
  559. u32 rx_4096_8191_byte_packets; /* dword 28*/
  560. u32 rx_8192_9216_byte_packets; /* dword 29*/
  561. u32 rx_ip_checksum_errs; /* dword 30*/
  562. u32 rx_tcp_checksum_errs; /* dword 31*/
  563. u32 rx_udp_checksum_errs; /* dword 32*/
  564. u32 rx_non_rss_packets; /* dword 33*/
  565. u32 rx_ipv4_packets; /* dword 34*/
  566. u32 rx_ipv6_packets; /* dword 35*/
  567. u32 rx_ipv4_bytes_lsd; /* dword 36*/
  568. u32 rx_ipv4_bytes_msd; /* dword 37*/
  569. u32 rx_ipv6_bytes_lsd; /* dword 38*/
  570. u32 rx_ipv6_bytes_msd; /* dword 39*/
  571. u32 rx_chute1_packets; /* dword 40*/
  572. u32 rx_chute2_packets; /* dword 41*/
  573. u32 rx_chute3_packets; /* dword 42*/
  574. u32 rx_management_packets; /* dword 43*/
  575. u32 rx_switched_unicast_packets; /* dword 44*/
  576. u32 rx_switched_multicast_packets; /* dword 45*/
  577. u32 rx_switched_broadcast_packets; /* dword 46*/
  578. u32 tx_bytes_lsd; /* dword 47*/
  579. u32 tx_bytes_msd; /* dword 48*/
  580. u32 tx_unicastframes; /* dword 49*/
  581. u32 tx_multicastframes; /* dword 50*/
  582. u32 tx_broadcastframes; /* dword 51*/
  583. u32 tx_pauseframes; /* dword 52*/
  584. u32 tx_controlframes; /* dword 53*/
  585. u32 tx_64_byte_packets; /* dword 54*/
  586. u32 tx_65_127_byte_packets; /* dword 55*/
  587. u32 tx_128_256_byte_packets; /* dword 56*/
  588. u32 tx_256_511_byte_packets; /* dword 57*/
  589. u32 tx_512_1023_byte_packets; /* dword 58*/
  590. u32 tx_1024_1518_byte_packets; /* dword 59*/
  591. u32 tx_1519_2047_byte_packets; /* dword 60*/
  592. u32 tx_2048_4095_byte_packets; /* dword 61*/
  593. u32 tx_4096_8191_byte_packets; /* dword 62*/
  594. u32 tx_8192_9216_byte_packets; /* dword 63*/
  595. u32 rx_fifo_overflow; /* dword 64*/
  596. u32 rx_input_fifo_overflow; /* dword 65*/
  597. };
  598. struct be_rxf_stats_v0 {
  599. struct be_port_rxf_stats_v0 port[2];
  600. u32 rx_drops_no_pbuf; /* dword 132*/
  601. u32 rx_drops_no_txpb; /* dword 133*/
  602. u32 rx_drops_no_erx_descr; /* dword 134*/
  603. u32 rx_drops_no_tpre_descr; /* dword 135*/
  604. u32 management_rx_port_packets; /* dword 136*/
  605. u32 management_rx_port_bytes; /* dword 137*/
  606. u32 management_rx_port_pause_frames; /* dword 138*/
  607. u32 management_rx_port_errors; /* dword 139*/
  608. u32 management_tx_port_packets; /* dword 140*/
  609. u32 management_tx_port_bytes; /* dword 141*/
  610. u32 management_tx_port_pause; /* dword 142*/
  611. u32 management_rx_port_rxfifo_overflow; /* dword 143*/
  612. u32 rx_drops_too_many_frags; /* dword 144*/
  613. u32 rx_drops_invalid_ring; /* dword 145*/
  614. u32 forwarded_packets; /* dword 146*/
  615. u32 rx_drops_mtu; /* dword 147*/
  616. u32 rsvd0[7];
  617. u32 port0_jabber_events;
  618. u32 port1_jabber_events;
  619. u32 rsvd1[6];
  620. };
  621. struct be_erx_stats_v0 {
  622. u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/
  623. u32 rsvd[4];
  624. };
  625. struct be_pmem_stats {
  626. u32 eth_red_drops;
  627. u32 rsvd[5];
  628. };
  629. struct be_hw_stats_v0 {
  630. struct be_rxf_stats_v0 rxf;
  631. u32 rsvd[48];
  632. struct be_erx_stats_v0 erx;
  633. struct be_pmem_stats pmem;
  634. };
  635. struct be_cmd_req_get_stats_v0 {
  636. struct be_cmd_req_hdr hdr;
  637. u8 rsvd[sizeof(struct be_hw_stats_v0)];
  638. };
  639. struct be_cmd_resp_get_stats_v0 {
  640. struct be_cmd_resp_hdr hdr;
  641. struct be_hw_stats_v0 hw_stats;
  642. };
  643. struct lancer_pport_stats {
  644. u32 tx_packets_lo;
  645. u32 tx_packets_hi;
  646. u32 tx_unicast_packets_lo;
  647. u32 tx_unicast_packets_hi;
  648. u32 tx_multicast_packets_lo;
  649. u32 tx_multicast_packets_hi;
  650. u32 tx_broadcast_packets_lo;
  651. u32 tx_broadcast_packets_hi;
  652. u32 tx_bytes_lo;
  653. u32 tx_bytes_hi;
  654. u32 tx_unicast_bytes_lo;
  655. u32 tx_unicast_bytes_hi;
  656. u32 tx_multicast_bytes_lo;
  657. u32 tx_multicast_bytes_hi;
  658. u32 tx_broadcast_bytes_lo;
  659. u32 tx_broadcast_bytes_hi;
  660. u32 tx_discards_lo;
  661. u32 tx_discards_hi;
  662. u32 tx_errors_lo;
  663. u32 tx_errors_hi;
  664. u32 tx_pause_frames_lo;
  665. u32 tx_pause_frames_hi;
  666. u32 tx_pause_on_frames_lo;
  667. u32 tx_pause_on_frames_hi;
  668. u32 tx_pause_off_frames_lo;
  669. u32 tx_pause_off_frames_hi;
  670. u32 tx_internal_mac_errors_lo;
  671. u32 tx_internal_mac_errors_hi;
  672. u32 tx_control_frames_lo;
  673. u32 tx_control_frames_hi;
  674. u32 tx_packets_64_bytes_lo;
  675. u32 tx_packets_64_bytes_hi;
  676. u32 tx_packets_65_to_127_bytes_lo;
  677. u32 tx_packets_65_to_127_bytes_hi;
  678. u32 tx_packets_128_to_255_bytes_lo;
  679. u32 tx_packets_128_to_255_bytes_hi;
  680. u32 tx_packets_256_to_511_bytes_lo;
  681. u32 tx_packets_256_to_511_bytes_hi;
  682. u32 tx_packets_512_to_1023_bytes_lo;
  683. u32 tx_packets_512_to_1023_bytes_hi;
  684. u32 tx_packets_1024_to_1518_bytes_lo;
  685. u32 tx_packets_1024_to_1518_bytes_hi;
  686. u32 tx_packets_1519_to_2047_bytes_lo;
  687. u32 tx_packets_1519_to_2047_bytes_hi;
  688. u32 tx_packets_2048_to_4095_bytes_lo;
  689. u32 tx_packets_2048_to_4095_bytes_hi;
  690. u32 tx_packets_4096_to_8191_bytes_lo;
  691. u32 tx_packets_4096_to_8191_bytes_hi;
  692. u32 tx_packets_8192_to_9216_bytes_lo;
  693. u32 tx_packets_8192_to_9216_bytes_hi;
  694. u32 tx_lso_packets_lo;
  695. u32 tx_lso_packets_hi;
  696. u32 rx_packets_lo;
  697. u32 rx_packets_hi;
  698. u32 rx_unicast_packets_lo;
  699. u32 rx_unicast_packets_hi;
  700. u32 rx_multicast_packets_lo;
  701. u32 rx_multicast_packets_hi;
  702. u32 rx_broadcast_packets_lo;
  703. u32 rx_broadcast_packets_hi;
  704. u32 rx_bytes_lo;
  705. u32 rx_bytes_hi;
  706. u32 rx_unicast_bytes_lo;
  707. u32 rx_unicast_bytes_hi;
  708. u32 rx_multicast_bytes_lo;
  709. u32 rx_multicast_bytes_hi;
  710. u32 rx_broadcast_bytes_lo;
  711. u32 rx_broadcast_bytes_hi;
  712. u32 rx_unknown_protos;
  713. u32 rsvd_69; /* Word 69 is reserved */
  714. u32 rx_discards_lo;
  715. u32 rx_discards_hi;
  716. u32 rx_errors_lo;
  717. u32 rx_errors_hi;
  718. u32 rx_crc_errors_lo;
  719. u32 rx_crc_errors_hi;
  720. u32 rx_alignment_errors_lo;
  721. u32 rx_alignment_errors_hi;
  722. u32 rx_symbol_errors_lo;
  723. u32 rx_symbol_errors_hi;
  724. u32 rx_pause_frames_lo;
  725. u32 rx_pause_frames_hi;
  726. u32 rx_pause_on_frames_lo;
  727. u32 rx_pause_on_frames_hi;
  728. u32 rx_pause_off_frames_lo;
  729. u32 rx_pause_off_frames_hi;
  730. u32 rx_frames_too_long_lo;
  731. u32 rx_frames_too_long_hi;
  732. u32 rx_internal_mac_errors_lo;
  733. u32 rx_internal_mac_errors_hi;
  734. u32 rx_undersize_packets;
  735. u32 rx_oversize_packets;
  736. u32 rx_fragment_packets;
  737. u32 rx_jabbers;
  738. u32 rx_control_frames_lo;
  739. u32 rx_control_frames_hi;
  740. u32 rx_control_frames_unknown_opcode_lo;
  741. u32 rx_control_frames_unknown_opcode_hi;
  742. u32 rx_in_range_errors;
  743. u32 rx_out_of_range_errors;
  744. u32 rx_address_mismatch_drops;
  745. u32 rx_vlan_mismatch_drops;
  746. u32 rx_dropped_too_small;
  747. u32 rx_dropped_too_short;
  748. u32 rx_dropped_header_too_small;
  749. u32 rx_dropped_invalid_tcp_length;
  750. u32 rx_dropped_runt;
  751. u32 rx_ip_checksum_errors;
  752. u32 rx_tcp_checksum_errors;
  753. u32 rx_udp_checksum_errors;
  754. u32 rx_non_rss_packets;
  755. u32 rsvd_111;
  756. u32 rx_ipv4_packets_lo;
  757. u32 rx_ipv4_packets_hi;
  758. u32 rx_ipv6_packets_lo;
  759. u32 rx_ipv6_packets_hi;
  760. u32 rx_ipv4_bytes_lo;
  761. u32 rx_ipv4_bytes_hi;
  762. u32 rx_ipv6_bytes_lo;
  763. u32 rx_ipv6_bytes_hi;
  764. u32 rx_nic_packets_lo;
  765. u32 rx_nic_packets_hi;
  766. u32 rx_tcp_packets_lo;
  767. u32 rx_tcp_packets_hi;
  768. u32 rx_iscsi_packets_lo;
  769. u32 rx_iscsi_packets_hi;
  770. u32 rx_management_packets_lo;
  771. u32 rx_management_packets_hi;
  772. u32 rx_switched_unicast_packets_lo;
  773. u32 rx_switched_unicast_packets_hi;
  774. u32 rx_switched_multicast_packets_lo;
  775. u32 rx_switched_multicast_packets_hi;
  776. u32 rx_switched_broadcast_packets_lo;
  777. u32 rx_switched_broadcast_packets_hi;
  778. u32 num_forwards_lo;
  779. u32 num_forwards_hi;
  780. u32 rx_fifo_overflow;
  781. u32 rx_input_fifo_overflow;
  782. u32 rx_drops_too_many_frags_lo;
  783. u32 rx_drops_too_many_frags_hi;
  784. u32 rx_drops_invalid_queue;
  785. u32 rsvd_141;
  786. u32 rx_drops_mtu_lo;
  787. u32 rx_drops_mtu_hi;
  788. u32 rx_packets_64_bytes_lo;
  789. u32 rx_packets_64_bytes_hi;
  790. u32 rx_packets_65_to_127_bytes_lo;
  791. u32 rx_packets_65_to_127_bytes_hi;
  792. u32 rx_packets_128_to_255_bytes_lo;
  793. u32 rx_packets_128_to_255_bytes_hi;
  794. u32 rx_packets_256_to_511_bytes_lo;
  795. u32 rx_packets_256_to_511_bytes_hi;
  796. u32 rx_packets_512_to_1023_bytes_lo;
  797. u32 rx_packets_512_to_1023_bytes_hi;
  798. u32 rx_packets_1024_to_1518_bytes_lo;
  799. u32 rx_packets_1024_to_1518_bytes_hi;
  800. u32 rx_packets_1519_to_2047_bytes_lo;
  801. u32 rx_packets_1519_to_2047_bytes_hi;
  802. u32 rx_packets_2048_to_4095_bytes_lo;
  803. u32 rx_packets_2048_to_4095_bytes_hi;
  804. u32 rx_packets_4096_to_8191_bytes_lo;
  805. u32 rx_packets_4096_to_8191_bytes_hi;
  806. u32 rx_packets_8192_to_9216_bytes_lo;
  807. u32 rx_packets_8192_to_9216_bytes_hi;
  808. };
  809. struct pport_stats_params {
  810. u16 pport_num;
  811. u8 rsvd;
  812. u8 reset_stats;
  813. };
  814. struct lancer_cmd_req_pport_stats {
  815. struct be_cmd_req_hdr hdr;
  816. union {
  817. struct pport_stats_params params;
  818. u8 rsvd[sizeof(struct lancer_pport_stats)];
  819. } cmd_params;
  820. };
  821. struct lancer_cmd_resp_pport_stats {
  822. struct be_cmd_resp_hdr hdr;
  823. struct lancer_pport_stats pport_stats;
  824. };
  825. static inline struct lancer_pport_stats*
  826. pport_stats_from_cmd(struct be_adapter *adapter)
  827. {
  828. struct lancer_cmd_resp_pport_stats *cmd = adapter->stats_cmd.va;
  829. return &cmd->pport_stats;
  830. }
  831. struct be_cmd_req_get_cntl_addnl_attribs {
  832. struct be_cmd_req_hdr hdr;
  833. u8 rsvd[8];
  834. };
  835. struct be_cmd_resp_get_cntl_addnl_attribs {
  836. struct be_cmd_resp_hdr hdr;
  837. u16 ipl_file_number;
  838. u8 ipl_file_version;
  839. u8 rsvd0;
  840. u8 on_die_temperature; /* in degrees centigrade*/
  841. u8 rsvd1[3];
  842. };
  843. struct be_cmd_req_vlan_config {
  844. struct be_cmd_req_hdr hdr;
  845. u8 interface_id;
  846. u8 promiscuous;
  847. u8 untagged;
  848. u8 num_vlan;
  849. u16 normal_vlan[64];
  850. } __packed;
  851. /******************* RX FILTER ******************************/
  852. #define BE_MAX_MC 64 /* set mcast promisc if > 64 */
  853. struct macaddr {
  854. u8 byte[ETH_ALEN];
  855. };
  856. struct be_cmd_req_rx_filter {
  857. struct be_cmd_req_hdr hdr;
  858. u32 global_flags_mask;
  859. u32 global_flags;
  860. u32 if_flags_mask;
  861. u32 if_flags;
  862. u32 if_id;
  863. u32 mcast_num;
  864. struct macaddr mcast_mac[BE_MAX_MC];
  865. };
  866. /******************** Link Status Query *******************/
  867. struct be_cmd_req_link_status {
  868. struct be_cmd_req_hdr hdr;
  869. u32 rsvd;
  870. };
  871. enum {
  872. PHY_LINK_DUPLEX_NONE = 0x0,
  873. PHY_LINK_DUPLEX_HALF = 0x1,
  874. PHY_LINK_DUPLEX_FULL = 0x2
  875. };
  876. enum {
  877. PHY_LINK_SPEED_ZERO = 0x0, /* => No link */
  878. PHY_LINK_SPEED_10MBPS = 0x1,
  879. PHY_LINK_SPEED_100MBPS = 0x2,
  880. PHY_LINK_SPEED_1GBPS = 0x3,
  881. PHY_LINK_SPEED_10GBPS = 0x4
  882. };
  883. struct be_cmd_resp_link_status {
  884. struct be_cmd_resp_hdr hdr;
  885. u8 physical_port;
  886. u8 mac_duplex;
  887. u8 mac_speed;
  888. u8 mac_fault;
  889. u8 mgmt_mac_duplex;
  890. u8 mgmt_mac_speed;
  891. u16 link_speed;
  892. u8 logical_link_status;
  893. u8 rsvd1[3];
  894. } __packed;
  895. /******************** Port Identification ***************************/
  896. /* Identifies the type of port attached to NIC */
  897. struct be_cmd_req_port_type {
  898. struct be_cmd_req_hdr hdr;
  899. u32 page_num;
  900. u32 port;
  901. };
  902. enum {
  903. TR_PAGE_A0 = 0xa0,
  904. TR_PAGE_A2 = 0xa2
  905. };
  906. struct be_cmd_resp_port_type {
  907. struct be_cmd_resp_hdr hdr;
  908. u32 page_num;
  909. u32 port;
  910. struct data {
  911. u8 identifier;
  912. u8 identifier_ext;
  913. u8 connector;
  914. u8 transceiver[8];
  915. u8 rsvd0[3];
  916. u8 length_km;
  917. u8 length_hm;
  918. u8 length_om1;
  919. u8 length_om2;
  920. u8 length_cu;
  921. u8 length_cu_m;
  922. u8 vendor_name[16];
  923. u8 rsvd;
  924. u8 vendor_oui[3];
  925. u8 vendor_pn[16];
  926. u8 vendor_rev[4];
  927. } data;
  928. };
  929. /******************** Get FW Version *******************/
  930. struct be_cmd_req_get_fw_version {
  931. struct be_cmd_req_hdr hdr;
  932. u8 rsvd0[FW_VER_LEN];
  933. u8 rsvd1[FW_VER_LEN];
  934. } __packed;
  935. struct be_cmd_resp_get_fw_version {
  936. struct be_cmd_resp_hdr hdr;
  937. u8 firmware_version_string[FW_VER_LEN];
  938. u8 fw_on_flash_version_string[FW_VER_LEN];
  939. } __packed;
  940. /******************** Set Flow Contrl *******************/
  941. struct be_cmd_req_set_flow_control {
  942. struct be_cmd_req_hdr hdr;
  943. u16 tx_flow_control;
  944. u16 rx_flow_control;
  945. } __packed;
  946. /******************** Get Flow Contrl *******************/
  947. struct be_cmd_req_get_flow_control {
  948. struct be_cmd_req_hdr hdr;
  949. u32 rsvd;
  950. };
  951. struct be_cmd_resp_get_flow_control {
  952. struct be_cmd_resp_hdr hdr;
  953. u16 tx_flow_control;
  954. u16 rx_flow_control;
  955. } __packed;
  956. /******************** Modify EQ Delay *******************/
  957. struct be_cmd_req_modify_eq_delay {
  958. struct be_cmd_req_hdr hdr;
  959. u32 num_eq;
  960. struct {
  961. u32 eq_id;
  962. u32 phase;
  963. u32 delay_multiplier;
  964. } delay[8];
  965. } __packed;
  966. struct be_cmd_resp_modify_eq_delay {
  967. struct be_cmd_resp_hdr hdr;
  968. u32 rsvd0;
  969. } __packed;
  970. /******************** Get FW Config *******************/
  971. #define BE_FUNCTION_CAPS_RSS 0x2
  972. /* The HW can come up in either of the following multi-channel modes
  973. * based on the skew/IPL.
  974. */
  975. #define RDMA_ENABLED 0x4
  976. #define FLEX10_MODE 0x400
  977. #define VNIC_MODE 0x20000
  978. #define UMC_ENABLED 0x1000000
  979. struct be_cmd_req_query_fw_cfg {
  980. struct be_cmd_req_hdr hdr;
  981. u32 rsvd[31];
  982. };
  983. struct be_cmd_resp_query_fw_cfg {
  984. struct be_cmd_resp_hdr hdr;
  985. u32 be_config_number;
  986. u32 asic_revision;
  987. u32 phys_port;
  988. u32 function_mode;
  989. u32 rsvd[26];
  990. u32 function_caps;
  991. };
  992. /******************** RSS Config *******************/
  993. /* RSS types */
  994. #define RSS_ENABLE_NONE 0x0
  995. #define RSS_ENABLE_IPV4 0x1
  996. #define RSS_ENABLE_TCP_IPV4 0x2
  997. #define RSS_ENABLE_IPV6 0x4
  998. #define RSS_ENABLE_TCP_IPV6 0x8
  999. struct be_cmd_req_rss_config {
  1000. struct be_cmd_req_hdr hdr;
  1001. u32 if_id;
  1002. u16 enable_rss;
  1003. u16 cpu_table_size_log2;
  1004. u32 hash[10];
  1005. u8 cpu_table[128];
  1006. u8 flush;
  1007. u8 rsvd0[3];
  1008. };
  1009. /******************** Port Beacon ***************************/
  1010. #define BEACON_STATE_ENABLED 0x1
  1011. #define BEACON_STATE_DISABLED 0x0
  1012. struct be_cmd_req_enable_disable_beacon {
  1013. struct be_cmd_req_hdr hdr;
  1014. u8 port_num;
  1015. u8 beacon_state;
  1016. u8 beacon_duration;
  1017. u8 status_duration;
  1018. } __packed;
  1019. struct be_cmd_resp_enable_disable_beacon {
  1020. struct be_cmd_resp_hdr resp_hdr;
  1021. u32 rsvd0;
  1022. } __packed;
  1023. struct be_cmd_req_get_beacon_state {
  1024. struct be_cmd_req_hdr hdr;
  1025. u8 port_num;
  1026. u8 rsvd0;
  1027. u16 rsvd1;
  1028. } __packed;
  1029. struct be_cmd_resp_get_beacon_state {
  1030. struct be_cmd_resp_hdr resp_hdr;
  1031. u8 beacon_state;
  1032. u8 rsvd0[3];
  1033. } __packed;
  1034. /****************** Firmware Flash ******************/
  1035. struct flashrom_params {
  1036. u32 op_code;
  1037. u32 op_type;
  1038. u32 data_buf_size;
  1039. u32 offset;
  1040. u8 data_buf[4];
  1041. };
  1042. struct be_cmd_write_flashrom {
  1043. struct be_cmd_req_hdr hdr;
  1044. struct flashrom_params params;
  1045. };
  1046. /**************** Lancer Firmware Flash ************/
  1047. struct amap_lancer_write_obj_context {
  1048. u8 write_length[24];
  1049. u8 reserved1[7];
  1050. u8 eof;
  1051. } __packed;
  1052. struct lancer_cmd_req_write_object {
  1053. struct be_cmd_req_hdr hdr;
  1054. u8 context[sizeof(struct amap_lancer_write_obj_context) / 8];
  1055. u32 write_offset;
  1056. u8 object_name[104];
  1057. u32 descriptor_count;
  1058. u32 buf_len;
  1059. u32 addr_low;
  1060. u32 addr_high;
  1061. };
  1062. struct lancer_cmd_resp_write_object {
  1063. u8 opcode;
  1064. u8 subsystem;
  1065. u8 rsvd1[2];
  1066. u8 status;
  1067. u8 additional_status;
  1068. u8 rsvd2[2];
  1069. u32 resp_len;
  1070. u32 actual_resp_len;
  1071. u32 actual_write_len;
  1072. };
  1073. /************************ Lancer Read FW info **************/
  1074. #define LANCER_READ_FILE_CHUNK (32*1024)
  1075. #define LANCER_READ_FILE_EOF_MASK 0x80000000
  1076. #define LANCER_FW_DUMP_FILE "/dbg/dump.bin"
  1077. #define LANCER_VPD_PF_FILE "/vpd/ntr_pf.vpd"
  1078. #define LANCER_VPD_VF_FILE "/vpd/ntr_vf.vpd"
  1079. struct lancer_cmd_req_read_object {
  1080. struct be_cmd_req_hdr hdr;
  1081. u32 desired_read_len;
  1082. u32 read_offset;
  1083. u8 object_name[104];
  1084. u32 descriptor_count;
  1085. u32 buf_len;
  1086. u32 addr_low;
  1087. u32 addr_high;
  1088. };
  1089. struct lancer_cmd_resp_read_object {
  1090. u8 opcode;
  1091. u8 subsystem;
  1092. u8 rsvd1[2];
  1093. u8 status;
  1094. u8 additional_status;
  1095. u8 rsvd2[2];
  1096. u32 resp_len;
  1097. u32 actual_resp_len;
  1098. u32 actual_read_len;
  1099. u32 eof;
  1100. };
  1101. /************************ WOL *******************************/
  1102. struct be_cmd_req_acpi_wol_magic_config{
  1103. struct be_cmd_req_hdr hdr;
  1104. u32 rsvd0[145];
  1105. u8 magic_mac[6];
  1106. u8 rsvd2[2];
  1107. } __packed;
  1108. struct be_cmd_req_acpi_wol_magic_config_v1 {
  1109. struct be_cmd_req_hdr hdr;
  1110. u8 rsvd0[2];
  1111. u8 query_options;
  1112. u8 rsvd1[5];
  1113. u32 rsvd2[288];
  1114. u8 magic_mac[6];
  1115. u8 rsvd3[22];
  1116. } __packed;
  1117. struct be_cmd_resp_acpi_wol_magic_config_v1 {
  1118. struct be_cmd_resp_hdr hdr;
  1119. u8 rsvd0[2];
  1120. u8 wol_settings;
  1121. u8 rsvd1[5];
  1122. u32 rsvd2[295];
  1123. } __packed;
  1124. #define BE_GET_WOL_CAP 2
  1125. #define BE_WOL_CAP 0x1
  1126. #define BE_PME_D0_CAP 0x8
  1127. #define BE_PME_D1_CAP 0x10
  1128. #define BE_PME_D2_CAP 0x20
  1129. #define BE_PME_D3HOT_CAP 0x40
  1130. #define BE_PME_D3COLD_CAP 0x80
  1131. /********************** LoopBack test *********************/
  1132. struct be_cmd_req_loopback_test {
  1133. struct be_cmd_req_hdr hdr;
  1134. u32 loopback_type;
  1135. u32 num_pkts;
  1136. u64 pattern;
  1137. u32 src_port;
  1138. u32 dest_port;
  1139. u32 pkt_size;
  1140. };
  1141. struct be_cmd_resp_loopback_test {
  1142. struct be_cmd_resp_hdr resp_hdr;
  1143. u32 status;
  1144. u32 num_txfer;
  1145. u32 num_rx;
  1146. u32 miscomp_off;
  1147. u32 ticks_compl;
  1148. };
  1149. struct be_cmd_req_set_lmode {
  1150. struct be_cmd_req_hdr hdr;
  1151. u8 src_port;
  1152. u8 dest_port;
  1153. u8 loopback_type;
  1154. u8 loopback_state;
  1155. };
  1156. struct be_cmd_resp_set_lmode {
  1157. struct be_cmd_resp_hdr resp_hdr;
  1158. u8 rsvd0[4];
  1159. };
  1160. /********************** DDR DMA test *********************/
  1161. struct be_cmd_req_ddrdma_test {
  1162. struct be_cmd_req_hdr hdr;
  1163. u64 pattern;
  1164. u32 byte_count;
  1165. u32 rsvd0;
  1166. u8 snd_buff[4096];
  1167. u8 rsvd1[4096];
  1168. };
  1169. struct be_cmd_resp_ddrdma_test {
  1170. struct be_cmd_resp_hdr hdr;
  1171. u64 pattern;
  1172. u32 byte_cnt;
  1173. u32 snd_err;
  1174. u8 rsvd0[4096];
  1175. u8 rcv_buff[4096];
  1176. };
  1177. /*********************** SEEPROM Read ***********************/
  1178. #define BE_READ_SEEPROM_LEN 1024
  1179. struct be_cmd_req_seeprom_read {
  1180. struct be_cmd_req_hdr hdr;
  1181. u8 rsvd0[BE_READ_SEEPROM_LEN];
  1182. };
  1183. struct be_cmd_resp_seeprom_read {
  1184. struct be_cmd_req_hdr hdr;
  1185. u8 seeprom_data[BE_READ_SEEPROM_LEN];
  1186. };
  1187. enum {
  1188. PHY_TYPE_CX4_10GB = 0,
  1189. PHY_TYPE_XFP_10GB,
  1190. PHY_TYPE_SFP_1GB,
  1191. PHY_TYPE_SFP_PLUS_10GB,
  1192. PHY_TYPE_KR_10GB,
  1193. PHY_TYPE_KX4_10GB,
  1194. PHY_TYPE_BASET_10GB,
  1195. PHY_TYPE_BASET_1GB,
  1196. PHY_TYPE_BASEX_1GB,
  1197. PHY_TYPE_SGMII,
  1198. PHY_TYPE_DISABLED = 255
  1199. };
  1200. #define BE_SUPPORTED_SPEED_NONE 0
  1201. #define BE_SUPPORTED_SPEED_10MBPS 1
  1202. #define BE_SUPPORTED_SPEED_100MBPS 2
  1203. #define BE_SUPPORTED_SPEED_1GBPS 4
  1204. #define BE_SUPPORTED_SPEED_10GBPS 8
  1205. #define BE_AN_EN 0x2
  1206. #define BE_PAUSE_SYM_EN 0x80
  1207. /* MAC speed valid values */
  1208. #define SPEED_DEFAULT 0x0
  1209. #define SPEED_FORCED_10GB 0x1
  1210. #define SPEED_FORCED_1GB 0x2
  1211. #define SPEED_AUTONEG_10GB 0x3
  1212. #define SPEED_AUTONEG_1GB 0x4
  1213. #define SPEED_AUTONEG_100MB 0x5
  1214. #define SPEED_AUTONEG_10GB_1GB 0x6
  1215. #define SPEED_AUTONEG_10GB_1GB_100MB 0x7
  1216. #define SPEED_AUTONEG_1GB_100MB 0x8
  1217. #define SPEED_AUTONEG_10MB 0x9
  1218. #define SPEED_AUTONEG_1GB_100MB_10MB 0xa
  1219. #define SPEED_AUTONEG_100MB_10MB 0xb
  1220. #define SPEED_FORCED_100MB 0xc
  1221. #define SPEED_FORCED_10MB 0xd
  1222. struct be_cmd_req_get_phy_info {
  1223. struct be_cmd_req_hdr hdr;
  1224. u8 rsvd0[24];
  1225. };
  1226. struct be_phy_info {
  1227. u16 phy_type;
  1228. u16 interface_type;
  1229. u32 misc_params;
  1230. u16 ext_phy_details;
  1231. u16 rsvd;
  1232. u16 auto_speeds_supported;
  1233. u16 fixed_speeds_supported;
  1234. u32 future_use[2];
  1235. };
  1236. struct be_cmd_resp_get_phy_info {
  1237. struct be_cmd_req_hdr hdr;
  1238. struct be_phy_info phy_info;
  1239. };
  1240. /*********************** Set QOS ***********************/
  1241. #define BE_QOS_BITS_NIC 1
  1242. struct be_cmd_req_set_qos {
  1243. struct be_cmd_req_hdr hdr;
  1244. u32 valid_bits;
  1245. u32 max_bps_nic;
  1246. u32 rsvd[7];
  1247. };
  1248. struct be_cmd_resp_set_qos {
  1249. struct be_cmd_resp_hdr hdr;
  1250. u32 rsvd;
  1251. };
  1252. /*********************** Controller Attributes ***********************/
  1253. struct be_cmd_req_cntl_attribs {
  1254. struct be_cmd_req_hdr hdr;
  1255. };
  1256. struct be_cmd_resp_cntl_attribs {
  1257. struct be_cmd_resp_hdr hdr;
  1258. struct mgmt_controller_attrib attribs;
  1259. };
  1260. /*********************** Set driver function ***********************/
  1261. #define CAPABILITY_SW_TIMESTAMPS 2
  1262. #define CAPABILITY_BE3_NATIVE_ERX_API 4
  1263. struct be_cmd_req_set_func_cap {
  1264. struct be_cmd_req_hdr hdr;
  1265. u32 valid_cap_flags;
  1266. u32 cap_flags;
  1267. u8 rsvd[212];
  1268. };
  1269. struct be_cmd_resp_set_func_cap {
  1270. struct be_cmd_resp_hdr hdr;
  1271. u32 valid_cap_flags;
  1272. u32 cap_flags;
  1273. u8 rsvd[212];
  1274. };
  1275. /******************** GET/SET_MACLIST **************************/
  1276. #define BE_MAX_MAC 64
  1277. struct be_cmd_req_get_mac_list {
  1278. struct be_cmd_req_hdr hdr;
  1279. u8 mac_type;
  1280. u8 perm_override;
  1281. u16 iface_id;
  1282. u32 mac_id;
  1283. u32 rsvd[3];
  1284. } __packed;
  1285. struct get_list_macaddr {
  1286. u16 mac_addr_size;
  1287. union {
  1288. u8 macaddr[6];
  1289. struct {
  1290. u8 rsvd[2];
  1291. u32 mac_id;
  1292. } __packed s_mac_id;
  1293. } __packed mac_addr_id;
  1294. } __packed;
  1295. struct be_cmd_resp_get_mac_list {
  1296. struct be_cmd_resp_hdr hdr;
  1297. struct get_list_macaddr fd_macaddr; /* Factory default mac */
  1298. struct get_list_macaddr macid_macaddr; /* soft mac */
  1299. u8 true_mac_count;
  1300. u8 pseudo_mac_count;
  1301. u8 mac_list_size;
  1302. u8 rsvd;
  1303. /* perm override mac */
  1304. struct get_list_macaddr macaddr_list[BE_MAX_MAC];
  1305. } __packed;
  1306. struct be_cmd_req_set_mac_list {
  1307. struct be_cmd_req_hdr hdr;
  1308. u8 mac_count;
  1309. u8 rsvd1;
  1310. u16 rsvd2;
  1311. struct macaddr mac[BE_MAX_MAC];
  1312. } __packed;
  1313. /*********************** HSW Config ***********************/
  1314. struct amap_set_hsw_context {
  1315. u8 interface_id[16];
  1316. u8 rsvd0[14];
  1317. u8 pvid_valid;
  1318. u8 rsvd1;
  1319. u8 rsvd2[16];
  1320. u8 pvid[16];
  1321. u8 rsvd3[32];
  1322. u8 rsvd4[32];
  1323. u8 rsvd5[32];
  1324. } __packed;
  1325. struct be_cmd_req_set_hsw_config {
  1326. struct be_cmd_req_hdr hdr;
  1327. u8 context[sizeof(struct amap_set_hsw_context) / 8];
  1328. } __packed;
  1329. struct be_cmd_resp_set_hsw_config {
  1330. struct be_cmd_resp_hdr hdr;
  1331. u32 rsvd;
  1332. };
  1333. struct amap_get_hsw_req_context {
  1334. u8 interface_id[16];
  1335. u8 rsvd0[14];
  1336. u8 pvid_valid;
  1337. u8 pport;
  1338. } __packed;
  1339. struct amap_get_hsw_resp_context {
  1340. u8 rsvd1[16];
  1341. u8 pvid[16];
  1342. u8 rsvd2[32];
  1343. u8 rsvd3[32];
  1344. u8 rsvd4[32];
  1345. } __packed;
  1346. struct be_cmd_req_get_hsw_config {
  1347. struct be_cmd_req_hdr hdr;
  1348. u8 context[sizeof(struct amap_get_hsw_req_context) / 8];
  1349. } __packed;
  1350. struct be_cmd_resp_get_hsw_config {
  1351. struct be_cmd_resp_hdr hdr;
  1352. u8 context[sizeof(struct amap_get_hsw_resp_context) / 8];
  1353. u32 rsvd;
  1354. };
  1355. /*************** HW Stats Get v1 **********************************/
  1356. #define BE_TXP_SW_SZ 48
  1357. struct be_port_rxf_stats_v1 {
  1358. u32 rsvd0[12];
  1359. u32 rx_crc_errors;
  1360. u32 rx_alignment_symbol_errors;
  1361. u32 rx_pause_frames;
  1362. u32 rx_priority_pause_frames;
  1363. u32 rx_control_frames;
  1364. u32 rx_in_range_errors;
  1365. u32 rx_out_range_errors;
  1366. u32 rx_frame_too_long;
  1367. u32 rx_address_mismatch_drops;
  1368. u32 rx_dropped_too_small;
  1369. u32 rx_dropped_too_short;
  1370. u32 rx_dropped_header_too_small;
  1371. u32 rx_dropped_tcp_length;
  1372. u32 rx_dropped_runt;
  1373. u32 rsvd1[10];
  1374. u32 rx_ip_checksum_errs;
  1375. u32 rx_tcp_checksum_errs;
  1376. u32 rx_udp_checksum_errs;
  1377. u32 rsvd2[7];
  1378. u32 rx_switched_unicast_packets;
  1379. u32 rx_switched_multicast_packets;
  1380. u32 rx_switched_broadcast_packets;
  1381. u32 rsvd3[3];
  1382. u32 tx_pauseframes;
  1383. u32 tx_priority_pauseframes;
  1384. u32 tx_controlframes;
  1385. u32 rsvd4[10];
  1386. u32 rxpp_fifo_overflow_drop;
  1387. u32 rx_input_fifo_overflow_drop;
  1388. u32 pmem_fifo_overflow_drop;
  1389. u32 jabber_events;
  1390. u32 rsvd5[3];
  1391. };
  1392. struct be_rxf_stats_v1 {
  1393. struct be_port_rxf_stats_v1 port[4];
  1394. u32 rsvd0[2];
  1395. u32 rx_drops_no_pbuf;
  1396. u32 rx_drops_no_txpb;
  1397. u32 rx_drops_no_erx_descr;
  1398. u32 rx_drops_no_tpre_descr;
  1399. u32 rsvd1[6];
  1400. u32 rx_drops_too_many_frags;
  1401. u32 rx_drops_invalid_ring;
  1402. u32 forwarded_packets;
  1403. u32 rx_drops_mtu;
  1404. u32 rsvd2[14];
  1405. };
  1406. struct be_erx_stats_v1 {
  1407. u32 rx_drops_no_fragments[68]; /* dwordS 0 to 67*/
  1408. u32 rsvd[4];
  1409. };
  1410. struct be_hw_stats_v1 {
  1411. struct be_rxf_stats_v1 rxf;
  1412. u32 rsvd0[BE_TXP_SW_SZ];
  1413. struct be_erx_stats_v1 erx;
  1414. struct be_pmem_stats pmem;
  1415. u32 rsvd1[3];
  1416. };
  1417. struct be_cmd_req_get_stats_v1 {
  1418. struct be_cmd_req_hdr hdr;
  1419. u8 rsvd[sizeof(struct be_hw_stats_v1)];
  1420. };
  1421. struct be_cmd_resp_get_stats_v1 {
  1422. struct be_cmd_resp_hdr hdr;
  1423. struct be_hw_stats_v1 hw_stats;
  1424. };
  1425. static inline void *hw_stats_from_cmd(struct be_adapter *adapter)
  1426. {
  1427. if (adapter->generation == BE_GEN3) {
  1428. struct be_cmd_resp_get_stats_v1 *cmd = adapter->stats_cmd.va;
  1429. return &cmd->hw_stats;
  1430. } else {
  1431. struct be_cmd_resp_get_stats_v0 *cmd = adapter->stats_cmd.va;
  1432. return &cmd->hw_stats;
  1433. }
  1434. }
  1435. static inline void *be_erx_stats_from_cmd(struct be_adapter *adapter)
  1436. {
  1437. if (adapter->generation == BE_GEN3) {
  1438. struct be_hw_stats_v1 *hw_stats = hw_stats_from_cmd(adapter);
  1439. return &hw_stats->erx;
  1440. } else {
  1441. struct be_hw_stats_v0 *hw_stats = hw_stats_from_cmd(adapter);
  1442. return &hw_stats->erx;
  1443. }
  1444. }
  1445. /************** get fat capabilites *******************/
  1446. #define MAX_MODULES 27
  1447. #define MAX_MODES 4
  1448. #define MODE_UART 0
  1449. #define FW_LOG_LEVEL_DEFAULT 48
  1450. #define FW_LOG_LEVEL_FATAL 64
  1451. struct ext_fat_mode {
  1452. u8 mode;
  1453. u8 rsvd0;
  1454. u16 port_mask;
  1455. u32 dbg_lvl;
  1456. u64 fun_mask;
  1457. } __packed;
  1458. struct ext_fat_modules {
  1459. u8 modules_str[32];
  1460. u32 modules_id;
  1461. u32 num_modes;
  1462. struct ext_fat_mode trace_lvl[MAX_MODES];
  1463. } __packed;
  1464. struct be_fat_conf_params {
  1465. u32 max_log_entries;
  1466. u32 log_entry_size;
  1467. u8 log_type;
  1468. u8 max_log_funs;
  1469. u8 max_log_ports;
  1470. u8 rsvd0;
  1471. u32 supp_modes;
  1472. u32 num_modules;
  1473. struct ext_fat_modules module[MAX_MODULES];
  1474. } __packed;
  1475. struct be_cmd_req_get_ext_fat_caps {
  1476. struct be_cmd_req_hdr hdr;
  1477. u32 parameter_type;
  1478. };
  1479. struct be_cmd_resp_get_ext_fat_caps {
  1480. struct be_cmd_resp_hdr hdr;
  1481. struct be_fat_conf_params get_params;
  1482. };
  1483. struct be_cmd_req_set_ext_fat_caps {
  1484. struct be_cmd_req_hdr hdr;
  1485. struct be_fat_conf_params set_params;
  1486. };
  1487. extern int be_pci_fnum_get(struct be_adapter *adapter);
  1488. extern int be_cmd_POST(struct be_adapter *adapter);
  1489. extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
  1490. u8 type, bool permanent, u32 if_handle, u32 pmac_id);
  1491. extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
  1492. u32 if_id, u32 *pmac_id, u32 domain);
  1493. extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id,
  1494. int pmac_id, u32 domain);
  1495. extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags,
  1496. u32 en_flags, u8 *mac, u32 *if_handle, u32 *pmac_id,
  1497. u32 domain);
  1498. extern int be_cmd_if_destroy(struct be_adapter *adapter, int if_handle,
  1499. u32 domain);
  1500. extern int be_cmd_eq_create(struct be_adapter *adapter,
  1501. struct be_queue_info *eq, int eq_delay);
  1502. extern int be_cmd_cq_create(struct be_adapter *adapter,
  1503. struct be_queue_info *cq, struct be_queue_info *eq,
  1504. bool no_delay, int num_cqe_dma_coalesce);
  1505. extern int be_cmd_mccq_create(struct be_adapter *adapter,
  1506. struct be_queue_info *mccq,
  1507. struct be_queue_info *cq);
  1508. extern int be_cmd_txq_create(struct be_adapter *adapter,
  1509. struct be_queue_info *txq,
  1510. struct be_queue_info *cq);
  1511. extern int be_cmd_rxq_create(struct be_adapter *adapter,
  1512. struct be_queue_info *rxq, u16 cq_id,
  1513. u16 frag_size, u32 if_id, u32 rss, u8 *rss_id);
  1514. extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
  1515. int type);
  1516. extern int be_cmd_rxq_destroy(struct be_adapter *adapter,
  1517. struct be_queue_info *q);
  1518. extern int be_cmd_link_status_query(struct be_adapter *adapter, u8 *mac_speed,
  1519. u16 *link_speed, u8 *link_status, u32 dom);
  1520. extern int be_cmd_reset(struct be_adapter *adapter);
  1521. extern int be_cmd_get_stats(struct be_adapter *adapter,
  1522. struct be_dma_mem *nonemb_cmd);
  1523. extern int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
  1524. struct be_dma_mem *nonemb_cmd);
  1525. extern int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver,
  1526. char *fw_on_flash);
  1527. extern int be_cmd_modify_eqd(struct be_adapter *adapter, u32 eq_id, u32 eqd);
  1528. extern int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id,
  1529. u16 *vtag_array, u32 num, bool untagged,
  1530. bool promiscuous);
  1531. extern int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status);
  1532. extern int be_cmd_set_flow_control(struct be_adapter *adapter,
  1533. u32 tx_fc, u32 rx_fc);
  1534. extern int be_cmd_get_flow_control(struct be_adapter *adapter,
  1535. u32 *tx_fc, u32 *rx_fc);
  1536. extern int be_cmd_query_fw_cfg(struct be_adapter *adapter,
  1537. u32 *port_num, u32 *function_mode, u32 *function_caps);
  1538. extern int be_cmd_reset_function(struct be_adapter *adapter);
  1539. extern int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
  1540. u16 table_size);
  1541. extern int be_process_mcc(struct be_adapter *adapter);
  1542. extern int be_cmd_set_beacon_state(struct be_adapter *adapter,
  1543. u8 port_num, u8 beacon, u8 status, u8 state);
  1544. extern int be_cmd_get_beacon_state(struct be_adapter *adapter,
  1545. u8 port_num, u32 *state);
  1546. extern int be_cmd_write_flashrom(struct be_adapter *adapter,
  1547. struct be_dma_mem *cmd, u32 flash_oper,
  1548. u32 flash_opcode, u32 buf_size);
  1549. extern int lancer_cmd_write_object(struct be_adapter *adapter,
  1550. struct be_dma_mem *cmd,
  1551. u32 data_size, u32 data_offset,
  1552. const char *obj_name,
  1553. u32 *data_written, u8 *addn_status);
  1554. int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
  1555. u32 data_size, u32 data_offset, const char *obj_name,
  1556. u32 *data_read, u32 *eof, u8 *addn_status);
  1557. int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
  1558. int offset);
  1559. extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
  1560. struct be_dma_mem *nonemb_cmd);
  1561. extern int be_cmd_fw_init(struct be_adapter *adapter);
  1562. extern int be_cmd_fw_clean(struct be_adapter *adapter);
  1563. extern void be_async_mcc_enable(struct be_adapter *adapter);
  1564. extern void be_async_mcc_disable(struct be_adapter *adapter);
  1565. extern int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
  1566. u32 loopback_type, u32 pkt_size,
  1567. u32 num_pkts, u64 pattern);
  1568. extern int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
  1569. u32 byte_cnt, struct be_dma_mem *cmd);
  1570. extern int be_cmd_get_seeprom_data(struct be_adapter *adapter,
  1571. struct be_dma_mem *nonemb_cmd);
  1572. extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
  1573. u8 loopback_type, u8 enable);
  1574. extern int be_cmd_get_phy_info(struct be_adapter *adapter);
  1575. extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);
  1576. extern void be_detect_dump_ue(struct be_adapter *adapter);
  1577. extern int be_cmd_get_die_temperature(struct be_adapter *adapter);
  1578. extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter);
  1579. extern int be_cmd_req_native_mode(struct be_adapter *adapter);
  1580. extern int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size);
  1581. extern void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf);
  1582. extern int be_cmd_get_mac_from_list(struct be_adapter *adapter, u32 domain,
  1583. bool *pmac_id_active, u32 *pmac_id, u8 *mac);
  1584. extern int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array,
  1585. u8 mac_count, u32 domain);
  1586. extern int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid,
  1587. u32 domain, u16 intf_id);
  1588. extern int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid,
  1589. u32 domain, u16 intf_id);
  1590. extern int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter);
  1591. extern int be_cmd_get_ext_fat_capabilites(struct be_adapter *adapter,
  1592. struct be_dma_mem *cmd);
  1593. extern int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
  1594. struct be_dma_mem *cmd,
  1595. struct be_fat_conf_params *cfgs);