57xx_iscsi_hsi.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527
  1. /* 57xx_iscsi_hsi.h: QLogic NetXtreme II iSCSI HSI.
  2. *
  3. * Copyright (c) 2006 - 2013 Broadcom Corporation
  4. * Copyright (c) 2014, QLogic Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation.
  9. *
  10. * Written by: Anil Veerabhadrappa (anilgv@broadcom.com)
  11. * Previously Maintained by: Eddie Wai (eddie.wai@broadcom.com)
  12. * Maintained by: QLogic-Storage-Upstream@qlogic.com
  13. */
  14. #ifndef __57XX_ISCSI_HSI_LINUX_LE__
  15. #define __57XX_ISCSI_HSI_LINUX_LE__
  16. /*
  17. * iSCSI Async CQE
  18. */
  19. struct bnx2i_async_msg {
  20. #if defined(__BIG_ENDIAN)
  21. u8 op_code;
  22. u8 reserved1;
  23. u16 reserved0;
  24. #elif defined(__LITTLE_ENDIAN)
  25. u16 reserved0;
  26. u8 reserved1;
  27. u8 op_code;
  28. #endif
  29. u32 reserved2;
  30. u32 exp_cmd_sn;
  31. u32 max_cmd_sn;
  32. u32 reserved3[2];
  33. #if defined(__BIG_ENDIAN)
  34. u16 reserved5;
  35. u8 err_code;
  36. u8 reserved4;
  37. #elif defined(__LITTLE_ENDIAN)
  38. u8 reserved4;
  39. u8 err_code;
  40. u16 reserved5;
  41. #endif
  42. u32 reserved6;
  43. u32 lun[2];
  44. #if defined(__BIG_ENDIAN)
  45. u8 async_event;
  46. u8 async_vcode;
  47. u16 param1;
  48. #elif defined(__LITTLE_ENDIAN)
  49. u16 param1;
  50. u8 async_vcode;
  51. u8 async_event;
  52. #endif
  53. #if defined(__BIG_ENDIAN)
  54. u16 param2;
  55. u16 param3;
  56. #elif defined(__LITTLE_ENDIAN)
  57. u16 param3;
  58. u16 param2;
  59. #endif
  60. u32 reserved7[3];
  61. u32 cq_req_sn;
  62. };
  63. /*
  64. * iSCSI Buffer Descriptor (BD)
  65. */
  66. struct iscsi_bd {
  67. u32 buffer_addr_hi;
  68. u32 buffer_addr_lo;
  69. #if defined(__BIG_ENDIAN)
  70. u16 reserved0;
  71. u16 buffer_length;
  72. #elif defined(__LITTLE_ENDIAN)
  73. u16 buffer_length;
  74. u16 reserved0;
  75. #endif
  76. #if defined(__BIG_ENDIAN)
  77. u16 reserved3;
  78. u16 flags;
  79. #define ISCSI_BD_RESERVED1 (0x3F<<0)
  80. #define ISCSI_BD_RESERVED1_SHIFT 0
  81. #define ISCSI_BD_LAST_IN_BD_CHAIN (0x1<<6)
  82. #define ISCSI_BD_LAST_IN_BD_CHAIN_SHIFT 6
  83. #define ISCSI_BD_FIRST_IN_BD_CHAIN (0x1<<7)
  84. #define ISCSI_BD_FIRST_IN_BD_CHAIN_SHIFT 7
  85. #define ISCSI_BD_RESERVED2 (0xFF<<8)
  86. #define ISCSI_BD_RESERVED2_SHIFT 8
  87. #elif defined(__LITTLE_ENDIAN)
  88. u16 flags;
  89. #define ISCSI_BD_RESERVED1 (0x3F<<0)
  90. #define ISCSI_BD_RESERVED1_SHIFT 0
  91. #define ISCSI_BD_LAST_IN_BD_CHAIN (0x1<<6)
  92. #define ISCSI_BD_LAST_IN_BD_CHAIN_SHIFT 6
  93. #define ISCSI_BD_FIRST_IN_BD_CHAIN (0x1<<7)
  94. #define ISCSI_BD_FIRST_IN_BD_CHAIN_SHIFT 7
  95. #define ISCSI_BD_RESERVED2 (0xFF<<8)
  96. #define ISCSI_BD_RESERVED2_SHIFT 8
  97. u16 reserved3;
  98. #endif
  99. };
  100. /*
  101. * iSCSI Cleanup SQ WQE
  102. */
  103. struct bnx2i_cleanup_request {
  104. #if defined(__BIG_ENDIAN)
  105. u8 op_code;
  106. u8 reserved1;
  107. u16 reserved0;
  108. #elif defined(__LITTLE_ENDIAN)
  109. u16 reserved0;
  110. u8 reserved1;
  111. u8 op_code;
  112. #endif
  113. u32 reserved2[3];
  114. #if defined(__BIG_ENDIAN)
  115. u16 reserved3;
  116. u16 itt;
  117. #define ISCSI_CLEANUP_REQUEST_INDEX (0x3FFF<<0)
  118. #define ISCSI_CLEANUP_REQUEST_INDEX_SHIFT 0
  119. #define ISCSI_CLEANUP_REQUEST_TYPE (0x3<<14)
  120. #define ISCSI_CLEANUP_REQUEST_TYPE_SHIFT 14
  121. #elif defined(__LITTLE_ENDIAN)
  122. u16 itt;
  123. #define ISCSI_CLEANUP_REQUEST_INDEX (0x3FFF<<0)
  124. #define ISCSI_CLEANUP_REQUEST_INDEX_SHIFT 0
  125. #define ISCSI_CLEANUP_REQUEST_TYPE (0x3<<14)
  126. #define ISCSI_CLEANUP_REQUEST_TYPE_SHIFT 14
  127. u16 reserved3;
  128. #endif
  129. u32 reserved4[10];
  130. #if defined(__BIG_ENDIAN)
  131. u8 cq_index;
  132. u8 reserved6;
  133. u16 reserved5;
  134. #elif defined(__LITTLE_ENDIAN)
  135. u16 reserved5;
  136. u8 reserved6;
  137. u8 cq_index;
  138. #endif
  139. };
  140. /*
  141. * iSCSI Cleanup CQE
  142. */
  143. struct bnx2i_cleanup_response {
  144. #if defined(__BIG_ENDIAN)
  145. u8 op_code;
  146. u8 status;
  147. u16 reserved0;
  148. #elif defined(__LITTLE_ENDIAN)
  149. u16 reserved0;
  150. u8 status;
  151. u8 op_code;
  152. #endif
  153. u32 reserved1[3];
  154. u32 reserved2[2];
  155. #if defined(__BIG_ENDIAN)
  156. u16 reserved4;
  157. u8 err_code;
  158. u8 reserved3;
  159. #elif defined(__LITTLE_ENDIAN)
  160. u8 reserved3;
  161. u8 err_code;
  162. u16 reserved4;
  163. #endif
  164. u32 reserved5[7];
  165. #if defined(__BIG_ENDIAN)
  166. u16 reserved6;
  167. u16 itt;
  168. #define ISCSI_CLEANUP_RESPONSE_INDEX (0x3FFF<<0)
  169. #define ISCSI_CLEANUP_RESPONSE_INDEX_SHIFT 0
  170. #define ISCSI_CLEANUP_RESPONSE_TYPE (0x3<<14)
  171. #define ISCSI_CLEANUP_RESPONSE_TYPE_SHIFT 14
  172. #elif defined(__LITTLE_ENDIAN)
  173. u16 itt;
  174. #define ISCSI_CLEANUP_RESPONSE_INDEX (0x3FFF<<0)
  175. #define ISCSI_CLEANUP_RESPONSE_INDEX_SHIFT 0
  176. #define ISCSI_CLEANUP_RESPONSE_TYPE (0x3<<14)
  177. #define ISCSI_CLEANUP_RESPONSE_TYPE_SHIFT 14
  178. u16 reserved6;
  179. #endif
  180. u32 cq_req_sn;
  181. };
  182. /*
  183. * SCSI read/write SQ WQE
  184. */
  185. struct bnx2i_cmd_request {
  186. #if defined(__BIG_ENDIAN)
  187. u8 op_code;
  188. u8 op_attr;
  189. #define ISCSI_CMD_REQUEST_TASK_ATTR (0x7<<0)
  190. #define ISCSI_CMD_REQUEST_TASK_ATTR_SHIFT 0
  191. #define ISCSI_CMD_REQUEST_RESERVED1 (0x3<<3)
  192. #define ISCSI_CMD_REQUEST_RESERVED1_SHIFT 3
  193. #define ISCSI_CMD_REQUEST_WRITE (0x1<<5)
  194. #define ISCSI_CMD_REQUEST_WRITE_SHIFT 5
  195. #define ISCSI_CMD_REQUEST_READ (0x1<<6)
  196. #define ISCSI_CMD_REQUEST_READ_SHIFT 6
  197. #define ISCSI_CMD_REQUEST_FINAL (0x1<<7)
  198. #define ISCSI_CMD_REQUEST_FINAL_SHIFT 7
  199. u16 reserved0;
  200. #elif defined(__LITTLE_ENDIAN)
  201. u16 reserved0;
  202. u8 op_attr;
  203. #define ISCSI_CMD_REQUEST_TASK_ATTR (0x7<<0)
  204. #define ISCSI_CMD_REQUEST_TASK_ATTR_SHIFT 0
  205. #define ISCSI_CMD_REQUEST_RESERVED1 (0x3<<3)
  206. #define ISCSI_CMD_REQUEST_RESERVED1_SHIFT 3
  207. #define ISCSI_CMD_REQUEST_WRITE (0x1<<5)
  208. #define ISCSI_CMD_REQUEST_WRITE_SHIFT 5
  209. #define ISCSI_CMD_REQUEST_READ (0x1<<6)
  210. #define ISCSI_CMD_REQUEST_READ_SHIFT 6
  211. #define ISCSI_CMD_REQUEST_FINAL (0x1<<7)
  212. #define ISCSI_CMD_REQUEST_FINAL_SHIFT 7
  213. u8 op_code;
  214. #endif
  215. #if defined(__BIG_ENDIAN)
  216. u16 ud_buffer_offset;
  217. u16 sd_buffer_offset;
  218. #elif defined(__LITTLE_ENDIAN)
  219. u16 sd_buffer_offset;
  220. u16 ud_buffer_offset;
  221. #endif
  222. u32 lun[2];
  223. #if defined(__BIG_ENDIAN)
  224. u16 reserved2;
  225. u16 itt;
  226. #define ISCSI_CMD_REQUEST_INDEX (0x3FFF<<0)
  227. #define ISCSI_CMD_REQUEST_INDEX_SHIFT 0
  228. #define ISCSI_CMD_REQUEST_TYPE (0x3<<14)
  229. #define ISCSI_CMD_REQUEST_TYPE_SHIFT 14
  230. #elif defined(__LITTLE_ENDIAN)
  231. u16 itt;
  232. #define ISCSI_CMD_REQUEST_INDEX (0x3FFF<<0)
  233. #define ISCSI_CMD_REQUEST_INDEX_SHIFT 0
  234. #define ISCSI_CMD_REQUEST_TYPE (0x3<<14)
  235. #define ISCSI_CMD_REQUEST_TYPE_SHIFT 14
  236. u16 reserved2;
  237. #endif
  238. u32 total_data_transfer_length;
  239. u32 cmd_sn;
  240. u32 reserved3;
  241. u32 cdb[4];
  242. u32 zero_fill;
  243. u32 bd_list_addr_lo;
  244. u32 bd_list_addr_hi;
  245. #if defined(__BIG_ENDIAN)
  246. u8 cq_index;
  247. u8 sd_start_bd_index;
  248. u8 ud_start_bd_index;
  249. u8 num_bds;
  250. #elif defined(__LITTLE_ENDIAN)
  251. u8 num_bds;
  252. u8 ud_start_bd_index;
  253. u8 sd_start_bd_index;
  254. u8 cq_index;
  255. #endif
  256. };
  257. /*
  258. * task statistics for write response
  259. */
  260. struct bnx2i_write_resp_task_stat {
  261. #if defined(__BIG_ENDIAN)
  262. u16 num_r2ts;
  263. u16 num_data_outs;
  264. #elif defined(__LITTLE_ENDIAN)
  265. u16 num_data_outs;
  266. u16 num_r2ts;
  267. #endif
  268. };
  269. /*
  270. * task statistics for read response
  271. */
  272. struct bnx2i_read_resp_task_stat {
  273. #if defined(__BIG_ENDIAN)
  274. u16 reserved;
  275. u16 num_data_ins;
  276. #elif defined(__LITTLE_ENDIAN)
  277. u16 num_data_ins;
  278. u16 reserved;
  279. #endif
  280. };
  281. /*
  282. * task statistics for iSCSI cmd response
  283. */
  284. union bnx2i_cmd_resp_task_stat {
  285. struct bnx2i_write_resp_task_stat write_stat;
  286. struct bnx2i_read_resp_task_stat read_stat;
  287. };
  288. /*
  289. * SCSI Command CQE
  290. */
  291. struct bnx2i_cmd_response {
  292. #if defined(__BIG_ENDIAN)
  293. u8 op_code;
  294. u8 response_flags;
  295. #define ISCSI_CMD_RESPONSE_RESERVED0 (0x1<<0)
  296. #define ISCSI_CMD_RESPONSE_RESERVED0_SHIFT 0
  297. #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW (0x1<<1)
  298. #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW_SHIFT 1
  299. #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW (0x1<<2)
  300. #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW_SHIFT 2
  301. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW (0x1<<3)
  302. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW_SHIFT 3
  303. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW (0x1<<4)
  304. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW_SHIFT 4
  305. #define ISCSI_CMD_RESPONSE_RESERVED1 (0x7<<5)
  306. #define ISCSI_CMD_RESPONSE_RESERVED1_SHIFT 5
  307. u8 response;
  308. u8 status;
  309. #elif defined(__LITTLE_ENDIAN)
  310. u8 status;
  311. u8 response;
  312. u8 response_flags;
  313. #define ISCSI_CMD_RESPONSE_RESERVED0 (0x1<<0)
  314. #define ISCSI_CMD_RESPONSE_RESERVED0_SHIFT 0
  315. #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW (0x1<<1)
  316. #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW_SHIFT 1
  317. #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW (0x1<<2)
  318. #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW_SHIFT 2
  319. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW (0x1<<3)
  320. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW_SHIFT 3
  321. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW (0x1<<4)
  322. #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW_SHIFT 4
  323. #define ISCSI_CMD_RESPONSE_RESERVED1 (0x7<<5)
  324. #define ISCSI_CMD_RESPONSE_RESERVED1_SHIFT 5
  325. u8 op_code;
  326. #endif
  327. u32 data_length;
  328. u32 exp_cmd_sn;
  329. u32 max_cmd_sn;
  330. u32 reserved2;
  331. u32 residual_count;
  332. #if defined(__BIG_ENDIAN)
  333. u16 reserved4;
  334. u8 err_code;
  335. u8 reserved3;
  336. #elif defined(__LITTLE_ENDIAN)
  337. u8 reserved3;
  338. u8 err_code;
  339. u16 reserved4;
  340. #endif
  341. u32 reserved5[5];
  342. union bnx2i_cmd_resp_task_stat task_stat;
  343. u32 reserved6;
  344. #if defined(__BIG_ENDIAN)
  345. u16 reserved7;
  346. u16 itt;
  347. #define ISCSI_CMD_RESPONSE_INDEX (0x3FFF<<0)
  348. #define ISCSI_CMD_RESPONSE_INDEX_SHIFT 0
  349. #define ISCSI_CMD_RESPONSE_TYPE (0x3<<14)
  350. #define ISCSI_CMD_RESPONSE_TYPE_SHIFT 14
  351. #elif defined(__LITTLE_ENDIAN)
  352. u16 itt;
  353. #define ISCSI_CMD_RESPONSE_INDEX (0x3FFF<<0)
  354. #define ISCSI_CMD_RESPONSE_INDEX_SHIFT 0
  355. #define ISCSI_CMD_RESPONSE_TYPE (0x3<<14)
  356. #define ISCSI_CMD_RESPONSE_TYPE_SHIFT 14
  357. u16 reserved7;
  358. #endif
  359. u32 cq_req_sn;
  360. };
  361. /*
  362. * firmware middle-path request SQ WQE
  363. */
  364. struct bnx2i_fw_mp_request {
  365. #if defined(__BIG_ENDIAN)
  366. u8 op_code;
  367. u8 op_attr;
  368. u16 hdr_opaque1;
  369. #elif defined(__LITTLE_ENDIAN)
  370. u16 hdr_opaque1;
  371. u8 op_attr;
  372. u8 op_code;
  373. #endif
  374. u32 data_length;
  375. u32 hdr_opaque2[2];
  376. #if defined(__BIG_ENDIAN)
  377. u16 reserved0;
  378. u16 itt;
  379. #define ISCSI_FW_MP_REQUEST_INDEX (0x3FFF<<0)
  380. #define ISCSI_FW_MP_REQUEST_INDEX_SHIFT 0
  381. #define ISCSI_FW_MP_REQUEST_TYPE (0x3<<14)
  382. #define ISCSI_FW_MP_REQUEST_TYPE_SHIFT 14
  383. #elif defined(__LITTLE_ENDIAN)
  384. u16 itt;
  385. #define ISCSI_FW_MP_REQUEST_INDEX (0x3FFF<<0)
  386. #define ISCSI_FW_MP_REQUEST_INDEX_SHIFT 0
  387. #define ISCSI_FW_MP_REQUEST_TYPE (0x3<<14)
  388. #define ISCSI_FW_MP_REQUEST_TYPE_SHIFT 14
  389. u16 reserved0;
  390. #endif
  391. u32 hdr_opaque3[4];
  392. u32 resp_bd_list_addr_lo;
  393. u32 resp_bd_list_addr_hi;
  394. u32 resp_buffer;
  395. #define ISCSI_FW_MP_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
  396. #define ISCSI_FW_MP_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
  397. #define ISCSI_FW_MP_REQUEST_NUM_RESP_BDS (0xFF<<24)
  398. #define ISCSI_FW_MP_REQUEST_NUM_RESP_BDS_SHIFT 24
  399. #if defined(__BIG_ENDIAN)
  400. u16 reserved4;
  401. u8 reserved3;
  402. u8 flags;
  403. #define ISCSI_FW_MP_REQUEST_RESERVED1 (0x1<<0)
  404. #define ISCSI_FW_MP_REQUEST_RESERVED1_SHIFT 0
  405. #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION (0x1<<1)
  406. #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION_SHIFT 1
  407. #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
  408. #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
  409. #define ISCSI_FW_MP_REQUEST_RESERVED2 (0x1F<<3)
  410. #define ISCSI_FW_MP_REQUEST_RESERVED2_SHIFT 3
  411. #elif defined(__LITTLE_ENDIAN)
  412. u8 flags;
  413. #define ISCSI_FW_MP_REQUEST_RESERVED1 (0x1<<0)
  414. #define ISCSI_FW_MP_REQUEST_RESERVED1_SHIFT 0
  415. #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION (0x1<<1)
  416. #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION_SHIFT 1
  417. #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
  418. #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
  419. #define ISCSI_FW_MP_REQUEST_RESERVED2 (0x1F<<3)
  420. #define ISCSI_FW_MP_REQUEST_RESERVED2_SHIFT 3
  421. u8 reserved3;
  422. u16 reserved4;
  423. #endif
  424. u32 bd_list_addr_lo;
  425. u32 bd_list_addr_hi;
  426. #if defined(__BIG_ENDIAN)
  427. u8 cq_index;
  428. u8 reserved6;
  429. u8 reserved5;
  430. u8 num_bds;
  431. #elif defined(__LITTLE_ENDIAN)
  432. u8 num_bds;
  433. u8 reserved5;
  434. u8 reserved6;
  435. u8 cq_index;
  436. #endif
  437. };
  438. /*
  439. * firmware response - CQE: used only by firmware
  440. */
  441. struct bnx2i_fw_response {
  442. u32 hdr_dword1[2];
  443. u32 hdr_exp_cmd_sn;
  444. u32 hdr_max_cmd_sn;
  445. u32 hdr_ttt;
  446. u32 hdr_res_cnt;
  447. u32 cqe_flags;
  448. #define ISCSI_FW_RESPONSE_RESERVED2 (0xFF<<0)
  449. #define ISCSI_FW_RESPONSE_RESERVED2_SHIFT 0
  450. #define ISCSI_FW_RESPONSE_ERR_CODE (0xFF<<8)
  451. #define ISCSI_FW_RESPONSE_ERR_CODE_SHIFT 8
  452. #define ISCSI_FW_RESPONSE_RESERVED3 (0xFFFF<<16)
  453. #define ISCSI_FW_RESPONSE_RESERVED3_SHIFT 16
  454. u32 stat_sn;
  455. u32 hdr_dword2[2];
  456. u32 hdr_dword3[2];
  457. u32 task_stat;
  458. u32 reserved0;
  459. u32 hdr_itt;
  460. u32 cq_req_sn;
  461. };
  462. /*
  463. * iSCSI KCQ CQE parameters
  464. */
  465. union iscsi_kcqe_params {
  466. u32 reserved0[4];
  467. };
  468. /*
  469. * iSCSI KCQ CQE
  470. */
  471. struct iscsi_kcqe {
  472. u32 iscsi_conn_id;
  473. u32 completion_status;
  474. u32 iscsi_conn_context_id;
  475. union iscsi_kcqe_params params;
  476. #if defined(__BIG_ENDIAN)
  477. u8 flags;
  478. #define ISCSI_KCQE_RESERVED0 (0xF<<0)
  479. #define ISCSI_KCQE_RESERVED0_SHIFT 0
  480. #define ISCSI_KCQE_LAYER_CODE (0x7<<4)
  481. #define ISCSI_KCQE_LAYER_CODE_SHIFT 4
  482. #define ISCSI_KCQE_RESERVED1 (0x1<<7)
  483. #define ISCSI_KCQE_RESERVED1_SHIFT 7
  484. u8 op_code;
  485. u16 qe_self_seq;
  486. #elif defined(__LITTLE_ENDIAN)
  487. u16 qe_self_seq;
  488. u8 op_code;
  489. u8 flags;
  490. #define ISCSI_KCQE_RESERVED0 (0xF<<0)
  491. #define ISCSI_KCQE_RESERVED0_SHIFT 0
  492. #define ISCSI_KCQE_LAYER_CODE (0x7<<4)
  493. #define ISCSI_KCQE_LAYER_CODE_SHIFT 4
  494. #define ISCSI_KCQE_RESERVED1 (0x1<<7)
  495. #define ISCSI_KCQE_RESERVED1_SHIFT 7
  496. #endif
  497. };
  498. /*
  499. * iSCSI KWQE header
  500. */
  501. struct iscsi_kwqe_header {
  502. #if defined(__BIG_ENDIAN)
  503. u8 flags;
  504. #define ISCSI_KWQE_HEADER_RESERVED0 (0xF<<0)
  505. #define ISCSI_KWQE_HEADER_RESERVED0_SHIFT 0
  506. #define ISCSI_KWQE_HEADER_LAYER_CODE (0x7<<4)
  507. #define ISCSI_KWQE_HEADER_LAYER_CODE_SHIFT 4
  508. #define ISCSI_KWQE_HEADER_RESERVED1 (0x1<<7)
  509. #define ISCSI_KWQE_HEADER_RESERVED1_SHIFT 7
  510. u8 op_code;
  511. #elif defined(__LITTLE_ENDIAN)
  512. u8 op_code;
  513. u8 flags;
  514. #define ISCSI_KWQE_HEADER_RESERVED0 (0xF<<0)
  515. #define ISCSI_KWQE_HEADER_RESERVED0_SHIFT 0
  516. #define ISCSI_KWQE_HEADER_LAYER_CODE (0x7<<4)
  517. #define ISCSI_KWQE_HEADER_LAYER_CODE_SHIFT 4
  518. #define ISCSI_KWQE_HEADER_RESERVED1 (0x1<<7)
  519. #define ISCSI_KWQE_HEADER_RESERVED1_SHIFT 7
  520. #endif
  521. };
  522. /*
  523. * iSCSI firmware init request 1
  524. */
  525. struct iscsi_kwqe_init1 {
  526. #if defined(__BIG_ENDIAN)
  527. struct iscsi_kwqe_header hdr;
  528. u8 reserved0;
  529. u8 num_cqs;
  530. #elif defined(__LITTLE_ENDIAN)
  531. u8 num_cqs;
  532. u8 reserved0;
  533. struct iscsi_kwqe_header hdr;
  534. #endif
  535. u32 dummy_buffer_addr_lo;
  536. u32 dummy_buffer_addr_hi;
  537. #if defined(__BIG_ENDIAN)
  538. u16 num_ccells_per_conn;
  539. u16 num_tasks_per_conn;
  540. #elif defined(__LITTLE_ENDIAN)
  541. u16 num_tasks_per_conn;
  542. u16 num_ccells_per_conn;
  543. #endif
  544. #if defined(__BIG_ENDIAN)
  545. u16 sq_wqes_per_page;
  546. u16 sq_num_wqes;
  547. #elif defined(__LITTLE_ENDIAN)
  548. u16 sq_num_wqes;
  549. u16 sq_wqes_per_page;
  550. #endif
  551. #if defined(__BIG_ENDIAN)
  552. u8 cq_log_wqes_per_page;
  553. u8 flags;
  554. #define ISCSI_KWQE_INIT1_PAGE_SIZE (0xF<<0)
  555. #define ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT 0
  556. #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE (0x1<<4)
  557. #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
  558. #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
  559. #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
  560. #define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE (0x1<<6)
  561. #define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE_SHIFT 6
  562. #define ISCSI_KWQE_INIT1_RESERVED1 (0x1<<7)
  563. #define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 7
  564. u16 cq_num_wqes;
  565. #elif defined(__LITTLE_ENDIAN)
  566. u16 cq_num_wqes;
  567. u8 flags;
  568. #define ISCSI_KWQE_INIT1_PAGE_SIZE (0xF<<0)
  569. #define ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT 0
  570. #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE (0x1<<4)
  571. #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
  572. #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
  573. #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
  574. #define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE (0x1<<6)
  575. #define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE_SHIFT 6
  576. #define ISCSI_KWQE_INIT1_RESERVED1 (0x1<<7)
  577. #define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 7
  578. u8 cq_log_wqes_per_page;
  579. #endif
  580. #if defined(__BIG_ENDIAN)
  581. u16 cq_num_pages;
  582. u16 sq_num_pages;
  583. #elif defined(__LITTLE_ENDIAN)
  584. u16 sq_num_pages;
  585. u16 cq_num_pages;
  586. #endif
  587. #if defined(__BIG_ENDIAN)
  588. u16 rq_buffer_size;
  589. u16 rq_num_wqes;
  590. #elif defined(__LITTLE_ENDIAN)
  591. u16 rq_num_wqes;
  592. u16 rq_buffer_size;
  593. #endif
  594. };
  595. /*
  596. * iSCSI firmware init request 2
  597. */
  598. struct iscsi_kwqe_init2 {
  599. #if defined(__BIG_ENDIAN)
  600. struct iscsi_kwqe_header hdr;
  601. u16 max_cq_sqn;
  602. #elif defined(__LITTLE_ENDIAN)
  603. u16 max_cq_sqn;
  604. struct iscsi_kwqe_header hdr;
  605. #endif
  606. u32 error_bit_map[2];
  607. u32 reserved1[5];
  608. };
  609. /*
  610. * Initial iSCSI connection offload request 1
  611. */
  612. struct iscsi_kwqe_conn_offload1 {
  613. #if defined(__BIG_ENDIAN)
  614. struct iscsi_kwqe_header hdr;
  615. u16 iscsi_conn_id;
  616. #elif defined(__LITTLE_ENDIAN)
  617. u16 iscsi_conn_id;
  618. struct iscsi_kwqe_header hdr;
  619. #endif
  620. u32 sq_page_table_addr_lo;
  621. u32 sq_page_table_addr_hi;
  622. u32 cq_page_table_addr_lo;
  623. u32 cq_page_table_addr_hi;
  624. u32 reserved0[3];
  625. };
  626. /*
  627. * iSCSI Page Table Entry (PTE)
  628. */
  629. struct iscsi_pte {
  630. u32 hi;
  631. u32 lo;
  632. };
  633. /*
  634. * Initial iSCSI connection offload request 2
  635. */
  636. struct iscsi_kwqe_conn_offload2 {
  637. #if defined(__BIG_ENDIAN)
  638. struct iscsi_kwqe_header hdr;
  639. u16 reserved0;
  640. #elif defined(__LITTLE_ENDIAN)
  641. u16 reserved0;
  642. struct iscsi_kwqe_header hdr;
  643. #endif
  644. u32 rq_page_table_addr_lo;
  645. u32 rq_page_table_addr_hi;
  646. struct iscsi_pte sq_first_pte;
  647. struct iscsi_pte cq_first_pte;
  648. u32 num_additional_wqes;
  649. };
  650. /*
  651. * Initial iSCSI connection offload request 3
  652. */
  653. struct iscsi_kwqe_conn_offload3 {
  654. #if defined(__BIG_ENDIAN)
  655. struct iscsi_kwqe_header hdr;
  656. u16 reserved0;
  657. #elif defined(__LITTLE_ENDIAN)
  658. u16 reserved0;
  659. struct iscsi_kwqe_header hdr;
  660. #endif
  661. u32 reserved1;
  662. struct iscsi_pte qp_first_pte[3];
  663. };
  664. /*
  665. * iSCSI connection update request
  666. */
  667. struct iscsi_kwqe_conn_update {
  668. #if defined(__BIG_ENDIAN)
  669. struct iscsi_kwqe_header hdr;
  670. u16 reserved0;
  671. #elif defined(__LITTLE_ENDIAN)
  672. u16 reserved0;
  673. struct iscsi_kwqe_header hdr;
  674. #endif
  675. #if defined(__BIG_ENDIAN)
  676. u8 session_error_recovery_level;
  677. u8 max_outstanding_r2ts;
  678. u8 reserved2;
  679. u8 conn_flags;
  680. #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST (0x1<<0)
  681. #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST_SHIFT 0
  682. #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST (0x1<<1)
  683. #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST_SHIFT 1
  684. #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T (0x1<<2)
  685. #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T_SHIFT 2
  686. #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA (0x1<<3)
  687. #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA_SHIFT 3
  688. #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE (0x3<<4)
  689. #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE_SHIFT 4
  690. #define ISCSI_KWQE_CONN_UPDATE_RESERVED1 (0x3<<6)
  691. #define ISCSI_KWQE_CONN_UPDATE_RESERVED1_SHIFT 6
  692. #elif defined(__LITTLE_ENDIAN)
  693. u8 conn_flags;
  694. #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST (0x1<<0)
  695. #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST_SHIFT 0
  696. #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST (0x1<<1)
  697. #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST_SHIFT 1
  698. #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T (0x1<<2)
  699. #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T_SHIFT 2
  700. #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA (0x1<<3)
  701. #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA_SHIFT 3
  702. #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE (0x3<<4)
  703. #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE_SHIFT 4
  704. #define ISCSI_KWQE_CONN_UPDATE_RESERVED1 (0x3<<6)
  705. #define ISCSI_KWQE_CONN_UPDATE_RESERVED1_SHIFT 6
  706. u8 reserved2;
  707. u8 max_outstanding_r2ts;
  708. u8 session_error_recovery_level;
  709. #endif
  710. u32 context_id;
  711. u32 max_send_pdu_length;
  712. u32 max_recv_pdu_length;
  713. u32 first_burst_length;
  714. u32 max_burst_length;
  715. u32 exp_stat_sn;
  716. };
  717. /*
  718. * iSCSI destroy connection request
  719. */
  720. struct iscsi_kwqe_conn_destroy {
  721. #if defined(__BIG_ENDIAN)
  722. struct iscsi_kwqe_header hdr;
  723. u16 reserved0;
  724. #elif defined(__LITTLE_ENDIAN)
  725. u16 reserved0;
  726. struct iscsi_kwqe_header hdr;
  727. #endif
  728. u32 context_id;
  729. u32 reserved1[6];
  730. };
  731. /*
  732. * iSCSI KWQ WQE
  733. */
  734. union iscsi_kwqe {
  735. struct iscsi_kwqe_init1 init1;
  736. struct iscsi_kwqe_init2 init2;
  737. struct iscsi_kwqe_conn_offload1 conn_offload1;
  738. struct iscsi_kwqe_conn_offload2 conn_offload2;
  739. struct iscsi_kwqe_conn_update conn_update;
  740. struct iscsi_kwqe_conn_destroy conn_destroy;
  741. };
  742. /*
  743. * iSCSI Login SQ WQE
  744. */
  745. struct bnx2i_login_request {
  746. #if defined(__BIG_ENDIAN)
  747. u8 op_code;
  748. u8 op_attr;
  749. #define ISCSI_LOGIN_REQUEST_NEXT_STAGE (0x3<<0)
  750. #define ISCSI_LOGIN_REQUEST_NEXT_STAGE_SHIFT 0
  751. #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE (0x3<<2)
  752. #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE_SHIFT 2
  753. #define ISCSI_LOGIN_REQUEST_RESERVED0 (0x3<<4)
  754. #define ISCSI_LOGIN_REQUEST_RESERVED0_SHIFT 4
  755. #define ISCSI_LOGIN_REQUEST_CONT (0x1<<6)
  756. #define ISCSI_LOGIN_REQUEST_CONT_SHIFT 6
  757. #define ISCSI_LOGIN_REQUEST_TRANSIT (0x1<<7)
  758. #define ISCSI_LOGIN_REQUEST_TRANSIT_SHIFT 7
  759. u8 version_max;
  760. u8 version_min;
  761. #elif defined(__LITTLE_ENDIAN)
  762. u8 version_min;
  763. u8 version_max;
  764. u8 op_attr;
  765. #define ISCSI_LOGIN_REQUEST_NEXT_STAGE (0x3<<0)
  766. #define ISCSI_LOGIN_REQUEST_NEXT_STAGE_SHIFT 0
  767. #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE (0x3<<2)
  768. #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE_SHIFT 2
  769. #define ISCSI_LOGIN_REQUEST_RESERVED0 (0x3<<4)
  770. #define ISCSI_LOGIN_REQUEST_RESERVED0_SHIFT 4
  771. #define ISCSI_LOGIN_REQUEST_CONT (0x1<<6)
  772. #define ISCSI_LOGIN_REQUEST_CONT_SHIFT 6
  773. #define ISCSI_LOGIN_REQUEST_TRANSIT (0x1<<7)
  774. #define ISCSI_LOGIN_REQUEST_TRANSIT_SHIFT 7
  775. u8 op_code;
  776. #endif
  777. u32 data_length;
  778. u32 isid_lo;
  779. #if defined(__BIG_ENDIAN)
  780. u16 isid_hi;
  781. u16 tsih;
  782. #elif defined(__LITTLE_ENDIAN)
  783. u16 tsih;
  784. u16 isid_hi;
  785. #endif
  786. #if defined(__BIG_ENDIAN)
  787. u16 reserved2;
  788. u16 itt;
  789. #define ISCSI_LOGIN_REQUEST_INDEX (0x3FFF<<0)
  790. #define ISCSI_LOGIN_REQUEST_INDEX_SHIFT 0
  791. #define ISCSI_LOGIN_REQUEST_TYPE (0x3<<14)
  792. #define ISCSI_LOGIN_REQUEST_TYPE_SHIFT 14
  793. #elif defined(__LITTLE_ENDIAN)
  794. u16 itt;
  795. #define ISCSI_LOGIN_REQUEST_INDEX (0x3FFF<<0)
  796. #define ISCSI_LOGIN_REQUEST_INDEX_SHIFT 0
  797. #define ISCSI_LOGIN_REQUEST_TYPE (0x3<<14)
  798. #define ISCSI_LOGIN_REQUEST_TYPE_SHIFT 14
  799. u16 reserved2;
  800. #endif
  801. #if defined(__BIG_ENDIAN)
  802. u16 cid;
  803. u16 reserved3;
  804. #elif defined(__LITTLE_ENDIAN)
  805. u16 reserved3;
  806. u16 cid;
  807. #endif
  808. u32 cmd_sn;
  809. u32 exp_stat_sn;
  810. u32 reserved4;
  811. u32 resp_bd_list_addr_lo;
  812. u32 resp_bd_list_addr_hi;
  813. u32 resp_buffer;
  814. #define ISCSI_LOGIN_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
  815. #define ISCSI_LOGIN_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
  816. #define ISCSI_LOGIN_REQUEST_NUM_RESP_BDS (0xFF<<24)
  817. #define ISCSI_LOGIN_REQUEST_NUM_RESP_BDS_SHIFT 24
  818. #if defined(__BIG_ENDIAN)
  819. u16 reserved8;
  820. u8 reserved7;
  821. u8 flags;
  822. #define ISCSI_LOGIN_REQUEST_RESERVED5 (0x3<<0)
  823. #define ISCSI_LOGIN_REQUEST_RESERVED5_SHIFT 0
  824. #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
  825. #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
  826. #define ISCSI_LOGIN_REQUEST_RESERVED6 (0x1F<<3)
  827. #define ISCSI_LOGIN_REQUEST_RESERVED6_SHIFT 3
  828. #elif defined(__LITTLE_ENDIAN)
  829. u8 flags;
  830. #define ISCSI_LOGIN_REQUEST_RESERVED5 (0x3<<0)
  831. #define ISCSI_LOGIN_REQUEST_RESERVED5_SHIFT 0
  832. #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
  833. #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
  834. #define ISCSI_LOGIN_REQUEST_RESERVED6 (0x1F<<3)
  835. #define ISCSI_LOGIN_REQUEST_RESERVED6_SHIFT 3
  836. u8 reserved7;
  837. u16 reserved8;
  838. #endif
  839. u32 bd_list_addr_lo;
  840. u32 bd_list_addr_hi;
  841. #if defined(__BIG_ENDIAN)
  842. u8 cq_index;
  843. u8 reserved10;
  844. u8 reserved9;
  845. u8 num_bds;
  846. #elif defined(__LITTLE_ENDIAN)
  847. u8 num_bds;
  848. u8 reserved9;
  849. u8 reserved10;
  850. u8 cq_index;
  851. #endif
  852. };
  853. /*
  854. * iSCSI Login CQE
  855. */
  856. struct bnx2i_login_response {
  857. #if defined(__BIG_ENDIAN)
  858. u8 op_code;
  859. u8 response_flags;
  860. #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE (0x3<<0)
  861. #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE_SHIFT 0
  862. #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE (0x3<<2)
  863. #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE_SHIFT 2
  864. #define ISCSI_LOGIN_RESPONSE_RESERVED0 (0x3<<4)
  865. #define ISCSI_LOGIN_RESPONSE_RESERVED0_SHIFT 4
  866. #define ISCSI_LOGIN_RESPONSE_CONT (0x1<<6)
  867. #define ISCSI_LOGIN_RESPONSE_CONT_SHIFT 6
  868. #define ISCSI_LOGIN_RESPONSE_TRANSIT (0x1<<7)
  869. #define ISCSI_LOGIN_RESPONSE_TRANSIT_SHIFT 7
  870. u8 version_max;
  871. u8 version_active;
  872. #elif defined(__LITTLE_ENDIAN)
  873. u8 version_active;
  874. u8 version_max;
  875. u8 response_flags;
  876. #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE (0x3<<0)
  877. #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE_SHIFT 0
  878. #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE (0x3<<2)
  879. #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE_SHIFT 2
  880. #define ISCSI_LOGIN_RESPONSE_RESERVED0 (0x3<<4)
  881. #define ISCSI_LOGIN_RESPONSE_RESERVED0_SHIFT 4
  882. #define ISCSI_LOGIN_RESPONSE_CONT (0x1<<6)
  883. #define ISCSI_LOGIN_RESPONSE_CONT_SHIFT 6
  884. #define ISCSI_LOGIN_RESPONSE_TRANSIT (0x1<<7)
  885. #define ISCSI_LOGIN_RESPONSE_TRANSIT_SHIFT 7
  886. u8 op_code;
  887. #endif
  888. u32 data_length;
  889. u32 exp_cmd_sn;
  890. u32 max_cmd_sn;
  891. u32 reserved1[2];
  892. #if defined(__BIG_ENDIAN)
  893. u16 reserved3;
  894. u8 err_code;
  895. u8 reserved2;
  896. #elif defined(__LITTLE_ENDIAN)
  897. u8 reserved2;
  898. u8 err_code;
  899. u16 reserved3;
  900. #endif
  901. u32 stat_sn;
  902. u32 isid_lo;
  903. #if defined(__BIG_ENDIAN)
  904. u16 isid_hi;
  905. u16 tsih;
  906. #elif defined(__LITTLE_ENDIAN)
  907. u16 tsih;
  908. u16 isid_hi;
  909. #endif
  910. #if defined(__BIG_ENDIAN)
  911. u8 status_class;
  912. u8 status_detail;
  913. u16 reserved4;
  914. #elif defined(__LITTLE_ENDIAN)
  915. u16 reserved4;
  916. u8 status_detail;
  917. u8 status_class;
  918. #endif
  919. u32 reserved5[3];
  920. #if defined(__BIG_ENDIAN)
  921. u16 reserved6;
  922. u16 itt;
  923. #define ISCSI_LOGIN_RESPONSE_INDEX (0x3FFF<<0)
  924. #define ISCSI_LOGIN_RESPONSE_INDEX_SHIFT 0
  925. #define ISCSI_LOGIN_RESPONSE_TYPE (0x3<<14)
  926. #define ISCSI_LOGIN_RESPONSE_TYPE_SHIFT 14
  927. #elif defined(__LITTLE_ENDIAN)
  928. u16 itt;
  929. #define ISCSI_LOGIN_RESPONSE_INDEX (0x3FFF<<0)
  930. #define ISCSI_LOGIN_RESPONSE_INDEX_SHIFT 0
  931. #define ISCSI_LOGIN_RESPONSE_TYPE (0x3<<14)
  932. #define ISCSI_LOGIN_RESPONSE_TYPE_SHIFT 14
  933. u16 reserved6;
  934. #endif
  935. u32 cq_req_sn;
  936. };
  937. /*
  938. * iSCSI Logout SQ WQE
  939. */
  940. struct bnx2i_logout_request {
  941. #if defined(__BIG_ENDIAN)
  942. u8 op_code;
  943. u8 op_attr;
  944. #define ISCSI_LOGOUT_REQUEST_REASON (0x7F<<0)
  945. #define ISCSI_LOGOUT_REQUEST_REASON_SHIFT 0
  946. #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE (0x1<<7)
  947. #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE_SHIFT 7
  948. u16 reserved0;
  949. #elif defined(__LITTLE_ENDIAN)
  950. u16 reserved0;
  951. u8 op_attr;
  952. #define ISCSI_LOGOUT_REQUEST_REASON (0x7F<<0)
  953. #define ISCSI_LOGOUT_REQUEST_REASON_SHIFT 0
  954. #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE (0x1<<7)
  955. #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE_SHIFT 7
  956. u8 op_code;
  957. #endif
  958. u32 data_length;
  959. u32 reserved1[2];
  960. #if defined(__BIG_ENDIAN)
  961. u16 reserved2;
  962. u16 itt;
  963. #define ISCSI_LOGOUT_REQUEST_INDEX (0x3FFF<<0)
  964. #define ISCSI_LOGOUT_REQUEST_INDEX_SHIFT 0
  965. #define ISCSI_LOGOUT_REQUEST_TYPE (0x3<<14)
  966. #define ISCSI_LOGOUT_REQUEST_TYPE_SHIFT 14
  967. #elif defined(__LITTLE_ENDIAN)
  968. u16 itt;
  969. #define ISCSI_LOGOUT_REQUEST_INDEX (0x3FFF<<0)
  970. #define ISCSI_LOGOUT_REQUEST_INDEX_SHIFT 0
  971. #define ISCSI_LOGOUT_REQUEST_TYPE (0x3<<14)
  972. #define ISCSI_LOGOUT_REQUEST_TYPE_SHIFT 14
  973. u16 reserved2;
  974. #endif
  975. #if defined(__BIG_ENDIAN)
  976. u16 cid;
  977. u16 reserved3;
  978. #elif defined(__LITTLE_ENDIAN)
  979. u16 reserved3;
  980. u16 cid;
  981. #endif
  982. u32 cmd_sn;
  983. u32 reserved4[5];
  984. u32 zero_fill;
  985. u32 bd_list_addr_lo;
  986. u32 bd_list_addr_hi;
  987. #if defined(__BIG_ENDIAN)
  988. u8 cq_index;
  989. u8 reserved6;
  990. u8 reserved5;
  991. u8 num_bds;
  992. #elif defined(__LITTLE_ENDIAN)
  993. u8 num_bds;
  994. u8 reserved5;
  995. u8 reserved6;
  996. u8 cq_index;
  997. #endif
  998. };
  999. /*
  1000. * iSCSI Logout CQE
  1001. */
  1002. struct bnx2i_logout_response {
  1003. #if defined(__BIG_ENDIAN)
  1004. u8 op_code;
  1005. u8 reserved1;
  1006. u8 response;
  1007. u8 reserved0;
  1008. #elif defined(__LITTLE_ENDIAN)
  1009. u8 reserved0;
  1010. u8 response;
  1011. u8 reserved1;
  1012. u8 op_code;
  1013. #endif
  1014. u32 reserved2;
  1015. u32 exp_cmd_sn;
  1016. u32 max_cmd_sn;
  1017. u32 reserved3[2];
  1018. #if defined(__BIG_ENDIAN)
  1019. u16 reserved5;
  1020. u8 err_code;
  1021. u8 reserved4;
  1022. #elif defined(__LITTLE_ENDIAN)
  1023. u8 reserved4;
  1024. u8 err_code;
  1025. u16 reserved5;
  1026. #endif
  1027. u32 reserved6[3];
  1028. #if defined(__BIG_ENDIAN)
  1029. u16 time_to_wait;
  1030. u16 time_to_retain;
  1031. #elif defined(__LITTLE_ENDIAN)
  1032. u16 time_to_retain;
  1033. u16 time_to_wait;
  1034. #endif
  1035. u32 reserved7[3];
  1036. #if defined(__BIG_ENDIAN)
  1037. u16 reserved8;
  1038. u16 itt;
  1039. #define ISCSI_LOGOUT_RESPONSE_INDEX (0x3FFF<<0)
  1040. #define ISCSI_LOGOUT_RESPONSE_INDEX_SHIFT 0
  1041. #define ISCSI_LOGOUT_RESPONSE_TYPE (0x3<<14)
  1042. #define ISCSI_LOGOUT_RESPONSE_TYPE_SHIFT 14
  1043. #elif defined(__LITTLE_ENDIAN)
  1044. u16 itt;
  1045. #define ISCSI_LOGOUT_RESPONSE_INDEX (0x3FFF<<0)
  1046. #define ISCSI_LOGOUT_RESPONSE_INDEX_SHIFT 0
  1047. #define ISCSI_LOGOUT_RESPONSE_TYPE (0x3<<14)
  1048. #define ISCSI_LOGOUT_RESPONSE_TYPE_SHIFT 14
  1049. u16 reserved8;
  1050. #endif
  1051. u32 cq_req_sn;
  1052. };
  1053. /*
  1054. * iSCSI Nop-In CQE
  1055. */
  1056. struct bnx2i_nop_in_msg {
  1057. #if defined(__BIG_ENDIAN)
  1058. u8 op_code;
  1059. u8 reserved1;
  1060. u16 reserved0;
  1061. #elif defined(__LITTLE_ENDIAN)
  1062. u16 reserved0;
  1063. u8 reserved1;
  1064. u8 op_code;
  1065. #endif
  1066. u32 data_length;
  1067. u32 exp_cmd_sn;
  1068. u32 max_cmd_sn;
  1069. u32 ttt;
  1070. u32 reserved2;
  1071. #if defined(__BIG_ENDIAN)
  1072. u16 reserved4;
  1073. u8 err_code;
  1074. u8 reserved3;
  1075. #elif defined(__LITTLE_ENDIAN)
  1076. u8 reserved3;
  1077. u8 err_code;
  1078. u16 reserved4;
  1079. #endif
  1080. u32 reserved5;
  1081. u32 lun[2];
  1082. u32 reserved6[4];
  1083. #if defined(__BIG_ENDIAN)
  1084. u16 reserved7;
  1085. u16 itt;
  1086. #define ISCSI_NOP_IN_MSG_INDEX (0x3FFF<<0)
  1087. #define ISCSI_NOP_IN_MSG_INDEX_SHIFT 0
  1088. #define ISCSI_NOP_IN_MSG_TYPE (0x3<<14)
  1089. #define ISCSI_NOP_IN_MSG_TYPE_SHIFT 14
  1090. #elif defined(__LITTLE_ENDIAN)
  1091. u16 itt;
  1092. #define ISCSI_NOP_IN_MSG_INDEX (0x3FFF<<0)
  1093. #define ISCSI_NOP_IN_MSG_INDEX_SHIFT 0
  1094. #define ISCSI_NOP_IN_MSG_TYPE (0x3<<14)
  1095. #define ISCSI_NOP_IN_MSG_TYPE_SHIFT 14
  1096. u16 reserved7;
  1097. #endif
  1098. u32 cq_req_sn;
  1099. };
  1100. /*
  1101. * iSCSI NOP-OUT SQ WQE
  1102. */
  1103. struct bnx2i_nop_out_request {
  1104. #if defined(__BIG_ENDIAN)
  1105. u8 op_code;
  1106. u8 op_attr;
  1107. #define ISCSI_NOP_OUT_REQUEST_RESERVED1 (0x7F<<0)
  1108. #define ISCSI_NOP_OUT_REQUEST_RESERVED1_SHIFT 0
  1109. #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE (0x1<<7)
  1110. #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE_SHIFT 7
  1111. u16 reserved0;
  1112. #elif defined(__LITTLE_ENDIAN)
  1113. u16 reserved0;
  1114. u8 op_attr;
  1115. #define ISCSI_NOP_OUT_REQUEST_RESERVED1 (0x7F<<0)
  1116. #define ISCSI_NOP_OUT_REQUEST_RESERVED1_SHIFT 0
  1117. #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE (0x1<<7)
  1118. #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE_SHIFT 7
  1119. u8 op_code;
  1120. #endif
  1121. u32 data_length;
  1122. u32 lun[2];
  1123. #if defined(__BIG_ENDIAN)
  1124. u16 reserved2;
  1125. u16 itt;
  1126. #define ISCSI_NOP_OUT_REQUEST_INDEX (0x3FFF<<0)
  1127. #define ISCSI_NOP_OUT_REQUEST_INDEX_SHIFT 0
  1128. #define ISCSI_NOP_OUT_REQUEST_TYPE (0x3<<14)
  1129. #define ISCSI_NOP_OUT_REQUEST_TYPE_SHIFT 14
  1130. #elif defined(__LITTLE_ENDIAN)
  1131. u16 itt;
  1132. #define ISCSI_NOP_OUT_REQUEST_INDEX (0x3FFF<<0)
  1133. #define ISCSI_NOP_OUT_REQUEST_INDEX_SHIFT 0
  1134. #define ISCSI_NOP_OUT_REQUEST_TYPE (0x3<<14)
  1135. #define ISCSI_NOP_OUT_REQUEST_TYPE_SHIFT 14
  1136. u16 reserved2;
  1137. #endif
  1138. u32 ttt;
  1139. u32 cmd_sn;
  1140. u32 reserved3[2];
  1141. u32 resp_bd_list_addr_lo;
  1142. u32 resp_bd_list_addr_hi;
  1143. u32 resp_buffer;
  1144. #define ISCSI_NOP_OUT_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
  1145. #define ISCSI_NOP_OUT_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
  1146. #define ISCSI_NOP_OUT_REQUEST_NUM_RESP_BDS (0xFF<<24)
  1147. #define ISCSI_NOP_OUT_REQUEST_NUM_RESP_BDS_SHIFT 24
  1148. #if defined(__BIG_ENDIAN)
  1149. u16 reserved7;
  1150. u8 reserved6;
  1151. u8 flags;
  1152. #define ISCSI_NOP_OUT_REQUEST_RESERVED4 (0x1<<0)
  1153. #define ISCSI_NOP_OUT_REQUEST_RESERVED4_SHIFT 0
  1154. #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION (0x1<<1)
  1155. #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION_SHIFT 1
  1156. #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL (0x3F<<2)
  1157. #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL_SHIFT 2
  1158. #elif defined(__LITTLE_ENDIAN)
  1159. u8 flags;
  1160. #define ISCSI_NOP_OUT_REQUEST_RESERVED4 (0x1<<0)
  1161. #define ISCSI_NOP_OUT_REQUEST_RESERVED4_SHIFT 0
  1162. #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION (0x1<<1)
  1163. #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION_SHIFT 1
  1164. #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL (0x3F<<2)
  1165. #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL_SHIFT 2
  1166. u8 reserved6;
  1167. u16 reserved7;
  1168. #endif
  1169. u32 bd_list_addr_lo;
  1170. u32 bd_list_addr_hi;
  1171. #if defined(__BIG_ENDIAN)
  1172. u8 cq_index;
  1173. u8 reserved9;
  1174. u8 reserved8;
  1175. u8 num_bds;
  1176. #elif defined(__LITTLE_ENDIAN)
  1177. u8 num_bds;
  1178. u8 reserved8;
  1179. u8 reserved9;
  1180. u8 cq_index;
  1181. #endif
  1182. };
  1183. /*
  1184. * iSCSI Reject CQE
  1185. */
  1186. struct bnx2i_reject_msg {
  1187. #if defined(__BIG_ENDIAN)
  1188. u8 op_code;
  1189. u8 reserved1;
  1190. u8 reason;
  1191. u8 reserved0;
  1192. #elif defined(__LITTLE_ENDIAN)
  1193. u8 reserved0;
  1194. u8 reason;
  1195. u8 reserved1;
  1196. u8 op_code;
  1197. #endif
  1198. u32 data_length;
  1199. u32 exp_cmd_sn;
  1200. u32 max_cmd_sn;
  1201. u32 reserved2[2];
  1202. #if defined(__BIG_ENDIAN)
  1203. u16 reserved4;
  1204. u8 err_code;
  1205. u8 reserved3;
  1206. #elif defined(__LITTLE_ENDIAN)
  1207. u8 reserved3;
  1208. u8 err_code;
  1209. u16 reserved4;
  1210. #endif
  1211. u32 reserved5[8];
  1212. u32 cq_req_sn;
  1213. };
  1214. /*
  1215. * bnx2i iSCSI TMF SQ WQE
  1216. */
  1217. struct bnx2i_tmf_request {
  1218. #if defined(__BIG_ENDIAN)
  1219. u8 op_code;
  1220. u8 op_attr;
  1221. #define ISCSI_TMF_REQUEST_FUNCTION (0x7F<<0)
  1222. #define ISCSI_TMF_REQUEST_FUNCTION_SHIFT 0
  1223. #define ISCSI_TMF_REQUEST_ALWAYS_ONE (0x1<<7)
  1224. #define ISCSI_TMF_REQUEST_ALWAYS_ONE_SHIFT 7
  1225. u16 reserved0;
  1226. #elif defined(__LITTLE_ENDIAN)
  1227. u16 reserved0;
  1228. u8 op_attr;
  1229. #define ISCSI_TMF_REQUEST_FUNCTION (0x7F<<0)
  1230. #define ISCSI_TMF_REQUEST_FUNCTION_SHIFT 0
  1231. #define ISCSI_TMF_REQUEST_ALWAYS_ONE (0x1<<7)
  1232. #define ISCSI_TMF_REQUEST_ALWAYS_ONE_SHIFT 7
  1233. u8 op_code;
  1234. #endif
  1235. u32 data_length;
  1236. u32 lun[2];
  1237. #if defined(__BIG_ENDIAN)
  1238. u16 reserved1;
  1239. u16 itt;
  1240. #define ISCSI_TMF_REQUEST_INDEX (0x3FFF<<0)
  1241. #define ISCSI_TMF_REQUEST_INDEX_SHIFT 0
  1242. #define ISCSI_TMF_REQUEST_TYPE (0x3<<14)
  1243. #define ISCSI_TMF_REQUEST_TYPE_SHIFT 14
  1244. #elif defined(__LITTLE_ENDIAN)
  1245. u16 itt;
  1246. #define ISCSI_TMF_REQUEST_INDEX (0x3FFF<<0)
  1247. #define ISCSI_TMF_REQUEST_INDEX_SHIFT 0
  1248. #define ISCSI_TMF_REQUEST_TYPE (0x3<<14)
  1249. #define ISCSI_TMF_REQUEST_TYPE_SHIFT 14
  1250. u16 reserved1;
  1251. #endif
  1252. u32 ref_itt;
  1253. u32 cmd_sn;
  1254. u32 reserved2;
  1255. u32 ref_cmd_sn;
  1256. u32 reserved3[3];
  1257. u32 zero_fill;
  1258. u32 bd_list_addr_lo;
  1259. u32 bd_list_addr_hi;
  1260. #if defined(__BIG_ENDIAN)
  1261. u8 cq_index;
  1262. u8 reserved5;
  1263. u8 reserved4;
  1264. u8 num_bds;
  1265. #elif defined(__LITTLE_ENDIAN)
  1266. u8 num_bds;
  1267. u8 reserved4;
  1268. u8 reserved5;
  1269. u8 cq_index;
  1270. #endif
  1271. };
  1272. /*
  1273. * iSCSI Text SQ WQE
  1274. */
  1275. struct bnx2i_text_request {
  1276. #if defined(__BIG_ENDIAN)
  1277. u8 op_code;
  1278. u8 op_attr;
  1279. #define ISCSI_TEXT_REQUEST_RESERVED1 (0x3F<<0)
  1280. #define ISCSI_TEXT_REQUEST_RESERVED1_SHIFT 0
  1281. #define ISCSI_TEXT_REQUEST_CONT (0x1<<6)
  1282. #define ISCSI_TEXT_REQUEST_CONT_SHIFT 6
  1283. #define ISCSI_TEXT_REQUEST_FINAL (0x1<<7)
  1284. #define ISCSI_TEXT_REQUEST_FINAL_SHIFT 7
  1285. u16 reserved0;
  1286. #elif defined(__LITTLE_ENDIAN)
  1287. u16 reserved0;
  1288. u8 op_attr;
  1289. #define ISCSI_TEXT_REQUEST_RESERVED1 (0x3F<<0)
  1290. #define ISCSI_TEXT_REQUEST_RESERVED1_SHIFT 0
  1291. #define ISCSI_TEXT_REQUEST_CONT (0x1<<6)
  1292. #define ISCSI_TEXT_REQUEST_CONT_SHIFT 6
  1293. #define ISCSI_TEXT_REQUEST_FINAL (0x1<<7)
  1294. #define ISCSI_TEXT_REQUEST_FINAL_SHIFT 7
  1295. u8 op_code;
  1296. #endif
  1297. u32 data_length;
  1298. u32 lun[2];
  1299. #if defined(__BIG_ENDIAN)
  1300. u16 reserved3;
  1301. u16 itt;
  1302. #define ISCSI_TEXT_REQUEST_INDEX (0x3FFF<<0)
  1303. #define ISCSI_TEXT_REQUEST_INDEX_SHIFT 0
  1304. #define ISCSI_TEXT_REQUEST_TYPE (0x3<<14)
  1305. #define ISCSI_TEXT_REQUEST_TYPE_SHIFT 14
  1306. #elif defined(__LITTLE_ENDIAN)
  1307. u16 itt;
  1308. #define ISCSI_TEXT_REQUEST_INDEX (0x3FFF<<0)
  1309. #define ISCSI_TEXT_REQUEST_INDEX_SHIFT 0
  1310. #define ISCSI_TEXT_REQUEST_TYPE (0x3<<14)
  1311. #define ISCSI_TEXT_REQUEST_TYPE_SHIFT 14
  1312. u16 reserved3;
  1313. #endif
  1314. u32 ttt;
  1315. u32 cmd_sn;
  1316. u32 reserved4[2];
  1317. u32 resp_bd_list_addr_lo;
  1318. u32 resp_bd_list_addr_hi;
  1319. u32 resp_buffer;
  1320. #define ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
  1321. #define ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
  1322. #define ISCSI_TEXT_REQUEST_NUM_RESP_BDS (0xFF<<24)
  1323. #define ISCSI_TEXT_REQUEST_NUM_RESP_BDS_SHIFT 24
  1324. u32 zero_fill;
  1325. u32 bd_list_addr_lo;
  1326. u32 bd_list_addr_hi;
  1327. #if defined(__BIG_ENDIAN)
  1328. u8 cq_index;
  1329. u8 reserved7;
  1330. u8 reserved6;
  1331. u8 num_bds;
  1332. #elif defined(__LITTLE_ENDIAN)
  1333. u8 num_bds;
  1334. u8 reserved6;
  1335. u8 reserved7;
  1336. u8 cq_index;
  1337. #endif
  1338. };
  1339. /*
  1340. * iSCSI SQ WQE
  1341. */
  1342. union iscsi_request {
  1343. struct bnx2i_cmd_request cmd;
  1344. struct bnx2i_tmf_request tmf;
  1345. struct bnx2i_nop_out_request nop_out;
  1346. struct bnx2i_login_request login_req;
  1347. struct bnx2i_text_request text;
  1348. struct bnx2i_logout_request logout_req;
  1349. struct bnx2i_cleanup_request cleanup;
  1350. };
  1351. /*
  1352. * iSCSI TMF CQE
  1353. */
  1354. struct bnx2i_tmf_response {
  1355. #if defined(__BIG_ENDIAN)
  1356. u8 op_code;
  1357. u8 reserved1;
  1358. u8 response;
  1359. u8 reserved0;
  1360. #elif defined(__LITTLE_ENDIAN)
  1361. u8 reserved0;
  1362. u8 response;
  1363. u8 reserved1;
  1364. u8 op_code;
  1365. #endif
  1366. u32 reserved2;
  1367. u32 exp_cmd_sn;
  1368. u32 max_cmd_sn;
  1369. u32 reserved3[2];
  1370. #if defined(__BIG_ENDIAN)
  1371. u16 reserved5;
  1372. u8 err_code;
  1373. u8 reserved4;
  1374. #elif defined(__LITTLE_ENDIAN)
  1375. u8 reserved4;
  1376. u8 err_code;
  1377. u16 reserved5;
  1378. #endif
  1379. u32 reserved6[7];
  1380. #if defined(__BIG_ENDIAN)
  1381. u16 reserved7;
  1382. u16 itt;
  1383. #define ISCSI_TMF_RESPONSE_INDEX (0x3FFF<<0)
  1384. #define ISCSI_TMF_RESPONSE_INDEX_SHIFT 0
  1385. #define ISCSI_TMF_RESPONSE_TYPE (0x3<<14)
  1386. #define ISCSI_TMF_RESPONSE_TYPE_SHIFT 14
  1387. #elif defined(__LITTLE_ENDIAN)
  1388. u16 itt;
  1389. #define ISCSI_TMF_RESPONSE_INDEX (0x3FFF<<0)
  1390. #define ISCSI_TMF_RESPONSE_INDEX_SHIFT 0
  1391. #define ISCSI_TMF_RESPONSE_TYPE (0x3<<14)
  1392. #define ISCSI_TMF_RESPONSE_TYPE_SHIFT 14
  1393. u16 reserved7;
  1394. #endif
  1395. u32 cq_req_sn;
  1396. };
  1397. /*
  1398. * iSCSI Text CQE
  1399. */
  1400. struct bnx2i_text_response {
  1401. #if defined(__BIG_ENDIAN)
  1402. u8 op_code;
  1403. u8 response_flags;
  1404. #define ISCSI_TEXT_RESPONSE_RESERVED1 (0x3F<<0)
  1405. #define ISCSI_TEXT_RESPONSE_RESERVED1_SHIFT 0
  1406. #define ISCSI_TEXT_RESPONSE_CONT (0x1<<6)
  1407. #define ISCSI_TEXT_RESPONSE_CONT_SHIFT 6
  1408. #define ISCSI_TEXT_RESPONSE_FINAL (0x1<<7)
  1409. #define ISCSI_TEXT_RESPONSE_FINAL_SHIFT 7
  1410. u16 reserved0;
  1411. #elif defined(__LITTLE_ENDIAN)
  1412. u16 reserved0;
  1413. u8 response_flags;
  1414. #define ISCSI_TEXT_RESPONSE_RESERVED1 (0x3F<<0)
  1415. #define ISCSI_TEXT_RESPONSE_RESERVED1_SHIFT 0
  1416. #define ISCSI_TEXT_RESPONSE_CONT (0x1<<6)
  1417. #define ISCSI_TEXT_RESPONSE_CONT_SHIFT 6
  1418. #define ISCSI_TEXT_RESPONSE_FINAL (0x1<<7)
  1419. #define ISCSI_TEXT_RESPONSE_FINAL_SHIFT 7
  1420. u8 op_code;
  1421. #endif
  1422. u32 data_length;
  1423. u32 exp_cmd_sn;
  1424. u32 max_cmd_sn;
  1425. u32 ttt;
  1426. u32 reserved2;
  1427. #if defined(__BIG_ENDIAN)
  1428. u16 reserved4;
  1429. u8 err_code;
  1430. u8 reserved3;
  1431. #elif defined(__LITTLE_ENDIAN)
  1432. u8 reserved3;
  1433. u8 err_code;
  1434. u16 reserved4;
  1435. #endif
  1436. u32 reserved5;
  1437. u32 lun[2];
  1438. u32 reserved6[4];
  1439. #if defined(__BIG_ENDIAN)
  1440. u16 reserved7;
  1441. u16 itt;
  1442. #define ISCSI_TEXT_RESPONSE_INDEX (0x3FFF<<0)
  1443. #define ISCSI_TEXT_RESPONSE_INDEX_SHIFT 0
  1444. #define ISCSI_TEXT_RESPONSE_TYPE (0x3<<14)
  1445. #define ISCSI_TEXT_RESPONSE_TYPE_SHIFT 14
  1446. #elif defined(__LITTLE_ENDIAN)
  1447. u16 itt;
  1448. #define ISCSI_TEXT_RESPONSE_INDEX (0x3FFF<<0)
  1449. #define ISCSI_TEXT_RESPONSE_INDEX_SHIFT 0
  1450. #define ISCSI_TEXT_RESPONSE_TYPE (0x3<<14)
  1451. #define ISCSI_TEXT_RESPONSE_TYPE_SHIFT 14
  1452. u16 reserved7;
  1453. #endif
  1454. u32 cq_req_sn;
  1455. };
  1456. /*
  1457. * iSCSI CQE
  1458. */
  1459. union iscsi_response {
  1460. struct bnx2i_cmd_response cmd;
  1461. struct bnx2i_tmf_response tmf;
  1462. struct bnx2i_login_response login_resp;
  1463. struct bnx2i_text_response text;
  1464. struct bnx2i_logout_response logout_resp;
  1465. struct bnx2i_cleanup_response cleanup;
  1466. struct bnx2i_reject_msg reject;
  1467. struct bnx2i_async_msg async;
  1468. struct bnx2i_nop_in_msg nop_in;
  1469. };
  1470. #endif /* __57XX_ISCSI_HSI_LINUX_LE__ */