summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/i2o/i2oexec.h
blob: 9dfb92dba2f2f3185ee44f6123da43b322792fed (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
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
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
/*
 * *****************************************************************************
 *
 * All software on this website is made available under the following terms and
 * conditions.  By downloading this software, you agree to abide by these terms
 * and conditions with respect to this software.
 *
 * I2O SIG All rights reserved.
 *
 * These header files are provided, pursuant to your I2O SIG membership
 * agreement, free of charge on an as-is basis without warranty of any kind,
 * either express or implied, including but not limited to, implied warranties
 * or merchantability and fitness for a particular purpose.  I2O SIG does not
 * warrant that this program will meet the user's requirements or that the
 * operation of these programs will be uninterrupted or error-free.
 * Acceptance and use of this program constitutes the user's understanding
 * that he will have no recourse to I2O SIG for any actual or consequential
 * damages including, but not limited to, loss profits arising out of use
 * or inability to use this program.
 *
 * Member is permitted to create derivative works to this header-file program.
 * However, all copies of the program and its derivative works must contain the
 * I2O SIG copyright notice.
 *
 * *****************************************************************************
 */

/*
 * ********************************************************************
 * I2OExec.h -- I2O Executive Class Message definition file
 *
 * This file contains information presented in Chapter 4 of the I2O(tm)
 * Specification.
 * ********************************************************************
 */

/*
 * Copyright (c) 1998 by Sun Microsystems, Inc.
 * All rights reserved.
 */

#ifndef	_SYS_I2OEXEC_H
#define	_SYS_I2OEXEC_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

#include	<sys/i2o/i2omsg.h>	/* the Base Message file */
#include	<sys/i2o/i2outil.h>
#include	<sys/types.h>


#define	I2OEXEC_REV 1_5_4	/* I2OExec 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.
 * *****************************************************************************
 */

/*  I2O Executive Function Codes.  */

#define	I2O_EXEC_ADAPTER_ASSIGN			0xB3
#define	I2O_EXEC_ADAPTER_READ			0xB2
#define	I2O_EXEC_ADAPTER_RELEASE		0xB5
#define	I2O_EXEC_BIOS_INFO_SET			0xA5
#define	I2O_EXEC_BOOT_DEVICE_SET		0xA7
#define	I2O_EXEC_CONFIG_VALIDATE		0xBB
#define	I2O_EXEC_CONN_SETUP			0xCA
#define	I2O_EXEC_DDM_DESTROY			0xB1
#define	I2O_EXEC_DDM_ENABLE			0xD5
#define	I2O_EXEC_DDM_QUIESCE			0xC7
#define	I2O_EXEC_DDM_RESET			0xD9
#define	I2O_EXEC_DDM_SUSPEND			0xAF
#define	I2O_EXEC_DEVICE_ASSIGN			0xB7
#define	I2O_EXEC_DEVICE_RELEASE			0xB9
#define	I2O_EXEC_HRT_GET			0xA8
#define	I2O_EXEC_IOP_CLEAR			0xBE
#define	I2O_EXEC_IOP_CONNECT			0xC9
#define	I2O_EXEC_IOP_RESET			0xBD
#define	I2O_EXEC_LCT_NOTIFY			0xA2
#define	I2O_EXEC_OUTBOUND_INIT			0xA1
#define	I2O_EXEC_PATH_ENABLE			0xD3
#define	I2O_EXEC_PATH_QUIESCE			0xC5
#define	I2O_EXEC_PATH_RESET			0xD7
#define	I2O_EXEC_STATIC_MF_CREATE		0xDD
#define	I2O_EXEC_STATIC_MF_RELEASE		0xDF
#define	I2O_EXEC_STATUS_GET			0xA0
#define	I2O_EXEC_SW_DOWNLOAD			0xA9
#define	I2O_EXEC_SW_UPLOAD			0xAB
#define	I2O_EXEC_SW_REMOVE			0xAD
#define	I2O_EXEC_SYS_ENABLE			0xD1
#define	I2O_EXEC_SYS_MODIFY			0xC1
#define	I2O_EXEC_SYS_QUIESCE			0xC3
#define	I2O_EXEC_SYS_TAB_SET			0xA3


/* I2O Get Status State values */

#define	I2O_IOP_STATE_INITIALIZING		0x01
#define	I2O_IOP_STATE_RESET			0x02
#define	I2O_IOP_STATE_HOLD			0x04
#define	I2O_IOP_STATE_READY			0x05
#define	I2O_IOP_STATE_OPERATIONAL		0x08
#define	I2O_IOP_STATE_FAILED			0x10
#define	I2O_IOP_STATE_FAULTED			0x11


/* Event Indicator Assignments for the Executive Class. */

#define	I2O_EVENT_IND_RESOURCE_LIMIT		0x00000001
#define	I2O_EVENT_IND_CONNECTION_FAIL		0x00000002
#define	I2O_EVENT_IND_ADAPTER_FAULT		0x00000004
#define	I2O_EVENT_IND_POWER_FAIL		0x00000008
#define	I2O_EVENT_IND_RESET_PENDING		0x00000010
#define	I2O_EVENT_IND_RESET_IMMINENT		0x00000020
#define	I2O_EVENT_IND_HARDWARE_FAIL		0x00000040
#define	I2O_EVENT_IND_XCT_CHANGE		0x00000080
#define	I2O_EVENT_IND_NEW_LCT_ENTRY		0x00000100
#define	I2O_EVENT_IND_MODIFIED_LCT		0x00000200
#define	I2O_EVENT_IND_DDM_AVAILABILITY		0x00000400

/* Resource Limit Event Data */

#define	I2O_EVENT_RESOURCE_LIMIT_LOW_MEMORY		0x00000001
#define	I2O_EVENT_RESOURCE_LIMIT_INBOUND_POOL_LOW	0x00000002
#define	I2O_EVENT_RESOURCE_LIMIT_OUTBOUND_POOL_LOW	0x00000004

/* Connection Fail Event Data */

#define	I2O_EVENT_CONNECTION_FAIL_REPOND_NORMAL		0x00000000
#define	I2O_EVENT_CONNECTION_FAIL_NOT_REPONDING		0x00000001
#define	I2O_EVENT_CONNECTION_FAIL_NO_AVAILABLE_FRAMES	0x00000002

/* Reset Pending Event Data */

#define	I2O_EVENT_RESET_PENDING_POWER_LOSS		0x00000001
#define	I2O_EVENT_RESET_PENDING_CODE_VIOLATION		0x00000002

/* Reset Imminent Event Data */

#define	I2O_EVENT_RESET_IMMINENT_UNKNOWN_CAUSE		0x00000000
#define	I2O_EVENT_RESET_IMMINENT_POWER_LOSS		0x00000001
#define	I2O_EVENT_RESET_IMMINENT_CODE_VIOLATION		0x00000002
#define	I2O_EVENT_RESET_IMMINENT_PARITY_ERROR		0x00000003
#define	I2O_EVENT_RESET_IMMINENT_CODE_EXCEPTION		0x00000004
#define	I2O_EVENT_RESET_IMMINENT_WATCHDOG_TIMEOUT	0x00000005

/* Hardware Fail Event Data */

#define	I2O_EVENT_HARDWARE_FAIL_UNKNOWN_CAUSE		0x00000000
#define	I2O_EVENT_HARDWARE_FAIL_CPU_FAILURE		0x00000001
#define	I2O_EVENT_HARDWARE_FAIL_MEMORY_FAULT		0x00000002
#define	I2O_EVENT_HARDWARE_FAIL_DMA_FAILURE		0x00000003
#define	I2O_EVENT_HARDWARE_FAIL_IO_BUS_FAILURE		0x00000004

/* DDM Availability Event Data */

#define	I2O_EVENT_DDM_AVAILIBILITY_RESPOND_NORMAL	0x00000000
#define	I2O_EVENT_DDM_AVAILIBILITY_CONGESTED		0x00000001
#define	I2O_EVENT_DDM_AVAILIBILITY_NOT_RESPONDING	0x00000002
#define	I2O_EVENT_DDM_AVAILIBILITY_PROTECTION_VIOLATION	0x00000003
#define	I2O_EVENT_DDM_AVAILIBILITY_CODE_VIOLATION	0x00000004


#define	I2O_OPERATION_FLAG_ASSIGN_PERMANENT		0x01

/* ExecAdapterAssign Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_adapter_assign_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DdmTID:12;
		uint32_t		reserved:12;
		uint32_t		OperationFlags:8;
	    } s;
	    uint32_t			w;
	} u1;
    i2o_hrt_entry_t			HRTEntry;
} i2o_exec_adappter_assign_message_t;

/* macros to access the bit fields in exec adapter assign message */

#define	get_i2o_exec_adapter_DdmTID(mp, hdl) \
			(mp)->u1.s.DdmTID
#define	put_i2o_exec_adapter_DdmTID(mp, id, hdl) \
			((mp)->u1.s.DdmTID = (id))
#define	get_i2o_exec_adapter_OperationFlags(mp, hdl) \
			(mp)->u1.s.OperationFlags
#define	put_i2o_exec_adapter_OperationFlags(mp, n, hdl) \
			((mp)->u1.s.OperationFlags = (n))

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_adapter_assign_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		OperationFlags:8;
		uint32_t		reserved:12;
		uint32_t		DdmTID:12;
	    } s;
	    uint32_t			w;
	} u1;
    i2o_hrt_entry_t			HRTEntry;
} i2o_exec_adappter_assign_message_t;

