Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

   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
/*
 * Copyright (c) 2017-2018 Cavium, Inc. 
 * All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *  1. Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 *  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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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
 *  INTERRUPTION) 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 SOFTWARE, EVEN IF ADVISED OF THE
 *  POSSIBILITY OF SUCH DAMAGE.
 *
 * $FreeBSD$
 *
 */


#ifndef __ISCSI_COMMON__
#define __ISCSI_COMMON__ 
/**********************/
/* ISCSI FW CONSTANTS */
/**********************/

/* iSCSI HSI constants */
#define ISCSI_DEFAULT_MTU	(1500)

/* KWQ (kernel work queue) layer codes */
#define ISCSI_SLOW_PATH_LAYER_CODE   (6)

/* iSCSI parameter defaults */
#define ISCSI_DEFAULT_HEADER_DIGEST         (0)
#define ISCSI_DEFAULT_DATA_DIGEST           (0)
#define ISCSI_DEFAULT_INITIAL_R2T           (1)
#define ISCSI_DEFAULT_IMMEDIATE_DATA        (1)
#define ISCSI_DEFAULT_MAX_PDU_LENGTH        (0x2000)
#define ISCSI_DEFAULT_FIRST_BURST_LENGTH    (0x10000)
#define ISCSI_DEFAULT_MAX_BURST_LENGTH      (0x40000)
#define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T   (1)

/* iSCSI parameter limits */
#define ISCSI_MIN_VAL_MAX_PDU_LENGTH        (0x200)
#define ISCSI_MAX_VAL_MAX_PDU_LENGTH        (0xffffff)
#define ISCSI_MIN_VAL_BURST_LENGTH          (0x200)
#define ISCSI_MAX_VAL_BURST_LENGTH          (0xffffff)
#define ISCSI_MIN_VAL_MAX_OUTSTANDING_R2T   (1)
#define ISCSI_MAX_VAL_MAX_OUTSTANDING_R2T   (0xff) // 0x10000 according to RFC

#define ISCSI_AHS_CNTL_SIZE 4 

#define ISCSI_WQE_NUM_SGES_SLOWIO           (0xf)

/* iSCSI reserved params */
#define ISCSI_ITT_ALL_ONES					(0xffffffff)
#define ISCSI_TTT_ALL_ONES					(0xffffffff)

#define ISCSI_OPTION_1_OFF_CHIP_TCP 1
#define ISCSI_OPTION_2_ON_CHIP_TCP 2

#define ISCSI_INITIATOR_MODE 0
#define ISCSI_TARGET_MODE 1


/* iSCSI request op codes */
#define ISCSI_OPCODE_NOP_OUT				(0)
#define ISCSI_OPCODE_SCSI_CMD       		(1)
#define ISCSI_OPCODE_TMF_REQUEST			(2)
#define ISCSI_OPCODE_LOGIN_REQUEST			(3)
#define ISCSI_OPCODE_TEXT_REQUEST       	(4)
#define ISCSI_OPCODE_DATA_OUT				(5)
#define ISCSI_OPCODE_LOGOUT_REQUEST     	(6)

/* iSCSI response/messages op codes */
#define ISCSI_OPCODE_NOP_IN             (0x20)
#define ISCSI_OPCODE_SCSI_RESPONSE      (0x21)
#define ISCSI_OPCODE_TMF_RESPONSE       (0x22)
#define ISCSI_OPCODE_LOGIN_RESPONSE     (0x23)
#define ISCSI_OPCODE_TEXT_RESPONSE      (0x24)
#define ISCSI_OPCODE_DATA_IN            (0x25)
#define ISCSI_OPCODE_LOGOUT_RESPONSE    (0x26)
#define ISCSI_OPCODE_R2T                (0x31)
#define ISCSI_OPCODE_ASYNC_MSG          (0x32)
#define ISCSI_OPCODE_REJECT             (0x3f)

/* iSCSI stages */
#define ISCSI_STAGE_SECURITY_NEGOTIATION            (0)
#define ISCSI_STAGE_LOGIN_OPERATIONAL_NEGOTIATION   (1)
#define ISCSI_STAGE_FULL_FEATURE_PHASE              (3)

/* iSCSI CQE errors */
#define CQE_ERROR_BITMAP_DATA_DIGEST          (0x08)
#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN  (0x10)
#define CQE_ERROR_BITMAP_DATA_TRUNCATED       (0x20)


/*
 * Union of data bd_opaque/ tq_tid
 */
union bd_opaque_tq_union
{
	__le16 bd_opaque /* BDs opaque data */;
	__le16 tq_tid /* Immediate Data with DIF TQe TID */;
};


/*
 * ISCSI SGL entry
 */
struct cqe_error_bitmap
{
	u8 cqe_error_status_bits;
#define CQE_ERROR_BITMAP_DIF_ERR_BITS_MASK         0x7 /* Mark task with DIF error (3 bit): [0]-CRC/checksum, [1]-app tag, [2]-reference tag */
#define CQE_ERROR_BITMAP_DIF_ERR_BITS_SHIFT        0
#define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_MASK      0x1 /* Mark task with data digest error (1 bit) */
#define CQE_ERROR_BITMAP_DATA_DIGEST_ERR_SHIFT     3
#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_MASK  0x1 /* Mark receive on invalid connection */
#define CQE_ERROR_BITMAP_RCV_ON_INVALID_CONN_SHIFT 4
#define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_MASK   0x1 /* Target Mode - Mark middle task error, data truncated */
#define CQE_ERROR_BITMAP_DATA_TRUNCATED_ERR_SHIFT  5
#define CQE_ERROR_BITMAP_UNDER_RUN_ERR_MASK        0x1
#define CQE_ERROR_BITMAP_UNDER_RUN_ERR_SHIFT       6
#define CQE_ERROR_BITMAP_RESERVED2_MASK            0x1
#define CQE_ERROR_BITMAP_RESERVED2_SHIFT           7
};


union cqe_error_status
{
	u8 error_status /* all error bits as uint8 */;
	struct cqe_error_bitmap error_bits /* cqe errors bitmap */;
};


/*
 * iSCSI Login Response PDU header
 */
struct data_hdr
{
	__le32 data[12] /* iscsi header data */;
};


struct lun_mapper_addr_reserved
{
	struct regpair lun_mapper_addr /* Lun mapper address */;
	u8 reserved0[8];
};

/*
 * rdif conetxt for dif on immediate
 */
struct dif_on_immediate_params
{
	__le32 initial_ref_tag;
	__le16 application_tag;
	__le16 application_tag_mask;
	__le16 flags1;
#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_MASK             0x1
#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_GUARD_SHIFT            0
#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_MASK           0x1
#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_APP_TAG_SHIFT          1
#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_MASK           0x1
#define DIF_ON_IMMEDIATE_PARAMS_VALIDATE_REF_TAG_SHIFT          2
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_MASK              0x1
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_GUARD_SHIFT             3
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_MASK            0x1
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_SHIFT           4
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_MASK            0x1
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_SHIFT           5
#define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_MASK              0x1 /* 0=512B, 1=4KB */
#define DIF_ON_IMMEDIATE_PARAMS_INTERVAL_SIZE_SHIFT             6
#define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_MASK          0x1 /* 0=None, 1=DIF */
#define DIF_ON_IMMEDIATE_PARAMS_NETWORK_INTERFACE_SHIFT         7
#define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_MASK             0x3 /* 0=None, 1=DIF, 2=DIX */
#define DIF_ON_IMMEDIATE_PARAMS_HOST_INTERFACE_SHIFT            8
#define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_MASK               0xF /* mask for refernce tag handling */
#define DIF_ON_IMMEDIATE_PARAMS_REF_TAG_MASK_SHIFT              10
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_MASK  0x1 /* Forward application tag with mask */
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_APP_TAG_WITH_MASK_SHIFT 14
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_MASK  0x1 /* Forward reference tag with mask */
#define DIF_ON_IMMEDIATE_PARAMS_FORWARD_REF_TAG_WITH_MASK_SHIFT 15
	u8 flags0;
#define DIF_ON_IMMEDIATE_PARAMS_RESERVED_MASK                   0x1
#define DIF_ON_IMMEDIATE_PARAMS_RESERVED_SHIFT                  0
#define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_MASK             0x1
#define DIF_ON_IMMEDIATE_PARAMS_IGNORE_APP_TAG_SHIFT            1
#define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_MASK   0x1
#define DIF_ON_IMMEDIATE_PARAMS_INITIAL_REF_TAG_IS_VALID_SHIFT  2
#define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_MASK            0x1 /* 0 = IP checksum, 1 = CRC */
#define DIF_ON_IMMEDIATE_PARAMS_HOST_GUARD_TYPE_SHIFT           3
#define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_MASK            0x3 /* 1/2/3 - Protection Type */
#define DIF_ON_IMMEDIATE_PARAMS_PROTECTION_TYPE_SHIFT           4
#define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_MASK                   0x1 /* 0=0x0000, 1=0xffff */
#define DIF_ON_IMMEDIATE_PARAMS_CRC_SEED_SHIFT                  6
#define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_MASK         0x1 /* Keep reference tag constant */
#define DIF_ON_IMMEDIATE_PARAMS_KEEP_REF_TAG_CONST_SHIFT        7
	u8 reserved_zero[5];
};

/*
 * iSCSI dif on immediate mode attributes union
 */
union dif_configuration_params
{
	struct lun_mapper_addr_reserved lun_mapper_address /* lun mapper address */;
	struct dif_on_immediate_params def_dif_conf /* default dif on immediate rdif configuration */;
};



/*
 * Union of data/r2t sequence number
 */
union iscsi_seq_num
{
	__le16 data_sn /* data-in sequence number */;
	__le16 r2t_sn /* r2t pdu sequence number */;
};

/*
 * iSCSI DIF flags 
 */
struct iscsi_dif_flags
{
	u8 flags;
#define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_MASK  0xF /* Protection log interval (9=512 10=1024  11=2048 12=4096 13=8192) */
#define ISCSI_DIF_FLAGS_PROT_INTERVAL_SIZE_LOG_SHIFT 0
#define ISCSI_DIF_FLAGS_DIF_TO_PEER_MASK             0x1 /* If DIF protection is configured against target (0=no, 1=yes) */
#define ISCSI_DIF_FLAGS_DIF_TO_PEER_SHIFT            4
#define ISCSI_DIF_FLAGS_HOST_INTERFACE_MASK          0x7 /* If DIF/DIX protection is configured against the host (0=none, 1=DIF, 2=DIX 2 bytes, 3=DIX 4 bytes, 4=DIX 8 bytes) */
#define ISCSI_DIF_FLAGS_HOST_INTERFACE_SHIFT         5
};

/*
 * The iscsi storm task context of Ystorm
 */
struct ystorm_iscsi_task_state
{
	struct scsi_cached_sges data_desc;
	struct scsi_sgl_params sgl_params;
	__le32 exp_r2t_sn /* Initiator mode - Expected R2T PDU index in sequence. [variable, initialized 0] */;
	__le32 buffer_offset /* Payload data offset */;
	union iscsi_seq_num seq_num /* PDU index in sequence */;
	struct iscsi_dif_flags dif_flags /* Dif flags */;
	u8 flags;
#define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_MASK  0x1 /* local_completion  */
#define YSTORM_ISCSI_TASK_STATE_LOCAL_COMP_SHIFT 0
#define YSTORM_ISCSI_TASK_STATE_SLOW_IO_MASK     0x1 /* Equals 1 if SGL is predicted and 0 otherwise. */
#define YSTORM_ISCSI_TASK_STATE_SLOW_IO_SHIFT    1
#define YSTORM_ISCSI_TASK_STATE_RESERVED0_MASK   0x3F
#define YSTORM_ISCSI_TASK_STATE_RESERVED0_SHIFT  2
};

