Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
57xx_iscsi_hsi.h
Go to the documentation of this file.
1 /* 57xx_iscsi_hsi.h: Broadcom NetXtreme II iSCSI HSI.
2  *
3  * Copyright (c) 2006 - 2012 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 ([email protected])
10  * Maintained by: Eddie Wai ([email protected])
11  */
12 #ifndef __57XX_ISCSI_HSI_LINUX_LE__
13 #define __57XX_ISCSI_HSI_LINUX_LE__
14 
15 /*
16  * iSCSI Async CQE
17  */
19 #if defined(__BIG_ENDIAN)
20  u8 op_code;
21  u8 reserved1;
22  u16 reserved0;
23 #elif defined(__LITTLE_ENDIAN)
24  u16 reserved0;
25  u8 reserved1;
26  u8 op_code;
27 #endif
32 #if defined(__BIG_ENDIAN)
33  u16 reserved5;
34  u8 err_code;
35  u8 reserved4;
36 #elif defined(__LITTLE_ENDIAN)
37  u8 reserved4;
38  u8 err_code;
39  u16 reserved5;
40 #endif
42  u32 lun[2];
43 #if defined(__BIG_ENDIAN)
44  u8 async_event;
45  u8 async_vcode;
46  u16 param1;
47 #elif defined(__LITTLE_ENDIAN)
48  u16 param1;
49  u8 async_vcode;
50  u8 async_event;
51 #endif
52 #if defined(__BIG_ENDIAN)
53  u16 param2;
54  u16 param3;
55 #elif defined(__LITTLE_ENDIAN)
56  u16 param3;
57  u16 param2;
58 #endif
61 };
62 
63 
64 /*
65  * iSCSI Buffer Descriptor (BD)
66  */
67 struct iscsi_bd {
70 #if defined(__BIG_ENDIAN)
71  u16 reserved0;
73 #elif defined(__LITTLE_ENDIAN)
75  u16 reserved0;
76 #endif
77 #if defined(__BIG_ENDIAN)
78  u16 reserved3;
79  u16 flags;
80 #define ISCSI_BD_RESERVED1 (0x3F<<0)
81 #define ISCSI_BD_RESERVED1_SHIFT 0
82 #define ISCSI_BD_LAST_IN_BD_CHAIN (0x1<<6)
83 #define ISCSI_BD_LAST_IN_BD_CHAIN_SHIFT 6
84 #define ISCSI_BD_FIRST_IN_BD_CHAIN (0x1<<7)
85 #define ISCSI_BD_FIRST_IN_BD_CHAIN_SHIFT 7
86 #define ISCSI_BD_RESERVED2 (0xFF<<8)
87 #define ISCSI_BD_RESERVED2_SHIFT 8
88 #elif defined(__LITTLE_ENDIAN)
89  u16 flags;
90 #define ISCSI_BD_RESERVED1 (0x3F<<0)
91 #define ISCSI_BD_RESERVED1_SHIFT 0
92 #define ISCSI_BD_LAST_IN_BD_CHAIN (0x1<<6)
93 #define ISCSI_BD_LAST_IN_BD_CHAIN_SHIFT 6
94 #define ISCSI_BD_FIRST_IN_BD_CHAIN (0x1<<7)
95 #define ISCSI_BD_FIRST_IN_BD_CHAIN_SHIFT 7
96 #define ISCSI_BD_RESERVED2 (0xFF<<8)
97 #define ISCSI_BD_RESERVED2_SHIFT 8
98  u16 reserved3;
99 #endif
100 };
101 
102 
103 /*
104  * iSCSI Cleanup SQ WQE
105  */
107 #if defined(__BIG_ENDIAN)
108  u8 op_code;
109  u8 reserved1;
110  u16 reserved0;
111 #elif defined(__LITTLE_ENDIAN)
112  u16 reserved0;
113  u8 reserved1;
114  u8 op_code;
115 #endif
117 #if defined(__BIG_ENDIAN)
118  u16 reserved3;
119  u16 itt;
120 #define ISCSI_CLEANUP_REQUEST_INDEX (0x3FFF<<0)
121 #define ISCSI_CLEANUP_REQUEST_INDEX_SHIFT 0
122 #define ISCSI_CLEANUP_REQUEST_TYPE (0x3<<14)
123 #define ISCSI_CLEANUP_REQUEST_TYPE_SHIFT 14
124 #elif defined(__LITTLE_ENDIAN)
125  u16 itt;
126 #define ISCSI_CLEANUP_REQUEST_INDEX (0x3FFF<<0)
127 #define ISCSI_CLEANUP_REQUEST_INDEX_SHIFT 0
128 #define ISCSI_CLEANUP_REQUEST_TYPE (0x3<<14)
129 #define ISCSI_CLEANUP_REQUEST_TYPE_SHIFT 14
130  u16 reserved3;
131 #endif
133 #if defined(__BIG_ENDIAN)
134  u8 cq_index;
135  u8 reserved6;
136  u16 reserved5;
137 #elif defined(__LITTLE_ENDIAN)
138  u16 reserved5;
139  u8 reserved6;
140  u8 cq_index;
141 #endif
142 };
143 
144 
145 /*
146  * iSCSI Cleanup CQE
147  */
149 #if defined(__BIG_ENDIAN)
150  u8 op_code;
151  u8 status;
152  u16 reserved0;
153 #elif defined(__LITTLE_ENDIAN)
154  u16 reserved0;
155  u8 status;
156  u8 op_code;
157 #endif
160 #if defined(__BIG_ENDIAN)
161  u16 reserved4;
162  u8 err_code;
163  u8 reserved3;
164 #elif defined(__LITTLE_ENDIAN)
165  u8 reserved3;
166  u8 err_code;
167  u16 reserved4;
168 #endif
170 #if defined(__BIG_ENDIAN)
171  u16 reserved6;
172  u16 itt;
173 #define ISCSI_CLEANUP_RESPONSE_INDEX (0x3FFF<<0)
174 #define ISCSI_CLEANUP_RESPONSE_INDEX_SHIFT 0
175 #define ISCSI_CLEANUP_RESPONSE_TYPE (0x3<<14)
176 #define ISCSI_CLEANUP_RESPONSE_TYPE_SHIFT 14
177 #elif defined(__LITTLE_ENDIAN)
178  u16 itt;
179 #define ISCSI_CLEANUP_RESPONSE_INDEX (0x3FFF<<0)
180 #define ISCSI_CLEANUP_RESPONSE_INDEX_SHIFT 0
181 #define ISCSI_CLEANUP_RESPONSE_TYPE (0x3<<14)
182 #define ISCSI_CLEANUP_RESPONSE_TYPE_SHIFT 14
183  u16 reserved6;
184 #endif
186 };
187 
188 
189 /*
190  * SCSI read/write SQ WQE
191  */
193 #if defined(__BIG_ENDIAN)
194  u8 op_code;
195  u8 op_attr;
196 #define ISCSI_CMD_REQUEST_TASK_ATTR (0x7<<0)
197 #define ISCSI_CMD_REQUEST_TASK_ATTR_SHIFT 0
198 #define ISCSI_CMD_REQUEST_RESERVED1 (0x3<<3)
199 #define ISCSI_CMD_REQUEST_RESERVED1_SHIFT 3
200 #define ISCSI_CMD_REQUEST_WRITE (0x1<<5)
201 #define ISCSI_CMD_REQUEST_WRITE_SHIFT 5
202 #define ISCSI_CMD_REQUEST_READ (0x1<<6)
203 #define ISCSI_CMD_REQUEST_READ_SHIFT 6
204 #define ISCSI_CMD_REQUEST_FINAL (0x1<<7)
205 #define ISCSI_CMD_REQUEST_FINAL_SHIFT 7
206  u16 reserved0;
207 #elif defined(__LITTLE_ENDIAN)
208  u16 reserved0;
209  u8 op_attr;
210 #define ISCSI_CMD_REQUEST_TASK_ATTR (0x7<<0)
211 #define ISCSI_CMD_REQUEST_TASK_ATTR_SHIFT 0
212 #define ISCSI_CMD_REQUEST_RESERVED1 (0x3<<3)
213 #define ISCSI_CMD_REQUEST_RESERVED1_SHIFT 3
214 #define ISCSI_CMD_REQUEST_WRITE (0x1<<5)
215 #define ISCSI_CMD_REQUEST_WRITE_SHIFT 5
216 #define ISCSI_CMD_REQUEST_READ (0x1<<6)
217 #define ISCSI_CMD_REQUEST_READ_SHIFT 6
218 #define ISCSI_CMD_REQUEST_FINAL (0x1<<7)
219 #define ISCSI_CMD_REQUEST_FINAL_SHIFT 7
220  u8 op_code;
221 #endif
222 #if defined(__BIG_ENDIAN)
223  u16 ud_buffer_offset;
224  u16 sd_buffer_offset;
225 #elif defined(__LITTLE_ENDIAN)
226  u16 sd_buffer_offset;
227  u16 ud_buffer_offset;
228 #endif
229  u32 lun[2];
230 #if defined(__BIG_ENDIAN)
231  u16 reserved2;
232  u16 itt;
233 #define ISCSI_CMD_REQUEST_INDEX (0x3FFF<<0)
234 #define ISCSI_CMD_REQUEST_INDEX_SHIFT 0
235 #define ISCSI_CMD_REQUEST_TYPE (0x3<<14)
236 #define ISCSI_CMD_REQUEST_TYPE_SHIFT 14
237 #elif defined(__LITTLE_ENDIAN)
238  u16 itt;
239 #define ISCSI_CMD_REQUEST_INDEX (0x3FFF<<0)
240 #define ISCSI_CMD_REQUEST_INDEX_SHIFT 0
241 #define ISCSI_CMD_REQUEST_TYPE (0x3<<14)
242 #define ISCSI_CMD_REQUEST_TYPE_SHIFT 14
243  u16 reserved2;
244 #endif
248  u32 cdb[4];
252 #if defined(__BIG_ENDIAN)
253  u8 cq_index;
254  u8 sd_start_bd_index;
255  u8 ud_start_bd_index;
256  u8 num_bds;
257 #elif defined(__LITTLE_ENDIAN)
258  u8 num_bds;
259  u8 ud_start_bd_index;
260  u8 sd_start_bd_index;
261  u8 cq_index;
262 #endif
263 };
264 
265 
266 /*
267  * task statistics for write response
268  */
270 #if defined(__BIG_ENDIAN)
271  u16 num_r2ts;
272  u16 num_data_outs;
273 #elif defined(__LITTLE_ENDIAN)
274  u16 num_data_outs;
275  u16 num_r2ts;
276 #endif
277 };
278 
279 /*
280  * task statistics for read response
281  */
283 #if defined(__BIG_ENDIAN)
284  u16 reserved;
285  u16 num_data_ins;
286 #elif defined(__LITTLE_ENDIAN)
287  u16 num_data_ins;
288  u16 reserved;
289 #endif
290 };
291 
292 /*
293  * task statistics for iSCSI cmd response
294  */
298 };
299 
300 /*
301  * SCSI Command CQE
302  */
304 #if defined(__BIG_ENDIAN)
305  u8 op_code;
307 #define ISCSI_CMD_RESPONSE_RESERVED0 (0x1<<0)
308 #define ISCSI_CMD_RESPONSE_RESERVED0_SHIFT 0
309 #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW (0x1<<1)
310 #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW_SHIFT 1
311 #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW (0x1<<2)
312 #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW_SHIFT 2
313 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW (0x1<<3)
314 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW_SHIFT 3
315 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW (0x1<<4)
316 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW_SHIFT 4
317 #define ISCSI_CMD_RESPONSE_RESERVED1 (0x7<<5)
318 #define ISCSI_CMD_RESPONSE_RESERVED1_SHIFT 5
319  u8 response;
320  u8 status;
321 #elif defined(__LITTLE_ENDIAN)
322  u8 status;
323  u8 response;
325 #define ISCSI_CMD_RESPONSE_RESERVED0 (0x1<<0)
326 #define ISCSI_CMD_RESPONSE_RESERVED0_SHIFT 0
327 #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW (0x1<<1)
328 #define ISCSI_CMD_RESPONSE_RESIDUAL_UNDERFLOW_SHIFT 1
329 #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW (0x1<<2)
330 #define ISCSI_CMD_RESPONSE_RESIDUAL_OVERFLOW_SHIFT 2
331 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW (0x1<<3)
332 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_UNDERFLOW_SHIFT 3
333 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW (0x1<<4)
334 #define ISCSI_CMD_RESPONSE_BR_RESIDUAL_OVERFLOW_SHIFT 4
335 #define ISCSI_CMD_RESPONSE_RESERVED1 (0x7<<5)
336 #define ISCSI_CMD_RESPONSE_RESERVED1_SHIFT 5
337  u8 op_code;
338 #endif
344 #if defined(__BIG_ENDIAN)
345  u16 reserved4;
346  u8 err_code;
347  u8 reserved3;
348 #elif defined(__LITTLE_ENDIAN)
349  u8 reserved3;
350  u8 err_code;
351  u16 reserved4;
352 #endif
356 #if defined(__BIG_ENDIAN)
357  u16 reserved7;
358  u16 itt;
359 #define ISCSI_CMD_RESPONSE_INDEX (0x3FFF<<0)
360 #define ISCSI_CMD_RESPONSE_INDEX_SHIFT 0
361 #define ISCSI_CMD_RESPONSE_TYPE (0x3<<14)
362 #define ISCSI_CMD_RESPONSE_TYPE_SHIFT 14
363 #elif defined(__LITTLE_ENDIAN)
364  u16 itt;
365 #define ISCSI_CMD_RESPONSE_INDEX (0x3FFF<<0)
366 #define ISCSI_CMD_RESPONSE_INDEX_SHIFT 0
367 #define ISCSI_CMD_RESPONSE_TYPE (0x3<<14)
368 #define ISCSI_CMD_RESPONSE_TYPE_SHIFT 14
369  u16 reserved7;
370 #endif
372 };
373 
374 
375 
376 /*
377  * firmware middle-path request SQ WQE
378  */
380 #if defined(__BIG_ENDIAN)
381  u8 op_code;
382  u8 op_attr;
383  u16 hdr_opaque1;
384 #elif defined(__LITTLE_ENDIAN)
385  u16 hdr_opaque1;
386  u8 op_attr;
387  u8 op_code;
388 #endif
391 #if defined(__BIG_ENDIAN)
392  u16 reserved0;
393  u16 itt;
394 #define ISCSI_FW_MP_REQUEST_INDEX (0x3FFF<<0)
395 #define ISCSI_FW_MP_REQUEST_INDEX_SHIFT 0
396 #define ISCSI_FW_MP_REQUEST_TYPE (0x3<<14)
397 #define ISCSI_FW_MP_REQUEST_TYPE_SHIFT 14
398 #elif defined(__LITTLE_ENDIAN)
399  u16 itt;
400 #define ISCSI_FW_MP_REQUEST_INDEX (0x3FFF<<0)
401 #define ISCSI_FW_MP_REQUEST_INDEX_SHIFT 0
402 #define ISCSI_FW_MP_REQUEST_TYPE (0x3<<14)
403 #define ISCSI_FW_MP_REQUEST_TYPE_SHIFT 14
404  u16 reserved0;
405 #endif
410 #define ISCSI_FW_MP_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
411 #define ISCSI_FW_MP_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
412 #define ISCSI_FW_MP_REQUEST_NUM_RESP_BDS (0xFF<<24)
413 #define ISCSI_FW_MP_REQUEST_NUM_RESP_BDS_SHIFT 24
414 #if defined(__BIG_ENDIAN)
415  u16 reserved4;
416  u8 reserved3;
417  u8 flags;
418 #define ISCSI_FW_MP_REQUEST_RESERVED1 (0x1<<0)
419 #define ISCSI_FW_MP_REQUEST_RESERVED1_SHIFT 0
420 #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION (0x1<<1)
421 #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION_SHIFT 1
422 #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
423 #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
424 #define ISCSI_FW_MP_REQUEST_RESERVED2 (0x1F<<3)
425 #define ISCSI_FW_MP_REQUEST_RESERVED2_SHIFT 3
426 #elif defined(__LITTLE_ENDIAN)
427  u8 flags;
428 #define ISCSI_FW_MP_REQUEST_RESERVED1 (0x1<<0)
429 #define ISCSI_FW_MP_REQUEST_RESERVED1_SHIFT 0
430 #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION (0x1<<1)
431 #define ISCSI_FW_MP_REQUEST_LOCAL_COMPLETION_SHIFT 1
432 #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
433 #define ISCSI_FW_MP_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
434 #define ISCSI_FW_MP_REQUEST_RESERVED2 (0x1F<<3)
435 #define ISCSI_FW_MP_REQUEST_RESERVED2_SHIFT 3
436  u8 reserved3;
437  u16 reserved4;
438 #endif
441 #if defined(__BIG_ENDIAN)
442  u8 cq_index;
443  u8 reserved6;
444  u8 reserved5;
445  u8 num_bds;
446 #elif defined(__LITTLE_ENDIAN)
447  u8 num_bds;
448  u8 reserved5;
449  u8 reserved6;
450  u8 cq_index;
451 #endif
452 };
453 
454 
455 /*
456  * firmware response - CQE: used only by firmware
457  */
465 #define ISCSI_FW_RESPONSE_RESERVED2 (0xFF<<0)
466 #define ISCSI_FW_RESPONSE_RESERVED2_SHIFT 0
467 #define ISCSI_FW_RESPONSE_ERR_CODE (0xFF<<8)
468 #define ISCSI_FW_RESPONSE_ERR_CODE_SHIFT 8
469 #define ISCSI_FW_RESPONSE_RESERVED3 (0xFFFF<<16)
470 #define ISCSI_FW_RESPONSE_RESERVED3_SHIFT 16
478 };
479 
480 
481 /*
482  * iSCSI KCQ CQE parameters
483  */
486 };
487 
488 /*
489  * iSCSI KCQ CQE
490  */
491 struct iscsi_kcqe {
496 #if defined(__BIG_ENDIAN)
497  u8 flags;
498 #define ISCSI_KCQE_RESERVED0 (0xF<<0)
499 #define ISCSI_KCQE_RESERVED0_SHIFT 0
500 #define ISCSI_KCQE_LAYER_CODE (0x7<<4)
501 #define ISCSI_KCQE_LAYER_CODE_SHIFT 4
502 #define ISCSI_KCQE_RESERVED1 (0x1<<7)
503 #define ISCSI_KCQE_RESERVED1_SHIFT 7
504  u8 op_code;
505  u16 qe_self_seq;
506 #elif defined(__LITTLE_ENDIAN)
507  u16 qe_self_seq;
508  u8 op_code;
509  u8 flags;
510 #define ISCSI_KCQE_RESERVED0 (0xF<<0)
511 #define ISCSI_KCQE_RESERVED0_SHIFT 0
512 #define ISCSI_KCQE_LAYER_CODE (0x7<<4)
513 #define ISCSI_KCQE_LAYER_CODE_SHIFT 4
514 #define ISCSI_KCQE_RESERVED1 (0x1<<7)
515 #define ISCSI_KCQE_RESERVED1_SHIFT 7
516 #endif
517 };
518 
519 
520 
521 /*
522  * iSCSI KWQE header
523  */
525 #if defined(__BIG_ENDIAN)
526  u8 flags;
527 #define ISCSI_KWQE_HEADER_RESERVED0 (0xF<<0)
528 #define ISCSI_KWQE_HEADER_RESERVED0_SHIFT 0
529 #define ISCSI_KWQE_HEADER_LAYER_CODE (0x7<<4)
530 #define ISCSI_KWQE_HEADER_LAYER_CODE_SHIFT 4
531 #define ISCSI_KWQE_HEADER_RESERVED1 (0x1<<7)
532 #define ISCSI_KWQE_HEADER_RESERVED1_SHIFT 7
533  u8 op_code;
534 #elif defined(__LITTLE_ENDIAN)
535  u8 op_code;
536  u8 flags;
537 #define ISCSI_KWQE_HEADER_RESERVED0 (0xF<<0)
538 #define ISCSI_KWQE_HEADER_RESERVED0_SHIFT 0
539 #define ISCSI_KWQE_HEADER_LAYER_CODE (0x7<<4)
540 #define ISCSI_KWQE_HEADER_LAYER_CODE_SHIFT 4
541 #define ISCSI_KWQE_HEADER_RESERVED1 (0x1<<7)
542 #define ISCSI_KWQE_HEADER_RESERVED1_SHIFT 7
543 #endif
544 };
545 
546 /*
547  * iSCSI firmware init request 1
548  */
550 #if defined(__BIG_ENDIAN)
551  struct iscsi_kwqe_header hdr;
552  u8 reserved0;
553  u8 num_cqs;
554 #elif defined(__LITTLE_ENDIAN)
555  u8 num_cqs;
556  u8 reserved0;
557  struct iscsi_kwqe_header hdr;
558 #endif
561 #if defined(__BIG_ENDIAN)
562  u16 num_ccells_per_conn;
563  u16 num_tasks_per_conn;
564 #elif defined(__LITTLE_ENDIAN)
565  u16 num_tasks_per_conn;
566  u16 num_ccells_per_conn;
567 #endif
568 #if defined(__BIG_ENDIAN)
569  u16 sq_wqes_per_page;
570  u16 sq_num_wqes;
571 #elif defined(__LITTLE_ENDIAN)
572  u16 sq_num_wqes;
573  u16 sq_wqes_per_page;
574 #endif
575 #if defined(__BIG_ENDIAN)
576  u8 cq_log_wqes_per_page;
577  u8 flags;
578 #define ISCSI_KWQE_INIT1_PAGE_SIZE (0xF<<0)
579 #define ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT 0
580 #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE (0x1<<4)
581 #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
582 #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
583 #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
584 #define ISCSI_KWQE_INIT1_RESERVED1 (0x3<<6)
585 #define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 6
586  u16 cq_num_wqes;
587 #elif defined(__LITTLE_ENDIAN)
588  u16 cq_num_wqes;
589  u8 flags;
590 #define ISCSI_KWQE_INIT1_PAGE_SIZE (0xF<<0)
591 #define ISCSI_KWQE_INIT1_PAGE_SIZE_SHIFT 0
592 #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE (0x1<<4)
593 #define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
594 #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
595 #define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
596 #define ISCSI_KWQE_INIT1_RESERVED1 (0x3<<6)
597 #define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 6
598  u8 cq_log_wqes_per_page;
599 #endif
600 #if defined(__BIG_ENDIAN)
601  u16 cq_num_pages;
602  u16 sq_num_pages;
603 #elif defined(__LITTLE_ENDIAN)
604  u16 sq_num_pages;
605  u16 cq_num_pages;
606 #endif
607 #if defined(__BIG_ENDIAN)
608  u16 rq_buffer_size;
609  u16 rq_num_wqes;
610 #elif defined(__LITTLE_ENDIAN)
611  u16 rq_num_wqes;
612  u16 rq_buffer_size;
613 #endif
614 };
615 
616 /*
617  * iSCSI firmware init request 2
618  */
620 #if defined(__BIG_ENDIAN)
621  struct iscsi_kwqe_header hdr;
622  u16 max_cq_sqn;
623 #elif defined(__LITTLE_ENDIAN)
624  u16 max_cq_sqn;
625  struct iscsi_kwqe_header hdr;
626 #endif
629 };
630 
631 /*
632  * Initial iSCSI connection offload request 1
633  */
635 #if defined(__BIG_ENDIAN)
636  struct iscsi_kwqe_header hdr;
637  u16 iscsi_conn_id;
638 #elif defined(__LITTLE_ENDIAN)
639  u16 iscsi_conn_id;
640  struct iscsi_kwqe_header hdr;
641 #endif
647 };
648 
649 /*
650  * iSCSI Page Table Entry (PTE)
651  */
652 struct iscsi_pte {
655 };
656 
657 /*
658  * Initial iSCSI connection offload request 2
659  */
661 #if defined(__BIG_ENDIAN)
662  struct iscsi_kwqe_header hdr;
663  u16 reserved0;
664 #elif defined(__LITTLE_ENDIAN)
665  u16 reserved0;
666  struct iscsi_kwqe_header hdr;
667 #endif
673 };
674 
675 
676 /*
677  * Initial iSCSI connection offload request 3
678  */
680 #if defined(__BIG_ENDIAN)
681  struct iscsi_kwqe_header hdr;
682  u16 reserved0;
683 #elif defined(__LITTLE_ENDIAN)
684  u16 reserved0;
685  struct iscsi_kwqe_header hdr;
686 #endif
689 };
690 
691 
692 /*
693  * iSCSI connection update request
694  */
696 #if defined(__BIG_ENDIAN)
697  struct iscsi_kwqe_header hdr;
698  u16 reserved0;
699 #elif defined(__LITTLE_ENDIAN)
700  u16 reserved0;
701  struct iscsi_kwqe_header hdr;
702 #endif
703 #if defined(__BIG_ENDIAN)
704  u8 session_error_recovery_level;
705  u8 max_outstanding_r2ts;
706  u8 reserved2;
707  u8 conn_flags;
708 #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST (0x1<<0)
709 #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST_SHIFT 0
710 #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST (0x1<<1)
711 #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST_SHIFT 1
712 #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T (0x1<<2)
713 #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T_SHIFT 2
714 #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA (0x1<<3)
715 #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA_SHIFT 3
716 #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE (0x3<<4)
717 #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE_SHIFT 4
718 #define ISCSI_KWQE_CONN_UPDATE_RESERVED1 (0x3<<6)
719 #define ISCSI_KWQE_CONN_UPDATE_RESERVED1_SHIFT 6
720 #elif defined(__LITTLE_ENDIAN)
721  u8 conn_flags;
722 #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST (0x1<<0)
723 #define ISCSI_KWQE_CONN_UPDATE_HEADER_DIGEST_SHIFT 0
724 #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST (0x1<<1)
725 #define ISCSI_KWQE_CONN_UPDATE_DATA_DIGEST_SHIFT 1
726 #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T (0x1<<2)
727 #define ISCSI_KWQE_CONN_UPDATE_INITIAL_R2T_SHIFT 2
728 #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA (0x1<<3)
729 #define ISCSI_KWQE_CONN_UPDATE_IMMEDIATE_DATA_SHIFT 3
730 #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE (0x3<<4)
731 #define ISCSI_KWQE_CONN_UPDATE_OOO_SUPPORT_MODE_SHIFT 4
732 #define ISCSI_KWQE_CONN_UPDATE_RESERVED1 (0x3<<6)
733 #define ISCSI_KWQE_CONN_UPDATE_RESERVED1_SHIFT 6
734  u8 reserved2;
735  u8 max_outstanding_r2ts;
736  u8 session_error_recovery_level;
737 #endif
744 };
745 
746 /*
747  * iSCSI destroy connection request
748  */
750 #if defined(__BIG_ENDIAN)
751  struct iscsi_kwqe_header hdr;
752  u16 reserved0;
753 #elif defined(__LITTLE_ENDIAN)
754  u16 reserved0;
755  struct iscsi_kwqe_header hdr;
756 #endif
759 };
760 
761 /*
762  * iSCSI KWQ WQE
763  */
764 union iscsi_kwqe {
771 };
772 
773 /*
774  * iSCSI Login SQ WQE
775  */
777 #if defined(__BIG_ENDIAN)
778  u8 op_code;
779  u8 op_attr;
780 #define ISCSI_LOGIN_REQUEST_NEXT_STAGE (0x3<<0)
781 #define ISCSI_LOGIN_REQUEST_NEXT_STAGE_SHIFT 0
782 #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE (0x3<<2)
783 #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE_SHIFT 2
784 #define ISCSI_LOGIN_REQUEST_RESERVED0 (0x3<<4)
785 #define ISCSI_LOGIN_REQUEST_RESERVED0_SHIFT 4
786 #define ISCSI_LOGIN_REQUEST_CONT (0x1<<6)
787 #define ISCSI_LOGIN_REQUEST_CONT_SHIFT 6
788 #define ISCSI_LOGIN_REQUEST_TRANSIT (0x1<<7)
789 #define ISCSI_LOGIN_REQUEST_TRANSIT_SHIFT 7
790  u8 version_max;
791  u8 version_min;
792 #elif defined(__LITTLE_ENDIAN)
793  u8 version_min;
794  u8 version_max;
795  u8 op_attr;
796 #define ISCSI_LOGIN_REQUEST_NEXT_STAGE (0x3<<0)
797 #define ISCSI_LOGIN_REQUEST_NEXT_STAGE_SHIFT 0
798 #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE (0x3<<2)
799 #define ISCSI_LOGIN_REQUEST_CURRENT_STAGE_SHIFT 2
800 #define ISCSI_LOGIN_REQUEST_RESERVED0 (0x3<<4)
801 #define ISCSI_LOGIN_REQUEST_RESERVED0_SHIFT 4
802 #define ISCSI_LOGIN_REQUEST_CONT (0x1<<6)
803 #define ISCSI_LOGIN_REQUEST_CONT_SHIFT 6
804 #define ISCSI_LOGIN_REQUEST_TRANSIT (0x1<<7)
805 #define ISCSI_LOGIN_REQUEST_TRANSIT_SHIFT 7
806  u8 op_code;
807 #endif
810 #if defined(__BIG_ENDIAN)
811  u16 isid_hi;
812  u16 tsih;
813 #elif defined(__LITTLE_ENDIAN)
814  u16 tsih;
815  u16 isid_hi;
816 #endif
817 #if defined(__BIG_ENDIAN)
818  u16 reserved2;
819  u16 itt;
820 #define ISCSI_LOGIN_REQUEST_INDEX (0x3FFF<<0)
821 #define ISCSI_LOGIN_REQUEST_INDEX_SHIFT 0
822 #define ISCSI_LOGIN_REQUEST_TYPE (0x3<<14)
823 #define ISCSI_LOGIN_REQUEST_TYPE_SHIFT 14
824 #elif defined(__LITTLE_ENDIAN)
825  u16 itt;
826 #define ISCSI_LOGIN_REQUEST_INDEX (0x3FFF<<0)
827 #define ISCSI_LOGIN_REQUEST_INDEX_SHIFT 0
828 #define ISCSI_LOGIN_REQUEST_TYPE (0x3<<14)
829 #define ISCSI_LOGIN_REQUEST_TYPE_SHIFT 14
830  u16 reserved2;
831 #endif
832 #if defined(__BIG_ENDIAN)
833  u16 cid;
834  u16 reserved3;
835 #elif defined(__LITTLE_ENDIAN)
836  u16 reserved3;
837  u16 cid;
838 #endif
845 #define ISCSI_LOGIN_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
846 #define ISCSI_LOGIN_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
847 #define ISCSI_LOGIN_REQUEST_NUM_RESP_BDS (0xFF<<24)
848 #define ISCSI_LOGIN_REQUEST_NUM_RESP_BDS_SHIFT 24
849 #if defined(__BIG_ENDIAN)
850  u16 reserved8;
851  u8 reserved7;
852  u8 flags;
853 #define ISCSI_LOGIN_REQUEST_RESERVED5 (0x3<<0)
854 #define ISCSI_LOGIN_REQUEST_RESERVED5_SHIFT 0
855 #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
856 #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
857 #define ISCSI_LOGIN_REQUEST_RESERVED6 (0x1F<<3)
858 #define ISCSI_LOGIN_REQUEST_RESERVED6_SHIFT 3
859 #elif defined(__LITTLE_ENDIAN)
860  u8 flags;
861 #define ISCSI_LOGIN_REQUEST_RESERVED5 (0x3<<0)
862 #define ISCSI_LOGIN_REQUEST_RESERVED5_SHIFT 0
863 #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN (0x1<<2)
864 #define ISCSI_LOGIN_REQUEST_UPDATE_EXP_STAT_SN_SHIFT 2
865 #define ISCSI_LOGIN_REQUEST_RESERVED6 (0x1F<<3)
866 #define ISCSI_LOGIN_REQUEST_RESERVED6_SHIFT 3
867  u8 reserved7;
868  u16 reserved8;
869 #endif
872 #if defined(__BIG_ENDIAN)
873  u8 cq_index;
874  u8 reserved10;
875  u8 reserved9;
876  u8 num_bds;
877 #elif defined(__LITTLE_ENDIAN)
878  u8 num_bds;
879  u8 reserved9;
880  u8 reserved10;
881  u8 cq_index;
882 #endif
883 };
884 
885 
886 /*
887  * iSCSI Login CQE
888  */
890 #if defined(__BIG_ENDIAN)
891  u8 op_code;
893 #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE (0x3<<0)
894 #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE_SHIFT 0
895 #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE (0x3<<2)
896 #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE_SHIFT 2
897 #define ISCSI_LOGIN_RESPONSE_RESERVED0 (0x3<<4)
898 #define ISCSI_LOGIN_RESPONSE_RESERVED0_SHIFT 4
899 #define ISCSI_LOGIN_RESPONSE_CONT (0x1<<6)
900 #define ISCSI_LOGIN_RESPONSE_CONT_SHIFT 6
901 #define ISCSI_LOGIN_RESPONSE_TRANSIT (0x1<<7)
902 #define ISCSI_LOGIN_RESPONSE_TRANSIT_SHIFT 7
903  u8 version_max;
904  u8 version_active;
905 #elif defined(__LITTLE_ENDIAN)
906  u8 version_active;
907  u8 version_max;
909 #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE (0x3<<0)
910 #define ISCSI_LOGIN_RESPONSE_NEXT_STAGE_SHIFT 0
911 #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE (0x3<<2)
912 #define ISCSI_LOGIN_RESPONSE_CURRENT_STAGE_SHIFT 2
913 #define ISCSI_LOGIN_RESPONSE_RESERVED0 (0x3<<4)
914 #define ISCSI_LOGIN_RESPONSE_RESERVED0_SHIFT 4
915 #define ISCSI_LOGIN_RESPONSE_CONT (0x1<<6)
916 #define ISCSI_LOGIN_RESPONSE_CONT_SHIFT 6
917 #define ISCSI_LOGIN_RESPONSE_TRANSIT (0x1<<7)
918 #define ISCSI_LOGIN_RESPONSE_TRANSIT_SHIFT 7
919  u8 op_code;
920 #endif
925 #if defined(__BIG_ENDIAN)
926  u16 reserved3;
927  u8 err_code;
928  u8 reserved2;
929 #elif defined(__LITTLE_ENDIAN)
930  u8 reserved2;
931  u8 err_code;
932  u16 reserved3;
933 #endif
936 #if defined(__BIG_ENDIAN)
937  u16 isid_hi;
938  u16 tsih;
939 #elif defined(__LITTLE_ENDIAN)
940  u16 tsih;
941  u16 isid_hi;
942 #endif
943 #if defined(__BIG_ENDIAN)
944  u8 status_class;
945  u8 status_detail;
946  u16 reserved4;
947 #elif defined(__LITTLE_ENDIAN)
948  u16 reserved4;
949  u8 status_detail;
950  u8 status_class;
951 #endif
953 #if defined(__BIG_ENDIAN)
954  u16 reserved6;
955  u16 itt;
956 #define ISCSI_LOGIN_RESPONSE_INDEX (0x3FFF<<0)
957 #define ISCSI_LOGIN_RESPONSE_INDEX_SHIFT 0
958 #define ISCSI_LOGIN_RESPONSE_TYPE (0x3<<14)
959 #define ISCSI_LOGIN_RESPONSE_TYPE_SHIFT 14
960 #elif defined(__LITTLE_ENDIAN)
961  u16 itt;
962 #define ISCSI_LOGIN_RESPONSE_INDEX (0x3FFF<<0)
963 #define ISCSI_LOGIN_RESPONSE_INDEX_SHIFT 0
964 #define ISCSI_LOGIN_RESPONSE_TYPE (0x3<<14)
965 #define ISCSI_LOGIN_RESPONSE_TYPE_SHIFT 14
966  u16 reserved6;
967 #endif
969 };
970 
971 
972 /*
973  * iSCSI Logout SQ WQE
974  */
976 #if defined(__BIG_ENDIAN)
977  u8 op_code;
978  u8 op_attr;
979 #define ISCSI_LOGOUT_REQUEST_REASON (0x7F<<0)
980 #define ISCSI_LOGOUT_REQUEST_REASON_SHIFT 0
981 #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE (0x1<<7)
982 #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE_SHIFT 7
983  u16 reserved0;
984 #elif defined(__LITTLE_ENDIAN)
985  u16 reserved0;
986  u8 op_attr;
987 #define ISCSI_LOGOUT_REQUEST_REASON (0x7F<<0)
988 #define ISCSI_LOGOUT_REQUEST_REASON_SHIFT 0
989 #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE (0x1<<7)
990 #define ISCSI_LOGOUT_REQUEST_ALWAYS_ONE_SHIFT 7
991  u8 op_code;
992 #endif
995 #if defined(__BIG_ENDIAN)
996  u16 reserved2;
997  u16 itt;
998 #define ISCSI_LOGOUT_REQUEST_INDEX (0x3FFF<<0)
999 #define ISCSI_LOGOUT_REQUEST_INDEX_SHIFT 0
1000 #define ISCSI_LOGOUT_REQUEST_TYPE (0x3<<14)
1001 #define ISCSI_LOGOUT_REQUEST_TYPE_SHIFT 14
1002 #elif defined(__LITTLE_ENDIAN)
1003  u16 itt;
1004 #define ISCSI_LOGOUT_REQUEST_INDEX (0x3FFF<<0)
1005 #define ISCSI_LOGOUT_REQUEST_INDEX_SHIFT 0
1006 #define ISCSI_LOGOUT_REQUEST_TYPE (0x3<<14)
1007 #define ISCSI_LOGOUT_REQUEST_TYPE_SHIFT 14
1008  u16 reserved2;
1009 #endif
1010 #if defined(__BIG_ENDIAN)
1011  u16 cid;
1012  u16 reserved3;
1013 #elif defined(__LITTLE_ENDIAN)
1014  u16 reserved3;
1015  u16 cid;
1016 #endif
1022 #if defined(__BIG_ENDIAN)
1023  u8 cq_index;
1024  u8 reserved6;
1025  u8 reserved5;
1026  u8 num_bds;
1027 #elif defined(__LITTLE_ENDIAN)
1028  u8 num_bds;
1029  u8 reserved5;
1030  u8 reserved6;
1031  u8 cq_index;
1032 #endif
1033 };
1034 
1035 
1036 /*
1037  * iSCSI Logout CQE
1038  */
1040 #if defined(__BIG_ENDIAN)
1041  u8 op_code;
1042  u8 reserved1;
1043  u8 response;
1044  u8 reserved0;
1045 #elif defined(__LITTLE_ENDIAN)
1046  u8 reserved0;
1047  u8 response;
1048  u8 reserved1;
1049  u8 op_code;
1050 #endif
1055 #if defined(__BIG_ENDIAN)
1056  u16 reserved5;
1057  u8 err_code;
1058  u8 reserved4;
1059 #elif defined(__LITTLE_ENDIAN)
1060  u8 reserved4;
1061  u8 err_code;
1062  u16 reserved5;
1063 #endif
1065 #if defined(__BIG_ENDIAN)
1066  u16 time_to_wait;
1067  u16 time_to_retain;
1068 #elif defined(__LITTLE_ENDIAN)
1069  u16 time_to_retain;
1070  u16 time_to_wait;
1071 #endif
1073 #if defined(__BIG_ENDIAN)
1074  u16 reserved8;
1075  u16 itt;
1076 #define ISCSI_LOGOUT_RESPONSE_INDEX (0x3FFF<<0)
1077 #define ISCSI_LOGOUT_RESPONSE_INDEX_SHIFT 0
1078 #define ISCSI_LOGOUT_RESPONSE_TYPE (0x3<<14)
1079 #define ISCSI_LOGOUT_RESPONSE_TYPE_SHIFT 14
1080 #elif defined(__LITTLE_ENDIAN)
1081  u16 itt;
1082 #define ISCSI_LOGOUT_RESPONSE_INDEX (0x3FFF<<0)
1083 #define ISCSI_LOGOUT_RESPONSE_INDEX_SHIFT 0
1084 #define ISCSI_LOGOUT_RESPONSE_TYPE (0x3<<14)
1085 #define ISCSI_LOGOUT_RESPONSE_TYPE_SHIFT 14
1086  u16 reserved8;
1087 #endif
1089 };
1090 
1091 
1092 /*
1093  * iSCSI Nop-In CQE
1094  */
1096 #if defined(__BIG_ENDIAN)
1097  u8 op_code;
1098  u8 reserved1;
1099  u16 reserved0;
1100 #elif defined(__LITTLE_ENDIAN)
1101  u16 reserved0;
1102  u8 reserved1;
1103  u8 op_code;
1104 #endif
1110 #if defined(__BIG_ENDIAN)
1111  u16 reserved4;
1112  u8 err_code;
1113  u8 reserved3;
1114 #elif defined(__LITTLE_ENDIAN)
1115  u8 reserved3;
1116  u8 err_code;
1117  u16 reserved4;
1118 #endif
1120  u32 lun[2];
1122 #if defined(__BIG_ENDIAN)
1123  u16 reserved7;
1124  u16 itt;
1125 #define ISCSI_NOP_IN_MSG_INDEX (0x3FFF<<0)
1126 #define ISCSI_NOP_IN_MSG_INDEX_SHIFT 0
1127 #define ISCSI_NOP_IN_MSG_TYPE (0x3<<14)
1128 #define ISCSI_NOP_IN_MSG_TYPE_SHIFT 14
1129 #elif defined(__LITTLE_ENDIAN)
1130  u16 itt;
1131 #define ISCSI_NOP_IN_MSG_INDEX (0x3FFF<<0)
1132 #define ISCSI_NOP_IN_MSG_INDEX_SHIFT 0
1133 #define ISCSI_NOP_IN_MSG_TYPE (0x3<<14)
1134 #define ISCSI_NOP_IN_MSG_TYPE_SHIFT 14
1135  u16 reserved7;
1136 #endif
1138 };
1139 
1140 
1141 /*
1142  * iSCSI NOP-OUT SQ WQE
1143  */
1145 #if defined(__BIG_ENDIAN)
1146  u8 op_code;
1147  u8 op_attr;
1148 #define ISCSI_NOP_OUT_REQUEST_RESERVED1 (0x7F<<0)
1149 #define ISCSI_NOP_OUT_REQUEST_RESERVED1_SHIFT 0
1150 #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE (0x1<<7)
1151 #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE_SHIFT 7
1152  u16 reserved0;
1153 #elif defined(__LITTLE_ENDIAN)
1154  u16 reserved0;
1155  u8 op_attr;
1156 #define ISCSI_NOP_OUT_REQUEST_RESERVED1 (0x7F<<0)
1157 #define ISCSI_NOP_OUT_REQUEST_RESERVED1_SHIFT 0
1158 #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE (0x1<<7)
1159 #define ISCSI_NOP_OUT_REQUEST_ALWAYS_ONE_SHIFT 7
1160  u8 op_code;
1161 #endif
1163  u32 lun[2];
1164 #if defined(__BIG_ENDIAN)
1165  u16 reserved2;
1166  u16 itt;
1167 #define ISCSI_NOP_OUT_REQUEST_INDEX (0x3FFF<<0)
1168 #define ISCSI_NOP_OUT_REQUEST_INDEX_SHIFT 0
1169 #define ISCSI_NOP_OUT_REQUEST_TYPE (0x3<<14)
1170 #define ISCSI_NOP_OUT_REQUEST_TYPE_SHIFT 14
1171 #elif defined(__LITTLE_ENDIAN)
1172  u16 itt;
1173 #define ISCSI_NOP_OUT_REQUEST_INDEX (0x3FFF<<0)
1174 #define ISCSI_NOP_OUT_REQUEST_INDEX_SHIFT 0
1175 #define ISCSI_NOP_OUT_REQUEST_TYPE (0x3<<14)
1176 #define ISCSI_NOP_OUT_REQUEST_TYPE_SHIFT 14
1177  u16 reserved2;
1178 #endif
1185 #define ISCSI_NOP_OUT_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
1186 #define ISCSI_NOP_OUT_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
1187 #define ISCSI_NOP_OUT_REQUEST_NUM_RESP_BDS (0xFF<<24)
1188 #define ISCSI_NOP_OUT_REQUEST_NUM_RESP_BDS_SHIFT 24
1189 #if defined(__BIG_ENDIAN)
1190  u16 reserved7;
1191  u8 reserved6;
1192  u8 flags;
1193 #define ISCSI_NOP_OUT_REQUEST_RESERVED4 (0x1<<0)
1194 #define ISCSI_NOP_OUT_REQUEST_RESERVED4_SHIFT 0
1195 #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION (0x1<<1)
1196 #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION_SHIFT 1
1197 #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL (0x3F<<2)
1198 #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL_SHIFT 2
1199 #elif defined(__LITTLE_ENDIAN)
1200  u8 flags;
1201 #define ISCSI_NOP_OUT_REQUEST_RESERVED4 (0x1<<0)
1202 #define ISCSI_NOP_OUT_REQUEST_RESERVED4_SHIFT 0
1203 #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION (0x1<<1)
1204 #define ISCSI_NOP_OUT_REQUEST_LOCAL_COMPLETION_SHIFT 1
1205 #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL (0x3F<<2)
1206 #define ISCSI_NOP_OUT_REQUEST_ZERO_FILL_SHIFT 2
1207  u8 reserved6;
1208  u16 reserved7;
1209 #endif
1212 #if defined(__BIG_ENDIAN)
1213  u8 cq_index;
1214  u8 reserved9;
1215  u8 reserved8;
1216  u8 num_bds;
1217 #elif defined(__LITTLE_ENDIAN)
1218  u8 num_bds;
1219  u8 reserved8;
1220  u8 reserved9;
1221  u8 cq_index;
1222 #endif
1223 };
1224 
1225 /*
1226  * iSCSI Reject CQE
1227  */
1229 #if defined(__BIG_ENDIAN)
1230  u8 op_code;
1231  u8 reserved1;
1232  u8 reason;
1233  u8 reserved0;
1234 #elif defined(__LITTLE_ENDIAN)
1235  u8 reserved0;
1236  u8 reason;
1237  u8 reserved1;
1238  u8 op_code;
1239 #endif
1244 #if defined(__BIG_ENDIAN)
1245  u16 reserved4;
1246  u8 err_code;
1247  u8 reserved3;
1248 #elif defined(__LITTLE_ENDIAN)
1249  u8 reserved3;
1250  u8 err_code;
1251  u16 reserved4;
1252 #endif
1255 };
1256 
1257 /*
1258  * bnx2i iSCSI TMF SQ WQE
1259  */
1261 #if defined(__BIG_ENDIAN)
1262  u8 op_code;
1263  u8 op_attr;
1264 #define ISCSI_TMF_REQUEST_FUNCTION (0x7F<<0)
1265 #define ISCSI_TMF_REQUEST_FUNCTION_SHIFT 0
1266 #define ISCSI_TMF_REQUEST_ALWAYS_ONE (0x1<<7)
1267 #define ISCSI_TMF_REQUEST_ALWAYS_ONE_SHIFT 7
1268  u16 reserved0;
1269 #elif defined(__LITTLE_ENDIAN)
1270  u16 reserved0;
1271  u8 op_attr;
1272 #define ISCSI_TMF_REQUEST_FUNCTION (0x7F<<0)
1273 #define ISCSI_TMF_REQUEST_FUNCTION_SHIFT 0
1274 #define ISCSI_TMF_REQUEST_ALWAYS_ONE (0x1<<7)
1275 #define ISCSI_TMF_REQUEST_ALWAYS_ONE_SHIFT 7
1276  u8 op_code;
1277 #endif
1279  u32 lun[2];
1280 #if defined(__BIG_ENDIAN)
1281  u16 reserved1;
1282  u16 itt;
1283 #define ISCSI_TMF_REQUEST_INDEX (0x3FFF<<0)
1284 #define ISCSI_TMF_REQUEST_INDEX_SHIFT 0
1285 #define ISCSI_TMF_REQUEST_TYPE (0x3<<14)
1286 #define ISCSI_TMF_REQUEST_TYPE_SHIFT 14
1287 #elif defined(__LITTLE_ENDIAN)
1288  u16 itt;
1289 #define ISCSI_TMF_REQUEST_INDEX (0x3FFF<<0)
1290 #define ISCSI_TMF_REQUEST_INDEX_SHIFT 0
1291 #define ISCSI_TMF_REQUEST_TYPE (0x3<<14)
1292 #define ISCSI_TMF_REQUEST_TYPE_SHIFT 14
1293  u16 reserved1;
1294 #endif
1303 #if defined(__BIG_ENDIAN)
1304  u8 cq_index;
1305  u8 reserved5;
1306  u8 reserved4;
1307  u8 num_bds;
1308 #elif defined(__LITTLE_ENDIAN)
1309  u8 num_bds;
1310  u8 reserved4;
1311  u8 reserved5;
1312  u8 cq_index;
1313 #endif
1314 };
1315 
1316 /*
1317  * iSCSI Text SQ WQE
1318  */
1320 #if defined(__BIG_ENDIAN)
1321  u8 op_code;
1322  u8 op_attr;
1323 #define ISCSI_TEXT_REQUEST_RESERVED1 (0x3F<<0)
1324 #define ISCSI_TEXT_REQUEST_RESERVED1_SHIFT 0
1325 #define ISCSI_TEXT_REQUEST_CONT (0x1<<6)
1326 #define ISCSI_TEXT_REQUEST_CONT_SHIFT 6
1327 #define ISCSI_TEXT_REQUEST_FINAL (0x1<<7)
1328 #define ISCSI_TEXT_REQUEST_FINAL_SHIFT 7
1329  u16 reserved0;
1330 #elif defined(__LITTLE_ENDIAN)
1331  u16 reserved0;
1332  u8 op_attr;
1333 #define ISCSI_TEXT_REQUEST_RESERVED1 (0x3F<<0)
1334 #define ISCSI_TEXT_REQUEST_RESERVED1_SHIFT 0
1335 #define ISCSI_TEXT_REQUEST_CONT (0x1<<6)
1336 #define ISCSI_TEXT_REQUEST_CONT_SHIFT 6
1337 #define ISCSI_TEXT_REQUEST_FINAL (0x1<<7)
1338 #define ISCSI_TEXT_REQUEST_FINAL_SHIFT 7
1339  u8 op_code;
1340 #endif
1342  u32 lun[2];
1343 #if defined(__BIG_ENDIAN)
1344  u16 reserved3;
1345  u16 itt;
1346 #define ISCSI_TEXT_REQUEST_INDEX (0x3FFF<<0)
1347 #define ISCSI_TEXT_REQUEST_INDEX_SHIFT 0
1348 #define ISCSI_TEXT_REQUEST_TYPE (0x3<<14)
1349 #define ISCSI_TEXT_REQUEST_TYPE_SHIFT 14
1350 #elif defined(__LITTLE_ENDIAN)
1351  u16 itt;
1352 #define ISCSI_TEXT_REQUEST_INDEX (0x3FFF<<0)
1353 #define ISCSI_TEXT_REQUEST_INDEX_SHIFT 0
1354 #define ISCSI_TEXT_REQUEST_TYPE (0x3<<14)
1355 #define ISCSI_TEXT_REQUEST_TYPE_SHIFT 14
1356  u16 reserved3;
1357 #endif
1364 #define ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH (0xFFFFFF<<0)
1365 #define ISCSI_TEXT_REQUEST_RESP_BUFFER_LENGTH_SHIFT 0
1366 #define ISCSI_TEXT_REQUEST_NUM_RESP_BDS (0xFF<<24)
1367 #define ISCSI_TEXT_REQUEST_NUM_RESP_BDS_SHIFT 24
1371 #if defined(__BIG_ENDIAN)
1372  u8 cq_index;
1373  u8 reserved7;
1374  u8 reserved6;
1375  u8 num_bds;
1376 #elif defined(__LITTLE_ENDIAN)
1377  u8 num_bds;
1378  u8 reserved6;
1379  u8 reserved7;
1380  u8 cq_index;
1381 #endif
1382 };
1383 
1384 /*
1385  * iSCSI SQ WQE
1386  */
1395 };
1396 
1397 
1398 /*
1399  * iSCSI TMF CQE
1400  */
1402 #if defined(__BIG_ENDIAN)
1403  u8 op_code;
1404  u8 reserved1;
1405  u8 response;
1406  u8 reserved0;
1407 #elif defined(__LITTLE_ENDIAN)
1408  u8 reserved0;
1409  u8 response;
1410  u8 reserved1;
1411  u8 op_code;
1412 #endif
1417 #if defined(__BIG_ENDIAN)
1418  u16 reserved5;
1419  u8 err_code;
1420  u8 reserved4;
1421 #elif defined(__LITTLE_ENDIAN)
1422  u8 reserved4;
1423  u8 err_code;
1424  u16 reserved5;
1425 #endif
1427 #if defined(__BIG_ENDIAN)
1428  u16 reserved7;
1429  u16 itt;
1430 #define ISCSI_TMF_RESPONSE_INDEX (0x3FFF<<0)
1431 #define ISCSI_TMF_RESPONSE_INDEX_SHIFT 0
1432 #define ISCSI_TMF_RESPONSE_TYPE (0x3<<14)
1433 #define ISCSI_TMF_RESPONSE_TYPE_SHIFT 14
1434 #elif defined(__LITTLE_ENDIAN)
1435  u16 itt;
1436 #define ISCSI_TMF_RESPONSE_INDEX (0x3FFF<<0)
1437 #define ISCSI_TMF_RESPONSE_INDEX_SHIFT 0
1438 #define ISCSI_TMF_RESPONSE_TYPE (0x3<<14)
1439 #define ISCSI_TMF_RESPONSE_TYPE_SHIFT 14
1440  u16 reserved7;
1441 #endif
1443 };
1444 
1445 /*
1446  * iSCSI Text CQE
1447  */
1449 #if defined(__BIG_ENDIAN)
1450  u8 op_code;
1452 #define ISCSI_TEXT_RESPONSE_RESERVED1 (0x3F<<0)
1453 #define ISCSI_TEXT_RESPONSE_RESERVED1_SHIFT 0
1454 #define ISCSI_TEXT_RESPONSE_CONT (0x1<<6)
1455 #define ISCSI_TEXT_RESPONSE_CONT_SHIFT 6
1456 #define ISCSI_TEXT_RESPONSE_FINAL (0x1<<7)
1457 #define ISCSI_TEXT_RESPONSE_FINAL_SHIFT 7
1458  u16 reserved0;
1459 #elif defined(__LITTLE_ENDIAN)
1460  u16 reserved0;
1462 #define ISCSI_TEXT_RESPONSE_RESERVED1 (0x3F<<0)
1463 #define ISCSI_TEXT_RESPONSE_RESERVED1_SHIFT 0
1464 #define ISCSI_TEXT_RESPONSE_CONT (0x1<<6)
1465 #define ISCSI_TEXT_RESPONSE_CONT_SHIFT 6
1466 #define ISCSI_TEXT_RESPONSE_FINAL (0x1<<7)
1467 #define ISCSI_TEXT_RESPONSE_FINAL_SHIFT 7
1468  u8 op_code;
1469 #endif
1475 #if defined(__BIG_ENDIAN)
1476  u16 reserved4;
1477  u8 err_code;
1478  u8 reserved3;
1479 #elif defined(__LITTLE_ENDIAN)
1480  u8 reserved3;
1481  u8 err_code;
1482  u16 reserved4;
1483 #endif
1485  u32 lun[2];
1487 #if defined(__BIG_ENDIAN)
1488  u16 reserved7;
1489  u16 itt;
1490 #define ISCSI_TEXT_RESPONSE_INDEX (0x3FFF<<0)
1491 #define ISCSI_TEXT_RESPONSE_INDEX_SHIFT 0
1492 #define ISCSI_TEXT_RESPONSE_TYPE (0x3<<14)
1493 #define ISCSI_TEXT_RESPONSE_TYPE_SHIFT 14
1494 #elif defined(__LITTLE_ENDIAN)
1495  u16 itt;
1496 #define ISCSI_TEXT_RESPONSE_INDEX (0x3FFF<<0)
1497 #define ISCSI_TEXT_RESPONSE_INDEX_SHIFT 0
1498 #define ISCSI_TEXT_RESPONSE_TYPE (0x3<<14)
1499 #define ISCSI_TEXT_RESPONSE_TYPE_SHIFT 14
1500  u16 reserved7;
1501 #endif
1503 };
1504 
1505 /*
1506  * iSCSI CQE
1507  */
1518 };
1519 
1520 #endif /* __57XX_ISCSI_HSI_LINUX_LE__ */