1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright 2010 QLogic Corporation */
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _QL_IOCB_H
#define _QL_IOCB_H
/*
* ISP2xxx Solaris Fibre Channel Adapter (FCA) driver header file.
*
* ***********************************************************************
* * **
* * NOTICE **
* * COPYRIGHT (C) 1996-2010 QLOGIC CORPORATION **
* * ALL RIGHTS RESERVED **
* * **
* ***********************************************************************
*
*/
#ifdef __cplusplus
extern "C" {
#endif
#define INVALID_ENTRY_TYPE 0
/*
* ISP queue - 32-Bit DMA addressing command with extended LUN support
* entry structure definition.
*/
#define IOCB_CMD_TYPE_2 0x11 /* Command entry */
#define MAX_CMDSZ 16 /* SCSI maximum CDB size. */
#define CMD_TYPE_2_DATA_SEGMENTS 3 /* Number of data segments. */
typedef struct cmd_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t target_l; /* SCSI ID - LSB */
uint8_t target_h; /* SCSI ID - MSB */
uint8_t lun_l; /* SCSI LUN - LSB */
uint8_t lun_h; /* SCSI LUN - MSB */
uint8_t control_flags_l; /* Control flags - LSB. */
uint8_t control_flags_h; /* Control flags - MSB. */
uint8_t reserved_1[2];
uint16_t timeout; /* Command timeout. */
uint16_t dseg_count; /* Data segment count - LSB. */
uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */
uint32_t byte_count; /* Total byte count. */
uint32_t dseg_0_address; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
uint32_t dseg_2_address; /* Data segment 2 address. */
uint32_t dseg_2_length; /* Data segment 2 length. */
} cmd_entry_t, request_t;
/*
* Command entry control flags least significant byte.
*/
#define CF_HTAG BIT_1
#define CF_OTAG BIT_2
#define CF_STAG BIT_3
#define CF_DATA_IN BIT_5
#define CF_DATA_OUT BIT_6
/*
* ISP24xx queue - Command IOCB structure definition.
*/
#define IOCB_CMD_TYPE_7 0x18
#define CMD_TYPE_7_DATA_SEGMENTS 1 /* Number of 64 bit data segments. */
typedef struct cmd7_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t n_port_hdl;
uint16_t timeout; /* Command timeout. */
uint16_t dseg_count;
uint8_t reserved_1[2];
uint8_t fcp_lun[8]; /* SCSI LUN ID. */
uint8_t control_flags;
uint8_t task_mgmt; /* Task management flags. */
uint8_t task; /* Task Attributes Values. */
uint8_t crn; /* Command reference number. */
uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command bytes. */
uint32_t total_byte_count;
uint8_t target_id[3]; /* SCSI Target ID */
uint8_t vp_index;
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
} cmd7_24xx_entry_t;
/*
* ISP24xx queue - Command IOCB structure definition.
*/
#define IOCB_CMD_TYPE_6 0x48
#define CMD_TYPE_6_DATA_SEGMENTS 1 /* Number of 64 bit data segments. */
typedef struct cmd6_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t n_port_hdl;
uint16_t timeout; /* Command timeout. */
uint16_t dseg_count;
uint16_t rsp_length;
uint8_t fcp_lun[8]; /* SCSI LUN ID. */
uint16_t control_flags;
uint16_t cmnd_length;
uint32_t cmnd_address[2];
uint32_t rsp_address[2]; /* Data segment 0 address. */
uint32_t total_byte_count;
uint8_t target_id[3]; /* SCSI Target ID */
uint8_t vp_index;
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
} cmd6_24xx_entry_t;
typedef struct fcp_cmnd {
uint8_t fcp_lun[8]; /* SCSI LUN ID. */
uint8_t crn; /* Command reference number. */
uint8_t task; /* Task Attributes Values. */
uint8_t task_mgmt; /* Task management flags. */
uint8_t control_flags; /* Plus additional cdb length */
uint8_t scsi_cdb[MAX_CMDSZ];
uint32_t dl;
} fcp_cmnd_t;
typedef struct cmd6_2400_dma {
fcp_cmnd_t cmd;
uint32_t cookie_list[QL_DMA_SG_LIST_LENGTH + 1][3];
} cmd6_2400_dma_t;
/*
* Task Management Flags.
*/
#define TF_TARGET_RESET BIT_13
#define TF_LUN_RESET BIT_12
#define TF_CLEAR_TASK_SET BIT_10
#define TF_ABORT_TASK_SET BIT_9
/*
* Task Attributes Values.
*/
#define TA_STAG 0
#define TA_HTAG 1
#define TA_OTAG 2
#define TA_ACA 4
#define TA_UNTAGGED 5
/*
* Control Flags.
*/
#define CF_DSD_PTR BIT_2
#define CF_RD BIT_1
#define CF_WR BIT_0
/*
* ISP queue - 64-Bit DMA addressing command with extended LUN support
* entry structure definition.
*/
#define IOCB_CMD_TYPE_3 0x19 /* Command Type 3 entry (64 bit) */
#define CMD_TYPE_3_DATA_SEGMENTS 2 /* Number of 64 bit data segments. */
typedef struct cmd_3_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t target_l; /* SCSI ID - LSB */
uint8_t target_h; /* SCSI ID - MSB */
uint8_t lun_l; /* SCSI LUN - LSB */
uint8_t lun_h; /* SCSI LUN - MSB */
uint8_t control_flags_l; /* Control flags - LSB. */
uint8_t control_flags_h; /* Control flags - MSB. */
uint8_t reserved_1[2];
uint16_t timeout; /* Command timeout. */
uint16_t dseg_count; /* Data segment count - LSB. */
uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */
uint32_t byte_count; /* Total byte count. */
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address[2]; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
} cmd_3_entry_t;
/*
* ISP queue - Command type 4 DSD list pointer structure definition.
*/
#define COMMAND_CHAINING_TYPE 0x15
typedef struct cmd_chaining_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t reserved;
uint8_t target; /* SCSI ID */
uint8_t lun_l; /* SCSI LUN - LSB */
uint8_t lun_h; /* SCSI LUN - MSB */
uint8_t control_flags_l; /* Control flags - LSB. */
uint8_t control_flags_h; /* Control flags - MSB. */
uint8_t crn;
uint8_t vp_index;
uint8_t timeout_l; /* Command timeout - LSB. */
uint8_t timeout_h; /* Command timeout - MSB. */
uint8_t dseg_count_l; /* Data segment count - LSB. */
uint8_t dseg_count_h; /* Data segment count - MSB. */
uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */
uint32_t byte_count; /* Total byte count. */
uint16_t list_type; /* 0 = 32bit, 1 = 64bit. */
uint16_t base_address[2];
uint16_t list_address[4];
uint8_t reserved_2[10];
} cmd_chaining_entry_t;
/*
* ISP queue - continuation entry structure definition.
*/
#define CONTINUATION_TYPE_0 0x02 /* Continuation entry. */
#define CONT_TYPE_0_DATA_SEGMENTS 7 /* Number of 32 bit data segments. */
typedef struct cont_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t reserved;
uint32_t dseg_0_address; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
uint32_t dseg_2_address; /* Data segment 2 address. */
uint32_t dseg_2_length; /* Data segment 2 length. */
uint32_t dseg_3_address; /* Data segment 3 address. */
uint32_t dseg_3_length; /* Data segment 3 length. */
uint32_t dseg_4_address; /* Data segment 4 address. */
uint32_t dseg_4_length; /* Data segment 4 length. */
uint32_t dseg_5_address; /* Data segment 5 address. */
uint32_t dseg_5_length; /* Data segment 5 length. */
uint32_t dseg_6_address; /* Data segment 6 address. */
uint32_t dseg_6_length; /* Data segment 6 length. */
} cont_entry_t;
/*
* ISP queue - 64-Bit addressing, continuation entry structure definition.
*/
#define CONTINUATION_TYPE_1 0x0A /* Continuation Type 1 entry. */
#define CONT_TYPE_1_DATA_SEGMENTS 5 /* Number of 64 bit data segments. */
typedef struct cont_type_1_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address[2]; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
uint32_t dseg_2_address[2]; /* Data segment 2 address. */
uint32_t dseg_2_length; /* Data segment 2 length. */
uint32_t dseg_3_address[2]; /* Data segment 3 address. */
uint32_t dseg_3_length; /* Data segment 3 length. */
uint32_t dseg_4_address[2]; /* Data segment 4 address. */
uint32_t dseg_4_length; /* Data segment 4 length. */
} cont_type_1_entry_t;
/*
* ISP queue - status entry structure definition.
*/
#define STATUS_TYPE 0x03 /* Status entry. */
typedef struct sts_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle. */
uint8_t scsi_status_l; /* SCSI status - LSB. */
uint8_t scsi_status_h; /* SCSI status - MSB. */
uint16_t comp_status; /* Completion status. */
uint8_t state_flags_l; /* State flags - LSB. */
uint8_t state_flags_h; /* State flags. */
uint8_t status_flags_l; /* Status flags. */
uint8_t status_flags_h; /* Status flags - MSB. */
uint16_t rsp_info_length; /* Response Info Length. */
uint16_t req_sense_length; /* Request sense data length. */
uint32_t residual_length; /* Residual transfer length. */
uint8_t rsp_info[8]; /* FCP response information. */
uint8_t req_sense_data[32]; /* Request sense data. */
} sts_entry_t, response_t;
/*
* Status entry entry status
*/
#define RF_INV_E_ORDER BIT_5 /* Invalid entry order. */
#define RF_INV_E_COUNT BIT_4 /* Invalid entry count. */
#define RF_INV_E_PARAM BIT_3 /* Invalid entry parameter. */
#define RF_INV_E_TYPE BIT_2 /* Invalid entry type. */
#define RF_BUSY BIT_1 /* Busy */
/*
* Status entry SCSI status most significant byte.
*/
#define FCP_CONF_REQ BIT_4
#define FCP_RESID_UNDER BIT_3
#define FCP_RESID_OVER BIT_2
#define FCP_SNS_LEN_VALID BIT_1
#define FCP_RSP_LEN_VALID BIT_0
#define FCP_RSP_MASK (FCP_RESID_UNDER | FCP_RESID_OVER | \
FCP_RSP_LEN_VALID)
/*
* Status entry state flag most significant byte.
* Not used in by ISP24xx
*/
#define SF_ARQ_DONE BIT_5
#define SF_GOT_STATUS BIT_4
#define SF_XFERRED_DATA BIT_3
#define SF_SENT_CMD BIT_2
#define SF_GOT_TARGET BIT_1
#define SF_GOT_BUS BIT_0
/*
* Status entry state flag least significant byte.
* Not used in by ISP24xx
*/
#define SF_NO_FAST_POST BIT_7
#define SF_DATA_OUT BIT_6
#define SF_DATA_IN BIT_5
#define SF_SIMPLE_Q BIT_3
#define SF_ORDERED_Q BIT_2
#define SF_HEAD_OF_Q BIT_1
#define SF_ACA_Q BIT_0
/*
* Status entry completion status definitions.
*/
#define CS_COMPLETE 0x0 /* No errors */
#define CS_INCOMPLETE 0x1 /* Incomplete transfer of cmd. */
#define CS_DMA_ERROR 0x2 /* A DMA direction error. */
#define CS_PORT_ID_CHANGE 0x2 /* The port ID has changed. */
#define CS_TRANSPORT 0x3 /* Transport error. */
#define CS_RESET 0x4 /* SCSI bus reset occurred */
#define CS_ABORTED 0x5 /* System aborted command. */
#define CS_TIMEOUT 0x6 /* Timeout error. */
#define CS_DATA_OVERRUN 0x7 /* Data overrun. */
#define CS_INVALID_RX_ID 0x8 /* Invalid RX_ID. */
#define CS_DATA_REASSEM_ERROR 0x11 /* Data reassembly error. */
#define CS_ABTS_REC 0x13 /* ABTS from target. */
#define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */
#define CS_QUEUE_FULL 0x1C /* Queue Full. */
#define CS_PORT_UNAVAILABLE 0x28 /* Port unavailable */
/* (selection timeout) */
#define CS_PORT_LOGGED_OUT 0x29 /* Port Logged Out */
#define CS_PORT_CONFIG_CHG 0x2A /* Port Configuration Changed */
#define CS_PORT_BUSY 0x2B /* Port Busy */
#define CS_RESOUCE_UNAVAILABLE 0x2C /* Frimware resource unavailable. */
#define CS_TASK_MGMT_OVERRUN 0x30 /* Task management overrun. */
#define CS_LOGIN_LOGOUT_ERROR 0x31 /* login/logout IOCB error. */
#define CS_SEQ_COMPLETE 0x40 /* Sequence Complete. */
#define CS_ABORTED_SEQ_REC 0x47 /* Abort sequence was received. */
#define CS_INVALID_PARAMETER 0x102 /* IP invalid_parameter. */
#define CS_ERROR_RESOURCE 0x103 /* IP insufficient resources. */
#define CS_IP_NOT_INITIALIZED 0x104 /* IP not_initialized. */
#define CS_BAD_PAYLOAD 0x180 /* Driver defined */
#define CS_UNKNOWN 0x181 /* Driver defined */
#define CS_CMD_FAILED 0x182 /* Driver defined */
#define CS_LOOP_DOWN_ABORT 0x183 /* Driver defined */
#define CS_FCP_RESPONSE_ERROR 0x184 /* Driver defined */
#define CS_DEVICE_UNAVAILABLE 0x185 /* Driver defined */
/*
* ISP24xx queue - Status IOCB structure definition.
*/
typedef struct sts_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle. */
uint16_t comp_status; /* Completion status. */
uint16_t ox_id;
uint32_t residual_length; /* Residual transfer length. */
uint16_t reserved;
uint8_t state_flags_l; /* State flags. */
uint8_t state_flags_h;
uint16_t reserved_1;
uint8_t scsi_status_l; /* SCSI status - LSB. */
uint8_t scsi_status_h; /* SCSI status - MSB. */
uint32_t fcp_rsp_residual_count;
uint32_t fcp_sense_length;
uint32_t fcp_rsp_data_length; /* Response Info Length. */
uint8_t rsp_sense_data[28]; /* FCP response and/or sense data. */
} sts_24xx_entry_t;
/*
* ISP queue - status continuation entry structure definition.
*/
#define STATUS_CONT_TYPE 0x10 /* Status continuation entry. */
typedef struct sts_cont_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint8_t req_sense_data[60]; /* Request sense data. */
} sts_cont_entry_t;
/*
* ISP queue - marker with extended LUN support
* entry structure definition.
*/
#define MARKER_TYPE 0x04 /* Marker entry. */
typedef struct mrk_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t sys_define_2; /* System defined. */
uint8_t target_l; /* SCSI ID - LSB */
uint8_t target_h; /* SCSI ID - MSB */
uint8_t modifier; /* Modifier (7-0). */
uint8_t reserved_1;
uint8_t sequence_number[2]; /* Sequence number of event. */
uint8_t lun_l; /* SCSI LUN - LSB */
uint8_t lun_h; /* SCSI LUN - MSB */
uint8_t reserved_2[48];
} mrk_entry_t;
/*
* Marker modifiers
*/
#define MK_SYNC_ID_LUN 0 /* Synchronize ID/LUN */
#define MK_SYNC_ID 1 /* Synchronize ID */
#define MK_SYNC_ALL 2 /* Synchronize all ID/LUN */
#define MK_SYNC_LIP 3 /* Synchronize all ID/LUN, */
/* clear port changed, */
/* use sequence number. */
/*
* ISP24xx queue - Marker IOCB structure definition.
*/
typedef struct marker_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t n_port_hdl;
uint8_t modifier; /* Modifier */
uint8_t reserved[2];
uint8_t vp_index;
uint8_t reserved_1[2];
uint8_t fcp_lun[8]; /* SCSI LUN ID. */
uint8_t reserved_2[40];
} marker_24xx_entry_t;
/*
* ISP queue - Management Server entry structure definition.
*/
#define MS_TYPE 0x29
#define MS_DATA_SEGMENTS 1 /* Number of data segments. */
typedef struct ms_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t loop_id_l; /* device id - LSB */
uint8_t loop_id_h; /* device id - MSB */
uint16_t comp_status; /* Completion status */
uint8_t control_flags_l; /* Control flags - LSB. */
uint8_t control_flags_h; /* Control flags - MSB. */
uint8_t reserved_1[2];
uint16_t timeout; /* Command timeout. */
uint8_t cmd_dseg_count_l; /* CMD segment count - LSB. */
uint8_t cmd_dseg_count_h; /* CMD segment count - MSB. */
uint16_t total_dseg_count; /* CMD + RESP segment count. */
uint8_t reserved_2[10];
uint32_t resp_byte_count; /* Response byte count */
uint32_t cmd_byte_count; /* Command byte count */
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address[2]; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
} ms_entry_t;
/*
* ISP24xx queue - CT Pass-Through IOCB structure definition.
*/
#define CT_PASSTHRU_TYPE 0x29
#define CT_PASSTHRU_DATA_SEGMENTS 1 /* Number of data segments. */
typedef struct ct_passthru_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t status;
uint16_t n_port_hdl;
uint16_t cmd_dseg_count;
uint8_t vp_index;
uint8_t reserved;
uint16_t timeout;
uint16_t reserved_1;
uint16_t resp_dseg_count;
uint8_t reserved_2[10];
uint32_t resp_byte_count;
uint32_t cmd_byte_count;
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address[2]; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
} ct_passthru_entry_t;
/*
* ISP24xx queue - ELS Pass-Through IOCB structure definition.
*/
#define ELS_PASSTHRU_TYPE 0x53
typedef struct els_passthru_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t reserved_8_9;
uint16_t n_port_hdl;
uint16_t xmt_dseg_count; /* Only one allowed */
uint8_t vp_index;
uint8_t sof_type;
uint32_t rcv_exch_address;
uint16_t rcv_dseg_count;
uint8_t els_cmd_opcode;
uint8_t reserved_17;
uint8_t d_id_7_0;
uint8_t d_id_15_8;
uint8_t d_id_23_16;
uint8_t s_id_23_16;
uint8_t s_id_7_0;
uint8_t s_id_15_8;
uint16_t control_flags;
uint32_t rcv_payld_data_bcnt;
uint32_t xmt_payld_data_bcnt;
uint32_t xmt_dseg_0_address[2]; /* Tx Data segment 0 address. */
uint32_t xmt_dseg_0_length; /* Tx Data segment 0 length. */
uint32_t rcv_dseg_0_address[2]; /* Rx Data segment 0 address. */
uint32_t rcv_dseg_0_length; /* Rx Data segment 0 length. */
} els_passthru_entry_t;
/*
* ISP24x queue - ELS Pass-Through IOCB response.
*/
typedef struct els_passthru_entry_rsp {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t comp_status;
uint16_t n_port_hdl;
uint16_t reserved_c_d;
uint8_t vp_index;
uint8_t sof_type;
uint32_t rcv_exch_addr;
uint16_t reserved_14_15;
uint8_t els_cmd_opcode;
uint8_t reserved_17;
uint8_t d_id_7_0;
uint8_t d_id_15_8;
uint8_t d_id_23_16;
uint8_t s_id_23_16;
uint8_t s_id_7_0;
uint8_t s_id_15_8;
uint16_t control_flags;
uint32_t total_data_bcnt;
uint32_t error_subcode1;
uint32_t error_subcode2;
uint8_t reserved_2c_3f[20];
} els_passthru_entry_rsp_t;
/*
* ISP24xx queue - Task Management IOCB structure definition.
*/
#define TASK_MGMT_TYPE 0x14
typedef struct task_mgmt_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t n_port_hdl;
uint16_t reserved;
uint16_t delay;
uint16_t timeout;
uint8_t fcp_lun[8]; /* SCSI LUN ID. */
uint32_t control_flags;
uint8_t reserved_1[20];
uint8_t target_id[3]; /* SCSI Target ID */
uint8_t vp_index;
uint8_t reserved_2[12];
} task_mgmt_entry_t;
/*
* Control Flags.
*/
#define CF_DO_NOT_SEND BIT_31
#define CF_LUN_RESET BIT_4
#define CF_ABORT_TASK_SET BIT_3
#define CF_CLEAR_TASK_SET BIT_2
#define CF_TARGET_RESET BIT_1
#define CF_CLEAR_ACA BIT_0
/*
* ISP24xx queue - Abort I/O IOCB structure definition.
*/
#define ABORT_CMD_TYPE 0x33
typedef struct abort_cmd_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t n_port_hdl; /* also comp_status */
uint8_t options;
uint8_t options_h;
uint32_t cmd_handle;
uint8_t reserved[32];
uint8_t target_id[3]; /* Port ID */
uint8_t vp_index;
uint8_t reserved_1[12];
} abort_cmd_entry_t;
/*
* Option Flags.
*/
#define AF_NO_ABTS BIT_0
/*
* ISP24xx queue - Login/Logout Port IOCB structure definition.
*/
#define LOG_TYPE 0x52
typedef struct log_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t status;
uint16_t n_port_hdl;
uint16_t control_flags;
uint8_t vp_index;
uint8_t reserved;
uint8_t port_id[3];
uint8_t rsp_size;
uint32_t io_param[11];
} log_entry_t;
/*
* ISP24xx control flag commands
*/
#define CF_CMD_PLOGI 0x00
#define CF_CMD_PRLI 0x01
#define CF_CMD_PDISC 0x02
#define CF_CMD_ADISC 0x03
#define CF_CMD_LOGO 0x08
#define CF_CMD_PRLO 0x09
#define CF_CMD_TPRLO 0x0A
/*
* ISP24xx control flag command options
*/
#define CFO_COND_PLOGI BIT_4
#define CFO_SKIP_PRLI BIT_5
#define CFO_COMMON_FEATURES BIT_7
#define CFO_CLASS_2 BIT_8
#define CFO_FCP_2_OVR BIT_9
#define CFO_IMPLICIT_LOGO BIT_4
#define CFO_IMPLICIT_LOGO_ALL BIT_5
#define CFO_EXPLICIT_LOGO BIT_6
#define CFO_FREE_N_PORT_HANDLE BIT_7
#define CFO_IMPLICIT_PRLO BIT_4
/*
* ISP24xx Login/Logout Status Sub Codes in in I/O Parameter 0 field.
*/
#define CS0_NO_LINK 0x01
#define CS0_NO_IOCB 0x02
#define CS0_NO_EXCH_CTRL_BLK 0x03
#define CS0_COMMAND_FAILED 0x04
#define CS0_NO_FABRIC_PRESENT 0x05
#define CS0_FIRMWARE_NOT_READY 0x07
#define CS0_PORT_NOT_LOGGED_IN 0x09
#define CS0_NO_PCB_ALLOCATED 0x0A
#define CS0_ELS_REJECT_RECEIVED 0x18
#define CS0_CMD_PARAMETER_ERROR 0x19
#define CS0_PORT_ID_USED 0x1A
#define CS0_N_PORT_HANDLE_USED 0x1B
#define CS0_NO_N_PORT_HANDLE_AVAILABLE 0x1C
#define CS0_NO_FLOGI_ACC 0x1F
/*
* ISP24xx Login/Logout Status Sub Codes in in I/O Parameter 1 field.
*/
#define CS1_PLOGI_FAILED 0x02
#define CS1_PLOGI_RESPONSE_FAILED 0x03
#define CS1_PRLI_FAILED 0x04
#define CS1_PRLI_RESPONSE_FAILED 0x05
#define CS1_COMMAND_LOGGED_OUT 0x07
/*
* ISP queue - Enable LUN with extended LUN support
* entry structure definition.
*/
#define ENABLE_LUN_TYPE 0xB /* Enable LUN entry */
typedef struct enable_lun_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t reserved[8];
uint8_t status;
uint8_t reserved_1;
uint8_t command_count;
uint8_t immediate_notify_count;
uint8_t reserved_2[2];
uint8_t timeout_l; /* Timeout - LSB. */
uint8_t timeout_h; /* Timeout - MSB. */
uint8_t reserved_3[40];
} enable_lun_entry_t;
/*
* ISP queue - Modify LUN with extended LUN support
* entry structure definition.
*/
#define MODIFY_LUN_TYPE 0xC /* Modify LUN entry */
typedef struct modify_lun_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t reserved[2];
uint8_t operators;
uint8_t reserved_1[5];
uint8_t status;
uint8_t reserved_2;
uint8_t command_count;
uint8_t immediate_notify_count;
uint8_t reserved_3[2];
uint8_t timeout_l; /* Timeout - LSB. */
uint8_t timeout_h; /* Timeout - MSB. */
uint8_t reserved_4[40];
} modify_lun_entry_t;
/*
* ISP queue - Immediate Notify with extended LUN support
* entry structure definition.
*/
#define IMMEDIATE_NOTIFY_TYPE 0xD /* Immediate notify entry */
typedef struct immediate_notify_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t initiator_id_l;
uint8_t initiator_id_h;
uint8_t lun_l;
uint8_t lun_h;
uint8_t reserved_1[4];
uint16_t status;
uint8_t task_flags_l;
uint8_t task_flags_h;
uint16_t sequence_id;
uint8_t reserved_3[40];
uint16_t ox_id;
} immediate_notify_entry_t;
/*
* ISP24xx queue - Immediate Notify IOCB structure definition.
*/
typedef struct immd_notify_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t reserved;
uint16_t n_port_hdl;
uint16_t reserved_1;
uint16_t flags;
uint16_t srr_rx_id;
uint16_t status;
uint8_t status_subcode;
uint8_t reserved_2;
uint32_t receive_exchange_address;
uint32_t srr_relative_offset;
uint16_t srr_iu;
uint16_t srr_ox_id;
uint8_t reserved_3[19];
uint8_t vp_index;
uint8_t reserved_4[10];
uint16_t ox_id;
} immd_notify_24xx_entry_t;
/*
* ISP queue - Notify Acknowledge extended LUN support
* entry structure definition.
*/
#define NOTIFY_ACKNOWLEDGE_TYPE 0xE /* Immediate notify entry */
typedef struct notify_acknowledge_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t initiator_id_l;
uint8_t initiator_id_h;
uint8_t reserved_1[2];
uint8_t flags_l;
uint8_t flags_h;
uint8_t reserved_2[2];
uint16_t status;
uint8_t task_flags_l;
uint8_t task_flags_h;
uint16_t sequence_id;
uint8_t reserved_3[42];
} notify_acknowledge_entry_t;
/*
* ISP24xx queue - Notify Acknowledge IOCB structure definition.
*/
typedef struct notify_ack_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle;
uint16_t n_port_hdl;
uint16_t reserved_1;
uint16_t flags;
uint16_t srr_rx_id;
uint16_t status;
uint8_t status_subcode;
uint8_t reserved_2;
uint32_t receive_exchange_address;
uint32_t srr_relative_offset;
uint16_t srr_iu;
uint16_t srr_flags;
uint8_t reserved_3[19];
uint8_t vp_index;
uint8_t srr_reject_vendor_unique;
uint8_t srr_reject_code_explanation;
uint8_t srr_reject_code;
uint8_t reserved_4[7];
uint16_t ox_id;
} notify_ack_24xx_entry_t;
/*
* ISP queue - Accept Target I/O with extended LUN support
* entry structure definition.
*/
#define ATIO_TYPE 0x16 /* ATIO entry */
typedef struct atio_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t initiator_id_l;
uint8_t initiator_id_h;
uint16_t rx_id;
uint8_t flags_l;
uint8_t flags_h;
uint16_t status;
uint8_t reserved_1;
uint8_t task_codes : 3,
reserved_2 : 5;
uint8_t task_flags;
uint8_t execution_codes;
uint8_t cdb[MAX_CMDSZ];
uint32_t data_length;
uint8_t lun_l;
uint8_t lun_h;
uint8_t reserved_3[20];
uint16_t ox_id;
} atio_entry_t;
/*
* ISP24xx queue - Accept Target I/O IOCB structure definition.
*/
#define ATIO_24xx_TYPE 0x06
typedef struct atio_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint16_t len_attr; /* System defined. */
uint32_t receive_exchange_address;
uint8_t frame_hdr[24];
uint8_t payload[32];
} atio_24xx_entry_t;
/*
* ISP queue - Continue Target I/O with extended LUN support
* entry structure definition.
*/
#define CTIO_TYPE_2 0x17
#define CTIO_TYPE_3 0x1F
typedef struct ctio_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t initiator_id_l;
uint8_t initiator_id_h;
uint16_t rx_id;
uint8_t flags_l;
uint8_t flags_h;
uint16_t status;
uint16_t timeout;
uint8_t dseg_count_l;
uint8_t dseg_count_h;
uint32_t relative_offset;
uint32_t residual_transfer_length;
uint8_t reserved_1[4];
union {
struct {
uint8_t reserved_2[2];
uint8_t scsi_status_l;
uint8_t scsi_status_h;
uint32_t byte_count;
uint32_t dseg_0_address;
uint32_t dseg_0_length;
uint32_t dseg_1_address;
uint32_t dseg_1_length;
uint32_t dseg_2_address;
uint32_t dseg_2_length;
}s0_32bit;
struct {
uint8_t reserved_3[2];
uint8_t scsi_status_l;
uint8_t scsi_status_h;
uint32_t byte_count;
uint32_t dseg_0_address[2];
uint32_t dseg_0_length;
uint32_t dseg_1_address[2];
uint32_t dseg_1_length;
}s0_64bit;
struct {
uint8_t sense_length_l;
uint8_t sense_length_h;
uint8_t scsi_status_l;
uint8_t scsi_status_h;
uint8_t response_length_l;
uint8_t response_length_h;
uint8_t response_info[26];
}s1;
struct {
uint8_t reserved_4[2];
uint32_t response_length;
uint32_t response_pointer;
uint8_t reserved[16];
}s2;
}type;
} ctio_entry_t;
/*
* ISP24xx queue - Continue Target I/O IOCBs from the System
* Target Driver structure definition.
*/
#define CTIO_24xx_TYPE 0x12
typedef struct ctio_snd_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle;
uint16_t n_port_hdl;
uint16_t timeout;
uint16_t dseg_count;
uint8_t vp_index;
uint8_t flags;
uint8_t initiator_id[3];
uint8_t reserved_1;
uint32_t receive_exchange_address;
union {
struct {
uint16_t reserved_2;
uint16_t flags;
uint32_t residual_length;
uint16_t ox_id;
uint16_t scsi_status;
uint32_t relative_offset;
uint32_t reserved_3;
uint32_t transfer_length;
uint32_t reserved_4;
uint32_t dseg_0_address_l;
uint32_t dseg_0_address_h;
uint32_t dseg_0_length;
}s0;
struct {
uint16_t sense_length;
uint16_t flags;
uint32_t residual_length;
uint16_t ox_id;
uint16_t scsi_status;
uint16_t response_length;
uint16_t reserved_2;
uint8_t rsp_sense_data[24];
}s1;
struct {
uint16_t reserved_2;
uint16_t flags;
uint32_t residual_length;
uint16_t ox_id;
uint8_t reserved_3[10];
uint32_t transfer_length;
uint32_t reserved_4;
uint32_t dseg_0_address_l;
uint32_t dseg_0_address_h;
uint32_t dseg_0_length;
}s2;
}type;
} ctio_snd_entry_t;
/*
* ISP24xx queue - Continue Target I/O IOCBs from the ISP24xx
* Firmware structure definition.
*/
typedef struct ctio_rcv_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle;
uint16_t status;
uint16_t timeout;
uint16_t dseg_count;
uint8_t reserved[6];
uint8_t vp_index;
uint8_t flags;
uint8_t initiator_id[3];
uint8_t reserved_1;
uint32_t receive_exchange_address;
union {
struct {
uint16_t reserved_2;
uint16_t flags;
uint32_t residual_length;
uint16_t ox_id;
uint16_t scsi_status;
uint32_t relative_offset;
uint32_t reserved_3;
uint32_t transfer_length;
uint32_t reserved_4;
uint32_t dseg_0_address_l;
uint32_t dseg_0_address_h;
uint32_t dseg_0_length;
}s0;
struct {
uint16_t sense_length;
uint16_t flags;
uint32_t residual_length;
uint16_t ox_id;
uint16_t scsi_status;
uint16_t response_length;
uint16_t reserved_2;
uint8_t rsp_sense_data[24];
}s1;
struct {
uint16_t reserved_2;
uint16_t flags;
uint32_t residual_length;
uint16_t ox_id;
uint8_t reserved_3[10];
uint32_t transfer_length;
uint32_t reserved_4;
uint32_t dseg_0_address_l;
uint32_t dseg_0_address_h;
uint32_t dseg_0_length;
}s2;
}type;
} ctio_rcv_entry_t;
/*
* ISP queue - 32-Bit DMA addressing IP entry structure definition.
*/
#define IP_TYPE 0x13
#define IP_DATA_SEGMENTS 3 /* Number of data segments. */
typedef struct ip_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t loop_id_l; /* device id - LSB */
uint8_t loop_id_h; /* device id - MSB */
uint16_t comp_status; /* Completion status. */
uint8_t control_flags_l; /* Control flags - LSB. */
uint8_t control_flags_h; /* Control flags - MSB. */
uint8_t reserved_1[2];
uint16_t timeout; /* Command timeout. */
uint16_t dseg_count; /* Data segment count. */
uint8_t reserved_2[16];
uint32_t byte_count; /* Total byte count. */
uint32_t dseg_0_address; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
uint32_t dseg_2_address; /* Data segment 2 address. */
uint32_t dseg_2_length; /* Data segment 2 length. */
} ip_entry_t;
/*
* ISP queue - 64-Bit DMA addressing IP entry structure definition.
*/
#define IP_A64_TYPE 0x1B
#define IP_A64_DATA_SEGMENTS 2 /* Number of data segments. */
typedef struct ip_a64_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t reserved;
uint8_t loop_id; /* Loop ID */
uint16_t comp_status; /* Completion status. */
uint8_t control_flags_l; /* Control flags - LSB. */
uint8_t control_flags_h; /* Control flags - MSB. */
uint8_t reserved_1[2];
uint16_t timeout; /* Command timeout. */
uint16_t dseg_count; /* Data segment count. */
uint8_t reserved_2[16];
uint32_t byte_count; /* Total byte count. */
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
uint32_t dseg_1_address[2]; /* Data segment 1 address. */
uint32_t dseg_1_length; /* Data segment 1 length. */
} ip_a64_entry_t;
/*
* ISP24xx queue - IP command entry structure definition.
*/
#define IP_CMD_TYPE 0x3B
#define IP_CMD_DATA_SEGMENTS 1
typedef struct ip_cmd_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle. */
uint16_t hdl_status; /* N_port hdl or Completion status */
uint16_t timeout_hdl; /* N_port hdl or Command timeout */
uint16_t dseg_count; /* Data segment count. */
uint8_t reserved_1[6];
uint32_t exch_addr;
uint16_t control_flags;
uint16_t frame_hdr_cntrl_flgs;
uint8_t reserved_2[12];
uint32_t sys_define_2;
uint32_t byte_count; /* Total byte count. */
uint8_t reserved_3[4];
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
} ip_cmd_entry_t;
/*
* IP command Control Flags.
*/
#define IPCF_TERMINATE_EXCH BIT_1
/*
* IP command Frame Header Control Flags.
*/
#define IPCF_FIRST_SEQ BIT_5
#define IPCF_LAST_SEQ BIT_4
/*
* ISP queue - Receive IP buffer entry structure definition.
*/
#define IP_RCVBUF_HANDLES 24 /* Buffer handles in entry. */
#define IP_RECEIVE_TYPE 0x23 /* IP receive entry */
typedef struct ip_rcv_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t segment_count; /* Segment count. */
uint8_t entry_status; /* Entry Status. */
uint8_t s_id[3]; /* Source ID. */
uint8_t reserved[2];
uint8_t loop_id; /* Loop ID */
uint16_t comp_status; /* Completion status. */
uint8_t class_of_srv_l; /* Class of service - LSB. */
uint8_t class_of_srv_h; /* Class of service - MSB. */
uint16_t seq_length; /* Sequence length. */
uint16_t buffer_handle[IP_RCVBUF_HANDLES]; /* Buffer handles. */
} ip_rcv_entry_t;
/*
* ISP queue - Receive IP buffer continuation entry structure definition.
*/
#define IP_RCVBUF_CONT_HANDLES 30 /* Buffer handles in entry. */
#define IP_RECEIVE_CONT_TYPE 0x2B /* IP receive continuation entry */
typedef struct ip_rcv_cont_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t reserved;
uint8_t entry_status; /* Entry Status. */
uint16_t buffer_handle[IP_RCVBUF_CONT_HANDLES]; /* Buf handles */
} ip_rcv_cont_entry_t;
/*
* ISP24xx queue - Receive IP buffer entry structure definition.
*/
#define IP_24XX_RCVBUF_HANDLES 4
#define IP_24XX_RECEIVE_TYPE 0x3c
typedef struct ip_rcv_24xx_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t segment_count; /* Segment count. */
uint8_t entry_status; /* Entry Status. */
uint8_t s_id[3]; /* Source ID. */
uint8_t reserved[1];
uint16_t comp_status; /* Completion status. */
uint16_t n_port_hdl; /* Loop ID */
uint8_t class_of_srv_l; /* Class of service - LSB. */
uint8_t class_of_srv_h; /* Class of service - MSB. */
uint16_t seq_length; /* Sequence length. */
uint16_t buffer_handle[IP_24XX_RCVBUF_HANDLES]; /* Buffer handles. */
} ip_rcv_24xx_entry_t;
/*
* ISP receive buffer container structure definition.
*/
typedef struct rcvbuf {
uint32_t bufp[2]; /* Buffer pointer. */
uint16_t handle; /* Buffer handle. */
uint16_t reserved;
} rcvbuf_t;
/*
* ISP24xx queue - IP Load Buffer Pool entry structure definition.
*/
#define IP_POOL_BUFFERS 4
#define IP_BUF_POOL_TYPE 0x3d
typedef struct ip_buf_pool_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t status;
uint16_t buffer_pool_id;
uint16_t option;
uint8_t buffer_count;
uint8_t buffer_count_h;
rcvbuf_t buffers[IP_POOL_BUFFERS];
} ip_buf_pool_entry_t;
/*
* ISP2400 queue - Virtual Port Modify IOCB structure definition.
*/
#define VP_MODIFY_TYPE 0x31
typedef struct vp_modify_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t reserved;
uint16_t status;
uint8_t command;
uint8_t vp_count;
uint8_t first_vp_index;
uint8_t second_vp_index;
uint8_t first_options;
uint8_t first_hard_prev_addr;
uint8_t reserved_2[2];
uint8_t first_port_name[8];
uint8_t first_node_name[8];
uint8_t second_options;
uint8_t second_hard_prev_addr;
uint8_t reserved_3[2];
uint8_t second_port_name[8];
uint8_t second_node_name[8];
uint8_t reserved_4[6];
uint16_t fcf_index;
} vp_modify_entry_t;
/*
* ISP2400 VP modify commands
*/
#define VPM_MODIFY 0x0
#define VPM_MODIFY_ENABLE 0x1
/*
* ISP2400 queue - Virtual Port Control IOCB structure definition.
*/
#define VP_CONTROL_TYPE 0x30
typedef struct vp_control_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t vp_index_failed;
uint16_t status;
uint8_t command;
uint8_t command_h;
uint8_t vp_count;
uint8_t vp_count_h;
uint8_t vp_index[16];
uint8_t reserved[30];
uint16_t fcf_index;
} vp_control_entry_t;
/*
* ISP2400 VP control commands
*/
#define VPC_ENABLE 0x0
#define VPC_DISABLE 0x8
#define VPC_DISABLE_INIT 0x9 /* Only 2400 & 2500 */
#define VPC_DISABLE_LOGOUT 0xa
#define VPC_DISABLE_LOGOUT_ALL 0xb
/*
* ISP2400 queue - Report ID Acquisition IOCB structure definition.
*/
#define REPORT_ID_TYPE 0x32
typedef struct report_id_0 {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint8_t acq_cnt; /* format 0 acquired, format 1 count */
uint8_t setup; /* format 0 */
uint8_t reserved[2];
uint8_t port_id[3];
uint8_t format;
uint8_t vp_index[16];
uint8_t reserved_1[32];
} report_id_0_t;
typedef struct report_id_1 {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t vp_count;
uint8_t vp_index;
uint8_t status;
uint8_t port_id[3];
uint8_t format;
uint8_t reserved[48];
} report_id_1_t;
/*
* ISP2400 queue - Verify Menlo FW entry structure definition.
*/
#define VERIFY_MENLO_TYPE 0x1b
typedef struct vfy_menlo_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t options_status;
uint16_t failure_code;
uint16_t dseg_count;
uint16_t reserved_1[3];
uint32_t fw_version;
uint32_t exch_addr;
uint32_t reserved_2[3];
uint32_t fw_size;
uint32_t fw_sequence_size;
uint32_t relative_offset;
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
} vfy_menlo_entry_t;
/*
* Option Flags.
*/
#define VMO_DSD_CHAINING BIT_15
#define VM_END_OF_DATA BIT_14
#define VMF_DIAGNOSTIC_FW BIT_3
#define VMF_DO_NOT_RESET BIT_2
#define VMF_FORCE_UPDATE_FW BIT_1
#define VMF_DO_NOT_UPDATE_FW BIT_0
/*
* ISP2400 queue - Access Menlo Data entry structure definition.
*/
#define MENLO_DATA_TYPE 0x2b
typedef struct menlo_data_entry {
uint8_t entry_type; /* Entry type. */
uint8_t entry_count; /* Entry count. */
uint8_t sys_define; /* System defined. */
uint8_t entry_status; /* Entry Status. */
uint32_t handle; /* System handle */
uint16_t options_status;
uint16_t failure_code;
uint16_t dseg_count;
uint16_t reserved_1[3];
uint32_t parameter_1;
uint32_t parameter_2;
uint32_t parameter_3;
uint32_t reserved_2[3];
uint32_t total_byte_count;
uint32_t reserved_3;
uint32_t dseg_0_address[2]; /* Data segment 0 address. */
uint32_t dseg_0_length; /* Data segment 0 length. */
} menlo_data_entry_t;
/*
* Mailbox IOCB.
*/
typedef union ql_mbx_iocb {
cmd_entry_t cmd;
cmd_3_entry_t cmd3;
cmd7_24xx_entry_t cmd24;
ms_entry_t ms;
ct_passthru_entry_t ms24;
abort_cmd_entry_t abo;
task_mgmt_entry_t mgmt;
sts_entry_t sts;
sts_24xx_entry_t sts24;
log_entry_t log;
vp_control_entry_t vpc;
vp_modify_entry_t vpm;
vfy_menlo_entry_t mvfy;
menlo_data_entry_t mdata;
} ql_mbx_iocb_t;
/*
* Global Data in ql_iocb.c source file.
*/
/*
* Global Function Prototypes in ql_iocb.c source file.
*/
void ql_start_iocb(ql_adapter_state_t *, ql_srb_t *);
void ql_isp_cmd(ql_adapter_state_t *);
int ql_marker(ql_adapter_state_t *, uint16_t, uint16_t, uint8_t);
void ql_isp_rcvbuf(ql_adapter_state_t *);
void ql_command_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
void ql_ms_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
void ql_ip_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
void ql_command_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
void ql_ms_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
void ql_ip_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
void ql_els_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
#ifdef __cplusplus
}
#endif
#endif /* _QL_IOCB_H */
|