<!--
{
  "documentType" : "article",
  "framework" : "SCSIPeripheralsDriverKit",
  "identifier" : "/documentation/SCSIPeripheralsDriverKit/scsi-commands",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "SCSI commands"
}
-->

# SCSI commands

Call the framework’s free functions to populate Command Descriptor Blocks (CDBs) to send to your peripheral.

## Topics

### Creating common SCSI commands

[`bool TEST_UNIT_READY(SCSIDeviceOutParameters *request, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/TEST_UNIT_READY)

Fills a Command Descriptor Block (CDB) to test whether the unit is ready.

[`bool INQUIRY(SCSIDeviceOutParameters *request, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/INQUIRY)

Fills a Command Descriptor Block (CDB) to perform a SCSI inquiry.

[`bool REQUEST_SENSE(SCSIDeviceOutParameters *request, UInt64 bufAddr, UInt8 senseLength, SCSIDeviceInParameters *response);`](/documentation/SCSIPeripheralsDriverKit/REQUEST_SENSE)

Fills a Command Descriptor Block (CDB) to perform a SCSI sense-request command.

[`bool READ_10(SCSIDeviceOutParameters *request, UInt64 blockSize, UInt32 startBlock, UInt16 blockCount, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/READ_10)

Fills a Command Descriptor Block (CDB) to perform a SCSI read command.

[`bool WRITE_10(SCSIDeviceOutParameters *request, UInt64 blockSize, UInt32 startBlock, UInt16 blockCount, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/WRITE_10)

Fills a Command Descriptor Block (CDB) to perform a SCSI write command.

[`bool READ_CAPACITY(SCSIDeviceOutParameters *request, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/READ_CAPACITY)

Fills a Command Descriptor Block (CDB) to perform a SCSI read-capacity command.

### Creating Self-Monitoring, Analysis and Reporting Technology (SMART) Commands

[`bool SMART_Enable_Disable_Operations(SCSIDeviceOutParameters *request, bool enable, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Enable_Disable_Operations)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to enable or disable operations.

[`bool SMART_Enable_Disable_AutoSave(SCSIDeviceOutParameters *request, bool enable, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Enable_Disable_AutoSave)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to enable or disable the autosave feature.

[`bool SMART_Return_Status(SCSIDeviceOutParameters *request, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Return_Status)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to return status.

[`bool SMART_Execute_Offline_Immediate(SCSIDeviceOutParameters *request, bool extendedTest, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Execute_Offline_Immediate)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to execute an immediate offline test.

[`bool SMART_Read_Data(SCSIDeviceOutParameters *request, UInt64 requestedBytes, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Read_Data)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to read data.

[`bool SMART_Read_Data_Thresholds(SCSIDeviceOutParameters *request, UInt64 requestedBytes, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Read_Data_Thresholds)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to read data thresholds.

[`bool SMART_Read_Log_At_Address(SCSIDeviceOutParameters *request, UInt64 bufAddr, UInt8 numSectors, UInt8 logAddress, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Read_Log_At_Address)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to read log data from an address.

[`bool SMART_Write_Log_At_Address(SCSIDeviceOutParameters *request, UInt64 bufAddr, UInt8 numSectors, UInt8 logAddress, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Write_Log_At_Address)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to write log data at an address.

[`bool SMART_Get_Identify_Data(SCSIDeviceOutParameters *request, UInt64 bufAddr, SCSIDeviceInParameters *response, UInt64 senseBufAddr);`](/documentation/SCSIPeripheralsDriverKit/SMART_Get_Identify_Data)

Fills a Command Descriptor Block (CDB) to perform a SMART SCSI Command to get identify data.

### Creating arbitrary SCSI commands

[`void SetCommandCDB(SCSICommandDescriptorBlock *cdb, UInt8 byte0, UInt8 byte1, UInt8 byte2, UInt8 byte3, UInt8 byte4, UInt8 byte5, UInt8 byte6, UInt8 byte7, UInt8 byte8, UInt8 byte9, UInt8 byte10, UInt8 byte11, UInt8 byte12, UInt8 byte13, UInt8 byte14, UInt8 byte15);`](/documentation/SCSIPeripheralsDriverKit/SetCommandCDB)

Fills a 16-byte Command Descriptor Block (CDB) with custom content.

### Supporting types

[`typedef struct SCSIDeviceOutParameters { ... } SCSIDeviceOutParameters;`](/documentation/SCSIPeripheralsDriverKit/SCSIDeviceOutParameters)

A structure that contains parameters for an outbound request to a SCSI device.

[`typedef struct SCSIDeviceInParameters { ... } SCSIDeviceInParameters;`](/documentation/SCSIPeripheralsDriverKit/SCSIDeviceInParameters)

A structure that contains properties from an inbound response from a SCSI device.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)