diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2004-07-04 09:35:29 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2004-07-04 09:35:29 -0400 |
| commit | 049a1ca4b4d2d5a6e6c6eb0715b09a929470f600 (patch) | |
| tree | 861b90318afb0886e2d057311aa5c06f2600d639 /include/linux | |
| parent | 2b50a905c4687d32459f93d980bbbdc541ee9431 (diff) | |
[libata] transfer mode cleanup
Add MWDMA support, and rework pio/mwdma/udma mode setup.
In the lone test case for PATA support, ata_piix, MWDMA mode setting
does not appear to work here. UDMA and PIO continue to work, so nobody
will really notice. But beware. Probably a driver problem, not
a bug in the core.
Also, doesn't bother writing to dummy timing registers on ICH5/6 SATA
anymore.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ata.h | 7 | ||||
| -rw-r--r-- | include/linux/libata.h | 21 |
2 files changed, 22 insertions, 6 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 7a99d7ee2f89..c8c5a0385414 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -42,6 +42,7 @@ enum { ATA_ID_SERNO_OFS = 10, ATA_ID_MAJOR_VER = 80, ATA_ID_PIO_MODES = 64, + ATA_ID_MWDMA_MODES = 63, ATA_ID_UDMA_MODES = 88, ATA_ID_PIO4 = (1 << 1), @@ -133,8 +134,14 @@ enum { XFER_UDMA_2 = 0x42, XFER_UDMA_1 = 0x41, XFER_UDMA_0 = 0x40, + XFER_MW_DMA_2 = 0x22, + XFER_MW_DMA_1 = 0x21, + XFER_MW_DMA_0 = 0x20, XFER_PIO_4 = 0x0C, XFER_PIO_3 = 0x0B, + XFER_PIO_2 = 0x0A, + XFER_PIO_1 = 0x09, + XFER_PIO_0 = 0x08, /* ATAPI stuff */ ATAPI_PKT_DMA = (1 << 0), diff --git a/include/linux/libata.h b/include/linux/libata.h index b646a48345a0..ac2b1fb85764 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -32,7 +32,6 @@ /* * compile-time options */ -#undef ATA_FORCE_PIO /* do not configure or use DMA */ #undef ATA_DEBUG /* debugging output */ #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ @@ -140,6 +139,13 @@ enum { PORT_UNKNOWN = 0, PORT_ENABLED = 1, PORT_DISABLED = 2, + + /* encoding various smaller bitmaps into a single + * unsigned long bitmap + */ + ATA_SHIFT_UDMA = 0, + ATA_SHIFT_MWDMA = 8, + ATA_SHIFT_PIO = 11, }; enum pio_task_states { @@ -188,6 +194,7 @@ struct ata_probe_ent { struct ata_ioports port[ATA_MAX_PORTS]; unsigned int n_ports; unsigned int pio_mask; + unsigned int mwdma_mask; unsigned int udma_mask; unsigned int legacy_mode; unsigned long irq; @@ -252,7 +259,9 @@ struct ata_device { unsigned int devno; /* 0 or 1 */ u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ unsigned int pio_mode; - unsigned int udma_mode; + unsigned int dma_mode; + unsigned int xfer_mode; + unsigned int xfer_shift; /* ATA_SHIFT_xxx */ /* cache info about current transfer mode */ u8 xfer_protocol; /* taskfile xfer protocol */ @@ -277,6 +286,7 @@ struct ata_port { unsigned int bus_state; unsigned int port_state; unsigned int pio_mask; + unsigned int mwdma_mask; unsigned int udma_mask; unsigned int cbl; /* cable type; ATA_CBL_xxx */ @@ -303,10 +313,8 @@ struct ata_port_operations { void (*dev_config) (struct ata_port *, struct ata_device *); - void (*set_piomode) (struct ata_port *, struct ata_device *, - unsigned int); - void (*set_udmamode) (struct ata_port *, struct ata_device *, - unsigned int); + void (*set_piomode) (struct ata_port *, struct ata_device *); + void (*set_dmamode) (struct ata_port *, struct ata_device *); void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); @@ -342,6 +350,7 @@ struct ata_port_info { Scsi_Host_Template *sht; unsigned long host_flags; unsigned long pio_mask; + unsigned long mwdma_mask; unsigned long udma_mask; struct ata_port_operations *port_ops; }; |
