Skip to contentSkip to conversation

IDE updates (part 3)

GIT PULL Bartlomiej Zolnierkiewicz 1 participant 1 message Jul 23, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

Inside:

* Addition of struct ide_tp_ops and struct ide_host.

* Rework of probing code to allow unloading of host driver modules.

* Dynamic allocation of ide_hwif_t instances.

* More work on generic ATAPI support from Borislav Petkov.

* Janitorial fixes from Darren Jenkins, Harvey Harrison and Pavel Machek.

* Misc fixes/cleanups.

Please pull from:

master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/

to receive the following updates:

 drivers/ide/Kconfig               |    2 +
 drivers/ide/arm/icside.c          |   71 +++----
 drivers/ide/arm/ide_arm.c         |   14 +--
 drivers/ide/arm/palm_bk3710.c     |   30 +--
 drivers/ide/arm/rapide.c          |   24 +--
 drivers/ide/h8300/ide-h8300.c     |   48 ++---
 drivers/ide/ide-atapi.c           |   58 ++++--
 drivers/ide/ide-cd.c              |  157 ++++++++--------
 drivers/ide/ide-cd.h              |   38 ----
 drivers/ide/ide-cd_ioctl.c        |   35 ++--
 drivers/ide/ide-disk.c            |    2 +-
 drivers/ide/ide-dma.c             |  103 +++++++----
 drivers/ide/ide-floppy.c          |   90 ++++------
 drivers/ide/ide-generic.c         |   73 ++++----
 drivers/ide/ide-io.c              |   42 +++--
 drivers/ide/ide-iops.c            |  230 ++++++++++++++++--------
 drivers/ide/ide-lib.c             |   17 +--
 drivers/ide/ide-pnp.c             |   29 ++--
 drivers/ide/ide-probe.c           |  366 ++++++++++++++++++++++++++-----------
 drivers/ide/ide-proc.c            |    4 +-
 drivers/ide/ide-tape.c            |  127 ++++++--------
 drivers/ide/ide-taskfile.c        |   38 +++--
 drivers/ide/ide.c                 |   49 +-----
 drivers/ide/legacy/buddha.c       |   24 +--
 drivers/ide/legacy/falconide.c    |   56 ++++--
 drivers/ide/legacy/gayle.c        |   39 ++---
 drivers/ide/legacy/ide-4drives.c  |   20 +--
 drivers/ide/legacy/ide-cs.c       |   54 +++---
 drivers/ide/legacy/ide_platform.c |   32 +---
 drivers/ide/legacy/macide.c       |   15 +--
 drivers/ide/legacy/q40ide.c       |   47 +++--
 drivers/ide/mips/au1xxx-ide.c     |   56 +++---
 drivers/ide/mips/swarm.c          |   24 +--
 drivers/ide/pci/aec62xx.c         |    5 -
 drivers/ide/pci/alim15x3.c        |   12 +-
 drivers/ide/pci/amd74xx.c         |    1 -
 drivers/ide/pci/cmd640.c          |   29 +---
 drivers/ide/pci/cmd64x.c          |   12 +-
 drivers/ide/pci/cs5520.c          |   41 +----
 drivers/ide/pci/cs5535.c          |    3 +-
 drivers/ide/pci/delkin_cb.c       |   25 +--
 drivers/ide/pci/hpt34x.c          |    1 -
 drivers/ide/pci/hpt366.c          |   23 ++-
 drivers/ide/pci/ns87415.c         |  115 ++++++------
 drivers/ide/pci/pdc202xx_old.c    |    3 +-
 drivers/ide/pci/piix.c            |    4 +-
 drivers/ide/pci/scc_pata.c        |  139 +++++++++------
 drivers/ide/pci/serverworks.c     |    4 +-
 drivers/ide/pci/sgiioc4.c         |   65 ++++---
 drivers/ide/pci/siimage.c         |    6 +-
 drivers/ide/pci/sl82c105.c        |    4 +-
 drivers/ide/pci/tc86c001.c        |   16 +-
 drivers/ide/pci/via82cxxx.c       |    1 -
 drivers/ide/ppc/pmac.c            |  222 +++++++++++++---------
 drivers/ide/setup-pci.c           |  109 ++++++-----
 drivers/scsi/ide-scsi.c           |   32 +---
 include/linux/ide.h               |  193 +++++++++++++-------
 57 files changed, 1613 insertions(+), 1466 deletions(-)

