summaryrefslogtreecommitdiffstats
path: root/sys/dev/asr/i2omsg.h
blob: a938e38062280a9012652136a0c63e9213fb2998 (plain)
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
/*-
 ****************************************************************
 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
 * Copyright (c) 2000 Adaptec Corporation.
 * All rights reserved.
 *
 * Copyright 1999 I2O Special Interest Group (I2O SIG).	 All rights reserved.
 * All rights reserved
 *
 * TERMS AND CONDITIONS OF USE
 *
 * Redistribution and use in source form, with or without modification, are
 * permitted provided that redistributions of source code must retain the
 * above copyright notice, this list of conditions and the following disclaimer.
 *
 * This software is provided `as is' by Distributed Processing Technology and
 * any express or implied warranties, including, but not limited to, the
 * implied warranties of merchantability and fitness for a particular purpose,
 * are disclaimed. In no event shall Distributed Processing Technology be
 * liable for any direct, indirect, incidental, special, exemplary or
 * consequential damages (including, but not limited to, procurement of
 * substitute goods or services; loss of use, data, or profits; or business
 * interruptions) however caused and on any theory of liability, whether in
 * contract, strict liability, or tort (including negligence or otherwise)
 * arising in any way out of the use of this driver software, even if advised
 * of the possibility of such damage.
 *
 * This header file, and any modifications of this header file, are provided
 * contingent upon your agreement and adherence to the here-listed terms and
 * conditions.	By accepting and/or using this header file, you agree to abide
 * by these terms and conditions and that these terms and conditions will be
 * construed and governed in accordance with the laws of the State of California,
 * without reference to conflict-of-law provisions.  If you do not agree
 * to these terms and conditions, please delete this file, and any copies,
 * permanently, without making any use thereof.
 *
 * THIS HEADER FILE IS PROVIDED FREE OF CHARGE ON AN AS-IS BASIS WITHOUT
 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
 * TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.  I2O SIG DOES NOT WARRANT THAT THIS HEADER FILE WILL MEET THE
 * USER'S REQUIREMENTS OR THAT ITS OPERATION WILL BE UNINTERRUPTED OR
 * ERROR-FREE.
 *
 * I2O SIG DISCLAIMS ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF
 * ANY PROPRIETARY RIGHTS, RELATING TO THE IMPLEMENTATION OF THE I2O
 * SPECIFICATIONS.  I2O SIG DOES NOT WARRANT OR REPRESENT THAT SUCH
 * IMPLEMENTATIONS WILL NOT INFRINGE SUCH RIGHTS.
 *
 * THE USER OF THIS HEADER FILE SHALL HAVE NO RECOURSE TO I2O SIG FOR ANY
 * ACTUAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST DATA
 * OR LOST PROFITS ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM.
 *
 * I2O SIG grants the user of this header file a license to copy, distribute,
 * and modify it, for any purpose, under the following terms.  Any copying,
 * distribution, or modification of this header file must not delete or alter
 * the copyright notice of I2O SIG or any of these Terms and Conditions.
 *
 * Any distribution of this header file must not include a charge for the
 * header file (unless such charges are strictly for the physical acts of
 * copying or transferring copies).  However, distribution of a product in
 * which this header file is embedded may include a charge so long as any
 * such charge does not include any charge for the header file itself.
 *
 * Any modification of this header file constitutes a derivative work based
 * on this header file.	 Any distribution of such derivative work: (1) must
 * include prominent notices that the header file has been changed from the
 * original, together with the dates of any changes; (2) automatically includes
 * this same license to the original header file from I2O SIG, without any
 * restriction thereon from the distributing user; and (3) must include a
 * grant of license of the modified file under the same terms and conditions
 * as these Terms and Conditions.
 *
 * The I2O SIG Web site can be found at: http://www.i2osig.org
 *
 * The I2O SIG encourages you to deposit derivative works based on this
 * header file at the I2O SIG Web site.	 Furthermore, to become a Registered
 * Developer of the I2O SIG, sign up at the Web site or call 415.750.8352
 * (United States).
 *
 * $FreeBSD$
 *
 ****************************************************************/

/*********************************************************************
 * I2OMsg.h -- I2O Message defintion file
 *
 * This file contains information presented in Chapter 3, 4 and 6 of
 * the I2O(tm) Specification and most of the I2O Global defines and
 * Typedefs.
 **********************************************************************/

#if !defined(I2O_MESSAGE_HDR)
#define	I2O_MESSAGE_HDR

#define	I2OMSG_REV 1_5_4  /* I2OMsg header file revision string */

/*

   NOTES:

   Gets, reads, receives, etc. are all even numbered functions.
   Sets, writes, sends, etc. are all odd numbered functions.
   Functions that both send and receive data can be either but an attempt is
   made to use the function number that indicates the greater transfer amount.
   Functions that do not send or receive data use odd function numbers.

   Some functions are synonyms like read, receive and send, write.

   All common functions will have a code of less than 0x80.
   Unique functions to a class will start at 0x80.
   Executive Functions start at 0xA0.

   Utility Message function codes range from 0 - 0x1f
   Base Message function codes range from 0x20 - 0xfe
   Private Message function code is 0xff.
*/



#if ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__))
# if (KERN_VERSION < 3)
#  include "i386/pci/i2otypes.h"
# else
#  include "dev/asr/i2otypes.h"
# endif
#else
# include "i2otypes.h"
#endif


PRAGMA_ALIGN_PUSH

PRAGMA_PACK_PUSH

/* Set to 1 for 64 bit Context Fields */
#define	    I2O_64BIT_CONTEXT	       0

/****************************************************************************/

/* Common functions accross all classes. */

#define	   I2O_PRIVATE_MESSAGE			       0xFF

/****************************************************************************/
/* Class ID and Code Assignments */


#define	   I2O_CLASS_VERSION_10			       0x00
#define	   I2O_CLASS_VERSION_11			       0x01

/*    Class Code Names:	 Table 6-1 Class Code Assignments. */
#define	   I2O_CLASS_EXECUTIVE			       0x000
#define	   I2O_CLASS_DDM			       0x001
#define	   I2O_CLASS_RANDOM_BLOCK_STORAGE	       0x010
#define	   I2O_CLASS_SEQUENTIAL_STORAGE		       0x011
#define	   I2O_CLASS_LAN			       0x020
#define	   I2O_CLASS_WAN			       0x030
#define	   I2O_CLASS_FIBRE_CHANNEL_PORT		       0x040
#define	   I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL	       0x041
#define	   I2O_CLASS_SCSI_PERIPHERAL		       0x051
#define	   I2O_CLASS_ATE_PORT			       0x060
#define	   I2O_CLASS_ATE_PERIPHERAL		       0x061
#define	   I2O_CLASS_FLOPPY_CONTROLLER		       0x070
#define	   I2O_CLASS_FLOPPY_DEVICE		       0x071
#define	   I2O_CLASS_BUS_ADAPTER_PORT		       0x080
/* Class Codes 0x090 - 0x09f are reserved for Peer-to-Peer classes */
#define	   I2O_CLASS_MATCH_ANYCLASS		       0xffffffff

#define	   I2O_SUBCLASS_i960			       0x001
#define	   I2O_SUBCLASS_HDM			       0x020
#define	   I2O_SUBCLASS_ISM			       0x021


/****************************************************************************/
/* Message Frame defines and structures	 */

/*   Defines for the Version_Status field. */

