diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ata.h | 20 | ||||
| -rw-r--r-- | include/linux/libata.h | 34 |
2 files changed, 40 insertions, 14 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index a5b74efab067..ecb7346d0c16 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -132,6 +132,7 @@ enum { | |||
| 132 | ATA_CMD_PACKET = 0xA0, | 132 | ATA_CMD_PACKET = 0xA0, |
| 133 | ATA_CMD_VERIFY = 0x40, | 133 | ATA_CMD_VERIFY = 0x40, |
| 134 | ATA_CMD_VERIFY_EXT = 0x42, | 134 | ATA_CMD_VERIFY_EXT = 0x42, |
| 135 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | ||
| 135 | 136 | ||
| 136 | /* SETFEATURES stuff */ | 137 | /* SETFEATURES stuff */ |
| 137 | SETFEATURES_XFER = 0x03, | 138 | SETFEATURES_XFER = 0x03, |
| @@ -146,14 +147,14 @@ enum { | |||
| 146 | XFER_MW_DMA_2 = 0x22, | 147 | XFER_MW_DMA_2 = 0x22, |
| 147 | XFER_MW_DMA_1 = 0x21, | 148 | XFER_MW_DMA_1 = 0x21, |
| 148 | XFER_MW_DMA_0 = 0x20, | 149 | XFER_MW_DMA_0 = 0x20, |
| 150 | XFER_SW_DMA_2 = 0x12, | ||
| 151 | XFER_SW_DMA_1 = 0x11, | ||
| 152 | XFER_SW_DMA_0 = 0x10, | ||
| 149 | XFER_PIO_4 = 0x0C, | 153 | XFER_PIO_4 = 0x0C, |
| 150 | XFER_PIO_3 = 0x0B, | 154 | XFER_PIO_3 = 0x0B, |
| 151 | XFER_PIO_2 = 0x0A, | 155 | XFER_PIO_2 = 0x0A, |
| 152 | XFER_PIO_1 = 0x09, | 156 | XFER_PIO_1 = 0x09, |
| 153 | XFER_PIO_0 = 0x08, | 157 | XFER_PIO_0 = 0x08, |
| 154 | XFER_SW_DMA_2 = 0x12, | ||
| 155 | XFER_SW_DMA_1 = 0x11, | ||
| 156 | XFER_SW_DMA_0 = 0x10, | ||
| 157 | XFER_PIO_SLOW = 0x00, | 158 | XFER_PIO_SLOW = 0x00, |
| 158 | 159 | ||
| 159 | /* ATAPI stuff */ | 160 | /* ATAPI stuff */ |
| @@ -181,6 +182,7 @@ enum { | |||
| 181 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ | 182 | ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ |
| 182 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ | 183 | ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ |
| 183 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ | 184 | ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ |
| 185 | ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ | ||
| 184 | }; | 186 | }; |
| 185 | 187 | ||
| 186 | enum ata_tf_protocols { | 188 | enum ata_tf_protocols { |
| @@ -250,6 +252,18 @@ struct ata_taskfile { | |||
| 250 | ((u64) (id)[(n) + 1] << 16) | \ | 252 | ((u64) (id)[(n) + 1] << 16) | \ |
| 251 | ((u64) (id)[(n) + 0]) ) | 253 | ((u64) (id)[(n) + 0]) ) |
| 252 | 254 | ||
| 255 | static inline int ata_id_current_chs_valid(u16 *id) | ||
| 256 | { | ||
| 257 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | ||
| 258 | has not been issued to the device then the values of | ||
| 259 | id[54] to id[56] are vendor specific. */ | ||
| 260 | return (id[53] & 0x01) && /* Current translation valid */ | ||
| 261 | id[54] && /* cylinders in current translation */ | ||
| 262 | id[55] && /* heads in current translation */ | ||
| 263 | id[55] <= 16 && | ||
| 264 | id[56]; /* sectors in current translation */ | ||
| 265 | } | ||
| 266 | |||
| 253 | static inline int atapi_cdb_len(u16 *dev_id) | 267 | static inline int atapi_cdb_len(u16 *dev_id) |
| 254 | { | 268 | { |
| 255 | u16 tmp = dev_id[0] & 0x3; | 269 | u16 tmp = dev_id[0] & 0x3; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index ceee1fc42c60..7929cfc9318d 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -97,6 +97,7 @@ enum { | |||
| 97 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ | 97 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ |
| 98 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ | 98 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ |
| 99 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ | 99 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ |
| 100 | ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */ | ||
| 100 | 101 | ||
| 101 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 102 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
| 102 | ATA_DEV_ATA = 1, /* ATA device */ | 103 | ATA_DEV_ATA = 1, /* ATA device */ |
| @@ -154,17 +155,21 @@ enum { | |||
| 154 | ATA_SHIFT_UDMA = 0, | 155 | ATA_SHIFT_UDMA = 0, |
| 155 | ATA_SHIFT_MWDMA = 8, | 156 | ATA_SHIFT_MWDMA = 8, |
| 156 | ATA_SHIFT_PIO = 11, | 157 | ATA_SHIFT_PIO = 11, |
| 158 | |||
| 159 | /* Masks for port functions */ | ||
| 160 | ATA_PORT_PRIMARY = (1 << 0), | ||
| 161 | ATA_PORT_SECONDARY = (1 << 1), | ||
| 157 | }; | 162 | }; |
| 158 | 163 | ||
| 159 | enum pio_task_states { | 164 | enum hsm_task_states { |
| 160 | PIO_ST_UNKNOWN, | 165 | HSM_ST_UNKNOWN, |
| 161 | PIO_ST_IDLE, | 166 | HSM_ST_IDLE, |
| 162 | PIO_ST_POLL, | 167 | HSM_ST_POLL, |
| 163 | PIO_ST_TMOUT, | 168 | HSM_ST_TMOUT, |
| 164 | PIO_ST, | 169 | HSM_ST, |
| 165 | PIO_ST_LAST, | 170 | HSM_ST_LAST, |
| 166 | PIO_ST_LAST_POLL, | 171 | HSM_ST_LAST_POLL, |
| 167 | PIO_ST_ERR, | 172 | HSM_ST_ERR, |
| 168 | }; | 173 | }; |
| 169 | 174 | ||
| 170 | /* forward declarations */ | 175 | /* forward declarations */ |
| @@ -282,6 +287,11 @@ struct ata_device { | |||
| 282 | u8 xfer_protocol; /* taskfile xfer protocol */ | 287 | u8 xfer_protocol; /* taskfile xfer protocol */ |
| 283 | u8 read_cmd; /* opcode to use on read */ | 288 | u8 read_cmd; /* opcode to use on read */ |
| 284 | u8 write_cmd; /* opcode to use on write */ | 289 | u8 write_cmd; /* opcode to use on write */ |
| 290 | |||
| 291 | /* for CHS addressing */ | ||
| 292 | u16 cylinders; /* Number of cylinders */ | ||
| 293 | u16 heads; /* Number of heads */ | ||
| 294 | u16 sectors; /* Number of sectors per track */ | ||
| 285 | }; | 295 | }; |
| 286 | 296 | ||
| 287 | struct ata_port { | 297 | struct ata_port { |
| @@ -319,7 +329,7 @@ struct ata_port { | |||
| 319 | struct work_struct packet_task; | 329 | struct work_struct packet_task; |
| 320 | 330 | ||
| 321 | struct work_struct pio_task; | 331 | struct work_struct pio_task; |
| 322 | unsigned int pio_task_state; | 332 | unsigned int hsm_task_state; |
| 323 | unsigned long pio_task_timeout; | 333 | unsigned long pio_task_timeout; |
| 324 | 334 | ||
| 325 | void *private_data; | 335 | void *private_data; |
| @@ -400,6 +410,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn | |||
| 400 | extern int ata_scsi_error(struct Scsi_Host *host); | 410 | extern int ata_scsi_error(struct Scsi_Host *host); |
| 401 | extern int ata_scsi_release(struct Scsi_Host *host); | 411 | extern int ata_scsi_release(struct Scsi_Host *host); |
| 402 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 412 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
| 413 | extern int ata_ratelimit(void); | ||
| 414 | |||
| 403 | /* | 415 | /* |
| 404 | * Default driver ops implementations | 416 | * Default driver ops implementations |
| 405 | */ | 417 | */ |
| @@ -452,7 +464,7 @@ struct pci_bits { | |||
| 452 | 464 | ||
| 453 | extern void ata_pci_host_stop (struct ata_host_set *host_set); | 465 | extern void ata_pci_host_stop (struct ata_host_set *host_set); |
| 454 | extern struct ata_probe_ent * | 466 | extern struct ata_probe_ent * |
| 455 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); | 467 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
| 456 | extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); | 468 | extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); |
| 457 | 469 | ||
| 458 | #endif /* CONFIG_PCI */ | 470 | #endif /* CONFIG_PCI */ |