Bartlomiej Zolnierkiewicz (40):
ide-pmac: store pmif instead of hwif in ->driver_data (take 2)
ide-pmac: add ->init_dev method (take 4)
ide-pmac: move ide_find_port() call to pmac_ide_setup_device() (take 2)
ide: move ide_pci_setup_ports() call out from do_ide_setup_pci_device()
ide: pass hw_regs_t-s to ide_device_add[_all]() (take 3)
ide: add ->read_sff_dma_status method
ide: use I/O ops directly in ide-dma.c
ide: remove ->dma_{status,command} fields from ide_hwif_t
ide: remove ide_setup_dma()
ide: factor out simplex handling from ide_pci_dma_base()
ide: add ->exec_command method
ide: add ->read_status method
ide: add ->read_altstatus method
ide: add ->set_irq method
ide: change order of register access in ide_config_drive_speed()
ide: use ->tf_load in ide_config_drive_speed()
ide: use ->tf_load in actual_try_to_identify()
ide: use ->tf_load in SELECT_DRIVE()
ide: use ->tf_read in ide_read_error()
ide: add ide_read_device() helper
ide: add ide_read_ireason() helper
ide: add ide_read_bcount_and_ireason() helper
ide: remove ->INB, ->OUTB and ->OUTBSYNC methods
ide: limit cy82c693 host driver to ALPHA
ide: mark hpt34x host driver as BROKEN
ide: remove dead Virtual DMA support
ide: filter out invalid transfer mode values in set_xfer_rate()
ide: filter out "default" transfer mode values in set_xfer_rate()
gayle: reserve memory resources at once
ide-generic: probing fix
ide: add 'config' field to hw_regs_t
ide: add struct ide_tp_ops (take 2)
ide: add struct ide_host (take 3)
ide: add ide_host_add() helper
ide: fix ide_host_register() return value
ide: fix IDE port slots reservation and freeing (take 2)
ide: move ide_remove_port_from_hwgroup() to ide-probe.c
ide: add ide_ports[]
ide: allocate ide_hwif_t instances dynamically
ide: add ide_host_free() helper (take 2)

Borislav Petkov (16):

      ide: push pc callback pointer into the ide_drive_t structure
      ide-floppy: use drive->pc_callback instead of pc->callback
      ide-tape: use drive->pc_callback instead of pc->callback
      ide-scsi: use drive->pc_callback instead of pc->callback
      ide: remove pc->callback member from ide_atapi_pc
      ide-floppy: pass packet command in rq->cmd
      ide-tape: make room for packet command ids in rq->cmd
      ide-tape: pass packet command in rq->cmd
      ide-scsi: pass packet command in rq->cmd
      ide: use rq->cmd instead of pc->c in atapi common code
      ide: add per-device flags
      ide-floppy: convert to using the new atapi_flags (take 2)
      ide-tape: convert to using the new atapi_flags
      ide-scsi: convert to using the new atapi_flags
      ide: remove unused PC_FLAG_DRQ_INTERRUPT
      ide-cd: convert to using the new atapi_flags

Darren Jenkins (1):
drivers/ide/ide-tape.c: remove double kfree

Harvey Harrison (2):
ide: ide-cd.c fix sparse endianness warnings
ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings

Pavel Machek (1):
ide: small whitespace fixes

drivers/ide/Kconfig +2 -0
index 15b09b8..04d9c4d 100644
@@ -510,6 +510,7 @@ config BLK_DEV_TRIFLEX
 
 config BLK_DEV_CY82C693
 	tristate "CY82C693 chipset support"
+	depends on ALPHA
 	select IDE_TIMINGS
 	select BLK_DEV_IDEDMA_PCI
 	help
@@ -548,6 +549,7 @@ config BLK_DEV_CS5535
 
 config BLK_DEV_HPT34X
 	tristate "HPT34X chipset support"
+	depends on BROKEN
 	select BLK_DEV_IDEDMA_PCI
 	help
 	  This driver adds up to 4 more EIDE devices sharing a single
drivers/ide/arm/icside.c +31 -40

134 lines not on this page · raw message