#define	   I2O_VERSION_10			       0x00
#define	   I2O_VERSION_11			       0x01

#define	   I2O_VERSION_OFFSET_NUMBER_MASK	       0x07
#define	   I2O_VERSION_OFFSET_SGL_TRL_OFFSET_MASK      0xF0

/*   Defines for the Message Flags Field. */
/*   Please Note the FAIL bit is only set in the Transport Fail Message. */
#define	   I2O_MESSAGE_FLAGS_STATIC		       0x01
#define	   I2O_MESSAGE_FLAGS_64BIT_CONTEXT	       0x02
#define	   I2O_MESSAGE_FLAGS_MULTIPLE		       0x10
#define	   I2O_MESSAGE_FLAGS_FAIL		       0x20
#define	   I2O_MESSAGE_FLAGS_LAST		       0x40
#define	   I2O_MESSAGE_FLAGS_REPLY		       0x80

/* Defines for Request Status Codes:  Table 3-1 Reply Status Codes.  */

#define	   I2O_REPLY_STATUS_SUCCESS		       0x00
#define	   I2O_REPLY_STATUS_ABORT_DIRTY		       0x01
#define	   I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER     0x02
#define	   I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER     0x03
#define	   I2O_REPLY_STATUS_ERROR_DIRTY		       0x04
#define	   I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER     0x05
#define	   I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER     0x06
#define	   I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY	       0x08
#define	   I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER   0x09
#define	   I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER   0x0A
#define	   I2O_REPLY_STATUS_TRANSACTION_ERROR	       0x0B
#define	   I2O_REPLY_STATUS_PROGRESS_REPORT	       0x80

/* DetailedStatusCode defines for ALL messages: Table 3-2 Detailed Status Codes.  */

#define	   I2O_DETAIL_STATUS_SUCCESS			    0x0000
#define	   I2O_DETAIL_STATUS_BAD_KEY			    0x0002
#define	   I2O_DETAIL_STATUS_TCL_ERROR			    0x0003
#define	   I2O_DETAIL_STATUS_REPLY_BUFFER_FULL		    0x0004
#define	   I2O_DETAIL_STATUS_NO_SUCH_PAGE		    0x0005
#define	   I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_SOFT	    0x0006
#define	   I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_HARD	    0x0007
#define	   I2O_DETAIL_STATUS_CHAIN_BUFFER_TOO_LARGE	    0x0009
#define	   I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION	    0x000A
#define	   I2O_DETAIL_STATUS_DEVICE_LOCKED		    0x000B
#define	   I2O_DETAIL_STATUS_DEVICE_RESET		    0x000C
#define	   I2O_DETAIL_STATUS_INAPPROPRIATE_FUNCTION	    0x000D
#define	   I2O_DETAIL_STATUS_INVALID_INITIATOR_ADDRESS	    0x000E
#define	   I2O_DETAIL_STATUS_INVALID_MESSAGE_FLAGS	    0x000F
#define	   I2O_DETAIL_STATUS_INVALID_OFFSET		    0x0010
#define	   I2O_DETAIL_STATUS_INVALID_PARAMETER		    0x0011
#define	   I2O_DETAIL_STATUS_INVALID_REQUEST		    0x0012
#define	   I2O_DETAIL_STATUS_INVALID_TARGET_ADDRESS	    0x0013
#define	   I2O_DETAIL_STATUS_MESSAGE_TOO_LARGE		    0x0014
#define	   I2O_DETAIL_STATUS_MESSAGE_TOO_SMALL		    0x0015
#define	   I2O_DETAIL_STATUS_MISSING_PARAMETER		    0x0016
#define	   I2O_DETAIL_STATUS_TIMEOUT			    0x0017
#define	   I2O_DETAIL_STATUS_UNKNOWN_ERROR		    0x0018
#define	   I2O_DETAIL_STATUS_UNKNOWN_FUNCTION		    0x0019
#define	   I2O_DETAIL_STATUS_UNSUPPORTED_VERSION	    0x001A
#define	   I2O_DEATIL_STATUS_DEVICE_BUSY		    0x001B
#define	   I2O_DETAIL_STATUS_DEVICE_NOT_AVAILABLE	    0x001C

/* Common I2O Field sizes  */

#define	   I2O_TID_SZ				       12
#define	   I2O_FUNCTION_SZ			       8
#define	   I2O_UNIT_ID_SZ			       16
#define	   I2O_SEGMENT_NUMBER_SZ		       12

#define	   I2O_IOP_ID_SZ			       12
#define	   I2O_GROUP_ID_SZ			       16
#define	   I2O_IOP_STATE_SZ			       8
#define	   I2O_MESSENGER_TYPE_SZ		       8

#define	   I2O_CLASS_ID_SZ			       12
#define	   I2O_CLASS_ORGANIZATION_ID_SZ		       16

#define	   I2O_4BIT_VERSION_SZ			       4
#define	   I2O_8BIT_FLAGS_SZ			       8
#define	   I2O_COMMON_LENGTH_FIELD_SZ		       16

#define	   I2O_DEVID_DESCRIPTION_SZ		       16
#define	   I2O_DEVID_VENDOR_INFO_SZ		       16
#define	   I2O_DEVID_PRODUCT_INFO_SZ		       16
#define	   I2O_DEVID_REV_LEVEL_SZ		       8
#define	   I2O_MODULE_NAME_SZ			       24

#define	   I2O_BIOS_INFO_SZ			       8

#define	   I2O_RESERVED_4BITS			       4
#define	   I2O_RESERVED_8BITS			       8
#define	   I2O_RESERVED_12BITS			       12
#define	   I2O_RESERVED_16BITS			       16
#define	   I2O_RESERVED_20BITS			       20
#define	   I2O_RESERVED_24BITS			       24
#define	   I2O_RESERVED_28BITS			       28


typedef	   U32	      I2O_PARAMETER_TID;


#if	I2O_64BIT_CONTEXT
typedef	   U64	      I2O_INITIATOR_CONTEXT;
typedef	   U64	      I2O_TRANSACTION_CONTEXT;
#else
typedef	   U32	      I2O_INITIATOR_CONTEXT;
typedef	   U32	      I2O_TRANSACTION_CONTEXT;
#endif

/*  Serial Number format defines */

#define	   I2O_SERIAL_FORMAT_UNKNOWN		       0
#define	   I2O_SERIAL_FORMAT_BINARY		       1
#define	   I2O_SERIAL_FORMAT_ASCII		       2
#define	   I2O_SERIAL_FORMAT_UNICODE		       3
#define	   I2O_SERIAL_FORMAT_LAN_MAC		       4
#define	   I2O_SERIAL_FORMAT_WAN		       5

/* Special TID Assignments */

#define	   I2O_IOP_TID				       0
#define	   I2O_HOST_TID				       1


/****************************************************************************/

/* I2O Message Frame common for all messages  */

typedef struct _I2O_MESSAGE_FRAME {
   U8			       VersionOffset;
   U8			       MsgFlags;
   U16			       MessageSize;
#if  (defined(__BORLANDC__)) || defined(_DPT_BIG_ENDIAN) || (defined(sparc))
   U32			       TargetAddress;
#else
   BF			       TargetAddress:I2O_TID_SZ;
   BF			       InitiatorAddress:I2O_TID_SZ;
   BF			       Function:I2O_FUNCTION_SZ;
#endif
   I2O_INITIATOR_CONTEXT       InitiatorContext;
} I2O_MESSAGE_FRAME, *PI2O_MESSAGE_FRAME;


