Changeset 35b8bfe in mainline for uspace/drv/block/ata_bd/ata_hw.h


Ignore:
Timestamp:
2014-08-16T13:05:28Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3abf70c7
Parents:
8820544
Message:

ATAPI commands correspond to SCSI SPC, SBC and MMC commands (with a few quirks) so use libscsi.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ata_bd/ata_hw.h

    r8820544 r35b8bfe  
    241241};
    242242
    243 /** ATA packet command codes. */
    244 enum ata_pkt_command {
    245         PCMD_INQUIRY            = 0x12,
    246         PCMD_READ_12            = 0xa8,
    247         PCMD_READ_TOC           = 0x43
    248 };
    249 
    250 /** ATAPI Inquiry command */
    251 typedef struct {
    252         uint8_t opcode;         /**< Operation code (PCMD_INQUIRY) */
    253         uint8_t _res0;
    254         uint8_t _res1;
    255         uint8_t _res2;
    256         uint8_t alloc_len;      /**< Allocation length */
    257         uint8_t _res3;
    258         uint8_t _res4;
    259         uint8_t _res5;
    260         uint32_t _res6;
    261 } __attribute__ ((packed)) ata_pcmd_inquiry_t;
    262 
    263 /** ATAPI Read(12) command */
    264 typedef struct {
    265         uint8_t opcode;         /**< Operation code (PCMD_READ_12) */
    266         uint8_t _res0;
    267         uint32_t ba;            /**< Starting block address */
    268         uint32_t nblocks;       /**< Number of blocks to transfer */
    269         uint8_t _res1;
    270         uint8_t _res2;
    271 } __attribute__ ((packed)) ata_pcmd_read_12_t;
    272 
    273 /** ATAPI Read TOC command */
    274 typedef struct {
    275         uint8_t opcode;         /**< Operation code (PCMD_READ_TOC) */
    276         uint8_t msf;            /**< 0x2 = MSF bit set */
    277         uint8_t format;         /**< low 3 bits */
    278         uint8_t _res0;
    279         uint8_t _res1;
    280         uint8_t _res2;
    281         uint8_t start;          /**< starting track/session number */
    282         uint16_t size;          /**< Allocation length */
    283         uint8_t oldformat;         /**< high 2 bits */
    284         uint8_t _res3;
    285         uint8_t _res4;
    286 } __attribute__ ((packed)) ata_pcmd_read_toc_t;
    287 
    288 /** Data returned from Inquiry command (mandatory part) */
    289 typedef struct {
    290         uint8_t pdev_type;      /** Reserved, Peripheral device type */
    291         uint8_t rmb;            /** RMB, Reserved */
    292         uint8_t std_version;    /** ISO version, ECMA version, ANSI version */
    293         uint8_t atapi_ver_rdf;  /** ATAPI version, Response data format */
    294         uint8_t additional_len; /** Additional length */
    295         uint8_t _res0;
    296         uint8_t _res1;
    297         uint8_t _res2;
    298         uint8_t vendor_id[8];   /** Vendor ID */
    299         uint8_t product_id[8];  /** Product ID */
    300         uint8_t product_rev[4]; /** Product revision level */
    301 } ata_inquiry_data_t;
    302 
    303 /** Extract value of ata_inquiry_data_t.pdev_type */
     243/** Extract value of device type from scsi_std_inquiry_data_t.pqual_devtype */
    304244#define INQUIRY_PDEV_TYPE(val) ((val) & 0x1f)
    305 
    306 /** Values for ata_inquiry_data_t.pdev_type */
    307 enum ata_pdev_type {
    308         PDEV_TYPE_CDROM         = 0x05
    309 };
    310245
    311246enum ata_pdev_signature {
Note: See TracChangeset for help on using the changeset viewer.