/*
 * The iscsi storm task context of Ystorm
 */
struct ystorm_iscsi_task_rxmit_opt
{
	__le32 fast_rxmit_sge_offset /* SGE offset from which to continue dummy-read or start fast retransmit */;
	__le32 scan_start_buffer_offset /* Starting buffer offset of next retransmit SGL scan */;
	__le32 fast_rxmit_buffer_offset /* Buffer offset from which to continue dummy-read or start fast retransmit */;
	u8 scan_start_sgl_index /* Starting SGL index of next retransmit SGL scan */;
	u8 fast_rxmit_sgl_index /* SGL index from which to continue dummy-read or start fast retransmit */;
	__le16 reserved /* reserved */;
};

/*
 * iSCSI Common PDU header
 */
struct iscsi_common_hdr
{
	u8 hdr_status /* Status field of ISCSI header */;
	u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */;
	u8 hdr_flags /* Flags field of ISCSI header */;
	u8 hdr_first_byte;
#define ISCSI_COMMON_HDR_OPCODE_MASK         0x3F /* Opcode */
#define ISCSI_COMMON_HDR_OPCODE_SHIFT        0
#define ISCSI_COMMON_HDR_IMM_MASK            0x1 /* Immediate */
#define ISCSI_COMMON_HDR_IMM_SHIFT           6
#define ISCSI_COMMON_HDR_RSRV_MASK           0x1 /* first bit of iSCSI PDU header */
#define ISCSI_COMMON_HDR_RSRV_SHIFT          7
	__le32 hdr_second_dword;
#define ISCSI_COMMON_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_COMMON_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_COMMON_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun_reserved /* Bytes 8..15 : LUN (if PDU contains a LUN field) or reserved */;
	__le32 itt /* ITT - common to all headers */;
	__le32 ttt /* bytes 20 to 23 - common ttt to various PDU headers */;
	__le32 cmdstat_sn /* bytes 24 to 27 - common cmd_sn (initiator) or stat_sn (target) to various PDU headers */;
	__le32 exp_statcmd_sn /* bytes 28 to 31 - common expected stat_sn (initiator) or cmd_sn (target) to various PDU headers */;
	__le32 max_cmd_sn /* bytes 32 to 35 - common max cmd_sn to various PDU headers */;
	__le32 data[3] /* bytes 36 to 47 */;
};

/*
 * iSCSI Command PDU header
 */
struct iscsi_cmd_hdr
{
	__le16 reserved1 /* reserved */;
	u8 flags_attr;
#define ISCSI_CMD_HDR_ATTR_MASK           0x7 /* attributes */
#define ISCSI_CMD_HDR_ATTR_SHIFT          0
#define ISCSI_CMD_HDR_RSRV_MASK           0x3 /* reserved */
#define ISCSI_CMD_HDR_RSRV_SHIFT          3
#define ISCSI_CMD_HDR_WRITE_MASK          0x1 /* write */
#define ISCSI_CMD_HDR_WRITE_SHIFT         5
#define ISCSI_CMD_HDR_READ_MASK           0x1 /* read */
#define ISCSI_CMD_HDR_READ_SHIFT          6
#define ISCSI_CMD_HDR_FINAL_MASK          0x1 /* final */
#define ISCSI_CMD_HDR_FINAL_SHIFT         7
	u8 hdr_first_byte;
#define ISCSI_CMD_HDR_OPCODE_MASK         0x3F /* Opcode */
#define ISCSI_CMD_HDR_OPCODE_SHIFT        0
#define ISCSI_CMD_HDR_IMM_MASK            0x1 /* Immediate delivery */
#define ISCSI_CMD_HDR_IMM_SHIFT           6
#define ISCSI_CMD_HDR_RSRV1_MASK          0x1 /* first bit of iSCSI PDU header */
#define ISCSI_CMD_HDR_RSRV1_SHIFT         7
	__le32 hdr_second_dword;
#define ISCSI_CMD_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_CMD_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_CMD_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_CMD_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number. [constant, initialized] */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 expected_transfer_length /* Expected Data Transfer Length (only 3 bytes are significant) */;
	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
	__le32 cdb[4] /* CDB. [constant, initialized] */;
};

/*
 * iSCSI Command PDU header with Extended CDB (Initiator Mode)
 */
struct iscsi_ext_cdb_cmd_hdr
{
	__le16 reserved1 /* reserved */;
	u8 flags_attr;
#define ISCSI_EXT_CDB_CMD_HDR_ATTR_MASK          0x7 /* attributes */
#define ISCSI_EXT_CDB_CMD_HDR_ATTR_SHIFT         0
#define ISCSI_EXT_CDB_CMD_HDR_RSRV_MASK          0x3 /* reserved */
#define ISCSI_EXT_CDB_CMD_HDR_RSRV_SHIFT         3
#define ISCSI_EXT_CDB_CMD_HDR_WRITE_MASK         0x1 /* write */
#define ISCSI_EXT_CDB_CMD_HDR_WRITE_SHIFT        5
#define ISCSI_EXT_CDB_CMD_HDR_READ_MASK          0x1 /* read */
#define ISCSI_EXT_CDB_CMD_HDR_READ_SHIFT         6
#define ISCSI_EXT_CDB_CMD_HDR_FINAL_MASK         0x1 /* final */
#define ISCSI_EXT_CDB_CMD_HDR_FINAL_SHIFT        7
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_MASK  0xFFFFFF /* DataSegmentLength */
#define ISCSI_EXT_CDB_CMD_HDR_DATA_SEG_LEN_SHIFT 0
#define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_MASK      0xFF /* The Extended CDB size in bytes. Maximum Extended CDB size supported is CDB 64B. */
#define ISCSI_EXT_CDB_CMD_HDR_CDB_SIZE_SHIFT     24
	struct regpair lun /* Logical Unit Number. [constant, initialized] */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 expected_transfer_length /* Expected Data Transfer Length (only 3 bytes are significant) */;
	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
	struct scsi_sge cdb_sge /* Extended CDBs dedicated SGE */;
};

/*
 * iSCSI login request PDU header
 */
struct iscsi_login_req_hdr
{
	u8 version_min /* Version-min */;
	u8 version_max /* Version-max */;
	u8 flags_attr;
#define ISCSI_LOGIN_REQ_HDR_NSG_MASK            0x3 /* Next Stage (NSG) */
#define ISCSI_LOGIN_REQ_HDR_NSG_SHIFT           0
#define ISCSI_LOGIN_REQ_HDR_CSG_MASK            0x3 /* Current stage (CSG) */
#define ISCSI_LOGIN_REQ_HDR_CSG_SHIFT           2
#define ISCSI_LOGIN_REQ_HDR_RSRV_MASK           0x3 /* reserved */
#define ISCSI_LOGIN_REQ_HDR_RSRV_SHIFT          4
#define ISCSI_LOGIN_REQ_HDR_C_MASK              0x1 /* C (Continue) bit */
#define ISCSI_LOGIN_REQ_HDR_C_SHIFT             6
#define ISCSI_LOGIN_REQ_HDR_T_MASK              0x1 /* T (Transit) bit */
#define ISCSI_LOGIN_REQ_HDR_T_SHIFT             7
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_LOGIN_REQ_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_LOGIN_REQ_HDR_TOTAL_AHS_LEN_SHIFT 24
	__le32 isid_tabc /* Session identifier high double word [constant, initialized] */;
	__le16 tsih /* TSIH */;
	__le16 isid_d /* Session identifier low word [constant, initialized] */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le16 reserved1;
	__le16 cid /* Unique Connection ID within the session [constant, initialized] */;
	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
	__le32 reserved2[4];
};

/*
 * iSCSI logout request PDU header
 */
struct iscsi_logout_req_hdr
{
	__le16 reserved0 /* reserved */;
	u8 reason_code /* Reason Code */;
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 reserved1;
	__le32 reserved2[2] /* Reserved */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le16 reserved3 /* Reserved */;
	__le16 cid /* Unique Connection ID within the session [constant, initialized] */;
	__le32 cmd_sn /* CmdSn. [constant, initialized] */;
	__le32 exp_stat_sn /* various fields for middle-path PDU. [constant, initialized] */;
	__le32 reserved4[4] /* Reserved */;
};

/*
 * iSCSI Data-out PDU header
 */
struct iscsi_data_out_hdr
{
	__le16 reserved1 /* reserved */;
	u8 flags_attr;
#define ISCSI_DATA_OUT_HDR_RSRV_MASK   0x7F /* reserved */
#define ISCSI_DATA_OUT_HDR_RSRV_SHIFT  0
#define ISCSI_DATA_OUT_HDR_FINAL_MASK  0x1 /* final */
#define ISCSI_DATA_OUT_HDR_FINAL_SHIFT 7
	u8 opcode /* opcode */;
	__le32 reserved2 /* reserved */;
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
	__le32 ttt /* Target Transfer Tag (from R2T) */;
	__le32 reserved3 /* resrved */;
	__le32 exp_stat_sn /* Expected StatSn */;
	__le32 reserved4 /* resrved */;
	__le32 data_sn /* DataSN - PDU index in sequnece */;
	__le32 buffer_offset /* Buffer Offset - offset in task */;
	__le32 reserved5 /* resrved */;
};

/*
 * iSCSI Data-in PDU header
 */
struct iscsi_data_in_hdr
{
	u8 status_rsvd /* Status or reserved */;
	u8 reserved1 /* reserved */;
	u8 flags;
#define ISCSI_DATA_IN_HDR_STATUS_MASK     0x1 /* Status */
#define ISCSI_DATA_IN_HDR_STATUS_SHIFT    0
#define ISCSI_DATA_IN_HDR_UNDERFLOW_MASK  0x1 /* Residual Underflow */
#define ISCSI_DATA_IN_HDR_UNDERFLOW_SHIFT 1
#define ISCSI_DATA_IN_HDR_OVERFLOW_MASK   0x1 /* Residual Overflow */
#define ISCSI_DATA_IN_HDR_OVERFLOW_SHIFT  2
#define ISCSI_DATA_IN_HDR_RSRV_MASK       0x7 /* reserved - 0 */
#define ISCSI_DATA_IN_HDR_RSRV_SHIFT      3
#define ISCSI_DATA_IN_HDR_ACK_MASK        0x1 /* Acknowledge */
#define ISCSI_DATA_IN_HDR_ACK_SHIFT       6
#define ISCSI_DATA_IN_HDR_FINAL_MASK      0x1 /* final */
#define ISCSI_DATA_IN_HDR_FINAL_SHIFT     7
	u8 opcode /* opcode */;
	__le32 reserved2 /* reserved */;
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
	__le32 ttt /* Target Transfer Tag (from R2T) */;
	__le32 stat_sn /* StatSN or reserved */;
	__le32 exp_cmd_sn /* Expected CmdSn */;
	__le32 max_cmd_sn /* MaxCmdSn */;
	__le32 data_sn /* DataSN - PDU index in sequnece */;
	__le32 buffer_offset /* Buffer Offset - offset in task */;
	__le32 residual_count /* Residual Count */;
};

/*
 * iSCSI R2T PDU header
 */