drivers/ide/arm/ide_arm.c +2 -12
index 2f311da..176532f 100644
@@ -28,10 +28,8 @@
 
 static int __init ide_arm_init(void)
 {
-	ide_hwif_t *hwif;
-	hw_regs_t hw;
 	unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;
-	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+	hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
 	if (!request_region(base, 8, DRV_NAME)) {
 		printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
@@ -51,15 +49,7 @@ static int __init ide_arm_init(void)
 	hw.irq = IDE_ARM_IRQ;
 	hw.chipset = ide_generic;
 
-	hwif = ide_find_port();
-	if (hwif) {
-		ide_init_port_hw(hwif, &hw);
-		idx[0] = hwif->index;
-
-		ide_device_add(idx, NULL);
-	}
-
-	return 0;
+	return ide_host_add(NULL, hws, NULL);
 }
 
 module_init(ide_arm_init);
drivers/ide/arm/palm_bk3710.c +9 -21
index c79b85b..65bb4b8 100644
@@ -316,15 +316,14 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
 static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
 					  const struct ide_port_info *d)
 {
-	unsigned long base =
-		hwif->io_ports.data_addr - IDE_PALM_ATA_PRI_REG_OFFSET;
-
 	printk(KERN_INFO "    %s: MMIO-DMA\n", hwif->name);
 
 	if (ide_allocate_dma_engine(hwif))
 		return -1;
 
-	ide_setup_dma(hwif, base);
+	hwif->dma_base = hwif->io_ports.data_addr - IDE_PALM_ATA_PRI_REG_OFFSET;
+
+	hwif->dma_ops = &sff_dma_ops;
 
 	return 0;
 }
@@ -348,11 +347,10 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 {
 	struct clk *clk;
 	struct resource *mem, *irq;
-	ide_hwif_t *hwif;
+	struct ide_host *host;
 	unsigned long base, rate;
-	int i;
-	hw_regs_t hw;
-	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+	int i, rc;
+	hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
 	clk = clk_get(NULL, "IDECLK");
 	if (IS_ERR(clk))
@@ -394,24 +392,14 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
 	hw.irq = irq->start;
 	hw.chipset = ide_palm3710;
 
-	hwif = ide_find_port();
-	if (hwif == NULL)
+	rc = ide_host_add(&palm_bk3710_port_info, hws, NULL);
+	if (rc)
 		goto out;
 
-	i = hwif->index;
-
-	ide_init_port_hw(hwif, &hw);
-
-	default_hwif_mmiops(hwif);
-
-	idx[0] = i;
-
-	ide_device_add(idx, &palm_bk3710_port_info);
-
 	return 0;
 out:
 	printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
-	return -ENODEV;
+	return rc;
 }
 
 /* work with hotplug and coldplug */