/****************************************************************************/

/* Transaction Reply Lists (TRL) Control Word structure */

#define	   I2O_TRL_FLAGS_SINGLE_FIXED_LENGTH	       0x00
#define	   I2O_TRL_FLAGS_SINGLE_VARIABLE_LENGTH	       0x40
#define	   I2O_TRL_FLAGS_MULTIPLE_FIXED_LENGTH	       0x80

typedef struct _I2O_TRL_CONTROL_WORD {
   U8			       TrlCount;
   U8			       TrlElementSize;
   U8			       reserved;
   U8			       TrlFlags;
#if	I2O_64BIT_CONTEXT
   U32			       Padding;		  /* Padding for 64 bit */
#endif
} I2O_TRL_CONTROL_WORD, *PI2O_TRL_CONTROL_WORD;

/****************************************************************************/

/* I2O Successful Single Transaction Reply Message Frame structure. */

typedef struct _I2O_SINGLE_REPLY_MESSAGE_FRAME {
   I2O_MESSAGE_FRAME	       StdMessageFrame;
   I2O_TRANSACTION_CONTEXT     TransactionContext;
   U16			       DetailedStatusCode;
   U8			       reserved;
   U8			       ReqStatus;
/*			       ReplyPayload	   */
} I2O_SINGLE_REPLY_MESSAGE_FRAME, *PI2O_SINGLE_REPLY_MESSAGE_FRAME;


/****************************************************************************/

/* I2O Successful Multiple Transaction Reply Message Frame structure. */

typedef struct _I2O_MULTIPLE_REPLY_MESSAGE_FRAME {
   I2O_MESSAGE_FRAME	       StdMessageFrame;
   I2O_TRL_CONTROL_WORD	       TrlControlWord;
   U16			       DetailedStatusCode;
   U8			       reserved;
   U8			       ReqStatus;
/*			       TransactionDetails[]	   */
} I2O_MULTIPLE_REPLY_MESSAGE_FRAME, *PI2O_MULTIPLE_REPLY_MESSAGE_FRAME;


/****************************************************************************/

/* I2O Private Message Frame structure. */

typedef struct _I2O_PRIVATE_MESSAGE_FRAME {
   I2O_MESSAGE_FRAME	       StdMessageFrame;
   I2O_TRANSACTION_CONTEXT     TransactionContext;
   U16			       XFunctionCode;
   U16			       OrganizationID;
/*			       PrivatePayload[]	       */
} I2O_PRIVATE_MESSAGE_FRAME, *PI2O_PRIVATE_MESSAGE_FRAME;


/****************************************************************************/

/* Message Failure Severity Codes */

#define	   I2O_SEVERITY_FORMAT_ERROR		       0x1
#define	   I2O_SEVERITY_PATH_ERROR		       0x2
#define	   I2O_SEVERITY_PATH_STATE		       0x4
#define	   I2O_SEVERITY_CONGESTION		       0x8

/* Transport Failure Codes: Table 3-3 Mesasge Failure Codes */

#define	   I2O_FAILURE_CODE_TRANSPORT_SERVICE_SUSPENDED	   0x81
#define	   I2O_FAILURE_CODE_TRANSPORT_SERVICE_TERMINATED   0x82
#define	   I2O_FAILURE_CODE_TRANSPORT_CONGESTION	   0x83
#define	   I2O_FAILURE_CODE_TRANSPORT_FAIL		   0x84
#define	   I2O_FAILURE_CODE_TRANSPORT_STATE_ERROR	   0x85
#define	   I2O_FAILURE_CODE_TRANSPORT_TIME_OUT		   0x86
#define	   I2O_FAILURE_CODE_TRANSPORT_ROUTING_FAILURE	   0x87
#define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_VERSION	   0x88
#define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_OFFSET	   0x89
#define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_MSG_FLAGS	   0x8A
#define	   I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_SMALL	   0x8B
#define	   I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_LARGE	   0x8C
#define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_TARGET_ID	   0x8D
#define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_ID 0x8E
#define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_CONTEXT	   0x8F
#define	   I2O_FAILURE_CODE_TRANSPORT_UNKNOWN_FAILURE	   0xFF

/* IOP_ID and Severity sizes */

#define	   I2O_FAILCODE_SEVERITY_SZ			   8
#define	   I2O_FAILCODE_CODE_SZ				   8

/* I2O Transport Message Reply for Message Failure. */

typedef struct _I2O_FAILURE_REPLY_MESSAGE_FRAME {
    I2O_MESSAGE_FRAME		StdMessageFrame;
    I2O_TRANSACTION_CONTEXT	TransactionContext;
#   if (defined(_DPT_BIG_ENDIAN) || defined(sparc) || defined(__BORLANDC__))
	U32			LowestVersion;
	U32			reserved;
#   else
	U8			LowestVersion;
	U8			HighestVersion;
/*	BF			Severity:I2O_FAILCODE_SEVERITY_SZ; */
/*	BF			FailureCode:I2O_FAILCODE_CODE_SZ; */
/* Due to our compiler padding this structure and making it larger than
 * it really is (4 bytes larger), we are re-defining these two fields
 */
	U8			Severity;
	U8			FailureCode;
	BF			reserved:I2O_RESERVED_4BITS;
	BF			FailingHostUnitID:I2O_UNIT_ID_SZ;
	BF			reserved1:12;
#   endif
    U32				AgeLimit;
    U32				PreservedMFA;
} I2O_FAILURE_REPLY_MESSAGE_FRAME, *PI2O_FAILURE_REPLY_MESSAGE_FRAME;

/* I2O Transport Message Reply for Transaction Error. */

typedef struct _I2O_TRANSACTION_ERROR_REPLY_MESSAGE_FRAME {
   I2O_MESSAGE_FRAME	       StdMessageFrame;
   I2O_TRANSACTION_CONTEXT     TransactionContext;
   U16			       DetailedStatusCode;
   U8			       reserved;
   U8			       ReqStatus;   /* Should always be Transaction Error */
   U32			       ErrorOffset;
   U8			       BitOffset;
   U8			       reserved1;
   U16			       reserved2;
} I2O_TRANSACTION_ERROR_REPLY_MESSAGE_FRAME, *PI2O_TRANSACTION_ERROR_REPLY_MESSAGE_FRAME;

/****************************************************************************/

/*  Misc. commonly used structures */

/* Class ID Block */

typedef struct _I2O_CLASS_ID {
#if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
   U32			       Class;
#else
   BF			       Class:I2O_CLASS_ID_SZ;
   BF			       Version:I2O_4BIT_VERSION_SZ;
   BF			       OrganizationID:I2O_CLASS_ORGANIZATION_ID_SZ;
#endif
} I2O_CLASS_ID, *PI2O_CLASS_ID;


#define	   I2O_MAX_SERIAL_NUMBER_SZ		       256

typedef struct _I2O_SERIAL_INFO {
   U8			       SerialNumberLength;
   U8			       SerialNumberFormat;
   U8			       SerialNumber[I2O_MAX_SERIAL_NUMBER_SZ];
} I2O_SERIAL_INFO, *PI2O_SERIAL_INFO;


/****************************************************************************/
/* Hardware Resource Table (HRT) and Logical Configuration Table (LCT) */
/****************************************************************************/

/* Bus Type Code defines */