/* macros to access the bit fields in exec adapter assign message */


#define	get_i2o_exec_adapter_OperationFlags(mp, hdl) \
	(mp)->u1.s.OperationFlags
#define	put_i2o_exec_adapter_OperatonFlags(mp, n, hdl) \
	((mp)->u1.s.OperationFlags = (n))

#define	get_i2o_exec_adapter_DdmTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_adapter_DdmTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif

#define	I2O_REQUEST_FLAG_CONFIG_REGISTER	0x00000000
#define	I2O_REQUEST_FLAG_IO_REGISTER		0x00000001
#define	I2O_REQUEST_FLAG_ADAPTER_MEMORY		0x00000002

/* ExecAdapterRead Function Message Frame structure. */

typedef struct i2o_exec_adapter_read_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	uint32_t			AdapterID;
	uint32_t			RequestFlags;
	uint32_t			Offset;
	uint32_t			Length;
	i2o_sg_element_t		SGL;
} i2o_exec_adapter_read_message_t;


#define	I2O_OPERATION_FLAG_RELEASE_PERMANENT	0x01

/* ExecAdapterRelease Function Message Frame structure. */

typedef struct i2o_exec_dapater_release_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	uint8_t				reserved[3];
	uint8_t				OperationFlags;
    i2o_hrt_entry_t			HRTEntry;
} i2o_exec_adapter_release_message_t;



/* ExecBiosInfoSet Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_bios_info_set_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DeviceTID:12;
		uint32_t		reserved:12;
		uint32_t		BiosInfo:8;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_bios_info_set_message_t;

/* macros to access the bit fields in exec bios info set message structure */

#define	get_i2o_exec_bios_DeviceTID(mp, hdl) \
			(mp)->u1.s.DeviceTID
#define	put_i2o_exec_bios_DeviceTID(mp, id, hdl) \
			((mp)->u1.s.DeviceTID = (id))
#define	get_i2o_exec_BiosInfo(mp, hdl) \
			(mp)->u1.s.BiosInfo
#define	put_i2o_exec_BiosInfo(mp, n, hdl) \
			((mp)->u1.s.BiosInfo = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_bios_info_set_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		BiosInfo:8;
		uint32_t		reserved:12;
		uint32_t		DeviceTID:12;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_bios_info_set_message_t;

/* macros to access the bit fields in exec bios info set message structure */

#define	get_i2o_exec_BiosInfo(mp, hdl) \
	(mp)->u1.s.BiosInfo
#define	put_i2o_exec_BiosInfo(mp, n, hdl) \
	((mp)->u1.s.BiosInfo = (n))

#define	get_i2o_exec_bios_DeviceID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_bios_DeviceID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif


#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

/* ExecBootDeviceSet Function Message Frame structure. */

typedef struct i2o_exec_boot_device_set_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		BootDevice:12;
		uint32_t		reserved:20;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_boot_device_set_message_t;

/* macros to access the bit fields in exec boot set message structure */

#define	get_i2o_exec_boot_BootDevice(mp, hdl) \
			(mp)->u1.s.BootDevice
#define	put_i2o_exec_boot_BootDevice(mp, id, hdl) \
			((mp)->u1.s.BootDevice = (id))

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_boot_device_set_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved:20;
		uint32_t		BootDevice:12;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_boot_device_set_message_t;

#define	get_i2o_exec_boot_BootDevice(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_boot_BootDevice(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecConfigValidate Function Message Frame structure. */

typedef struct i2o_exec_config_validate_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
} i2o_exec_config_validate_message_t;



/* ExecConnSetup Requestor  */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_alias_connect_setup {
	union {
	    struct {
		uint32_t	IOP1AliasForTargetDevice:12;
		uint32_t	IOP2AliasForInitiatorDevice:12;
		uint32_t	reserved:8;
	    } s;
	    uint32_t		w;
	} u1;
} i2o_alias_connect_setup_t;

/* macros to access the bit fields in alias connect setup structure */

#define	get_i2o_exec_setup_IOP1AliasForTargetDevice(mp, hdl) \
			(mp)->u1.s.IOP1AliasForTargetDevice
#define	put_i2o_exec_setup_IOP1AliasForTargetDevice(mp, id, hdl) \
			((mp)->u1.s.IOP1AliasForTargetDevice = (id))
#define	get_i2o_exec_setup_IOP2AliasForInitiatorDevice(mp, hdl) \
			(mp)->u1.s.IOP2AliasForInitiatorDevice
#define	put_i2o_exec_setup_IOP2AliasForInitiatortDevice(mp, n, hdl) \
			((mp)->u1.s.IOP2AliasForInitiatortDevice = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_alias_connect_setup {
	union {
	    struct {
		uint32_t	reserved:8;
		uint32_t	IOP2AliasForInitiatorDevice:12;
		uint32_t	IOP1AliasForTargetDevice:12;
	    } s;
	    uint32_t		w;
	} u1;
} i2o_alias_connect_setup_t;

/* macros to access the bit fields in alias connect setup structure */

#define	get_i2o_exec_setup_IOP2ForInitiatorDevice(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u1.w) >> 12) & 0xFFF)
#define	put_i2o_exec_setup_IOP2ForInitiatorDevice(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, (ddi_get32(hdl, &(mp)->u.w) & \
			~0xFFF000) | (((id) & 0xFFF) << 12))

#define	get_i2o_exec_setup_IOP1AliasForTargetDevice(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_setup_IOP1AliasForTargetDevice(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif


#define	I2O_OPERATION_FLAG_PEER_TO_PEER_BIDIRECTIONAL	0x01

/* ExecConnSetup Object  */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_object_connect_setup {
	union {
	    struct {
		uint32_t	TargetDevice:12;
		uint32_t	InitiatorDevice:12;
		uint32_t	OperationFlags:8;
	    } s;
	    uint32_t		w;
	} u1;
} i2o_object_connect_setup_t;

/* macros to access the bit fields in object connect setup structure */

#define	get_i2o_exec_setup_TargetDevice(mp, hdl) \
			(mp)->u1.s.TargetDevice
#define	put_i2o_exec_setup_TargetDevice(mp, id, hdl) \
			((mp)->u1.s.TargetDevice = (id))
#define	get_i2o_exec_setup_InitiatorDevice(mp, hdl) \
			(mp)->u1.s.InitiatorDevice
#define	put_i2o_exec_setup_InitiatorDevice(mp, n, hdl) \
			((mp)->u1.s.InitiatorDevice = (id))
#define	get_i2o_exec_setup_OperationFlags(mp, hdl) \
			(mp)->u1.s.OpetationFlags
#define	put_i2o_exec_setup_OperationFlags(mp, id, hdl) \
			((mp)->u1.s.OperationFlags = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_object_connect_setup {
	union {
	    struct {
		uint32_t	OperationFlags:8;
		uint32_t	InitiatorDevice:12;
		uint32_t	TargetDevice:12;
	    } s;
	    uint32_t		w;
	} u1;
} i2o_object_connect_setup_t;

/* macros to access the bit fields in object connect setup structure */

#define	get_i2o_exec_setup_OperationFlags(mp, hdl) \
	(mp)->u1.s.OperationFlags
#define	put_i2o_exec_setup_OperationFlags(mp, n, hdl) \
	((mp)->u1.s.OperationFlags = (n))

#define	get_i2o_exec_setup_InitiatorDevice(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u1.w) >> 12) & 0xFFF)
#define	put_i2o_exec_setup_InitiatorDevice(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, (ddi_get32(hdl, &(mp)->u.w) & \
			~0xFFF000) | (((id) & 0xFFF) << 12))

#define	get_i2o_exec_setup_TargetDevice(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_setup_TargetDevice(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecConnSetup Function Message Frame structure. */

typedef struct i2o_exec_conn_setup_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	i2o_object_connect_setup_t	ObjectInfo;
	i2o_alias_connect_setup_t	AliasInfo;
	uint16_t			IOP2InboundMFrameSize;
	uint16_t			reserved;
	uint32_t			MessageClass;
} i2o_exec_conn_setup_message_t;


/* ExecConnSetup Object Reply */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_object_connect_reply {
	union {
	    struct {
		uint32_t	TargetDevice:12;
		uint32_t	InitiatorDevice:12;
		uint32_t	ReplyStatusCode:8;
	    } s;
	    uint32_t		w;
	} u1;
} i2o_object_connect_reply_t;

/* macros to access the bit fields in object connect reply structure */

#define	get_connect_reply_TargetDevice(mp, hdl) \
			(mp)->u1.s.TargetDevice
#define	get_connect_reply_InitiatorDevice(mp, hdl) \
			(mp)->u1.s.InitiatorDevice
#define	get_connect_reply_RepluStatus(mp, hdl) \
			(mp)->u1.s.ReplyStatusCode

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_object_connect_reply {
	union {
	    struct {
		uint32_t	ReplyStatusCode:8;
		uint32_t	InitiatorDevice:12;
		uint32_t	TargetDevice:12;
	    } s;
	    uint32_t		w;
	} u1;
} i2o_object_connect_reply_t;

/* macros to access the bit fields in object connect reply structure */