drivers/ide/arm/rapide.c +7 -17
index 43057e0..2bdd8b7 100644
@@ -32,11 +32,10 @@ static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base,
 static int __devinit
 rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
 {
-	ide_hwif_t *hwif;
 	void __iomem *base;
+	struct ide_host *host;
 	int ret;
-	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
-	hw_regs_t hw;
+	hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
 	ret = ecard_request_resources(ec);
 	if (ret)
@@ -53,20 +52,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
 	hw.chipset = ide_generic;
 	hw.dev = &ec->dev;
 
-	hwif = ide_find_port();
-	if (hwif == NULL) {
-		ret = -ENOENT;
+	ret = ide_host_add(&rapide_port_info, hws, &host);
+	if (ret)
 		goto release;
-	}
-
-	ide_init_port_hw(hwif, &hw);
-	default_hwif_mmiops(hwif);
-
-	idx[0] = hwif->index;
-
-	ide_device_add(idx, &rapide_port_info);
 
-	ecard_set_drvdata(ec, hwif);
+	ecard_set_drvdata(ec, host);
 	goto out;
 
  release:
@@ -77,11 +67,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
 
 static void __devexit rapide_remove(struct expansion_card *ec)
 {
-	ide_hwif_t *hwif = ecard_get_drvdata(ec);
+	struct ide_host *host = ecard_get_drvdata(ec);
 
 	ecard_set_drvdata(ec, NULL);
 
-	ide_unregister(hwif);
+	ide_host_remove(host);
 
 	ecard_release_resources(ec);
 }
drivers/ide/h8300/ide-h8300.c +20 -28

78 lines not on this page · raw message

drivers/ide/ide-atapi.c +38 -20

177 lines not on this page · raw message

drivers/ide/ide-cd.c +75 -82

392 lines not on this page · raw message

drivers/ide/ide-cd.h +0 -38
index fe0ea36..61a4599 100644
@@ -27,42 +27,6 @@
 #define ATAPI_CAPABILITIES_PAGE_SIZE		(8 + 20)
 #define ATAPI_CAPABILITIES_PAGE_PAD_SIZE	4
 
-enum {
-	/* Device sends an interrupt when ready for a packet command. */
-	IDE_CD_FLAG_DRQ_INTERRUPT	= (1 << 0),
-	/* Drive cannot lock the door. */
-	IDE_CD_FLAG_NO_DOORLOCK		= (1 << 1),
-	/* Drive cannot eject the disc. */
-	IDE_CD_FLAG_NO_EJECT		= (1 << 2),
-	/* Drive is a pre ATAPI 1.2 drive. */
-	IDE_CD_FLAG_PRE_ATAPI12		= (1 << 3),
-	/* TOC addresses are in BCD. */
-	IDE_CD_FLAG_TOCADDR_AS_BCD	= (1 << 4),
-	/* TOC track numbers are in BCD. */
-	IDE_CD_FLAG_TOCTRACKS_AS_BCD	= (1 << 5),
-	/*
-	 * Drive does not provide data in multiples of SECTOR_SIZE
-	 * when more than one interrupt is needed.
-	 */
-	IDE_CD_FLAG_LIMIT_NFRAMES	= (1 << 6),
-	/* Seeking in progress. */
-	IDE_CD_FLAG_SEEKING		= (1 << 7),
-	/* Driver has noticed a media change. */
-	IDE_CD_FLAG_MEDIA_CHANGED	= (1 << 8),
-	/* Saved TOC information is current. */
-	IDE_CD_FLAG_TOC_VALID		= (1 << 9),
-	/* We think that the drive door is locked. */
-	IDE_CD_FLAG_DOOR_LOCKED		= (1 << 10),
-	/* SET_CD_SPEED command is unsupported. */
-	IDE_CD_FLAG_NO_SPEED_SELECT	= (1 << 11),
-	IDE_CD_FLAG_VERTOS_300_SSD	= (1 << 12),
-	IDE_CD_FLAG_VERTOS_600_ESD	= (1 << 13),
-	IDE_CD_FLAG_SANYO_3CD		= (1 << 14),
-	IDE_CD_FLAG_FULL_CAPS_PAGE	= (1 << 15),
-	IDE_CD_FLAG_PLAY_AUDIO_OK	= (1 << 16),
-	IDE_CD_FLAG_LE_SPEED_FIELDS	= (1 << 17),
-};
-
 /* Structure of a MSF cdrom address. */
 struct atapi_msf {
 	byte reserved;
@@ -128,8 +92,6 @@ struct cdrom_info {
 	unsigned long last_block;
 	unsigned long start_seek;
 
-	unsigned int cd_flags;
-
 	u8 max_speed;		/* Max speed of the drive. */
 	u8 current_speed;	/* Current speed of the drive. */
 
drivers/ide/ide-cd_ioctl.c +16 -19
index 24d002a..74231b4 100644
@@ -27,10 +27,9 @@ int ide_cdrom_open_real(struct cdrom_device_info *cdi, int purpose)
 void ide_cdrom_release_real(struct cdrom_device_info *cdi)
 {
 	ide_drive_t *drive = cdi->handle;
-	struct cdrom_info *cd = drive->driver_data;
 
 	if (!cdi->use_count)
-		cd->cd_flags &= ~IDE_CD_FLAG_TOC_VALID;
+		drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID;
 }
 
 /*
@@ -83,13 +82,12 @@ int ide_cdrom_check_media_change_real(struct cdrom_device_info *cdi,
 				       int slot_nr)
 {
 	ide_drive_t *drive = cdi->handle;
-	struct cdrom_info *cd = drive->driver_data;
 	int retval;
 
 	if (slot_nr == CDSL_CURRENT) {
 		(void) cdrom_check_status(drive, NULL);
-		retval = (cd->cd_flags & IDE_CD_FLAG_MEDIA_CHANGED) ? 1 : 0;
-		cd->cd_flags &= ~IDE_CD_FLAG_MEDIA_CHANGED;
+		retval = (drive->atapi_flags & IDE_AFLAG_MEDIA_CHANGED) ? 1 : 0;
+		drive->atapi_flags &= ~IDE_AFLAG_MEDIA_CHANGED;
 		return retval;
 	} else {
 		return -EINVAL;
@@ -107,11 +105,11 @@ int cdrom_eject(ide_drive_t *drive, int ejectflag,
 	char loej = 0x02;
 	unsigned char cmd[BLK_MAX_CDB];
 
-	if ((cd->cd_flags & IDE_CD_FLAG_NO_EJECT) && !ejectflag)
+	if ((drive->atapi_flags & IDE_AFLAG_NO_EJECT) && !ejectflag)
 		return -EDRIVE_CANT_DO_THIS;
 
 	/* reload fails on some drives, if the tray is locked */
-	if ((cd->cd_flags & IDE_CD_FLAG_DOOR_LOCKED) && ejectflag)
+	if ((drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED) && ejectflag)
 		return 0;
 
 	/* only tell drive to close tray if open, if it can do that */
@@ -123,7 +121,7 @@ int cdrom_eject(ide_drive_t *drive, int ejectflag,
 	cmd[0] = GPCMD_START_STOP_UNIT;
 	cmd[4] = loej | (ejectflag != 0);
 
-	return ide_cd_queue_pc(drive, cmd, 0, NULL, 0, sense, 0, 0);
+	return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, sense, 0, 0);
 }
 
 /* Lock the door if LOCKFLAG is nonzero; unlock it otherwise. */
@@ -131,7 +129,6 @@ static
 int ide_cd_lockdoor(ide_drive_t *drive, int lockflag,
 		    struct request_sense *sense)
 {
-	struct cdrom_info *cd = drive->driver_data;
 	struct request_sense my_sense;
 	int stat;
 
@@ -139,7 +136,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag,
 		sense = &my_sense;
 
 	/* If the drive cannot lock the door, just pretend. */
-	if (cd->cd_flags & IDE_CD_FLAG_NO_DOORLOCK) {
+	if (drive->atapi_flags & IDE_AFLAG_NO_DOORLOCK) {
 		stat = 0;
 	} else {
 		unsigned char cmd[BLK_MAX_CDB];
@@ -149,7 +146,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag,
 		cmd[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL;
 		cmd[4] = lockflag ? 1 : 0;
 
-		stat = ide_cd_queue_pc(drive, cmd, 0, NULL, 0,
+		stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL,
 				       sense, 0, 0);
 	}
 
@@ -160,7 +157,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag,
 	    (sense->asc == 0x24 || sense->asc == 0x20)) {
 		printk(KERN_ERR "%s: door locking not supported\n",
 			drive->name);
-		cd->cd_flags |= IDE_CD_FLAG_NO_DOORLOCK;
+		drive->atapi_flags |= IDE_AFLAG_NO_DOORLOCK;
 		stat = 0;
 	}
 
@@ -170,9 +167,9 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag,
 
 	if (stat == 0) {
 		if (lockflag)
-			cd->cd_flags |= IDE_CD_FLAG_DOOR_LOCKED;
+			drive->atapi_flags |= IDE_AFLAG_DOOR_LOCKED;
 		else
-			cd->cd_flags &= ~IDE_CD_FLAG_DOOR_LOCKED;
+			drive->atapi_flags &= ~IDE_AFLAG_DOOR_LOCKED;
 	}
 
 	return stat;
@@ -231,7 +228,7 @@ int ide_cdrom_select_speed(struct cdrom_device_info *cdi, int speed)
 		cmd[5] = speed & 0xff;
 	}
 
-	stat = ide_cd_queue_pc(drive, cmd, 0, NULL, 0, &sense, 0, 0);
+	stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, &sense, 0, 0);
 
 	if (!ide_cdrom_get_capabilities(drive, buf)) {
 		ide_cdrom_update_speed(drive, buf);
@@ -250,7 +247,7 @@ int ide_cdrom_get_last_session(struct cdrom_device_info *cdi,
 	struct request_sense sense;
 	int ret;
 
-	if ((info->cd_flags & IDE_CD_FLAG_TOC_VALID) == 0 || !info->toc) {
+	if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0 || !info->toc) {
 		ret = ide_cd_read_toc(drive, &sense);
 		if (ret)
 			return ret;
@@ -308,7 +305,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
 	 * A reset will unlock the door. If it was previously locked,
 	 * lock it again.
 	 */
-	if (cd->cd_flags & IDE_CD_FLAG_DOOR_LOCKED)
+	if (drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED)
 		(void)ide_cd_lockdoor(drive, 1, &sense);
 
 	return ret;
@@ -324,7 +321,7 @@ static int ide_cd_get_toc_entry(ide_drive_t *drive, int track,
 	/*
 	 * don't serve cached data, if the toc isn't valid
 	 */
-	if ((info->cd_flags & IDE_CD_FLAG_TOC_VALID) == 0)
+	if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0)
 		return -EINVAL;
 
 	/* Check validity of requested track number. */
@@ -374,7 +371,7 @@ static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)
 	lba_to_msf(lba_start,   &cmd[3], &cmd[4], &cmd[5]);
 	lba_to_msf(lba_end - 1, &cmd[6], &cmd[7], &cmd[8]);
 
-	return ide_cd_queue_pc(drive, cmd, 0, NULL, 0, &sense, 0, 0);
+	return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, &sense, 0, 0);
 }
 
 static int ide_cd_read_tochdr(ide_drive_t *drive, void *arg)
drivers/ide/ide-disk.c +1 -1
index 3a2e802..df5fe57 100644
@@ -158,7 +158,7 @@ static void ide_tf_set_cmd(ide_drive_t *drive, ide_task_t *task, u8 dma)
 	write = (task->tf_flags & IDE_TFLAG_WRITE) ? 1 : 0;
 
 	if (dma)
-		index = drive->vdma ? 4 : 8;
+		index = 8;
 	else
 		index = drive->mult_count ? 0 : 4;
 
drivers/ide/ide-dma.c +63 -40

195 lines not on this page · raw message

drivers/ide/ide-floppy.c +38 -52

273 lines not on this page · raw message

drivers/ide/ide-generic.c +37 -36

117 lines not on this page · raw message

drivers/ide/ide-io.c +22 -20

136 lines not on this page · raw message

drivers/ide/ide-iops.c +156 -74

448 lines not on this page · raw message

drivers/ide/ide-lib.c +3 -14
index 13af72f..97fefab 100644
@@ -266,22 +266,11 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
 
 	rate = ide_rate_filter(drive, rate);
 
+	BUG_ON(rate < XFER_PIO_0);
+
 	if (rate >= XFER_PIO_0 && rate <= XFER_PIO_5)
 		return ide_set_pio_mode(drive, rate);
 
-	/*
-	 * TODO: transfer modes 0x00-0x07 passed from the user-space are
-	 * currently handled here which needs fixing (please note that such
-	 * case could happen iff the transfer mode has already been set on
-	 * the device by ide-proc.c::set_xfer_rate()).
-	 */
-	if (rate < XFER_PIO_0) {
-		if (hwif->host_flags & IDE_HFLAG_ABUSE_SET_DMA_MODE)
-			return ide_set_dma_mode(drive, rate);
-		else
-			return ide_config_drive_speed(drive, rate);
-	}
-
 	return ide_set_dma_mode(drive, rate);
 }
 
@@ -336,7 +325,7 @@ static void ide_dump_sector(ide_drive_t *drive)
 	else
 		task.tf_flags = IDE_TFLAG_IN_LBA | IDE_TFLAG_IN_DEVICE;
 
-	drive->hwif->tf_read(drive, &task);
+	drive->hwif->tp_ops->tf_read(drive, &task);
 
 	if (lba48 || (tf->device & ATA_LBA))
 		printk(", LBAsect=%llu",
drivers/ide/ide-pnp.c +12 -17
index 03f2ef5..bac9b39 100644
@@ -29,9 +29,10 @@ static struct pnp_device_id idepnp_devices[] = {
 
 static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 {
-	hw_regs_t hw;
-	ide_hwif_t *hwif;
+	struct ide_host *host;
 	unsigned long base, ctl;
+	int rc;
+	hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
 
 	printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n");
 
@@ -59,31 +60,25 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 	hw.irq = pnp_irq(dev, 0);
 	hw.chipset = ide_generic;
 
-	hwif = ide_find_port();
-	if (hwif) {
-		u8 index = hwif->index;
-		u8 idx[4] = { index, 0xff, 0xff, 0xff };
+	rc = ide_host_add(NULL, hws, &host);
+	if (rc)
+		goto out;
 
-		ide_init_port_hw(hwif, &hw);
-
-		pnp_set_drvdata(dev, hwif);
-
-		ide_device_add(idx, NULL);
-
-		return 0;
-	}
+	pnp_set_drvdata(dev, host);
 
+	return 0;
+out:
 	release_region(ctl, 1);
 	release_region(base, 8);
 
-	return -1;
+	return rc;
 }
 
 static void idepnp_remove(struct pnp_dev *dev)
 {
-	ide_hwif_t *hwif = pnp_get_drvdata(dev);
+	struct ide_host *host = pnp_get_drvdata(dev);
 
-	ide_unregister(hwif);
+	ide_host_remove(host);
 
 	release_region(pnp_port_start(dev, 1), 1);
 	release_region(pnp_port_start(dev, 0), 8);
drivers/ide/ide-probe.c +261 -105

630 lines not on this page · raw message

drivers/ide/ide-proc.c +2 -2
index 8af88bf..151c91e 100644

Lines of this file are not shown. View the raw message.

drivers/ide/ide-tape.c +55 -72

127 lines not on this page · raw message

drivers/ide/ide-taskfile.c +24 -14
index 1fbdb74..aeddbbd 100644

Lines of this file are not shown. View the raw message.

drivers/ide/ide.c +3 -46

49 lines not on this page · raw message

drivers/ide/legacy/buddha.c +8 -16
index 0497e7f..7c2afa9 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/falconide.c +40 -16

56 lines not on this page · raw message

drivers/ide/legacy/gayle.c +12 -27
index 7e74b20..dd5c467 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/ide-4drives.c +2 -18
index 89c8ff0..c76d55d 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/ide-cs.c +24 -30

54 lines not on this page · raw message

drivers/ide/legacy/ide_platform.c +10 -22
index a249562..051b4ab 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/macide.c +2 -13
index 0a6195b..a0bb167 100644

Lines of this file are not shown. View the raw message.

drivers/ide/legacy/q40ide.c +26 -21

47 lines not on this page · raw message

drivers/ide/mips/au1xxx-ide.c +29 -27

56 lines not on this page · raw message

drivers/ide/mips/swarm.c +7 -17
index 9f1212c..badf79f 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/aec62xx.c +0 -5
index ae7a432..fbc43e1 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/alim15x3.c +10 -2
index 80d19c0..5ef7817 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/amd74xx.c +0 -1
index 0bfcdd0..ef7d971 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/cmd640.c +6 -23
index 1ad1e23..e6c6200 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/cmd64x.c +6 -6
index cfa784b..ce58bfc 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/cs5520.c +4 -37

41 lines not on this page · raw message

drivers/ide/pci/cs5535.c +1 -2
index dc97c48..5404fe4 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/delkin_cb.c +8 -17
index 0106e2a..f84bfb4 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/hpt34x.c +0 -1
index 84c36c1..9e1d1c4 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/hpt366.c +15 -8
index 397c6cb..1f1135c 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/ns87415.c +58 -57

115 lines not on this page · raw message

drivers/ide/pci/pdc202xx_old.c +1 -2
index fca89ed..e54dc65 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/piix.c +2 -2
index f04738d..0ce41b4 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/scc_pata.c +86 -53

139 lines not on this page · raw message

drivers/ide/pci/serverworks.c +1 -3
index a1fb208..127ccb4 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/sgiioc4.c +39 -26

65 lines not on this page · raw message

drivers/ide/pci/siimage.c +3 -3
index 6e9d765..5965a35 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/sl82c105.c +2 -2
index 6efbde2..f82a650 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/tc86c001.c +9 -7
index 9b4b27a..477e197 100644

Lines of this file are not shown. View the raw message.

drivers/ide/pci/via82cxxx.c +0 -1
index e47384c..09dc480 100644

Lines of this file are not shown. View the raw message.

drivers/ide/ppc/pmac.c +131 -91

222 lines not on this page · raw message

drivers/ide/setup-pci.c +60 -49

109 lines not on this page · raw message

drivers/scsi/ide-scsi.c +10 -22
index f843c13..5385524 100644

Lines of this file are not shown. View the raw message.

include/linux/ide.h +124 -69

193 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.