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