#define	get_connect_reply_ReplyStatusCode(mp, hdl) \
	(mp)->u1.s.ReplyStatusCode

#define	get_connect_reply_InitiatorDevice(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u1.w) >> 12) & 0xFFF)

#define	get_connect_reply_TargetDevice(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)

#endif


/* ExecConnSetup reply structure. */

typedef struct i2o_exec_conn_setup_reply {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	i2o_object_connect_reply_t	ObjectInfo;
	i2o_alias_connect_setup_t	AliasInfo;
	uint16_t			IOP2InboundMFrameSize;
	uint16_t			reserved;
} i2o_exec_conn_setup_reply_t;


/* ExecDdmDestroy Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_ddm_destroy_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DdmTID:12;
		uint32_t		reserved:20;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_ddm_destroy_message_t;

/* macros to access the bit fields in exec ddm destroy message structure */

#define	get_i2o_exec_ddm_destroy_DdmTID(mp, hdl) \
			(mp)->u1.s.DdmTID
#define	put_i2o_exec_ddm_destroy_DdmTID(mp, id, hdl) \
			((mp)->u1.s.DdmTID = (id))

#endif

#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_ddm_destroy_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved:20;
		uint32_t		DdmTID:12;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_ddm_destroy_message_t;

/* macros to access the bit fields in exec ddm destroy message structure */

#define	get_i2o_exec_ddm_destroy_DdmTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_ddm_destroy_DdmTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecDdmEnable Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_ddm_enable_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DeviceTID:12;
		uint32_t		reserved1:20;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_ddm_enable_message_t;

/* macros to access the bit fields in exec ddm enable message structure */

#define	get_i2o_exec_ddm_enable_DeviceTID(mp, hdl) \
			(mp)->u2.s2.DeviceTID
#define	put_i2o_exec_ddm_enable_DeviceTID(mp, id, hdl) \
			((mp)->u2.s2.DeviceTID = (id))

#define	get_i2o_exec_ddm_enable_IOP_ID(mp, hdl) \
			(mp)->u3.s3.IOP_ID
#define	put_i2o_exec_ddm_enable_IOP_ID(mp, id, hdl) \
			((mp)->u3.s3.IOP_ID = (id))

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_ddm_enable_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved1:20;
		uint32_t		DeviceTID:12;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_ddm_enable_message_t;

/* macros to access the bit fields in exec ddm enable message structure */

#define	get_i2o_exec_ddm_enable_DeviceTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_ddm_enable_DeviceTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_ddm_enable_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) & 0xFFF)

#define	put_i2o_exec_ddm_enable_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h1, \
		(ddi_get16(hdl, &(mp)->u3.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif

/* ExecDdmQuiesce Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_ddm_quiesce_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DeviceTID:12;
		uint32_t		reserved1:20;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_ddm_quiesce_message_t;

/* macros to access the bit fields in exec ddm quiesce message structure */

#define	get_i2o_exec_ddm_quiesce_DeviceTID(mp, hdl) \
			(mp)->u2.s2.DeviceTID
#define	put_i2o_exec_ddm_quiesce_DeviceTID(mp, id, hdl) \
			((mp)->u2.s2.DeviceTID = (id))

#define	get_i2o_exec_ddm_quiesce_IOP_ID(mp, hdl) \
			(mp)->u3.s3.IOP_ID
#define	put_i2o_exec_ddm_quiesce_IOP_ID(mp, id, hdl) \
			((mp)->u3.s3.IOP_ID = (id))

#endif


/* ExecDdmQuiesce Function Message Frame structure. */

#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_ddm_quiesce_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved1:20;
		uint32_t		DeviceTID:12;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_ddm_quiesce_message_t;

/* macros to access the bit fields in exec ddm quiesce message structure */

#define	get_i2o_exec_ddm_quiesce_DeviceTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_ddm_quiesce_DeviceTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_ddm_quiesce_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) & 0xFFF)

#define	put_i2o_exec_ddm_quiesce_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h1, \
		(ddi_get16(hdl, &(mp)->u3.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecDdmReset Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_ddm_reset_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DeviceTID:12;
		uint32_t		reserved1:20;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_ddm_reset_message_t;

/* macros to access the bit fields in exec ddm reset message structure */

#define	get_i2o_exec_ddm_reset_DeviceTID(mp, hdl) \
			(mp)->u2.s2.DeviceTID
#define	put_i2o_exec_ddm_reset_DeviceTID(mp, id, hdl) \
			((mp)->u2.s2.DeviceTID = (id))

#define	get_i2o_exec_ddm_reset_IOP_ID(mp, hdl) \
			(mp)->u3.s3.IOP_ID
#define	put_i2o_exec_ddm_resetquiesce_IOP_ID(mp, id, hdl) \
			((mp)->u3.s3.IOP_ID = (id))

#endif


/* ExecDdmReset Function Message Frame structure. */

#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_ddm_reset_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved1:20;
		uint32_t		DeviceTID:12;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_ddm_reset_message_t;

/* macros to access the bit fields in exec ddm reset message structure */

#define	get_i2o_exec_ddm_reset_DeviceTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_ddm_reset_DeviceTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_ddm_reset_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) & 0xFFF)

#define	put_i2o_exec_ddm_reset_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h1, \
		(ddi_get16(hdl, &(mp)->u3.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecDdmSuspend Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_ddm_suspend_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DdmTID:12;
		uint32_t		reserved:20;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_ddm_suspend_message_t;

/* macros to access the bit fields in exec ddm suspend message structure */

#define	get_i2o_exec_ddm_suspend_DdmTID(mp, hdl) \
			(mp)->u1.s.DdmTID
#define	put_i2o_exec_ddm_suspend_DdmTID(mp, id, hdl) \
			((mp)->u1.s.DdmTID = (id))

#endif

#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_ddm_suspend_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved:20;
		uint32_t		DdmTID:12;
	    } s;
	    uint32_t			w;
	} u1;
} i2o_exec_ddm_suspend_message_t;

/* macros to access the bit fields in exec ddm suspend message structure */

#define	get_i2o_exec_ddm_suspend_DdmTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u1.w) & 0xFFF)
#define	put_i2o_exec_ddm_suspend_DdmTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u1.w, \
		(ddi_get32(hdl, &(mp)->u1.w) & ~0xFFF) | ((id) & 0xFFF))

#endif


#define	I2O_OPERATION_FLAG_ASSIGN_PERMANENT	0x01


/* ExecDeviceAssign Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_device_assign_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DeviceTID:12;
		uint32_t		DdmTID:12;
		uint32_t		OperationFlags:8;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_device_assign_message_t;


/* macros to access the bit fields in device assign message structure */

#define	get_i2o_exec_device_assign_DeviceTID(mp, hdl) \
			(mp)->u2.s2.DeviceTID
#define	put_i2o_exec_device_assign_DeviceTID(mp, id, hdl) \
			((mp)->u2.s2.DeviceTID = (id))
#define	get_i2o_exec_device_assign_DdmTID(mp, hdl) \
			(mp)->u2.s2.DdmTID
#define	put_i2o_exec_device_assign_DdmTID(mp, n, hdl) \
			((mp)->u2.s2.DdmTID = (id))
#define	get_i2o_exec_device_assign_OperationFlags(mp, hdl) \
			(mp)->u2.s2.OpetationFlags
#define	put_i2o_exec_device_assign_OperationFlags(mp, id, hdl) \
			((mp)->u2.s2.OperationFlags = (id))

#define	get_i2o_exec_device_assign_IOP_ID(mp, hdl) \
			(mp)->u3.s3.IOP_ID
#define	put_i2o_exec_device_assign_IOP_ID(mp, id, hdl) \
			((mp)->u3.s3.IOP_ID = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)


typedef struct i2o_exec_device_assign_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		OperationFlags:8;
		uint32_t		DdmTID:12;
		uint32_t		DeviceTID:12;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_device_assign_message_t;

/* macros to access the bit fields in device assign message structure */

#define	get_i2o_exec_device_assign_OperationFlags(mp, hdl) \
	(mp)->u2.s2.OperationFlags
#define	put_i2o_exec_device_assign_OperationFlags(mp, n, hdl) \
	((mp)->u2.s2.OperationFlags = (n))

#define	get_i2o_exec_device_assign_DdmTID(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u2.w2) >> 12) & 0xFFF)
#define	put_i2o_exec_device_assign_DdmTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, (ddi_get32(hdl, &(mp)->u2.w2) & \
			~0xFFF000) | (((id) & 0xFFF) << 12))