struct iscsi_r2t_hdr
{
	u8 reserved0[3] /* reserved */;
	u8 opcode /* opcode */;
	__le32 reserved2 /* reserved */;
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag */;
	__le32 ttt /* Target Transfer Tag */;
	__le32 stat_sn /* stat sn */;
	__le32 exp_cmd_sn /* Expected CmdSn */;
	__le32 max_cmd_sn /* Max CmdSn */;
	__le32 r2t_sn /* DataSN - PDU index in sequnece */;
	__le32 buffer_offset /* Buffer Offset - offset in task */;
	__le32 desired_data_trns_len /* Desired data trnsfer len */;
};

/*
 * iSCSI NOP-out PDU header
 */
struct iscsi_nop_out_hdr
{
	__le16 reserved1 /* reserved */;
	u8 flags_attr;
#define ISCSI_NOP_OUT_HDR_RSRV_MASK    0x7F /* reserved */
#define ISCSI_NOP_OUT_HDR_RSRV_SHIFT   0
#define ISCSI_NOP_OUT_HDR_CONST1_MASK  0x1 /* const1 */
#define ISCSI_NOP_OUT_HDR_CONST1_SHIFT 7
	u8 opcode /* opcode */;
	__le32 reserved2 /* reserved */;
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
	__le32 ttt /* Target Transfer Tag (from R2T) */;
	__le32 cmd_sn /* CmdSN */;
	__le32 exp_stat_sn /* Expected StatSn */;
	__le32 reserved3 /* reserved */;
	__le32 reserved4 /* reserved */;
	__le32 reserved5 /* reserved */;
	__le32 reserved6 /* reserved */;
};

/*
 * iSCSI NOP-in PDU header
 */
struct iscsi_nop_in_hdr
{
	__le16 reserved0 /* reserved */;
	u8 flags_attr;
#define ISCSI_NOP_IN_HDR_RSRV_MASK           0x7F /* reserved */
#define ISCSI_NOP_IN_HDR_RSRV_SHIFT          0
#define ISCSI_NOP_IN_HDR_CONST1_MASK         0x1 /* const1 */
#define ISCSI_NOP_IN_HDR_CONST1_SHIFT        7
	u8 opcode /* opcode */;
	__le32 hdr_second_dword;
#define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_NOP_IN_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_NOP_IN_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant) */;
	__le32 ttt /* Target Transfer Tag */;
	__le32 stat_sn /* stat_sn */;
	__le32 exp_cmd_sn /* exp_cmd_sn */;
	__le32 max_cmd_sn /* max_cmd_sn */;
	__le32 reserved5 /* reserved */;
	__le32 reserved6 /* reserved */;
	__le32 reserved7 /* reserved */;
};

/*
 * iSCSI Login Response PDU header
 */
struct iscsi_login_response_hdr
{
	u8 version_active /* Version-active */;
	u8 version_max /* Version-max */;
	u8 flags_attr;
#define ISCSI_LOGIN_RESPONSE_HDR_NSG_MASK            0x3 /* Next Stage (NSG) */
#define ISCSI_LOGIN_RESPONSE_HDR_NSG_SHIFT           0
#define ISCSI_LOGIN_RESPONSE_HDR_CSG_MASK            0x3 /* Current stage (CSG) */
#define ISCSI_LOGIN_RESPONSE_HDR_CSG_SHIFT           2
#define ISCSI_LOGIN_RESPONSE_HDR_RSRV_MASK           0x3 /* reserved */
#define ISCSI_LOGIN_RESPONSE_HDR_RSRV_SHIFT          4
#define ISCSI_LOGIN_RESPONSE_HDR_C_MASK              0x1 /* C (Continue) bit */
#define ISCSI_LOGIN_RESPONSE_HDR_C_SHIFT             6
#define ISCSI_LOGIN_RESPONSE_HDR_T_MASK              0x1 /* T (Transit) bit */
#define ISCSI_LOGIN_RESPONSE_HDR_T_SHIFT             7
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_LOGIN_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_LOGIN_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
	__le32 isid_tabc /* Session identifier high double word [constant, initialized] */;
	__le16 tsih /* TSIH */;
	__le16 isid_d /* Session identifier low word [constant, initialized] */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 reserved1;
	__le32 stat_sn /* CmdSn. [constant, initialized] */;
	__le32 exp_cmd_sn /* various fields for middle-path PDU. [constant, initialized] */;
	__le32 max_cmd_sn /* max_cmd_sn */;
	__le16 reserved2;
	u8 status_detail /* status_detail */;
	u8 status_class /* status_class */;
	__le32 reserved4[2];
};

/*
 * iSCSI Logout Response PDU header
 */
struct iscsi_logout_response_hdr
{
	u8 reserved1 /* reserved */;
	u8 response /* response */;
	u8 flags /* flags and attributes */;
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_LOGOUT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_LOGOUT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
	__le32 reserved2[2] /* Reserved */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 reserved3 /* Reserved */;
	__le32 stat_sn /* CmdSN */;
	__le32 exp_cmd_sn /* Expected StatSn */;
	__le32 max_cmd_sn /* CmdSN */;
	__le32 reserved4 /* Reserved */;
	__le16 time_2_retain /* Time to Retain  */;
	__le16 time_2_wait /* Time to wait */;
	__le32 reserved5[1] /* Reserved */;
};

/*
 * iSCSI Text Request PDU header
 */
struct iscsi_text_request_hdr
{
	__le16 reserved0 /* reserved */;
	u8 flags_attr;
#define ISCSI_TEXT_REQUEST_HDR_RSRV_MASK           0x3F /* reserved */
#define ISCSI_TEXT_REQUEST_HDR_RSRV_SHIFT          0
#define ISCSI_TEXT_REQUEST_HDR_C_MASK              0x1 /* C (Continue) bit */
#define ISCSI_TEXT_REQUEST_HDR_C_SHIFT             6
#define ISCSI_TEXT_REQUEST_HDR_F_MASK              0x1 /* F (Final) bit */
#define ISCSI_TEXT_REQUEST_HDR_F_SHIFT             7
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_TEXT_REQUEST_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_TEXT_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 ttt /* Referenced Task Tag or 0xffffffff */;
	__le32 cmd_sn /* cmd_sn */;
	__le32 exp_stat_sn /* exp_stat_sn */;
	__le32 reserved4[4] /* Reserved */;
};

/*
 * iSCSI Text Response PDU header
 */
struct iscsi_text_response_hdr
{
	__le16 reserved1 /* reserved */;
	u8 flags;
#define ISCSI_TEXT_RESPONSE_HDR_RSRV_MASK           0x3F /* reserved */
#define ISCSI_TEXT_RESPONSE_HDR_RSRV_SHIFT          0
#define ISCSI_TEXT_RESPONSE_HDR_C_MASK              0x1 /* C (Continue) bit */
#define ISCSI_TEXT_RESPONSE_HDR_C_SHIFT             6
#define ISCSI_TEXT_RESPONSE_HDR_F_MASK              0x1 /* F (Final) bit */
#define ISCSI_TEXT_RESPONSE_HDR_F_SHIFT             7
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_TEXT_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_TEXT_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 ttt /* Target Task Tag */;
	__le32 stat_sn /* CmdSN */;
	__le32 exp_cmd_sn /* Expected StatSn */;
	__le32 max_cmd_sn /* CmdSN */;
	__le32 reserved4[3] /* Reserved */;
};

/*
 * iSCSI TMF Request PDU header
 */
struct iscsi_tmf_request_hdr
{
	__le16 reserved0 /* reserved */;
	u8 function /* function */;
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_TMF_REQUEST_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_TMF_REQUEST_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 rtt /* Referenced Task Tag or 0xffffffff */;
	__le32 cmd_sn /* cmd_sn */;
	__le32 exp_stat_sn /* exp_stat_sn */;
	__le32 ref_cmd_sn /* ref_cmd_sn */;
	__le32 exp_data_sn /* exp_data_sn */;
	__le32 reserved4[2] /* Reserved */;
};

struct iscsi_tmf_response_hdr
{
	u8 reserved2 /* reserved2 */;
	u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */;
	u8 hdr_flags /* Flags field of ISCSI header */;
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_TMF_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_TMF_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair reserved0;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 reserved1 /* Reserved */;
	__le32 stat_sn /* stat_sn */;
	__le32 exp_cmd_sn /* exp_cmd_sn */;
	__le32 max_cmd_sn /* max_cmd_sn */;
	__le32 reserved4[3] /* Reserved */;
};

/*
 * iSCSI Response PDU header
 */
struct iscsi_response_hdr
{
	u8 hdr_status /* Status field of ISCSI header */;
	u8 hdr_response /* Response field of ISCSI header for Responses / Reserved for Data-In */;
	u8 hdr_flags /* Flags field of ISCSI header */;
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_RESPONSE_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_RESPONSE_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number */;
	__le32 itt /* Initiator Task Tag (only 2 bytes are significant). [constant, initialized] */;
	__le32 snack_tag /* Currently ERL>0 is not supported */;
	__le32 stat_sn /* CmdSN */;
	__le32 exp_cmd_sn /* Expected StatSn */;
	__le32 max_cmd_sn /* CmdSN */;
	__le32 exp_data_sn /* exp_data_sn */;
	__le32 bi_residual_count /* bi residual count */;
	__le32 residual_count /* residual count */;
};

/*
 * iSCSI Reject PDU header
 */
struct iscsi_reject_hdr
{
	u8 reserved4 /* Reserved */;
	u8 hdr_reason /* The reject reason */;
	u8 hdr_flags /* Flags field of ISCSI header */;
	u8 opcode /* opcode. [constant, initialized] */;
	__le32 hdr_second_dword;
#define ISCSI_REJECT_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_REJECT_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_REJECT_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair reserved0;
	__le32 all_ones;
	__le32 reserved2;
	__le32 stat_sn /* stat_sn */;
	__le32 exp_cmd_sn /* exp_cmd_sn */;
	__le32 max_cmd_sn /* max_cmd_sn */;
	__le32 data_sn /* data_sn */;
	__le32 reserved3[2] /* reserved3 */;
};

/*
 * iSCSI Asynchronous Message PDU header
 */
struct iscsi_async_msg_hdr
{
	__le16 reserved0 /* reserved */;
	u8 flags_attr;
#define ISCSI_ASYNC_MSG_HDR_RSRV_MASK           0x7F /* reserved */
#define ISCSI_ASYNC_MSG_HDR_RSRV_SHIFT          0
#define ISCSI_ASYNC_MSG_HDR_CONST1_MASK         0x1 /* const1 */
#define ISCSI_ASYNC_MSG_HDR_CONST1_SHIFT        7
	u8 opcode /* opcode */;
	__le32 hdr_second_dword;
#define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_MASK   0xFFFFFF /* DataSegmentLength */
#define ISCSI_ASYNC_MSG_HDR_DATA_SEG_LEN_SHIFT  0
#define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_MASK  0xFF /* TotalAHSLength */
#define ISCSI_ASYNC_MSG_HDR_TOTAL_AHS_LEN_SHIFT 24
	struct regpair lun /* Logical Unit Number */;
	__le32 all_ones /* should be 0xffffffff */;
	__le32 reserved1 /* reserved */;
	__le32 stat_sn /* stat_sn */;
	__le32 exp_cmd_sn /* exp_cmd_sn */;
	__le32 max_cmd_sn /* max_cmd_sn */;
	__le16 param1_rsrv /* Parameter1 or Reserved */;
	u8 async_vcode /* AsuncVCode */;
	u8 async_event /* AsyncEvent */;
	__le16 param3_rsrv /* Parameter3 or Reserved */;
	__le16 param2_rsrv /* Parameter2 or Reserved */;
	__le32 reserved7 /* reserved */;
};