#define	   I2O_LOCAL_BUS			       0
#define	   I2O_ISA_BUS				       1
#define	   I2O_EISA_BUS				       2
#define	   I2O_MCA_BUS				       3
#define	   I2O_PCI_BUS				       4
#define	   I2O_PCMCIA_BUS			       5
#define	   I2O_NUBUS_BUS			       6
#define	   I2O_CARDBUS_BUS			       7
#define	   I2O_OTHER_BUS			       0x80

#define	   I2O_HRT_STATE_SZ			       4
#define	   I2O_HRT_BUS_NUMBER_SZ		       8
#define	   I2O_HRT_BUS_TYPE_SZ			       8


/* Bus Structures */

/* PCI Bus */
typedef struct _I2O_PCI_BUS_INFO {
   U8			       PciFunctionNumber;
   U8			       PciDeviceNumber;
   U8			       PciBusNumber;
   U8			       reserved;
   U16			       PciVendorID;
   U16			       PciDeviceID;
} I2O_PCI_BUS_INFO, *PI2O_PCI_BUS_INFO;

/* Local Bus */
typedef struct _I2O_LOCAL_BUS_INFO {
   U16			       LbBaseIOPort;
   U16			       reserved;
   U32			       LbBaseMemoryAddress;
} I2O_LOCAL_BUS_INFO, *PI2O_LOCAL_BUS_INFO;

/* ISA Bus */
typedef struct _I2O_ISA_BUS_INFO {
   U16			       IsaBaseIOPort;
   U8			       CSN;
   U8			       reserved;
   U32			       IsaBaseMemoryAddress;
} I2O_ISA_BUS_INFO, *PI2O_ISA_BUS_INFO;

/* EISA Bus */
typedef struct _I2O_EISA_BUS_INFO {
   U16			       EisaBaseIOPort;
   U8			       reserved;
   U8			       EisaSlotNumber;
   U32			       EisaBaseMemoryAddress;
} I2O_EISA_BUS_INFO, *PI2O_EISA_BUS_INFO;

/* MCA Bus */
typedef struct _I2O_MCA_BUS_INFO {
   U16			       McaBaseIOPort;
   U8			       reserved;
   U8			       McaSlotNumber;
   U32			       McaBaseMemoryAddress;
} I2O_MCA_BUS_INFO, *PI2O_MCA_BUS_INFO;

/* Other Bus */
typedef struct _I2O_OTHER_BUS_INFO {
   U16			       BaseIOPort;
   U16			       reserved;
   U32			       BaseMemoryAddress;
} I2O_OTHER_BUS_INFO, *PI2O_OTHER_BUS_INFO;


/* HRT Entry Block */

typedef struct _I2O_HRT_ENTRY {
   U32			       AdapterID;
#if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
   U32			       ControllingTID;
#else
   BF			       ControllingTID:I2O_TID_SZ;
   BF			       AdapterState:I2O_HRT_STATE_SZ;
   BF			       BusNumber:I2O_HRT_BUS_NUMBER_SZ;
   BF			       BusType:I2O_HRT_BUS_TYPE_SZ;
#endif
   union {
       /* PCI Bus */
       I2O_PCI_BUS_INFO	       PCIBus;

       /* Local Bus */
       I2O_LOCAL_BUS_INFO      LocalBus;

       /* ISA Bus */
       I2O_ISA_BUS_INFO	       ISABus;

       /* EISA Bus */
       I2O_EISA_BUS_INFO       EISABus;

       /* MCA Bus */
       I2O_MCA_BUS_INFO	       MCABus;

       /* Other. */
       I2O_OTHER_BUS_INFO      OtherBus;
   }uBus;
} I2O_HRT_ENTRY, *PI2O_HRT_ENTRY;


/* I2O Hardware Resource Table structure. */

typedef struct _I2O_HRT {
   U16			       NumberEntries;
   U8			       EntryLength;
   U8			       HRTVersion;
   U32			       CurrentChangeIndicator;
   I2O_HRT_ENTRY	       HRTEntry[1];
} I2O_HRT, *PI2O_HRT;


/****************************************************************************/
/* Logical Configuration Table	*/
/****************************************************************************/

/* I2O Logical Configuration Table structures. */

#define	   I2O_IDENTITY_TAG_SZ			       8

/* I2O Logical Configuration Table Device Flags */

#define	   I2O_LCT_DEVICE_FLAGS_CONF_DIALOG_REQUEST	       0x01
#define	   I2O_LCT_DEVICE_FLAGS_MORE_THAN_1_USER	       0x02
#define	   I2O_LCT_DEVICE_FLAGS_PEER_SERVICE_DISABLED	       0x10
#define	   I2O_LCT_DEVICE_FLAGS_MANAGEMENT_SERVICE_DISABLED    0x20

/* LCT Entry Block */

typedef struct _I2O_LCT_ENTRY {
#if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
   U32			       TableEntrySize;
#else
   BF			       TableEntrySize:I2O_COMMON_LENGTH_FIELD_SZ;
   BF			       LocalTID:I2O_TID_SZ;
   BF			       reserved:I2O_4BIT_VERSION_SZ;
#endif
   U32			       ChangeIndicator;
   U32			       DeviceFlags;
   I2O_CLASS_ID		       ClassID;
   U32			       SubClassInfo;
#if (defined(__BORLANDC__)) || defined(_DPT_BIG_ENDIAN) || (defined(sparc))
   U32			       UserTID;
#else
   BF			       UserTID:I2O_TID_SZ;
   BF			       ParentTID:I2O_TID_SZ;
   BF			       BiosInfo:I2O_BIOS_INFO_SZ;
#endif
   U8			       IdentityTag[I2O_IDENTITY_TAG_SZ];
   U32			       EventCapabilities;
} I2O_LCT_ENTRY, *PI2O_LCT_ENTRY;


/* I2O Logical Configuration Table structure. */

typedef struct _I2O_LCT {
#if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
   U32			       TableSize;
#else
   BF			       TableSize:I2O_COMMON_LENGTH_FIELD_SZ;
   BF			       BootDeviceTID:I2O_TID_SZ;
   BF			       LctVer:I2O_4BIT_VERSION_SZ;
#endif
   U32			       IopFlags;
   U32			       CurrentChangeIndicator;
   I2O_LCT_ENTRY	       LCTEntry[1];
} I2O_LCT, *PI2O_LCT;


/****************************************************************************/

/* Memory Addressing structures and defines. */

/* SglFlags defines. */

#define	   I2O_SGL_FLAGS_LAST_ELEMENT		       0x80
#define	   I2O_SGL_FLAGS_END_OF_BUFFER		       0x40

#define	   I2O_SGL_FLAGS_IGNORE_ELEMENT		       0x00
#define	   I2O_SGL_FLAGS_TRANSPORT_ELEMENT	       0x04
#define	   I2O_SGL_FLAGS_BIT_BUCKET_ELEMENT	       0x08
#define	   I2O_SGL_FLAGS_IMMEDIATE_DATA_ELEMENT	       0x0C
#define	   I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT	       0x10
#define	   I2O_SGL_FLAGS_PAGE_LIST_ADDRESS_ELEMENT     0x20
#define	   I2O_SGL_FLAGS_CHAIN_POINTER_ELEMENT	       0x30
#define	   I2O_SGL_FLAGS_LONG_TRANSACTION_ELEMENT      0x40
#define	   I2O_SGL_FLAGS_SHORT_TRANSACTION_ELEMENT     0x70
#define	   I2O_SGL_FLAGS_SGL_ATTRIBUTES_ELEMENT	       0x7C