#define	get_i2o_exec_device_assign_DeviceTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_device_assign_DeviceTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_device_assign_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) & 0xFFF)
#define	put_i2o_exec_device_assign_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h1, \
		(ddi_get16(hdl, &(mp)->u3.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


#define	I2O_OPERATION_FLAG_RELEASE_PERMANENT	0x01

/* ExecDeviceRelease Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_device_release_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		DeviceTID:12;
		uint32_t		DdmTID:12;
		uint32_t		OperationFlags:8;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_device_release_message_t;


/* macros to access the bit fields in device release message structure */

#define	get_i2o_exec_device_release_DeviceTID(mp, hdl) \
			(mp)->u2.s2.DeviceTID
#define	put_i2o_exec_device_release_DeviceTID(mp, id, hdl) \
			((mp)->u2.s2.DeviceTID = (id))
#define	get_i2o_exec_device_release_DdmTID(mp, hdl) \
			(mp)->u2.s2.DdmTID
#define	put_i2o_exec_device_release_DdmTID(mp, n, hdl) \
			((mp)->u2.s2.DdmTID = (id))
#define	get_i2o_exec_device_release_OperationFlags(mp, hdl) \
			(mp)->u2.s2.OpetationFlags
#define	put_i2o_exec_device_release_OperationFlags(mp, id, hdl) \
			((mp)->u2.s2.OperationFlags = (id))

#define	get_i2o_exec_device_release_IOP_ID(mp, hdl) \
			(mp)->u3.s3.IOP_ID
#define	put_i2o_exec_device_release_IOP_ID(mp, id, hdl) \
			((mp)->u3.s3.IOP_ID = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)


typedef struct i2o_exec_device_release_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		OperationFlags:8;
		uint32_t		DdmTID:12;
		uint32_t		DeviceTID:12;
	    } s2;
	    uint32_t			w2;
	} u2;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s3;
	    uint16_t			h1;
	} u3;
	uint16_t			HostUnitID;
} i2o_exec_device_release_message_t;

/* macros to access the bit fields in device assign message structure */


#define	get_i2o_exec_device_release_OperationFlags(mp, hdl) \
	(mp)->u2.s2.OperationFlags
#define	put_i2o_exec_device_release_OperationFlags(mp, n, hdl) \
	((mp)->u2.s2.OperationFlags = (n))

#define	get_i2o_exec_device_release_DdmTID(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u2.w2) >> 12) & 0xFFF)
#define	put_i2o_exec_device_release_DdmTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, (ddi_get32(hdl, &(mp)->u2.w2) & \
			~0xFFF000) | (((id) & 0xFFF) << 12))

#define	get_i2o_exec_device_release_DeviceTID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_device_release_DeviceTID(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_device_release_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) & 0xFFF)

#define	put_i2o_exec_device_release_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h1, \
		(ddi_get16(hdl, &(mp)->u3.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* HRT Entry Structure defined in I2OMSG.H */

/* ExecHrtGet Function Message Frame structure. */

typedef struct i2o_exec_hrt_get_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	i2o_sg_element_t		SGL;
} i2o_exec_hrt_get_message_t;



/* ExecIopClear Function Message Frame structure. */

typedef struct i2o_exec_iop_clear_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
} i2o_exec_iop_clear_message_t;


/* ExecIopConnect Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_iop_connect_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		reserved:24;
		uint32_t		IOP1MsgerType:8;

	    } s2;
	    uint32_t			w2;
	} u2;
	uint16_t			IOP1InboundMFrameSize;
	union {
	    struct {
		uint16_t		IOP1AliasForIOP2:12;
		uint16_t		reserved1:4;
	    } s3;
	    uint16_t			h2;
	} u3;
	union {
	    struct {
		uint16_t		IOP_ID1:12;
		uint16_t		reserved2:4;
	    } s4;
	    uint16_t			h1;
	} u4;
	uint16_t			HostUnitID1;
} i2o_exec_iop_connect_message_t;


/* macros to access the bit fields in exec iop connect message structure */

#define	get_i2o_exec_iop_connect_IOP1MsgerType(p, hdl) \
		(mp)->u2.s2.IOP1MsgerType

#define	put_i2o_exec_iop_connect_IOP1MsgerType(mp, id, hdl) \
		((mp)->u2.s2.IOP1MsgerType = (id))


#define	get_i2o_exec_iop_connect_IOP1AliasForIOP2(p, hdl) \
		(mp)->u3.s3.IOP1AliasForIOP2

#define	put_i2o_exec_iop_connect_IOP1AliasForIOP2(mp, id, hdl) \
		((mp)->u3.s3.IOP1AliasForIOP2 = (id))

#define	get_i2o_exec_iop_connect_IOP_ID1(p, hdl) \
		(mp)->u4.s4.IOP_ID1

#define	put_i2o_exec_iop_connect_IOP_ID1(mp, id, hdl) \
		((mp)->u4.s4.IOP_ID1 = (id))


#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_iop_connect_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint32_t		IOP1MsgerType:8;
		uint32_t		reserved:24;
	    } s2;
	    uint32_t			w2;
	} u2;

	uint16_t			IOP1InboundMFrameSize;
	union {
	    struct {
		uint16_t		reserved1:8;
		uint16_t		IOP1AliasForIOP2:12;
	    } s3;
	    uint16_t			h2;
	} u3;
	union {
	    struct {
		uint16_t		reserved2:4;
		uint16_t		IOP_ID1:12;
	    } s4;
	    uint16_t			h1;
	} u4;
	uint16_t			HostUnitID1;
} i2o_exec_iop_connect_message_t;

/* macros to access the bit fields in exec iop connect message structure */

#define	get_i2o_exec_iop_connect_IOP1MsgerType(p, hdl) \
	((ddi_get32(hdl, &(p)->u2.w2) >> 24) & 0xFF)

#define	put_i2o_exec_iop_connect_IOP1MsgerType(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFF) | (((id) & 0xFF) << 24))


#define	get_i2o_exec_iop_connect_IOP1AliasForIOP2(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h2) & 0xFFF)