/*
 * PDU header part of Ystorm task context
 */
union iscsi_task_hdr
{
	struct iscsi_common_hdr common /* Command PDU header */;
	struct data_hdr data /* Command PDU header */;
	struct iscsi_cmd_hdr cmd /* Command PDU header */;
	struct iscsi_ext_cdb_cmd_hdr ext_cdb_cmd /* Command PDU header with extended CDB - Initiator Mode */;
	struct iscsi_login_req_hdr login_req /* Login request PDU header */;
	struct iscsi_logout_req_hdr logout_req /* Logout request PDU header */;
	struct iscsi_data_out_hdr data_out /* Data-out PDU header */;
	struct iscsi_data_in_hdr data_in /* Data-in PDU header */;
	struct iscsi_r2t_hdr r2t /* R2T PDU header */;
	struct iscsi_nop_out_hdr nop_out /* NOP-out PDU header */;
	struct iscsi_nop_in_hdr nop_in /* NOP-in PDU header */;
	struct iscsi_login_response_hdr login_response /* Login response PDU header */;
	struct iscsi_logout_response_hdr logout_response /* Logout response PDU header */;
	struct iscsi_text_request_hdr text_request /* Text request PDU header */;
	struct iscsi_text_response_hdr text_response /* Text response PDU header */;
	struct iscsi_tmf_request_hdr tmf_request /* TMF request PDU header */;
	struct iscsi_tmf_response_hdr tmf_response /* TMF response PDU header */;
	struct iscsi_response_hdr response /* Text response PDU header */;
	struct iscsi_reject_hdr reject /* Reject PDU header */;
	struct iscsi_async_msg_hdr async_msg /* Asynchronous Message PDU header */;
};

/*
 * The iscsi storm task context of Ystorm
 */
struct ystorm_iscsi_task_st_ctx
{
	struct ystorm_iscsi_task_state state /* iSCSI task parameters and state */;
	struct ystorm_iscsi_task_rxmit_opt rxmit_opt /* iSCSI retransmit optimizations parameters */;
	union iscsi_task_hdr pdu_hdr /* PDU header - [constant initialized] */;
};

struct e4_ystorm_iscsi_task_ag_ctx
{
	u8 reserved /* cdu_validation */;
	u8 byte1 /* state */;
	__le16 word0 /* icid */;
	u8 flags0;
#define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK     0xF /* connection_type */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT    0
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK        0x1 /* exist_in_qm0 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT       4
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK        0x1 /* exist_in_qm1 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT       5
#define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK       0x1 /* bit2 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT      6
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK        0x1 /* bit3 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT       7
	u8 flags1;
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK         0x3 /* cf0 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT        0
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK         0x3 /* cf1 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT        2
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK  0x3 /* cf2special */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT 4
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK       0x1 /* cf0en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT      6
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK       0x1 /* cf1en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT      7
	u8 flags2;
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK        0x1 /* bit4 */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT       0
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK     0x1 /* rule0en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT    1
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK     0x1 /* rule1en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT    2
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK     0x1 /* rule2en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT    3
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK     0x1 /* rule3en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT    4
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK     0x1 /* rule4en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT    5
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK     0x1 /* rule5en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT    6
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK     0x1 /* rule6en */
#define E4_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT    7
	u8 byte2 /* byte2 */;
	__le32 TTT /* reg0 */;
	u8 byte3 /* byte3 */;
	u8 byte4 /* byte4 */;
	__le16 word1 /* word1 */;
};

struct e4_mstorm_iscsi_task_ag_ctx
{
	u8 cdu_validation /* cdu_validation */;
	u8 byte1 /* state */;
	__le16 task_cid /* icid */;
	u8 flags0;
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK     0xF /* connection_type */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT    0
#define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK        0x1 /* exist_in_qm0 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT       4
#define E4_MSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK                0x1 /* exist_in_qm1 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT               5
#define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK               0x1 /* bit2 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT              6
#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK   0x1 /* bit3 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT  7
	u8 flags1;
#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK     0x3 /* cf0 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT    0
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK                 0x3 /* cf1 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT                2
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK                 0x3 /* cf2 */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT                4
#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK  0x1 /* cf0en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK               0x1 /* cf1en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT              7
	u8 flags2;
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK               0x1 /* cf2en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT              0
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK             0x1 /* rule0en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT            1
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK             0x1 /* rule1en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT            2
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK             0x1 /* rule2en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT            3
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK             0x1 /* rule3en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT            4
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK             0x1 /* rule4en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT            5
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK             0x1 /* rule5en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT            6
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK             0x1 /* rule6en */
#define E4_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT            7
	u8 byte2 /* byte2 */;
	__le32 reg0 /* reg0 */;
	u8 byte3 /* byte3 */;
	u8 byte4 /* byte4 */;
	__le16 word1 /* word1 */;
};

struct e4_ustorm_iscsi_task_ag_ctx
{
	u8 reserved /* cdu_validation */;
	u8 state /* state */;
	__le16 icid /* icid */;
	u8 flags0;
#define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK        0xF /* connection_type */
#define E4_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT       0
#define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK           0x1 /* exist_in_qm0 */
#define E4_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT          4
#define E4_USTORM_ISCSI_TASK_AG_CTX_BIT1_MASK                   0x1 /* exist_in_qm1 */
#define E4_USTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT                  5
#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK          0x3 /* timer0cf */
#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT         6
	u8 flags1;
#define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK              0x3 /* timer1cf */
#define E4_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT             0
#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK               0x3 /* timer2cf */
#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT              2
#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_MASK                    0x3 /* timer_stop_all */
#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT                   4
#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK           0x3 /* cf4 */
#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT          6
	u8 flags2;
#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK       0x1 /* cf0en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT      0
#define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK     0x1 /* cf1en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT    1
#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK            0x1 /* cf2en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT           2
#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK                  0x1 /* cf3en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT                 3
#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK        0x1 /* cf4en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT       4
#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK  0x1 /* rule0en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK                0x1 /* rule1en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT               6
#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK    0x1 /* rule2en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT   7
	u8 flags3;
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK                0x1 /* rule3en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT               0
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK                0x1 /* rule4en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT               1
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK                0x1 /* rule5en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT               2
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK                0x1 /* rule6en */
#define E4_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT               3
#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK         0xF /* nibble1 */
#define E4_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT        4
	__le32 dif_err_intervals /* reg0 */;
	__le32 dif_error_1st_interval /* reg1 */;
	__le32 rcv_cont_len /* reg2 */;
	__le32 exp_cont_len /* reg3 */;
	__le32 total_data_acked /* reg4 */;
	__le32 exp_data_acked /* reg5 */;
	u8 next_tid_valid /* byte2 */;
	u8 byte3 /* byte3 */;
	__le16 word1 /* word1 */;
	__le16 next_tid /* word2 */;
	__le16 word3 /* word3 */;
	__le32 hdr_residual_count /* reg6 */;
	__le32 exp_r2t_sn /* reg7 */;
};

/*
 * The iscsi storm task context of Mstorm
 */
struct mstorm_iscsi_task_st_ctx
{
	struct scsi_cached_sges data_desc /* Union of Data SGL / cached sge */;
	struct scsi_sgl_params sgl_params;
	__le32 rem_task_size /* Remaining task size, used for placement verification */;
	__le32 data_buffer_offset /* Buffer offset */;
	u8 task_type /* Task type, (use: iscsi_task_type enum) */;
	struct iscsi_dif_flags dif_flags /* sizes of host/peer protection intervals + protection log interval */;
	__le16 dif_task_icid /* save tasks CID for validation - dif on immediate flow */;
	struct regpair sense_db /* Pointer to sense data buffer */;
	__le32 expected_itt /* ITT - for target mode validations */;
	__le32 reserved1 /* reserved1 */;
};

struct iscsi_reg1
{
	__le32 reg1_map;
#define ISCSI_REG1_NUM_SGES_MASK   0xF /* Written to R2tQE */
#define ISCSI_REG1_NUM_SGES_SHIFT  0
#define ISCSI_REG1_RESERVED1_MASK  0xFFFFFFF /* reserved */
#define ISCSI_REG1_RESERVED1_SHIFT 4
};

struct tqe_opaque
{
	__le16 opaque[2] /* TQe opaque */;
};

/*
 * The iscsi storm task context of Ustorm
 */
struct ustorm_iscsi_task_st_ctx
{
	__le32 rem_rcv_len /* Remaining data to be received in bytes. Used in validations */;
	__le32 exp_data_transfer_len /* iSCSI Initiator - The size of the transmitted task, iSCSI Target - the size of the Rx continuation */;
	__le32 exp_data_sn /* Expected data SN */;
	struct regpair lun /* LUN */;
	struct iscsi_reg1 reg1;
	u8 flags2;
#define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_MASK              0x1 /* Initiator Mode - Mark AHS exist */
#define USTORM_ISCSI_TASK_ST_CTX_AHS_EXIST_SHIFT             0
#define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_MASK              0x7F
#define USTORM_ISCSI_TASK_ST_CTX_RESERVED1_SHIFT             1
	struct iscsi_dif_flags dif_flags /* Dif flags (written to R2T WQE) */;
	__le16 reserved3;
	struct tqe_opaque tqe_opaque_list;
	__le32 reserved5;
	__le32 reserved6;
	__le32 reserved7;
	u8 task_type /* Task Type */;
	u8 error_flags;
#define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_MASK      0x1 /* Mark task with data digest error (1 bit) */
#define USTORM_ISCSI_TASK_ST_CTX_DATA_DIGEST_ERROR_SHIFT     0
#define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_MASK   0x1 /* Target Mode - Mark middle task error, data truncated */
#define USTORM_ISCSI_TASK_ST_CTX_DATA_TRUNCATED_ERROR_SHIFT  1
#define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_MASK        0x1
#define USTORM_ISCSI_TASK_ST_CTX_UNDER_RUN_ERROR_SHIFT       2
#define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_MASK              0x1F
#define USTORM_ISCSI_TASK_ST_CTX_RESERVED8_SHIFT             3
	u8 flags;
#define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_MASK              0x3 /* mark task cqe write (for cleanup flow) */
#define USTORM_ISCSI_TASK_ST_CTX_CQE_WRITE_SHIFT             0
#define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_MASK             0x1 /* local completion bit */
#define USTORM_ISCSI_TASK_ST_CTX_LOCAL_COMP_SHIFT            2
#define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_MASK         0x1 /* write R2TQE from Q0 flow */
#define USTORM_ISCSI_TASK_ST_CTX_Q0_R2TQE_WRITE_SHIFT        3
#define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_MASK  0x1 /* Mark total data acked or disabled */
#define USTORM_ISCSI_TASK_ST_CTX_TOTAL_DATA_ACKED_DONE_SHIFT 4
#define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_MASK        0x1 /* Mark HQ scanned or disabled */
#define USTORM_ISCSI_TASK_ST_CTX_HQ_SCANNED_DONE_SHIFT       5
#define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_MASK          0x1 /* Mark HQ scanned or disabled */
#define USTORM_ISCSI_TASK_ST_CTX_R2T2RECV_DONE_SHIFT         6
#define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_MASK              0x1
#define USTORM_ISCSI_TASK_ST_CTX_RESERVED0_SHIFT             7
	u8 cq_rss_number /* Task CQ_RSS number 0.63 */;
};

