Changes in uspace/srv/bd/ata_bd/ata_hw.h [d770deb:bb0eab1] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_hw.h
rd770deb rbb0eab1 134 134 CMD_WRITE_SECTORS = 0x30, 135 135 CMD_WRITE_SECTORS_EXT = 0x34, 136 CMD_PACKET = 0xA0, 137 CMD_IDENTIFY_PKT_DEV = 0xA1, 136 138 CMD_IDENTIFY_DRIVE = 0xEC 137 139 }; 138 140 139 /** Data returned from @c identifycommand. */141 /** Data returned from identify device and identify packet device command. */ 140 142 typedef struct { 141 143 uint16_t gen_conf; … … 159 161 uint16_t max_rw_multiple; 160 162 uint16_t _res48; 161 uint16_t caps; 163 uint16_t caps; /* Different meaning for packet device */ 162 164 uint16_t _res50; 163 165 uint16_t pio_timing; … … 214 216 } identify_data_t; 215 217 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. */ 219 enum 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. */ 227 enum 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 221 236 }; 222 237 … … 226 241 }; 227 242 243 /** ATA packet command codes. */ 244 enum ata_pkt_command { 245 PCMD_INQUIRY = 0x12, 246 PCMD_READ_12 = 0xa8 247 }; 248 249 /** ATAPI Inquiry command */ 250 typedef 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 */ 263 typedef 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) */ 273 typedef 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 */ 291 enum ata_pdev_type { 292 PDEV_TYPE_CDROM = 0x05 293 }; 294 228 295 #endif 229 296
Note:
See TracChangeset
for help on using the changeset viewer.