#define	   I2O_SGL_FLAGS_BC0			       0x01
#define	   I2O_SGL_FLAGS_BC1			       0x02
#define	   I2O_SGL_FLAGS_DIR			       0x04
#define	   I2O_SGL_FLAGS_LOCAL_ADDRESS		       0x08

#define	   I2O_SGL_FLAGS_CONTEXT_COUNT_MASK	       0x03
#define	   I2O_SGL_FLAGS_ADDRESS_MODE_MASK	       0x3C
#define	   I2O_SGL_FLAGS_NO_CONTEXT		       0x00

/*  Scatter/Gather Truth Table */

/*

typedef enum _SG_TYPE {
   INVALID,
   Ignore,
   TransportDetails,
   BitBucket,
   ImmediateData,
   Simple,
   PageList,
   ChainPointer,
   ShortTransaction,
   LongTransaction,
   SGLAttributes,
   INVALID/ReservedLongFormat,
   INVALID/ReservedShortFormat
} SG_TYPE, *PSG_TYPE;


   0x00	   Ignore;
   0x04	   TransportDetails;
   0x08	   BitBucket;
   0x0C	   ImmediateData;
   0x10	   Simple;
   0x14	   Simple;
   0x18	   Simple;
   0x1C	   Simple;
   0x20	   PageList;
   0x24	   PageList;
   0x28	   PageList;
   0x2C	   PageList;
   0x30	   ChainPointer;
   0x34	   INVALID;
   0x38	   ChainPointer;
   0x3C	   INVALID;
   0x40	   LongTransaction;
   0x44	   INVALID/ReservedLongFormat;
   0x48	   BitBucket;
   0x4C	   ImmediateData;
   0x50	   Simple;
   0x54	   Simple;
   0x58	   Simple;
   0x5C	   Simple;
   0x60	   PageList;
   0x64	   PageList;
   0x68	   PageList;
   0x6C	   PageList;
   0x70	   ShortTransaction;
   0x74	   INVALID/ReservedShortFormat;
   0x78	   INVALID/ReservedShortFormat;
   0x7C	   SGLAttributes;
*/


/* 32 Bit Context Field defines */

#define	   I2O_SGL_FLAGS_CONTEXT32_NULL		       0x00
#define	   I2O_SGL_FLAGS_CONTEXT32_U32		       0x01
#define	   I2O_SGL_FLAGS_CONTEXT32_U64		       0x02
#define	   I2O_SGL_FLAGS_CONTEXT32_U96		       0x03

#define	   I2O_SGL_FLAGS_CONTEXT32_NULL_SZ	       0x00
#define	   I2O_SGL_FLAGS_CONTEXT32_U32_SZ	       0x04
#define	   I2O_SGL_FLAGS_CONTEXT32_U64_SZ	       0x08
#define	   I2O_SGL_FLAGS_CONTEXT32_U96_SZ	       0x0C

/* 64 Bit Context Field defines */

#define	   I2O_SGL_FLAGS_CONTEXT64_NULL		       0x00
#define	   I2O_SGL_FLAGS_CONTEXT64_U64		       0x01
#define	   I2O_SGL_FLAGS_CONTEXT64_U128		       0x02
#define	   I2O_SGL_FLAGS_CONTEXT64_U192		       0x03

#define	   I2O_SGL_FLAGS_CONTEXT64_NULL_SZ	       0x00
#define	   I2O_SGL_FLAGS_CONTEXT64_U64_SZ	       0x08
#define	   I2O_SGL_FLAGS_CONTEXT64_U128_SZ	       0x10
#define	   I2O_SGL_FLAGS_CONTEXT64_U192_SZ	       0x18

/* SGL Attribute Element defines */

#define	   I2O_SGL_ATTRIBUTE_FLAGS_BIT_BUCKET_HINT     0x0400
#define	   I2O_SGL_ATTRIBUTE_FLAGS_IMMEDIATE_DATA_HINT 0x0200
#define	   I2O_SGL_ATTRIBUTE_FLAGS_LOCAL_ADDRESS_HINT  0x0100
#define	   I2O_SGL_ATTRIBUTE_FLAGS_32BIT_TRANSACTION   0x0000
#define	   I2O_SGL_ATTRIBUTE_FLAGS_64BIT_TRANSACTION   0x0004
#define	   I2O_SGL_ATTRIBUTE_FLAGS_32BIT_LOCAL_ADDRESS 0x0000

/* SG Size defines */

#define	   I2O_SG_COUNT_SZ			       24
#define	   I2O_SG_FLAGS_SZ			       8

/* Standard Flags and Count fields for SG Elements */

typedef struct _I2O_FLAGS_COUNT {
#if (defined(__BORLANDC__)) || defined(_DPT_BIG_ENDIAN) || (defined(sparc))
   U32			       Count;
#else
   BF			       Count:I2O_SG_COUNT_SZ;
   BF			       Flags:I2O_SG_FLAGS_SZ;
#endif
} I2O_FLAGS_COUNT, *PI2O_FLAGS_COUNT;

/* Bit Bucket Element */

typedef struct _I2O_SGE_BIT_BUCKET_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       BufferContext;
} I2O_SGE_BIT_BUCKET_ELEMENT, *PI2O_SGE_BIT_BUCKET_ELEMENT;

/* Chain Addressing Scatter-Gather Element */

typedef struct _I2O_SGE_CHAIN_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       PhysicalAddress;
} I2O_SGE_CHAIN_ELEMENT, *PI2O_SGE_CHAIN_ELEMENT;

/* Chain Addressing with Context Scatter-Gather Element */

typedef struct _I2O_SGE_CHAIN_CONTEXT_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       Context[1];
   U32			       PhysicalAddress;
} I2O_SGE_CHAIN_CONTEXT_ELEMENT, *PI2O_SGE_CHAIN_CONTEXT_ELEMENT;

/* Ignore Scatter-Gather Element */

typedef struct _I2O_SGE_IGNORE_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
} I2O_SGE_IGNORE_ELEMENT, *PI2O_SGE_IGNORE_ELEMENT;

/* Immediate Data Element */

typedef struct _I2O_SGE_IMMEDIATE_DATA_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
} I2O_SGE_IMMEDIATE_DATA_ELEMENT, *PI2O_SGE_IMMEDIATE_DATA_ELEMENT;

/* Immediate Data with Context Element */

typedef struct _I2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       BufferContext;
} I2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT, *PI2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT;

/* Long Transaction Parameters Element */

typedef struct _I2O_SGE_LONG_TRANSACTION_ELEMENT {
#if (defined(__BORLANDC__))
   U32			       LongElementLength;
#else
   BF			       LongElementLength:I2O_SG_COUNT_SZ;
   BF			       Flags:I2O_SG_FLAGS_SZ;
#endif
   U32			       BufferContext;
} I2O_SGE_LONG_TRANSACTION_ELEMENT, *PI2O_SGE_LONG_TRANSACTION_ELEMENT;

/* Page List Scatter-Gather Element */

typedef struct _I2O_SGE_PAGE_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       PhysicalAddress[1];
} I2O_SGE_PAGE_ELEMENT , *PI2O_SGE_PAGE_ELEMENT ;

/* Page List with Context Scatter-Gather Element */