/*
 * iscsi task context
 */
struct e4_iscsi_task_context
{
	struct ystorm_iscsi_task_st_ctx ystorm_st_context /* ystorm storm context */;
	struct e4_ystorm_iscsi_task_ag_ctx ystorm_ag_context /* ystorm aggregative context */;
	struct regpair ystorm_ag_padding[2] /* padding */;
	struct tdif_task_context tdif_context /* tdif context */;
	struct e4_mstorm_iscsi_task_ag_ctx mstorm_ag_context /* mstorm aggregative context */;
	struct regpair mstorm_ag_padding[2] /* padding */;
	struct e4_ustorm_iscsi_task_ag_ctx ustorm_ag_context /* ustorm aggregative context */;
	struct mstorm_iscsi_task_st_ctx mstorm_st_context /* mstorm storm context */;
	struct ustorm_iscsi_task_st_ctx ustorm_st_context /* ustorm storm context */;
	struct rdif_task_context rdif_context /* rdif context */;
};


struct e5_ystorm_iscsi_task_ag_ctx
{
	u8 reserved /* cdu_validation */;
	u8 byte1 /* state_and_core_id */;
	__le16 word0 /* icid */;
	u8 flags0;
#define E5_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK       0xF /* connection_type */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT      0
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK          0x1 /* exist_in_qm0 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT         4
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK          0x1 /* exist_in_qm1 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT         5
#define E5_YSTORM_ISCSI_TASK_AG_CTX_VALID_MASK         0x1 /* bit2 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT        6
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK          0x1 /* bit3 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT         7
	u8 flags1;
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0_MASK           0x3 /* cf0 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT          0
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1_MASK           0x3 /* cf1 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT          2
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_MASK    0x3 /* cf2special */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF2SPECIAL_SHIFT   4
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK         0x1 /* cf0en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT        6
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK         0x1 /* cf1en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT        7
	u8 flags2;
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK          0x1 /* bit4 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT         0
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK       0x1 /* rule0en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT      1
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK       0x1 /* rule1en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT      2
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK       0x1 /* rule2en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT      3
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK       0x1 /* rule3en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT      4
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK       0x1 /* rule4en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT      5
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK       0x1 /* rule5en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT      6
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK       0x1 /* rule6en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT      7
	u8 flags3;
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_MASK  0x1 /* bit5 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_SHIFT 0
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_MASK  0x3 /* cf3 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_SHIFT 1
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_MASK  0x3 /* cf4 */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_SHIFT 3
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_MASK  0x1 /* cf3en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_SHIFT 5
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_MASK  0x1 /* cf4en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_SHIFT 6
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_MASK  0x1 /* rule7en */
#define E5_YSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_SHIFT 7
	__le32 TTT /* reg0 */;
	u8 byte2 /* byte2 */;
	u8 byte3 /* byte3 */;
	u8 byte4 /* byte4 */;
	u8 e4_reserved7 /* byte5 */;
};

struct e5_mstorm_iscsi_task_ag_ctx
{
	u8 cdu_validation /* cdu_validation */;
	u8 byte1 /* state_and_core_id */;
	__le16 task_cid /* icid */;
	u8 flags0;
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK     0xF /* connection_type */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT    0
#define E5_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK        0x1 /* exist_in_qm0 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT       4
#define E5_MSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK                0x1 /* exist_in_qm1 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT               5
#define E5_MSTORM_ISCSI_TASK_AG_CTX_VALID_MASK               0x1 /* bit2 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_VALID_SHIFT              6
#define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_MASK   0x1 /* bit3 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_FLAG_SHIFT  7
	u8 flags1;
#define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_MASK     0x3 /* cf0 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_SHIFT    0
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1_MASK                 0x3 /* cf1 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT                2
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2_MASK                 0x3 /* cf2 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT                4
#define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_MASK  0x1 /* cf0en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_TASK_CLEANUP_CF_EN_SHIFT 6
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK               0x1 /* cf1en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT              7
	u8 flags2;
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK               0x1 /* cf2en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT              0
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK             0x1 /* rule0en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT            1
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK             0x1 /* rule1en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT            2
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK             0x1 /* rule2en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT            3
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK             0x1 /* rule3en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT            4
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK             0x1 /* rule4en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT            5
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK             0x1 /* rule5en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT            6
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK             0x1 /* rule6en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT            7
	u8 flags3;
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_MASK        0x1 /* bit4 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_SHIFT       0
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_MASK        0x3 /* cf3 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_SHIFT       1
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_MASK        0x3 /* cf4 */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_SHIFT       3
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_MASK        0x1 /* cf3en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_SHIFT       5
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_MASK        0x1 /* cf4en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_SHIFT       6
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_MASK        0x1 /* rule7en */
#define E5_MSTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_SHIFT       7
	__le32 reg0 /* reg0 */;
	u8 byte2 /* byte2 */;
	u8 byte3 /* byte3 */;
	u8 byte4 /* byte4 */;
	u8 e4_reserved7 /* byte5 */;
};

struct e5_ustorm_iscsi_task_ag_ctx
{
	u8 reserved /* cdu_validation */;
	u8 state_and_core_id /* state_and_core_id */;
	__le16 icid /* icid */;
	u8 flags0;
#define E5_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_MASK        0xF /* connection_type */
#define E5_USTORM_ISCSI_TASK_AG_CTX_CONNECTION_TYPE_SHIFT       0
#define E5_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_MASK           0x1 /* exist_in_qm0 */
#define E5_USTORM_ISCSI_TASK_AG_CTX_EXIST_IN_QM0_SHIFT          4
#define E5_USTORM_ISCSI_TASK_AG_CTX_BIT1_MASK                   0x1 /* exist_in_qm1 */
#define E5_USTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT                  5
#define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_MASK          0x3 /* timer0cf */
#define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_SHIFT         6
	u8 flags1;
#define E5_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_MASK              0x3 /* timer1cf */
#define E5_USTORM_ISCSI_TASK_AG_CTX_RESERVED1_SHIFT             0
#define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_MASK               0x3 /* timer2cf */
#define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_SHIFT              2
#define E5_USTORM_ISCSI_TASK_AG_CTX_CF3_MASK                    0x3 /* timer_stop_all */
#define E5_USTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT                   4
#define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_MASK           0x3 /* dif_error_cf */
#define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_SHIFT          6
	u8 flags2;
#define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_MASK       0x1 /* cf0en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_HQ_SCANNED_CF_EN_SHIFT      0
#define E5_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_MASK     0x1 /* cf1en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_DISABLE_DATA_ACKED_SHIFT    1
#define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_MASK            0x1 /* cf2en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_R2T2RECV_EN_SHIFT           2
#define E5_USTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK                  0x1 /* cf3en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT                 3
#define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK        0x1 /* cf4en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT       4
#define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_MASK  0x1 /* rule0en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_DATA_TOTAL_EXP_EN_SHIFT 5
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK                0x1 /* rule1en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT               6
#define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_MASK    0x1 /* rule2en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_CMP_CONT_RCV_EXP_EN_SHIFT   7
	u8 flags3;
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK                0x1 /* rule3en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT               0
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK                0x1 /* rule4en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT               1
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK                0x1 /* rule5en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT               2
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_MASK                0x1 /* rule6en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_RULE6EN_SHIFT               3
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_MASK           0x1 /* bit2 */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED1_SHIFT          4
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_MASK           0x1 /* bit3 */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED2_SHIFT          5
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_MASK           0x1 /* bit4 */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED3_SHIFT          6
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_MASK           0x1 /* rule7en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED4_SHIFT          7
	u8 flags4;
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_MASK           0x3 /* cf5 */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED5_SHIFT          0
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_MASK           0x1 /* cf5en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED6_SHIFT          2
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED7_MASK           0x1 /* rule8en */
#define E5_USTORM_ISCSI_TASK_AG_CTX_E4_RESERVED7_SHIFT          3
#define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_MASK         0xF /* dif_error_type */
#define E5_USTORM_ISCSI_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT        4
	u8 next_tid_valid /* byte2 */;
	u8 byte3 /* byte3 */;
	u8 e4_reserved8 /* byte4 */;
	__le32 dif_err_intervals /* dif_err_intervals */;
	__le32 dif_error_1st_interval /* dif_error_1st_interval */;
	__le32 rcv_cont_len /* reg2 */;
	__le32 exp_cont_len /* reg3 */;
	__le32 total_data_acked /* reg4 */;
	__le32 exp_data_acked /* reg5 */;
	__le16 word1 /* word1 */;
	__le16 next_tid /* word2 */;
	__le32 hdr_residual_count /* reg6 */;
	__le32 exp_r2t_sn /* reg7 */;
};

/*
 * iscsi task context
 */
struct e5_iscsi_task_context
{
	struct ystorm_iscsi_task_st_ctx ystorm_st_context /* ystorm storm context */;
	struct e5_ystorm_iscsi_task_ag_ctx ystorm_ag_context /* ystorm aggregative context */;
	struct regpair ystorm_ag_padding[2] /* padding */;
	struct tdif_task_context tdif_context /* tdif context */;
	struct e5_mstorm_iscsi_task_ag_ctx mstorm_ag_context /* mstorm aggregative context */;
	struct regpair mstorm_ag_padding[2] /* padding */;
	struct e5_ustorm_iscsi_task_ag_ctx ustorm_ag_context /* ustorm aggregative context */;
	struct mstorm_iscsi_task_st_ctx mstorm_st_context /* mstorm storm context */;
	struct ustorm_iscsi_task_st_ctx ustorm_st_context /* ustorm storm context */;
	struct rdif_task_context rdif_context /* rdif context */;
};





/*
 * ISCSI connection offload params passed by driver to FW in ISCSI offload ramrod 
 */
struct iscsi_conn_offload_params
{
	struct regpair sq_pbl_addr /* PBL SQ pointer */;
	struct regpair r2tq_pbl_addr /* PBL R2TQ pointer */;
	struct regpair xhq_pbl_addr /* PBL XHQ pointer */;
	struct regpair uhq_pbl_addr /* PBL UHQ pointer */;
	__le32 initial_ack /* Initial ack, received from TCP */;
	__le16 physical_q0 /* Physical QM queue to be tied to logical Q0 */;
	__le16 physical_q1 /* Physical QM queue to be tied to logical Q1 */;
	u8 flags;
#define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_MASK   0x1 /* TCP connect/terminate option. 0 - TCP on host (option-1); 1 - TCP on chip (option-2). */
#define ISCSI_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B_SHIFT  0
#define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_MASK      0x1 /* iSCSI connect mode: 0-iSCSI Initiator, 1-iSCSI Target */
#define ISCSI_CONN_OFFLOAD_PARAMS_TARGET_MODE_SHIFT     1
#define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_MASK  0x1 /* Restricted mode: 0 - un-restricted (deviating from the RFC), 1 - restricted (according to the RFC) */
#define ISCSI_CONN_OFFLOAD_PARAMS_RESTRICTED_MODE_SHIFT 2
#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_MASK        0x1F /* reserved */
#define ISCSI_CONN_OFFLOAD_PARAMS_RESERVED1_SHIFT       3
	u8 pbl_page_size_log /* Page size with PBEs log; Page Size = 2^(page_size_log+12) */;
	u8 pbe_page_size_log /* PBE page size with log; Page Size = 2^(page_size_log+12) */;
	u8 default_cq /* Default CQ used to write unsolicited data */;
	__le32 stat_sn /* StatSn for Target Mode only: the first Login Response StatSn value for Target mode */;
};


