Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/scsi/vmkapi_scsi_types.h
d0a14f973771
48.1 KiB
text/x-chdr
ESXi-5.0-U1
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 | /***************************************************************************
* Copyright 2004 - 2009 VMware, Inc. All rights reserved.
***************************************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
***********************************************************************
* SCSI-specific types */ /**
* \addtogroup SCSI
* @{
*
* \defgroup SCSItypes SCSI Types
* @{
***********************************************************************
*/
#ifndef _VMKAPI_SCSI_TYPES_H_
#define _VMKAPI_SCSI_TYPES_H_
/** \cond never */
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
#error This vmkapi file should never be included directly but only via vmkapi.h
#endif
/** \endcond never */
#include "core/vmkapi_dma.h"
#include "scsi/vmkapi_scsi_ext.h"
#include "scsi/vmkapi_scsi_mgmt_types.h"
#define VMK_SECTOR_SIZE 512
/**
* \brief configured SCSI system limits
*/
typedef struct vmk_ScsiSystemLimits {
vmk_uint32 maxDevices;
vmk_uint32 maxPaths;
vmk_VA pad[3];
} vmk_ScsiSystemLimits;
/**
* \brief sense data structure maintained in each SCSI device
* SPC 3 r23, Section 4.5.3 table 26
*
* NB: The "valid" bit in the data structure does NOT tell whether the sense is
* actually valid and thus the name is really badly chosen (even though it is
* the official name from the SCSI II specification). The SCSI II spec.
* states "A valid bit of zero indicates that the information field is not as
* defined in this International Standard". we have seen that many tape drives
* are capable of returning sense without this bit set
*/
typedef struct vmk_ScsiSenseData {
/** \brief error type and format of sense data (see SPC 3 r23, Sec. 4.5.1) */
vmk_uint8 error :7,
/* \brief sense data is for "current command" */
#define VMK_SCSI_SENSE_ERROR_CURCMD 0x70
/* \brief sense data is for an earlier command */
#define VMK_SCSI_SENSE_ERROR_PREVCMD 0x71
/** \brief set to one indicates the 'info' field is valid */
valid :1;
/** \brief obsolete */
vmk_uint8 segment;
/** \brief generic information describing the error or exception condition */
vmk_uint8 key :4,
:1,
/** \brief see above spc section */
ili :1,
/** \brief see above spc section */
eom :1,
/** \brief see above spc section */
filmrk :1;
/** \brief see above spc section */
vmk_uint8 info[4];
/** \brief see above spc section */
vmk_uint8 optLen;
/** \brief see above spc section */
vmk_uint8 cmdInfo[4];
/** \brief further information about to the condition reported in 'key' */
vmk_uint8 asc;
/** \brief detailed information about to the additional sense code in 'asc' */
vmk_uint8 ascq;
/** \brief Field Replacable Unit code (see SPC 3 r23, 4.5.2.5) */
vmk_uint8 fru;
/** \brief Sense-key specific fields (see SPC 3 r23, 4.5.2.4) */
vmk_uint8 bitpos :3,
bpv :1,
:2,
cd :1,
/** \brief Set to indicate sense-key specific fields are valid */
sksv :1;
/** \brief field indicates which byte of the CDB or param data was in error */
vmk_uint16 epos;
/*
* \brief may contain vendor specific data further defining exception cond.
*
* Some vendors want to return additional data which
* requires a sense buffer of up to 64 bytes.
*
* See SPC 3 r23, Section 4.5
*/
vmk_uint8 additional[46];
} VMK_ATTRIBUTE_PACKED vmk_ScsiSenseData;
/*
* Commands
*/
/**
* \brief SCSI command ID
*/
typedef struct vmk_ScsiCommandId {
/** \brief unique token of originator of cmd */
void *initiator;
/** \brief unique serial of cmd */
vmk_uint64 serialNumber;
} vmk_ScsiCommandId;
struct vmk_ScsiCommand;
typedef void (*vmk_ScsiCommandDoneCbk)(struct vmk_ScsiCommand *cmd);
/**
* \brief Flag definitions for vmk_ScsiCommand.flags field.
*
*/
typedef enum {
/**
* \brief Command requests Use of ORDERED tag.
*
* This instructs the lower level drivers to issue this command
* with ORDERED tag if tagged queuing is being used. If tagged
* queuing is not in effect for the target, it can be ignored.
*/
VMK_SCSI_COMMAND_FLAGS_ISSUE_WITH_ORDERED_TAG = 0x00010000,
/**
* \brief Command is reservation sensitive.
*
* If a command has the VMK_SCSI_COMMAND_FLAGS_RESERVATION_SENSITIVE
* flag set, the plugin should _not_ retry the IO upon failure.
*/
VMK_SCSI_COMMAND_FLAGS_RESERVATION_SENSITIVE = 0x00008000,
/**
* \brief Command was issued to probe if a device supports it.
*
* This should be treated as hint for plugins to not log if these
* IOs fail with a "not supported" SCSI error status.
*/
VMK_SCSI_COMMAND_FLAGS_PROBE_FOR_SUPPORT = 0x00002000,
/** \brief IO is treated as high priority */
VMK_SCSI_COMMAND_FLAGS_USE_PRIORITY_QUEUE = 0x00001000,
/**
* \brief Fail IO with "no-connect" if device is all-paths-dead.
*
* Instructs an MP Plugin to fail the I/O with a
* VMK_SCSI_HOST_NO_CONNECT host status if it finds that a
* vmk_ScsiDevice is in an all-paths-dead condition.
*
* Normally an MP Plugin should keep retrying the I/O until a path
* becomes available or it receives a task management abort or
* reset request.
*/
VMK_SCSI_COMMAND_FLAGS_NO_CONNECT_IF_APD = 0x00000800,
/**
* \brief Command is issued by a VM that is a guest cluster node.
*
* A Cluster may use SCSI reservation as a mechanism to determine
* node membership. As a result, a VM cluster is particularly
* sensitive to RESERVATION CONFLICT command status.
*
* The MP Plugin must ensure that the VM never sees incorrect
* reservation conflicts - e.g. reservation conflicts that arise
* during failover as paths are switched. Further, it must ensure
* that I/Os are never retried on (correct) reservation
* conflicts. So, the guest should see all genuine reservation
* conflicts from the device (e.g. ones caused by the other nodes
* in the VM cluster), but not any other ones.
*/
VMK_SCSI_COMMAND_FLAGS_VM_CLUSTER = 0x00000400,
} /** \cond nodoc */ VMK_ATTRIBUTE_PACKED VMK_ATTRIBUTE_ALIGN(1) /* \endcond*/
vmk_ScsiCommandFlags;
#define VMK_SCSI_MAX_CDB_LEN 16
#define VMK_SCSI_MAX_SENSE_DATA_LEN 64
/**
* \brief SCSI command structure
*/
typedef struct vmk_ScsiCommand {
/** \brief Command completion callback for async IO. */
vmk_ScsiCommandDoneCbk done;
/** \brief Command completion callback argument for async IO. */
void *doneData;
/**
* \brief Scatter/gather array representing the machine-address ranges
* associated with the IO buffer.
*/
vmk_SgArray *sgArray;
/** \brief Hint indicating the direction of data transfer */
vmk_ScsiCommandDirection dataDirection;
/** \brief Command flags, see above */
vmk_uint32 flags;
/** \brief Hint indicating whether a cmd is a read IO */
vmk_Bool isReadCdb;
/** \brief Hint indicating whether a cmd is a write IO */
vmk_Bool isWriteCdb;
/** \brief Reserved */
vmk_uint8 reserved1[2];
/**
* \brief Minimum data transfer length.
*
* Must be <= vmk_SgGetDataLen(sgArray).
*/
vmk_ByteCountSmall requiredDataLen;
/** \brief WorldId of the world on behalf of whom cmd is issued. */
vmk_uint32 worldId;
/**
* \brief Number of blocks to be transferred.
*
* Only valid for when isReadCdb or isWriteCdb are set.
*/
vmk_uint32 lbc;
/**
* \brief address of first block to be xfer'd
*
* Only valid for isReadCdb or isWriteCdb.
*/
vmk_uint64 lba;
/**
* \brief Number of milliseconds since system boot before
* the command times out.
*
* 0 indicates the cmd will not be timed out.
*
* A nonzero value indicates the system time beyond which the storage
* framework will issue an abort task management request and fail
* the IO with a timeout status.
*/
vmk_uint64 absTimeoutMs;
/** \brief Unique tag for this command. */
vmk_ScsiCommandId cmdId;
/** \brief SCSI command descriptor block. */
vmk_uint8 cdb[VMK_SCSI_MAX_CDB_LEN];
/**
* \brief Number of valid bytes in cdb.
*
* Must be <= VMK_SCSI_MAX_CDB_LEN
*/
vmk_ByteCountSmall cdbLen;
/** \brief Command completion status. */
vmk_ScsiCmdStatus status;
/** \brief Number of bytes transferred to or from the data buffer. */
vmk_ByteCountSmall bytesXferred;
/** \brief Worldlet ID that submitted the command, if any. */
vmk_WorldletID worldletId;
/**
* \brief Scatter/gather array representing the IO-address ranges
* associated with the IO buffer.
*
* \note Sometimes this will be the same as sgArray but other
* times it will be different. Do not rely on the contents
* of sgIOArray and sgArray being identical.
*/
vmk_SgArray *sgIOArray;
/**
* \brief SCSI sense data.
*
* Only valid if vmk_ScsiCmdStatusIsCheck(cmd->status).
*/
vmk_ScsiSenseData senseData;
/** \brief Reserved. */
vmk_VA reserved2[2];
} vmk_ScsiCommand;
/**
* \brief SCSI task management action
*/
typedef enum {
VMK_SCSI_TASKMGMT_ACTION_IGNORE = 0,
VMK_SCSI_TASKMGMT_ACTION_ABORT = 1,
} vmk_ScsiTaskMgmtAction;
/**
* \brief Used to abort all commands, regardless of initiator and s/n
*/
#define VMK_SCSI_TASKMGMT_ANY_INITIATOR (void*)0xA11
/**
* \brief SCSI task management
*/
typedef struct vmk_ScsiTaskMgmt {
/** \brief magic */
vmk_uint32 magic;
/** \brief task mgmt type */
vmk_ScsiTaskMgmtType type;
/** \brief command status */
vmk_ScsiCmdStatus status;
/** \brief cmdId of the cmd to abort. cmdId.serialNumber is only
* applicable for VMK_SCSI_TASKMGMT_ABORT and ignored for all
* other vmk_ScsiTaskMgmtType values. cmdId.initiator is only
* applicable for VMK_SCSI_TASKMGMT_ABORT and
* VMK_SCSI_TASKMGMT_VIRT_RESET, ignored for all other
* vmk_ScsiTaskMgmtType values
*/
vmk_ScsiCommandId cmdId;
/** \brief worldId of the cmd(s) to abort. only applicable for
* VMK_SCSI_TASKMGMT_ABORT and VMK_SCSI_TASKMGMT_VIRT_RESET, ignored
* for all other vmk_ScsiTaskMgmtType values
*/
vmk_uint32 worldId;
} vmk_ScsiTaskMgmt;
/*
* SCSI Adapter
*/
typedef enum vmk_ScanAction {
VMK_SCSI_SCAN_CREATE_PATH,
VMK_SCSI_SCAN_CONFIGURE_PATH,
VMK_SCSI_SCAN_DESTROY_PATH,
} vmk_ScanAction;
/**
* \brief bitmasks for adapter events
*
* Events are bit fields because users can
* wait for multiple events
*
*/
typedef enum vmk_ScsiAdapterEvents {
VMK_SCSI_ADAPTER_EVENT_FC_LOOP_UP = 0x00000001,
VMK_SCSI_ADAPTER_EVENT_FC_LOOP_DOWN = 0x00000002,
VMK_SCSI_ADAPTER_EVENT_FC_RSCN = 0x00000004,
VMK_SCSI_ADAPTER_EVENT_FC_NEW_TARGET = 0x00000008,
VMK_SCSI_ADAPTER_EVENT_FC_REMOVED_TARGET = 0x00000010,
VMK_SCSI_ADAPTER_EVENT_FC_NEW_VPORT = 0x00000020,
VMK_SCSI_ADAPTER_EVENT_FC_REMOVED_VPORT = 0x00000040,
VMK_SCSI_ADAPTER_EVENT_HOT_PLUG_ADD = 0x00000080,
VMK_SCSI_ADAPTER_EVENT_HOT_PLUG_REMOVE = 0x00000100,
VMK_SCSI_ADAPTER_EVENT_FC_TARGET_SCAN_DONE = 0x00000200,
} vmk_ScsiAdapterEvents;
/** \brief Event handler callback entry */
typedef void (*vmk_EventHandlerCbk) (void *clientData, vmk_uint32 eventType);
/**
* \brief bitmasks for flags field of SCSI adapter
*
* Through this flags, give vmkernel information how handle the adapter.
*
*/
typedef enum vmk_ScsiAdapterFlags {
VMK_SCSI_ADAPTER_FLAG_BLOCK = 0x00000001,
/** This adapter is an NPIV VPORT */
VMK_SCSI_ADAPTER_FLAG_NPIV_VPORT = 0x00000002,
/** Do not scan when registering this adapter */
VMK_SCSI_ADAPTER_FLAG_REGISTER_WITHOUT_SCAN = 0x00000004,
/** Do not scan periodically */
VMK_SCSI_ADAPTER_FLAG_NO_PERIODIC_SCAN = 0x00000008,
/** Ok to probe periodically, but no adapter rescan */
VMK_SCSI_ADAPTER_FLAG_NO_ADAPTER_RESCAN = 0x00000010,
/** This adapter is a Legacy NPIV VPORT */
VMK_SCSI_ADAPTER_FLAG_NPIV_LEGACY_VPORT = 0x00000020,
} vmk_ScsiAdapterFlags;
/**
* \brief main data structure for SCSI adapter
*
* The discover() entrypoint passes back a deviceData.
* This deviceData must be able to completely identify
* the channel:target:lun of the device as it's the only
* thing that will be passed back once it's set by the
* discover() entrypoint.
*/
typedef struct vmk_ScsiAdapter {
/** \brief DMA constraints for this adapter. */
vmk_DMAConstraints constraints;
/** \brief Device for this adapter. */
vmk_Device device;
/** \brief max # of blocks per i/o */
int hostMaxSectors;
/** \brief adapter's ->can_queue entrypoint */
vmk_uint32 *qDepthPtr;
/** \brief Issue a SCSI command to the specified device */
VMK_ReturnStatus (*command)(
void *clientData,
struct vmk_ScsiCommand *cmd,
void *deviceData);
/** \brief Issue a SCSI task management */
VMK_ReturnStatus (*taskMgmt)(
void *clientData,
struct vmk_ScsiTaskMgmt *taskMgmt,
void *deviceData);
/** \brief Issue a SCSI command during a core dump */
VMK_ReturnStatus (*dumpCommand)(
void *clientData,
vmk_ScsiCommand *cmd,
void *deviceData);
/** \brief Destroy the adapter */
void (*close)(void *clientData);
/** \brief generate the adapter's proc node information */
VMK_ReturnStatus (*procInfo)(
void* clientData,
char* buf,
vmk_ByteCountSmall offset,
vmk_ByteCountSmall count,
vmk_ByteCountSmall* nbytes,
int isWrite);
/** \brief Log the current adapter queue */
void (*dumpQueue)(void *clientData);
/** \brief Run the adapter's BH, called on the dump device during a PSOD
* Interrupts are disabled and BHs aren't running.
*/
void (*dumpBHHandler)(void *clientData);
/** \brief arg to dumpQueue() */
void *dumpBHHandlerData;
/** \brief driver specific ioctl */
VMK_ReturnStatus (*ioctl)(
void *clientData,
void *deviceData,
vmk_uint32 fileFlags,
vmk_uint32 cmd,
vmk_VA userArgsPtr,
vmk_IoctlCallerSize callerSize,
vmk_int32 *drvErr);
/** \brief discover & destroy a device */
VMK_ReturnStatus (*discover)(
void *clientData,
vmk_ScanAction action,
int channel,
int targetId,
int lunId,
void **deviceData);
/** \brief send NPIV specific commands to a device */
VMK_ReturnStatus (*vportop)(
void *handle,
vmk_uint32 cmd,
void *arg,
vmk_int32 *drvErr);
/** \brief scan a single LUN on a vport */
VMK_ReturnStatus (*vportDiscover)(
void *clientData,
vmk_ScanAction action,
int ctlr,
int devNum,
int lun,
struct vmk_ScsiAdapter **vmkAdapter,
void **deviceData);
/** \brief try changing the path queue depth */
int (*modifyDeviceQueueDepth)(
void *clientData,
int qDepth,
void *deviceData);
/** \brief query the path queue depth */
int (*queryDeviceQueueDepth)(
void *clientData,
void *deviceData);
/** \brief checks if a target exists */
VMK_ReturnStatus (*checkTarget)(
void *clientData,
int channel,
int targetId);
/** \brief SCSI target id of adapter, or -1 if n/a */
int targetId;
/** \brief adapter flags, see vmk_ScsiAdapterFlags above */
vmk_uint32 flags;
/** \brief block data */
int blockData;
/** \brief id of module running this adapter */
vmk_ModuleID moduleID;
/** \brief adapter creator's private convenience scratch data ptr */
void *clientData;
/** \brief # of channels */
int channels;
/** \brief # of targets per channel */
int maxTargets;
/** \brief max # of logical units per target */
int maxLUNs;
/** \brief Unique adapter number. Set by vmk_ScsiAllocateAdapter. */
vmk_uint16 hostNum;
/** \brief adapter support physical address extensions? */
vmk_Bool paeCapable;
/** \brief max len of SCSI cmds adapter can accept */
vmk_uint8 maxCmdLen;
/** \brief adapter name */
vmk_Name name;
/** \brief block device name
* only valid for mgmtAdapter.transport == VMK_STORAGE_ADAPTER_BLOCK
*/
vmk_Name blockDevName;
/** \brief driver name */
vmk_Name driverName;
/** \brief /proc directory */
vmk_Name procName;
/** \brief transport specific mgmtAdapter hooks */
vmk_SCSITransportMgmt mgmtAdapter;
} vmk_ScsiAdapter;
/*
* Physical Path
*/
#define VMK_SCSI_PATH_ANY_ADAPTER "*"
#define VMK_SCSI_PATH_ANY_CHANNEL ~0
#define VMK_SCSI_PATH_ANY_TARGET ~0
#define VMK_SCSI_PATH_ANY_LUN ~0
typedef enum {
VMK_SCSI_PLUGIN_STATE_ENABLED,
VMK_SCSI_PLUGIN_STATE_DISABLING,
VMK_SCSI_PLUGIN_STATE_DISABLED,
VMK_SCSI_PLUGIN_STATE_CLAIM_PATHS,
} vmk_ScsiPluginState;
/**
* \brief Opaque handle for Completion Objects, provided by lower layer.
*/
typedef vmk_AddrCookie vmk_ScsiCompletionHandle;
/**
* \brief Completion Object information passed by the vmkLinux module.
*/
typedef struct vmk_ScsiCompObjectInfo {
/** \brief Completion Object Handle assigned by the lower layer. */
vmk_ScsiCompletionHandle completionHandle;
/** \brief Worldlet - if any - associated with the completion object. */
vmk_Worldlet completionWorldlet;
vmk_uint8 infoPad[8];
} vmk_ScsiCompObjectInfo;
/**
* \brief Format of INQUIRY request block.
* SPC 3 r23, Section 6.4.1 table 80
*/
typedef struct vmk_ScsiInquiryCmd {
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 evpd :1,
/** \brief see above spc section */
cmddt :1,
/** \brief see above spc section */
resv12:3,
/** \brief see above spc section */
lun :3;
/** \brief see above spc section */
vmk_uint8 pagecode;
/** \brief see above spc section */
vmk_uint16 length;
/** \brief see above spc section */
vmk_uint8 ctrl;
} VMK_ATTRIBUTE_PACKED vmk_ScsiInquiryCmd;
/**
* \brief Format of INQUIRY response block.
* SPC 3 r23, Section 6.4.2 table 81
*/
typedef struct vmk_ScsiInquiryResponse {
/** \brief see above spc section */
vmk_uint8 devclass :5,
/** \brief see above spc section */
pqual :3;
#define VMK_SCSI_PQUAL_CONNECTED 0 // device described is connected to the LUN
#define VMK_SCSI_PQUAL_NOTCONNECTED 1 // target supports such a device, but none is connected
#define VMK_SCSI_PQUAL_NODEVICE 3 // target does not support a physical device for this LUN
/** \brief see above spc section */
vmk_uint8 :7,
/** \brief see above spc section */
rmb:1;
/** \brief see above spc section */
vmk_uint8 ansi :3,
#define VMK_SCSI_ANSI_SCSI1 0x0 // device supports SCSI-1
#define VMK_SCSI_ANSI_CCS 0x1 // device supports the CCS
#define VMK_SCSI_ANSI_SCSI2 0x2 // device supports SCSI-2
#define VMK_SCSI_ANSI_SCSI3_SPC 0x3 // device supports SCSI-3 version SPC
#define VMK_SCSI_ANSI_SCSI3_SPC2 0x4 // device supports SCSI-3 version SPC-2
#define VMK_SCSI_ANSI_SCSI3_SPC3 0x5 // device supports SCSI-3 version SPC-3
#define VMK_SCSI_ANSI_SCSI3_SPC4 0x6 // device supports SCSI-3 version SPC-4
/** \brief see above spc section */
ecma :3,
/** \brief see above spc section */
iso :2;
/** \brief see above spc section */
vmk_uint8 dataformat :4,
/** \brief see above spc section */
:1,
/** \brief see above spc section */
naca :1,
/** \brief see above spc section */
tio :1,
/** \brief see above spc section */
aen :1;
/** \brief see above spc section */
vmk_uint8 optlen;
/** \brief see above spc section */
vmk_uint8 protect :1,
/** \brief see above spc section */
rsrv :2,
/** \brief see above spc section */
tpcp :1,
/** \brief see above spc section */
tpgs :2,
/** \brief see above spc section */
acc :1,
/** \brief see above spc section */
sccs :1;
#define VMK_SCSI_TPGS_NONE 0x0
#define VMK_SCSI_TPGS_IMPLICIT_ONLY 0x1
#define VMK_SCSI_TPGS_IMPLICIT VMK_SCSI_TPGS_IMPLICIT_ONLY
#define VMK_SCSI_TPGS_EXPLICIT_ONLY 0x2
#define VMK_SCSI_TPGS_EXPLICIT VMK_SCSI_TPGS_EXPLICIT_ONLY
#define VMK_SCSI_TPGS_BOTH_IMPLICIT_AND_EXPLICIT 0x3
#define VMK_SCSI_TPGS_BOTH VMK_SCSI_TPGS_BOTH_IMPLICIT_AND_EXPLICIT
/** \brief see above spc section */
vmk_uint8 adr16 :1,
/** \brief see above spc section */
adr32 :1,
/** \brief see above spc section */
arq :1,
/** \brief see above spc section */
mchngr :1,
/** \brief see above spc section */
dualp :1,
/** \brief see above spc section */
port :1,
/** \brief see above spc section */
:2;
/** \brief see above spc section */
vmk_uint8 sftr :1,
/** \brief see above spc section */
que :1,
/** \brief see above spc section */
trndis :1,
/** \brief see above spc section */
link :1,
/** \brief see above spc section */
sync :1,
/** \brief see above spc section */
w16 :1,
/** \brief see above spc section */
w32 :1,
/** \brief see above spc section */
rel :1;
/** \brief see above spc section */
vmk_uint8 manufacturer[8];
/** \brief see above spc section */
vmk_uint8 product[16];
/** \brief see above spc section */
vmk_uint8 revision[4];
/** \brief see above spc section */
vmk_uint8 vendor1[20];
/** \brief see above spc section */
vmk_uint8 reserved[40];
} vmk_ScsiInquiryResponse;
#define VMK_SCSI_STANDARD_INQUIRY_MIN_LENGTH 36
/**
* \brief Format of INQUIRY EVPD responses
* SPC 3 r23, Section 7.6
*/
typedef struct vmk_ScsiInquiryVPDResponse {
/** \brief see above spc section */
vmk_uint8 devclass :5,
/** \brief see above spc section */
pqual :3;
/** \brief see above spc section */
vmk_uint8 pageCode;
/** \brief see above spc section */
vmk_uint8 reserved;
/** \brief see above spc section */
vmk_uint8 payloadLen;
/** \brief see above spc section */
vmk_uint8 payload[0];
} VMK_ATTRIBUTE_PACKED VMK_ATTRIBUTE_ALIGN(1) vmk_ScsiInquiryVPDResponse;
/*
* \brief Format of INQUIRY EVPD Page 83 response
* SPC 3 r23, Section 7.6.3.1 table 294
*/
typedef struct vmk_ScsiInquiryVPD83Response {
/** \brief see above spc section */
vmk_uint8 devclass :5,
/** \brief see above spc section */
pqual :3;
/** \brief see above spc section */
vmk_uint8 pageCode;
/** \brief see above spc section */
vmk_uint16 payloadLen;
/** \brief see above spc section */
vmk_uint8 payload[0];
} VMK_ATTRIBUTE_PACKED VMK_ATTRIBUTE_ALIGN(1) vmk_ScsiInquiryVPD83Response;
/*
* \brief Format of INQUIRY EVPD Page 83 response id descriptor
* SPC 3 r23, Section 7.6.3.1 table 295
*/
typedef struct vmk_ScsiInquiryVPD83IdDesc {
/** \brief see above spc section */
vmk_uint8 codeSet :4,
/** \brief see above spc section */
protocolId :4;
#define VMK_SCSI_EVPD83_ID_VENDOR (0x0)
#define VMK_SCSI_EVPD83_ID_T10 (0x1)
#define VMK_SCSI_EVPD83_ID_EUI (0x2)
#define VMK_SCSI_EVPD83_ID_NAA (0x3)
#define VMK_SCSI_EVPD83_ID_RTP (0x4)
#define VMK_SCSI_EVPD83_ID_TPG (0x5)
#define VMK_SCSI_EVPD83_ID_LUG (0x6)
#define VMK_SCSI_EVPD83_ID_MD5 (0x7)
#define VMK_SCSI_EVPD83_ID_SCSINAME (0x8)
/** \brief see above spc section */
vmk_uint8 idType :4,
#define VMK_SCSI_EVPD83_ASSOCIATION_LU (0x0)
#define VMK_SCSI_EVPD83_ASSOCIATION_PORT (0x1)
#define VMK_SCSI_EVPD83_ASSOCIATION_DEV (0x2)
/** \brief see above spc section */
association :2,
/** \brief see above spc section */
reserved1 :1,
/** \brief see above spc section */
piv :1;
/** \brief see above spc section */
vmk_uint8 reserved2;
/** \brief see above spc section */
vmk_uint8 idLen;
/** \brief see above spc section */
vmk_uint8 id[0];
} VMK_ATTRIBUTE_PACKED VMK_ATTRIBUTE_ALIGN(1) vmk_ScsiInquiryVPD83IdDesc;
#define VMK_SCSI_EVPD83_NAA_EXTENDED (0x2)
#define VMK_SCSI_EVPD83_NAA_REGISTERED (0x5)
#define VMK_SCSI_EVPD83_NAA_REG_EXT (0x6)
/**
* \brief NAA IEEE Registered Extended identification field foramt
* SPC 3 r23:
* Section 7.6.3.6.4 table 309.
*/
typedef struct vmk_ScsiNAARegExtendedIdField {
vmk_uint8 companyIdMSB :4,
NAA :4;
vmk_uint16 companyIdMiddleBytes;
vmk_uint8 vendorSpecIdMSB :4,
companyIdLSB :4;
vmk_uint32 vendorSpecIdLSB;
vmk_uint64 vendorSpecIdExt;
} __attribute__((packed,aligned(1))) vmk_ScsiNAARegExtendedIdField;
/**
* \brief Format of the 6 byte version of MODE SELECT
* SPC 3 r23, Section 6.9.1 table 97
*/
typedef struct vmk_ScsiModeSenseCmd {
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 :3,
/** \brief see above spc section */
dbd :1,
:1,
/** \brief see above spc section */
lun :3;
/** \brief see above spc section */
vmk_uint8 page :6,
#define VMK_SCSI_MS_PAGE_VENDOR 0x00 // vendor-specific (ALL)
#define VMK_SCSI_MS_PAGE_RWERROR 0x01 // read/write error (DISK/TAPE/CDROM/OPTICAL)
#define VMK_SCSI_MS_PAGE_CONNECT 0x02 // disconnect/connect (ALL)
#define VMK_SCSI_MS_PAGE_FORMAT 0x03 // format (DISK)
#define VMK_SCSI_MS_PAGE_PARALLEL 0x03 // parallel interface (PRINTER)
#define VMK_SCSI_MS_PAGE_UNITS 0x03 // measurement units (SCANNER)
#define VMK_SCSI_MS_PAGE_GEOMETRY 0x04 // rigid disk geometry (DISK)
#define VMK_SCSI_MS_PAGE_SERIAL 0x04 // serial interface (PRINTER)
#define VMK_SCSI_MS_PAGE_FLEXIBLE 0x05 // flexible disk geometry (DISK)
#define VMK_SCSI_MS_PAGE_PRINTER 0x05 // printer operations (PRINTER)
#define VMK_SCSI_MS_PAGE_OPTICAL 0x06 // optical memory (OPTICAL)
#define VMK_SCSI_MS_PAGE_VERIFY 0x07 // verification error (DISK/CDROM/OPTICAL)
#define VMK_SCSI_MS_PAGE_CACHE 0x08 // cache (DISK/CDROM/OPTICAL)
#define VMK_SCSI_MS_PAGE_PERIPH 0x09 // peripheral device (ALL)
#define VMK_SCSI_MS_PAGE_CONTROL 0x0a // control mode (ALL)
#define VMK_SCSI_MS_PAGE_MEDIUM 0x0b // medium type (DISK/CDROM/OPTICAL)
#define VMK_SCSI_MS_PAGE_NOTCH 0x0c // notch partitions (DISK)
#define VMK_SCSI_MS_PAGE_CDROM 0x0d // CD-ROM (CDROM)
#define VMK_SCSI_MS_PAGE_CDAUDIO 0x0e // CD-ROM audio (CDROM)
#define VMK_SCSI_MS_PAGE_COMPRESS 0x0f // data compression (TAPE)
#define VMK_SCSI_MS_PAGE_CONFIG 0x10 // device configuration (TAPE)
#define VMK_SCSI_MS_PAGE_EXCEPT 0x1c // informal exception (ALL:SCSI-3)
#define VMK_SCSI_MS_PAGE_CDCAPS 0x2a // CD-ROM capabilities and mechanical status (CDROM)
// more defined...
#define VMK_SCSI_MS_PAGE_ALL 0x3f // all available pages (ALL)
/** \brief see above spc section */
pcf :2;
#define VMK_SCSI_MS_PCF_CURRENT 0x00 // current values
#define VMK_SCSI_MS_PCF_VOLATILE 0x01 // changeable values
#define VMK_SCSI_MS_PCF_DEFAULT 0x02 // default values
#define VMK_SCSI_MS_PCF_SAVED 0x03 // saved values
/** \brief see above spc section */
vmk_uint8 subpage;
/** \brief see above spc section */
vmk_uint8 length;
/** \brief see above spc section */
vmk_uint8 ctrl;
} vmk_ScsiModeSenseCmd;
/**
* \brief Format of READ_CAPACITY(10) response block.
* SBC 2 r16, section 5.10.1 table 34
*/
typedef struct {
/** \brief see above sbc section */
vmk_uint32 lbn;
/** \brief see above sbc section */
vmk_uint32 blocksize;
} vmk_ScsiReadCapacityResponse;
/*
* Format of REPORT TARGET PORT GROUPS request and response blocks.
*/
/**
* \brief target port group command for SCSI report
* SPC 3 r23, section 6.25 table 162
*/
typedef struct vmk_ScsiReportTargetPortGroupsCmd {
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 svc:5,
#define VMK_SCSI_RTPGC_SVC 0xA
/** \brief see above spc section */
res1:3;
/** \brief see above spc section */
vmk_uint8 reserved1[4];
/** \brief see above spc section */
vmk_uint32 length;
/** \brief see above spc section */
vmk_uint8 reserved2;
/** \brief see above spc section */
vmk_uint8 ctrl;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReportTargetPortGroupsCmd;
/**
* \brief target port group response for SCSI report
* SPC 3 r23, section 6.25 table 163
*/
typedef struct vmk_ScsiReportTargetPortGroupsResponse {
/** \brief see above spc section */
vmk_uint32 length;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReportTargetPortGroupsResponse;
/**
* \brief target port group descriptor for SCSI report
* SPC 3 r23, section 6.25 table 164
*/
typedef struct vmk_ScsiReportTargetPortGroupDescriptor {
/** \brief see above spc section */
vmk_uint8 aas:4,
/** \brief see above spc section */
res1:3,
/** \brief see above spc section */
pref:1;
#define VMK_SCSI_TPGD_AAS_AO 0x00 //!< active/optimized
#define VMK_SCSI_TPGD_AAS_ANO 0x01 //!< active/nonoptomized
#define VMK_SCSI_TPGD_AAS_STBY 0x02 //!< standby
#define VMK_SCSI_TPGD_AAS_UNAVAIL 0x03 //!< unavailable
#define VMK_SCSI_TPGD_AAS_TRANS 0x0F //!< transitioning
/** \brief see above spc section */
vmk_uint8 aosup:1,
/** \brief see above spc section */
ansup:1,
/** \brief see above spc section */
ssup:1,
/** \brief see above spc section */
usup:1,
/** \brief see above spc section */
res2:3,
/** \brief see above spc section */
tsup:1;
/** \brief see above spc section */
vmk_uint16 targetPortGroup;
/** \brief see above spc section */
vmk_uint8 reserved1;
#define VMK_SCSI_TPGD_STAT_NONE 0x00 //!< no status available
#define VMK_SCSI_TPGD_STAT_EXP 0x01 //!< state altered by SET command
#define VMK_SCSI_TPGD_STAT_IMP 0x02 //!< state altered by implicit behavior
/** \brief see above spc section */
vmk_uint8 status;
/** \brief see above spc section */
vmk_uint8 vendorSpec;
/** \brief see above spc section */
vmk_uint8 targetPortCount;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReportTargetPortGroupDescriptor;
/**
* \brief SCSI target port descriptor format
* SPC 3 r23, section 6.25 table 167
*/
typedef struct vmk_ScsiReportTargetPortDescriptor {
/** \brief see above spc section */
vmk_uint16 obsolete;
/** \brief see above spc section */
vmk_uint16 relativeTargetPortId;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReportTargetPortDescriptor;
/**
* \brief set target port groups command
* SPC 3 r23, Section 6.31 table 178
*/
typedef struct vmk_ScsiSetTargetPortGroupsCmd{
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 svc:5,
#define VMK_SCSI_STPGC_SVC 0xA
/** \brief see above spc section */
res1:3;
/** \brief see above spc section */
vmk_uint8 reserved1[4];
/** \brief see above spc section */
vmk_uint32 length;
/** \brief see above spc section */
vmk_uint8 reserved2;
/** \brief see above spc section */
vmk_uint8 ctrl;
} VMK_ATTRIBUTE_PACKED vmk_ScsiSetTargetPortGroupsCmd;
#define SCSI_STPG_PARAM_LIST_OFFSET 4
/**
* \brief set target port group descriptor
* SPC 3 r23, Section 6.31 table 180
*/
typedef struct vmk_ScsiSetTargetPortGroupDescriptor{
/** \brief see above spc section */
vmk_uint8 aas:4,
/** \brief see above spc section */
res1:4;
/** \brief see above spc section */
vmk_uint8 reserved1;
/** \brief see above spc section */
vmk_uint16 targetPortGroup;
} VMK_ATTRIBUTE_PACKED vmk_ScsiSetTargetPortGroupDescriptor;
/**
* \brief parameter header of module sense for SCSI
* SPC 3 r23, Section 7.4.3 table 239
*/
typedef struct vmk_Scsi4ByteModeSenseParameterHeader {
/** \brief see above spc section */
vmk_uint8 modeDataLength;
/** \brief see above spc section */
vmk_uint8 mediumType;
/** \brief see above spc section */
vmk_uint8 reserved1:4,
/** \brief see above spc section */
dpofua:1,
/** \brief see above spc section */
reserved2:2,
/** \brief see above spc section */
wp:1;
/** \brief see above spc section */
vmk_uint8 blockDescriptorLength;
} VMK_ATTRIBUTE_PACKED vmk_Scsi4ByteModeSenseParameterHeader;
/**
* \brief block descriptor for SCSI mode sense
* SPC 3 r23, Section 7.4.4.1 table 241
*/
typedef struct vmk_ScsiModeSenseBlockDescriptor {
/** \brief see above spc section */
vmk_uint8 densityCode;
/** \brief see above spc section */
vmk_uint8 numberOfBlocks[3];
/** \brief see above spc section */
vmk_uint8 reserved1;
/** \brief see above spc section */
vmk_uint8 blockLength[3];
} VMK_ATTRIBUTE_PACKED vmk_ScsiModeSenseBlockDescriptor;
/**
* \brief Format of READ/WRITE (6) request.
* SBC 2 r16, Section 5.5 table 26 & 5.24 table 61
*/
typedef struct vmk_ScsiReadWrite6Cmd {
/** \brief see above sbc section */
vmk_uint32 opcode:8,
/** \brief see above sbc section */
lun:3,
/** \brief see above sbc section */
lbn:21;
/** \brief see above sbc section */
vmk_uint8 length;
/** \brief see above sbc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadWrite6Cmd;
/**
* \brief Format of READ/WRITE (10) request.
* SBC 2 r16, Section 5.6 table 28 & 5.25 table 62
*/
typedef struct vmk_ScsiReadWrite10Cmd {
/** \brief see above sbc section */
vmk_uint8 opcode;
/** \brief see above sbc section */
vmk_uint8 rel :1,
:2,
/** \brief see above sbc section */
flua :1,
/** \brief see above sbc section */
dpo :1,
/** \brief see above sbc section */
lun :3;
/** \brief see above sbc section */
vmk_uint32 lbn;
/** \brief see above sbc section */
vmk_uint8 reserved;
/** \brief see above sbc section */
vmk_uint16 length;
/** \brief see above sbc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadWrite10Cmd;
/**
* \brief Format of READ/WRITE (12) request.
* SBC 2 r16, Section 5.7 table 31 & 5.26 table 65
*/
typedef struct vmk_ScsiReadWrite12Cmd {
/** \brief see above sbc section */
vmk_uint8 opcode;
/** \brief see above sbc section */
vmk_uint8 rel :1,
:2,
/** \brief see above sbc section */
flua :1,
/** \brief see above sbc section */
dpo :1,
/** \brief see above sbc section */
lun :3;
/** \brief see above sbc section */
vmk_uint32 lbn;
/** \brief see above sbc section */
vmk_uint32 length;
/** \brief see above sbc section */
vmk_uint8 reserved;
/** \brief see above sbc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadWrite12Cmd;
/**
* \brief Format of READ/WRITE (16) request.
* SBC 2 r16, Section 5.8 table 32 & 5.27 table 66
*/
typedef struct vmk_ScsiReadWrite16Cmd {
/** \brief see above sbc section */
vmk_uint8 opcode;
/** \brief see above sbc section */
vmk_uint8 rel :1,
:2,
/** \brief see above sbc section */
flua :1,
/** \brief see above sbc section */
dpo :1,
:3;
/** \brief see above sbc section */
vmk_uint64 lbn;
/** \brief see above sbc section */
vmk_uint32 length;
/** \brief see above sbc section */
vmk_uint8 reserved;
/** \brief see above sbc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadWrite16Cmd;
/**
* \brief Scsi page types for inquiry data
*/
typedef enum {
VMK_SCSI_INQ_TYPE_STD = 1,
VMK_SCSI_INQ_TYPE_EVPD80 = 2,
VMK_SCSI_INQ_TYPE_EVPD83 = 3,
} vmk_ScsiInqType;
/**
* \brief Persistent Reserve Out Command
* SPC 3 r23, Section 6.12.1 (Table 112)
*/
typedef struct vmk_ScsiPersistentReserveOutCmd {
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 serviceAction :5,
/** \brief see above spc section */
reserved :3;
/** \brief see above spc section */
vmk_uint8 type :4,
/** \brief see above spc section */
scope :4;
/** \brief see above spc section */
vmk_uint8 reserved1[2];
/** \brief see above spc section */
vmk_uint32 parameterListLength;
/** \brief see above spc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiPersistentReserveOutCmd;
/**
* \brief Persistent Reserve Out parameter List.
* SPC 3 r23, Section 6.12.3 (Table 114)
*/
typedef struct vmk_ScsiPersistentReserveOutPList {
/** \brief see above spc section */
vmk_uint64 reservationKey;
/** \brief see above spc section */
vmk_uint64 serviceActionResKey;
/** \brief see above spc section */
vmk_uint8 obsolete1[4];
/** \brief see above spc section */
vmk_uint8 aptpl :1,
/** \brief see above spc section */
reserved1 :1,
/** \brief see above spc section */
all_tg_pt :1,
/** \brief see above spc section */
spec_i_pt :1,
/** \brief see above spc section */
reserved2 :4;
/** \brief see above spc section */
vmk_uint8 reserved3;
/** \brief see above spc section */
vmk_uint8 obsolete2[2];
} VMK_ATTRIBUTE_PACKED vmk_ScsiPersistentReserveOutPList;
/**
* \brief Persistent Reserve In Command
* SPC 3 r23, Section 6.11.1 (Table 101)
*/
typedef struct vmk_ScsiPersistentReserveInCmd {
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 serviceAction :5,
/** \brief see above spc section */
reserved :3;
/** \brief see above spc section */
vmk_uint8 reserved1[5];
/** \brief see above spc section */
vmk_uint16 allocationLength;
/** \brief see above spc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiPersistentReserveInCmd;
/**
* \brief Persistent read reservation response
* SPC 3 r23, Section 6.11.3.4 (Table 105)
*/
typedef struct vmk_ScsiReadReservationResp {
/** \brief see above spc section */
vmk_uint32 prGeneration;
/** \brief see above spc section */
vmk_uint32 additionalLength;
/** \brief see above spc section */
vmk_uint64 reservationKey;
/** \brief see above spc section */
vmk_uint8 obsolete[4];
/** \brief see above spc section */
vmk_uint8 reserved;
/** \brief see above spc section */
vmk_uint8 type :4,
/** \brief see above spc section */
scope :4;
/** \brief see above spc section */
vmk_uint8 obsolete1[2];
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadReservationResp;
/**
* \brief Extended copy (XCOPY) command
* SPC 3 r23, Section 6.3.1 table 50
*/
typedef struct vmk_ScsiExtendedCopyCmd {
/** \brief see above spc section */
vmk_uint8 opcode;
/** \brief see above spc section */
vmk_uint8 reserved1[9];
/** \brief see above spc section */
vmk_uint32 parameterListLength;
/** \brief see above spc section */
vmk_uint8 reserved2;
/** \brief see above spc section */
vmk_uint8 control;
} __attribute__ ((packed)) vmk_ScsiExtendedCopyCmd;
/**
* \brief Extended copy parameter list header
* SPC 3 r23, Section 6.3.1 table 51
*/
typedef struct vmk_ScsiExtendedCopyParamListHeader {
/** \brief see above spc section */
vmk_uint8 listID;
/** \brief see above spc section */
vmk_uint8 priority:3,
/** \brief see above spc section */
reserved1:1,
/** \brief see above spc section */
NRCR:1,
/** \brief see above spc section */
STR:1,
/** \brief see above spc section */
reserved2:2;
/** \brief see above spc section */
vmk_uint16 targetDescriptorListLength;
/** \brief see above spc section */
vmk_uint8 reserved3[4];
/** \brief see above spc section */
vmk_uint32 segmentDescriptorListLength;
/** \brief see above spc section */
vmk_uint32 inlineDataLength;
} __attribute__ ((packed,aligned(1))) vmk_ScsiExtendedCopyParamListHeader;
/**
* \brief Identification descriptor target
* descriptor for the extended copy command
* SPC 3 r23, Section 6.3.6.2 table 56
*/
typedef struct vmk_ScsiIdDescriptorTargetDescriptor {
/** \brief see above spc section */
vmk_uint8 descTypeCode;
/** \brief see above spc section */
vmk_uint8 peripheralDeviceType:5,
/** \brief see above spc section */
nul:1,
/** \brief see above spc section */
luIdType:2;
/** \brief see above spc section */
vmk_uint16 relativeInitiatorPortId;
/** \brief see above spc section */
vmk_uint8 codeSet :4,
/** \brief see above spc section */
reserved1 :4;
/** \brief see above spc section */
vmk_uint8 idType :4,
/** \brief see above spc section */
association :2,
/** \brief see above spc section */
reserved2 :2;
/** \brief see above spc section */
vmk_uint8 reserved3;
/** \brief see above spc section */
vmk_uint8 idLen;
/** \brief see above spc section */
vmk_uint8 varLenId[20];
/** \brief see above spc section */
vmk_uint8 devTypeSpecParams[4];
} __attribute__ ((packed,aligned(1))) vmk_ScsiIdDescriptorTargetDescriptor;
/**
* \brief Device type specific target descriptor parameters for block
* device types, for the extended copy command
* SPC 3 r23, Section 6.3.6.4 table 58
*/
typedef struct vmk_ScsiBlockDeviceSpecTargetDescParams {
/** \brief see above spc section */
vmk_uint8 reserved1:2;
/** \brief see above spc section */
vmk_uint8 PAD:1;
/** \brief see above spc section */
vmk_uint8 reserved2:5;
/** \brief see above spc section */
vmk_uint8 blockSize[3];
} __attribute__ ((packed,aligned(1))) vmk_ScsiBlockDeviceSpecTargetDescParams;
/**
* \brief Block device to block device segment descriptor
* for the extended copy command
* SPC 3 r23, Section 6.3.7.5 table 66
*/
typedef struct vmk_ScsiBlockToBlockSegmentDescriptor {
/** \brief see above spc section */
vmk_uint8 descriptorTypeCode;
/** \brief see above spc section */
vmk_uint8 CAT:1,
/** \brief see above spc section */
DC:1,
/** \brief see above spc section */
reserved1:6;
/** \brief see above spc section */
vmk_uint16 descriptorLength;
/** \brief see above spc section */
vmk_uint16 srcTargetDescriptorIndex;
/** \brief see above spc section */
vmk_uint16 dstTargetDescriptorIndex;
/** \brief see above spc section */
vmk_uint8 reserved2[2];
/** \brief see above spc section */
vmk_uint16 numBlocks;
/** \brief see above spc section */
vmk_uint64 srcLBA;
/** \brief see above spc section */
vmk_uint64 dstLBA;
} __attribute__ ((packed,aligned(1))) vmk_ScsiBlockToBlockSegmentDescriptor;
/**
* \brief Format of REQUEST SENSE block.
* SPC 3 r23, Section 6.27 table 170
*/
typedef struct vmk_ScsiRequestSenseCommand {
/** \brief Operation Code (03h) */
vmk_uint8 opcode;
/** \brief DESC */
vmk_uint8 desc:1,
/** \brief Reserved */
resv1:4,
/** \brief Reserved in SPC3R23, and ignored */
lun:3;
/** \brief Reserved */
vmk_uint8 resv2;
/** \brief Reserved */
vmk_uint8 resv3;
/** \brief Allocation Length */
vmk_uint8 len;
/** \brief Control */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiRequestSenseCommand;
/**
* \brief Format of MODE SELECT block.
* SPC 3 r23, Section 6.7 table 94
*/
typedef struct vmk_ScsiModeSelectCommand {
/** \brief Operation Code (15h) */
vmk_uint8 opcode;
/** \brief Save Pages */
vmk_uint8 sp:1,
/** \brief Reserved */
resv11:3,
/** \brief Page Format */
pf:1,
/** \brief Actually, reserved */
lun:3;
/** \brief Reserved */
vmk_uint8 resv2;
/** \brief Reserved */
vmk_uint8 resv3;
/** \brief Allocation Length */
vmk_uint8 len;
/** \brief Control */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiModeSelectCommand;
/**
* \brief Format of REPORT LUNS block.
* SPC 3 r23, Section 6.21 table 147
*/
typedef struct vmk_ScsiReportLunsCommand {
/** \brief Operation Code (A0h) */
vmk_uint8 opcode;
/** \brief Reserved */
vmk_uint8 resv1;
/** \brief SELECT REPORT */
vmk_uint8 selectReport;
/** \brief Reserved */
vmk_uint8 resv2;
/** \brief Reserved */
vmk_uint8 resv3;
/** \brief Reserved */
vmk_uint8 resv4;
/** \brief Allocation Length */
vmk_uint32 len;
/** \brief Reserved */
vmk_uint8 resv5;
/** \brief Control */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReportLunsCommand;
/**
* \brief Format of READ CAPACITY 10 byte block.
* SBC 3 r18, Section 5.12.1 table 45
*/
typedef struct vmk_ScsiReadCap10Command {
/** \brief Operation Code (25h) */
vmk_uint8 opcode;
/** \brief Obsolete */
vmk_uint8 obs:1,
resv1:7;
/** \brief Logical Block Address */
vmk_uint32 lba;
vmk_uint8 resv2;
vmk_uint8 resv3;
/** \brief PMI */
vmk_uint8 pmi:1,
resv4:7;
/** \brief Control */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadCap10Command;
/**
* \brief Format of READ CAPACITY 16 byte block.
* SBC 3 r18, Section 5.13.1 table 47
*/
typedef struct vmk_ScsiReadCap16Command {
/** \brief Operation Code (9eh) */
vmk_uint8 opcode;
/** \brief Service Action (10h) */
vmk_uint8 sa:5,
resv1:3;
/** \brief Logical Block Address */
vmk_uint64 lba;
/** \brief Allocation Length */
vmk_uint32 len;
vmk_uint8 pmi:1,
resv2:7;
/** \brief Control */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadCap16Command;
/**
* \brief Format of READ BUFFER block.
* SPC 3 r23, Section 6.15 table 126
*/
typedef struct vmk_ScsiReadBufferCommand {
/** \brief Operation Code (3Ch) */
vmk_uint8 opcode;
/** \brief Mode */
vmk_uint8 mode:5,
/** \brief Reserved */
resv1:3;
/** \brief BUFFER ID */
vmk_uint8 bufferId;
/** \brief BUFFER OFFSET - MSB */
vmk_uint8 msbbo;
/** \brief BUFFER OFFSET - MID */
vmk_uint8 midbo;
/** \brief BUFFER OFFSET - LSB */
vmk_uint8 lsbbo;
/** \brief Allocation Length MSB */
vmk_uint8 msblen;
/** \brief Allocation Length MID */
vmk_uint8 midlen;
/** \brief Allocation Length LSB */
vmk_uint8 lsblen;
/** \brief Control */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiReadBufferCommand;
/**
* \brief WRITE LONG (16) Command
* SBC 2 r16, Secion 5.34 table 73
*/
typedef struct vmk_ScsiWriteLong16 {
/** \brief Operation Code (9fh) */
vmk_uint8 opcode;
/** \brief service action (11h) */
vmk_uint8 serviceAction :5,
/** \brief reserved */
reserved1 :3;
/** \brief see above sbc section */
vmk_uint64 lba;
/** \brief see above sbc section */
vmk_uint8 reserved2[2];
/** \brief see above sbc section */
vmk_uint16 transferLength;
/** \brief see above sbc section */
vmk_uint8 corrct : 1,
reserved3 : 7;
/** \brief see above sbc section */
vmk_uint8 control;
} VMK_ATTRIBUTE_PACKED vmk_ScsiWriteLong16;
#endif /* _VMKAPI_SCSI_TYPES_H_ */
/** @} */
/** @} */
|