#define	put_i2o_exec_iop_connect_IOP1AliasForIOP2(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h2, \
		(ddi_get16(hdl, &(mp)->u3.h2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_iop_connect_IOP_ID1(p, hdl) \
	(ddi_get32(hdl, &(p)->u4.h1) & 0xFFF)

#define	put_i2o_exec_iop_connect_IOP_ID1(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u4.h1, \
		(ddi_get16(hdl, &(mp)->u4.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecIopConnect reply structure */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_iop_connect_iop_reply {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	uint16_t			DetailedStatusCode;
	uint8_t				reserved;
	uint8_t				ReqStatus;
	uint16_t			IOP2InboundMFrameSize;
	union {
	    struct {
		uint16_t		IOP2AliasForIOP1:12;
		uint16_t		reserved1:4;
	    } s3;
	    uint16_t			h2;
	} u3;
	union {
	    struct {
		uint16_t		IOP_ID2:12;
		uint16_t		reserved2:4;
	    } s4;
	    uint16_t			w4;
	} u4;
	uint16_t			HostUnitID2;
} i2o_exec_iop_connect_reply_t;

/* macros to access the bit fields in exec iop connect reply structure */

#define	get_i2o_exec_iop_connect_reply_IOP2AliasForIOP1(p, hdl) \
		(mp)->u3.s3.IOP2AliasForIOP1

#define	put_i2o_exec_iop_connect_reply_IOP2AliasForIOP1(mp, id, hdl) \
		((mp)->u3.s3.IOP2AliasForIOP1 = (id))

#define	get_i2o_exec_iop_connect_reply_IOP_ID2(p, hdl) \
		(mp)->u4.s4.IOP_ID2

#define	put_i2o_exec_iop_connect_reply_IOP_ID2(mp, id, hdl) \
		((mp)->u4.s4.IOP_ID2 = (id))

#endif



#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_iop_connect_iop_reply {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	uint16_t			DetailedStatusCode;
	uint8_t				reserved;
	uint8_t				ReqStatus;
	uint16_t			IOP2InboundMFrameSize;
	union {
	    struct {
		uint16_t		reserved1:8;
		uint16_t		IOP2AliasForIOP1:12;
	    } s3;
	    uint16_t			h2;
	} u3;
	union {
	    struct {
		uint16_t		reserved2:4;
		uint16_t		IOP_ID2:12;
	    } s4;
	    uint16_t			h1;
	} u4;
	uint16_t			HostUnitID2;
} i2o_exec_iop_connect_reply_t;

/* macros to access the bit fields in exec iop connect reply structure */

#define	get_i2o_exec_iop_connect_reply_IOP2AliasForIOP1(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h2) & 0xFFF)

#define	put_i2o_exec_iop_connect_reply_IOP2AliasForIOP1(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u3.h2, \
		(ddi_get16(hdl, &(mp)->u3.h2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_iop_connect_reply_IOP_ID2(p, hdl) \
	(ddi_get32(hdl, &(p)->u4.h1) & 0xFFF)

#define	put_i2o_exec_iop_connect_reply_IOP_ID2(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u4.h1, \
		(ddi_get16(hdl, &(mp)->u4.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


#define	I2O_EXEC_IOP_RESET_RESERVED_SZ	16

#define	I2O_EXEC_IOP_RESET_IN_PROGRESS	0x01
#define	I2O_EXEC_IOP_RESET_REJECTED	0x02

#define	I2O_EXEC_IOP_RESET_STATUS_RESERVED_SZ	3

typedef struct i2o_exec_iop_reset_status {
	volatile uint8_t ResetStatus;
	uint8_t		 reserved[I2O_EXEC_IOP_RESET_STATUS_RESERVED_SZ];
} i2o_exec_iop_reset_status_t;


/* ExecIopReset Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_iop_reset_message {
	uint8_t			VersionOffset;
	uint8_t			MsgFlags;
	uint16_t		MessageSize;
	union {
	    struct {
		uint32_t	TargetAddress:12;
		uint32_t	InitiatorAddress:12;
		uint32_t	Function:8;
	    } s2;
	    uint32_t		w2;
	} u2;
	uint8_t			Reserved[I2O_EXEC_IOP_RESET_RESERVED_SZ];
	uint32_t		StatusWordLowAddress;
	uint32_t		StatusWordHighAddress;
} i2o_exec_iop_reset_message_t;

/* macros to access the bit fields in iop reset message */

#define	get_i2o_exec_reset_TargetAddress(mp, hdl) \
			(mp)->u2.s2.TargetAddress
#define	put_i2o_exec_reset_TargetAddress(mp, id, hdl) \
			((mp)->u2.s2.TargetAddress = (id))
#define	get_i2o_exec_reset_InitiatorAddress(mp, hdl) \
			(mp)->u2.s2.InitiatorAddress
#define	put_i2o_exec_reset_InitiatorAddress(mp, id, hdl) \
			((mp)->u2.s2.InitiatorAddress = (id))
#define	get_i2o_exec_reset_Function(mp, hdl) \
			(mp)->u2.s2.Function
#define	put_i2o_exec_reset_Function(mp, n, hdl) \
			((mp)->u2.s2.Function = (n))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_iop_reset_message {
	uint8_t			VersionOffset;
	uint8_t			MsgFlags;
	uint16_t		MessageSize;
	union {
	    struct {
		uint32_t	Function:8;
		uint32_t	InitiatorAddress:12;
		uint32_t	TargetAddress:12;
	    } s2;
	    uint32_t		w2;
	} u2;

	uint8_t			Reserved[I2O_EXEC_IOP_RESET_RESERVED_SZ];
	uint32_t		StatusWordLowAddress;
	uint32_t		StatusWordHighAddress;
} i2o_exec_iop_reset_message_t;

/* macros to access the bit fields in iop reset message */

#define	get_i2o_exec_reset_Function(mp, hdl) \
	(mp)->u2.s2.Function
#define	put_i2o_exec_reset_Function(mp, n, hdl) \
	((mp)->u2.s2.Function = (n))

#define	get_i2o_exec_reset_TargetAddress(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_reset_TargetAddress(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_reset_InitiatorAddress(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u2.w2) >> 12) & 0xFFF)
#define	put_i2o_exec_reset_InitiatorAddress(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, (ddi_get32(hdl, &(mp)->u2.w2) & \
			~0xFFF000) | (((id) & 0xFFF) << 12))

#endif


/* LCT Entry Structure defined in I2OMSG.H */

/* ExecLCTNotify Function Message Frame structure. */

typedef struct i2o_exec_lct_notify_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	uint32_t			ClassIdentifier;
	uint32_t			LastReportedChangeIndicator;
	i2o_sg_element_t		SGL;
} i2o_exec_lct_notify_message_t;


/* ExecOutboundInit Function Message Frame structure. */

typedef struct i2o_exec_outbound_init_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	uint32_t			HostPageFrameSize;
	uint8_t				InitCode;
	uint8_t				reserved;
	uint16_t			OutboundMFrameSize;
	i2o_sg_element_t		SGL;
} i2o_exec_outbound_init_message_t;


#define	I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS	0x01
#define	I2O_EXEC_OUTBOUND_INIT_REJECTED	0x02
#define	I2O_EXEC_OUTBOUND_INIT_FAILED	0x03
#define	I2O_EXEC_OUTBOUND_INIT_COMPLETE	0x04

#define	I2O_EXEC_OUTBOUND_INIT_RESERVED_SZ	3


typedef struct i2o_exec_outbound_init_status {
	uint8_t	InitStatus;
	uint8_t	reserved[I2O_EXEC_OUTBOUND_INIT_RESERVED_SZ];
} i2o_exec_outbound_init_status_t;


typedef struct i2o_exec_outbound_init_reclaim_list {
	uint32_t	MFACount;
	uint32_t	MFAReleaseCount;
	uint32_t	MFAAddress[1];
} i2o_exec_outbound_init_reclaim_list_t;


/* ExecPathEnable Function Message Frame structure. */


#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_path_enable_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
} i2o_exec_path_enable_message_t;

/* macros to access the bit fields in exec path enable message structure */

#define	get_i2o_exec_path_enable_IOP_ID(mp, hdl) \
			(mp)->u2.s2.IOP_ID
#define	put_i2o_exec_path_enable_IOP_ID(mp, id, hdl) \
			((mp)->u2.s2.IOP_ID = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_path_enable_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
} i2o_exec_path_enable_message_t;

/* macros to access the bit fields in exec path enable message structure */

#define	get_i2o_exec_path_enable_IOP_ID(p, hdl) \
	(ddi_get32(hdl, &(p)->u2.h1) & 0xFFF)

#define	put_i2o_exec_path_enable_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u2.h1, \
		(ddi_get16(hdl, &(mp)->u2.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecPathQuiesce Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_path_quiesce_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
} i2o_exec_path_quiesce_message_t;

/* macros to access the bit fields in exec path quiesce message structure */

#define	get_i2o_exec_path_quiesce_IOP_ID(mp, hdl) \
			(mp)->u2.s2.IOP_ID
#define	put_i2o_exec_path_quiesce_IOP_ID(mp, id, hdl) \
			((mp)->u2.s2.IOP_ID = (id))

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_path_quiesce_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
} i2o_exec_path_quiesce_message_t;

/* macros to access the bit fields in exec path quiesce message structure */

#define	get_i2o_exec_path_quiesce_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u2.h1) & 0xFFF)

#define	put_i2o_exec_path_quiesce_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u2.h1, \
		(ddi_get16(hdl, &(mp)->u2.h1) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecPathReset Function Message Frame structure. */


#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_path_reset_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
} i2o_exec_path_reset_message_t;

/* macros to access the bit fields in exec path reset message structure */

#define	get_i2o_exec_path_reset_IOP_ID(mp, hdl) \
			(mp)->u2.s2.IOP_ID
#define	put_i2o_exec_path_reset_IOP_ID(mp, id, hdl) \
			((mp)->u2.s2.IOP_ID = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_path_reset_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
} i2o_exec_path_reset_message_t;

/* macros to access the bit fields in exec path reset message structure */

#define	get_i2o_exec_path_reset_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u2.h1) & 0xFFF)

#define	put_i2o_exec_path_reset_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u2.h1, \
		(ddi_get16(hdl, &(mp)->u2.h1) & ~0xFFF) | ((id) & 0xFFF))


#endif


#define	I2O_EXEC_STATIC_MF_CREATE_RESERVED_SZ	3

/* ExecStaticMfCreate Message Frame  structure */

typedef struct i2o_exec_static_mf_create_message {
	i2o_message_frame_t	StdMessageFrame;
	i2o_transaction_context_t TransactionContext;
	uint8_t			MaxOutstanding;
	uint8_t			reserved[I2O_EXEC_STATIC_MF_CREATE_RESERVED_SZ];
	i2o_message_frame_t	StaticMessageFrame;
} i2o_exec_static_mf_create_message_t;


/* ExecStaticMfCreate Message Frame reply */

typedef struct i2o_exec_static_mf_create_reply {
	i2o_single_reply_message_frame_t	StdReplyFrame;
	i2o_message_frame_t			StaticMFA;
} i2o_exec_static_mf_create_reply_t;


/* ExecStaticMfRelease Message Frame structure */

typedef struct i2o_exec_static_mf_release_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	i2o_message_frame_t		StaticMFA;
} i2o_exec_static_mf_release_message_t;



#define	I2O_EXEC_STATUS_GET_RESERVED_SZ	16

/* ExecStatusGet Function Message Frame structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_status_get_message {
	uint8_t			VersionOffset;
	uint8_t			MsgFlags;
	uint16_t		MessageSize;
	union {
	    struct {
		uint32_t	Function:8;
		uint32_t	InitiatorAddress:12;
		uint32_t	TargetAddress:12;
	    } s2;
	    uint32_t		w2;
	} u2;
	uint8_t			Reserved[I2O_EXEC_STATUS_GET_RESERVED_SZ];
	uint32_t		ReplyBufferAddressLow;
	uint32_t		ReplyBufferAddressHigh;
	uint32_t		ReplyBufferLength;
} i2o_exec_status_get_message_t;

/* macros to access the bit fields in i2o exec status get message */

#define	get_i2o_exec_status_TargetAddress(mp, hdl) \
			(mp)->u2.s2.TargetAddress
#define	put_i2o_exec_status_TargetAddress(mp, id, hdl) \
			((mp)->u2.s2.TargetAddress = (id))
#define	get_i2o_exec_status_InitiatorAddress(mp, hdl) \
			(mp)->u2.s2.InitiatorAddress
#define	put_i2o_exec_status_InitiatorAddress(mp, id, hdl) \
			((mp)->u2.s2.InitiatorAddress = (id))
#define	get_i2o_exec_status_Function(mp, hdl) \
			(mp)->u2.s2.Function
#define	put_i2o_exec_status_Function(mp, n, hdl) \
			((mp)->u2.s2.Function = (n))

#endif

#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_status_get_message {
	uint8_t			VersionOffset;
	uint8_t			MsgFlags;
	uint16_t		MessageSize;
	union {
	    struct {
		uint32_t	Function:8;
		uint32_t	InitiatorAddress:12;
		uint32_t	TargetAddress:12;
	    } s2;
	    uint32_t		w2;
	} u2;
	uint8_t			Reserved[I2O_EXEC_STATUS_GET_RESERVED_SZ];
	uint32_t		ReplyBufferAddressLow;
	uint32_t		ReplyBufferAddressHigh;
	uint32_t		ReplyBufferLength;
} i2o_exec_status_get_message_t;

