Changeset cd50486 in mainline for uspace/srv/bd/ata_bd/ata_hw.h


Ignore:
Timestamp:
2011-02-06T22:03:55Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
25971d2
Parents:
1110ebd (diff), 960ff451 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge development/ changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/ata_bd/ata_hw.h

    r1110ebd rcd50486  
    134134        CMD_WRITE_SECTORS       = 0x30,
    135135        CMD_WRITE_SECTORS_EXT   = 0x34,
     136        CMD_PACKET              = 0xA0,
     137        CMD_IDENTIFY_PKT_DEV    = 0xA1,
    136138        CMD_IDENTIFY_DRIVE      = 0xEC
    137139};
    138140
    139 /** Data returned from @c identify command. */
     141/** Data returned from identify device and identify packet device command. */
    140142typedef struct {
    141143        uint16_t gen_conf;
     
    159161        uint16_t max_rw_multiple;
    160162        uint16_t _res48;
    161         uint16_t caps;
     163        uint16_t caps;          /* Different meaning for packet device */
    162164        uint16_t _res50;
    163165        uint16_t pio_timing;
     
    214216} identify_data_t;
    215217
    216 enum ata_caps {
    217         cap_iordy       = 0x0800,
    218         cap_iordy_cbd   = 0x0400,
    219         cap_lba         = 0x0200,
    220         cap_dma         = 0x0100
     218/** Capability bits for register device. */
     219enum ata_regdev_caps {
     220        rd_cap_iordy            = 0x0800,
     221        rd_cap_iordy_cbd        = 0x0400,
     222        rd_cap_lba              = 0x0200,
     223        rd_cap_dma              = 0x0100
     224};
     225
     226/** Capability bits for packet device. */
     227enum ata_pktdev_caps {
     228        pd_cap_ildma            = 0x8000,
     229        pd_cap_cmdqueue         = 0x4000,
     230        pd_cap_overlap          = 0x2000,
     231        pd_cap_need_softreset   = 0x1000,       /* Obsolete (ATAPI-6) */
     232        pd_cap_iordy            = 0x0800,
     233        pd_cap_iordy_dis        = 0x0400,
     234        pd_cap_lba              = 0x0200,       /* Must be on */
     235        pd_cap_dma              = 0x0100
    221236};
    222237
     
    226241};
    227242
     243/** ATA packet command codes. */
     244enum ata_pkt_command {
     245        PCMD_INQUIRY            = 0x12,
     246        PCMD_READ_12            = 0xa8
     247};
     248
     249/** ATAPI Inquiry command */
     250typedef struct {
     251        uint8_t opcode;         /**< Operation code (PCMD_INQUIRY) */
     252        uint8_t _res0;
     253        uint8_t _res1;
     254        uint8_t _res2;
     255        uint8_t alloc_len;      /**< Allocation length */
     256        uint8_t _res3;
     257        uint8_t _res4;
     258        uint8_t _res5;
     259        uint32_t _res6;
     260} __attribute__ ((packed)) ata_pcmd_inquiry_t;
     261
     262/** ATAPI Read(12) command */
     263typedef struct {
     264        uint8_t opcode;         /**< Operation code (PCMD_READ_12) */
     265        uint8_t _res0;
     266        uint32_t ba;            /**< Starting block address */
     267        uint32_t nblocks;       /**< Number of blocks to transfer */
     268        uint8_t _res1;
     269        uint8_t _res2;
     270} __attribute__ ((packed)) ata_pcmd_read_12_t;
     271
     272/** Data returned from Inquiry command (mandatory part) */
     273typedef struct {
     274        uint8_t pdev_type;      /** Reserved, Peripheral device type */
     275        uint8_t rmb;            /** RMB, Reserved */
     276        uint8_t std_version;    /** ISO version, ECMA version, ANSI version */
     277        uint8_t atapi_ver_rdf;  /** ATAPI version, Response data format */
     278        uint8_t additional_len; /** Additional length */
     279        uint8_t _res0;
     280        uint8_t _res1;
     281        uint8_t _res2;
     282        uint8_t vendor_id[8];   /** Vendor ID */
     283        uint8_t product_id[8];  /** Product ID */
     284        uint8_t product_rev[4]; /** Product revision level */
     285} ata_inquiry_data_t;
     286
     287/** Extract value of ata_inquiry_data_t.pdev_type */
     288#define INQUIRY_PDEV_TYPE(val) ((val) & 0x1f)
     289
     290/** Values for ata_inquiry_data_t.pdev_type */
     291enum ata_pdev_type {
     292        PDEV_TYPE_CDROM         = 0x05
     293};
     294
    228295#endif
    229296
Note: See TracChangeset for help on using the changeset viewer.