/*
 * spe message header 
 */
struct iscsi_slow_path_hdr
{
	u8 op_code /* iscsi bus-drv message opcode */;
	u8 flags;
#define ISCSI_SLOW_PATH_HDR_RESERVED0_MASK   0xF
#define ISCSI_SLOW_PATH_HDR_RESERVED0_SHIFT  0
#define ISCSI_SLOW_PATH_HDR_LAYER_CODE_MASK  0x7 /* protocol layer (L2,L3,L4,L5) */
#define ISCSI_SLOW_PATH_HDR_LAYER_CODE_SHIFT 4
#define ISCSI_SLOW_PATH_HDR_RESERVED1_MASK   0x1
#define ISCSI_SLOW_PATH_HDR_RESERVED1_SHIFT  7
};

/*
 * ISCSI connection update params passed by driver to FW in ISCSI update ramrod 
 */
struct iscsi_conn_update_ramrod_params
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 conn_id /* ISCSI Connection ID. (MOTI_COHEN : draft for DrvSim sake) */;
	__le32 fw_cid /* Context ID (cid) of the connection. (MOTI_COHEN : draft for DrvSim sake) */;
	u8 flags;
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_MASK           0x1 /* Is header digest enabled */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_HD_EN_SHIFT          0
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_MASK           0x1 /* Is data digest enabled */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DD_EN_SHIFT          1
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_MASK     0x1 /* Initial R2T */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_INITIAL_R2T_SHIFT    2
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_MASK  0x1 /* Immediate data */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_IMMEDIATE_DATA_SHIFT 3
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_MASK  0x1 /* 0 - 512B, 1 - 4K */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_BLOCK_SIZE_SHIFT 4
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_MASK  0x1 /* 0 - no DIF, 1 - could be enabled per task */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_HOST_EN_SHIFT 5
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_MASK   0x1 /* Support DIF on immediate, 1-Yes, 0-No */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_DIF_ON_IMM_EN_SHIFT  6
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_MASK   0x1 /* valid only if dif_on_imm_en=1 Does this connection has dif configuration per Lun or Default dif configuration */
#define ISCSI_CONN_UPDATE_RAMROD_PARAMS_LUN_MAPPER_EN_SHIFT  7
	u8 reserved0[3];
	__le32 max_seq_size /* Maximum sequence size. Valid for TX and RX */;
	__le32 max_send_pdu_length /* Maximum PDU size. Valid for the TX */;
	__le32 max_recv_pdu_length /* Maximum PDU size. Valid for the RX */;
	__le32 first_seq_length /* Initial sequence length */;
	__le32 exp_stat_sn /* ExpStatSn - Option1 Only */;
	union dif_configuration_params dif_on_imme_params /* dif on immmediate params - Target mode Only */;
};


/*
 * iSCSI CQ element
 */
struct iscsi_cqe_common
{
	__le16 conn_id /* Drivers connection Id */;
	u8 cqe_type /* Indicates CQE type */;
	union cqe_error_status error_bitmap /* CQE error status */;
	__le32 reserved[3];
	union iscsi_task_hdr iscsi_hdr /* iscsi header union */;
};

/*
 * iSCSI CQ element
 */
struct iscsi_cqe_solicited
{
	__le16 conn_id /* Drivers connection Id */;
	u8 cqe_type /* Indicates CQE type */;
	union cqe_error_status error_bitmap /* CQE error status */;
	__le16 itid /* initiator itt (Initiator mode) or target ttt (Target mode) */;
	u8 task_type /* Task type */;
	u8 fw_dbg_field /* FW debug params */;
	u8 caused_conn_err /* Equals 1 if this TID caused the connection error, otherwise equals 0. */;
	u8 reserved0[3];
	__le32 reserved1[1];
	union iscsi_task_hdr iscsi_hdr /* iscsi header union */;
};

/*
 * iSCSI CQ element
 */
struct iscsi_cqe_unsolicited
{
	__le16 conn_id /* Drivers connection Id */;
	u8 cqe_type /* Indicates CQE type */;
	union cqe_error_status error_bitmap /* CQE error status */;
	__le16 reserved0 /* Reserved */;
	u8 reserved1 /* Reserved */;
	u8 unsol_cqe_type /* Represent this unsolicited CQE position in a sequence of packets belonging to the same unsolicited PDU */;
	__le16 rqe_opaque /* Relevant for Unsolicited CQE only: The opaque data of RQ BDQ */;
	__le16 reserved2[3] /* Reserved */;
	union iscsi_task_hdr iscsi_hdr /* iscsi header union */;
};

/*
 * iSCSI CQ element
 */
union iscsi_cqe
{
	struct iscsi_cqe_common cqe_common /* Common CQE */;
	struct iscsi_cqe_solicited cqe_solicited /* Solicited CQE */;
	struct iscsi_cqe_unsolicited cqe_unsolicited /* Unsolicited CQE. relevant only when cqe_opcode == ISCSI_CQE_TYPE_UNSOLICITED */;
};


/*
 * iSCSI CQE type 
 */
enum iscsi_cqes_type
{
	ISCSI_CQE_TYPE_SOLICITED=1 /* iSCSI CQE with solicited data */,
	ISCSI_CQE_TYPE_UNSOLICITED /* iSCSI CQE with unsolicited data */,
	ISCSI_CQE_TYPE_SOLICITED_WITH_SENSE /* iSCSI CQE with solicited with sense data */,
	ISCSI_CQE_TYPE_TASK_CLEANUP /* iSCSI CQE task cleanup */,
	ISCSI_CQE_TYPE_DUMMY /* iSCSI Dummy CQE */,
	MAX_ISCSI_CQES_TYPE
};





/*
 * iSCSI CQE type 
 */
enum iscsi_cqe_unsolicited_type
{
	ISCSI_CQE_UNSOLICITED_NONE /* iSCSI CQE with unsolicited data */,
	ISCSI_CQE_UNSOLICITED_SINGLE /* iSCSI CQE with unsolicited data */,
	ISCSI_CQE_UNSOLICITED_FIRST /* iSCSI CQE with unsolicited data */,
	ISCSI_CQE_UNSOLICITED_MIDDLE /* iSCSI CQE with unsolicited data */,
	ISCSI_CQE_UNSOLICITED_LAST /* iSCSI CQE with unsolicited data */,
	MAX_ISCSI_CQE_UNSOLICITED_TYPE
};




/*
 * iscsi debug modes
 */
struct iscsi_debug_modes
{
	u8 flags;
#define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_MASK         0x1 /* Assert on Rx connection error */
#define ISCSI_DEBUG_MODES_ASSERT_IF_RX_CONN_ERROR_SHIFT        0
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_MASK            0x1 /* Assert if TCP RESET arrived */
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_RESET_SHIFT           1
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_MASK              0x1 /* Assert if TCP FIN arrived */
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_FIN_SHIFT             2
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_MASK          0x1 /* Assert if cleanup flow */
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_CLEANUP_SHIFT         3
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_MASK  0x1 /* Assert if REJECT PDU or ASYNC PDU arrived */
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_REJECT_OR_ASYNC_SHIFT 4
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_MASK              0x1 /* Assert if NOP IN PDU or NOP OUT PDU arrived */
#define ISCSI_DEBUG_MODES_ASSERT_IF_RECV_NOP_SHIFT             5
#define ISCSI_DEBUG_MODES_ASSERT_IF_DATA_DIGEST_ERROR_MASK     0x1 /* Assert if data digest error */
#define ISCSI_DEBUG_MODES_ASSERT_IF_DATA_DIGEST_ERROR_SHIFT    6
#define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_ERROR_MASK             0x1 /* Assert if DIF error */
#define ISCSI_DEBUG_MODES_ASSERT_IF_DIF_ERROR_SHIFT            7
};



/*
 * iSCSI kernel completion queue IDs 
 */
enum iscsi_eqe_opcode
{
	ISCSI_EVENT_TYPE_INIT_FUNC=0 /* iSCSI response after init Ramrod */,
	ISCSI_EVENT_TYPE_DESTROY_FUNC /* iSCSI response after destroy Ramrod */,
	ISCSI_EVENT_TYPE_OFFLOAD_CONN /* iSCSI response after option 2 offload Ramrod */,
	ISCSI_EVENT_TYPE_UPDATE_CONN /* iSCSI response after update Ramrod */,
	ISCSI_EVENT_TYPE_CLEAR_SQ /* iSCSI response after clear sq Ramrod */,
	ISCSI_EVENT_TYPE_TERMINATE_CONN /* iSCSI response after termination Ramrod */,
	ISCSI_EVENT_TYPE_MAC_UPDATE_CONN /* iSCSI response after MAC address update Ramrod */,
	ISCSI_EVENT_TYPE_ASYN_CONNECT_COMPLETE /* iSCSI response after option 2 connect completed (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_TERMINATE_DONE /* iSCSI response after option 2 termination completed (A-syn EQE) */,
	RESERVED9 /* reserved9 */,
	ISCSI_EVENT_TYPE_START_OF_ERROR_TYPES=10 /* Never returned in EQE, used to separate Regular event types from Error event types */,
	ISCSI_EVENT_TYPE_ASYN_ABORT_RCVD /* iSCSI abort response after TCP RST packet recieve (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_CLOSE_RCVD /* iSCSI response after close receive (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_SYN_RCVD /* iSCSI response after TCP SYN+ACK packet receive (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_MAX_RT_TIME /* iSCSI error - tcp max retransmit time (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_MAX_RT_CNT /* iSCSI error - tcp max retransmit count (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_MAX_KA_PROBES_CNT /* iSCSI error - tcp ka probes count (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ASYN_FIN_WAIT2 /* iSCSI error - tcp fin wait 2 (A-syn EQE) */,
	ISCSI_EVENT_TYPE_ISCSI_CONN_ERROR /* iSCSI error response (A-syn EQE) */,
	ISCSI_EVENT_TYPE_TCP_CONN_ERROR /* iSCSI error - tcp error (A-syn EQE) */,
	MAX_ISCSI_EQE_OPCODE
};


/*
 * iSCSI EQE and CQE completion status 
 */