/* macros to access the bit fields in i2o exec status get message */

#define	get_i2o_exec_status_Function(mp, hdl) \
	(mp)->u2.s2.Function
#define	put_i2o_exec_status_Function(mp, n, hdl) \
	((mp)->u2.s2.Function = (n))

#define	get_i2o_exec_status_TargetAddress(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)
#define	put_i2o_exec_status_TargetAddress(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, \
		(ddi_get32(hdl, &(mp)->u2.w2) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_status_InitiatorAddress(mp, hdl) \
	((ddi_get32(hdl, &(mp)->u2.w2) >> 12) & 0xFFF)
#define	put_i2o_exec_status_InitiatorAddress(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u2.w2, (ddi_get32(hdl, &(mp)->u2.w2) & \
			~0xFFF000) | (((id) & 0xFFF) << 12))

#endif


#define	I2O_IOP_STATUS_PROD_ID_STR_SZ		24
#define	I2O_EXEC_STATUS_GET_REPLY_RESERVED_SZ	6

/* ExecStatusGet reply Structure */

#define	I2O_IOP_CAP_CONTEXT_32_ONLY		0x00000000
#define	I2O_IOP_CAP_CONTEXT_64_ONLY		0x00000001
#define	I2O_IOP_CAP_CONTEXT_32_64_NOT_CURRENTLY	0x00000002
#define	I2O_IOP_CAP_CONTEXT_32_64_CURRENTLY	0x00000003
#define	I2O_IOP_CAP_CURRENT_CONTEXT_NOT_CONFIG	0x00000000
#define	I2O_IOP_CAP_CURRENT_CONTEXT_32_ONLY	0x00000004
#define	I2O_IOP_CAP_CURRENT_CONTEXT_64_ONLY	0x00000008
#define	I2O_IOP_CAP_CURRENT_CONTEXT_32_64	0x0000000C
#define	I2O_IOP_CAP_INBOUND_PEER_SUPPORT	0x00000010
#define	I2O_IOP_CAP_OUTBOUND_PEER_SUPPORT	0x00000020
#define	I2O_IOP_CAP_PEER_TO_PEER_SUPPORT	0x00000040


#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_status_get_reply {
	uint16_t		OrganizationID;
	uint16_t		reserved;
	union {
	    struct {
		uint16_t	IOP_ID:12;
		uint16_t	reserved1:4;
	    } s2;
	    uint16_t		h1;
	} u2;
	uint16_t		HostUnitID;
	union {
	    struct {
		uint16_t	SegmentNumber:12;
		uint16_t	I2oVersion:4;
	    } s3;
	    uint16_t		h1;
	} u3;
	uint8_t			IopState;
	uint8_t			MessengerType;
	uint16_t		InboundMFrameSize;
	uint8_t			InitCode;
	uint8_t			reserved2;
	uint32_t		MaxInboundMFrames;
	uint32_t		CurrentInboundMFrames;
	uint32_t		MaxOutboundMFrames;
	uint8_t			ProductIDString[I2O_IOP_STATUS_PROD_ID_STR_SZ];
	uint32_t		ExpectedLCTSize;
	uint32_t		IopCapabilities;
	uint32_t		DesiredPrivateMemSize;
	uint32_t		CurrentPrivateMemSize;
	uint32_t		CurrentPrivateMemBase;
	uint32_t		DesiredPrivateIOSize;
	uint32_t		CurrentPrivateIOSize;
	uint32_t		CurrentPrivateIOBase;
	uint8_t			reserved3[3];
	volatile uint8_t	SyncByte;
} i2o_exec_status_get_reply_t;

#define	get_i2o_exec_status_reply_IOP_ID(p, hdl)	(p)->u2.s2.IOP_ID
#define	get_i2o_exec_status_reply_SegmentNumber(p, hdl)(p)->u3.s3.SegmentNumber
#define	get_i2o_exec_status_reply_I2oVersion(p, hdl)(p)->u3.s3.I2oVersion

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_status_get_reply {
	uint16_t		OrganizationID;
	uint16_t		reserved;
	union {
	    struct {
		uint16_t	reserved1:4;
		uint16_t	IOP_ID:12;
	    } s2;
	    uint16_t		h1;
	} u2;
	uint16_t		HostUnitID;
	union {
	    struct {
		uint16_t	I2oVersion:4;
		uint16_t	SegmentNumber:12;
	    } s3;
	    uint16_t		h1;
	} u3;
	uint8_t			IopState;
	uint8_t			MessengerType;
	uint16_t		InboundMFrameSize;
	uint8_t			InitCode;
	uint8_t			reserved2;
	uint32_t		MaxInboundMFrames;
	uint32_t		CurrentInboundMFrames;
	uint32_t		MaxOutboundMFrames;
	uint8_t			ProductIDString[I2O_IOP_STATUS_PROD_ID_STR_SZ];
	uint32_t		ExpectedLCTSize;
	uint32_t		IopCapabilities;
	uint32_t		DesiredPrivateMemSize;
	uint32_t		CurrentPrivateMemSize;
	uint32_t		CurrentPrivateMemBase;
	uint32_t		DesiredPrivateIOSize;
	uint32_t		CurrentPrivateIOSize;
	uint32_t		CurrentPrivateIOBase;
	uint8_t			reserved3[3];
	uint8_t		SyncByte;
} i2o_exec_status_get_reply_t;

#define	get_i2o_exec_status_reply_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u2.h1) & 0xFFF)

#define	get_i2o_exec_status_reply_I2oVersion(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) >> 4)
#define	get_i2o_exec_staus_reply_SegmentNumber(p, hdl) \
	(ddi_get16(hdl, &(p)->u3.h1) & 0xFFF)

#endif


#define	I2O_EXEC_SW_DOWNLOAD_FLAG_LOAD_MEMORY		0x00
#define	I2O_EXEC_SW_DOWNLOAD_FLAG_PERMANENT_STORE	0x01
#define	I2O_EXEC_SW_DOWNLOAD_FLAG_EXPERIMENTAL		0x00
#define	I2O_EXEC_SW_DOWNLOAD_FLAG_OVERRIDE		0x02

#define	I2O_EXEC_SW_TYPE_DDM				0x01
#define	I2O_EXEC_SW_TYPE_DDM_MPB			0x02
#define	I2O_EXEC_SW_TYPE_DDM_CONFIG_TABLE		0x03
#define	I2O_EXEC_SW_TYPE_IRTOS				0x11
#define	I2O_EXEC_SW_TYPE_IRTOS_PRIVATE_MODULE		0x12
#define	I2O_EXEC_SW_TYPE_IRTOS_DIALOG_TABLE		0x13
#define	I2O_EXEC_SW_TYPE_IOP_PRIVATE_MODULE		0x22
#define	I2O_EXEC_SW_TYPE_IOP_DIALOG_TABLE		0x23


/* I2O ExecSwDownload/Upload/Remove SwID Structure */

typedef struct i2o_sw_id {
	uint16_t	ModuleID;
	uint16_t	OrganizationID;
} i2o_sw_id_t;


/* ExecSwDownload Function Message Frame structure. */

typedef struct i2o_exec_sw_donwload_message {
	i2o_message_frame_t	StdMessageFrame;
	i2o_transaction_context_t TransactionContext;
	uint8_t			CurrentFragment;
	uint8_t			TotalFragments;
	uint8_t			SwType;
	uint8_t			DownloadFlags;
	uint32_t		SWSize;
	i2o_sw_id_t		SwID;
	i2o_sg_element_t	SGL;
} i2o_exec_sw_download_message_t;




/* ExecSwUpload Function Message Frame structure. */

typedef struct i2o_exec_sw_upload_message {
	i2o_message_frame_t	StdMessageFrame;
	i2o_transaction_context_t TransactionContext;
	uint8_t			CurrentFragment;
	uint8_t			TotalFragments;
	uint8_t			SwType;
	uint8_t			UploadFlags;
	uint32_t		SWSize;
	i2o_sw_id_t		SwID;
	i2o_sg_element_t	SGL;
} i2o_exec_sw_upload_message_t;


/* ExecSwRemove Function Message Frame structure. */

typedef struct i2o_exec_sw_remove_message {
	i2o_message_frame_t	StdMessageFrame;
	i2o_transaction_context_t TransactionContext;
	uint16_t		reserved;
	uint8_t			SwType;
	uint8_t			RemoveFlags;
	uint32_t		SWSize;
    i2o_sw_id_t			SwID;
} i2o_exec_sw_remove_message_t;


/* ExecSysEnable Function Message Frame structure. */

typedef struct i2o_exec_sys_enable_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
} i2o_exec_sys_enable_message_t;


/* ExecSysModify Function Message Frame structure. */

typedef struct i2o_exec_sys_modify_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	i2o_sg_element_t		SGL;
} i2o_exec_sys_modify_message_t;


/* ExecSysQuiesce Function Message Frame structure. */

typedef struct i2o_exec_sys_quiesce_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
} i2o_exec_sys_quiesce_message_t;


/* ExecSysTabSet (System Table) Function Message Frame structure. */