typedef struct _I2O_SGE_PAGE_CONTEXT_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       BufferContext[1];
   U32			       PhysicalAddress[1];
} I2O_SGE_PAGE_CONTEXT_ELEMENT, *PI2O_SGE_PAGE_CONTEXT_ELEMENT;

/* SGL Attribute Element */

typedef struct _I2O_SGE_SGL_ATTRIBUTES_ELEMENT {
   U16			       SglAttributeFlags;
   U8			       ElementLength;
   U8			       Flags;
   U32			       PageFrameSize;
} I2O_SGE_SGL_ATTRIBUTES_ELEMENT, *PI2O_SGE_SGL_ATTRIBUTES_ELEMENT;

/* Short Transaction Parameters Element */

typedef struct _I2O_SGE_SHORT_TRANSACTION_ELEMENT {
   U16			       ClassFields;
   U8			       ElementLength;
   U8			       Flags;
   U32			       BufferContext;
} I2O_SGE_SHORT_TRANSACTION_ELEMENT, *PI2O_SGE_SHORT_TRANSACTION_ELEMENT;

/* Simple Addressing Scatter-Gather Element */

typedef struct _I2O_SGE_SIMPLE_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       PhysicalAddress;
} I2O_SGE_SIMPLE_ELEMENT, *PI2O_SGE_SIMPLE_ELEMENT;

/* Simple Addressing with Context Scatter-Gather Element */

typedef struct _I2O_SGE_SIMPLE_CONTEXT_ELEMENT {
   I2O_FLAGS_COUNT	       FlagsCount;
   U32			       BufferContext[1];
   U32			       PhysicalAddress;
} I2O_SGE_SIMPLE_CONTEXT_ELEMENT, *PI2O_SGE_SIMPLE_CONTEXT_ELEMENT;

/* Transport Detail Element */

typedef struct _I2O_SGE_TRANSPORT_ELEMENT {
#if (defined(__BORLANDC__))
   U32			       LongElementLength;
#else
   BF			       LongElementLength:I2O_SG_COUNT_SZ;
   BF			       Flags:I2O_SG_FLAGS_SZ;
#endif
} I2O_SGE_TRANSPORT_ELEMENT, *PI2O_SGE_TRANSPORT_ELEMENT;

typedef struct _I2O_SG_ELEMENT {
   union {
       /* Bit Bucket Element */
       I2O_SGE_BIT_BUCKET_ELEMENT	   BitBucket;

       /* Chain Addressing Element */
       I2O_SGE_CHAIN_ELEMENT		   Chain;

       /* Chain Addressing with Context Element */
       I2O_SGE_CHAIN_CONTEXT_ELEMENT	   ChainContext;

       /* Ignore Scatter-Gather Element */
       I2O_SGE_IGNORE_ELEMENT		   Ignore;

       /* Immediate Data Element */
       I2O_SGE_IMMEDIATE_DATA_ELEMENT	   ImmediateData;

       /* Immediate Data with Context Element */
       I2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT  ImmediateDataContext;

       /* Long Transaction Parameters Element */
       I2O_SGE_LONG_TRANSACTION_ELEMENT	   LongTransaction;

       /* Page List Element */
       I2O_SGE_PAGE_ELEMENT		   Page;

       /* Page List with Context Element */
       I2O_SGE_PAGE_CONTEXT_ELEMENT	   PageContext;

       /* SGL Attribute Element */
       I2O_SGE_SGL_ATTRIBUTES_ELEMENT	   SGLAttribute;

       /* Short Transaction Parameters Element */
       I2O_SGE_SHORT_TRANSACTION_ELEMENT   ShortTransaction;

       /* Simple Addressing Element */
       I2O_SGE_SIMPLE_ELEMENT		   Simple[1];

       /* Simple Addressing with Context Element */
       I2O_SGE_SIMPLE_CONTEXT_ELEMENT	   SimpleContext[1];

       /* Transport Detail Element */
       I2O_SGE_TRANSPORT_ELEMENT	   Transport;
#if (defined(sun) && defined(u))
/* there is a macro defined in Solaris sys/user.h for u, rename this to uSG */
   } uSG ;
#else
   } u ;
#endif
} I2O_SG_ELEMENT, *PI2O_SG_ELEMENT;

/****************************************************************************/
/*  Basic Parameter Group Access */
/****************************************************************************/

/* Operation Function Numbers */

#define	  I2O_PARAMS_OPERATION_FIELD_GET	       0x0001
#define	  I2O_PARAMS_OPERATION_LIST_GET		       0x0002
#define	  I2O_PARAMS_OPERATION_MORE_GET		       0x0003
#define	  I2O_PARAMS_OPERATION_SIZE_GET		       0x0004
#define	  I2O_PARAMS_OPERATION_TABLE_GET	       0x0005
#define	  I2O_PARAMS_OPERATION_FIELD_SET	       0x0006
#define	  I2O_PARAMS_OPERATION_LIST_SET		       0x0007
#define	  I2O_PARAMS_OPERATION_ROW_ADD		       0x0008
#define	  I2O_PARAMS_OPERATION_ROW_DELETE	       0x0009
#define	  I2O_PARAMS_OPERATION_TABLE_CLEAR	       0x000A

/* Operations List Header */

typedef struct _I2O_PARAM_OPERATIONS_LIST_HEADER {
   U16			       OperationCount;
   U16			       Reserved;
} I2O_PARAM_OPERATIONS_LIST_HEADER, *PI2O_PARAM_OPERATIONS_LIST_HEADER;

/* Results List Header */

typedef struct _I2O_PARAM_RESULTS_LIST_HEADER {
   U16			       ResultCount;
   U16			       Reserved;
} I2O_PARAM_RESULTS_LIST_HEADER, *PI2O_PARAM_RESULTS_LIST_HEADER;

/* Read Operation Result Block Template Structure */

typedef struct _I2O_PARAM_READ_OPERATION_RESULT {
   U16			       BlockSize;
   U8			       BlockStatus;
   U8			       ErrorInfoSize;
   /*			       Operations Results	   */
   /*			       Pad (if any)		   */
   /*			       ErrorInformation (if any)   */
} I2O_PARAM_READ_OPERATION_RESULT, *PI2O_PARAM_READ_OPERATION_RESULT;

typedef struct _I2O_TABLE_READ_OPERATION_RESULT {
   U16			       BlockSize;
   U8			       BlockStatus;
   U8			       ErrorInfoSize;
   U16			       RowCount;
   U16			       MoreFlag;
   /*			       Operations Results	   */
   /*			       Pad (if any)		   */
   /*			       ErrorInformation (if any)   */
} I2O_TABLE_READ_OPERATION_RESULT, *PI2O_TABLE_READ_OPERATION_RESULT;

/* Error Information Template Structure */

typedef struct _I2O_PARAM_ERROR_INFO_TEMPLATE {
   U16			       OperationCode;
   U16			       GroupNumber;
   U16			       FieldIdx;
   U8			       AdditionalStatus;
   U8			       NumberKeys;
   /*			       List of Key Values (variable)   */
   /*			       Pad (if any)		       */
} I2O_PARAM_ERROR_INFO_TEMPLATE, *PI2O_PARAM_ERROR_INFO_TEMPLATE;

/* Operation Template for Specific Fields */

