Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

testing

Try a 16bit pass-through command if the 12bit version fails. Haven't
seen any cases in which this actually happens so for the time being it
does not make any difference
  • Loading branch information...
commit 1a2790a20104cccd4820de6ee12afc58ad81e8ae 1 parent 35b98ee
RJVB authored
View
4 Resources/postinstall.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-chmod -R go-w /System/Library/Extensions/SATSMARTDriver.kext
-chmod -R go-w /System/Library/Extensions/SATSMARTLib.plugin
+chmod -R go-w /System/Library/Extensions/SATSMARTDriver.kext /System/Library/Extensions/SATSMARTLib.plugin
+chown -R root:wheel /System/Library/Extensions/SATSMARTDriver.kext /System/Library/Extensions/SATSMARTLib.plugin
View
3  Resources/preinstall.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+kextunload -v -b org.dungeon.driver.SATSMARTDriver
+exit 0
View
BIN  SATSMARTDriver-0.41.dmg
Binary file not shown
View
2  SATSMARTDriver.pmdoc/01root-contents.xml
@@ -1 +1 @@
-<pkg-contents spec="1.12"/>
+<pkg-contents spec="1.12"><f n="Root" o="bertin" g="bertin" p="16877" pt="/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/Root" m="false" t="file"><f n="System" o="bertin" g="bertin" p="16877"><f n="Library" o="bertin" g="bertin" p="16877"><f n="Extensions" o="bertin" g="bertin" p="16877"><f n="SATSMARTDriver.kext" o="bertin" g="bertin" p="16877"><f n="Contents" o="bertin" g="bertin" p="16877"><f n="Info.plist" o="bertin" g="bertin" p="33188"/><f n="MacOS" o="bertin" g="bertin" p="16877"><f n="SATSMARTDriver" o="bertin" g="bertin" p="33188"/></f><f n="Resources" o="bertin" g="bertin" p="16877"><f n="English.lproj" o="bertin" g="bertin" p="16877"><f n="InfoPlist.strings" o="bertin" g="bertin" p="33188"/></f></f></f></f><f n="SATSMARTLib.plugin" o="bertin" g="bertin" p="16877"><f n="Contents" o="bertin" g="bertin" p="16877"><f n="Info.plist" o="bertin" g="bertin" p="33188"/><f n="MacOS" o="bertin" g="bertin" p="16877"><f n="SATSMARTLib" o="bertin" g="bertin" p="33261"/></f></f></f></f></f></f></f></pkg-contents>
View
2  SATSMARTDriver.pmdoc/01root.xml
@@ -1 +1 @@
-<pkgref spec="1.12" uuid="8F0C944E-6009-492E-955D-09141AF5DAFE"><config><identifier>org.dungeon.satsmartdriver.Root.pkg</identifier><version>1.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">Root</installFrom><installTo>/</installTo><flags><followSymbolicLinks/><updateInstalledLanguagesOnly/><mod>updateInstalledLanguagesOnly</mod></flags><packageStore type="internal"></packageStore><mod>installFrom.isRelativeType</mod><mod>version</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>scripts.postinstall.isRelativeType</mod><mod>parent</mod><mod>installTo</mod></config><scripts><postinstall relative="true" mod="true">Resources/postinstall.sh</postinstall><scripts-dir relative="true" mod="true">Resources</scripts-dir></scripts><contents><component id="org.dungeon.driver.SATSMARTDriver" path="/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/Root/System/Library/Extensions/SATSMARTDriver.kext" version="1.1"/><component id="org.dungeon.driver.SATSMARTLib" path="/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/Root/System/Library/Extensions/SATSMARTLib.plugin" version="1"/><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
+<pkgref spec="1.12" uuid="8F0C944E-6009-492E-955D-09141AF5DAFE"><config><identifier>org.dungeon.satsmartdriver.Root.pkg</identifier><version>1.1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">Root</installFrom><installTo>/</installTo><flags><followSymbolicLinks/><updateInstalledLanguagesOnly/><mod>updateInstalledLanguagesOnly</mod></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>scripts.scriptsDirectoryPath.path</mod><mod>scripts.preinstall.isRelativeType</mod><mod>parent</mod><mod>version</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod></config><scripts><preinstall relative="true" mod="true">Resources/preinstall.sh</preinstall><postinstall relative="true" mod="true">Resources/postinstall.sh</postinstall><scripts-dir relative="true" mod="true">Resources</scripts-dir></scripts><contents><file-list>01root-contents.xml</file-list><component id="org.dungeon.driver.SATSMARTDriver" path="/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/Root/System/Library/Extensions/SATSMARTDriver.kext" version="1.1"/><component id="org.dungeon.driver.SATSMARTLib" path="/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/Root/System/Library/Extensions/SATSMARTLib.plugin" version="1"/><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
View
2  SATSMARTDriver.pmdoc/index.xml
@@ -1,4 +1,4 @@
-<pkmkdoc spec="1.12"><properties><title>SATSMARTDriver</title><build>/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/SATSMARTDriver.pkg</build><organization>org.dungeon</organization><userSees ui="easy"/><min-target os="3"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="Root" id="choice10" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.dungeon.satsmartdriver.Root.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+<pkmkdoc spec="1.12"><properties><title>SATSMARTDriver</title><build>/Volumes/Debian/Users/bertin/work/src/MacOSX/OS-X-SAT-SMART-Driver/SATSMARTDriver.pkg</build><organization>org.dungeon</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="Root" id="choice10" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.dungeon.satsmartdriver.Root.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fnil\fcharset0 NovareseITCbyBT-Book;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
View
109 SATSMARTDriver/IOSATDriver.cpp
@@ -258,6 +258,7 @@ IOReturn org_dungeon_driver_IOSATDriver::sendSMARTCommand ( IOSATCommand * comma
int ataResult = kATAErrUnknownType;
IOReturn err = kIOReturnInvalid;
int direction, count, protocol;
+ UInt8 opBytes;
IOSATBusCommand* cmd = OSDynamicCast( IOSATBusCommand, command);
require_action_string(cmd, ErrorExit, err = kIOReturnBadArgument, "Command is not a IOSATBusCommand");
@@ -289,7 +290,7 @@ IOReturn org_dungeon_driver_IOSATDriver::sendSMARTCommand ( IOSATCommand * comma
}
DEBUG_LOG("%s[%p]::%s direction %d, count %d, protocol %d\n", getClassName(), this, __FUNCTION__, direction, count, protocol);
- if ( PASS_THROUGH_12 ( request,
+ if ( PASS_THROUGH_12or16 ( request,
cmd->getBuffer(),
0, // MULTIPLE_COUNT,
protocol, // PROTOCOL,
@@ -306,7 +307,7 @@ IOReturn org_dungeon_driver_IOSATDriver::sendSMARTCommand ( IOSATCommand * comma
cmd->getCylHi(), // LBA_HIGH,
0, // DEVICE,
cmd->getStatus(), // COMMAND, smart
- 0x00 ) // CONTROL
+ 0x00, opBytes ) // CONTROL
== true)
{
serviceResponse = SendCommand ( request, cmd->getTimeoutMS() );
@@ -314,13 +315,15 @@ IOReturn org_dungeon_driver_IOSATDriver::sendSMARTCommand ( IOSATCommand * comma
if ( ( serviceResponse == kSCSIServiceResponse_TASK_COMPLETE ) &&
GetTaskStatus ( request ) == kSCSITaskStatus_GOOD )
{
- DEBUG_LOG("%s[%p]::%s success, service response %d, task status %d\n", getClassName(), this, __FUNCTION__, serviceResponse, GetTaskStatus ( request ) );
+ DEBUG_LOG("%s[%p]::%s success, service response %d, task status %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), this, __FUNCTION__, serviceResponse, GetTaskStatus ( request ), opBytes );
ataResult = kATANoErr;
err=kIOReturnSuccess;
}
else
{
- ERROR_LOG("%s::%s failed, service response %d, task status %d\n", getClassName(), __FUNCTION__, serviceResponse, GetTaskStatus ( request ) );
+ ERROR_LOG("%s::%s failed, service response %d, task status %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), __FUNCTION__, serviceResponse, GetTaskStatus ( request ), opBytes );
if (GetTaskStatus ( request ) == kSCSITaskStatus_TaskTimeoutOccurred) {
ataResult = kATATimeoutErr;
err=kIOReturnSuccess;
@@ -421,7 +424,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_IDENTIFY ( void )
IOBufferMemoryDescriptor * buffer = NULL;
SCSITaskIdentifier request = NULL;
SCSI_Sense_Data senseData;
- UInt8 * ptr = NULL;
+ UInt8 * ptr = NULL, opBytes;
UInt16 * ataIdentify = NULL;
bool result = false;
@@ -456,7 +459,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_IDENTIFY ( void )
// Architecture Model family's built-in command-building functions. The
// BuildINQUIRY function uses INQUIRY as an example merely because
// it is a well-understood command.
- if ( PASS_THROUGH_12 ( request,
+ if ( PASS_THROUGH_12or16 ( request,
buffer,
0, // MULTIPLE_COUNT,
kIOSATProtocolPIODataIn, // PROTOCOL,
@@ -473,7 +476,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_IDENTIFY ( void )
0, // LBA_HIGH,
0, // DEVICE,
0xEC, // COMMAND, identify
- 0x00 ) // CONTROL
+ 0x00, opBytes ) // CONTROL
== true)
{
serviceResponse = SendCommand ( request, kTenSecondTimeoutInMS );
@@ -491,7 +494,8 @@ org_dungeon_driver_IOSATDriver::Send_ATA_IDENTIFY ( void )
trimcpy(model, (char*)(ataIdentify+kATAIdentifyModelNumber), sizeof(model));
// TODO get from build
- IOLog("SATSMARTDriver v0.4: disk serial '%s', revision '%s', model '%s'\n",serial, revision, model);
+ IOLog("SATSMARTDriver v0.4: disk serial '%s', revision '%s', model '%s', kSCSICmd_PASS_THROUGH_%u\n",
+ serial, revision, model, opBytes );
//DEBUG_LOG("capabilities %04x %04x %04x\n",ataIdentify[kATAIdentifyDriveCapabilities],
// ataIdentify[kATAIdentifyDriveCapabilitiesExtended],
// ataIdentify[kATAIdentifyCommandSetSupported]);
@@ -502,7 +506,8 @@ org_dungeon_driver_IOSATDriver::Send_ATA_IDENTIFY ( void )
else
{
GetAutoSenseData( request, &senseData, sizeof(senseData) );
- ERROR_LOG("%s::%s failed %d %d\n", getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ ERROR_LOG("%s::%s failed %d %d kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
ERROR_LOG( "senseData: VALID_RESPONSE_CODE=%d (7=valid),\n"
": SEGMENT_NUMBER=%d,\n"
": SENSE_KEY=%d (7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY)\n"
@@ -552,7 +557,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SMART_READ_DATA ( void )
IOBufferMemoryDescriptor * buffer = NULL;
SCSITaskIdentifier request = NULL;
SCSI_Sense_Data senseData;
- UInt8 * ptr = NULL;
+ UInt8 * ptr = NULL, opBytes;
UInt16 * ptr16;
bool result = false;
@@ -569,7 +574,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SMART_READ_DATA ( void )
require ( ( request != NULL ), ReleaseBuffer );
require ( ( buffer->prepare ( ) == kIOReturnSuccess ), ReleaseTask );
- if ( PASS_THROUGH_12 ( request,
+ if ( PASS_THROUGH_12or16 ( request,
buffer,
0, // MULTIPLE_COUNT,
kIOSATProtocolPIODataIn, // PROTOCOL,
@@ -586,7 +591,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SMART_READ_DATA ( void )
0xc2, // LBA_HIGH,
0, // DEVICE,
0xB0, // COMMAND, smart
- 0x00 ) // CONTROL
+ 0x00, opBytes ) // CONTROL
== true)
{
serviceResponse = SendCommand ( request, kTenSecondTimeoutInMS );
@@ -596,7 +601,8 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SMART_READ_DATA ( void )
(GetTaskStatus ( request ) == kSCSITaskStatus_GOOD ||
GetTaskStatus(request) == kSCSITaskStatus_CHECK_CONDITION) )
{
- DEBUG_LOG("%s[%p]::%s success checksum %d\n", getClassName(), this, __FUNCTION__, checksum(buffer) );
+ DEBUG_LOG("%s[%p]::%s success checksum %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), this, __FUNCTION__, checksum(buffer), opBytes );
swapbytes(buffer);
hexdump16(ptr16, 368, 10);
result = true;
@@ -605,7 +611,8 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SMART_READ_DATA ( void )
else
{
GetAutoSenseData( request, &senseData, sizeof(senseData) );
- ERROR_LOG("%s::%s failed %d %d\n", getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ ERROR_LOG("%s::%s failed %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
ERROR_LOG( "senseData: VALID_RESPONSE_CODE=%d (7=valid),\n"
": SEGMENT_NUMBER=%d,\n"
": SENSE_KEY=%d (7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY)\n"
@@ -653,13 +660,14 @@ bool
SCSIServiceResponse serviceResponse = kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE;
SCSITaskIdentifier request = NULL;
bool result = false;
+ UInt8 opBytes;
DEBUG_LOG("%s[%p]::%s value %d\n", getClassName(), this, __FUNCTION__, (int) value);
request = GetSCSITask ( );
require ( ( request != NULL ), ReleaseBuffer );
- if ( PASS_THROUGH_12 ( request,
+ if ( PASS_THROUGH_12or16 ( request,
0, // buffer
0, // MULTIPLE_COUNT,
kIOSATProtocolNonData, // PROTOCOL, soft reset
@@ -676,7 +684,7 @@ bool
0x00, // LBA_HIGH,
0, // DEVICE,
0xe3, // COMMAND, idle
- 0x00 ) // CONTROL
+ 0x00, opBytes ) // CONTROL
== true)
{
serviceResponse = SendCommand ( request, kTenSecondTimeoutInMS );
@@ -684,12 +692,14 @@ bool
if ( ( serviceResponse == kSCSIServiceResponse_TASK_COMPLETE ) &&
GetTaskStatus ( request ) == kSCSITaskStatus_GOOD )
{
- DEBUG_LOG("%s[%p]::%s success %d %d\n", getClassName(), this, __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ DEBUG_LOG("%s[%p]::%s success %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), this, __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
result = true;
}
else
{
- ERROR_LOG("%s::%s failed %d %d\n", getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ ERROR_LOG("%s::%s failed %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
}
ReleaseTask:
@@ -710,13 +720,14 @@ org_dungeon_driver_IOSATDriver::Send_ATA_STANDBY(UInt8 value)
SCSIServiceResponse serviceResponse = kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE;
SCSITaskIdentifier request = NULL;
bool result = false;
+ UInt8 opBytes;
DEBUG_LOG("%s[%p]::%s value %d\n", getClassName(), this, __FUNCTION__, (int) value);
request = GetSCSITask ( );
require ( ( request != NULL ), ReleaseBuffer );
- if ( PASS_THROUGH_12 ( request,
+ if ( PASS_THROUGH_12or16 ( request,
0, // buffer
0, // MULTIPLE_COUNT,
kIOSATProtocolNonData, // PROTOCOL, soft reset
@@ -733,7 +744,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_STANDBY(UInt8 value)
0x00, // LBA_HIGH,
0, // DEVICE,
0xe2, // COMMAND, standby
- 0x00 ) // CONTROL
+ 0x00, opBytes ) // CONTROL
== true)
{
serviceResponse = SendCommand ( request, kTenSecondTimeoutInMS );
@@ -741,12 +752,14 @@ org_dungeon_driver_IOSATDriver::Send_ATA_STANDBY(UInt8 value)
if ( ( serviceResponse == kSCSIServiceResponse_TASK_COMPLETE ) &&
GetTaskStatus ( request ) == kSCSITaskStatus_GOOD )
{
- DEBUG_LOG("%s[%p]::%s success %d %d\n", getClassName(), this, __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ DEBUG_LOG("%s[%p]::%s success %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), this, __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
result = true;
}
else
{
- ERROR_LOG("%s::%s failed %d %d\n", getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ ERROR_LOG("%s::%s failed %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
}
ReleaseTask:
@@ -767,13 +780,14 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SEND_SOFT_RESET ( void )
SCSIServiceResponse serviceResponse = kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE;
SCSITaskIdentifier request = NULL;
bool result = false;
+ UInt8 opBytes;
DEBUG_LOG("%s[%p]::%s\n", getClassName(), this, __FUNCTION__);
request = GetSCSITask ( );
require ( ( request != NULL ), ReleaseBuffer );
- if ( PASS_THROUGH_12 ( request,
+ if ( PASS_THROUGH_12or16 ( request,
0, // buffer
0, // MULTIPLE_COUNT,
kIOSATProtocolSRST, // PROTOCOL, soft reset
@@ -790,7 +804,7 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SEND_SOFT_RESET ( void )
0x00, // LBA_HIGH,
0, // DEVICE,
0x00, // COMMAND
- 0x00 ) // CONTROL
+ 0x00, opBytes ) // CONTROL
== true)
{
serviceResponse = SendCommand ( request, kTenSecondTimeoutInMS );
@@ -798,12 +812,14 @@ org_dungeon_driver_IOSATDriver::Send_ATA_SEND_SOFT_RESET ( void )
if ( ( serviceResponse == kSCSIServiceResponse_TASK_COMPLETE ) &&
GetTaskStatus ( request ) == kSCSITaskStatus_GOOD )
{
- DEBUG_LOG("%s[%p]::%s success %d %d\n", getClassName(), this, __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ DEBUG_LOG("%s[%p]::%s success %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), this, __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
result = true;
}
else
{
- ERROR_LOG("%s::%s failed %d %d\n", getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ) );
+ ERROR_LOG("%s::%s failed %d %d, kSCSICmd_PASS_THROUGH_%u\n",
+ getClassName(), __FUNCTION__, serviceResponse,GetTaskStatus ( request ), opBytes );
}
ReleaseTask:
@@ -914,7 +930,7 @@ org_dungeon_driver_IOSATDriver::PASS_THROUGH_12 (
}
}
- // This is a 16-byte command: fill out the CDB appropriately
+ // This is a 12-byte command: fill out the CDB appropriately
SetCommandDescriptorBlock ( request,
kSCSICmd_PASS_THROUGH_12,
(MULTIPLE_COUNT << 5) | (PROTOCOL << 1) | EXTEND,
@@ -1023,7 +1039,44 @@ org_dungeon_driver_IOSATDriver::PASS_THROUGH_16 (
return result;
}
-
+bool
+org_dungeon_driver_IOSATDriver::PASS_THROUGH_12or16 (
+ SCSITaskIdentifier request,
+ IOMemoryDescriptor * dataBuffer,
+ SCSICmdField3Bit MULTIPLE_COUNT,
+ SCSICmdField4Bit PROTOCOL,
+ SCSICmdField1Bit EXTEND,
+ SCSICmdField2Bit OFF_LINE,
+ SCSICmdField1Bit CK_COND,
+ SCSICmdField1Bit T_DIR,
+ SCSICmdField1Bit BYT_BLOK,
+ SCSICmdField2Bit T_LENGTH,
+ SCSICmdField2Byte FEATURES,
+ SCSICmdField2Byte SECTOR_COUNT,
+ SCSICmdField2Byte LBA_LOW,
+ SCSICmdField2Byte LBA_MID,
+ SCSICmdField2Byte LBA_HIGH,
+ SCSICmdField1Byte DEVICE,
+ SCSICmdField1Byte COMMAND,
+ SCSICmdField1Byte CONTROL,
+ UInt8 &opBytes)
+{ bool ret = PASS_THROUGH_12( request, dataBuffer,
+ MULTIPLE_COUNT, PROTOCOL, EXTEND, OFF_LINE, CK_COND, T_DIR, BYT_BLOK, T_LENGTH,
+ (SCSICmdField1Byte) FEATURES, (SCSICmdField1Byte) SECTOR_COUNT,
+ (SCSICmdField1Byte) LBA_LOW, (SCSICmdField1Byte) LBA_MID, (SCSICmdField1Byte) LBA_HIGH,
+ DEVICE, COMMAND, CONTROL );
+ if( !ret ){
+ opBytes = 16;
+ return PASS_THROUGH_16( request, dataBuffer,
+ MULTIPLE_COUNT, PROTOCOL, EXTEND, OFF_LINE, CK_COND, T_DIR, BYT_BLOK, T_LENGTH,
+ FEATURES, SECTOR_COUNT,
+ LBA_LOW, LBA_MID, LBA_HIGH,
+ DEVICE, COMMAND, CONTROL ); }
+ else{
+ opBytes = 12;
+ return ret;
+ }
+}
void
org_dungeon_driver_IOSATDriver::SendBuiltInINQUIRY ( void )
View
20 SATSMARTDriver/IOSATDriver.h
@@ -117,6 +117,26 @@ bool PASS_THROUGH_16 (
SCSICmdField1Byte DEVICE,
SCSICmdField1Byte COMMAND,
SCSICmdField1Byte CONTROL);
+bool PASS_THROUGH_12or16 (
+ SCSITaskIdentifier request,
+ IOMemoryDescriptor * dataBuffer,
+ SCSICmdField3Bit MULTIPLE_COUNT,
+ SCSICmdField4Bit PROTOCOL,
+ SCSICmdField1Bit EXTEND,
+ SCSICmdField2Bit OFF_LINE,
+ SCSICmdField1Bit CK_COND,
+ SCSICmdField1Bit T_DIR,
+ SCSICmdField1Bit BYT_BLOK,
+ SCSICmdField2Bit T_LENGTH,
+ SCSICmdField2Byte FEATURES,
+ SCSICmdField2Byte SECTOR_COUNT,
+ SCSICmdField2Byte LBA_LOW,
+ SCSICmdField2Byte LBA_MID,
+ SCSICmdField2Byte LBA_HIGH,
+ SCSICmdField1Byte DEVICE,
+ SCSICmdField1Byte COMMAND,
+ SCSICmdField1Byte CONTROL,
+ UInt8 &opBytes);
void SendBuiltInINQUIRY ( void );
public:
Please sign in to comment.
Something went wrong with that request. Please try again.