aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:19 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 16:39:19 -0400
commit48fb2688aa67baba373531cc4ed2d9e695983c3f (patch)
tree9382e5175e43b914fd06bb778cc6f37a4967ab9d /drivers/ide/pci
parent4dde4492d850a4c9bcaa92e5bd7f4eebe3e2f5ab (diff)
ide: remove drive->driveid
* Factor out HDIO_[OBSOLETE,GET]_IDENTITY ioctls handling to ide_get_identity_ioctl(). * Use temporary buffer in ide_get_identity_ioctl() instead of accessing drive->id directly. * Add ide_id_to_hd_driveid() inline to convert raw id into struct hd_driveid format (needed on big-endian). * Use ide_id_to_hd_driveid() in ide_get_identity_ioctl(), cleanup ide_fix_driveid() and switch ide to use use raw id. * Remove no longer needed drive->driveid. This leaves us with 3 users of struct hd_driveid in tree: - arch/um/drivers/ubd_kern.c - drivers/block/xsysace.c - drivers/usb/storage/isd200.c While at it: * Use ata_id_u{32,64}() and ata_id_has_{dma,lba,iordy}() macros. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r--drivers/ide/pci/cs5530.c2
-rw-r--r--drivers/ide/pci/it821x.c4
-rw-r--r--drivers/ide/pci/pdc202xx_old.c2
-rw-r--r--drivers/ide/pci/sc1200.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 774ff58603a2..ef91e9d7c54f 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -88,7 +88,7 @@ static u8 cs5530_udma_filter(ide_drive_t *drive)
88 if (mate->present == 0) 88 if (mate->present == 0)
89 goto out; 89 goto out;
90 90
91 if ((mate->driveid->capability & 1) && __ide_dma_bad_drive(mate) == 0) { 91 if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
92 if ((mateid[ATA_ID_FIELD_VALID] & 4) && 92 if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
93 (mateid[ATA_ID_UDMA_MODES] & 7)) 93 (mateid[ATA_ID_UDMA_MODES] & 7))
94 goto out; 94 goto out;
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 31d4e6aef1b8..ed24065f74e8 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -470,7 +470,7 @@ static void it821x_quirkproc(ide_drive_t *drive)
470 /* In raid mode the ident block is slightly buggy 470 /* In raid mode the ident block is slightly buggy
471 We need to set the bits so that the IDE layer knows 471 We need to set the bits so that the IDE layer knows
472 LBA28. LBA48 and DMA ar valid */ 472 LBA28. LBA48 and DMA ar valid */
473 drive->driveid->capability |= 3; /* LBA28, DMA */ 473 id[ATA_ID_CAPABILITY] |= (3 << 8); /* LBA28, DMA */
474 id[ATA_ID_COMMAND_SET_2] |= 0x0400; /* LBA48 valid */ 474 id[ATA_ID_COMMAND_SET_2] |= 0x0400; /* LBA48 valid */
475 id[ATA_ID_CFS_ENABLE_2] |= 0x0400; /* LBA48 on */ 475 id[ATA_ID_CFS_ENABLE_2] |= 0x0400; /* LBA48 on */
476 /* Reporting logic */ 476 /* Reporting logic */
@@ -504,7 +504,7 @@ static void it821x_quirkproc(ide_drive_t *drive)
504 * IDE core that DMA is supported (it821x hardware 504 * IDE core that DMA is supported (it821x hardware
505 * takes care of DMA mode programming). 505 * takes care of DMA mode programming).
506 */ 506 */
507 if (drive->driveid->capability & 1) { 507 if (ata_id_has_dma(id)) {
508 id[ATA_ID_MWDMA_MODES] |= 0x0101; 508 id[ATA_ID_MWDMA_MODES] |= 0x0101;
509 drive->current_speed = XFER_MW_DMA_0; 509 drive->current_speed = XFER_MW_DMA_0;
510 } 510 }
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 23e861b177ce..5d4436f3efd4 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -86,7 +86,7 @@ static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed)
86 * Prefetch_EN / IORDY_EN / PA[3:0] bits of register A 86 * Prefetch_EN / IORDY_EN / PA[3:0] bits of register A
87 */ 87 */
88 AP &= ~0x3f; 88 AP &= ~0x3f;
89 if (drive->driveid->capability & 4) 89 if (ata_id_iordy_disable(drive->id))
90 AP |= 0x20; /* set IORDY_EN bit */ 90 AP |= 0x20; /* set IORDY_EN bit */
91 if (drive->media == ide_disk) 91 if (drive->media == ide_disk)
92 AP |= 0x10; /* set Prefetch_EN bit */ 92 AP |= 0x10; /* set Prefetch_EN bit */
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 5c8367df14e4..695cc9742048 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -111,7 +111,7 @@ static u8 sc1200_udma_filter(ide_drive_t *drive)
111 if (mate->present == 0) 111 if (mate->present == 0)
112 goto out; 112 goto out;
113 113
114 if ((mate->driveid->capability & 1) && __ide_dma_bad_drive(mate) == 0) { 114 if (ata_id_has_dma(mateid) && __ide_dma_bad_drive(mate) == 0) {
115 if ((mateid[ATA_ID_FIELD_VALID] & 4) && 115 if ((mateid[ATA_ID_FIELD_VALID] & 4) &&
116 (mateid[ATA_ID_UDMA_MODES] & 7)) 116 (mateid[ATA_ID_UDMA_MODES] & 7))
117 goto out; 117 goto out;