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
|
/* Copyright (c) 1996-2004, Adaptec Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - 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.
* - Neither the name of the Adaptec Corporation nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 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.
*/
#ifndef __DPT_EATA_H
#define __DPT_EATA_H
//File - DPT_EATA.H
//***************************************************************************
//
//Description:
//
// This file contains EATA specific structure and constant
//definitions.
//
//Author: Doug Anderson
//Date: 4/8/93
//
//Editors:
//
//Remarks:
//
//
//***************************************************************************
//Include Files -------------------------------------------------------------
#include "osd_util.h"
#include "dptalign.h"
#ifndef osdBcopy
# define osdBcopy(src,dest,size) memcpy(dest,src,size)
#endif
#ifndef __FAR__
# ifdef __BORLANDC__
# define __FAR__ far
# else
# define __FAR__
# endif
#endif
#ifndef NO_PACK
#if defined (_DPT_AIX)
#pragma options align=packed
#else
#pragma pack(1)
#endif // aix
#endif
//Definitions - Defines & Constants -----------------------------------------
// EATA Communcation Methods...........................
#define EATA_PIO 0
#define EATA_DMA 1
/*
* Eata Register set definitions. We may need to undef them to remove
* errors since these same symbols are repeated in the various drivers.
* There are two sets of definitions, in an effort to support driver code
* and engine code that had formerly standardized on these.
*/
#define HA_DATA 0x00
#define HA_ERROR 0x01
#define HA_DMA_BASE 0x02
#define HA_COMMAND 0x07
# define CP_READ_CFG_PIO 0xF0 /* Read Configuration Data, PIO */
# define CP_EATA_RESET 0xF9 /* Reset SCSI Bus */
# define CP_IMMEDIATE 0xFA /* EATA Immediate command */
# define CP_DMA_CMD 0xFF /* Send an EATA DMA command */
#define HA_STATUS 0x07
# define HA_ST_ERROR 0x01
# define HA_ST_INDEX 0x02
# define HA_ST_CORRCTD 0x04
# define HA_ST_DRQ 0x08
# define HA_ST_SEEK_COMPLETE 0x10
# define HA_ST_WRT_FLT 0x20
# define HA_ST_READY 0x40
# define HA_ST_BUSY 0x80
# define HA_ST_DATA_RDY (HA_ST_SEEK_COMPLETE | HA_ST_READY | HA_ST_DRQ)
#define HA_AUX_STATUS 0x08
# define HA_AUX_BUSY 0x01
# define HA_AUX_INTR 0x02
// EATA Registers .....................................
//
// EPR_ = EATA PIO Register Offset
#define HBA_COMMAND 0x7 // Write
#define HBA_STATUS 0x7 // Read
#define HBA_AUX_STATUS 0x8 // Read
#define HBA_DATA 0x0 // Read/Write
#define HBA_ADDR3 0x5 // Write - CP Address Byte #3
#define HBA_ADDR2 0x4 // Write - CP Address Byte #2
#define HBA_ADDR1 0x3 // Write - CP Address Byte #1
#define HBA_ADDR0 0x2 // Write - CP Address Byte #0
// EATA PIO Commands..................................
#define EPIO_RD_CONFIG 0xf0 // Read Config.
#define EPIO_SEND_CP 0xf2 // Send CP (Command Packet)
#define EPIO_RCVE_SP 0xf3 // Recieve SP (Status Packet)
#define EPIO_TRUNCATE 0xf4 // Truncate Transfer
// EATA DMA Commands..................................
#define EDMA_RD_CONFIG 0xfd // Read Config.
#define EDMA_SEND_CP 0xff // Send CP (Command Packet)
// EATA Commands......................................
#define EATA_RESET 0xf9 // Reset
#define EDMA_RESET 0xf9 // - Clears controller hung
#define EPIO_RESET 0xf9 // - Issues reset to SCSI bus
// EATA Status Register...............................
// Previous cmd ended in an error
#define ESTAT_ERROR 0x01
// Controller will have more data soon (To avoid
// context switching)
#define ESTAT_MORE 0x02
// Data read was corrected by ECC algorithm
#define ESTAT_CORRECT 0x04
// Data Request is active
#define ESTAT_DRQ 0x08
// Seek complete
#define ESTAT_SEEKCOMP 0x10
// Write fault
#define ESTAT_FAULT 0x20
// Drive is ready
#define ESTAT_READY 0x40
// Controller is busy
#define ESTAT_BUSY 0x80
// EATA Auxillary Status Register.....................
// Controller is busy (Doesn't clear interrupt)
#define AUX_BUSY 0x01
// A drive interrupt is asserted
#define AUX_IRQ 0x02
//Definitions - Structure & Typedef -----------------------------------------
// EATA Read Config. Data Structure...................
/* Signature */
#define RDCFG_EATA_SIG (((long)'E')|(((long)'A')<<8L)|(((long)'T')<<16L)|(((long)'A')<<24L))
//flag1
// Controller supports overlapped cmds
#define RDCFG_OVERLAP 0x01
// Controller supports SCSI target mode
#define RDCFG_TGT_MODE 0x02
// Controller supports DMA
#define RDCFG_DMA 0x10
// The DRQX value is valid
#define RDCFG_DRQ_VALID 0x20
// ATA device (Head/Drive Register Req'd)
#define RDCFG_ATA 0x40
// Host Adapter Address Valid
#define RDCFG_HBA_ADDR 0x80
//flag2
// Controller interrupt request #
#define RDCFG_IRQ_NUM 0x0f
// IRQ trigger (0=edge, 1=level)
#define RDCFG_IRQ_TRIG 0x10
// 0=Primary, 1=Secondary
#define RDCFG_PRIORITY 0x20
// DRQ Index:
// 0 = DRQ #0
// 1 = DRQ #7
// 2 = DRQ #6
// 3 = DRQ #5
#define RDCFG_DRQ_NUM 0xc0
//flag3
// (1=A secondary EISA controller does not also
// respond to ISA address)
#define RDCFG_NO_ISA 0x01
// 1 = A PCI HBA is configured to decode a fixed EISA address
#define RDCFG_FORCE_ADDR 0x02
// 1 = A 64KByte scatter-gather table is supported
#define RDCFG_SG_64K 0x04
// 1 = Unaligned scatter-gather table elements are supported
#define RDCFG_SG_UAE 0x08
//flag4
// 1=This is an EISA controller
#define RDCFG_EISA_BUS 0x80
// 1=This is a PCI controller
#define RDCFG_PCI_BUS 0x40
// 1=RAIDNUM returned is questionable
#define RDCGF_VOODOO_RAIDNUM 0x20
// 1=This ia a PCI board with an M1 chip installed
#define RDCFG_PCI_M1 0x10
// 1=HBA supports AUTO termination on base channel only
#define RDCFG_AUTOTRM 0x08
// 1=HBA supports SCAM on one or more channels
#define RDCFG_SCAM 0x04
#define STRUCT_NAME eataRdConfig_S
#ifdef __cplusplus
struct STRUCT_NAME {
#elif (defined(_DPT_ACTIVE_ALIGNMENT))
# define eataRdConfig_size 38
typedef unsigned char eataRdConfig_S[eataRdConfig_size];
#else
typedef struct {
#endif
//--------------------
// If active alignment...
//--------------------
#if defined (__cplusplus) && defined (_DPT_ACTIVE_ALIGNMENT)
#define eataRdConfig_size 38
#define STRUCT_SIZE eataRdConfig_size
//-----------
// Bogus data
//-----------
uCHAR filler[STRUCT_SIZE];
//-----------------
// Access Functions
//-----------------
// uCHAR getDevType() { return getU1(this,0); }
# define eataRdConfig_getDevType(this) ((eataRdConfig_S __FAR__ *)(this))->getDevType()
// uCHAR setDevType(uCHAR inChar) { return setU1(this,0,inChar); }
# define eataRdConfig_setDevType(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->getDevType(inChar)
// uCHAR getPageCode() { return getU1(this,1); }
# define eataRdConfig_getPageCode(this) ((eataRdConfig_S __FAR__ *)(this))->getPageCode()
// uCHAR setPageCode(uCHAR inChar) { return setU1(this,1,inChar); }
# define eataRdConfig_setPageCode(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->getPageCode(inChar)
// CR 3033 - Change byte position from 0 to 3 to reflect the correct "length" location
uCHAR getLength() { return getU1(this,3); }
# define eataRdConfig_getLength(this) ((eataRdConfig_S __FAR__ *)(this))->getLength()
// CR 3033 - Change byte position from 0 to 3
uCHAR setLength(uCHAR inChar) { return setU1(this,3,inChar); }
# define eataRdConfig_setLength(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setLength(inChar)
// CR 3033 - Remove swapLength(). Change andU4 to andU1 and byte position
// from 0 to 3
// uLONG swapLength() { return osdSwap4((uLONG __FAR__ *)getUP1(this,0)); }
// void andLength(uLONG inLong) { andU4(this,0,inLong); }
void andLength(uLONG inLong) { andU1(this,3,inLong); }
uCHAR __FAR__ * getSignature() { return getUP1(this,4); }
# define eataRdConfig_getSignature(this) (*((uLONG __FAR__ *)(this->getSignature())))
uCHAR getVersion() { return getU1(this,8); }
# define eataRdConfig_getVersion(this) ((eataRdConfig_S __FAR__ *)(this))->getVersion()
uCHAR setVersion(uCHAR inChar) { return setU1(this,8,inChar); }
# define eataRdConfig_setVersion(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setVersion(inChar)
void orVersion(uCHAR inChar) { orU1(this,8,inChar); }
void andVersion(uCHAR inChar) { andU1(this,8,inChar); }
uCHAR getFlag1() { return getU1(this,9); }
# define eataRdConfig_getFlag1(this) ((eataRdConfig_S __FAR__ *)(this))->getFlag1()
uCHAR setFlag1(uCHAR inChar) { return setU1(this,9,inChar); }
# define eataRdConfig_setFlag1(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setFlag1(inChar)
void orFlag1(uCHAR inChar) { orU1(this,9,inChar); }
# define eataRdConfig_orFlag1(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->orFlag1(inChar)
void andFlag1(uCHAR inChar) { andU1(this,9,inChar); }
# define eataRdConfig_andFlag1(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->andFlag1(inChar)
uSHORT getPadLength() { return getU2(this,10); }
# define eataRdConfig_getPadLength(this) ((eataRdConfig_S __FAR__ *)(this))->getPadLength()
uSHORT setPadLength(uSHORT inShort) { return setU2(this,10,inShort); }
# define eataRdConfig_setPadLength(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setPadLength(inChar)
uSHORT swapPadLength() { return osdSwap2((uSHORT __FAR__ *)getUP1(this,10)); }
uCHAR __FAR__ * getScsiIDs() { return getUP1(this,12); }
# define eataRdConfig_getScsiIDs(this) ((eataRdConfig_S __FAR__ *)(this))->getScsiIDs()
uLONG getCpLength() { return getU4(this,16); }
# define eataRdConfig_getCpLength(this) ((eataRdConfig_S __FAR__ *)(this))->getCpLength()
uLONG setCpLength(uLONG inLong) { return setU4(this,16,inLong); }
# define eataRdConfig_setCpLength(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setCpLength(inChar)
uLONG swapCpLength() { return osdSwap4((uLONG __FAR__ *)getUP1(this,16)); }
uLONG getSpLength() { return getU4(this,20); }
# define eataRdConfig_getSpLength(this) ((eataRdConfig_S __FAR__ *)(this))->getSpLength()
uLONG setSpLength(uLONG inLong) { return setU4(this,20,inLong); }
# define eataRdConfig_setSpLength(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setSpLength(inChar)
uLONG swapSpLength() { return osdSwap4((uLONG __FAR__ *)getUP1(this,20)); }
uSHORT getQueueSize() { return getU2(this,24); }
# define eataRdConfig_getQueueSize(this) ((eataRdConfig_S __FAR__ *)(this))->getQueueSize()
uSHORT setQueueSize(uSHORT inShort) { return setU2(this,24,inShort); }
# define eataRdConfig_setQueueSize(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setQueueSize(inChar)
uSHORT swapQueueSize() { return osdSwap2((uSHORT __FAR__ *)getUP1(this,24)); }
uLONG getSgSize() { return getU4(this,26); }
# define eataRdConfig_getSgSize(this) ((eataRdConfig_S __FAR__ *)(this))->getSgSize()
uLONG setSgSize(uLONG inLong) { return setU4(this,26,inLong); }
# define eataRdConfig_setSgSize(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setSgSize(inChar)
uLONG swapSgSize() { return osdSwap4((uLONG __FAR__ *)getUP1(this,26)); }
uCHAR getFlag2() { return getU1(this,30); }
# define eataRdConfig_getFlag2(this) ((eataRdConfig_S __FAR__ *)(this))->getFlag2()
uCHAR setFlag2(uCHAR inChar) { return setU1(this,30,inChar); }
# define eataRdConfig_setFlag2(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setFlag2(inChar)
void orFlag2(uCHAR inChar) { orU1(this,30,inChar); }
# define eataRdConfig_orFlag2(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->orFlag2(inChar)
void andFlag2(uCHAR inChar) { andU1(this,30,inChar); }
# define eataRdConfig_andFlag2(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->andFlag2(inChar)
uCHAR getReserved1() { return getU1(this,31); }
uCHAR getIRQ() { return getU1(this,31); }
# define eataRdConfig_getIRQ(this) ((eataRdConfig_S __FAR__ *)(this))->getIRQ()
uCHAR setReserved1(uCHAR inChar) { return setU1(this,31,inChar); }
uCHAR setIRQ(uCHAR inChar) { return setU1(this,31,inChar); }
# define eataRdConfig_setIRQ(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setIRQ(inChar)
void orReserved1(uCHAR inChar) { orU1(this,31,inChar); }
void andReserved1(uCHAR inChar) { andU1(this,31,inChar); }
uCHAR getFlag3() { return getU1(this,32); }
# define eataRdConfig_getFlag3(this) ((eataRdConfig_S __FAR__ *)(this))->getFlag3()
uCHAR setFlag3(uCHAR inChar) { return setU1(this,32,inChar); }
# define eataRdConfig_setFlag3(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setFlag3(inChar)
void orFlag3(uCHAR inChar) { orU1(this,32,inChar); }
# define eataRdConfig_orFlag3(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->orFlag3(inChar)
void andFlag3(uCHAR inChar) { andU1(this,32,inChar); }
# define eataRdConfig_andFlag3(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->andFlag3(inChar)
uCHAR getMaxChanID() { return getU1(this,33); }
# define eataRdConfig_getMaxChanID(this) ((eataRdConfig_S __FAR__ *)(this))->getMaxChanID()
uCHAR setMaxChanID(uCHAR inChar) { return setU1(this,33,inChar); }
# define eataRdConfig_setMaxChanID(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setMaxChanID(inChar)
void orMaxChanID(uCHAR inChar) { orU1(this,33,inChar); }
# define eataRdConfig_orMaxChanID(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->orMaxChanID(inChar)
void andMaxChanID(uCHAR inChar) { andU1(this,33,inChar); }
# define eataRdConfig_andMaxChanID(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->andMaxChanID(inChar)
uCHAR getMaxLun() { return getU1(this,34); }
# define eataRdConfig_getMaxLun(this) ((eataRdConfig_S __FAR__ *)(this))->getMaxLun()
uCHAR setMaxLun(uCHAR inChar) { return setU1(this,34,inChar); }
# define eataRdConfig_setMaxLun(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setMaxLun(inChar)
void orMaxLun(uCHAR inChar) { orU1(this,34,inChar); }
void andMaxLun(uCHAR inChar) { andU1(this,34,inChar); }
uCHAR getFlag4() { return getU1(this,35); }
# define eataRdConfig_getFlag4(this) ((eataRdConfig_S __FAR__ *)(this))->getFlag4()
uCHAR setFlag4(uCHAR inChar) { return setU1(this,35,inChar); }
# define eataRdConfig_setFlag4(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setFlag4(inChar)
void orFlag4(uCHAR inChar) { orU1(this,35,inChar); }
# define eataRdConfig_orFlag4(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->orFlag4(inChar)
void andFlag4(uCHAR inChar) { andU1(this,35,inChar); }
# define eataRdConfig_andFlag4(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->andFlag4(inChar)
uCHAR getRaidNum() { return getU1(this,36); }
# define eataRdConfig_getRaidNum(this) ((eataRdConfig_S __FAR__ *)(this))->getRaidNum()
uCHAR setRaidNum(uCHAR inChar) { return setU1(this,36,inChar); }
# define eataRdConfig_setRaidNum(this,inChar) ((eataRdConfig_S __FAR__ *)(this))->setRaidNum(inChar)
void orRaidNum(uCHAR inChar) { orU1(this,36,inChar); }
void andRaidNum(uCHAR inChar) { andU1(this,36,inChar); }
uCHAR getReserved2() { return getU1(this,37); }
# define eataRdConfig_getReserved2(this) ((eataRdConfig_S __FAR__ *)(this))->getReserved2()
uCHAR setReserved2(uCHAR inChar) { return setU1(this,37,inChar); }
void orReserved2(uCHAR inChar) { orU1(this,37,inChar); }
void andReserved2(uCHAR inChar) { andU1(this,37,inChar); }
//---------------------------
// Required Support Functions
//---------------------------
static uLONG size() { return STRUCT_SIZE; }
void clear() { memset(this,0,STRUCT_SIZE); }
# define eataRdConfig_clear(this) ((eataRdConfig_S __FAR__ *)(this))->clear()
STRUCT_NAME __FAR__ * next() { return ((STRUCT_NAME __FAR__ *)(((uCHAR __FAR__ *)this)+STRUCT_SIZE)); }
STRUCT_NAME __FAR__ * prev() { return ((STRUCT_NAME __FAR__ *)(((uCHAR __FAR__ *)this)+STRUCT_SIZE)); }
void scsiSwap() {
#ifndef _DPT_BIG_ENDIAN
// CR 3033 swapLength();
swapPadLength();
swapCpLength();
swapSpLength();
swapQueueSize();
swapSgSize();
#endif
}
#undef STRUCT_SIZE
#elif (defined(_DPT_ACTIVE_ALIGNMENT))
/*-----------------
* Access Functions
*-----------------*/
#define eataRdConfig_getDevType(x) getU1(x,0)
#define eataRdConfig_getPageCode(x) getU1(x,1)
#define eataRdConfig_getLength(x) getU1(x,3)
#define eataRdConfig_getSignature(x) (*((unsigned long __FAR__ *)getUP1(x,4)))
#define eataRdConfig_getVersion(x) getU1(x,8)
#define eataRdConfig_getFlag1(x) getU1(x,9)
#define eataRdConfig_orFlag1(x,y) orU1(x,9,y)
#define eataRdConfig_andFlag1(x,y) andU1(x,9,y)
#define eataRdConfig_setFlag1(x,y) setU1(x,9,y)
#define eataRdConfig_getPadLength(x) getU2(x,10)
#define eataRdConfig_getScsiIDs(x) getUP1(x,12)
#define eataRdConfig_getCpLength(x) getU4(x,16)
#define eataRdConfig_setCpLength(x,y) setU4(x,16,y)
#define eataRdConfig_getSpLength(x) getU4(x,20)
#define eataRdConfig_getQueueSize(x) getU2(x,24)
#define eataRdConfig_setQueueSize(x,y) setU2(x,24,y)
#define eataRdConfig_getSgSize(x) getU2(x,28)
#define eataRdConfig_setSgSize(x,y) setU2(x,28,y)
#define eataRdConfig_getFlag2(x) getU1(x,30)
#define eataRdConfig_orFlag2(x,y) orU1(x,30,y)
#define eataRdConfig_andFlag2(x,y) andU1(x,30,y)
#define eataRdConfig_setFlag2(x,y) setU1(x,30,y)
#define eataRdConfig_getIRQ(x) getU1(x,31)
#define eataRdConfig_setIRQ(x,y) setU1(x,31,y)
#define eataRdConfig_getFlag3(x) getU1(x,32)
#define eataRdConfig_orFlag3(x,y) orU1(x,32,y)
#define eataRdConfig_andFlag3(x,y) andU1(x,32,y)
#define eataRdConfig_setFlag3(x,y) setU1(x,32,y)
#define eataRdConfig_getMaxChanID(x) getU1(x,33)
#define eataRdConfig_orMaxChanID(x,y) orU1(x,33,y)
#define eataRdConfig_andMaxChanID(x,y) andU1(x,33,y)
#define eataRdConfig_setMaxChanID(x,y) setU1(x,33,y)
#define eataRdConfig_getMaxLun(x) getU1(x,34)
#define eataRdConfig_setMaxLun(x,y) setU1(x,34,y)
#define eataRdConfig_getFlag4(x) getU1(x,35)
#define eataRdConfig_orFlag4(x,y) orU1(x,35,y)
#define eataRdConfig_andFlag4(x,y) andU1(x,35,y)
#define eataRdConfig_setFlag4(x,y) setU1(x,35,y)
#define eataRdConfig_getRaidNum(x) getU1(x,36)
#define eataRdConfig_setRaidNum(x,y) setU1(x,36,y)
#define eataRdConfig_getReserved2(x) getU1(x,37)
/*---------------------------
* Required Support Functions
*---------------------------*/
#define eataRdConfig_clear(x) osdBzero(x,eataRdConfig_size)
//-----------------------------
// Else assume static alignment...
//-----------------------------
#else
uLONG length; // # bytes following this field
# define eataRdConfig_getDevType(this) \
((eataRdConfig_S __FAR__ *)this)->length
# define eataRdConfig_getPageCode(this) \
(((eataRdConfig_S __FAR__ *)this)->length>>8)
# define eataRdConfig_getLength(this) \
(((eataRdConfig_S __FAR__ *)this)->length>>24)
char signature[4]; // EATA signature = ascii "EATA"
# define eataRdConfig_getSignature(this) \
(*((uLONG __FAR__ *)((eatatRdConfig_S __FAR__ *)this)->signature))
uCHAR version; // EATA version level supported
// bits 7-4 = version level
// bits 3-0 = 0
# define eataRdConfig_getVersion(this) \
((eataRdConfig_S __FAR__ *)this)->version
# define eataRdConfig_setVersion(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->version = (inChar)
uCHAR flag1; // Flag byte - see bit definitions above
# define eataRdConfig_getFlag1(this) ((eataRdConfig_S __FAR__ *)this)->flag1
# define eataRdConfig_setFlag1(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag1 = (inChar)
# define eataRdConfig_orFlag1(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag1 |= (inChar)
# define eataRdConfig_andFlag1(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag1 &= (inChar)
uSHORT padLength; // Extra CP bytes sent (PIO only, DMA = 0)
# define eataRdConfig_getPadLength(this) \
getU2(&(((eataRdConfig_S __FAR__ *)this)->padLength),0)
# define eataRdConfig_setPadLength(this,inShort) \
setU2(&(((eataRdConfig_S __FAR__ *)this)->padLength),0,inShort)
uCHAR scsiIDs[4]; // HBA's SCSI IDs for various SCSI channels
# define eataRdConfig_getScsiIDs(this) \
((eataRdConfig_S __FAR__ *)this)->scsiIDs
uLONG cpLength; // # valid Command Packet bytes
# define eataRdConfig_getCpLength(this) \
getU4(&(((eataRdConfig_S __FAR__ *)this)->cpLength),0)
# define eataRdConfig_setCpLength(this,inLong) \
setU4(&(((eataRdConfig_S __FAR__ *)this)->cpLength),0,inLong)
uLONG spLength; // # valid Status Packet bytes
# define eataRdConfig_getSpLength(this) \
getU4(&(((eataRdConfig_S __FAR__ *)this)->spLength),0)
# define eataRdConfig_setSpLength(this,inLong) \
setU4(&(((eataRdConfig_S __FAR__ *)this)->spLength),0,inLong)
uSHORT queueSize; // Max. # CPs that can be queued
# define eataRdConfig_getQueueSize(this) \
getU2(&(((eataRdConfig_S __FAR__ *)this)->queueSize),0)
# define eataRdConfig_setQueueSize(this,inShort) \
setU2(&(((eataRdConfig_S __FAR__ *)this)->queueSize),0,inShort)
uLONG sgSize; // Max. # Scatter Gather table entries
// (8 bytes each)
# define eataRdConfig_getSgSize(this) \
getU4(&(((eataRdConfig_S __FAR__ *)this)->sgSize),0)
# define eataRdConfig_setSgSize(this,inLong) \
setU4(&(((eataRdConfig_S __FAR__ *)this)->sgSize),0,inLong)
uCHAR flag2; // Flag byte - see bit definitions above
# define eataRdConfig_getFlag2(this) ((eataRdConfig_S __FAR__ *)this)->flag2
# define eataRdConfig_setFlag2(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag2 = (inChar)
# define eataRdConfig_orFlag2(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag2 |= (inChar)
# define eataRdConfig_andFlag2(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag2 &= (inChar)
uCHAR reserved1; // Device synchronous mode flags (defunct)
// Bit 7 = SCSI ID 7...
# define eataRdConfig_getIRQ(this) ((eataRdConfig_S __FAR__ *)this)->reserved1
# define eataRdConfig_setIRQ(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->reserved1 = (inChar)
uCHAR flag3; // Flag byte - see bit definitions above
# define eataRdConfig_getFlag3(this) ((eataRdConfig_S __FAR__ *)this)->flag3
# define eataRdConfig_setFlag3(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag3 = (inChar)
# define eataRdConfig_orFlag3(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag3 |= (inChar)
# define eataRdConfig_andFlag3(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag3 &= (inChar)
uCHAR maxChanID; // Maximum SCSI channel/ID supported
// (Max. channel = upper 3 bits)
# define eataRdConfig_getMaxChanID(this) \
((eataRdConfig_S __FAR__ *)this)->maxChanID
# define eataRdConfig_setMaxChanID(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->maxChanID = (inChar)
# define eataRdConfig_orMaxChanID(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->maxChanID |= (inChar)
# define eataRdConfig_andMaxChanID(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->maxChanID &= (inChar)
uCHAR maxLUN; // Maximum SCSI LUN supported
# define eataRdConfig_getMaxLun(this) ((eataRdConfig_S __FAR__ *)this)->maxLUN
# define eataRdConfig_setMaxLun(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->maxLUN = (inChar)
uCHAR flag4; // Flag byte - see bit definitions above
# define eataRdConfig_getFlag4(this) ((eataRdConfig_S __FAR__ *)this)->flag4
# define eataRdConfig_setFlag4(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag4 = (inChar)
# define eataRdConfig_orFlag4(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag4 |= (inChar)
# define eataRdConfig_andFlag4(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->flag4 &= (inChar)
uCHAR raidNum; // This HBA's unique RAID number
# define eataRdConfig_getRaidNum(this) \
((eataRdConfig_S __FAR__ *)this)->raidNum
# define eataRdConfig_setRaidNum(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->raidNum = (inChar)
uCHAR reserved2;
# define eataRdConfig_getReserved2(this) \
((eataRdConfig_S __FAR__ *)this)->reserved2
# define eataRdConfig_setReserved2(this,inChar) \
((eataRdConfig_S __FAR__ *)this)->reserved2 = (inChar)
# define eataRdConfig_size sizeof(eataRdConfig_S)
# define eataRdConfig_clear(this) osdBzero(this,eataRdConfig_size)
#endif
#ifdef __cplusplus
};
#elif (!defined(_DPT_ACTIVE_ALIGNMENT))
} STRUCT_NAME;
#endif
#undef STRUCT_NAME
// EATA CP (Command Packet) Structure.............
//flags
// Issue SCSI bus reset
#define CP_SCSI_RESET 0x01
// Controller should re-initialize
#define CP_INIT 0x02
// DMA only - Target should automatically transfer
// request sense data
#define CP_REQ_SENSE 0x04
// DMA only - Data address is used for Scatter Gather
#define CP_SG_ADDR 0x08
// PIO only - Quick mode (CP uses PIO, Data uses DMA)
#define CP_QUICK 0x10
// The controller should interpret the cmd directly
#define CP_INTERPRET 0x20
// Data Output (Write, Host to Target)
#define CP_DATA_OUT 0x40
// Data Input (Read, Target to Host)
#define CP_DATA_IN 0x80
//message bits
#define CP_DISCONNECT 0x80
#define CP_IDENTIFY 0x40
#define STRUCT_NAME eataCP_S
// #if (defined(__cplusplus))
// struct STRUCT_NAME {
// #elif (defined(_DPT_ACTIVE_ALIGNMENT))
# define eataCP_size 44
// typedef unsigned char eataCP_S[eataCP_size];
// #else
typedef struct {
// #endif
//--------------------
// If active alignment...
//--------------------
#if 0 && defined (__cplusplus) && defined (_DPT_ACTIVE_ALIGNMENT)
#define STRUCT_SIZE 44
//-----------
// Bogus data
//-----------
uCHAR filler[STRUCT_SIZE];
//-----------------
// Access Functions
//-----------------
uCHAR getFlags() { return getU1(this,0); }
# define eataCP_getFlags(this) ((eataCP_S __FAR__ *)(this))->getFlags()
uCHAR setFlags(uCHAR inChar) { return setU1(this,0,inChar); }
# define eataCP_setFlags(this,inChar) ((eataCP_S __FAR__ *)(this))->setFlags(inChar)
uCHAR orFlags(uCHAR inChar) { return orU1(this,0,inChar); }
# define eataCP_orFlags(this,inChar) ((eataCP_S __FAR__ *)(this))->orFlags(inChar)
uCHAR andFlags(uCHAR inChar) { return andU1(this,0,inChar); }
# define eataCP_andFlags(this,inChar) ((eataCP_S __FAR__ *)(this))->andFlags(inChar)
uCHAR getReqSenseLen() { return getU1(this,1); }
# define eataCP_getReqSenseLen(this) ((eataCP_S __FAR__ *)(this))->getReqSenseLen()
uCHAR setReqSenseLen(uCHAR inChar) { return setU1(this,1,inChar); }
# define eataCP_setReqSenseLen(this,inChar) ((eataCP_S __FAR__ *)(this))->setReqSenseLen(inChar)
uCHAR getExtendedId() { return getU1(this,2); }
# define eataCP_getExtendedId(this) ((eataCP_S __FAR__ *)(this))->getExtendedId()
uCHAR setExtendedId(uCHAR inChar) { return setU1(this,2,inChar); }
# define eataCP_setExtendedId(this,inChar) ((eataCP_S __FAR__ *)(this))->setExtendedId(inChar)
uCHAR getNestedFW() { return getU1(this,5); }
# define eataCP_getNestedFW(this) ((eataCP_S __FAR__ *)(this))->getNestedFW()
uCHAR setNestedFW(uCHAR inChar) { return setU1(this,5,inChar); }
# define eataCP_setNestedFW(this,inChar) ((eataCP_S __FAR__ *)(this))->setNestedFW(inChar)
uCHAR orNestedFW(uCHAR inChar) { return orU1(this,5,inChar); }
# define eataCP_orNestedFW(this,inChar) ((eataCP_S __FAR__ *)(this))->orNestedFW(inChar)
uCHAR andNestedFW(uCHAR inChar) { return andU1(this,5,inChar); }
# define eataCP_andNestedFW(this,inChar) ((eataCP_S __FAR__ *)(this))->andNestedFW(inChar)
uCHAR getPhysical() { return getU1(this,6); }
# define eataCP_getPhysical(this) ((eataCP_S __FAR__ *)(this))->getPhysical()
uCHAR setPhysical(uCHAR inChar) { return setU1(this,6,inChar); }
# define eataCP_setPhysical(this,inChar) ((eataCP_S __FAR__ *)(this))->setPhysical(inChar)
uCHAR orPhysical(uCHAR inChar) { return orU1(this,6,inChar); }
# define eataCP_orPhysical(this,inChar) ((eataCP_S __FAR__ *)(this))->orPhysical(inChar)
uCHAR andPhysical(uCHAR inChar) { return andU1(this,6,inChar); }
# define eataCP_andPhysical(this,inChar) ((eataCP_S __FAR__ *)(this))->andPhysical(inChar)
uCHAR getDevAddr() { return getU1(this,7); }
# define eataCP_getDevAddr(this) ((eataCP_S __FAR__ *)(this))->getDevAddr()
uCHAR setDevAddr(uCHAR inChar) { return setU1(this,7,inChar); }
# define eataCP_setDevAddr(this,inChar) ((eataCP_S __FAR__ *)(this))->setDevAddr(inChar)
uCHAR orDevAddr(uCHAR inChar) { return orU1(this,7,inChar); }
# define eataCP_orDevAddr(this,inChar) ((eataCP_S __FAR__ *)(this))->orDevAddr(inChar)
uCHAR andDevAddr(uCHAR inChar) { return andU1(this,7,inChar); }
# define eataCP_andDevAddr(this,inChar) ((eataCP_S __FAR__ *)(this))->andDevAddr(inChar)
uCHAR getMessage() { return getU1(this,8); }
# define eataCP_getMessage(this) ((eataCP_S __FAR__ *)(this))->getMessage()
uCHAR setMessage(uCHAR inChar) { return setU1(this,8,inChar); }
# define eataCP_setMessage(this,inChar) ((eataCP_S __FAR__ *)(this))->setMessage(inChar)
uCHAR orMessage(uCHAR inChar) { return orU1(this,8,inChar); }
# define eataCP_orMessage(this,inChar) ((eataCP_S __FAR__ *)(this))->orMessage(inChar)
uCHAR andMessage(uCHAR inChar) { return andU1(this,8,inChar); }
# define eataCP_andMessage(this,inChar) ((eataCP_S __FAR__ *)(this))->andMessage(inChar)
uCHAR __FAR__ * getCDB() { return getUP1(this,12); }
# define eataCP_getCDB(this) ((eataCP_S __FAR__ *)(this))->getCDB()
uLONG getDataLength() { return getU4(this,24); }
# define eataCP_getDataLength(this) ((eataCP_S __FAR__ *)(this))->getDataLength()
uLONG setDataLength(uLONG inLong) { return setU4(this,24,inLong); }
# define eataCP_setDataLength(this,inLong) ((eataCP_S __FAR__ *)(this))->setDataLength(inLong)
uLONG __FAR__ * getDataLengthPtr() { return getUP4(this,24); }
# define eataCP_getDataLengthPtr(this) ((eataCP_S __FAR__ *)(this))->getDataLengthPtr()
uLONG getVCPaddr() { return *((uLONG __FAR__ *)getUP1(this,28)); }
# define eataCP_getVCPaddr(this) ((eataCP_S __FAR__ *)(this))->getVCPaddr()
uLONG setVCPaddr(uLONG inLong) { return *((uLONG __FAR__ *)getUP1(this,28)) = inLong; }
# define eataCP_setVCPaddr(this,inLong) ((eataCP_S __FAR__ *)(this))->setVCPaddr(inLong)
uLONG getDataAddr() { return getU4(this,32); }
# define eataCP_getDataAddr(this) osdVirt(this->getDataAddr())
uLONG setDataAddr(uLONG inLong) { return setU4(this,32,inLong); }
# define eataCP_setDataAddr(this,inLong) ((eataCP_S __FAR__ *)(this))->setDataAddr(osdPhys(inLong))
uLONG __FAR__ * getDataAddrPtr() { return getUP4(this,32); }
# define eataCP_getDataAddrPtr(this) ((eataCP_S __FAR__ *)(this))->getDataAddrPtr()
uLONG getSpAddr() { return getU4(this,36); }
# define eataCP_getSpAddr(this) osdVirt(this->getSpAddr())
uLONG setSpAddr(uLONG inLong) { return setU4(this,36,inLong); }
# define eataCP_setSpAddr(this,inLong) ((eataCP_S __FAR__ *)(this))->setSpAddr(osdPhys(inLong))
uLONG __FAR__ * getSpAddrPtr() { return getUP4(this,36); }
# define eataCP_getSpAddrPtr(this) ((eataCP_S __FAR__ *)(this))->getSpAddrPtr()
uLONG getReqSenseAddr() { return getU4(this,40); }
# define eataCP_getReqSenseAddr(this) osdVirt(this->getReqSenseAddr())
uLONG setReqSenseAddr(uLONG inLong) { return setU4(this,40,inLong); }
# define eataCP_setReqSenseAddr(this,inLong) ((eataCP_S __FAR__ *)(this))->setReqSenseAddr(osdPhys(inLong))
uLONG __FAR__ * getReqSenseAddrPtr() { return getUP4(this,40); }
# define eataCP_getReqSenseAddrPtr(this) ((eataCP_S __FAR__ *)(this))->getReqSenseAddrPtr()
//---------------------------
// Required Support Functions
//---------------------------
static uLONG size() { return STRUCT_SIZE; }
void clear() { memset(this,0,STRUCT_SIZE); }
# define eataRdConfig_clear(this) ((eataCP_S __FAR__ *)(this))->clear()
STRUCT_NAME __FAR__ * next() { return ((STRUCT_NAME __FAR__ *)(((uCHAR __FAR__ *)this)+STRUCT_SIZE)); }
STRUCT_NAME __FAR__ * prev() { return ((STRUCT_NAME __FAR__ *)(((uCHAR __FAR__ *)this)+STRUCT_SIZE)); }
void scsiSwap() {
#ifndef _DPT_BIG_ENDIAN
#endif
}
#undef STRUCT_SIZE
// #elif (defined(_DPT_ACTIVE_ALIGNMENT))
#endif
/*-----------------
* Access Functions
*-----------------*/
#define eataCP_getFlags(x) getU1(x,0)
#define eataCP_setFlags(x,y) setU1(x,0,y)
#define eataCP_orFlags(x,y) orU1(x,0,y)
#define eataCP_andFlags(x,y) andU1(x,0,y)
#define eataCP_getReqSenseLen(x) getU1(x,1)
#define eataCP_setReqSenseLen(x,y) setU1(x,1,y)
#define eataCP_getExtendedId(x) getU1(x,2)
#define eataCP_setExtendedId(x,y) setU1(x,2,y)
#define eataCP_getNestedFW(x) getU1(x,5)
#define eataCP_setNestedFW(x,y) setU1(x,5,y)
#define eataCP_orNestedFW(x,y) orU1(x,5,y)
#define eataCP_andNestedFW(x,y) andU1(x,5,y)
#define eataCP_getPhysical(x) getU1(x,6)
#define eataCP_setPhysical(x,y) setU1(x,6,y)
#define eataCP_orPhysical(x,y) orU1(x,6,y)
#define eataCP_andPhysical(x,y) andU1(x,6,y)
#define eataCP_getDevAddr(x) getU1(x,7)
#define eataCP_setDevAddr(x,y) setU1(x,7,y)
#define eataCP_orDevAddr(x,y) orU1(x,7,y)
#define eataCP_andDevAddr(x,y) andU1(x,7,y)
#define eataCP_getMessage(x) getU1(x,8)
#define eataCP_setMessage(x,y) setU1(x,8,y)
#define eataCP_orMessage(x,y) orU1(x,8,y)
#define eataCP_andMessage(x,y) andU1(x,8,y)
#define eataCP_getCDB(x) getUP1(x,12)
#if (!defined(eataCP_getDataLength))
# define eataCP_getDataLength(x) getU4(x,24)
#endif
#if (!defined(eataCP_setDataLength))
# define eataCP_setDataLength(x,y) setU4(x,24,(unsigned long)(y))
#endif
#define eataCP_getDataLengthPtr(x) getUP4(x,24)
#if (!defined(eataCP_getSgLength))
# define eataCP_getSgLength(x) eataCP_getDataLength(x)
#endif
#if (!defined(eataCP_setSgLength))
# define eataCP_setSgLength(x,y) eataCP_setDataLength(x,y)
#endif
#define eataCP_getSgLengthPtr(x) eataCP_getDataLengthPtr(x)
#define eataCP_getVCPaddr(x) (*((unsigned long __FAR__ *)getUP1(x,28)))
#define eataCP_setVCPaddr(x,y) (*((unsigned long __FAR__ *)getUP1(x,28)) \
= (unsigned long)(y))
#if (!defined(eataCP_getDataAddr))
# if (defined(osdVirt))
# define eataCP_getDataAddr(x) osdVirt(getU4(x,32))
# else
# define eataCP_getDataAddr(x) getU4(x,32)
# endif
#endif
#if (!defined(eataCP_setDataAddr))
# if (defined(osdPhys))
# define eataCP_setDataAddr(x,y) setU4(x,32,osdPhys((unsigned long)(y)))
# else
# define eataCP_setDataAddr(x,y) setU4(x,32,(unsigned long)(y))
# endif
#endif
#if (!defined(eataCP_setDataAddrPtr))
# define eataCP_getDataAddrPtr(x) getUP4(x,32)
#endif
#if (!defined(eataCP_getSgAddr))
# if ((defined(osdPhys) && defined(osdVirt)) || (!defined(osdPhys) && !defined(osdVirt)))
# define eataCP_getSgAddr(x) ((eataSG_S __FAR__ *)eataCP_getDataAddr(x))
# endif
#endif
#if (!defined(eataCP_setSgAddr))
# define eataCP_setSgAddr(x,y) eataCP_setDataAddr(x,y)
#endif
#define eataCP_getSgAddrPtr(x) eataCP_getDataAddrPtr(x)
#if (!defined(eataCP_getSpAddr))
# if (defined(osdVirt))
# define eataCP_getSpAddr(x) (eataSP_S __FAR__ *)osdVirt(getU4(x,36))
# else
# define eataCP_getSpAddr(x) (eataSP_S __FAR__ *)getU4(x,36)
# endif
#endif
#if (!defined(eataCP_setSpAddr))
# if (defined(osdPhys))
# define eataCP_setSpAddr(x,y) setU4(x,36,osdPhys((unsigned long)(y)))
# else
# define eataCP_setSpAddr(x,y) setU4(x,36,(unsigned long)(y))
# endif
#endif
#define eataCP_getSpAddrPtr(x) getUP4(x,36)
#if (!defined(eataCP_getReqSenseAddr))
# if (defined(osdVirt))
# define eataCP_getReqSenseAddr(x) ((sdRequestSense_S __FAR__ *)osdVirt(getU4(x,40)))
# else
# define eataCP_getReqSenseAddr(x) ((sdRequestSense_S __FAR__ *)getU4(x,40))
# endif
#endif
#if (!defined(eataCP_setReqSenseAddr))
# if (defined(osdPhys))
# define eataCP_setReqSenseAddr(x,y) setU4(x,40,osdPhys((unsigned long)(y)))
# else
# define eataCP_setReqSenseAddr(x,y) setU4(x,40,(unsigned long)(y))
# endif
#endif
#define eataCP_getReqSenseAddrPtr(x) getUP4(x,40)
#define eataCP_clear(x) osdBzero(x,eataCP_size)
//-----------------------------
// Else assume static alignment...
//-----------------------------
// #else
uCHAR flags; // Flag byte - see bit definition above
// # define eataCP_getFlags(this) ((eataCP_S __FAR__ *)this)->flags
// # define eataCP_setFlags(this,inChar) \
// ((eataCP_S __FAR__ *)this)->flags = (inChar)
// # define eataCP_orFlags(this,inChar) \
// ((eataCP_S __FAR__ *)this)->flags |= (inChar)
// # define eataCP_andFlags(this,inChar) \
// ((eataCP_S __FAR__ *)this)->flags &= (inChar)
uCHAR reqSenseLen; // # bytes requested by controller in
// response to a check status (reqSense=1).
// # define eataCP_getReqSenseLen(this) ((eataCP_S __FAR__ *)this)->reqSenseLen
// # define eataCP_setReqSenseLen(this,inChar) \
// ((eataCP_S __FAR__ *)this)->reqSenseLen = (inChar)
uCHAR extendedId; // Extended ID word (for SCSI IDs > 31)
uCHAR unUsed[2]; // Unused
uCHAR nestedFW; // Bit 0 = The SCSI cmd should be sent
// to a FW drive that may be a component
// of a SW drive.
// # define eataCP_getNestedFW(this) ((eataCP_S __FAR__ *)this)->nestedFW
// # define eataCP_setNestedFW(this,inChar) \
// ((eataCP_S __FAR__ *)this)->nestedFW = (inChar)
// # define eataCP_orNestedFW(this,inChar) \
// ((eataCP_S __FAR__ *)this)->nestedFW |= (inChar)
// # define eataCP_andNestedFW(this,inChar) \
// ((eataCP_S __FAR__ *)this)->nestedFW &= (inChar)
uCHAR physical; // Bit 0 = The SCSI cmd should be sent
// directly to the target physical unit.
// (Bypasses all RAID, mirroring...)
// # define eataCP_getPhysical(this) ((eataCP_S __FAR__ *)this)->physical
// # define eataCP_setPhysical(this,inChar) \
// ((eataCP_S __FAR__ *)this)->physical = (inChar)
// # define eataCP_orPhysical(this,inChar) \
// ((eataCP_S __FAR__ *)this)->physical |= (inChar)
// # define eataCP_andPhysical(this,inChar) \
// ((eataCP_S __FAR__ *)this)->physical &= (inChar)
uCHAR devAddr; // SCSI channel=bits 7-4, SCSI ID=bits 3-0
// # define eataCP_getDevAddr(this) ((eataCP_S __FAR__ *)this)->devAddr
// # define eataCP_setDevAddr(this,inChar) \
// ((eataCP_S __FAR__ *)this)->devAddr = (inChar)
// # define eataCP_orDevAddr(this,inChar) \
// ((eataCP_S __FAR__ *)this)->devAddr |= (inChar)
// # define eataCP_andDevAddr(this,inChar) \
// ((eataCP_S __FAR__ *)this)->devAddr &= (inChar)
uCHAR message[4]; // SCSI message bytes to be transfered to
// the target device (0=NOP)
// # define eataCP_getMessage(this) ((eataCP_S __FAR__ *)this)->message
// # define eataCP_setMessage(this,inChar) \
// ((eataCP_S __FAR__ *)this)->message = (inChar)
// # define eataCP_orMessage(this,inChar) \
// ((eataCP_S __FAR__ *)this)->message |= (inChar)
// # define eataCP_andMessage(this,inChar) \
// ((eataCP_S __FAR__ *)this)->message &= (inChar)
uCHAR scsiCDB[12]; // SCSI CDB (Command Description Block)
// # define eataCP_getCDB(this) ((eataCP_S __FAR__ *)this)->scsiCDB
uLONG dataLength; // If,
// SG=0, Max. # bytes transfered.
// SG=1, Total scatter gather packet
// length (in bytes)
// # define eataCP_getDataLength(this) \
// getU4(&(((eataCP_S __FAR__ *)this)->dataLength),0)
// # define eataCP_setDataLength(this,inLong) \
// setU4(&(((eataCP_S __FAR__ *)this)->dataLength),0,inLong)
// # define eataCP_setDataLengthPtr(this) \
// &(((eataCP_S __FAR__ *)this)->DataLength)
#ifdef _DPT_REALMODE
uSHORT vCPsegment; // Real Mode segment of virtual CP address
uSHORT vCPoffset; // Real Mode offset of virtual CP address
#else
uLONG vCPaddr; // Virtual CP Address (returned in SP)
// # define eataCP_getVCPaddr(this) ((eataCP_S __FAR__ *)this)->vCPaddr
// # define eataCP_setVCPaddr(this,inLong) \
// ((eataCP_S __FAR__ *)this)->vCPaddr = (inLong)
#endif
// Note: dataAddr, SPaddr, & reqSenseAddr = Physical Addresses
uLONG dataAddr; // If,
// SG=0, Address of data to be read
// or written
// SG=1, Address of scatter gather table
// # define eataCP_getDataAddr(this) \
// osdVirt(getU4(&(((eataCP_S __FAR__ *)this)->dataAddr),0))
// # define eataCP_setDataAddr(this,inLong) \
// setU4(&(((eataCP_S __FAR__ *)this)->dataAddr),0,osdPhys(inLong))
// # define eataCP_setDataAddrPtr(this) \
// &(((eataCP_S __FAR__ *)this)->dataAddr)
uLONG spAddr; // Address of the SP (Status Packet)
// The SP EOC bit should be cleared before
// issuing a send CP.
// # define eataCP_getSpAddr(this) \
// osdVirt(getU4(&(((eataCP_S __FAR__ *)this)->spAddr),0))
// # define eataCP_setSpAddr(this,inLong) \
// setU4(&(((eataCP_S __FAR__ *)this)->spAddr),0,osdPhys(inLong))
// # define eataCP_setSpAddrPtr(this) \
// &(((eataCP_S __FAR__ *)this)->spAddr)
uLONG reqSenseAddr; // The address of request sense data
// (check req. sense if CP error)
// # define eataCP_getResSenseAddr(this) \
// osdVirt(getU4(&(((eataCP_S __FAR__ *)this)->reqSenseAddr),0))
// # define eataCP_setResSenseAddr(this,inLong) \
// setU4(&(((eataCP_S __FAR__ *)this)->reqSenseAddr),0,osdPhys(inLong))
// # define eataCP_setResSenseAddrPtr(this) \
// &(((eataCP_S __FAR__ *)this)->reqSenseAddr)
//#endif
// #ifdef __cplusplus
// };
// #elif (!defined(_DPT_ACTIVE_ALIGNMENT))
} STRUCT_NAME;
// #endif
/*
* Aggregate macros.
*/
#define eataCP_getBus(x) (eataCP_getDevAddr(x)>>5)
#define eataCP_setBus(x,y) (eataCP_andDevAddr(x,31), \
eataCP_orDevAddr(x,(y)<<5))
#define eataCP_getTarget(x) (eataCP_getDevAddr(x)&31)
#define eataCP_setTarget(x,y) (eataCP_andDevAddr(x,225), \
eataCP_orDevAddr(x,(y)&31))
#define eataCP_getLun(x) (eataCP_getMessage(x)&7)
#define eataCP_setLun(x,y) (eataCP_andMessage(x,248), \
eataCP_orMessage(x,(y)&7))
#if (!defined(eataCP_getSgLength))
# define eataCP_getSgLength(x) eataCP_getDataLength(x)
#endif
#if (!defined(eataCP_getSgLengthPtr))
# define eataCP_getSgLengthPtr(x) eataCP_getDataLengthPtr(x)
#endif
#if (!defined(eataCP_getSgAddr))
# if ((defined(osdPhys) && defined(osdVirt)) || (!defined(osdPhys) && !defined(osdVirt)))
# define eataCP_getSgAddr(x) ((eataSG_S __FAR__ *)eataCP_getDataAddr(x))
# endif
#endif
#if (!defined(eataCP_setSgAddr))
# define eataCP_setSgAddr(x,y) eataCP_setDataAddr(x,y)
#endif
#define eataCP_getSgAddrPtr(x) eataCP_getDataAddrPtr(x)
#undef STRUCT_NAME
// EATA SP (Status Packet) Structure..................
//flags
// Controller status mask - see Status's above
#define SP_STATUS 0x7f
// End of command
#define SP_EOC 0x80
// Controller status values
#define HERR_NO_ERROR 0x00
#define HERR_SEL_TIMEOUT 0x01
#define HERR_CMD_TIMEOUT 0x02
#define HERR_SCSI_RESET 0x03
#define HERR_HBA_POST 0x04
#define HERR_BUS_PHASE 0x05
#define HERR_BUS_FREE 0x06
#define HERR_BUS_PARITY 0x07
#define HERR_BUS_HUNG 0x08
#define HERR_MSG_REJECT 0x09
#define HERR_BUS_RESET_STUCK 0x0a
#define HERR_AUTO_SENSE 0x0b
#define HERR_RAM_PARITY 0x0c
#define HERR_ABORT_NA 0x0d /* CP aborted - NOT on Bus */
#define HERR_ABORTED 0x0e /* CP aborted - WAS on Bus */
#define HERR_RESET_NA 0x0f /* CP was reset - NOT on Bus */
#define HERR_RESET 0x10 /* CP was reset - WAS on Bus */
#define HERR_ECC 0x11 /* HBA Memory ECC Error */
#define HERR_PCI_PARITY 0x12 /* PCI Parity Error */
#define HERR_PCI_MASTER 0x13 /* PCI Master Abort */
#define HERR_PCI_TARGET 0x14 /* PCI Target Abort */
#define HERR_PCI_SIGNAL_TARGET 0x15 /* PCI Signalled Target Abort */
// SCSI status values
#define SERR_GOOD 0x00
#define SERR_CHECK_CONDITION 0x02
#define SERR_CONDITION_MET 0x04
#define SERR_BUSY 0x08
#define SERR_INTERMEDIATE 0x10
#define SERR_INTM_CM 0x14
#define SERR_RESV_CONFLICT 0x18
#define SERR_CMD_TERMINATED 0x22
#define SERR_QUEUE_FULL 0x28
typedef struct {
uCHAR ctlrStatus; // Flags byte - see bit definitions above
uCHAR scsiStatus; // SCSI status (equals 0 if endCmd=0)
uCHAR unUsed1; // Unused (should=0)
uCHAR unUsed2; // Unused (should=0)
uLONG residueLen; // # bytes not transfered
#ifdef _DPT_REALMODE
uSHORT vCPsegment; // Real Mode segment of virtual CP address
uSHORT vCPoffset; // Real Mode offset of virtual CP address
#else
uLONG vCPaddr; // Virtual CP Address
#endif
uCHAR message[12]; // Indicate the Nexus responding to a
// previous CP
} eataSP_S;
#define eataSP_size 24
// typedef unsigned char eataSP_S[eataSP_size];
#if (!defined(eataSP_getCtlrStatus))
# define eataSP_getCtlrStatus(x) getU1(x,0)
#endif
#if (!defined(eataSP_setCtlrStatus))
# define eataSP_setCtlrStatus(x,y) setU1(x,0,y)
#endif
#if (!defined(eataSP_orCtlrStatus))
# define eataSP_orCtlrStatus(x,y) orU1(x,0,y)
#endif
#if (!defined(eataSP_andCtlrStatus))
# define eataSP_andCtlrStatus(x,y) andU1(x,0,y)
#endif
#if (!defined(eataSP_getScsiStatus))
# define eataSP_getScsiStatus(x) getU1(x,1)
#endif
#if (!defined(eataSP_setScsiStatus))
# define eataSP_setScsiStatus(x,y) setU1(x,1,y)
#endif
#if (!defined(eataSP_getResidue))
# define eataSP_getResidue(x) getU4(x,4)
#endif
#if (!defined(eataSP_setResidue))
# define eataSP_setResidue(x,y) setU4(x,4,(unsigned long)(y))
#endif
#define eataSP_getResiduePtr(x) getUP4(x,4)
#if (!defined(eataSP_getVCPaddr))
# define eataSP_getVCPaddr(x) (*((unsigned long __FAR__ *)getUP1(x,8)))
#endif
#if (!defined(eataSP_setVCPaddr))
# define eataSP_setVCPaddr(x,y) ((*((unsigned long __FAR__ *)getUP1(x,8))) = y)
#endif
#if (!defined(eataSP_getMessage))
# define eataSP_getMessage(x) getUP1(x,12)
#endif
#if (!defined(eataSP_clear))
# define eataSP_clear(x) osdBzero(x,eataSP_size)
#endif
// EATA SG (Scatter Gather) Structure..................
typedef struct {
uLONG addr;
uLONG length;
} eataSG_S;
typedef struct {
uCHAR __FAR__ * addr_P;
uLONG length;
} eataSGptr_S;
#define eataSG_size 8
// typedef unsigned char eataSG_S[eataSG_size];
#if (!defined(eataSG_getAddr))
# if (defined(osdVirt))
# define eataSG_getAddr(x) osdVirt(getU4(x,0))
# else
# define eataSG_getAddr(x) getU4(x,0)
# endif
#endif
#if (!defined(eataSG_setAddr))
# if (defined(osdPhys))
# define eataSG_setAddr(x,y) setU4(x,0,osdPhys((unsigned long)(y)))
# else
# define eataSG_setAddr(x,y) setU4(x,0,(unsigned long)(y))
# endif
#endif
#define eataSG_getAddrPtr(x) getUP4(x,0)
#define eataSG_getLength(x) getU4(x,4)
#define eataSG_setLength(x,y) setU4(x,4,(unsigned long)(y))
#define eataSG_getLengthPtr(x) getUP4(x,4)
/*
* Log Sense page that provides a list of the LSUs installed into the
* specified HBA. This log page is an interpreted 0x36.
*/
#define eataLSU_size 512
typedef unsigned char eataLSU_S[eataLSU_size];
#define eataLSU_getPageCode(x) getU1(x,0)
#define eataLSU_getReserved1(x) getU1(x,1)
#define eataLSU_getPageLength(x) getU2(x,2)
#define eataLSU_getParmCode(x) getU2(x,4)
#define eataLSU_getReserved2(x) getU1(x,6)
#define eataLSU_getSize(x) getU1(x,7)
#define eataLSU_getEataDevAddr(x) ((eataLSUList_S __FAR__ *)getUP1(x,8))
/*
* The LSU data list contained at eataLSU_getEataDevAddr
*/
#define eataLSUList_size 2
typedef unsigned char eataLSUList_S[eataLSUList_size];
#define eataLSUList_getBus(x) (getU1(x,0) & 7)
#define eataLSUList_getHba(x) (getU1(x,0) >> 3)
#define eataLSUList_getLun(x) (getU1(x,1) & 15)
#define eataLSUList_getTarget(x) (getU1(x,1) >> 4)
/*
* A Mode Sense(10) page 0x2A gets you ...
*/
#define PHYS_CHANGE 0x80
#define eataPhysDesc_size 250
typedef unsigned char eataPhysDesc_S[eataPhysDesc_size];
/* The Mode Page header */
#define eataPhysDesc_getDataLength(x) getU2(x,0)
#define eataPhysDesc_setDataLength(x,y) setU2(x,0,y)
#define eataPhysDesc_getMediumType(x) getU1(x,2)
#define eataPhysDesc_getDevice(x) getU1(x,3)
#define eataPhysDesc_getReserved1(x) getU2(x,4)
#define eataPhysDesc_getBlockLength(x) getU2(x,6)
/* The actual Mode Page */
#define eataPhysDesc_getModePage(x) getU1(x,8)
#define eataPhysDesc_getLength(x) getU1(x,9)
/* A status array, [targets][Bus] [16][15] */
#define eataPhysDesc_getStatus(x) getUP1(x,10)
/*
* Then, a Mode sense(10) page 0x3B gets you ...
*/
#define LAP_CMD_ADD 0x80
#define LAP_CMD_DELETE 0x81
#define LAP_CMD_MODIFY 0x82
#define LAP_CMD_REPLACE 0x83
#define LAP_CMD_ABORT 0x84
#define LAP_CMD_BUILD 0x88
#define LAP_CMD_REBUILD 0x89
#define LAP_CMD_VERIFY 0x8a
#define LAP_CMD_VERIFY_FIX 0x8b
#define LAP_CMD_VERIFY_ABORT 0x8c
#define eataLSUDesc_size 512
typedef unsigned char eataLSUDesc_S[eataLSUDesc_size];
/* The Mode Page header */
#define eataLSUDesc_getDataLength(x) getU2(x,0)
#define eataLSUDesc_setDataLength(x,y) setU2(x,0,y)
#define eataLSUDesc_getMediumType(x) getU1(x,2)
#define eataLSUDesc_getDevice(x) getU1(x,3)
#define eataLSUDesc_getReserved1(x) getU2(x,4)
#define eataLSUDesc_getBlockLength(x) getU2(x,6)
/* The actual Mode Page */
#define eataLSUDesc_getModePage(x) getU1(x,8)
#define eataLSUDesc_getLength(x) getU1(x,9)
#define eataLSUDesc_getActionStatus(x) getU1(x,10)
#define eataLSUDesc_setActionStatus(x,y) setU1(x,10,y)
#define eataLSUDesc_getRAIDLevel(x) getU1(x,11)
#define eataLSUDesc_getLsuType(x) getU1(x,12)
#define eataLSUDesc_getLsuBytesPerBlock(x) getU4(x,13)
#define eataLSUDesc_getCompBytesPerBlock(x) getU2(x,17)
#define eataLSUDesc_getLsuCapacity(x) getU4(x,19)
#define eataLSUDesc_getStartOffset(x) getU4(x,23) /* Verify Error Block */
#define eataLSUDesc_getReserved2(x) getUP1(x,27)
#define eataLSUDesc_getLsuStripeSize(x) getU1(x,31)
#define eataLSUDesc_getCopyDir(x) getU1(x,32)
#define eataLSUDesc_getFlags(x) getU1(x,33)
#define eataLSUDesc_getReconBlock(x) getU4(x,34)
#define eataLSUDesc_getReconFrequency(x) getU1(x,38)
#define eataLSUDesc_getReconAmount(x) getU2(x,39)
#define eataLSUDesc_getLunNumber(x) getU1(x,41)
#define eataLSUDesc_getHbaIndex(x) getU1(x,42)
#define eataLSUDesc_getSpinDown(x) getU1(x,43)
#define eataLSUDesc_getCompList(x) ((eataLSUCompList_S*)(getUP1(x,44)))
/*
* And the component list looks like:
*/
#define eataLSUCompList_size 6
typedef unsigned char eataLSUCompList_S[eataLSUCompList_size];
#define eataLSUCompList_getBus(x) eataLSUList_getBus(x)
#define eataLSUCompList_getHba(x) eataLSUList_getHba(x)
#define eataLSUCompList_getLun(x) eataLSUList_getLun(x)
#define eataLSUCompList_getTarget(x) eataLSUList_getTarget(x)
#define eataLSUCompList_getStripe(x) getU4(x,2)
#ifndef NO_UNPACK
#if defined (_DPT_AIX)
#pragma options align=reset
#elif defined (UNPACK_FOUR)
#pragma pack(4)
#else
#pragma pack()
#endif // aix
#endif
#endif
|