typedef struct _I2O_PARAM_OPERATION_SPECIFIC_TEMPLATE {
   U16			       Operation;
   U16			       GroupNumber;
   U16			       FieldCount;
   U16			       FieldIdx[1];
   /*			       Pad (if any)		       */
} I2O_PARAM_OPERATION_SPECIFIC_TEMPLATE, *PI2O_PARAM_OPERATION_SPECIFIC_TEMPLATE;

/* Operation Template for All Fields */

typedef struct _I2O_PARAM_OPERATION_ALL_TEMPLATE {
   U16			       Operation;
   U16			       GroupNumber;
   U16			       FieldCount;
   /*			       Pad (if any)		       */
} I2O_PARAM_OPERATION_ALL_TEMPLATE, *PI2O_PARAM_OPERATION_ALL_TEMPLATE;

/* Operation Template for All List Fields */

typedef struct _I2O_PARAM_OPERATION_ALL_LIST_TEMPLATE {
   U16			       Operation;
   U16			       GroupNumber;
   U16			       FieldCount;
   U16			       KeyCount;
   U8			       KeyValue;
   /*			       Pad (if any)		       */
} I2O_PARAM_OPERATION_ALL_LIST_TEMPLATE, *PI2O_PARAM_OPERATION_ALL_LIST_TEMPLATE;

/* Modify Operation Result Block Template Structure */

typedef struct _I2O_PARAM_MODIFY_OPERATION_RESULT {
   U16			       BlockSize;
   U8			       BlockStatus;
   U8			       ErrorInfoSize;
   /*			       ErrorInformation (if any)   */
} I2O_PARAM_MODIFY_OPERATION_RESULT, *PI2O_PARAM_MODIFY_OPERATION_RESULT;

/* Operation Template for Row Delete  */

typedef struct _I2O_PARAM_OPERATION_ROW_DELETE_TEMPLATE {
   U16			       Operation;
   U16			       GroupNumber;
   U16			       RowCount;
   U8			       KeyValue;
} I2O_PARAM_OPERATION_ROW_DELETE_TEMPLATE, *PI2O_PARAM_OPERATION_ROW_DELETE_TEMPLATE;

/* Operation Template for Table Clear  */

typedef struct _I2O_PARAM_OPERATION_TABLE_CLEAR_TEMPLATE {
   U16			       Operation;
   U16			       GroupNumber;
} I2O_PARAM_OPERATION_TABLE_CLEAR_TEMPLATE, *PI2O_PARAM_OPERATION_TABLE_CLEAR_TEMPLATE;

/* Status codes and Error Information for Parameter functions */

#define	  I2O_PARAMS_STATUS_SUCCESS		   0x00
#define	  I2O_PARAMS_STATUS_BAD_KEY_ABORT	   0x01
#define	  I2O_PARAMS_STATUS_BAD_KEY_CONTINUE	   0x02
#define	  I2O_PARAMS_STATUS_BUFFER_FULL		   0x03
#define	  I2O_PARAMS_STATUS_BUFFER_TOO_SMALL	   0x04
#define	  I2O_PARAMS_STATUS_FIELD_UNREADABLE	   0x05
#define	  I2O_PARAMS_STATUS_FIELD_UNWRITEABLE	   0x06
#define	  I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS	   0x07
#define	  I2O_PARAMS_STATUS_INVALID_GROUP_ID	   0x08
#define	  I2O_PARAMS_STATUS_INVALID_OPERATION	   0x09
#define	  I2O_PARAMS_STATUS_NO_KEY_FIELD	   0x0A
#define	  I2O_PARAMS_STATUS_NO_SUCH_FIELD	   0x0B
#define	  I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP	   0x0C
#define	  I2O_PARAMS_STATUS_OPERATION_ERROR	   0x0D
#define	  I2O_PARAMS_STATUS_SCALAR_ERROR	   0x0E
#define	  I2O_PARAMS_STATUS_TABLE_ERROR		   0x0F
#define	  I2O_PARAMS_STATUS_WRONG_GROUP_TYPE	   0x10


/****************************************************************************/
/* GROUP Parameter Groups */
/****************************************************************************/

/* GROUP Configuration and Operating Structures and Defines */

/* Groups Numbers */

#define	   I2O_UTIL_PARAMS_DESCRIPTOR_GROUP_NO		0xF000
#define	   I2O_UTIL_PHYSICAL_DEVICE_TABLE_GROUP_NO	0xF001
#define	   I2O_UTIL_CLAIMED_TABLE_GROUP_NO		0xF002
#define	   I2O_UTIL_USER_TABLE_GROUP_NO			0xF003
#define	   I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_GROUP_NO 0xF005
#define	   I2O_UTIL_AUTHORIZED_USER_TABLE_GROUP_NO	0xF006
#define	   I2O_UTIL_DEVICE_IDENTITY_GROUP_NO		0xF100
#define	   I2O_UTIL_DDM_IDENTITY_GROUP_NO		0xF101
#define	   I2O_UTIL_USER_INFORMATION_GROUP_NO		0xF102
#define	   I2O_UTIL_SGL_OPERATING_LIMITS_GROUP_NO	0xF103
#define	   I2O_UTIL_SENSORS_GROUP_NO			0xF200

/* UTIL Group F000h - GROUP DESCRIPTORS Parameter Group */

#define	   I2O_UTIL_GROUP_PROPERTIES_GROUP_TABLE       0x01
#define	   I2O_UTIL_GROUP_PROPERTIES_ROW_ADDITION      0x02
#define	   I2O_UTIL_GROUP_PROPERTIES_ROW_DELETION      0x04
#define	   I2O_UTIL_GROUP_PROPERTIES_CLEAR_OPERATION   0x08

typedef struct _I2O_UTIL_GROUP_DESCRIPTOR_TABLE {
   U16			       GroupNumber;
   U16			       FieldCount;
   U16			       RowCount;
   U8			       Properties;
   U8			       reserved;
} I2O_UTIL_GROUP_DESCRIPTOR_TABLE, *PI2O_UTIL_GROUP_DESCRIPTOR_TABLE;

/* UTIL Group F001h - Physical Device Table Parameter Group */

typedef struct _I2O_UTIL_PHYSICAL_DEVICE_TABLE {
   U32			       AdapterID;
} I2O_UTIL_PHYSICAL_DEVICE_TABLE, *PI2O_UTIL_PHYSICAL_DEVICE_TABLE;

/* UTIL Group F002h - Claimed Table Parameter Group */

typedef struct _I2O_UTIL_CLAIMED_TABLE {
   U16			       ClaimedTID;
} I2O_UTIL_CLAIMED_TABLE, *PI2O_UTIL_CLAIMED_TABLE;

/* UTIL Group F003h - User Table Parameter Group */

typedef struct _I2O_UTIL_USER_TABLE {
   U16			       Instance;
   U16			       UserTID;
   U8			       ClaimType;
   U8			       reserved1;
   U16			       reserved2;
} I2O_UTIL_USER_TABLE, *PI2O_UTIL_USER_TABLE;

/* UTIL Group F005h - Private Message Extensions Parameter Group */

typedef struct _I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_TABLE {
   U16			       ExtInstance;
   U16			       OrganizationID;
   U16			       XFunctionCode;
} I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_TABLE, *PI2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_TABLE;

/* UTIL Group F006h - Authorized User Table Parameter Group */

typedef struct _I2O_UTIL_AUTHORIZED_USER_TABLE {
   U16			       AlternateTID;
} I2O_UTIL_AUTHORIZED_USER_TABLE, *PI2O_UTIL_AUTHORIZED_USER_TABLE;

