57xx_iscsi_hsi.h 36 KB

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