57xx_hsi_bnx2fc.h 22 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. /* 57xx_hsi_bnx2fc.h: QLogic Linux FCoE offload driver.
  2. * Handles operations such as session offload/upload etc, and manages
  3. * session resources such as connection id and qp resources.
  4. *
  5. * Copyright (c) 2008-2013 Broadcom Corporation
  6. * Copyright (c) 2014-2016 QLogic Corporation
  7. * Copyright (c) 2016-2017 Cavium Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation.
  12. *
  13. */
  14. #ifndef __57XX_FCOE_HSI_LINUX_LE__
  15. #define __57XX_FCOE_HSI_LINUX_LE__
  16. /*
  17. * common data for all protocols
  18. */
  19. struct b577xx_doorbell_hdr {
  20. u8 header;
  21. #define B577XX_DOORBELL_HDR_RX (0x1<<0)
  22. #define B577XX_DOORBELL_HDR_RX_SHIFT 0
  23. #define B577XX_DOORBELL_HDR_DB_TYPE (0x1<<1)
  24. #define B577XX_DOORBELL_HDR_DB_TYPE_SHIFT 1
  25. #define B577XX_DOORBELL_HDR_DPM_SIZE (0x3<<2)
  26. #define B577XX_DOORBELL_HDR_DPM_SIZE_SHIFT 2
  27. #define B577XX_DOORBELL_HDR_CONN_TYPE (0xF<<4)
  28. #define B577XX_DOORBELL_HDR_CONN_TYPE_SHIFT 4
  29. };
  30. /*
  31. * doorbell message sent to the chip
  32. */
  33. struct b577xx_doorbell {
  34. #if defined(__BIG_ENDIAN)
  35. u16 zero_fill2;
  36. u8 zero_fill1;
  37. struct b577xx_doorbell_hdr header;
  38. #elif defined(__LITTLE_ENDIAN)
  39. struct b577xx_doorbell_hdr header;
  40. u8 zero_fill1;
  41. u16 zero_fill2;
  42. #endif
  43. };
  44. /*
  45. * doorbell message sent to the chip
  46. */
  47. struct b577xx_doorbell_set_prod {
  48. #if defined(__BIG_ENDIAN)
  49. u16 prod;
  50. u8 zero_fill1;
  51. struct b577xx_doorbell_hdr header;
  52. #elif defined(__LITTLE_ENDIAN)
  53. struct b577xx_doorbell_hdr header;
  54. u8 zero_fill1;
  55. u16 prod;
  56. #endif
  57. };
  58. struct regpair {
  59. __le32 lo;
  60. __le32 hi;
  61. };
  62. /*
  63. * ABTS info $$KEEP_ENDIANNESS$$
  64. */
  65. struct fcoe_abts_info {
  66. __le16 aborted_task_id;
  67. __le16 reserved0;
  68. __le32 reserved1;
  69. };
  70. /*
  71. * Fixed size structure in order to plant it in Union structure
  72. * $$KEEP_ENDIANNESS$$
  73. */
  74. struct fcoe_abts_rsp_union {
  75. u8 r_ctl;
  76. u8 rsrv[3];
  77. __le32 abts_rsp_payload[7];
  78. };
  79. /*
  80. * 4 regs size $$KEEP_ENDIANNESS$$
  81. */
  82. struct fcoe_bd_ctx {
  83. __le32 buf_addr_hi;
  84. __le32 buf_addr_lo;
  85. __le16 buf_len;
  86. __le16 rsrv0;
  87. __le16 flags;
  88. __le16 rsrv1;
  89. };
  90. /*
  91. * FCoE cached sges context $$KEEP_ENDIANNESS$$
  92. */
  93. struct fcoe_cached_sge_ctx {
  94. struct regpair cur_buf_addr;
  95. __le16 cur_buf_rem;
  96. __le16 second_buf_rem;
  97. struct regpair second_buf_addr;
  98. };
  99. /*
  100. * Cleanup info $$KEEP_ENDIANNESS$$
  101. */
  102. struct fcoe_cleanup_info {
  103. __le16 cleaned_task_id;
  104. __le16 rolled_tx_seq_cnt;
  105. __le32 rolled_tx_data_offset;
  106. };
  107. /*
  108. * Fcp RSP flags $$KEEP_ENDIANNESS$$
  109. */
  110. struct fcoe_fcp_rsp_flags {
  111. u8 flags;
  112. #define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID (0x1<<0)
  113. #define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID_SHIFT 0
  114. #define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID (0x1<<1)
  115. #define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID_SHIFT 1
  116. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER (0x1<<2)
  117. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER_SHIFT 2
  118. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER (0x1<<3)
  119. #define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER_SHIFT 3
  120. #define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ (0x1<<4)
  121. #define FCOE_FCP_RSP_FLAGS_FCP_CONF_REQ_SHIFT 4
  122. #define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS (0x7<<5)
  123. #define FCOE_FCP_RSP_FLAGS_FCP_BIDI_FLAGS_SHIFT 5
  124. };
  125. /*
  126. * Fcp RSP payload $$KEEP_ENDIANNESS$$
  127. */
  128. struct fcoe_fcp_rsp_payload {
  129. struct regpair reserved0;
  130. __le32 fcp_resid;
  131. u8 scsi_status_code;
  132. struct fcoe_fcp_rsp_flags fcp_flags;
  133. __le16 retry_delay_timer;
  134. __le32 fcp_rsp_len;
  135. __le32 fcp_sns_len;
  136. };
  137. /*
  138. * Fixed size structure in order to plant it in Union structure
  139. * $$KEEP_ENDIANNESS$$
  140. */
  141. struct fcoe_fcp_rsp_union {
  142. struct fcoe_fcp_rsp_payload payload;
  143. struct regpair reserved0;
  144. };
  145. /*
  146. * FC header $$KEEP_ENDIANNESS$$
  147. */
  148. struct fcoe_fc_hdr {
  149. u8 s_id[3];
  150. u8 cs_ctl;
  151. u8 d_id[3];
  152. u8 r_ctl;
  153. __le16 seq_cnt;
  154. u8 df_ctl;
  155. u8 seq_id;
  156. u8 f_ctl[3];
  157. u8 type;
  158. __le32 parameters;
  159. __le16 rx_id;
  160. __le16 ox_id;
  161. };
  162. /*
  163. * FC header union $$KEEP_ENDIANNESS$$
  164. */
  165. struct fcoe_mp_rsp_union {
  166. struct fcoe_fc_hdr fc_hdr;
  167. __le32 mp_payload_len;
  168. __le32 rsrv;
  169. };
  170. /*
  171. * Completion information $$KEEP_ENDIANNESS$$
  172. */
  173. union fcoe_comp_flow_info {
  174. struct fcoe_fcp_rsp_union fcp_rsp;
  175. struct fcoe_abts_rsp_union abts_rsp;
  176. struct fcoe_mp_rsp_union mp_rsp;
  177. __le32 opaque[8];
  178. };
  179. /*
  180. * External ABTS info $$KEEP_ENDIANNESS$$
  181. */
  182. struct fcoe_ext_abts_info {
  183. __le32 rsrv0[6];
  184. struct fcoe_abts_info ctx;
  185. };
  186. /*
  187. * External cleanup info $$KEEP_ENDIANNESS$$
  188. */
  189. struct fcoe_ext_cleanup_info {
  190. __le32 rsrv0[6];
  191. struct fcoe_cleanup_info ctx;
  192. };
  193. /*
  194. * Fcoe FW Tx sequence context $$KEEP_ENDIANNESS$$
  195. */
  196. struct fcoe_fw_tx_seq_ctx {
  197. __le32 data_offset;
  198. __le16 seq_cnt;
  199. __le16 rsrv0;
  200. };
  201. /*
  202. * Fcoe external FW Tx sequence context $$KEEP_ENDIANNESS$$
  203. */
  204. struct fcoe_ext_fw_tx_seq_ctx {
  205. __le32 rsrv0[6];
  206. struct fcoe_fw_tx_seq_ctx ctx;
  207. };
  208. /*
  209. * FCoE multiple sges context $$KEEP_ENDIANNESS$$
  210. */
  211. struct fcoe_mul_sges_ctx {
  212. struct regpair cur_sge_addr;
  213. __le16 cur_sge_off;
  214. u8 cur_sge_idx;
  215. u8 sgl_size;
  216. };
  217. /*
  218. * FCoE external multiple sges context $$KEEP_ENDIANNESS$$
  219. */
  220. struct fcoe_ext_mul_sges_ctx {
  221. struct fcoe_mul_sges_ctx mul_sgl;
  222. struct regpair rsrv0;
  223. };
  224. /*
  225. * FCP CMD payload $$KEEP_ENDIANNESS$$
  226. */
  227. struct fcoe_fcp_cmd_payload {
  228. __le32 opaque[8];
  229. };
  230. /*
  231. * Fcp xfr rdy payload $$KEEP_ENDIANNESS$$
  232. */
  233. struct fcoe_fcp_xfr_rdy_payload {
  234. __le32 burst_len;
  235. __le32 data_ro;
  236. };
  237. /*
  238. * FC frame $$KEEP_ENDIANNESS$$
  239. */
  240. struct fcoe_fc_frame {
  241. struct fcoe_fc_hdr fc_hdr;
  242. __le32 reserved0[2];
  243. };
  244. /*
  245. * FCoE KCQ CQE parameters $$KEEP_ENDIANNESS$$
  246. */
  247. union fcoe_kcqe_params {
  248. __le32 reserved0[4];
  249. };
  250. /*
  251. * FCoE KCQ CQE $$KEEP_ENDIANNESS$$
  252. */
  253. struct fcoe_kcqe {
  254. __le32 fcoe_conn_id;
  255. __le32 completion_status;
  256. __le32 fcoe_conn_context_id;
  257. union fcoe_kcqe_params params;
  258. __le16 qe_self_seq;
  259. u8 op_code;
  260. u8 flags;
  261. #define FCOE_KCQE_RESERVED0 (0x7<<0)
  262. #define FCOE_KCQE_RESERVED0_SHIFT 0
  263. #define FCOE_KCQE_RAMROD_COMPLETION (0x1<<3)
  264. #define FCOE_KCQE_RAMROD_COMPLETION_SHIFT 3
  265. #define FCOE_KCQE_LAYER_CODE (0x7<<4)
  266. #define FCOE_KCQE_LAYER_CODE_SHIFT 4
  267. #define FCOE_KCQE_LINKED_WITH_NEXT (0x1<<7)
  268. #define FCOE_KCQE_LINKED_WITH_NEXT_SHIFT 7
  269. };
  270. /*
  271. * FCoE KWQE header $$KEEP_ENDIANNESS$$
  272. */
  273. struct fcoe_kwqe_header {
  274. u8 op_code;
  275. u8 flags;
  276. #define FCOE_KWQE_HEADER_RESERVED0 (0xF<<0)
  277. #define FCOE_KWQE_HEADER_RESERVED0_SHIFT 0
  278. #define FCOE_KWQE_HEADER_LAYER_CODE (0x7<<4)
  279. #define FCOE_KWQE_HEADER_LAYER_CODE_SHIFT 4
  280. #define FCOE_KWQE_HEADER_RESERVED1 (0x1<<7)
  281. #define FCOE_KWQE_HEADER_RESERVED1_SHIFT 7
  282. };
  283. /*
  284. * FCoE firmware init request 1 $$KEEP_ENDIANNESS$$
  285. */
  286. struct fcoe_kwqe_init1 {
  287. __le16 num_tasks;
  288. struct fcoe_kwqe_header hdr;
  289. __le32 task_list_pbl_addr_lo;
  290. __le32 task_list_pbl_addr_hi;
  291. __le32 dummy_buffer_addr_lo;
  292. __le32 dummy_buffer_addr_hi;
  293. __le16 sq_num_wqes;
  294. __le16 rq_num_wqes;
  295. __le16 rq_buffer_log_size;
  296. __le16 cq_num_wqes;
  297. __le16 mtu;
  298. u8 num_sessions_log;
  299. u8 flags;
  300. #define FCOE_KWQE_INIT1_LOG_PAGE_SIZE (0xF<<0)
  301. #define FCOE_KWQE_INIT1_LOG_PAGE_SIZE_SHIFT 0
  302. #define FCOE_KWQE_INIT1_LOG_CACHED_PBES_PER_FUNC (0x7<<4)
  303. #define FCOE_KWQE_INIT1_LOG_CACHED_PBES_PER_FUNC_SHIFT 4
  304. #define FCOE_KWQE_INIT1_RESERVED1 (0x1<<7)
  305. #define FCOE_KWQE_INIT1_RESERVED1_SHIFT 7
  306. };
  307. /*
  308. * FCoE firmware init request 2 $$KEEP_ENDIANNESS$$
  309. */
  310. struct fcoe_kwqe_init2 {
  311. u8 hsi_major_version;
  312. u8 hsi_minor_version;
  313. struct fcoe_kwqe_header hdr;
  314. __le32 hash_tbl_pbl_addr_lo;
  315. __le32 hash_tbl_pbl_addr_hi;
  316. __le32 t2_hash_tbl_addr_lo;
  317. __le32 t2_hash_tbl_addr_hi;
  318. __le32 t2_ptr_hash_tbl_addr_lo;
  319. __le32 t2_ptr_hash_tbl_addr_hi;
  320. __le32 free_list_count;
  321. };
  322. /*
  323. * FCoE firmware init request 3 $$KEEP_ENDIANNESS$$
  324. */
  325. struct fcoe_kwqe_init3 {
  326. __le16 reserved0;
  327. struct fcoe_kwqe_header hdr;
  328. __le32 error_bit_map_lo;
  329. __le32 error_bit_map_hi;
  330. u8 perf_config;
  331. u8 reserved21[3];
  332. __le32 reserved2[4];
  333. };
  334. /*
  335. * FCoE connection offload request 1 $$KEEP_ENDIANNESS$$
  336. */
  337. struct fcoe_kwqe_conn_offload1 {
  338. __le16 fcoe_conn_id;
  339. struct fcoe_kwqe_header hdr;
  340. __le32 sq_addr_lo;
  341. __le32 sq_addr_hi;
  342. __le32 rq_pbl_addr_lo;
  343. __le32 rq_pbl_addr_hi;
  344. __le32 rq_first_pbe_addr_lo;
  345. __le32 rq_first_pbe_addr_hi;
  346. __le16 rq_prod;
  347. __le16 reserved0;
  348. };
  349. /*
  350. * FCoE connection offload request 2 $$KEEP_ENDIANNESS$$
  351. */
  352. struct fcoe_kwqe_conn_offload2 {
  353. __le16 tx_max_fc_pay_len;
  354. struct fcoe_kwqe_header hdr;
  355. __le32 cq_addr_lo;
  356. __le32 cq_addr_hi;
  357. __le32 xferq_addr_lo;
  358. __le32 xferq_addr_hi;
  359. __le32 conn_db_addr_lo;
  360. __le32 conn_db_addr_hi;
  361. __le32 reserved1;
  362. };
  363. /*
  364. * FCoE connection offload request 3 $$KEEP_ENDIANNESS$$
  365. */
  366. struct fcoe_kwqe_conn_offload3 {
  367. __le16 vlan_tag;
  368. #define FCOE_KWQE_CONN_OFFLOAD3_VLAN_ID (0xFFF<<0)
  369. #define FCOE_KWQE_CONN_OFFLOAD3_VLAN_ID_SHIFT 0
  370. #define FCOE_KWQE_CONN_OFFLOAD3_CFI (0x1<<12)
  371. #define FCOE_KWQE_CONN_OFFLOAD3_CFI_SHIFT 12
  372. #define FCOE_KWQE_CONN_OFFLOAD3_PRIORITY (0x7<<13)
  373. #define FCOE_KWQE_CONN_OFFLOAD3_PRIORITY_SHIFT 13
  374. struct fcoe_kwqe_header hdr;
  375. u8 s_id[3];
  376. u8 tx_max_conc_seqs_c3;
  377. u8 d_id[3];
  378. u8 flags;
  379. #define FCOE_KWQE_CONN_OFFLOAD3_B_MUL_N_PORT_IDS (0x1<<0)
  380. #define FCOE_KWQE_CONN_OFFLOAD3_B_MUL_N_PORT_IDS_SHIFT 0
  381. #define FCOE_KWQE_CONN_OFFLOAD3_B_E_D_TOV_RES (0x1<<1)
  382. #define FCOE_KWQE_CONN_OFFLOAD3_B_E_D_TOV_RES_SHIFT 1
  383. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT (0x1<<2)
  384. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONT_INCR_SEQ_CNT_SHIFT 2
  385. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONF_REQ (0x1<<3)
  386. #define FCOE_KWQE_CONN_OFFLOAD3_B_CONF_REQ_SHIFT 3
  387. #define FCOE_KWQE_CONN_OFFLOAD3_B_REC_VALID (0x1<<4)
  388. #define FCOE_KWQE_CONN_OFFLOAD3_B_REC_VALID_SHIFT 4
  389. #define FCOE_KWQE_CONN_OFFLOAD3_B_C2_VALID (0x1<<5)
  390. #define FCOE_KWQE_CONN_OFFLOAD3_B_C2_VALID_SHIFT 5
  391. #define FCOE_KWQE_CONN_OFFLOAD3_B_ACK_0 (0x1<<6)
  392. #define FCOE_KWQE_CONN_OFFLOAD3_B_ACK_0_SHIFT 6
  393. #define FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG (0x1<<7)
  394. #define FCOE_KWQE_CONN_OFFLOAD3_B_VLAN_FLAG_SHIFT 7
  395. __le32 reserved;
  396. __le32 confq_first_pbe_addr_lo;
  397. __le32 confq_first_pbe_addr_hi;
  398. __le16 tx_total_conc_seqs;
  399. __le16 rx_max_fc_pay_len;
  400. __le16 rx_total_conc_seqs;
  401. u8 rx_max_conc_seqs_c3;
  402. u8 rx_open_seqs_exch_c3;
  403. };
  404. /*
  405. * FCoE connection offload request 4 $$KEEP_ENDIANNESS$$
  406. */
  407. struct fcoe_kwqe_conn_offload4 {
  408. u8 e_d_tov_timer_val;
  409. u8 reserved2;
  410. struct fcoe_kwqe_header hdr;
  411. u8 src_mac_addr_lo[2];
  412. u8 src_mac_addr_mid[2];
  413. u8 src_mac_addr_hi[2];
  414. u8 dst_mac_addr_hi[2];
  415. u8 dst_mac_addr_lo[2];
  416. u8 dst_mac_addr_mid[2];
  417. __le32 lcq_addr_lo;
  418. __le32 lcq_addr_hi;
  419. __le32 confq_pbl_base_addr_lo;
  420. __le32 confq_pbl_base_addr_hi;
  421. };
  422. /*
  423. * FCoE connection enable request $$KEEP_ENDIANNESS$$
  424. */
  425. struct fcoe_kwqe_conn_enable_disable {
  426. __le16 reserved0;
  427. struct fcoe_kwqe_header hdr;
  428. u8 src_mac_addr_lo[2];
  429. u8 src_mac_addr_mid[2];
  430. u8 src_mac_addr_hi[2];
  431. u16 vlan_tag;
  432. #define FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID (0xFFF<<0)
  433. #define FCOE_KWQE_CONN_ENABLE_DISABLE_VLAN_ID_SHIFT 0
  434. #define FCOE_KWQE_CONN_ENABLE_DISABLE_CFI (0x1<<12)
  435. #define FCOE_KWQE_CONN_ENABLE_DISABLE_CFI_SHIFT 12
  436. #define FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY (0x7<<13)
  437. #define FCOE_KWQE_CONN_ENABLE_DISABLE_PRIORITY_SHIFT 13
  438. u8 dst_mac_addr_lo[2];
  439. u8 dst_mac_addr_mid[2];
  440. u8 dst_mac_addr_hi[2];
  441. __le16 reserved1;
  442. u8 s_id[3];
  443. u8 vlan_flag;
  444. u8 d_id[3];
  445. u8 reserved3;
  446. __le32 context_id;
  447. __le32 conn_id;
  448. __le32 reserved4;
  449. };
  450. /*
  451. * FCoE connection destroy request $$KEEP_ENDIANNESS$$
  452. */
  453. struct fcoe_kwqe_conn_destroy {
  454. __le16 reserved0;
  455. struct fcoe_kwqe_header hdr;
  456. __le32 context_id;
  457. __le32 conn_id;
  458. __le32 reserved1[5];
  459. };
  460. /*
  461. * FCoe destroy request $$KEEP_ENDIANNESS$$
  462. */
  463. struct fcoe_kwqe_destroy {
  464. __le16 reserved0;
  465. struct fcoe_kwqe_header hdr;
  466. __le32 reserved1[7];
  467. };
  468. /*
  469. * FCoe statistics request $$KEEP_ENDIANNESS$$
  470. */
  471. struct fcoe_kwqe_stat {
  472. __le16 reserved0;
  473. struct fcoe_kwqe_header hdr;
  474. __le32 stat_params_addr_lo;
  475. __le32 stat_params_addr_hi;
  476. __le32 reserved1[5];
  477. };
  478. /*
  479. * FCoE KWQ WQE $$KEEP_ENDIANNESS$$
  480. */
  481. union fcoe_kwqe {
  482. struct fcoe_kwqe_init1 init1;
  483. struct fcoe_kwqe_init2 init2;
  484. struct fcoe_kwqe_init3 init3;
  485. struct fcoe_kwqe_conn_offload1 conn_offload1;
  486. struct fcoe_kwqe_conn_offload2 conn_offload2;
  487. struct fcoe_kwqe_conn_offload3 conn_offload3;
  488. struct fcoe_kwqe_conn_offload4 conn_offload4;
  489. struct fcoe_kwqe_conn_enable_disable conn_enable_disable;
  490. struct fcoe_kwqe_conn_destroy conn_destroy;
  491. struct fcoe_kwqe_destroy destroy;
  492. struct fcoe_kwqe_stat statistics;
  493. };
  494. /*
  495. * TX SGL context $$KEEP_ENDIANNESS$$
  496. */
  497. union fcoe_sgl_union_ctx {
  498. struct fcoe_cached_sge_ctx cached_sge;
  499. struct fcoe_ext_mul_sges_ctx sgl;
  500. __le32 opaque[5];
  501. };
  502. /*
  503. * Data-In/ELS/BLS information $$KEEP_ENDIANNESS$$
  504. */
  505. struct fcoe_read_flow_info {
  506. union fcoe_sgl_union_ctx sgl_ctx;
  507. __le32 rsrv0[3];
  508. };
  509. /*
  510. * Fcoe stat context $$KEEP_ENDIANNESS$$
  511. */
  512. struct fcoe_s_stat_ctx {
  513. u8 flags;
  514. #define FCOE_S_STAT_CTX_ACTIVE (0x1<<0)
  515. #define FCOE_S_STAT_CTX_ACTIVE_SHIFT 0
  516. #define FCOE_S_STAT_CTX_ACK_ABORT_SEQ_COND (0x1<<1)
  517. #define FCOE_S_STAT_CTX_ACK_ABORT_SEQ_COND_SHIFT 1
  518. #define FCOE_S_STAT_CTX_ABTS_PERFORMED (0x1<<2)
  519. #define FCOE_S_STAT_CTX_ABTS_PERFORMED_SHIFT 2
  520. #define FCOE_S_STAT_CTX_SEQ_TIMEOUT (0x1<<3)
  521. #define FCOE_S_STAT_CTX_SEQ_TIMEOUT_SHIFT 3
  522. #define FCOE_S_STAT_CTX_P_RJT (0x1<<4)
  523. #define FCOE_S_STAT_CTX_P_RJT_SHIFT 4
  524. #define FCOE_S_STAT_CTX_ACK_EOFT (0x1<<5)
  525. #define FCOE_S_STAT_CTX_ACK_EOFT_SHIFT 5
  526. #define FCOE_S_STAT_CTX_RSRV1 (0x3<<6)
  527. #define FCOE_S_STAT_CTX_RSRV1_SHIFT 6
  528. };
  529. /*
  530. * Fcoe rx seq context $$KEEP_ENDIANNESS$$
  531. */
  532. struct fcoe_rx_seq_ctx {
  533. u8 seq_id;
  534. struct fcoe_s_stat_ctx s_stat;
  535. __le16 seq_cnt;
  536. __le32 low_exp_ro;
  537. __le32 high_exp_ro;
  538. };
  539. /*
  540. * Fcoe rx_wr union context $$KEEP_ENDIANNESS$$
  541. */
  542. union fcoe_rx_wr_union_ctx {
  543. struct fcoe_read_flow_info read_info;
  544. union fcoe_comp_flow_info comp_info;
  545. __le32 opaque[8];
  546. };
  547. /*
  548. * FCoE SQ element $$KEEP_ENDIANNESS$$
  549. */
  550. struct fcoe_sqe {
  551. __le16 wqe;
  552. #define FCOE_SQE_TASK_ID (0x7FFF<<0)
  553. #define FCOE_SQE_TASK_ID_SHIFT 0
  554. #define FCOE_SQE_TOGGLE_BIT (0x1<<15)
  555. #define FCOE_SQE_TOGGLE_BIT_SHIFT 15
  556. };
  557. /*
  558. * 14 regs $$KEEP_ENDIANNESS$$
  559. */
  560. struct fcoe_tce_tx_only {
  561. union fcoe_sgl_union_ctx sgl_ctx;
  562. __le32 rsrv0;
  563. };
  564. /*
  565. * 32 bytes (8 regs) used for TX only purposes $$KEEP_ENDIANNESS$$
  566. */
  567. union fcoe_tx_wr_rx_rd_union_ctx {
  568. struct fcoe_fc_frame tx_frame;
  569. struct fcoe_fcp_cmd_payload fcp_cmd;
  570. struct fcoe_ext_cleanup_info cleanup;
  571. struct fcoe_ext_abts_info abts;
  572. struct fcoe_ext_fw_tx_seq_ctx tx_seq;
  573. __le32 opaque[8];
  574. };
  575. /*
  576. * tce_tx_wr_rx_rd_const $$KEEP_ENDIANNESS$$
  577. */
  578. struct fcoe_tce_tx_wr_rx_rd_const {
  579. u8 init_flags;
  580. #define FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE (0x7<<0)
  581. #define FCOE_TCE_TX_WR_RX_RD_CONST_TASK_TYPE_SHIFT 0
  582. #define FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE (0x1<<3)
  583. #define FCOE_TCE_TX_WR_RX_RD_CONST_DEV_TYPE_SHIFT 3
  584. #define FCOE_TCE_TX_WR_RX_RD_CONST_CLASS_TYPE (0x1<<4)
  585. #define FCOE_TCE_TX_WR_RX_RD_CONST_CLASS_TYPE_SHIFT 4
  586. #define FCOE_TCE_TX_WR_RX_RD_CONST_CACHED_SGE (0x3<<5)
  587. #define FCOE_TCE_TX_WR_RX_RD_CONST_CACHED_SGE_SHIFT 5
  588. #define FCOE_TCE_TX_WR_RX_RD_CONST_SUPPORT_REC_TOV (0x1<<7)
  589. #define FCOE_TCE_TX_WR_RX_RD_CONST_SUPPORT_REC_TOV_SHIFT 7
  590. u8 tx_flags;
  591. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_VALID (0x1<<0)
  592. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_VALID_SHIFT 0
  593. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_STATE (0xF<<1)
  594. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_STATE_SHIFT 1
  595. #define FCOE_TCE_TX_WR_RX_RD_CONST_RSRV1 (0x1<<5)
  596. #define FCOE_TCE_TX_WR_RX_RD_CONST_RSRV1_SHIFT 5
  597. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_SEQ_INIT (0x1<<6)
  598. #define FCOE_TCE_TX_WR_RX_RD_CONST_TX_SEQ_INIT_SHIFT 6
  599. #define FCOE_TCE_TX_WR_RX_RD_CONST_RSRV2 (0x1<<7)
  600. #define FCOE_TCE_TX_WR_RX_RD_CONST_RSRV2_SHIFT 7
  601. __le16 rsrv3;
  602. __le32 verify_tx_seq;
  603. };
  604. /*
  605. * tce_tx_wr_rx_rd $$KEEP_ENDIANNESS$$
  606. */
  607. struct fcoe_tce_tx_wr_rx_rd {
  608. union fcoe_tx_wr_rx_rd_union_ctx union_ctx;
  609. struct fcoe_tce_tx_wr_rx_rd_const const_ctx;
  610. };
  611. /*
  612. * tce_rx_wr_tx_rd_const $$KEEP_ENDIANNESS$$
  613. */
  614. struct fcoe_tce_rx_wr_tx_rd_const {
  615. __le32 data_2_trns;
  616. __le32 init_flags;
  617. #define FCOE_TCE_RX_WR_TX_RD_CONST_CID (0xFFFFFF<<0)
  618. #define FCOE_TCE_RX_WR_TX_RD_CONST_CID_SHIFT 0
  619. #define FCOE_TCE_RX_WR_TX_RD_CONST_RSRV0 (0xFF<<24)
  620. #define FCOE_TCE_RX_WR_TX_RD_CONST_RSRV0_SHIFT 24
  621. };
  622. /*
  623. * tce_rx_wr_tx_rd_var $$KEEP_ENDIANNESS$$
  624. */
  625. struct fcoe_tce_rx_wr_tx_rd_var {
  626. __le16 rx_flags;
  627. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV1 (0xF<<0)
  628. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV1_SHIFT 0
  629. #define FCOE_TCE_RX_WR_TX_RD_VAR_NUM_RQ_WQE (0x7<<4)
  630. #define FCOE_TCE_RX_WR_TX_RD_VAR_NUM_RQ_WQE_SHIFT 4
  631. #define FCOE_TCE_RX_WR_TX_RD_VAR_CONF_REQ (0x1<<7)
  632. #define FCOE_TCE_RX_WR_TX_RD_VAR_CONF_REQ_SHIFT 7
  633. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_STATE (0xF<<8)
  634. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_STATE_SHIFT 8
  635. #define FCOE_TCE_RX_WR_TX_RD_VAR_EXP_FIRST_FRAME (0x1<<12)
  636. #define FCOE_TCE_RX_WR_TX_RD_VAR_EXP_FIRST_FRAME_SHIFT 12
  637. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_SEQ_INIT (0x1<<13)
  638. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_SEQ_INIT_SHIFT 13
  639. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV2 (0x1<<14)
  640. #define FCOE_TCE_RX_WR_TX_RD_VAR_RSRV2_SHIFT 14
  641. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_VALID (0x1<<15)
  642. #define FCOE_TCE_RX_WR_TX_RD_VAR_RX_VALID_SHIFT 15
  643. __le16 rx_id;
  644. struct fcoe_fcp_xfr_rdy_payload fcp_xfr_rdy;
  645. };
  646. /*
  647. * tce_rx_wr_tx_rd $$KEEP_ENDIANNESS$$
  648. */
  649. struct fcoe_tce_rx_wr_tx_rd {
  650. struct fcoe_tce_rx_wr_tx_rd_const const_ctx;
  651. struct fcoe_tce_rx_wr_tx_rd_var var_ctx;
  652. };
  653. /*
  654. * tce_rx_only $$KEEP_ENDIANNESS$$
  655. */
  656. struct fcoe_tce_rx_only {
  657. struct fcoe_rx_seq_ctx rx_seq_ctx;
  658. union fcoe_rx_wr_union_ctx union_ctx;
  659. };
  660. /*
  661. * task_ctx_entry $$KEEP_ENDIANNESS$$
  662. */
  663. struct fcoe_task_ctx_entry {
  664. struct fcoe_tce_tx_only txwr_only;
  665. struct fcoe_tce_tx_wr_rx_rd txwr_rxrd;
  666. struct fcoe_tce_rx_wr_tx_rd rxwr_txrd;
  667. struct fcoe_tce_rx_only rxwr_only;
  668. };
  669. /*
  670. * FCoE XFRQ element $$KEEP_ENDIANNESS$$
  671. */
  672. struct fcoe_xfrqe {
  673. __le16 wqe;
  674. #define FCOE_XFRQE_TASK_ID (0x7FFF<<0)
  675. #define FCOE_XFRQE_TASK_ID_SHIFT 0
  676. #define FCOE_XFRQE_TOGGLE_BIT (0x1<<15)
  677. #define FCOE_XFRQE_TOGGLE_BIT_SHIFT 15
  678. };
  679. /*
  680. * fcoe rx doorbell message sent to the chip $$KEEP_ENDIANNESS$$
  681. */
  682. struct b577xx_fcoe_rx_doorbell {
  683. struct b577xx_doorbell_hdr hdr;
  684. u8 params;
  685. #define B577XX_FCOE_RX_DOORBELL_NEGATIVE_ARM (0x1F<<0)
  686. #define B577XX_FCOE_RX_DOORBELL_NEGATIVE_ARM_SHIFT 0
  687. #define B577XX_FCOE_RX_DOORBELL_OPCODE (0x7<<5)
  688. #define B577XX_FCOE_RX_DOORBELL_OPCODE_SHIFT 5
  689. __le16 doorbell_cq_cons;
  690. };
  691. /*
  692. * FCoE CONFQ element $$KEEP_ENDIANNESS$$
  693. */
  694. struct fcoe_confqe {
  695. __le16 ox_id;
  696. __le16 rx_id;
  697. __le32 param;
  698. };
  699. /*
  700. * FCoE connection data base
  701. */
  702. struct fcoe_conn_db {
  703. #if defined(__BIG_ENDIAN)
  704. u16 rsrv0;
  705. u16 rq_prod;
  706. #elif defined(__LITTLE_ENDIAN)
  707. u16 rq_prod;
  708. u16 rsrv0;
  709. #endif
  710. u32 rsrv1;
  711. struct regpair cq_arm;
  712. };
  713. /*
  714. * FCoE CQ element $$KEEP_ENDIANNESS$$
  715. */
  716. struct fcoe_cqe {
  717. __le16 wqe;
  718. #define FCOE_CQE_CQE_INFO (0x3FFF<<0)
  719. #define FCOE_CQE_CQE_INFO_SHIFT 0
  720. #define FCOE_CQE_CQE_TYPE (0x1<<14)
  721. #define FCOE_CQE_CQE_TYPE_SHIFT 14
  722. #define FCOE_CQE_TOGGLE_BIT (0x1<<15)
  723. #define FCOE_CQE_TOGGLE_BIT_SHIFT 15
  724. };
  725. /*
  726. * FCoE error/warning reporting entry $$KEEP_ENDIANNESS$$
  727. */
  728. struct fcoe_partial_err_report_entry {
  729. __le32 err_warn_bitmap_lo;
  730. __le32 err_warn_bitmap_hi;
  731. __le32 tx_buf_off;
  732. __le32 rx_buf_off;
  733. };
  734. /*
  735. * FCoE error/warning reporting entry $$KEEP_ENDIANNESS$$
  736. */
  737. struct fcoe_err_report_entry {
  738. struct fcoe_partial_err_report_entry data;
  739. struct fcoe_fc_hdr fc_hdr;
  740. };
  741. /*
  742. * FCoE hash table entry (32 bytes) $$KEEP_ENDIANNESS$$
  743. */
  744. struct fcoe_hash_table_entry {
  745. u8 s_id_0;
  746. u8 s_id_1;
  747. u8 s_id_2;
  748. u8 d_id_0;
  749. u8 d_id_1;
  750. u8 d_id_2;
  751. __le16 dst_mac_addr_hi;
  752. __le16 dst_mac_addr_mid;
  753. __le16 dst_mac_addr_lo;
  754. __le16 src_mac_addr_hi;
  755. __le16 vlan_id;
  756. __le16 src_mac_addr_lo;
  757. __le16 src_mac_addr_mid;
  758. u8 vlan_flag;
  759. u8 reserved0;
  760. __le16 reserved1;
  761. __le32 reserved2;
  762. __le32 field_id;
  763. #define FCOE_HASH_TABLE_ENTRY_CID (0xFFFFFF<<0)
  764. #define FCOE_HASH_TABLE_ENTRY_CID_SHIFT 0
  765. #define FCOE_HASH_TABLE_ENTRY_RESERVED3 (0x7F<<24)
  766. #define FCOE_HASH_TABLE_ENTRY_RESERVED3_SHIFT 24
  767. #define FCOE_HASH_TABLE_ENTRY_VALID (0x1<<31)
  768. #define FCOE_HASH_TABLE_ENTRY_VALID_SHIFT 31
  769. };
  770. /*
  771. * FCoE LCQ element $$KEEP_ENDIANNESS$$
  772. */
  773. struct fcoe_lcqe {
  774. __le32 wqe;
  775. #define FCOE_LCQE_TASK_ID (0xFFFF<<0)
  776. #define FCOE_LCQE_TASK_ID_SHIFT 0
  777. #define FCOE_LCQE_LCQE_TYPE (0xFF<<16)
  778. #define FCOE_LCQE_LCQE_TYPE_SHIFT 16
  779. #define FCOE_LCQE_RESERVED (0xFF<<24)
  780. #define FCOE_LCQE_RESERVED_SHIFT 24
  781. };
  782. /*
  783. * FCoE pending work request CQE $$KEEP_ENDIANNESS$$
  784. */
  785. struct fcoe_pend_wq_cqe {
  786. __le16 wqe;
  787. #define FCOE_PEND_WQ_CQE_TASK_ID (0x3FFF<<0)
  788. #define FCOE_PEND_WQ_CQE_TASK_ID_SHIFT 0
  789. #define FCOE_PEND_WQ_CQE_CQE_TYPE (0x1<<14)
  790. #define FCOE_PEND_WQ_CQE_CQE_TYPE_SHIFT 14
  791. #define FCOE_PEND_WQ_CQE_TOGGLE_BIT (0x1<<15)
  792. #define FCOE_PEND_WQ_CQE_TOGGLE_BIT_SHIFT 15
  793. };
  794. /*
  795. * FCoE RX statistics parameters section#0 $$KEEP_ENDIANNESS$$
  796. */
  797. struct fcoe_rx_stat_params_section0 {
  798. __le32 fcoe_rx_pkt_cnt;
  799. __le32 fcoe_rx_byte_cnt;
  800. };
  801. /*
  802. * FCoE RX statistics parameters section#1 $$KEEP_ENDIANNESS$$
  803. */
  804. struct fcoe_rx_stat_params_section1 {
  805. __le32 fcoe_ver_cnt;
  806. __le32 fcoe_rx_drop_pkt_cnt;
  807. };
  808. /*
  809. * FCoE RX statistics parameters section#2 $$KEEP_ENDIANNESS$$
  810. */
  811. struct fcoe_rx_stat_params_section2 {
  812. __le32 fc_crc_cnt;
  813. __le32 eofa_del_cnt;
  814. __le32 miss_frame_cnt;
  815. __le32 seq_timeout_cnt;
  816. __le32 drop_seq_cnt;
  817. __le32 fcoe_rx_drop_pkt_cnt;
  818. __le32 fcp_rx_pkt_cnt;
  819. __le32 reserved0;
  820. };
  821. /*
  822. * FCoE TX statistics parameters $$KEEP_ENDIANNESS$$
  823. */
  824. struct fcoe_tx_stat_params {
  825. __le32 fcoe_tx_pkt_cnt;
  826. __le32 fcoe_tx_byte_cnt;
  827. __le32 fcp_tx_pkt_cnt;
  828. __le32 reserved0;
  829. };
  830. /*
  831. * FCoE statistics parameters $$KEEP_ENDIANNESS$$
  832. */
  833. struct fcoe_statistics_params {
  834. struct fcoe_tx_stat_params tx_stat;
  835. struct fcoe_rx_stat_params_section0 rx_stat0;
  836. struct fcoe_rx_stat_params_section1 rx_stat1;
  837. struct fcoe_rx_stat_params_section2 rx_stat2;
  838. };
  839. /*
  840. * FCoE t2 hash table entry (64 bytes) $$KEEP_ENDIANNESS$$
  841. */
  842. struct fcoe_t2_hash_table_entry {
  843. struct fcoe_hash_table_entry data;
  844. struct regpair next;
  845. struct regpair reserved0[3];
  846. };
  847. /*
  848. * FCoE unsolicited CQE $$KEEP_ENDIANNESS$$
  849. */
  850. struct fcoe_unsolicited_cqe {
  851. __le16 wqe;
  852. #define FCOE_UNSOLICITED_CQE_SUBTYPE (0x3<<0)
  853. #define FCOE_UNSOLICITED_CQE_SUBTYPE_SHIFT 0
  854. #define FCOE_UNSOLICITED_CQE_PKT_LEN (0xFFF<<2)
  855. #define FCOE_UNSOLICITED_CQE_PKT_LEN_SHIFT 2
  856. #define FCOE_UNSOLICITED_CQE_CQE_TYPE (0x1<<14)
  857. #define FCOE_UNSOLICITED_CQE_CQE_TYPE_SHIFT 14
  858. #define FCOE_UNSOLICITED_CQE_TOGGLE_BIT (0x1<<15)
  859. #define FCOE_UNSOLICITED_CQE_TOGGLE_BIT_SHIFT 15
  860. };
  861. #endif /* __57XX_FCOE_HSI_LINUX_LE__ */