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>
This commit is contained in:
Bartlomiej Zolnierkiewicz
2008-10-10 22:39:19 +02:00
parent 4dde4492d8
commit 48fb2688aa
13 changed files with 90 additions and 69 deletions

View File

@@ -649,8 +649,8 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode)
case XFER_SW_DMA_0:
if (id[ATA_ID_FIELD_VALID] & 2) {
mask = id[ATA_ID_SWDMA_MODES] & hwif->swdma_mask;
} else if (drive->driveid->tDMA) {
u8 mode = drive->driveid->tDMA;
} else if (id[ATA_ID_OLD_DMA_MODES] >> 8) {
u8 mode = id[ATA_ID_OLD_DMA_MODES] >> 8;
/*
* if the mode is valid convert it to the mask
@@ -727,7 +727,7 @@ static int ide_tune_dma(ide_drive_t *drive)
ide_hwif_t *hwif = drive->hwif;
u8 speed;
if (drive->nodma || (drive->driveid->capability & 1) == 0)
if (drive->nodma || ata_id_has_dma(drive->id) == 0)
return 0;
/* consult the list of known "bad" drives */