be_cmds.h 44 KB

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