#define	I2O_EXEC_SYS_TAB_IOP_ID_LOCAL_IOP		0x000
#define	I2O_EXEC_SYS_TAB_IOP_ID_LOCAL_HOST		0x001
#define	I2O_EXEC_SYS_TAB_IOP_ID_UNKNOWN_IOP		0xFFF
#define	I2O_EXEC_SYS_TAB_HOST_UNIT_ID_LOCAL_UNIT	0x0000
#define	I2O_EXEC_SYS_TAB_HOST_UNIT_ID_UNKNOWN_UNIT	0xffff
#define	I2O_EXEC_SYS_TAB_SEG_NUMBER_LOCAL_SEGMENT	0x000
#define	I2O_EXEC_SYS_TAB_SEG_NUMBER_UNKNOWN_SEGMENT	0xfff


#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_exec_sys_tab_set_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		IOP_ID:12;
		uint16_t		reserved:4;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
	union {
	    struct {
		uint32_t		SegmentNumber:12;
		uint32_t		reserved1:20;
	    } s3;
	    uint32_t			w3;
	} u3;
	i2o_sg_element_t		SGL;
} i2o_exec_sys_tab_set_message_t;

/* macros to access the bit fields in exec ddm enable message structure */

#define	get_i2o_exec_sys_tab_set_IOP_ID(mp, hdl) \
			(mp)->u2.s2.IOP_ID
#define	put_i2o_exec_sys_tab_set_IOP_ID(mp, id, hdl) \
			((mp)->u2.s2.IOP_ID = (id))

#define	get_i2o_exec_sys_tab_set_SegmentNumber(mp, hdl) \
			(mp)->u3.s3.SegmentNumber
#define	put_i2o_exec_sys_tab_set_SegmentNumber(mp, id, hdl) \
			((mp)->u3.s3.SegmentNumber = (id))
#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_exec_sys_tab_set_message {
	i2o_message_frame_t		StdMessageFrame;
	i2o_transaction_context_t	TransactionContext;
	union {
	    struct {
		uint16_t		reserved:4;
		uint16_t		IOP_ID:12;
	    } s2;
	    uint16_t			h1;
	} u2;
	uint16_t			HostUnitID;
	union {
	    struct {
		uint32_t		reserved1:20;
		uint32_t		SegmentNumnber:12;
	    } s3;
	    uint32_t			w3;
	} u3;
	i2o_sg_element_t		SGL;
} i2o_exec_sys_tab_set_message_t;

/* macros to access the bit fields in exec ddm enable message structure */

#define	get_i2o_exec_sys_tab_set_IOP_ID(p, hdl) \
	(ddi_get16(hdl, &(p)->u2.h1) & 0xFFF)

#define	put_i2o_exec_sys_tab_set_IOP_ID(mp, id, hdl) \
	ddi_put16(hdl, &(mp)->u2.h1, \
		(ddi_get16(hdl, &(mp)->u2.h1) & ~0xFFF) | ((id) & 0xFFF))

#define	get_i2o_exec_sys_tab_set_SegmentNumber(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u3.w3) & 0xFFF)
#define	put_i2o_exec_sys_tab_set_SegmentNumber(mp, id, hdl) \
	ddi_put32(hdl, &(mp)->u3.w3, \
		(ddi_get32(hdl, &(mp)->u3.w3) & ~0xFFF) | ((id) & 0xFFF))

#endif


/* ExecSysTabSet (System Table) Header Reply structure. */

#define	I2O_SET_SYSTAB_RESERVED_SZ	8

typedef struct i2o_set_systab_header {
	uint8_t		NumberEntries;
	uint8_t		SysTabVersion;
	uint16_t	reserved;
	uint32_t	CurrentChangeIndicator;
	uint8_t		reserved1[I2O_SET_SYSTAB_RESERVED_SZ];
/*    I2O_SYSTAB_ENTRY    SysTabEntry[1]; */
} i2o_set_systab_header_t;


#define	I2O_RESOURCE_MANAGER_VERSION	0

typedef struct i2o_messenger_info {
	uint32_t	InboundMessagePortAddressLow;
	uint32_t	InboundMessagePortAddressHigh;
} i2o_messenger_info_t;

/* ExecSysTabSet IOP Descriptor Entry structure. */

#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)

typedef struct i2o_iop_entry {
	uint16_t		OrganizationID;
	uint16_t		reserved;
	union {
	    struct {
		uint32_t	IOP_ID:12;
		uint32_t	reserved1:20;
	    } s2;
	    uint32_t		w2;
	} u2;
	union {
	    struct {
		uint16_t	SegmentNumber:12;
		uint16_t	I2oVersion:4;
	    } s3;
	    uint16_t		h1;
	} u3;
	uint8_t			IopState;
	uint8_t			MessengerType;
	uint16_t		InboundMessageFrameSize;
	uint16_t		reserved2;
	uint32_t		LastChanged;
	uint32_t		IopCapabilities;
    i2o_messenger_info_t	MessengerInfo;
} i2o_iop_entry_t;


#define	get_i2o_iop_entry_IOP_ID(mp, hdl) \
	((mp)->u2.s2.IOP_ID)

#define	put_i2o_iop_entry_IOP_ID(mp, v, hdl) \
	((mp)->u2.s2.IOP_ID) = (v)

#define	get_i2o_iop_entry_SegmentNumber(mp, hdl) \
	((mp)->u3.s3.SegmentNumber)

#define	put_i2o_iop_entry_SegmentNumber(mp, v, hdl) \
	((mp)->u3.s3.SegmentNumber) = (v)

#define	get_i2o_iop_entry_I2oVersion(mp, hdl) \
	((mp)->u3.s3.I2oVersion)

#define	put_i2o_iop_entry_I2oVersion(mp, v, hdl) \
	((mp)->u3.s3.I2oVersion) = (v)

#endif


#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)

typedef struct i2o_iop_entry {
	uint16_t		OrganizationID;
	uint16_t		reserved;
	union {
	    struct {
		uint32_t	reserved1:20;
		uint32_t	IOP_ID:12;
	    } s2;
	    uint32_t		w2;
	} u2;
	union {
	    struct {
		uint16_t	I2oVersion:4;
		uint16_t	SegmentNumber:12;
	    } s3;
	    uint16_t		h1;
	} u3;
	uint8_t			IopState;
	uint8_t			MessengerType;
	uint16_t		InboundMessageFrameSize;
	uint16_t		reserved2;
	uint32_t		LastChanged;
	uint32_t		IopCapabilities;
    i2o_messenger_info_t	MessengerInfo;
} i2o_iop_entry_t;


#define	get_i2o_iop_entry_IOP_ID(mp, hdl) \
	(ddi_get32(hdl, &(mp)->u2.w2) & 0xFFF)

#define	put_i2o_iop_entry_IOP_ID(mp, v, hdl) \
	(ddi_put32(hdl, &(mp)->u2.w2) & 0xFFF, (v))

#define	get_i2o_iop_entry_SegmentNumber(mp, hdl) \
	(ddi_get16(hdl, &(mp)->u3.h1) & 0xFFF)

#define	put_i2o_iop_entry_SegmentNumber(mp, v, hdl) \
	(ddi_put16(hdl, &(mp)->u3.h1) & 0xFFF, (v))

#define	get_i2o_iop_entry_I2oVersion(mp, hdl) \
	((ddi_get16(hdl, &(mp)->u3.h1) >> 12) & 0xF)

#define	put_i2o_iop_entry_I2oVersion(mp, v, hdl) \
	((ddi_put16(hdl, &(mp)->u3.h1) >> 12) & 0xF, (v))

#endif


/* ************************************************************************** */
/* Executive Parameter Groups */
/* ************************************************************************** */


#define	I2O_EXEC_IOP_HARDWARE_GROUP_NO			0x0000
#define	I2O_EXEC_IOP_MESSAGE_IF_GROUP_NO		0x0001
#define	I2O_EXEC_EXECUTING_ENVIRONMENT_GROUP_NO		0x0002
#define	I2O_EXEC_EXECUTING_DDM_LIST_GROUP_NO		0x0003
#define	I2O_EXEC_DRIVER_STORE_GROUP_NO			0x0004
#define	I2O_EXEC_DRIVER_STORE_TABLE_GROUP_NO		0x0005
#define	I2O_EXEC_IOP_BUS_ATTRIBUTES_GROUP_NO		0x0006
#define	I2O_EXEC_IOP_SW_ATTRIBUTES_GROUP_NO		0x0007
#define	I2O_EXEC_HARDWARE_RESOURCE_TABLE_GROUP_NO	0x0100
#define	I2O_EXEC_LCT_SCALAR_GROUP_NO			0x0101
#define	I2O_EXEC_LCT_TABLE_GROUP_NO			0x0102
#define	I2O_EXEC_SYSTEM_TABLE_GROUP_NO			0x0103
#define	I2O_EXEC_EXTERNAL_CONN_TABLE_GROUP_NO		0x0104


/* EXEC Group 0000h - IOP Hardware Parameter Group */

/* IOP HardWare Capabilities defines */