/* UTIL Group F100h - Device Identity Parameter Group */

typedef struct _I2O_UTIL_DEVICE_IDENTITY_SCALAR {
   U32			       ClassID;
   U16			       OwnerTID;
   U16			       ParentTID;
   U8			       VendorInfo[I2O_DEVID_VENDOR_INFO_SZ];
   U8			       ProductInfo[I2O_DEVID_PRODUCT_INFO_SZ];
   U8			       Description[I2O_DEVID_DESCRIPTION_SZ];
   U8			       ProductRevLevel[I2O_DEVID_REV_LEVEL_SZ];
   U8			       SNFormat;
   U8			       SerialNumber[I2O_MAX_SERIAL_NUMBER_SZ];
} I2O_UTIL_DEVICE_IDENTITY_SCALAR, *PI2O_UTIL_DEVICE_IDENTITY_SCALAR;

/* UTIL Group F101h - DDM Identity Parameter Group */

typedef struct _I2O_UTIL_DDM_IDENTITY_SCALAR {
   U16			       DdmTID;
   U8			       ModuleName[I2O_MODULE_NAME_SZ];
   U8			       ModuleRevLevel[I2O_DEVID_REV_LEVEL_SZ];
   U8			       SNFormat;
   U8			       SerialNumber[I2O_MAX_SERIAL_NUMBER_SZ];
} I2O_UTIL_DDM_IDENTITY_SCALAR, *PI2O_UTIL_DDM_IDENTITY_SCALAR;

/* UTIL Group F102h - User Information Parameter Group */

#define	   I2O_USER_DEVICE_NAME_SZ		       64
#define	   I2O_USER_SERVICE_NAME_SZ		       64
#define	   I2O_USER_PHYSICAL_LOCATION_SZ	       64

typedef struct _I2O_UTIL_USER_INFORMATION_SCALAR {
   U8			       DeviceName[I2O_USER_DEVICE_NAME_SZ];
   U8			       ServiceName[I2O_USER_SERVICE_NAME_SZ];
   U8			       PhysicalLocation[I2O_USER_PHYSICAL_LOCATION_SZ];
   U32			       InstanceNumber;
} I2O_UTIL_USER_INFORMATION_SCALAR, *PI2O_UTIL_USER_INFORMATION_SCALAR;

/* UTIL Group F103h - SGL Operating Limits Parameter Group */

typedef struct _I2O_UTIL_SGL_OPERATING_LIMITS_SCALAR {
   U32			       SglChainSize;
   U32			       SglChainSizeMax;
   U32			       SglChainSizeTarget;
   U16			       SglFragCount;
   U16			       SglFragCountMax;
   U16			       SglFragCountTarget;
} I2O_UTIL_SGL_OPERATING_LIMITS_SCALAR, *PI2O_UTIL_SGL_OPERATING_LIMITS_SCALAR;

/* UTIL Group F200h - Sensors Parameter Group */

#define	   I2O_SENSOR_COMPONENT_OTHER		       0x00
#define	   I2O_SENSOR_COMPONENT_PLANAR_LOGIC_BOARD     0x01
#define	   I2O_SENSOR_COMPONENT_CPU		       0x02
#define	   I2O_SENSOR_COMPONENT_CHASSIS		       0x03
#define	   I2O_SENSOR_COMPONENT_POWER_SUPPLY	       0x04
#define	   I2O_SENSOR_COMPONENT_STORAGE		       0x05
#define	   I2O_SENSOR_COMPONENT_EXTERNAL	       0x06

#define	   I2O_SENSOR_SENSOR_CLASS_ANALOG	       0x00
#define	   I2O_SENSOR_SENSOR_CLASS_DIGITAL	       0x01

#define	   I2O_SENSOR_SENSOR_TYPE_OTHER		       0x00
#define	   I2O_SENSOR_SENSOR_TYPE_THERMAL	       0x01
#define	   I2O_SENSOR_SENSOR_TYPE_DC_VOLTAGE	       0x02
#define	   I2O_SENSOR_SENSOR_TYPE_AC_VOLTAGE	       0x03
#define	   I2O_SENSOR_SENSOR_TYPE_DC_CURRENT	       0x04
#define	   I2O_SENSOR_SENSOR_TYPE_AC_CURRENT	       0x05
#define	   I2O_SENSOR_SENSOR_TYPE_DOOR_OPEN	       0x06
#define	   I2O_SENSOR_SENSOR_TYPE_FAN_OPERATIONAL      0x07

#define	   I2O_SENSOR_SENSOR_STATE_NORMAL	       0x00
#define	   I2O_SENSOR_SENSOR_STATE_ABNORMAL	       0x01
#define	   I2O_SENSOR_SENSOR_STATE_UNKNOWN	       0x02
#define	   I2O_SENSOR_SENSOR_STATE_LOW_CAT	       0x03
#define	   I2O_SENSOR_SENSOR_STATE_LOW		       0x04
#define	   I2O_SENSOR_SENSOR_STATE_LOW_WARNING	       0x05
#define	   I2O_SENSOR_SENSOR_STATE_HIGH_WARNING	       0x06
#define	   I2O_SENSOR_SENSOR_STATE_HIGH		       0x07
#define	   I2O_SENSOR_SENSOR_STATE_HIGH_CAT	       0x08

#define	   I2O_SENSOR_EVENT_ENABLE_STATE_CHANGE	       0x0001
#define	   I2O_SENSOR_EVENT_ENABLE_LOW_CATASTROPHIC    0x0002
#define	   I2O_SENSOR_EVENT_ENABLE_LOW_READING	       0x0004
#define	   I2O_SENSOR_EVENT_ENABLE_LOW_WARNING	       0x0008
#define	   I2O_SENSOR_EVENT_ENABLE_CHANGE_TO_NORMAL    0x0010
#define	   I2O_SENSOR_EVENT_ENABLE_HIGH_WARNING	       0x0020
#define	   I2O_SENSOR_EVENT_ENABLE_HIGH_READING	       0x0040
#define	   I2O_SENSOR_EVENT_ENABLE_HIGH_CATASTROPHIC   0x0080


typedef struct _I2O_UTIL_SENSORS_TABLE {
   U16			       SensorInstance;
   U8			       Component;
   U16			       ComponentInstance;
   U8			       SensorClass;
   U8			       SensorType;
   S8			       ScalingExponent;
   S32			       ActualReading;
   S32			       MinimumReading;
   S32			       Low2LowCatThreshold;
   S32			       LowCat2LowThreshold;
   S32			       LowWarn2LowThreshold;
   S32			       Low2LowWarnThreshold;
   S32			       Norm2LowWarnThreshold;
   S32			       LowWarn2NormThreshold;
   S32			       NominalReading;
   S32			       HiWarn2NormThreshold;
   S32			       Norm2HiWarnThreshold;
   S32			       High2HiWarnThreshold;
   S32			       HiWarn2HighThreshold;
   S32			       HiCat2HighThreshold;
   S32			       Hi2HiCatThreshold;
   S32			       MaximumReading;
   U8			       SensorState;
   U16			       EventEnable;
} I2O_UTIL_SENSORS_TABLE, *PI2O_UTIL_SENSORS_TABLE;


PRAGMA_PACK_POP

PRAGMA_ALIGN_POP

#endif	  /* I2O_MESSAGE_HDR */
OpenPOWER on IntegriCloud