enum iscsi_error_types
{
	ISCSI_STATUS_NONE=0,
	ISCSI_CQE_ERROR_UNSOLICITED_RCV_ON_INVALID_CONN=1,
	ISCSI_CONN_ERROR_TASK_CID_MISMATCH /* iSCSI connection error - Corrupted Task context  */,
	ISCSI_CONN_ERROR_TASK_NOT_VALID /* iSCSI connection error - The task is not valid  */,
	ISCSI_CONN_ERROR_RQ_RING_IS_FULL /* iSCSI connection error - RQ full  */,
	ISCSI_CONN_ERROR_CMDQ_RING_IS_FULL /* iSCSI connection error - CMDQ full (Target only)  */,
	ISCSI_CONN_ERROR_HQE_CACHING_FAILED /* iSCSI connection error - HQ error  */,
	ISCSI_CONN_ERROR_HEADER_DIGEST_ERROR /* iSCSI connection error - Header digest error */,
	ISCSI_CONN_ERROR_LOCAL_COMPLETION_ERROR /* iSCSI connection error - Local completion bit is not correct   (A-syn EQE) */,
	ISCSI_CONN_ERROR_DATA_OVERRUN /* iSCSI connection error - data overrun */,
	ISCSI_CONN_ERROR_OUT_OF_SGES_ERROR /* iSCSI connection error - out of sges in task context */,
	ISCSI_CONN_ERROR_IP_OPTIONS_ERROR /* TCP connection error - IP option error  */,
	ISCSI_CONN_ERROR_PRS_ERRORS /* TCP connection error - error indication form parser */,
	ISCSI_CONN_ERROR_CONNECT_INVALID_TCP_OPTION /* TCP connection error - tcp options error(option 2 only)  */,
	ISCSI_CONN_ERROR_TCP_IP_FRAGMENT_ERROR /* TCP connection error - IP fragmentation error  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_LEN /* iSCSI connection error - invalid AHS length (Target only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_AHS_TYPE /* iSCSI connection error - invalid AHS type (Target only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_ITT_OUT_OF_RANGE /* iSCSI connection error - invalid ITT  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_TTT_OUT_OF_RANGE /* iSCSI connection error - invalid TTT (Target only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_EXCEEDS_PDU_SIZE /* iSCSI connection error - PDU data_seg_len > max receive pdu size */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE /* iSCSI connection error - invalid PDU opcode */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_OPCODE_BEFORE_UPDATE /* iSCSI connection error - invalid PDU opcode before update ramrod (Option 2 only)  */,
	ISCSI_CONN_ERROR_UNVALID_NOPIN_DSL /* iSCSI connection error - NOPIN dsl > 0 and ITT = 0xffffffff (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_CARRIES_NO_DATA /* iSCSI connection error - R2T dsl > 0 (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SN /* iSCSI connection error - DATA-SN error  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_IN_TTT /* iSCSI connection error - DATA-IN TTT error (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_OUT_ITT /* iSCSI connection error - DATA-OUT ITT error (Target only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_TTT /* iSCSI connection error - R2T TTT error (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_BUFFER_OFFSET /* iSCSI connection error - R2T buffer offset error (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_BUFFER_OFFSET_OOO /* iSCSI connection error - DATA PDU buffer offset error  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_R2T_SN /* iSCSI connection error - R2T SN error (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0 /* iSCSI connection error - R2T desired data transfer length = 0 (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1 /* iSCSI connection error - R2T desired data transfer length less then max burst size (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_2 /* iSCSI connection error - R2T desired data transfer length + buffer offset > task size (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_LUN /* iSCSI connection error - R2T unvalid LUN (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO /* iSCSI connection error - All data has been already received, however it is not the end of sequence (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_F_BIT_ZERO_S_BIT_ONE /* iSCSI connection error - S-bit and final bit = 1 (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_EXP_STAT_SN /* iSCSI connection error - STAT SN error (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DSL_NOT_ZERO /* iSCSI connection error - TMF or LOGOUT PDUs dsl > 0 (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_INVALID_DSL /* iSCSI connection error - CMD PDU dsl>0 while immediate data is disabled (Target only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DATA_SEG_LEN_TOO_BIG /* iSCSI connection error - Data In overrun (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_OUTSTANDING_R2T_COUNT /* iSCSI connection error - >1 outstanding R2T (Initiator only)  */,
	ISCSI_CONN_ERROR_PROTOCOL_ERR_DIF_TX /* iSCSI connection error - DIF Tx error + DIF error drop is enabled (Target only)  */,
	ISCSI_CONN_ERROR_SENSE_DATA_LENGTH /* iSCSI connection error - Sense data length > 256 (Initiator only)  */,
	ISCSI_CONN_ERROR_DATA_PLACEMENT_ERROR /* iSCSI connection error - Data placement error  */,
	ISCSI_CONN_ERROR_INVALID_ITT /* iSCSI connection error - Invalid ITT (Target Only) */,
	ISCSI_ERROR_UNKNOWN /* iSCSI connection error  */,
	MAX_ISCSI_ERROR_TYPES
};










/*
 * iSCSI Ramrod Command IDs 
 */
enum iscsi_ramrod_cmd_id
{
	ISCSI_RAMROD_CMD_ID_UNUSED=0,
	ISCSI_RAMROD_CMD_ID_INIT_FUNC=1 /* iSCSI function init Ramrod */,
	ISCSI_RAMROD_CMD_ID_DESTROY_FUNC=2 /* iSCSI function destroy Ramrod */,
	ISCSI_RAMROD_CMD_ID_OFFLOAD_CONN=3 /* iSCSI connection offload Ramrod */,
	ISCSI_RAMROD_CMD_ID_UPDATE_CONN=4 /* iSCSI connection update Ramrod  */,
	ISCSI_RAMROD_CMD_ID_TERMINATION_CONN=5 /* iSCSI connection offload Ramrod. Command ID known only to FW and VBD */,
	ISCSI_RAMROD_CMD_ID_CLEAR_SQ=6 /* iSCSI connection clear-sq ramrod.  */,
	ISCSI_RAMROD_CMD_ID_MAC_UPDATE=7 /* iSCSI connection update MAC address ramrod.  */,
	MAX_ISCSI_RAMROD_CMD_ID
};







/*
 * ISCSI connection termination request
 */
struct iscsi_spe_conn_mac_update
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 conn_id /* ISCSI Connection ID. */;
	__le32 fw_cid /* Context ID (cid) of the connection. */;
	__le16 remote_mac_addr_lo /* new remote mac address lo */;
	__le16 remote_mac_addr_mid /* new remote mac address mid */;
	__le16 remote_mac_addr_hi /* new remote mac address hi */;
	u8 reserved0[2];
};


/*
 * ISCSI and TCP connection(Option 1) offload params passed by driver to FW in ISCSI offload ramrod 
 */
struct iscsi_spe_conn_offload
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 conn_id /* ISCSI Connection ID. */;
	__le32 fw_cid;
	struct iscsi_conn_offload_params iscsi /* iSCSI session offload params */;
	struct tcp_offload_params tcp /* iSCSI session offload params */;
};


/*
 * ISCSI and TCP connection(Option 2) offload params passed by driver to FW in ISCSI offload ramrod 
 */
struct iscsi_spe_conn_offload_option2
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 conn_id /* ISCSI Connection ID. */;
	__le32 fw_cid;
	struct iscsi_conn_offload_params iscsi /* iSCSI session offload params */;
	struct tcp_offload_params_opt2 tcp /* iSCSI session offload params */;
};


/*
 * ISCSI connection termination request
 */
struct iscsi_spe_conn_termination
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 conn_id /* ISCSI Connection ID. */;
	__le32 fw_cid /* Context ID (cid) of the connection. */;
	u8 abortive /* Mark termination as abort(reset) flow */;
	u8 reserved0[7];
	struct regpair queue_cnts_addr /* cmdq and unsolicited counters termination params */;
	struct regpair query_params_addr /* query_params_ptr */;
};


/*
 * iSCSI firmware function destroy parameters 
 */
struct iscsi_spe_func_dstry
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 reserved0;
	__le32 reserved1;
};


/*
 * iSCSI firmware function init parameters 
 */
struct iscsi_spe_func_init
{
	struct iscsi_slow_path_hdr hdr /* spe message header. */;
	__le16 half_way_close_timeout /* Half Way Close Timeout in Option 2 Close */;
	u8 num_sq_pages_in_ring /* Number of entries in the SQ PBL. Provided by driver at function init spe */;
	u8 num_r2tq_pages_in_ring /* Number of entries in the R2TQ PBL. Provided by driver at function init spe */;
	u8 num_uhq_pages_in_ring /* Number of entries in the uHQ PBL (xHQ entries is X2). Provided by driver at function init spe */;
	u8 ll2_rx_queue_id /* Queue ID of the Light-L2 Rx Queue */;
	u8 ooo_enable /* Enable Out Of Order mode (enable = 1) */;
	struct iscsi_debug_modes debug_mode /* Use iscsi_debug_mode flags */;
	__le16 reserved1;
	__le32 reserved2;
	struct scsi_init_func_params func_params /* Common SCSI init params passed by driver to FW in function init ramrod */;
	struct scsi_init_func_queues q_params /* SCSI RQ/CQ firmware function init parameters */;
};



/*
 * iSCSI task type
 */
enum iscsi_task_type
{
	ISCSI_TASK_TYPE_INITIATOR_WRITE,
	ISCSI_TASK_TYPE_INITIATOR_READ,
	ISCSI_TASK_TYPE_MIDPATH,
	ISCSI_TASK_TYPE_UNSOLIC,
	ISCSI_TASK_TYPE_EXCHCLEANUP,
	ISCSI_TASK_TYPE_IRRELEVANT,
	ISCSI_TASK_TYPE_TARGET_WRITE,
	ISCSI_TASK_TYPE_TARGET_READ,
	ISCSI_TASK_TYPE_TARGET_RESPONSE,
	ISCSI_TASK_TYPE_LOGIN_RESPONSE,
	ISCSI_TASK_TYPE_TARGET_IMM_W_DIF,
	MAX_ISCSI_TASK_TYPE
};






/*
 * iSCSI DesiredDataTransferLength/ttt union
 */
union iscsi_ttt_txlen_union
{
	__le32 desired_tx_len /* desired data transfer length */;
	__le32 ttt /* target transfer tag */;
};


/*
 * iSCSI uHQ element
 */
struct iscsi_uhqe
{
	__le32 reg1;
#define ISCSI_UHQE_PDU_PAYLOAD_LEN_MASK     0xFFFFF /* iSCSI payload (doesnt include padding or digest) or AHS length */
#define ISCSI_UHQE_PDU_PAYLOAD_LEN_SHIFT    0
#define ISCSI_UHQE_LOCAL_COMP_MASK          0x1 /* local compleiton flag */
#define ISCSI_UHQE_LOCAL_COMP_SHIFT         20
#define ISCSI_UHQE_TOGGLE_BIT_MASK          0x1 /* toggle bit to protect from uHQ full */
#define ISCSI_UHQE_TOGGLE_BIT_SHIFT         21
#define ISCSI_UHQE_PURE_PAYLOAD_MASK        0x1 /* indicates whether pdu_payload_len contains pure payload length. if not, pdu_payload_len is AHS length */
#define ISCSI_UHQE_PURE_PAYLOAD_SHIFT       22
#define ISCSI_UHQE_LOGIN_RESPONSE_PDU_MASK  0x1 /* indicates login pdu */
#define ISCSI_UHQE_LOGIN_RESPONSE_PDU_SHIFT 23
#define ISCSI_UHQE_TASK_ID_HI_MASK          0xFF /* most significant byte of task_id */
#define ISCSI_UHQE_TASK_ID_HI_SHIFT         24
	__le32 reg2;
#define ISCSI_UHQE_BUFFER_OFFSET_MASK       0xFFFFFF /* absolute offset in task */
#define ISCSI_UHQE_BUFFER_OFFSET_SHIFT      0
#define ISCSI_UHQE_TASK_ID_LO_MASK          0xFF /* least significant byte of task_id */
#define ISCSI_UHQE_TASK_ID_LO_SHIFT         24
};


/*
 * iSCSI WQ element 
 */