#define	I2O_IOP_HW_CAP_SELF_BOOT			0x00000001
#define	I2O_IOP_HW_CAP_IRTOS_UPGRADEABLE		0x00000002
#define	I2O_IOP_HW_CAP_DOWNLOADABLE_DDM			0x00000004
#define	I2O_IOP_HW_CAP_INSTALLABLE_DDM			0x00000008
#define	I2O_IOP_HW_CAP_BATTERY_BACKUP_RAM		0x00000010

/* IOP Processor Type defines */

#define	I2O_IOP_PROC_TYPE_INTEL_80960			0x00
#define	I2O_IOP_PROC_TYPE_AMD_29000			0x01
#define	I2O_IOP_PROC_TYPE_MOTOROLA_68000		0x02
#define	I2O_IOP_PROC_TYPE_ARM				0x03
#define	I2O_IOP_PROC_TYPE_MIPS				0x04
#define	I2O_IOP_PROC_TYPE_SPARC				0x05
#define	I2O_IOP_PROC_TYPE_POWER_PC			0x06
#define	I2O_IOP_PROC_TYPE_ALPHA				0x07
#define	I2O_IOP_PROC_TYPE_INTEL_X86			0x08
#define	I2O_IOP_PROC_TYPE_OTHER				0xFF


typedef struct i2o_exec_iop_hardware_scalar {
	uint16_t		I2oVendorID;
	uint16_t		ProductID;
	uint32_t		ProcessorMemory;
	uint32_t		PermMemory;
	uint32_t		HWCapabilities;
	uint8_t			ProcessorType;
	uint8_t			ProcessorVersion;
} i2o_exec_iop_hardware_scalar_t;


/* EXEC Group 0001h - IOP Message Interface Parameter Group */

/* InitCode defines */
#define	I2O_MESSAGE_IF_INIT_CODE_NO_OWNER		0x00
#define	I2O_MESSAGE_IF_INIT_CODE_BIOS			0x10
#define	I2O_MESSAGE_IF_INIT_CODE_OEM_BIOS_EXTENSION	0x20
#define	I2O_MESSAGE_IF_INIT_CODE_ROM_BIOS_EXTENSION	0x30
#define	I2O_MESSAGE_IF_INIT_CODE_OS			0x80

typedef struct i2o_exec_iop_message_if_scalar {
	uint32_t		InboundFrameSize;
	uint32_t		InboundSizeTarget;
	uint32_t		InboundMax;
	uint32_t		InboundTarget;
	uint32_t		InboundPoolCount;
	uint32_t		InboundCurrentFree;
	uint32_t		InboundCurrentPost;
	uint16_t		StaticCount;
	uint16_t		StaticInstanceCount;
	uint16_t		StaticLimit;
	uint16_t		StaticInstanceLimit;
	uint32_t		OutboundFrameSize;
	uint32_t		OutboundMax;
	uint32_t		OutboundMaxTarget;
	uint32_t		OutboundCurrentFree;
	uint32_t		OutboundCurrentPost;
	uint8_t			InitCode;
} i2o_exec_iop_message_if_scalar_t;


/* EXEC Group 0002h - Executing Environment Parameter Group */

typedef struct i2o_exec_execute_environment_scalar {
	uint32_t		MemTotal;
	uint32_t		MemFree;
	uint32_t		PageSize;
	uint32_t		EventQMax;
	uint32_t		EventQCurrent;
	uint32_t		DDMLoadMax;
} i2o_exec_execute_environment_scalar_t;


/* EXEC Group 0003h - Executing DDM's Parameter Group */

/* ModuleType Defines */

#define	I2O_EXEC_DDM_MODULE_TYPE_OTHER		0x00
#define	I2O_EXEC_DDM_MODULE_TYPE_DOWNLOAD	0x01
#define	I2O_EXEC_DDM_MODULE_TYPE_EMBEDDED	0x22


typedef struct i2o_exec_execute_ddm_table {
	uint16_t		DdmTID;
	uint8_t			ModuleType;
	uint8_t			reserved;
	uint16_t		I2oVendorID;
	uint16_t		ModuleID;
	uint8_t			ModuleName[I2O_MODULE_NAME_SZ];
	uint32_t		ModuleVersion;
	uint32_t		DataSize;
	uint32_t		CodeSize;
} i2o_exec_execute_ddm_table_t;


/* EXEC Group 0004h - Driver Store Environment Parameter Group */


typedef struct i2o_exec_driver_store_scalar {
	uint32_t		ModuleLimit;
	uint32_t		ModuleCount;
	uint32_t		CurrentSpace;
	uint32_t		FreeSpace;
} i2o_exec_driver_store_scalar_t;


/* EXEC Group 0005h - Driver Store Parameter Group */


typedef struct i2o_exec_driver_store_table {
	uint16_t		StoredDdmIndex;
	uint8_t			ModuleType;
	uint8_t			reserved;
	uint16_t		I2oVendorID;
	uint16_t		ModuleID;
	uint8_t			ModuleName[I2O_MODULE_NAME_SZ];
	uint32_t		ModuleVersion;
	uint16_t		DateDay;
	uint16_t		DateMonth;
	uint32_t		DateYear;
	uint32_t		ModuleSize;
	uint32_t		MpbSize;
	uint32_t		ModuleFlags;
} i2o_exec_driver_store_table_t;


/* EXEC Group 0006h - IOP's Bus Attributes Parameter Group */

#define	I2O_EXEC_IOP_BUS_ATTRIB_SYSTEM_BUS		0x00
#define	I2O_EXEC_IOP_BUS_ATTRIB_BRIDGED_SYSTEM_BUS	0x01
#define	I2O_EXEC_IOP_BUS_ATTRIB_PRIVATE			0x02

typedef struct i2o_exec_iop_bus_attribute_table {
	uint32_t		BusID;
	uint8_t			BusType;
	uint8_t			MaxAdapters;
	uint8_t			AdapterCount;
	uint8_t			BusAttributes;
} i2o_exec_iop_bus_attribute_table_t;


/* EXEC Group 0007h - IOP's Bus Attributes Parameter Group */

#define	I2O_EXEC_IOP_SW_CAP_IRTOS_I2O_COMPLIANT		0x00000001
#define	I2O_EXEC_IOP_SW_CAP_IRTOS_UPGRADEABLE		0x00000002
#define	I2O_EXEC_IOP_SW_CAP_DOWNLOADABLE_DDM		0x00000004
#define	I2O_EXEC_IOP_SW_CAP_INSTALLABLE_DDM		0x00000008

typedef struct i2o_exec_iop_sw_attributes_scalar {
	uint16_t		I2oVendorID;
	uint16_t		ProductID;
	uint32_t		CodeSize;
	uint32_t		SWCapabilities;
} i2o_exec_iop_sw_attributes_scalar_t;


/* EXEC Group 0100h - Hardware Resource Table Parameter Group */

typedef struct i2o_exec_hardware_resource_table {
	uint32_t		AdapterID;
	uint16_t		StateInfo; /* AdapterState plus Local TID */
	uint8_t			BusNumber;
	uint8_t			BusType;
	u_longlong_t		PhysicalLocation;
	uint32_t		MemorySpace;
	uint32_t		IoSpace;
} i2o_exec_hardware_resource_table_t;

/* EXEC Group 0101h - Logical Configuration Table Scalar Parameter Group */

typedef struct i2o_exec_lct_scalar {
	uint16_t		BootDevice;
	uint32_t		IopFlags;
	uint32_t		CurrentChangeIndicator;
} i2o_exec_lct_scalar_t;

/* EXEC Group 0102h - Logical Configuration Table Parameter Group */

typedef struct i2o_exec_lct_table {
	uint16_t		LocalTID;
	uint16_t		UserTID;
	uint16_t		ParentTID;
	uint16_t		DdmTID;
	uint32_t		ChangeIndicator;
	uint32_t		DeviceFlags;
	uint32_t		ClassID;
	uint32_t		SubClass;
	uint8_t			IdentityTag[I2O_IDENTITY_TAG_SZ];
	uint32_t		EventCapabilities;
	uint8_t			BiosInfo;
} i2o_exec_lct_table_t;

/* EXEC Group 0103h - System Table Parameter Group */

#define	I2O_MESSENGER_TYPE_MEMORY_MAPPED_MESSAGE_UNIT	0x0

typedef struct i2o_exec_system_table {
	uint16_t		IOP_ID;
	uint16_t		OrganizationID;
	uint16_t		SegmentNumber;
	uint8_t			Version;
	uint8_t			IopState;
	uint8_t			MessengerType;
	uint8_t			reserved;
	uint32_t		InboundMessagePortAddress;
	uint16_t		InboundMessageFrameSize;
	uint32_t		IopCapabilities;
    i2o_messenger_info_t	MessengerInfo;
} i2o_exec_system_table_t;


/* EXEC Group 0104h - External Connection Table Parameter Group */

#define	I2O_EXEC_XCT_FLAGS_REMOTE_IOP_CREATED_CONNECTION	0x00
#define	I2O_EXEC_XCT_FLAGS_THIS_IOP_CREATED_CONNECTION		0x01

typedef struct i2o_exec_external_connection_table {
	uint16_t		LocalAliasTID;
	uint16_t		RemoteTID;
	uint16_t		RemoteIOP;
	uint16_t		RemoteUnitID;
	uint8_t			Flags;
	uint8_t			reserved;
} i2o_exec_external_connection_table_t;


#ifdef	__cplusplus
}
#endif

#endif /* _SYS_I2OEXEC_H */