From 3b76d12e0203972f2d1d09c478d1ebcc7409d0c3 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 23 May 2003 04:01:17 -0700 Subject: [PATCH] Add IDE support for VIA vt8237 southbridge. Add IDE support for VIA vt8237 southbridge. Author: Vojtech Pavlik --- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4c8f4240d33d..72a5252c144a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1127,6 +1127,7 @@ #define PCI_DEVICE_ID_VIA_8753_0 0x3128 #define PCI_DEVICE_ID_VIA_8233A 0x3147 #define PCI_DEVICE_ID_VIA_8752 0x3148 +#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149 #define PCI_DEVICE_ID_VIA_KN266 0x3156 #define PCI_DEVICE_ID_VIA_8754 0x3168 #define PCI_DEVICE_ID_VIA_8235 0x3177 @@ -1135,6 +1136,7 @@ #define PCI_DEVICE_ID_VIA_8377_0 0x3189 #define PCI_DEVICE_ID_VIA_KM400 0x3205 #define PCI_DEVICE_ID_VIA_P4M400 0x3209 +#define PCI_DEVICE_ID_VIA_8237 0x3227 #define PCI_DEVICE_ID_VIA_86C100A 0x6100 #define PCI_DEVICE_ID_VIA_8231 0x8231 #define PCI_DEVICE_ID_VIA_8231_4 0x8235 -- cgit v1.2.3 From e295deb066e8983096991fa1e4e15f3f03d90f95 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 23 May 2003 04:01:27 -0700 Subject: [PATCH] Intel ICH5 basic SATA support Add Intel ICH5 basic SATA support (from 2.4 by Andre Hedrick) and as a bonus kill duplicate entry in piix_pci_info[]. --- drivers/ide/pci/piix.c | 9 +++++++++ drivers/ide/pci/piix.h | 6 +++--- include/linux/pci_ids.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index e9952c84c236..e3302e156c16 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -142,6 +142,9 @@ static int piix_get_info (char *buffer, char **addr, off_t offset, int count) p += sprintf(p, "\nController: %d\n", i); p += sprintf(p, "\n Intel "); switch(dev->device) { + case PCI_DEVICE_ID_INTEL_82801EB_1: + p += sprintf(p, "PIIX4 SATA 150 "); + break; case PCI_DEVICE_ID_INTEL_82801BA_8: case PCI_DEVICE_ID_INTEL_82801BA_9: case PCI_DEVICE_ID_INTEL_82801CA_10: @@ -275,6 +278,9 @@ static u8 piix_ratemask (ide_drive_t *drive) u8 mode; switch(dev->device) { + case PCI_DEVICE_ID_INTEL_82801EB_1: + mode = 3; + break; /* UDMA 100 capable */ case PCI_DEVICE_ID_INTEL_82801BA_8: case PCI_DEVICE_ID_INTEL_82801BA_9: @@ -325,6 +331,7 @@ static u8 piix_ratemask (ide_drive_t *drive) static u8 piix_dma_2_pio (u8 xfer_rate) { switch(xfer_rate) { + case XFER_UDMA_6: case XFER_UDMA_5: case XFER_UDMA_4: case XFER_UDMA_3: @@ -603,6 +610,7 @@ no_dma_set: static unsigned int __devinit init_chipset_piix (struct pci_dev *dev, const char *name) { switch(dev->device) { + case PCI_DEVICE_ID_INTEL_82801EB_1: case PCI_DEVICE_ID_INTEL_82801AA_1: case PCI_DEVICE_ID_INTEL_82801AB_1: case PCI_DEVICE_ID_INTEL_82801BA_8: @@ -803,6 +811,7 @@ static struct pci_device_id piix_pci_tbl[] __devinitdata = { { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15}, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16}, { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17}, + { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18}, { 0, }, }; diff --git a/drivers/ide/pci/piix.h b/drivers/ide/pci/piix.h index 4502d2347112..87c8047da40b 100644 --- a/drivers/ide/pci/piix.h +++ b/drivers/ide/pci/piix.h @@ -291,10 +291,10 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = { .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, .bootable = ON_BOARD, .extra = 0, - },{ /* 17 */ + },{ /* 18 */ .vendor = PCI_VENDOR_ID_INTEL, - .device = PCI_DEVICE_ID_INTEL_82801DB_10, - .name = "ICH4", + .device = PCI_DEVICE_ID_INTEL_82801EB_1, + .name = "ICH5-SATA", .init_setup = init_setup_piix, .init_chipset = init_chipset_piix, .init_iops = NULL, diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 72a5252c144a..05774a1e2b50 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1895,6 +1895,7 @@ #define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc #define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd #define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0 +#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1 #define PCI_DEVICE_ID_INTEL_82801EB_2 0x24d2 #define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3 #define PCI_DEVICE_ID_INTEL_82801EB_4 0x24d4 -- cgit v1.2.3 From 7fc241996c5a97d1cca3ea71af341cfa77b82982 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 23 May 2003 04:01:47 -0700 Subject: [PATCH] add hwif->hold flag Add hwif->hold flag for hotswap interfaces. Initialize founded hwif in ide_register_hw(). Original patch by Benjamin Herrenschmidt. --- drivers/ide/ide.c | 4 ++++ include/linux/ide.h | 1 + 2 files changed, 5 insertions(+) (limited to 'include/linux') diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 5967fe433778..142a84ae4507 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -913,6 +913,8 @@ int ide_register_hw (hw_regs_t *hw, ide_hwif_t **hwifp) } for (index = 0; index < MAX_HWIFS; ++index) { hwif = &ide_hwifs[index]; + if (hwif->hold) + continue; if ((!hwif->present && !hwif->mate && !initializing) || (!hwif->hw.io_ports[IDE_DATA_OFFSET] && initializing)) goto found; @@ -924,6 +926,8 @@ int ide_register_hw (hw_regs_t *hw, ide_hwif_t **hwifp) found: if (hwif->present) ide_unregister(index); + else if (!hwif->hold) + init_hwif_data(index); if (hwif->present) return -1; memcpy(&hwif->hw, hw, sizeof(*hw)); diff --git a/include/linux/ide.h b/include/linux/ide.h index f773ff4268a9..9fd858147813 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1001,6 +1001,7 @@ typedef struct hwif_s { unsigned noprobe : 1; /* don't probe for this interface */ unsigned present : 1; /* this interface exists */ + unsigned hold : 1; /* this interface is always present */ unsigned serialized : 1; /* serialized all channel operation */ unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ unsigned reset : 1; /* reset after probe */ -- cgit v1.2.3 From 7b4e8ef02de20549fef6a44a451be44301d5e183 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 23 May 2003 04:18:59 -0700 Subject: [PATCH] SiS IDE driver fixes SiS IDE driver fixes by Lionel Bouton: - support for SiS655 - support for SiS630S/ET UDMA5 mode - corrected /proc/ide/sis output for ATA133 chipsets (drives' positions were swapped) - use of pci_read_config_byte() instead of direct PCI poking for SiS962+ detection --- drivers/ide/pci/sis5513.c | 113 ++++++++++++++++++++++++++-------------------- include/linux/pci_ids.h | 1 + 2 files changed, 65 insertions(+), 49 deletions(-) (limited to 'include/linux') diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 6f41eade2bfb..5b7d079bf96a 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -161,9 +161,10 @@ static const struct { { "SiS748", PCI_DEVICE_ID_SI_748, ATA_133, 0 }, { "SiS746", PCI_DEVICE_ID_SI_746, ATA_133, 0 }, { "SiS745", PCI_DEVICE_ID_SI_745, ATA_133, 0 }, - { "SiS740", PCI_DEVICE_ID_SI_740, ATA_100, 0 }, + { "SiS740", PCI_DEVICE_ID_SI_740, ATA_133, 0 }, { "SiS735", PCI_DEVICE_ID_SI_735, ATA_100, SIS5513_LATENCY }, { "SiS730", PCI_DEVICE_ID_SI_730, ATA_100a, SIS5513_LATENCY }, + { "SiS655", PCI_DEVICE_ID_SI_655, ATA_133, 0 }, { "SiS652", PCI_DEVICE_ID_SI_652, ATA_133, 0 }, { "SiS651", PCI_DEVICE_ID_SI_651, ATA_133, 0 }, { "SiS650", PCI_DEVICE_ID_SI_650, ATA_133, 0 }, @@ -257,8 +258,8 @@ static struct pci_dev *host_dev = NULL; static char* chipset_capability[] = { "ATA", "ATA 16", "ATA 33", "ATA 66", - "ATA 100", "ATA 100", - "ATA 133", "ATA 133" + "ATA 100 (1st gen)", "ATA 100 (2nd gen)", + "ATA 133 (1st gen)", "ATA 133 (2nd gen)" }; #if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) @@ -331,8 +332,8 @@ static char* get_drives_info (char *buffer, u8 pos) // Configuration space remapped to 0x70 drive_pci = 0x70; } - pci_read_config_dword(bmide_dev, (unsigned long)drive_pci+8*pos, ®dw0); - pci_read_config_dword(bmide_dev, (unsigned long)drive_pci+8*pos+4, ®dw1); + pci_read_config_dword(bmide_dev, (unsigned long)drive_pci+4*pos, ®dw0); + pci_read_config_dword(bmide_dev, (unsigned long)drive_pci+4*pos+8, ®dw1); p += sprintf(p, "Drive %d:\n", pos); } @@ -357,8 +358,7 @@ static char* get_drives_info (char *buffer, u8 pos) case ATA_100a: p += sprintf(p, cycle_time[(reg01 & 0x70) >> 4]); break; case ATA_100: case ATA_133a: p += sprintf(p, cycle_time[reg01 & 0x0F]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; + default: p += sprintf(p, "?"); break; } p += sprintf(p, " \t UDMA Cycle Time "); switch(chipset_family) { @@ -367,42 +367,39 @@ static char* get_drives_info (char *buffer, u8 pos) case ATA_100a: p += sprintf(p, cycle_time[(reg11 & 0x70) >> 4]); break; case ATA_100: case ATA_133a: p += sprintf(p, cycle_time[reg11 & 0x0F]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; + default: p += sprintf(p, "?"); break; } p += sprintf(p, "\n"); } + if (chipset_family < ATA_133) { /* else case TODO */ /* Data Active */ - p += sprintf(p, " Data Active Time "); - switch(chipset_family) { - case ATA_00: - case ATA_16: /* confirmed */ - case ATA_33: - case ATA_66: - case ATA_100a: p += sprintf(p, active_time[reg01 & 0x07]); break; - case ATA_100: - case ATA_133a: p += sprintf(p, active_time[(reg00 & 0x70) >> 4]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; - } - p += sprintf(p, " \t Data Active Time "); - switch(chipset_family) { - case ATA_00: - case ATA_16: - case ATA_33: - case ATA_66: - case ATA_100a: p += sprintf(p, active_time[reg11 & 0x07]); break; - case ATA_100: - case ATA_133a: p += sprintf(p, active_time[(reg10 & 0x70) >> 4]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; - } - p += sprintf(p, "\n"); + p += sprintf(p, " Data Active Time "); + switch(chipset_family) { + case ATA_00: + case ATA_16: /* confirmed */ + case ATA_33: + case ATA_66: + case ATA_100a: p += sprintf(p, active_time[reg01 & 0x07]); break; + case ATA_100: + case ATA_133a: p += sprintf(p, active_time[(reg00 & 0x70) >> 4]); break; + default: p += sprintf(p, "?"); break; + } + p += sprintf(p, " \t Data Active Time "); + switch(chipset_family) { + case ATA_00: + case ATA_16: + case ATA_33: + case ATA_66: + case ATA_100a: p += sprintf(p, active_time[reg11 & 0x07]); break; + case ATA_100: + case ATA_133a: p += sprintf(p, active_time[(reg10 & 0x70) >> 4]); break; + default: p += sprintf(p, "?"); break; + } + p += sprintf(p, "\n"); /* Data Recovery */ /* warning: may need (reg&0x07) for pre ATA66 chips */ - if (chipset_family < ATA_133) { p += sprintf(p, " Data Recovery Time %s \t Data Recovery Time %s\n", recovery_time[reg00 & 0x0f], recovery_time[reg10 & 0x0f]); } @@ -430,7 +427,6 @@ static int sis_get_info (char *buffer, char **addr, off_t offset, int count) p += sprintf(p, "\nSiS 5513 "); switch(chipset_family) { - case ATA_00: p += sprintf(p, "Unknown???"); break; case ATA_16: p += sprintf(p, "DMA 16"); break; case ATA_33: p += sprintf(p, "Ultra 33"); break; case ATA_66: p += sprintf(p, "Ultra 66"); break; @@ -867,6 +863,19 @@ static int sis5513_config_xfer_rate (ide_drive_t *drive) return sis5513_config_drive_xfer_rate(drive); } +/* Helper function used at init time + * returns a PCI device revision ID + * (used to detect different IDE controller versions) + */ +static u8 __init devfn_rev(int device, int function) +{ + u8 revision; + /* Find device */ + struct pci_dev* dev = pci_find_slot(0,PCI_DEVFN(device,function)); + pci_read_config_byte(dev, PCI_REVISION_ID, &revision); + return revision; +} + /* Chip detection and general config */ static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char *name) { @@ -887,26 +896,24 @@ static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char /* check 100/133 chipset family */ if (chipset_family == ATA_133) { u32 reg54h; - u16 reg02h; + u16 devid; pci_read_config_dword(dev, 0x54, ®54h); + /* SiS962 and above report 0x5518 dev id if high bit is cleared */ pci_write_config_dword(dev, 0x54, (reg54h & 0x7fffffff)); - pci_read_config_word(dev, 0x02, ®02h); + pci_read_config_word(dev, 0x02, &devid); + /* restore register 0x54 */ pci_write_config_dword(dev, 0x54, reg54h); + /* devid 5518 here means SiS962 or later - which supports ATA133 */ - if (reg02h != 0x5518) { + which supports ATA133. + These are refered by chipset_family = ATA133 + */ + if (devid != 0x5518) { u8 reg49h; - unsigned long sbrev; /* SiS961 family */ - - /* - * FIXME !!! GAK!!!!!!!!!! PCI DIRECT POKING - */ - outl(0x80001008, 0x0cf8); - sbrev = inl(0x0cfc); - pci_read_config_byte(dev, 0x49, ®49h); - if (((sbrev & 0xff) == 0x10) && (reg49h & 0x80)) + /* check isa bridge device rev id */ + if (((devfn_rev(2,0) & 0xff) == 0x10) && (reg49h & 0x80)) chipset_family = ATA_133a; else chipset_family = ATA_100; @@ -924,6 +931,14 @@ static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char u8 latency = (chipset_family == ATA_100)? 0x80 : 0x10; /* Lacking specs */ pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency); } + + /* Special case for SiS630 : 630S/ET is ATA_100a */ + if (SiSHostChipInfo[i].host_id == PCI_DEVICE_ID_SI_630) { + /* check host device rev id */ + if (devfn_rev(0,0) >= 0x30) { + chipset_family = ATA_100a; + } + } } /* Make general config ops here diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 05774a1e2b50..4f5fdde6dc4b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -557,6 +557,7 @@ #define PCI_DEVICE_ID_SI_650 0x0650 #define PCI_DEVICE_ID_SI_651 0x0651 #define PCI_DEVICE_ID_SI_652 0x0652 +#define PCI_DEVICE_ID_SI_655 0x0655 #define PCI_DEVICE_ID_SI_730 0x0730 #define PCI_DEVICE_ID_SI_630_VGA 0x6300 #define PCI_DEVICE_ID_SI_730_VGA 0x7300 -- cgit v1.2.3 From e9b2bbae4c642fab18fb4d1ce1202943c560abd2 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 23 May 2003 04:19:19 -0700 Subject: [PATCH] add hwif->rw_disk callout Add hwif->rw_disk callout (forward port of 2.4 Alan's work). "This allows us to remove the PDC4030 special case and also allows for the 372N clock switch stuff." --- drivers/ide/ide-disk.c | 43 ++++++++++++++++++++----------------------- drivers/ide/legacy/pdc4030.c | 8 +++++++- include/linux/ide.h | 4 ++++ 3 files changed, 31 insertions(+), 24 deletions(-) (limited to 'include/linux') diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 8ad09844971f..00985933a642 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -247,7 +247,7 @@ static ide_startstop_t write_intr (ide_drive_t *drive) * * Returns 0 on success. * - * Note that we may be called from two contexts - the do_rw_disk context + * Note that we may be called from two contexts - __ide_do_rw_disk() context * and IRQ context. The IRQ can happen any time after we've output the * full "mcount" number of sectors, so we must make sure we update the * state _before_ we output the final part of the data! @@ -351,11 +351,11 @@ static ide_startstop_t multwrite_intr (ide_drive_t *drive) } /* - * do_rw_disk() issues READ and WRITE commands to a disk, + * __ide_do_rw_disk() issues READ and WRITE commands to a disk, * using LBA if supported, or CHS otherwise, to address sectors. * It also takes care of issuing special DRIVE_CMDs. */ -static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block) +ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block) { ide_hwif_t *hwif = HWIF(drive); u8 lba48 = (drive->addressing == 1) ? 1 : 0; @@ -367,11 +367,6 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, secto if (driver_blocked) panic("Request while ide driver is blocked?"); -#if defined(CONFIG_BLK_DEV_PDC4030) || defined(CONFIG_BLK_DEV_PDC4030_MODULE) - if (IS_PDC4030_DRIVE) - return promise_rw_disk(drive, rq, block); -#endif /* CONFIG_BLK_DEV_PDC4030 */ - if (drive->using_tcq && idedisk_start_tag(drive, rq)) { if (!ata_pending_commands(drive)) BUG(); @@ -550,10 +545,11 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, secto } return ide_started; } - blk_dump_rq_flags(rq, "do_rw_disk - bad command"); + blk_dump_rq_flags(rq, "__ide_do_rw_disk - bad command"); ide_end_request(drive, 0, 0); return ide_stopped; } +EXPORT_SYMBOL_GPL(__ide_do_rw_disk); #else /* CONFIG_IDE_TASKFILE_IO */ @@ -562,15 +558,15 @@ static ide_startstop_t lba_28_rw_disk(ide_drive_t *, struct request *, unsigned static ide_startstop_t lba_48_rw_disk(ide_drive_t *, struct request *, unsigned long long); /* - * do_rw_disk() issues READ and WRITE commands to a disk, + * __ide_do_rw_disk() issues READ and WRITE commands to a disk, * using LBA if supported, or CHS otherwise, to address sectors. * It also takes care of issuing special DRIVE_CMDs. */ -static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block) +ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block) { BUG_ON(drive->blocked); if (!blk_fs_request(rq)) { - blk_dump_rq_flags(rq, "do_rw_disk - bad command"); + blk_dump_rq_flags(rq, "__ide_do_rw_disk - bad command"); ide_end_request(drive, 0, 0); return ide_stopped; } @@ -581,11 +577,6 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, secto * need to add split taskfile operations based on 28bit threshold. */ -#if defined(CONFIG_BLK_DEV_PDC4030) || defined(CONFIG_BLK_DEV_PDC4030_MODULE) - if (IS_PDC4030_DRIVE) - return promise_rw_disk(drive, rq, block); -#endif /* CONFIG_BLK_DEV_PDC4030 */ - if (drive->using_tcq && idedisk_start_tag(drive, rq)) { if (!ata_pending_commands(drive)) BUG(); @@ -601,6 +592,7 @@ static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, secto /* 28-bit CHS : DIE DIE DIE piece of legacy crap!!! */ return chs_rw_disk(drive, rq, (unsigned long) block); } +EXPORT_SYMBOL_GPL(__ide_do_rw_disk); static task_ioreg_t get_command (ide_drive_t *drive, int cmd) { @@ -760,6 +752,16 @@ static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, u #endif /* CONFIG_IDE_TASKFILE_IO */ +static ide_startstop_t ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector_t block) +{ + ide_hwif_t *hwif = HWIF(drive); + + if (hwif->rw_disk) + return hwif->rw_disk(drive, rq, block); + else + return __ide_do_rw_disk(drive, rq, block); +} + static int do_idedisk_flushcache(ide_drive_t *drive); static u8 idedisk_dump_status (ide_drive_t *drive, const char *msg, u8 stat) @@ -1541,11 +1543,6 @@ static void idedisk_setup (ide_drive_t *drive) struct hd_driveid *id = drive->id; unsigned long capacity; -#if 0 - if (IS_PDC4030_DRIVE) - DRIVER(drive)->do_request = promise_rw_disk; -#endif - idedisk_add_settings(drive); if (drive->id_read == 0) @@ -1674,7 +1671,7 @@ static ide_driver_t idedisk_driver = { .supports_dsc_overlap = 0, .cleanup = idedisk_cleanup, .flushcache = do_idedisk_flushcache, - .do_request = do_rw_disk, + .do_request = ide_do_rw_disk, .sense = idedisk_dump_status, .error = idedisk_error, .abort = idedisk_abort, diff --git a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c index c1c407319b4d..8a1967a7c525 100644 --- a/drivers/ide/legacy/pdc4030.c +++ b/drivers/ide/legacy/pdc4030.c @@ -94,6 +94,8 @@ #include "pdc4030.h" +static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block); + /* * promise_selectproc() is invoked by ide.c * in preparation for access to the specified drive. @@ -231,6 +233,10 @@ int __init setup_pdc4030(ide_hwif_t *hwif) /* DC4030 hosted drives need their own identify... */ hwif->identify = hwif2->identify = &pdc4030_identify; + /* Override the normal ide disk read/write. */ + hwif->rw_disk = promise_rw_disk; + hwif2->rw_disk = promise_rw_disk; + /* Shift the remaining interfaces up by one */ for (i=MAX_HWIFS-1 ; i > hwif->index+1 ; i--) { ide_hwif_t *h = &ide_hwifs[i]; @@ -803,7 +809,7 @@ ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task) } } -ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) +static ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) { /* The four drives on the two logical (one physical) interfaces are distinguished by writing the drive number (0-3) to the diff --git a/include/linux/ide.h b/include/linux/ide.h index 9fd858147813..a6166056977c 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -886,6 +886,8 @@ typedef struct hwif_s { struct pnp_dev *pnp_dev; /* for PnP devices */ + ide_startstop_t (*rw_disk)(ide_drive_t *, struct request *, sector_t); + #if 0 ide_hwif_ops_t *hwifops; #else @@ -1535,6 +1537,8 @@ extern u8 eighty_ninty_three (ide_drive_t *); extern int set_transfer(ide_drive_t *, ide_task_t *); extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *); +ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block); + /* * ide_system_bus_speed() returns what we think is the system VESA/PCI * bus speed (in MHz). This is used for calculating interface PIO timings. -- cgit v1.2.3