struct iscsi_wqe
{
	__le16 task_id /* The task identifier (itt) includes all the relevant information required for the task processing */;
	u8 flags;
#define ISCSI_WQE_WQE_TYPE_MASK  0x7 /* Wqe type [use iscsi_wqe_type] */
#define ISCSI_WQE_WQE_TYPE_SHIFT 0
#define ISCSI_WQE_NUM_SGES_MASK  0xF /* The driver will give a hint about sizes of SGEs for better credits evaluation at Xstorm */
#define ISCSI_WQE_NUM_SGES_SHIFT 3
#define ISCSI_WQE_RESPONSE_MASK  0x1 /* 1 if this Wqe triggers a response and advances stat_sn, 0 otherwise */
#define ISCSI_WQE_RESPONSE_SHIFT 7
	struct iscsi_dif_flags prot_flags /* Task data-integrity flags (protection) */;
	__le32 contlen_cdbsize;
#define ISCSI_WQE_CONT_LEN_MASK  0xFFFFFF /* expected/desired data transfer length */
#define ISCSI_WQE_CONT_LEN_SHIFT 0
#define ISCSI_WQE_CDB_SIZE_MASK  0xFF /* Initiator mode only: equals SCSI command CDB size if extended CDB is used, otherwise equals zero.  */
#define ISCSI_WQE_CDB_SIZE_SHIFT 24
};


/*
 * iSCSI wqe type 
 */
enum iscsi_wqe_type
{
	ISCSI_WQE_TYPE_NORMAL /* iSCSI WQE type normal. excluding status bit in target mode. */,
	ISCSI_WQE_TYPE_TASK_CLEANUP /* iSCSI WQE type task cleanup */,
	ISCSI_WQE_TYPE_MIDDLE_PATH /* iSCSI WQE type middle path */,
	ISCSI_WQE_TYPE_LOGIN /* iSCSI WQE type login */,
	ISCSI_WQE_TYPE_FIRST_R2T_CONT /* iSCSI WQE type First Write Continuation (Target) */,
	ISCSI_WQE_TYPE_NONFIRST_R2T_CONT /* iSCSI WQE type Non-First Write Continuation (Target) */,
	ISCSI_WQE_TYPE_RESPONSE /* iSCSI WQE type SCSI response */,
	MAX_ISCSI_WQE_TYPE
};


/*
 * iSCSI xHQ element
 */
struct iscsi_xhqe
{
	union iscsi_ttt_txlen_union ttt_or_txlen /* iSCSI DesiredDataTransferLength/ttt union */;
	__le32 exp_stat_sn /* expected StatSn */;
	struct iscsi_dif_flags prot_flags /* Task data-integrity flags (protection) */;
	u8 total_ahs_length /* Initiator mode only: Total AHS Length. greater than zero if and only if PDU is SCSI command and CDB > 16 */;
	u8 opcode /* Type opcode for command PDU */;
	u8 flags;
#define ISCSI_XHQE_FINAL_MASK       0x1 /* The Final(F) for this PDU */
#define ISCSI_XHQE_FINAL_SHIFT      0
#define ISCSI_XHQE_STATUS_BIT_MASK  0x1 /* Whether this PDU is Data-In PDU with status_bit = 1 */
#define ISCSI_XHQE_STATUS_BIT_SHIFT 1
#define ISCSI_XHQE_NUM_SGES_MASK    0xF /* If Predicted IO equals Min(8, number of SGEs in SGL), otherwise equals 0 */
#define ISCSI_XHQE_NUM_SGES_SHIFT   2
#define ISCSI_XHQE_RESERVED0_MASK   0x3 /* reserved */
#define ISCSI_XHQE_RESERVED0_SHIFT  6
	union iscsi_seq_num seq_num /* R2T/DataSN sequence number */;
	__le16 reserved1;
};



/*
 * Per PF iSCSI receive path statistics - mStorm RAM structure
 */
struct mstorm_iscsi_stats_drv
{
	struct regpair iscsi_rx_dropped_PDUs_task_not_valid /* Number of Rx silently dropped PDUs due to task not valid */;
};



/*
 * Per PF iSCSI transmit path statistics - pStorm RAM structure
 */
struct pstorm_iscsi_stats_drv
{
	struct regpair iscsi_tx_bytes_cnt /* Counts the number of tx bytes that were transmitted */;
	struct regpair iscsi_tx_packet_cnt /* Counts the number of tx packets that were transmitted */;
};



/*
 * Per PF iSCSI receive path statistics - tStorm RAM structure
 */
struct tstorm_iscsi_stats_drv
{
	struct regpair iscsi_rx_bytes_cnt /* Counts the number of rx bytes that were received */;
	struct regpair iscsi_rx_packet_cnt /* Counts the number of rx packets that were received */;
	struct regpair iscsi_rx_new_ooo_isle_events_cnt /* Counts the number of new out-of-order isle event */;
	__le32 iscsi_cmdq_threshold_cnt /* Counts the number of times elements in cmdQ reached threshold */;
	__le32 iscsi_rq_threshold_cnt /* Counts the number of times elements in RQQ reached threshold */;
	__le32 iscsi_immq_threshold_cnt /* Counts the number of times elements in immQ reached threshold */;
};


/*
 * Per PF iSCSI receive path statistics - uStorm RAM structure
 */
struct ustorm_iscsi_stats_drv
{
	struct regpair iscsi_rx_data_pdu_cnt /* Number of data PDUs that were received */;
	struct regpair iscsi_rx_r2t_pdu_cnt /* Number of R2T PDUs that were received */;
	struct regpair iscsi_rx_total_pdu_cnt /* Number of total PDUs that were received */;
};



/*
 * Per PF iSCSI transmit path statistics - xStorm RAM structure
 */
struct xstorm_iscsi_stats_drv
{
	struct regpair iscsi_tx_go_to_slow_start_event_cnt /* Number of times slow start event occurred */;
	struct regpair iscsi_tx_fast_retransmit_event_cnt /* Number of times fast retransmit event occurred */;
};


/*
 * Per PF iSCSI transmit path statistics - yStorm RAM structure
 */
struct ystorm_iscsi_stats_drv
{
	struct regpair iscsi_tx_data_pdu_cnt /* Number of data PDUs that were transmitted */;
	struct regpair iscsi_tx_r2t_pdu_cnt /* Number of R2T PDUs that were transmitted */;
	struct regpair iscsi_tx_total_pdu_cnt /* Number of total PDUs that were transmitted */;
};






struct e4_tstorm_iscsi_task_ag_ctx
{
	u8 byte0 /* cdu_validation */;
	u8 byte1 /* state */;
	__le16 word0 /* icid */;
	u8 flags0;
#define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK  0xF /* connection_type */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT    4
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT    5
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK     0x1 /* bit2 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT    6
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK     0x1 /* bit3 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT    7
	u8 flags1;
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK     0x1 /* bit4 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT    0
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK     0x1 /* bit5 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT    1
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK      0x3 /* timer0cf */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT     2
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK      0x3 /* timer1cf */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT     4
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK      0x3 /* timer2cf */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT     6
	u8 flags2;
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK      0x3 /* timer_stop_all */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT     0
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK      0x3 /* cf4 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT     2
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK      0x3 /* cf5 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT     4
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK      0x3 /* cf6 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT     6
	u8 flags3;
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK      0x3 /* cf7 */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT     0
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT   2
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT   3
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT   4
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK    0x1 /* cf3en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT   5
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK    0x1 /* cf4en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT   6
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK    0x1 /* cf5en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT   7
	u8 flags4;
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK    0x1 /* cf6en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT   0
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK    0x1 /* cf7en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT   1
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK  0x1 /* rule5en */
#define E4_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7
	u8 byte2 /* byte2 */;
	__le16 word1 /* word1 */;
	__le32 reg0 /* reg0 */;
	u8 byte3 /* byte3 */;
	u8 byte4 /* byte4 */;
	__le16 word2 /* word2 */;
	__le16 word3 /* word3 */;
	__le16 word4 /* word4 */;
	__le32 reg1 /* reg1 */;
	__le32 reg2 /* reg2 */;
};





struct e5_tstorm_iscsi_task_ag_ctx
{
	u8 byte0 /* cdu_validation */;
	u8 byte1 /* state_and_core_id */;
	__le16 word0 /* icid */;
	u8 flags0;
#define E5_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_MASK  0xF /* connection_type */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_NIBBLE0_SHIFT 0
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT0_SHIFT    4
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT1_SHIFT    5
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT2_MASK     0x1 /* bit2 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT2_SHIFT    6
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT3_MASK     0x1 /* bit3 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT3_SHIFT    7
	u8 flags1;
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT4_MASK     0x1 /* bit4 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT4_SHIFT    0
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT5_MASK     0x1 /* bit5 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_BIT5_SHIFT    1
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0_MASK      0x3 /* timer0cf */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0_SHIFT     2
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1_MASK      0x3 /* timer1cf */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1_SHIFT     4
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2_MASK      0x3 /* timer2cf */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2_SHIFT     6
	u8 flags2;
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3_MASK      0x3 /* timer_stop_all */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3_SHIFT     0
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4_MASK      0x3 /* cf4 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4_SHIFT     2
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5_MASK      0x3 /* cf5 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5_SHIFT     4
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6_MASK      0x3 /* cf6 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6_SHIFT     6
	u8 flags3;
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7_MASK      0x3 /* cf7 */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7_SHIFT     0
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF0EN_SHIFT   2
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF1EN_SHIFT   3
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF2EN_SHIFT   4
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_MASK    0x1 /* cf3en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF3EN_SHIFT   5
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_MASK    0x1 /* cf4en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF4EN_SHIFT   6
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_MASK    0x1 /* cf5en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF5EN_SHIFT   7
	u8 flags4;
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_MASK    0x1 /* cf6en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF6EN_SHIFT   0
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_MASK    0x1 /* cf7en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_CF7EN_SHIFT   1
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE0EN_SHIFT 2
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE1EN_SHIFT 3
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE2EN_SHIFT 4
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE3EN_SHIFT 5
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE4EN_SHIFT 6
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_MASK  0x1 /* rule5en */
#define E5_TSTORM_ISCSI_TASK_AG_CTX_RULE5EN_SHIFT 7
	u8 byte2 /* byte2 */;
	__le16 word1 /* word1 */;
	__le32 reg0 /* reg0 */;
	u8 byte3 /* regpair0 */;
	u8 byte4 /* byte4 */;
	__le16 word2 /* word2 */;
	__le16 word3 /* word3 */;
	__le16 word4 /* word4 */;
	__le32 reg1 /* regpair1 */;
	__le32 reg2 /* reg2 */;
};




/*
 * iSCSI doorbell data
 */
struct iscsi_db_data
{
	u8 params;
#define ISCSI_DB_DATA_DEST_MASK         0x3 /* destination of doorbell (use enum db_dest) */
#define ISCSI_DB_DATA_DEST_SHIFT        0
#define ISCSI_DB_DATA_AGG_CMD_MASK      0x3 /* aggregative command to CM (use enum db_agg_cmd_sel) */
#define ISCSI_DB_DATA_AGG_CMD_SHIFT     2
#define ISCSI_DB_DATA_BYPASS_EN_MASK    0x1 /* enable QM bypass */
#define ISCSI_DB_DATA_BYPASS_EN_SHIFT   4
#define ISCSI_DB_DATA_RESERVED_MASK     0x1
#define ISCSI_DB_DATA_RESERVED_SHIFT    5
#define ISCSI_DB_DATA_AGG_VAL_SEL_MASK  0x3 /* aggregative value selection */
#define ISCSI_DB_DATA_AGG_VAL_SEL_SHIFT 6
	u8 agg_flags /* bit for every DQ counter flags in CM context that DQ can increment */;
	__le16 sq_prod;
};

#endif /* __ISCSI_COMMON__ */