Commit c9c13c7b authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/hch/BK/xfs/linux-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents f67dd842 13c7e0d4
......@@ -177,14 +177,9 @@ int elevator_linus_merge(request_queue_t *q, struct request **req,
if (__rq->flags & (REQ_BARRIER | REQ_STARTED))
break;
/*
* simply "aging" of requests in queue
*/
if (elv_linus_sequence(__rq)-- <= 0)
break;
if (!(__rq->flags & REQ_CMD))
continue;
if (elv_linus_sequence(__rq) < bio_sectors(bio))
break;
......@@ -200,24 +195,20 @@ int elevator_linus_merge(request_queue_t *q, struct request **req,
}
}
return ret;
}
void elevator_linus_merge_cleanup(request_queue_t *q, struct request *req, int count)
{
struct list_head *entry;
BUG_ON(req->q != q);
/*
* second pass scan of requests that got passed over, if any
* if *req, it's either a seek or merge in the middle of the queue
*/
entry = &req->queuelist;
while ((entry = entry->next) != &q->queue_head) {
struct request *tmp;
tmp = list_entry_rq(entry);
elv_linus_sequence(tmp) -= count;
if (*req) {
struct list_head *entry = &(*req)->queuelist;
int cost = ret ? 1 : ELV_LINUS_SEEK_COST;
while ((entry = entry->next) != &q->queue_head) {
__rq = list_entry_rq(entry);
elv_linus_sequence(__rq) -= cost;
}
}
return ret;
}
void elevator_linus_merge_req(request_queue_t *q, struct request *req,
......@@ -260,8 +251,8 @@ int elevator_linus_init(request_queue_t *q, elevator_t *e)
if (!latency)
return -ENOMEM;
latency[READ] = 8192;
latency[WRITE] = 16384;
latency[READ] = 1024;
latency[WRITE] = 2048;
e->elevator_data = latency;
return 0;
......@@ -355,15 +346,6 @@ int elevator_global_init(void)
return 0;
}
void elv_merge_cleanup(request_queue_t *q, struct request *rq,
int nr_sectors)
{
elevator_t *e = &q->elevator;
if (e->elevator_merge_cleanup_fn)
e->elevator_merge_cleanup_fn(q, rq, nr_sectors);
}
int elv_merge(request_queue_t *q, struct request **rq, struct bio *bio)
{
elevator_t *e = &q->elevator;
......@@ -460,7 +442,6 @@ inline struct list_head *elv_get_sort_head(request_queue_t *q,
elevator_t elevator_linus = {
elevator_merge_fn: elevator_linus_merge,
elevator_merge_cleanup_fn: elevator_linus_merge_cleanup,
elevator_merge_req_fn: elevator_linus_merge_req,
elevator_next_req_fn: elevator_noop_next_request,
elevator_add_req_fn: elevator_linus_add_request,
......
......@@ -1508,7 +1508,6 @@ static int __make_request(request_queue_t *q, struct bio *bio)
req->biotail->bi_next = bio;
req->biotail = bio;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
elv_merge_cleanup(q, req, nr_sectors);
drive_stat_acct(req, nr_sectors, 0);
attempt_back_merge(q, req);
goto out;
......@@ -1532,7 +1531,6 @@ static int __make_request(request_queue_t *q, struct bio *bio)
req->hard_cur_sectors = cur_nr_sectors;
req->sector = req->hard_sector = sector;
req->nr_sectors = req->hard_nr_sectors += nr_sectors;
elv_merge_cleanup(q, req, nr_sectors);
drive_stat_acct(req, nr_sectors, 0);
attempt_front_merge(q, req);
goto out;
......
......@@ -16,20 +16,8 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_mbool ' Use multi-mode by default' CONFIG_IDEDISK_MULTI_MODE $CONFIG_BLK_DEV_IDEDISK
dep_mbool ' Auto-Geometry Resizing support' CONFIG_IDEDISK_STROKE $CONFIG_BLK_DEV_IDEDISK
define_bool CONFIG_BLK_DEV_IDEDISK_VENDOR n
dep_mbool ' Fujitsu Vendor Specific' CONFIG_BLK_DEV_IDEDISK_FUJITSU $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' IBM Vendor Specific' CONFIG_BLK_DEV_IDEDISK_IBM $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Maxtor Vendor Specific' CONFIG_BLK_DEV_IDEDISK_MAXTOR $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Quantum Vendor Specific' CONFIG_BLK_DEV_IDEDISK_QUANTUM $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Seagate Vendor Specific' CONFIG_BLK_DEV_IDEDISK_SEAGATE $CONFIG_BLK_DEV_IDEDISK_VENDOR
dep_mbool ' Western Digital Vendor Specific' CONFIG_BLK_DEV_IDEDISK_WD $CONFIG_BLK_DEV_IDEDISK_VENDOR
define_bool CONFIG_BLK_DEV_COMMERIAL n
dep_mbool ' TiVo Commerial Application Specific' CONFIG_BLK_DEV_TIVO $CONFIG_BLK_DEV_COMMERIAL
dep_tristate ' PCMCIA IDE support' CONFIG_BLK_DEV_IDECS $CONFIG_BLK_DEV_IDE $CONFIG_PCMCIA
dep_tristate ' Include IDE/ATAPI CDROM support' CONFIG_BLK_DEV_IDECD $CONFIG_BLK_DEV_IDE
dep_mbool ' Reduce media failure retries support' CONFIG_BLK_DEV_IDECD_BAILOUT $CONFIG_BLK_DEV_IDECD
#dep_tristate ' Include IDE/ATAPI TAPE support' CONFIG_BLK_DEV_IDETAPE $CONFIG_BLK_DEV_IDE
dep_tristate ' Include IDE/ATAPI FLOPPY support' CONFIG_BLK_DEV_IDEFLOPPY $CONFIG_BLK_DEV_IDE
dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE $CONFIG_SCSI
......@@ -45,7 +33,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
if [ "$CONFIG_PCI" = "y" ]; then
bool ' Generic PCI IDE chipset support' CONFIG_BLK_DEV_IDEPCI
if [ "$CONFIG_BLK_DEV_IDEPCI" = "y" ]; then
dep_bool ' Orphan Chipset Support' CONFIG_BLK_DEV_GENERIC $CONFIG_BLK_DEV_IDEPCI
dep_bool ' Generic PCI IDE Chipset Support' CONFIG_BLK_DEV_GENERIC $CONFIG_BLK_DEV_IDEPCI
bool ' Sharing PCI IDE interrupts support' CONFIG_IDEPCI_SHARE_IRQ
bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI
bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD
......@@ -55,44 +43,40 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ATA Work(s) In Progress (EXPERIMENTAL)' CONFIG_IDEDMA_PCI_WIP $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL
dep_bool ' Good-Bad DMA Model-Firmware (WIP)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_IDEDMA_PCI_WIP
# dep_bool ' Asynchronous DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL
define_bool CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI
# dep_bool ' Tag Command Queue DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_IDEDMA_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL
dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3
dep_bool ' AMD Viper support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' AMD Viper ATA-66 Override' CONFIG_AMD74XX_OVERRIDE $CONFIG_BLK_DEV_AMD74XX
dep_bool ' CMD64{3|6|8|9} chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' HPT34X AUTODMA support (WIP)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_IDEDMA_PCI_WIP
dep_bool ' HPT366/368/370 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_X86" = "y" -o "$CONFIG_IA64" = "y" ]; then
dep_mbool ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI
fi
dep_tristate ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3
dep_tristate ' AMD Viper support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' AMD Viper ATA-66 Override' CONFIG_AMD74XX_OVERRIDE $CONFIG_BLK_DEV_AMD74XX
dep_tristate ' CMD64{3|6|8|9} chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI
dep_mbool ' HPT34X AUTODMA support (WIP)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_IDEDMA_PCI_WIP
dep_tristate ' HPT366/368/370 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then
dep_mbool ' IT8172 IDE support' CONFIG_BLK_DEV_IT8172 $CONFIG_BLK_DEV_IDEDMA_PCI
fi
dep_bool ' nVidia NFORCE support' CONFIG_BLK_DEV_NFORCE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' NS87415 chipset support' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL
# dep_bool ' Pacific Digital ADMA100 basic support' CONFIG_BLK_DEV_ADMA100 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' PROMISE PDC202{46|62|65|67} support' CONFIG_BLK_DEV_PDC202XX_OLD $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX_OLD $CONFI_BLK_DEV_IDEDMA_PCI
dep_bool ' PROMISE PDC202{68|69|70|71|75|76|77} support' CONFIG_BLK_DEV_PDC202XX_NEW $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX
dep_bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86
dep_bool ' ServerWorks OSB4/CSB5/CSB6 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Silicon Image chipset support' CONFIG_BLK_DEV_SIIMAGE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_bool ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Tekram TRM290 chipset support' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' VIA82CXXX chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' nVidia NFORCE support' CONFIG_BLK_DEV_NFORCE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' NS87415 chipset support' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL
dep_tristate ' PROMISE PDC202{46|62|65|67} support' CONFIG_BLK_DEV_PDC202XX_OLD $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX_OLD $CONFI_BLK_DEV_IDEDMA_PCI
dep_tristate ' PROMISE PDC202{68|69|70|71|75|76|77} support' CONFIG_BLK_DEV_PDC202XX_NEW $CONFIG_BLK_DEV_IDEDMA_PCI
# FIXME - probably wants to be one for old and for new
dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX_NEW
dep_tristate ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86
dep_tristate ' ServerWorks OSB4/CSB5/CSB6 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Silicon Image chipset support' CONFIG_BLK_DEV_SIIMAGE $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86
dep_tristate ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' Tekram TRM290 chipset support' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_tristate ' VIA82CXXX chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI
if [ "$CONFIG_PPC" = "y" -o "$CONFIG_ARM" = "y" ]; then
dep_bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEPCI
dep_tristate ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEPCI
fi
fi
fi
......@@ -230,8 +214,4 @@ else
define_bool CONFIG_BLK_DEV_IDE_MODES n
fi
#dep_tristate 'Support for IDE Raid controllers (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL
#dep_tristate ' Support Promise software RAID (Fasttrak(tm)) (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID_PDC $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID
#dep_tristate ' Highpoint 370 software RAID (EXPERIMENTAL)' CONFIG_BLK_DEV_ATARAID_HPT $CONFIG_BLK_DEV_IDE $CONFIG_EXPERIMENTAL $CONFIG_BLK_DEV_ATARAID
endmenu
......@@ -19,21 +19,26 @@ ide-obj-y :=
subdir-$(CONFIG_BLK_DEV_IDEPCI) += pci
subdir-$(CONFIG_BLK_DEV_IDE) += legacy ppc arm pci
# First come modules that register themselves with the core
obj-y += pci/idedriver-pci.o
# Core IDE code - must come before legacy
obj-$(CONFIG_BLK_DEV_IDE) += ide-probe.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o
obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o
obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o
obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o
obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o
obj-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o
obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o
obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o
obj-$(CONFIG_PROC_FS) += ide-proc.o
obj-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o
ifeq ($(CONFIG_BLK_DEV_IDE),y)
obj-$(CONFIG_PROC_FS) += ide-proc.o
endif
ifeq ($(CONFIG_BLK_DEV_IDE),y)
obj-y += pci/idedriver-pci.o
obj-y += legacy/idedriver-legacy.o
obj-y += ppc/idedriver-ppc.o
obj-y += arm/idedriver-arm.o
......
......@@ -211,6 +211,8 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive)
return DRIVER(drive)->error(drive, "dma_intr", stat);
}
EXPORT_SYMBOL_GPL(ide_dma_intr);
static int ide_build_sglist (ide_drive_t *drive, struct request *rq)
{
ide_hwif_t *hwif = HWIF(drive);
......@@ -365,6 +367,8 @@ int ide_build_dmatable (ide_drive_t *drive, struct request *rq)
return 0; /* revert to PIO for this request */
}
EXPORT_SYMBOL_GPL(ide_build_dmatable);
/* Teardown mappings after DMA has completed. */
void ide_destroy_dmatable (ide_drive_t *drive)
{
......@@ -376,6 +380,8 @@ void ide_destroy_dmatable (ide_drive_t *drive)
HWIF(drive)->sg_dma_active = 0;
}
EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
static int config_drive_for_dma (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
......@@ -1019,4 +1025,4 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
BUG();
}
EXPORT_SYMBOL_GPL(ide_setup_dma);
......@@ -23,6 +23,8 @@
#include <asm/io.h>
#include <asm/bitops.h>
#include "ide_modes.h"
/*
* IDE library routines. These are plug in code that most
* drivers can use but occasionally may be weird enough
......@@ -186,3 +188,201 @@ int ide_dma_enable (ide_drive_t *drive)
}
EXPORT_SYMBOL(ide_dma_enable);
const ide_pio_timings_t ide_pio_timings[6] = {
{ 70, 165, 600 }, /* PIO Mode 0 */
{ 50, 125, 383 }, /* PIO Mode 1 */
{ 30, 100, 240 }, /* PIO Mode 2 */
{ 30, 80, 180 }, /* PIO Mode 3 with IORDY */
{ 25, 70, 120 }, /* PIO Mode 4 with IORDY */
{ 20, 50, 100 } /* PIO Mode 5 with IORDY (nonstandard) */
};
EXPORT_SYMBOL_GPL(ide_pio_timings);
/*
* Black list. Some drives incorrectly report their maximal PIO mode,
* at least in respect to CMD640. Here we keep info on some known drives.
*/
static struct ide_pio_info {
const char *name;
int pio;
} ide_pio_blacklist [] = {
/* { "Conner Peripherals 1275MB - CFS1275A", 4 }, */
{ "Conner Peripherals 540MB - CFS540A", 3 },
{ "WDC AC2700", 3 },
{ "WDC AC2540", 3 },
{ "WDC AC2420", 3 },
{ "WDC AC2340", 3 },
{ "WDC AC2250", 0 },
{ "WDC AC2200", 0 },
{ "WDC AC21200", 4 },
{ "WDC AC2120", 0 },
{ "WDC AC2850", 3 },
{ "WDC AC1270", 3 },
{ "WDC AC1170", 1 },
{ "WDC AC1210", 1 },
{ "WDC AC280", 0 },
/* { "WDC AC21000", 4 }, */
{ "WDC AC31000", 3 },
{ "WDC AC31200", 3 },
/* { "WDC AC31600", 4 }, */
{ "Maxtor 7131 AT", 1 },
{ "Maxtor 7171 AT", 1 },
{ "Maxtor 7213 AT", 1 },
{ "Maxtor 7245 AT", 1 },
{ "Maxtor 7345 AT", 1 },
{ "Maxtor 7546 AT", 3 },
{ "Maxtor 7540 AV", 3 },
{ "SAMSUNG SHD-3121A", 1 },
{ "SAMSUNG SHD-3122A", 1 },
{ "SAMSUNG SHD-3172A", 1 },
/* { "ST51080A", 4 },
* { "ST51270A", 4 },
* { "ST31220A", 4 },
* { "ST31640A", 4 },
* { "ST32140A", 4 },
* { "ST3780A", 4 },
*/
{ "ST5660A", 3 },
{ "ST3660A", 3 },
{ "ST3630A", 3 },
{ "ST3655A", 3 },
{ "ST3391A", 3 },
{ "ST3390A", 1 },
{ "ST3600A", 1 },
{ "ST3290A", 0 },
{ "ST3144A", 0 },
{ "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on */
/* drive) according to Seagates FIND-ATA program */
{ "QUANTUM ELS127A", 0 },
{ "QUANTUM ELS170A", 0 },
{ "QUANTUM LPS240A", 0 },
{ "QUANTUM LPS210A", 3 },
{ "QUANTUM LPS270A", 3 },
{ "QUANTUM LPS365A", 3 },
{ "QUANTUM LPS540A", 3 },
{ "QUANTUM LIGHTNING 540A", 3 },
{ "QUANTUM LIGHTNING 730A", 3 },
{ "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
{ "QUANTUM FIREBALL_640", 3 },
{ "QUANTUM FIREBALL_1080", 3 },
{ "QUANTUM FIREBALL_1280", 3 },
{ NULL, 0 }
};
/**
* ide_scan_pio_blacklist - check for a blacklisted drive
* @model: Drive model string
*
* This routine searches the ide_pio_blacklist for an entry
* matching the start/whole of the supplied model name.
*
* Returns -1 if no match found.
* Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
*/
static int ide_scan_pio_blacklist (char *model)
{
struct ide_pio_info *p;
for (p = ide_pio_blacklist; p->name != NULL; p++) {
if (strncmp(p->name, model, strlen(p->name)) == 0)
return p->pio;
}
return -1;
}
/**
* ide_get_best_pio_mode - get PIO mode fro drive
* @driver: drive to consider
* @mode_wanted: preferred mode
* @max_mode: highest allowed
* @d: pio data
*
* This routine returns the recommended PIO settings for a given drive,
* based on the drive->id information and the ide_pio_blacklist[].
* This is used by most chipset support modules when "auto-tuning".
*
* Drive PIO mode auto selection
*/
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d)
{
int pio_mode;
int cycle_time = 0;
int use_iordy = 0;
struct hd_driveid* id = drive->id;
int overridden = 0;
int blacklisted = 0;
if (mode_wanted != 255) {
pio_mode = mode_wanted;
} else if (!drive->id) {
pio_mode = 0;
} else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
overridden = 1;
blacklisted = 1;
use_iordy = (pio_mode > 2);
} else {
pio_mode = id->tPIO;
if (pio_mode > 2) { /* 2 is maximum allowed tPIO value */
pio_mode = 2;
overridden = 1;
}
if (id->field_valid & 2) { /* drive implements ATA2? */
if (id->capability & 8) { /* drive supports use_iordy? */
use_iordy = 1;
cycle_time = id->eide_pio_iordy;
if (id->eide_pio_modes & 7) {
overridden = 0;
if (id->eide_pio_modes & 4)
pio_mode = 5;
else if (id->eide_pio_modes & 2)
pio_mode = 4;
else
pio_mode = 3;
}
} else {
cycle_time = id->eide_pio;
}
}
#if 0
if (drive->id->major_rev_num & 0x0004) printk("ATA-2 ");
#endif
/*
* Conservative "downgrade" for all pre-ATA2 drives
*/
if (pio_mode && pio_mode < 4) {
pio_mode--;
overridden = 1;
#if 0
use_iordy = (pio_mode > 2);
#endif
if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time)
cycle_time = 0; /* use standard timing */
}
}
if (pio_mode > max_mode) {
pio_mode = max_mode;
cycle_time = 0;
}
if (d) {
d->pio_mode = pio_mode;
d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
d->use_iordy = use_iordy;
d->overridden = overridden;
d->blacklisted = blacklisted;
}
return pio_mode;
}
EXPORT_SYMBOL_GPL(ide_get_best_pio_mode);
......@@ -592,6 +592,7 @@ void probe_hwif (ide_hwif_t *hwif)
{
unsigned int unit;
unsigned long flags;
unsigned int irqd;
if (hwif->noprobe)
return;
......@@ -623,7 +624,12 @@ void probe_hwif (ide_hwif_t *hwif)
return;
}
if (hwif->hw.ack_intr && hwif->irq)
/*
* We must always disable IRQ, as probe_for_drive will assert IRQ, but
* we'll install our IRQ driver much later...
*/
irqd = hwif->irq;
if (irqd)
disable_irq(hwif->irq);
local_irq_set(flags);
......@@ -659,8 +665,12 @@ void probe_hwif (ide_hwif_t *hwif)
}
local_irq_restore(flags);
if (hwif->hw.ack_intr && hwif->irq)
enable_irq(hwif->irq);
/*
* Use cached IRQ number. It might be (and is...) changed by probe
* code above
*/
if (irqd)
enable_irq(irqd);
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
......
......@@ -194,6 +194,8 @@ int noautodma = 0;
int noautodma = 1;
#endif
EXPORT_SYMBOL(noautodma);
/*
* ide_modules keeps track of the available IDE chipset/probe/driver modules.
*/
......@@ -1376,7 +1378,6 @@ void ide_intr (int irq, void *dev_id, struct pt_regs *regs)
if ((handler = hwgroup->handler) == NULL ||
hwgroup->poll_timeout != 0) {
printk("ide_intr: unexpected interrupt!\n");
/*
* Not expecting an interrupt from this drive.
* That means this could be:
......
......@@ -16,8 +16,6 @@
* breaking the fragile cmd640.c support.
*/
#ifdef CONFIG_BLK_DEV_IDE_MODES
/*
* Standard (generic) timings for PIO modes, from ATA2 specification.
* These timings are for access to the IDE data port register *only*.
......@@ -38,199 +36,6 @@ typedef struct ide_pio_data_s {
unsigned int cycle_time;
} ide_pio_data_t;
#ifndef _IDE_C
int ide_scan_pio_blacklist (char *model);
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d);
extern const ide_pio_timings_t ide_pio_timings[6];
#else /* _IDE_C */
const ide_pio_timings_t ide_pio_timings[6] = {
{ 70, 165, 600 }, /* PIO Mode 0 */
{ 50, 125, 383 }, /* PIO Mode 1 */
{ 30, 100, 240 }, /* PIO Mode 2 */
{ 30, 80, 180 }, /* PIO Mode 3 with IORDY */
{ 25, 70, 120 }, /* PIO Mode 4 with IORDY */
{ 20, 50, 100 } /* PIO Mode 5 with IORDY (nonstandard) */
};
/*
* Black list. Some drives incorrectly report their maximal PIO mode,
* at least in respect to CMD640. Here we keep info on some known drives.
*/
static struct ide_pio_info {
const char *name;
int pio;
} ide_pio_blacklist [] = {
/* { "Conner Peripherals 1275MB - CFS1275A", 4 }, */
{ "Conner Peripherals 540MB - CFS540A", 3 },
{ "WDC AC2700", 3 },
{ "WDC AC2540", 3 },
{ "WDC AC2420", 3 },
{ "WDC AC2340", 3 },
{ "WDC AC2250", 0 },
{ "WDC AC2200", 0 },
{ "WDC AC21200", 4 },
{ "WDC AC2120", 0 },
{ "WDC AC2850", 3 },
{ "WDC AC1270", 3 },
{ "WDC AC1170", 1 },
{ "WDC AC1210", 1 },
{ "WDC AC280", 0 },
/* { "WDC AC21000", 4 }, */
{ "WDC AC31000", 3 },
{ "WDC AC31200", 3 },
/* { "WDC AC31600", 4 }, */
{ "Maxtor 7131 AT", 1 },
{ "Maxtor 7171 AT", 1 },
{ "Maxtor 7213 AT", 1 },
{ "Maxtor 7245 AT", 1 },
{ "Maxtor 7345 AT", 1 },
{ "Maxtor 7546 AT", 3 },
{ "Maxtor 7540 AV", 3 },
{ "SAMSUNG SHD-3121A", 1 },
{ "SAMSUNG SHD-3122A", 1 },
{ "SAMSUNG SHD-3172A", 1 },
/* { "ST51080A", 4 },
* { "ST51270A", 4 },
* { "ST31220A", 4 },
* { "ST31640A", 4 },
* { "ST32140A", 4 },
* { "ST3780A", 4 },
*/
{ "ST5660A", 3 },
{ "ST3660A", 3 },
{ "ST3630A", 3 },
{ "ST3655A", 3 },
{ "ST3391A", 3 },
{ "ST3390A", 1 },
{ "ST3600A", 1 },
{ "ST3290A", 0 },
{ "ST3144A", 0 },
{ "ST3491A", 1 }, /* reports 3, should be 1 or 2 (depending on */
/* drive) according to Seagates FIND-ATA program */
{ "QUANTUM ELS127A", 0 },
{ "QUANTUM ELS170A", 0 },
{ "QUANTUM LPS240A", 0 },
{ "QUANTUM LPS210A", 3 },
{ "QUANTUM LPS270A", 3 },
{ "QUANTUM LPS365A", 3 },
{ "QUANTUM LPS540A", 3 },
{ "QUANTUM LIGHTNING 540A", 3 },
{ "QUANTUM LIGHTNING 730A", 3 },
{ "QUANTUM FIREBALL_540", 3 }, /* Older Quantum Fireballs don't work */
{ "QUANTUM FIREBALL_640", 3 },
{ "QUANTUM FIREBALL_1080", 3 },
{ "QUANTUM FIREBALL_1280", 3 },
{ NULL, 0 }
};
/*
* This routine searches the ide_pio_blacklist for an entry
* matching the start/whole of the supplied model name.
*
* Returns -1 if no match found.
* Otherwise returns the recommended PIO mode from ide_pio_blacklist[].
*/
int ide_scan_pio_blacklist (char *model)
{
struct ide_pio_info *p;
for (p = ide_pio_blacklist; p->name != NULL; p++) {
if (strncmp(p->name, model, strlen(p->name)) == 0)
return p->pio;
}
return -1;
}
/*
* This routine returns the recommended PIO settings for a given drive,
* based on the drive->id information and the ide_pio_blacklist[].
* This is used by most chipset support modules when "auto-tuning".
*/
/*
* Drive PIO mode auto selection
*/
u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d)
{
int pio_mode;
int cycle_time = 0;
int use_iordy = 0;
struct hd_driveid* id = drive->id;
int overridden = 0;
int blacklisted = 0;
if (mode_wanted != 255) {
pio_mode = mode_wanted;
} else if (!drive->id) {
pio_mode = 0;
} else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
overridden = 1;
blacklisted = 1;
use_iordy = (pio_mode > 2);
} else {
pio_mode = id->tPIO;
if (pio_mode > 2) { /* 2 is maximum allowed tPIO value */
pio_mode = 2;
overridden = 1;
}
if (id->field_valid & 2) { /* drive implements ATA2? */
if (id->capability & 8) { /* drive supports use_iordy? */
use_iordy = 1;
cycle_time = id->eide_pio_iordy;
if (id->eide_pio_modes & 7) {
overridden = 0;
if (id->eide_pio_modes & 4)
pio_mode = 5;
else if (id->eide_pio_modes & 2)
pio_mode = 4;
else
pio_mode = 3;
}
} else {
cycle_time = id->eide_pio;
}
}
#if 0
if (drive->id->major_rev_num & 0x0004) printk("ATA-2 ");
#endif
/*
* Conservative "downgrade" for all pre-ATA2 drives
*/
if (pio_mode && pio_mode < 4) {
pio_mode--;
overridden = 1;
#if 0
use_iordy = (pio_mode > 2);
#endif
if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time)
cycle_time = 0; /* use standard timing */
}
}
if (pio_mode > max_mode) {
pio_mode = max_mode;
cycle_time = 0;
}
if (d) {
d->pio_mode = pio_mode;
d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
d->use_iordy = use_iordy;
d->overridden = overridden;
d->blacklisted = blacklisted;
}
return pio_mode;
}
#endif /* _IDE_C */
#endif /* CONFIG_BLK_DEV_IDE_MODES */
#endif /* _IDE_MODES_H */
......@@ -19,6 +19,7 @@ obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o
obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o
# Last of all
obj-$(CONFIG_BLK_DEV_HD) += hd.o
EXTRA_CFLAGS := -I../
......
......@@ -870,3 +870,4 @@ static int parse_hd_setup (char *line) {
}
__setup("hd=", parse_hd_setup);
module_init(hd_init);
......@@ -12,7 +12,6 @@ obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o
obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o
obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o
obj-$(CONFIG_BLK_DEV_GENERIC) += generic.o
obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o
obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o
#obj-$(CONFIG_BLK_DEV_HPT37X) += hpt37x.o
......@@ -34,6 +33,9 @@ obj-$(CONFIG_BLK_DEV_SLC90E66) += slc90e66.o
obj-$(CONFIG_BLK_DEV_TRM290) += trm290.o
obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o
# Must appear at the end of the block
obj-$(CONFIG_BLK_DEV_GENERIC) += generic.o
EXTRA_CFLAGS := -I../
include $(TOPDIR)/Rules.make
......@@ -38,8 +38,6 @@ static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count)
char *chipset_nums[] = {"error", "error", "error", "error",
"error", "error", "850UF", "860",
"860R", "865", "865R", "error" };
// char *modes_33[] = {};
// char *modes_34[] = {};
int i;
for (i = 0; i < n_aec_devs; i++) {
......@@ -516,22 +514,69 @@ static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init aec62xx_scan_pcidev (struct pci_dev *dev)
/**
* aec62xx_init_one - called when a AEC is found
* @dev: the aec62xx device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &aec62xx_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_ARTOP)
return 0;
for (d = aec62xx_chipsets;
d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* aec62xx_remove_one - called when an AEC is unplugged
* @dev: the device that was removed
*
* Disconnect an AEC device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void aec62xx_remove_one(struct pci_dev *dev)
{
panic("AEC62xx removal not yet supported");
}
static struct pci_device_id aec62xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3 },
{ PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP865R, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 },
{ 0, },
};
static struct pci_driver driver = {
name: "AEC62xx IDE",
id_table: aec62xx_pci_tbl,
probe: aec62xx_init_one,
remove: __devexit_p(aec62xx_remove_one),
};
static int aec62xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void aec62xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(aec62xx_ide_init);
module_exit(aec62xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for ARTOP AEC62xx IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -99,7 +99,7 @@ static void init_hwif_aec62xx(ide_hwif_t *);
static void init_dma_aec62xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t aec62xx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP850UF,
name: "AEC6210",
......@@ -113,7 +113,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860,
name: "AEC6260",
......@@ -127,7 +127,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP860R,
name: "AEC6260R",
......@@ -141,7 +141,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: NEVER_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865,
name: "AEC6X80",
......@@ -155,7 +155,7 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_ARTOP,
device: PCI_DEVICE_ID_ARTOP_ATP865R,
name: "AEC6X80R",
......@@ -169,11 +169,6 @@ static ide_pci_device_t aec62xx_chipsets[] __initdata = {
enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
bootable: OFF_BOARD,
extra: 0,
},{
vendor: 0,
device: 0,
channels: 0,
bootable: EOL,
}
};
......
......@@ -22,6 +22,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......@@ -623,9 +624,11 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char
/*
* We should only tune the 1533 enable if we are using an ALi
* North bridge
* North bridge. We might have no north found on some zany
* box without a device at 0:0.0. The ALi bridge will be at
* 0:0.0 so if we didn't find one we know what is cooking.
*/
if (north->vendor != PCI_VENDOR_ID_AL) {
if (north && north->vendor != PCI_VENDOR_ID_AL) {
local_irq_restore(flags);
return 0;
}
......@@ -841,45 +844,64 @@ extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/**
* init_setup_ali15x3 - set up an ALi15x3 IDE controller
* alim15x3_init_one - set up an ALi15x3 IDE controller
* @dev: PCI device to set up
* @d: IDE PCI structures
*
* Perform the actual set up for the ALi15x3.
* Perform the actual set up for an ALi15x3 that has been found by the
* hot plug layer.
*/
static void __init init_setup_ali15x3 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &ali15x3_chipsets[id->driver_data];
#if defined(CONFIG_SPARC64)
d->init_hwif = init_hwif_common_ali15x3;
#endif /* CONFIG_SPARC64 */
ide_setup_pci_device(dev, d);
return 0;
}
/**
* ali15x3_scan_pcidev - check for ali pci ide
* @dev: device found by IDE ordered scan
* ali15x3_remove_one - called with an ALi is unplugged
* @dev: the device that was removed
*
* If the device is a known ALi IDE controller we set it up and
* then return 1. If we do not know it, or set up fails we return 0
* and it will be offered to other drivers or taken generic
* Disconnect an ALi device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
int __init ali15x3_scan_pcidev (struct pci_dev *dev)
static void ali15x3_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("ALi removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_AL)
return 0;
static struct pci_device_id alim15x3_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0, },
};
for (d = ali15x3_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "ALI15x3 IDE",
id_table: alim15x3_pci_tbl,
probe: alim15x3_init_one,
remove: __devexit_p(ali15x3_remove_one),
};
static int ali15x3_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void ali15x3_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(ali15x3_ide_init);
module_exit(ali15x3_ide_exit);
MODULE_AUTHOR("Michael Aubry, Andrzej Krzysztofowicz, CJ, Andre Hedrick, Alan Cox");
MODULE_DESCRIPTION("PCI driver module for ALi 15x3 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,18 +25,16 @@ static ide_pci_host_proc_t ali_procs[] __initdata = {
};
#endif /* DISPLAY_ALI_TIMINGS && CONFIG_PROC_FS */
static void init_setup_ali15x3(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *);
static void init_hwif_common_ali15x3(ide_hwif_t *);
static void init_hwif_ali15x3(ide_hwif_t *);
static void init_dma_ali15x3(ide_hwif_t *, unsigned long);
static ide_pci_device_t ali15x3_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_AL,
device: PCI_DEVICE_ID_AL_M5229,
name: "ALI15X3",
init_setup: init_setup_ali15x3,
init_chipset: init_chipset_ali15x3,
init_iops: NULL,
init_hwif: init_hwif_ali15x3,
......
......@@ -7,6 +7,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -392,26 +393,60 @@ static void __init init_dma_amd74xx (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_amd74xx (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit amd74xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &amd74xx_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init amd74xx_scan_pcidev (struct pci_dev *dev)
/**
* amd74xx_remove_one - called with an AMD IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an AMD IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void amd74xx_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("AMD IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_AMD)
return 0;
static struct pci_device_id amd74xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7411, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_OPUS_7441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ 0, },
};
static struct pci_driver driver = {
name: "AMD IDE",
id_table: amd74xx_pci_tbl,
probe: amd74xx_init_one,
remove: __devexit_p(amd74xx_remove_one),
};
static int amd74xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
for (d = amd74xx_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static void amd74xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(amd74xx_ide_init);
module_exit(amd74xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for AMD IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,17 +25,15 @@ static ide_pci_host_proc_t amd74xx_procs[] __initdata = {
};
#endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_amd74xx(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *);
static void init_hwif_amd74xx(ide_hwif_t *);
static void init_dma_amd74xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t amd74xx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_COBRA_7401,
name: "AMD7401",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -45,11 +43,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7409,
name: "AMD7409",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -59,11 +56,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_VIPER_7411,
name: "AMD7411",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -73,11 +69,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_OPUS_7441,
name: "AMD7441",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......@@ -87,11 +82,10 @@ static ide_pci_device_t amd74xx_chipsets[] __initdata = {
enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
bootable: ON_BOARD,
extra: 0
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_AMD,
device: PCI_DEVICE_ID_AMD_8111_IDE,
name: "AMD8111",
init_setup: init_setup_amd74xx,
init_chipset: init_chipset_amd74xx,
init_iops: NULL,
init_hwif: init_hwif_amd74xx,
......
/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16
*
* linux/drivers/ide/cmd64x.c Version 1.22 June 9, 2000
* linux/drivers/ide/cmd64x.c Version 1.30 Sept 10, 2002
*
* cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
* Note, this driver is not used at all on other systems because
......@@ -15,6 +15,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
......@@ -727,10 +728,12 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
if (dev->device == PCI_DEVICE_ID_CMD_643)
hwif->ultra_mask = 0x80;
if (dev->device == PCI_DEVICE_ID_CMD_646)
{
if (class_rev > 0x04)
hwif->ultra_mask = 0x07;
else
hwif->ultra_mask = 0x80;
}
#ifdef CONFIG_BLK_DEV_IDEDMA
hwif->ide_dma_check = &cmd64x_config_drive_for_dma;
......@@ -758,10 +761,6 @@ static void __init init_hwif_cmd64x (ide_hwif_t *hwif)
#endif /* CONFIG_BLK_DEV_IDEDMA */
}
/**
* FIXME: not required ?
*/
static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase)
{
ide_setup_dma(hwif, dmabase, 8);
......@@ -769,30 +768,59 @@ static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cmd64x_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
/**
* FIXME: not required either ?
* cmd64x_remove_one - called with an CMD64x is unplugged
* @dev: the device that was removed
*
* Disconnect a CMD64x device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void __init init_setup_cmd64x (struct pci_dev *dev, ide_pci_device_t *d)
static void cmd64x_remove_one(struct pci_dev *dev)
{
ide_setup_pci_device(dev, d);
panic("CMD64x removal not yet supported");
}
int __init cmd64x_scan_pcidev (struct pci_dev *dev)
static struct pci_device_id cmd64x_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ 0, },
};
static struct pci_driver driver = {
name: "CMD64x IDE",
id_table: cmd64x_pci_tbl,
probe: cmd64x_init_one,
remove: __devexit_p(cmd64x_remove_one),
};
static int cmd64x_ide_init(void)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_CMD)
return 0;
return ide_pci_register_driver(&driver);
}
for (d = cmd64x_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static void cmd64x_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cmd64x_ide_init);
module_exit(cmd64x_ide_exit);
MODULE_AUTHOR("Eddie Dost, David Miller, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for CMD64x IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -79,17 +79,15 @@ static ide_pci_host_proc_t cmd64x_procs[] __initdata = {
};
#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_cmd64x(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *);
static void init_hwif_cmd64x(ide_hwif_t *);
static void init_dma_cmd64x(ide_hwif_t *, unsigned long);
static ide_pci_device_t cmd64x_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_643,
name: "CMD643",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......@@ -99,11 +97,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_646,
name: "CMD646",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......@@ -113,11 +110,10 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_648,
name: "CMD648",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......@@ -131,7 +127,6 @@ static ide_pci_device_t cmd64x_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_CMD_649,
name: "CMD649",
init_setup: init_setup_cmd64x,
init_chipset: init_chipset_cmd64x,
init_iops: NULL,
init_hwif: init_hwif_cmd64x,
......
/*
* linux/drivers/ide/cs5530.c Version 0.6 Mar. 18, 2000
* linux/drivers/ide/cs5530.c Version 0.7 Sept 10, 2002
*
* Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org>
* Ditto of GNU General Public License.
......@@ -12,6 +12,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -419,44 +420,56 @@ static void __init init_dma_cs5530 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/**
* init_setup_cs5530 - set up a CS5530 IDE
* @dev: PCI device
* @d: PCI ide device info
*
* FIXME: this function can go away too
*/
static void __init init_setup_cs5530 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cs5530_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
/**
* cs5530_scan_pcidev - set up any CS5530 device
* @dev: pci device to check
* cs5530_remove_one - called when a CS5530 is unplugged
* @dev: the device that was removed
*
* Check if the device is a 5530 IDE controller. If it is then
* claim and set up the interface. Return 1 if we claimed the
* interface or zero if it is not ours
* Disconnect an Cyrix device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
int __init cs5530_scan_pcidev (struct pci_dev *dev)
static void cs5530_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("Cyrix removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CYRIX)
return 0;
static struct pci_device_id cs5530_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = cs5530_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "CS5530 IDE",
id_table: cs5530_pci_tbl,
probe: cs5530_init_one,
remove: __devexit_p(cs5530_remove_one),
};
static int cs5530_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void cs5530_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cs5530_ide_init);
module_exit(cs5530_ide_exit);
MODULE_AUTHOR("Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Cyrix/NS 5530 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,17 +25,15 @@ static ide_pci_host_proc_t cs5530_procs[] __initdata = {
};
#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */
static void init_setup_cs5530(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_cs5530(struct pci_dev *, const char *);
static void init_hwif_cs5530(ide_hwif_t *);
static void init_dma_cs5530(ide_hwif_t *, unsigned long);
static ide_pci_device_t cs5530_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CYRIX,
device: PCI_DEVICE_ID_CYRIX_5530_IDE,
name: "CS5530",
init_setup: init_setup_cs5530,
init_chipset: init_chipset_cs5530,
init_iops: NULL,
init_hwif: init_hwif_cs5530,
......
/*
* linux/drivers/ide/cy82c693.c Version 0.34 Dec. 13, 1999
* linux/drivers/ide/cy82c693.c Version 0.40 Sep. 10, 2002
*
* Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>, Integrater
......@@ -29,8 +29,7 @@
* - first tests with DMA look okay, they seem to work, but there is a
* problem with sound - the BusMaster IDE TimeOut should fixed this
*
*
* History:
* Ancient History:
* AMH@1999-08-24: v0.34 init_cy82c693_chip moved to pci_init_cy82c693
* ASK@1999-01-23: v0.33 made a few minor code clean ups
* removed DMA clock speed setting by default
......@@ -46,6 +45,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/delay.h>
......@@ -418,29 +418,56 @@ void __init init_dma_cy82c693 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
void __init init_setup_cy82c693 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &cy82c693_chipsets[id->driver_data];
if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
return; /* CY82C693 is more than only a IDE controller */
return 0; /* CY82C693 is more than only a IDE controller */
ide_setup_pci_device(dev, d);
return 0;
}
int __init cy82c693_scan_pcidev (struct pci_dev *dev)
/**
* cy82c693_remove_one - called with an Cypress is unplugged
* @dev: the device that was removed
*
* Disconnect an Cypress device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void cy82c693_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("Cypress removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CONTAQ)
return 0;
static struct pci_device_id cy82c693_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = cy82c693_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "Cypress IDE",
id_table: cy82c693_pci_tbl,
probe: cy82c693_init_one,
remove: __devexit_p(cy82c693_remove_one),
};
static int cy82c693_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void cy82c693_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(cy82c693_ide_init);
module_exit(cy82c693_ide_exit);
MODULE_AUTHOR("Andreas Krebs, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for the Cypress CY82C693 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -64,17 +64,15 @@ typedef struct pio_clocks_s {
u8 time_8; /* clocks for 8bit (0xF0=Active/data, 0x0F=Recovery) */
} pio_clocks_t;
extern void init_setup_cy82c693(struct pci_dev *, ide_pci_device_t *);
extern unsigned int init_chipset_cy82c693(struct pci_dev *, const char *);
extern void init_hwif_cy82c693(ide_hwif_t *);
extern void init_dma_cy82c693(ide_hwif_t *, unsigned long);
static ide_pci_device_t cy82c693_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CONTAQ,
device: PCI_DEVICE_ID_CONTAQ_82C693,
name: "CY82C693",
init_setup: init_setup_cy82c693,
init_chipset: init_chipset_cy82c693,
init_iops: NULL,
init_hwif: init_hwif_cy82c693,
......
/*
* linux/drivers/ide/pci-orphan.c Version 0.01 December 8, 1997
* linux/drivers/ide/generic.c Version 0.10 Sept 11, 2002
*
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
*/
......@@ -9,6 +9,7 @@
#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -84,19 +85,10 @@ static void __init init_setup_unknown (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init generic_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
for (d = generic_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
#if 0
/* Logic to add back later on */
if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
ide_pci_device_t *unknown = unknown_chipset;
// unknown->vendor = dev->vendor;
......@@ -105,5 +97,75 @@ int __init generic_scan_pcidev (struct pci_dev *dev)
return 1;
}
return 0;
#endif
/**
* generic_init_one - called when a PIIX is found
* @dev: the generic device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &generic_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* generic_remove_one - called when PCI IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void generic_remove_one(struct pci_dev *dev)
{
panic("PCI IDE removal not yet supported");
}
static struct pci_device_id generic_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
{ 0, },
};
static struct pci_driver driver = {
name: "PCI IDE",
id_table: generic_pci_tbl,
probe: generic_init_one,
remove: __devexit_p(generic_remove_one),
};
static int generic_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void generic_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(generic_ide_init);
module_exit(generic_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for generic PCI IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -11,7 +11,7 @@ static void init_hwif_generic(ide_hwif_t *);
static void init_dma_generic(ide_hwif_t *, unsigned long);
static ide_pci_device_t generic_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87410,
name: "NS87410",
......@@ -25,7 +25,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
name: "SAMURAI",
......@@ -39,7 +39,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_HOLTEK,
device: PCI_DEVICE_ID_HOLTEK_6565,
name: "HT6565",
......@@ -53,7 +53,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8673F,
name: "UM8673F",
......@@ -67,7 +67,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886A,
name: "UM8886A",
......@@ -81,7 +81,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 5 */
vendor: PCI_VENDOR_ID_UMC,
device: PCI_DEVICE_ID_UMC_UM8886BF,
name: "UM8886BF",
......@@ -95,7 +95,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 6 */
vendor: PCI_VENDOR_ID_HINT,
device: PCI_DEVICE_ID_HINT_VXPROII_IDE,
name: "HINT_IDE",
......@@ -109,7 +109,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 7 */
vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C561,
name: "VIA_IDE",
......@@ -123,7 +123,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 8 */
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C558,
name: "OPTI621V",
......@@ -146,7 +146,7 @@ static ide_pci_device_t generic_chipsets[] __initdata = {
};
static ide_pci_device_t unknown_chipset[] __initdata = {
{
{ /* 0 */
vendor: 0,
device: 0,
name: "PCI_IDE",
......
/*
* linux/drivers/ide/hpt34x.c Version 0.31 June. 9, 2000
* linux/drivers/ide/hpt34x.c Version 0.40 Sept 10, 2002
*
* Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public License
......@@ -25,6 +25,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -321,34 +322,61 @@ static void __init init_dma_hpt34x (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_hpt34x (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
char *chipset_names[] = {"HPT343", "HPT345"};
ide_pci_device_t *d = &hpt34x_chipsets[id->driver_data];
static char *chipset_names[] = {"HPT343", "HPT345"};
u16 pcicmd = 0;
pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
strcpy(d->name, chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]);
d->name = chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0];
d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD;
ide_setup_pci_device(dev, d);
return 0;
}
int __init hpt34x_scan_pcidev (struct pci_dev *dev)
/**
* hpt34x_remove_one - called with an hpt34x is unplugged
* @dev: the device that was removed
*
* Disconnect an hpt34x device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void hpt34x_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("hpt34x removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_TTI)
return 0;
static struct pci_device_id hpt34x_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT343, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = hpt34x_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "HPT34x IDE",
id_table: hpt34x_pci_tbl,
probe: hpt34x_init_one,
remove: __devexit_p(hpt34x_remove_one),
};
static int hpt34x_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void hpt34x_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(hpt34x_ide_init);
module_exit(hpt34x_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Highpoint 34x IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -31,17 +31,15 @@ static ide_pci_host_proc_t hpt34x_procs[] __initdata = {
};
#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_hpt34x(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *);
static void init_hwif_hpt34x(ide_hwif_t *);
static void init_dma_hpt34x(ide_hwif_t *, unsigned long);
static ide_pci_device_t hpt34x_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT343,
name: "HPT34X",
init_setup: init_setup_hpt34x,
init_chipset: init_chipset_hpt34x,
init_iops: NULL,
init_hwif: init_hwif_hpt34x,
......
......@@ -44,6 +44,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -1167,23 +1168,70 @@ static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init hpt366_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_TTI)
return 0;
if (dev->device == PCI_DEVICE_ID_TTI_HPT343)
return 0;
/**
* hpt366_init_one - called when an HPT366 is found
* @dev: the hpt366 device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &hpt366_chipsets[id->driver_data];
for (d = hpt366_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* hpt366_remove_one - called when an HPT366 is unplugged
* @dev: the device that was removed
*
* Disconnect a HPT366 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void hpt366_remove_one(struct pci_dev *dev)
{
panic("HPT366 removal not yet supported");
}
static struct pci_device_id hpt366_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
{ 0, },
};
static struct pci_driver driver = {
name: "HPT366 IDE",
id_table: hpt366_pci_tbl,
probe: hpt366_init_one,
remove: __devexit_p(hpt366_remove_one),
};
static int hpt366_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void hpt366_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(hpt366_ide_init);
module_exit(hpt366_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Highpoint HPT366 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -442,7 +442,7 @@ static void init_hwif_hpt366(ide_hwif_t *);
static void init_dma_hpt366(ide_hwif_t *, unsigned long);
static ide_pci_device_t hpt366_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT366,
name: "HPT366",
......@@ -456,7 +456,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 240
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT372,
name: "HPT372A",
......@@ -470,7 +470,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT302,
name: "HPT302",
......@@ -484,7 +484,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT371,
name: "HPT371",
......@@ -498,7 +498,7 @@ static ide_pci_device_t hpt366_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_TTI,
device: PCI_DEVICE_ID_TTI_HPT374,
name: "HPT374",
......
......@@ -29,6 +29,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
......@@ -297,29 +298,56 @@ static void __init init_dma_it8172 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_it8172 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit it8172_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &it8172_chipsets[id->driver_data];
if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
return; /* IT8172 is more than only a IDE controller */
return 0; /* IT8172 is more than only a IDE controller */
ide_setup_pci_device(dev, d);
return 0;
}
static int __init it8172_scan_pcidev (struct pci_dev *dev)
/**
* it8172_remove_one - called with an IT8172 is unplugged
* @dev: the device that was removed
*
* Disconnect an IT8172 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void it8172_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("IT8172 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_ITE)
return 0;
static struct pci_device_id it8172_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_IT8172G, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = it8172_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "IT8172IDE",
id_table: it8172_pci_tbl,
probe: it8172_init_one,
remove: __devexit_p(it8172_remove_one),
};
static int it8172_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void it8172_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(it8172_ide_init);
module_exit(it8172_ide_exit);
MODULE_AUTHOR("SteveL@mvista.com");
MODULE_DESCRIPTION("PCI driver module for ITE 8172 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -20,7 +20,7 @@ static void init_hwif_it8172(ide_hwif_t *);
static void init_dma_it8172(ide_hwif_t *, unsigned long);
static ide_pci_device_t it8172_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_ITE,
device: PCI_DEVICE_ID_ITE_IT8172G,
name: "IT8172G",
......
/*
* linux/drivers/ide/ns87415.c Version 1.01 Mar. 18, 2000
* linux/drivers/ide/ns87415.c Version 2.00 Sep. 10, 2002
*
* Copyright (C) 1997-1998 Mark Lord <mlord@pobox.com>
* Copyright (C) 1998 Eddie C. Dost <ecd@skynet.be>
......@@ -9,6 +9,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/timer.h>
......@@ -229,26 +230,55 @@ static void __init init_dma_ns87415 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_ns87415 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &ns87415_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init ns87415_scan_pcidev (struct pci_dev *dev)
/**
* ns87415_remove_one - called with an NS87415 is unplugged
* @dev: the device that was removed
*
* Disconnect an NS87415 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void ns87415_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("NS87415 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_NS)
return 0;
static struct pci_device_id ns87415_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = ns87415_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "NS87415IDE",
id_table: ns87415_pci_tbl,
probe: ns87415_init_one,
remove: __devexit_p(ns87415_remove_one),
};
static int ns87415_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void ns87415_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(ns87415_ide_init);
module_exit(ns87415_ide_exit);
MODULE_AUTHOR("Mark Lord, Eddie Dost, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for NS87415 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -5,16 +5,14 @@
#include <linux/pci.h>
#include <linux/ide.h>
static void init_setup_ns87415(struct pci_dev *, ide_pci_device_t *);
static void init_hwif_ns87415(ide_hwif_t *);
static void init_dma_ns87415(ide_hwif_t *, unsigned long);
static ide_pci_device_t ns87415_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_NS,
device: PCI_DEVICE_ID_NS_87415,
name: "NS87415",
init_setup: init_setup_ns87415,
init_chipset: NULL,
init_iops: NULL,
init_hwif: init_hwif_ns87415,
......
......@@ -7,6 +7,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -91,8 +92,8 @@ static u8 nforce_ratemask (ide_drive_t *drive)
*/
static int nforce_tune_chipset (ide_drive_t *drive, u8 xferspeed)
{
u8 drive_pci[] = { 0x63, 0x62, 0x61, 0x60 };
u8 drive_pci2[] = { 0x5b, 0x5a, 0x59, 0x58 };
static const u8 drive_pci[] = { 0x63, 0x62, 0x61, 0x60 };
static const u8 drive_pci2[] = { 0x5b, 0x5a, 0x59, 0x58 };
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
......@@ -336,27 +337,55 @@ static void __init init_dma_nforce (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/* FIXME - not needed */
static void __init init_setup_nforce (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit nforce_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &nvidia_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init nforce_scan_pcidev (struct pci_dev *dev)
/**
* nforce_remove_one - called with an nForce is unplugged
* @dev: the device that was removed
*
* Disconnect an nForce device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void nforce_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("nForce removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_NVIDIA)
return 0;
static struct pci_device_id nforce_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = nvidia_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "nForce IDE",
id_table: nforce_pci_tbl,
probe: nforce_init_one,
remove: __devexit_p(nforce_remove_one),
};
static int nforce_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void nforce_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(nforce_ide_init);
module_exit(nforce_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for nVidia nForce IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,7 +25,6 @@ static ide_pci_host_proc_t nforce_procs[] __initdata = {
};
#endif /* defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_nforce(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_nforce(struct pci_dev *, const char *);
static void init_hwif_nforce(ide_hwif_t *);
static void init_dma_nforce(ide_hwif_t *, unsigned long);
......@@ -35,7 +34,6 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_NVIDIA,
device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
name: "NFORCE",
init_setup: init_setup_nforce,
init_chipset: init_chipset_nforce,
init_iops: NULL,
init_hwif: init_hwif_nforce,
......@@ -45,12 +43,8 @@ static ide_pci_device_t nvidia_chipsets[] __initdata = {
enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
bootable: ON_BOARD,
extra: 0,
},{
vendor: 0,
device: 0,
channels: 0,
bootable: EOL,
}
};
#endif /* NFORCE_H */
/*
* linux/drivers/ide/opti621.c Version 0.6 Jan 02, 1999
* linux/drivers/ide/opti621.c Version 0.7 Sept 10, 2002
*
* Copyright (C) 1996-1998 Linus Torvalds & authors (see below)
*/
......@@ -91,6 +91,7 @@
#define OPTI621_DEBUG /* define for debug messages */
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -363,21 +364,56 @@ static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init opti621_scan_pcidev (struct pci_dev *dev)
static int __devinit opti621_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &opti621_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
if (dev->vendor != PCI_VENDOR_ID_OPTI)
return 0;
/**
* opti621_remove_one - called with an Opti621 is unplugged
* @dev: the device that was removed
*
* Disconnect an Opti621 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void opti621_remove_one(struct pci_dev *dev)
{
panic("Opti621 removal not yet supported");
}
for (d = opti621_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_device_id opti621_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
static struct pci_driver driver = {
name: "Opti621 IDE",
id_table: opti621_pci_tbl,
probe: opti621_init_one,
remove: __devexit_p(opti621_remove_one),
};
static int opti621_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void opti621_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(opti621_ide_init);
module_exit(opti621_ide_exit);
MODULE_AUTHOR("Jaromir Koutek, Jan Harkes, Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Opti621 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -10,7 +10,7 @@ static void init_hwif_opti621(ide_hwif_t *);
static void init_dma_opti621(ide_hwif_t *, unsigned long);
static ide_pci_device_t opti621_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C621,
name: "OPTI621",
......@@ -24,7 +24,7 @@ static ide_pci_device_t opti621_chipsets[] __initdata = {
enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_OPTI,
device: PCI_DEVICE_ID_OPTI_82C825,
name: "OPTI621X",
......
/*
* linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
*
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
*
* Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
* compiled into the kernel if you have more than one card installed.
* Note that BIOS v1.29 is reported to fix the problem. Since this is
* safe chipset tuning, including this support is harmless
*
* Promise Ultra66 cards with BIOS v1.11 this
* compiled into the kernel if you have more than one card installed.
*
* Promise Ultra100 cards.
*
* The latest chipset code will support the following ::
* Three Ultra33 controllers and 12 drives.
* 8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
* The 8/4 ratio is a BIOS code limit by promise.
*
* UNLESS you enable "CONFIG_PDC202XX_BURST"
*
*/
/*
* Portions Copyright (C) 1999 Promise Technology, Inc.
* Author: Frank Tiernan (frankt@promise.com)
* Released under terms of General Public License
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/ide.h>
#include <asm/io.h>
#include <asm/irq.h>
#include "ide_modes.h"
#include "pdc202xx.h"
#define PDC202_DEBUG_CABLE 0
#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
#include <linux/stat.h>
#include <linux/proc_fs.h>
static u8 pdc202xx_proc = 0;
#define PDC202_MAX_DEVS 5
static struct pci_dev *pdc202_devs[PDC202_MAX_DEVS];
static int n_pdc202_devs;
static char * pdc202xx_info (char *buf, struct pci_dev *dev)
{
char *p = buf;
u32 bibma = pci_resource_start(dev, 4);
u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0;
u16 reg50h = 0, pmask = (1<<10), smask = (1<<11);
u8 hi = 0, lo = 0;
/*
* at that point bibma+0x2 et bibma+0xa are byte registers
* to investigate:
*/
u8 c0 = inb_p((u16)bibma + 0x02);
u8 c1 = inb_p((u16)bibma + 0x0a);
u8 sc11 = inb_p((u16)bibma + 0x11);
u8 sc1a = inb_p((u16)bibma + 0x1a);
u8 sc1b = inb_p((u16)bibma + 0x1b);
u8 sc1c = inb_p((u16)bibma + 0x1c);
u8 sc1d = inb_p((u16)bibma + 0x1d);
u8 sc1e = inb_p((u16)bibma + 0x1e);
u8 sc1f = inb_p((u16)bibma + 0x1f);
pci_read_config_word(dev, 0x50, &reg50h);
pci_read_config_dword(dev, 0x60, &reg60h);
pci_read_config_dword(dev, 0x64, &reg64h);
pci_read_config_dword(dev, 0x68, &reg68h);
pci_read_config_dword(dev, 0x6c, &reg6ch);
p += sprintf(p, "\n ");
switch(dev->device) {
case PCI_DEVICE_ID_PROMISE_20267:
p += sprintf(p, "Ultra100"); break;
case PCI_DEVICE_ID_PROMISE_20265:
p += sprintf(p, "Ultra100 on M/B"); break;
case PCI_DEVICE_ID_PROMISE_20263:
p += sprintf(p, "FastTrak 66"); break;
case PCI_DEVICE_ID_PROMISE_20262:
p += sprintf(p, "Ultra66"); break;
case PCI_DEVICE_ID_PROMISE_20246:
p += sprintf(p, "Ultra33");
reg50h |= 0x0c00;
break;
default:
p += sprintf(p, "Ultra Series"); break;
}
p += sprintf(p, " Chipset.\n");
p += sprintf(p, "------------------------------- General Status "
"---------------------------------\n");
p += sprintf(p, "Burst Mode : %sabled\n",
(sc1f & 0x01) ? "en" : "dis");
p += sprintf(p, "Host Mode : %s\n",
(sc1f & 0x08) ? "Tri-Stated" : "Normal");
p += sprintf(p, "Bus Clocking : %s\n",
((sc1f & 0xC0) == 0xC0) ? "100 External" :
((sc1f & 0x80) == 0x80) ? "66 External" :
((sc1f & 0x40) == 0x40) ? "33 External" : "33 PCI Internal");
p += sprintf(p, "IO pad select : %s mA\n",
((sc1c & 0x03) == 0x03) ? "10" :
((sc1c & 0x02) == 0x02) ? "8" :
((sc1c & 0x01) == 0x01) ? "6" :
((sc1c & 0x00) == 0x00) ? "4" : "??");
SPLIT_BYTE(sc1e, hi, lo);
p += sprintf(p, "Status Polling Period : %d\n", hi);
p += sprintf(p, "Interrupt Check Status Polling Delay : %d\n", lo);
p += sprintf(p, "--------------- Primary Channel "
"---------------- Secondary Channel "
"-------------\n");
p += sprintf(p, " %s %s\n",
(c0&0x80)?"disabled":"enabled ",
(c1&0x80)?"disabled":"enabled ");
p += sprintf(p, "66 Clocking %s %s\n",
(sc11&0x02)?"enabled ":"disabled",
(sc11&0x08)?"enabled ":"disabled");
p += sprintf(p, " Mode %s Mode %s\n",
(sc1a & 0x01) ? "MASTER" : "PCI ",
(sc1b & 0x01) ? "MASTER" : "PCI ");
p += sprintf(p, " %s %s\n",
(sc1d & 0x08) ? "Error " :
((sc1d & 0x05) == 0x05) ? "Not My INTR " :
(sc1d & 0x04) ? "Interrupting" :
(sc1d & 0x02) ? "FIFO Full " :
(sc1d & 0x01) ? "FIFO Empty " : "????????????",
(sc1d & 0x80) ? "Error " :
((sc1d & 0x50) == 0x50) ? "Not My INTR " :
(sc1d & 0x40) ? "Interrupting" :
(sc1d & 0x20) ? "FIFO Full " :
(sc1d & 0x10) ? "FIFO Empty " : "????????????");
p += sprintf(p, "--------------- drive0 --------- drive1 "
"-------- drive0 ---------- drive1 ------\n");
p += sprintf(p, "DMA enabled: %s %s "
" %s %s\n",
(c0&0x20)?"yes":"no ", (c0&0x40)?"yes":"no ",
(c1&0x20)?"yes":"no ", (c1&0x40)?"yes":"no ");
p += sprintf(p, "DMA Mode: %s %s "
" %s %s\n",
pdc202xx_ultra_verbose(reg60h, (reg50h & pmask)),
pdc202xx_ultra_verbose(reg64h, (reg50h & pmask)),
pdc202xx_ultra_verbose(reg68h, (reg50h & smask)),
pdc202xx_ultra_verbose(reg6ch, (reg50h & smask)));
p += sprintf(p, "PIO Mode: %s %s "
" %s %s\n",
pdc202xx_pio_verbose(reg60h),
pdc202xx_pio_verbose(reg64h),
pdc202xx_pio_verbose(reg68h),
pdc202xx_pio_verbose(reg6ch));
#if 0
p += sprintf(p, "--------------- Can ATAPI DMA ---------------\n");
#endif
return (char *)p;
}
static char * pdc202xx_info_new (char *buf, struct pci_dev *dev)
{
char *p = buf;
// u32 bibma = pci_resource_start(dev, 4);
// u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0;
// u16 reg50h = 0, word88 = 0;
// int udmasel[4]={0,0,0,0}, piosel[4]={0,0,0,0}, i=0, hd=0;
p += sprintf(p, "\n ");
switch(dev->device) {
case PCI_DEVICE_ID_PROMISE_20277:
p += sprintf(p, "SBFastTrak 133 Lite"); break;
case PCI_DEVICE_ID_PROMISE_20276:
p += sprintf(p, "MBFastTrak 133 Lite"); break;
case PCI_DEVICE_ID_PROMISE_20275:
p += sprintf(p, "MBUltra133"); break;
case PCI_DEVICE_ID_PROMISE_20271:
p += sprintf(p, "FastTrak TX2000"); break;
case PCI_DEVICE_ID_PROMISE_20270:
p += sprintf(p, "FastTrak LP/TX2/TX4"); break;
case PCI_DEVICE_ID_PROMISE_20269:
p += sprintf(p, "Ultra133 TX2"); break;
case PCI_DEVICE_ID_PROMISE_20268:
p += sprintf(p, "Ultra100 TX2"); break;
default:
p += sprintf(p, "Ultra series"); break;
break;
}
p += sprintf(p, " Chipset.\n");
return (char *)p;
}
static int pdc202xx_get_info (char *buffer, char **addr, off_t offset, int count)
{
char *p = buffer;
int i;
for (i = 0; i < n_pdc202_devs; i++) {
struct pci_dev *dev = pdc202_devs[i];
switch(dev->device) {
case PCI_DEVICE_ID_PROMISE_20277:
case PCI_DEVICE_ID_PROMISE_20276:
case PCI_DEVICE_ID_PROMISE_20275:
case PCI_DEVICE_ID_PROMISE_20271:
case PCI_DEVICE_ID_PROMISE_20269:
case PCI_DEVICE_ID_PROMISE_20268:
case PCI_DEVICE_ID_PROMISE_20270:
p = pdc202xx_info_new(buffer, dev);
break;
default:
p = pdc202xx_info(buffer, dev);
break;
}
}
return p-buffer; /* => must be less than 4k! */
}
#endif /* defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) */
static u8 pdc202xx_ratemask (ide_drive_t *drive)
{
u8 mode;
switch(HWIF(drive)->pci_dev->device) {
case PCI_DEVICE_ID_PROMISE_20277:
case PCI_DEVICE_ID_PROMISE_20276:
case PCI_DEVICE_ID_PROMISE_20275:
case PCI_DEVICE_ID_PROMISE_20271:
case PCI_DEVICE_ID_PROMISE_20269:
mode = 4;
break;
case PCI_DEVICE_ID_PROMISE_20270:
case PCI_DEVICE_ID_PROMISE_20268:
mode = 3;
break;
case PCI_DEVICE_ID_PROMISE_20267:
case PCI_DEVICE_ID_PROMISE_20265:
mode = 3;
break;
case PCI_DEVICE_ID_PROMISE_20263:
case PCI_DEVICE_ID_PROMISE_20262:
mode = 2;
break;
case PCI_DEVICE_ID_PROMISE_20246:
return 1;
default:
return 0;
}
if (!eighty_ninty_three(drive))
mode = min(mode, (u8)1);
return mode;
}
static int check_in_drive_lists (ide_drive_t *drive, const char **list)
{
struct hd_driveid *id = drive->id;
if (pdc_quirk_drives == list) {
while (*list) {
if (strstr(id->model, *list++)) {
return 2;
}
}
} else {
while (*list) {
if (!strcmp(*list++,id->model)) {
return 1;
}
}
}
return 0;
}
static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u8 drive_pci = 0x60 + (drive->dn << 2);
u8 speed = ide_rate_filter(pdc202xx_ratemask(drive), xferspeed);
u32 drive_conf;
u8 AP, BP, CP, DP;
u8 TA = 0, TB = 0, TC = 0;
if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0))
return -1;
pci_read_config_dword(dev, drive_pci, &drive_conf);
pci_read_config_byte(dev, (drive_pci), &AP);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
pci_read_config_byte(dev, (drive_pci)|0x02, &CP);
pci_read_config_byte(dev, (drive_pci)|0x03, &DP);
if (speed < XFER_SW_DMA_0) {
if ((AP & 0x0F) || (BP & 0x07)) {
/* clear PIO modes of lower 8421 bits of A Register */
pci_write_config_byte(dev, (drive_pci), AP &~0x0F);
pci_read_config_byte(dev, (drive_pci), &AP);
/* clear PIO modes of lower 421 bits of B Register */
pci_write_config_byte(dev, (drive_pci)|0x01, BP &~0x07);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
pci_read_config_byte(dev, (drive_pci), &AP);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
}
#ifdef CONFIG_BLK_DEV_IDEDMA
} else {
if ((BP & 0xF0) && (CP & 0x0F)) {
/* clear DMA modes of upper 842 bits of B Register */
/* clear PIO forced mode upper 1 bit of B Register */
pci_write_config_byte(dev, (drive_pci)|0x01, BP &~0xF0);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
/* clear DMA modes of lower 8421 bits of C Register */
pci_write_config_byte(dev, (drive_pci)|0x02, CP &~0x0F);
pci_read_config_byte(dev, (drive_pci)|0x02, &CP);
}
#endif /* CONFIG_BLK_DEV_IDEDMA */
}
pci_read_config_byte(dev, (drive_pci), &AP);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
pci_read_config_byte(dev, (drive_pci)|0x02, &CP);
switch(speed) {
#ifdef CONFIG_BLK_DEV_IDEDMA
case XFER_UDMA_6: speed = XFER_UDMA_5;
case XFER_UDMA_5:
case XFER_UDMA_4: TB = 0x20; TC = 0x01; break;
case XFER_UDMA_2: TB = 0x20; TC = 0x01; break;
case XFER_UDMA_3:
case XFER_UDMA_1: TB = 0x40; TC = 0x02; break;
case XFER_UDMA_0:
case XFER_MW_DMA_2: TB = 0x60; TC = 0x03; break;
case XFER_MW_DMA_1: TB = 0x60; TC = 0x04; break;
case XFER_MW_DMA_0:
case XFER_SW_DMA_2: TB = 0x60; TC = 0x05; break;
case XFER_SW_DMA_1: TB = 0x80; TC = 0x06; break;
case XFER_SW_DMA_0: TB = 0xC0; TC = 0x0B; break;
#endif /* CONFIG_BLK_DEV_IDEDMA */
case XFER_PIO_4: TA = 0x01; TB = 0x04; break;
case XFER_PIO_3: TA = 0x02; TB = 0x06; break;
case XFER_PIO_2: TA = 0x03; TB = 0x08; break;
case XFER_PIO_1: TA = 0x05; TB = 0x0C; break;
case XFER_PIO_0:
default: TA = 0x09; TB = 0x13; break;
}
if (speed < XFER_SW_DMA_0) {
pci_write_config_byte(dev, (drive_pci), AP|TA);
pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB);
#ifdef CONFIG_BLK_DEV_IDEDMA
} else {
pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB);
pci_write_config_byte(dev, (drive_pci)|0x02, CP|TC);
#endif /* CONFIG_BLK_DEV_IDEDMA */
}
#if PDC202XX_DECODE_REGISTER_INFO
pci_read_config_byte(dev, (drive_pci), &AP);
pci_read_config_byte(dev, (drive_pci)|0x01, &BP);
pci_read_config_byte(dev, (drive_pci)|0x02, &CP);
pci_read_config_byte(dev, (drive_pci)|0x03, &DP);
decode_registers(REG_A, AP);
decode_registers(REG_B, BP);
decode_registers(REG_C, CP);
decode_registers(REG_D, DP);
#endif /* PDC202XX_DECODE_REGISTER_INFO */
#if PDC202XX_DEBUG_DRIVE_INFO
printk("%s: %s drive%d 0x%08x ",
drive->name, ide_xfer_verbose(speed),
drive->dn, drive_conf);
pci_read_config_dword(dev, drive_pci, &drive_conf);
printk("0x%08x\n", drive_conf);
#endif /* PDC202XX_DEBUG_DRIVE_INFO */
return (ide_config_drive_speed(drive, speed));
}
static int pdc202xx_new_tune_chipset (ide_drive_t *drive, u8 xferspeed)
{
ide_hwif_t *hwif = HWIF(drive);
#ifdef CONFIG_BLK_DEV_IDEDMA
u32 indexreg = hwif->dma_vendor1;
u32 datareg = hwif->dma_vendor3;
#else /* !CONFIG_BLK_DEV_IDEDMA */
struct pci_dev *dev = hwif->pci_dev;
u32 high_16 = pci_resource_start(dev, 4);
u32 indexreg = high_16 + (hwif->channel ? 0x09 : 0x01);
u32 datareg = (indexreg + 2);
#endif /* CONFIG_BLK_DEV_IDEDMA */
u8 thold = 0x10;
u8 adj = (drive->dn%2) ? 0x08 : 0x00;
u8 speed = ide_rate_filter(pdc202xx_ratemask(drive), xferspeed);
#ifdef CONFIG_BLK_DEV_IDEDMA
if (speed == XFER_UDMA_2) {
hwif->OUTB((thold + adj), indexreg);
hwif->OUTB((hwif->INB(datareg) & 0x7f), datareg);
}
#endif /* CONFIG_BLK_DEV_IDEDMA */
switch (speed) {
#ifdef CONFIG_BLK_DEV_IDEDMA
case XFER_UDMA_7:
speed = XFER_UDMA_6;
case XFER_UDMA_6: set_ultra(0x1a, 0x01, 0xcb); break;
case XFER_UDMA_5: set_ultra(0x1a, 0x02, 0xcb); break;
case XFER_UDMA_4: set_ultra(0x1a, 0x03, 0xcd); break;
case XFER_UDMA_3: set_ultra(0x1a, 0x05, 0xcd); break;
case XFER_UDMA_2: set_ultra(0x2a, 0x07, 0xcd); break;
case XFER_UDMA_1: set_ultra(0x3a, 0x0a, 0xd0); break;
case XFER_UDMA_0: set_ultra(0x4a, 0x0f, 0xd5); break;
case XFER_MW_DMA_2: set_ata2(0x69, 0x25); break;
case XFER_MW_DMA_1: set_ata2(0x6b, 0x27); break;
case XFER_MW_DMA_0: set_ata2(0xdf, 0x5f); break;
#endif /* CONFIG_BLK_DEV_IDEDMA */
case XFER_PIO_4: set_pio(0x23, 0x09, 0x25); break;
case XFER_PIO_3: set_pio(0x27, 0x0d, 0x35); break;
case XFER_PIO_2: set_pio(0x23, 0x26, 0x64); break;
case XFER_PIO_1: set_pio(0x46, 0x29, 0xa4); break;
case XFER_PIO_0: set_pio(0xfb, 0x2b, 0xac); break;
default:
;
}
return (ide_config_drive_speed(drive, speed));
}
/* 0 1 2 3 4 5 6 7 8
* 960, 480, 390, 300, 240, 180, 120, 90, 60
* 180, 150, 120, 90, 60
* DMA_Speed
* 180, 120, 90, 90, 90, 60, 30
* 11, 5, 4, 3, 2, 1, 0
*/
static int config_chipset_for_pio (ide_drive_t *drive, u8 pio)
{
u8 speed = 0;
pio = (pio == 5) ? 4 : pio;
speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, pio, NULL);
return ((int) pdc202xx_tune_chipset(drive, speed));
}
static void pdc202xx_tune_drive (ide_drive_t *drive, u8 pio)
{
(void) config_chipset_for_pio(drive, pio);
}
#ifdef CONFIG_BLK_DEV_IDEDMA
static u8 pdc202xx_new_cable_detect (ide_hwif_t *hwif)
{
hwif->OUTB(0x0b, hwif->dma_vendor1);
return ((u8)((hwif->INB(hwif->dma_vendor3) & 0x04)));
}
static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
{
u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10);
pci_read_config_word(hwif->pci_dev, 0x50, &CIS);
return ((u8)(CIS & mask));
}
static int config_chipset_for_dma (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u32 drive_conf = 0;
u8 mask = hwif->channel ? 0x08 : 0x02;
u8 drive_pci = 0x60 + (drive->dn << 2);
u8 test1 = 0, test2 = 0, speed = -1;
u8 AP = 0, CLKSPD = 0, jumpbit = 0, cable = 0;
u8 ultra_66 = ((id->dma_ultra & 0x0010) ||
(id->dma_ultra & 0x0008)) ? 1 : 0;
switch(dev->device) {
case PCI_DEVICE_ID_PROMISE_20277:
case PCI_DEVICE_ID_PROMISE_20276:
case PCI_DEVICE_ID_PROMISE_20275:
case PCI_DEVICE_ID_PROMISE_20271:
case PCI_DEVICE_ID_PROMISE_20269:
case PCI_DEVICE_ID_PROMISE_20270:
case PCI_DEVICE_ID_PROMISE_20268:
cable = pdc202xx_new_cable_detect(hwif);
#if PDC202_DEBUG_CABLE
printk("%s: %s-pin cable, %s-pin cable, %d\n",
hwif->name, hwif->udma_four ? "80" : "40",
cable ? "40" : "80", cable);
#endif /* PDC202_DEBUG_CABLE */
jumpbit = 1;
break;
case PCI_DEVICE_ID_PROMISE_20267:
case PCI_DEVICE_ID_PROMISE_20265:
case PCI_DEVICE_ID_PROMISE_20263:
case PCI_DEVICE_ID_PROMISE_20262:
cable = pdc202xx_old_cable_detect(hwif);
#if PDC202_DEBUG_CABLE
printk("%s: %s-pin cable, %s-pin cable, %d\n",
hwif->name, hwif->udma_four ? "80" : "40",
cable ? "40" : "80", cable);
#endif /* PDC202_DEBUG_CABLE */
jumpbit = 0;
break;
default:
cable = 1; jumpbit = 0;
break;
}
if (!jumpbit)
CLKSPD = hwif->INB(hwif->dma_master + 0x11);
/*
* Set the control register to use the 66Mhz system
* clock for UDMA 3/4 mode operation. If one drive on
* a channel is U66 capable but the other isn't we
* fall back to U33 mode. The BIOS INT 13 hooks turn
* the clock on then off for each read/write issued. I don't
* do that here because it would require modifying the
* kernel, seperating the fop routines from the kernel or
* somehow hooking the fops calls. It may also be possible to
* leave the 66Mhz clock on and readjust the timing
* parameters.
*/
if ((ultra_66) && (cable)) {
#ifdef DEBUG
printk("ULTRA 66/100/133: %s channel of Ultra 66/100/133 "
"requires an 80-pin cable for Ultra66 operation.\n",
hwif->channel ? "Secondary" : "Primary");
printk(" Switching to Ultra33 mode.\n");
#endif /* DEBUG */
/* Primary : zero out second bit */
/* Secondary : zero out fourth bit */
if (!jumpbit)
hwif->OUTB(CLKSPD & ~mask, (hwif->dma_master + 0x11));
printk("Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary");
printk("%s reduced to Ultra33 mode.\n", drive->name);
} else {
if (ultra_66) {
/*
* check to make sure drive on same channel
* is u66 capable
*/
if (hwif->drives[!(drive->dn%2)].id) {
if (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0078) {
if (!jumpbit)
hwif->OUTB(CLKSPD | mask, (hwif->dma_master + 0x11));
} else {
if (!jumpbit)
hwif->OUTB(CLKSPD & ~mask, (hwif->dma_master + 0x11));
}
} else { /* udma4 drive by itself */
if (!jumpbit)
hwif->OUTB(CLKSPD | mask, (hwif->dma_master + 0x11));
}
}
}
if (jumpbit) {
if (drive->media != ide_disk)
return 0;
if (id->capability & 4) { /* IORDY_EN & PREFETCH_EN */
hwif->OUTB((0x13 + ((drive->dn%2) ? 0x08 : 0x00)), hwif->dma_vendor1);
hwif->OUTB((hwif->INB(hwif->dma_vendor3)|0x03), hwif->dma_vendor3);
}
goto jumpbit_is_set;
}
drive_pci = 0x60 + (drive->dn << 2);
pci_read_config_dword(dev, drive_pci, &drive_conf);
if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4))
goto chipset_is_set;
pci_read_config_byte(dev, drive_pci, &test1);
if (!(test1 & SYNC_ERRDY_EN)) {
if (drive->select.b.unit & 0x01) {
pci_read_config_byte(dev, drive_pci - 4, &test2);
if ((test2 & SYNC_ERRDY_EN) &&
!(test1 & SYNC_ERRDY_EN)) {
pci_write_config_byte(dev, drive_pci,
test1|SYNC_ERRDY_EN);
}
} else {
pci_write_config_byte(dev, drive_pci,
test1|SYNC_ERRDY_EN);
}
}
chipset_is_set:
if (drive->media == ide_disk) {
pci_read_config_byte(dev, (drive_pci), &AP);
if (id->capability & 4) /* IORDY_EN */
pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN);
pci_read_config_byte(dev, (drive_pci), &AP);
if (drive->media == ide_disk) /* PREFETCH_EN */
pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN);
}
jumpbit_is_set:
speed = ide_dma_speed(drive, pdc202xx_ratemask(drive));
if (!(speed)) {
/* restore original pci-config space */
if (!jumpbit)
pci_write_config_dword(dev, drive_pci, drive_conf);
hwif->tuneproc(drive, 5);
return 0;
}
(void) hwif->speedproc(drive, speed);
return ide_dma_enable(drive);
}
static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
struct hd_driveid *id = drive->id;
drive->init_speed = 0;
if (id && (id->capability & 1) && drive->autodma) {
/* Consult the list of known "bad" drives */
if (hwif->ide_dma_bad_drive(drive))
goto fast_ata_pio;
if (id->field_valid & 4) {
if (id->dma_ultra & hwif->ultra_mask) {
/* Force if Capable UltraDMA */
int dma = config_chipset_for_dma(drive);
if ((id->field_valid & 2) && !dma)
goto try_dma_modes;
}
} else if (id->field_valid & 2) {
try_dma_modes:
if ((id->dma_mword & hwif->mwdma_mask) ||
(id->dma_1word & hwif->swdma_mask)) {
/* Force if Capable regular DMA modes */
if (!config_chipset_for_dma(drive))
goto no_dma_set;
}
} else if (hwif->ide_dma_good_drive(drive) &&
(id->eide_dma_time < 150)) {
goto no_dma_set;
/* Consult the list of known "good" drives */
if (!config_chipset_for_dma(drive))
goto no_dma_set;
} else {
goto fast_ata_pio;
}
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hwif->tuneproc(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
}
static int pdc202xx_quirkproc (ide_drive_t *drive)
{
return ((int) check_in_drive_lists(drive, pdc_quirk_drives));
}
static int pdc202xx_old_ide_dma_begin(ide_drive_t *drive)
{
if (drive->addressing == 1) {
struct request *rq = HWGROUP(drive)->rq;
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u32 high_16 = pci_resource_start(dev, 4);
u32 atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
u32 word_count = 0;
u8 clock = hwif->INB(high_16 + 0x11);
hwif->OUTB(clock|(hwif->channel ? 0x08 : 0x02), high_16+0x11);
word_count = (rq->nr_sectors << 8);
word_count = (rq->cmd == READ) ? word_count | 0x05000000 :
word_count | 0x06000000;
hwif->OUTL(word_count, atapi_reg);
}
return __ide_dma_begin(drive);
}
static int pdc202xx_old_ide_dma_end(ide_drive_t *drive)
{
if (drive->addressing == 1) {
ide_hwif_t *hwif = HWIF(drive);
u32 high_16 = pci_resource_start(hwif->pci_dev, 4);
u32 atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20);
u8 clock = 0;
hwif->OUTL(0, atapi_reg); /* zero out extra */
clock = hwif->INB(high_16 + 0x11);
hwif->OUTB(clock & ~(hwif->channel ? 0x08:0x02), high_16+0x11);
}
return __ide_dma_end(drive);
}
static int pdc202xx_old_ide_dma_test_irq(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
unsigned long high_16 = pci_resource_start(dev, 4);
u8 dma_stat = hwif->INB(hwif->dma_status);
u8 sc1d = hwif->INB((high_16 + 0x001d));
if (hwif->channel) {
if ((sc1d & 0x50) == 0x50)
goto somebody_else;
else if ((sc1d & 0x40) == 0x40)
return (dma_stat & 4) == 4;
} else {
if ((sc1d & 0x05) == 0x05)
goto somebody_else;
else if ((sc1d & 0x04) == 0x04)
return (dma_stat & 4) == 4;
}
somebody_else:
return (dma_stat & 4) == 4; /* return 1 if INTR asserted */
}
static int pdc202xx_ide_dma_lostirq(ide_drive_t *drive)
{
if (HWIF(drive)->resetproc != NULL)
HWIF(drive)->resetproc(drive);
return __ide_dma_lostirq(drive);
}
static int pdc202xx_ide_dma_timeout(ide_drive_t *drive)
{
if (HWIF(drive)->resetproc != NULL)
HWIF(drive)->resetproc(drive);
return __ide_dma_timeout(drive);
}
#endif /* CONFIG_BLK_DEV_IDEDMA */
static void pdc202xx_new_reset (ide_drive_t *drive)
{
/*
* Deleted this because it is redundant from the caller.
*/
printk("PDC202XX: %s channel reset.\n",
HWIF(drive)->channel ? "Secondary" : "Primary");
}
static void pdc202xx_reset_host (ide_hwif_t *hwif)
{
#ifdef CONFIG_BLK_DEV_IDEDMA
// unsigned long high_16 = hwif->dma_base - (8*(hwif->channel));
unsigned long high_16 = hwif->dma_master;
#else /* !CONFIG_BLK_DEV_IDEDMA */
unsigned long high_16 = pci_resource_start(hwif->pci_dev, 4);
#endif /* CONFIG_BLK_DEV_IDEDMA */
u8 udma_speed_flag = hwif->INB(high_16|0x001f);
hwif->OUTB((udma_speed_flag | 0x10), (high_16|0x001f));
mdelay(100);
hwif->OUTB((udma_speed_flag & ~0x10), (high_16|0x001f));
mdelay(2000); /* 2 seconds ?! */
printk("PDC202XX: %s channel reset.\n",
hwif->channel ? "Secondary" : "Primary");
}
void pdc202xx_reset (ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
ide_hwif_t *mate = hwif->mate;
pdc202xx_reset_host(hwif);
pdc202xx_reset_host(mate);
#if 0
/*
* FIXME: Have to kick all the drives again :-/
* What a pain in the ACE!
*/
if (hwif->present) {
u16 hunit = 0;
hwif->initializing = 1;
for (hunit = 0; hunit < MAX_DRIVES; ++hunit) {
ide_drive_t *hdrive = &hwif->drives[hunit];
if (hdrive->present) {
if (hwif->ide_dma_check)
hwif->ide_dma_check(hdrive);
else
hwif->tuneproc(hdrive, 5);
}
}
hwif->initializing = 0;
}
if (mate->present) {
u16 munit = 0;
mate->initializing = 1;
for (munit = 0; munit < MAX_DRIVES; ++munit) {
ide_drive_t *mdrive = &mate->drives[munit];
if (mdrive->present) {
if (mate->ide_dma_check)
mate->ide_dma_check(mdrive);
else
mate->tuneproc(mdrive, 5);
}
}
mate->initializing = 0;
}
#else
hwif->tuneproc(drive, 5);
#endif
}
/*
* Since SUN Cobalt is attempting to do this operation, I should disclose
* this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date
* HOTSWAP ATA Infrastructure.
*/
static int pdc202xx_tristate (ide_drive_t * drive, int state)
{
ide_hwif_t *hwif = HWIF(drive);
#ifdef CONFIG_BLK_DEV_IDEDMA
// unsigned long high_16 = hwif->dma_base - (8*(hwif->channel));
unsigned long high_16 = hwif->dma_master;
#else /* !CONFIG_BLK_DEV_IDEDMA */
unsigned long high_16 = pci_resource_start(hwif->pci_dev, 4);
#endif /* CONFIG_BLK_DEV_IDEDMA */
u8 sc1f = hwif->INB(high_16|0x001f);
if (!hwif)
return -EINVAL;
// hwif->bus_state = state;
if (state) {
hwif->OUTB(sc1f | 0x08, (high_16|0x001f));
} else {
hwif->OUTB(sc1f & ~0x08, (high_16|0x001f));
}
return 0;
}
static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const char *name)
{
if (dev->resource[PCI_ROM_RESOURCE].start) {
pci_write_config_dword(dev, PCI_ROM_ADDRESS,
dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
printk("%s: ROM enabled at 0x%08lx\n",
name, dev->resource[PCI_ROM_RESOURCE].start);
}
#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
pdc202_devs[n_pdc202_devs++] = dev;
if (!pdc202xx_proc) {
pdc202xx_proc = 1;
ide_pci_register_host_proc(&pdc202xx_procs[0]);
}
#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */
/*
* software reset - this is required because the bios
* will set UDMA timing on if the hdd supports it. The
* user may want to turn udma off. A bug in the pdc20262
* is that it cannot handle a downgrade in timing from
* UDMA to DMA. Disk accesses after issuing a set
* feature command will result in errors. A software
* reset leaves the timing registers intact,
* but resets the drives.
*/
#if 0
if ((dev->device == PCI_DEVICE_ID_PROMISE_20267) ||
(dev->device == PCI_DEVICE_ID_PROMISE_20265) ||
(dev->device == PCI_DEVICE_ID_PROMISE_20263) ||
(dev->device == PCI_DEVICE_ID_PROMISE_20262)) {
unsigned long high_16 = pci_resource_start(dev, 4);
byte udma_speed_flag = inb(high_16 + 0x001f);
outb(udma_speed_flag | 0x10, high_16 + 0x001f);
mdelay(100);
outb(udma_speed_flag & ~0x10, high_16 + 0x001f);
mdelay(2000); /* 2 seconds ?! */
}
#endif
return dev->irq;
}
static void __init init_hwif_pdc202xx (ide_hwif_t *hwif)
{
hwif->autodma = 0;
hwif->tuneproc = &pdc202xx_tune_drive;
hwif->quirkproc = &pdc202xx_quirkproc;
if (hwif->pci_dev->device == PCI_DEVICE_ID_PROMISE_20267)
hwif->addressing = (hwif->channel) ? 0 : 1;
if (hwif->pci_dev->device == PCI_DEVICE_ID_PROMISE_20265)
hwif->addressing = (hwif->channel) ? 0 : 1;
if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) {
hwif->busproc = &pdc202xx_tristate;
hwif->resetproc = &pdc202xx_reset;
}
hwif->speedproc = &pdc202xx_tune_chipset;
if (!hwif->dma_base) {
hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
return;
}
hwif->ultra_mask = 0x3f;
hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x07;
#ifdef CONFIG_BLK_DEV_IDEDMA
hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate;
hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq;
hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout;
if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) {
if (!(hwif->udma_four))
hwif->udma_four = (pdc202xx_old_cable_detect(hwif)) ? 0 : 1;
hwif->ide_dma_begin = &pdc202xx_old_ide_dma_begin;
hwif->ide_dma_end = &pdc202xx_old_ide_dma_end;
}
hwif->ide_dma_test_irq = &pdc202xx_old_ide_dma_test_irq;
if (!noautodma)
hwif->autodma = 1;
hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
#endif /* CONFIG_BLK_DEV_IDEDMA */
#if PDC202_DEBUG_CABLE
printk("%s: %s-pin cable\n",
hwif->name, hwif->udma_four ? "80" : "40");
#endif /* PDC202_DEBUG_CABLE */
}
static void __init init_hwif_pdc202new (ide_hwif_t *hwif)
{
hwif->autodma = 0;
hwif->tuneproc = &pdc202xx_tune_drive;
hwif->quirkproc = &pdc202xx_quirkproc;
hwif->speedproc = &pdc202xx_new_tune_chipset;
hwif->resetproc = &pdc202xx_new_reset;
if (!hwif->dma_base) {
hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
return;
}
hwif->ultra_mask = 0x7f;
hwif->mwdma_mask = 0x07;
#ifdef CONFIG_BLK_DEV_IDEDMA
hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate;
hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq;
hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout;
if (!(hwif->udma_four))
hwif->udma_four = (pdc202xx_new_cable_detect(hwif)) ? 0 : 1;
if (!noautodma)
hwif->autodma = 1;
hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
#endif /* CONFIG_BLK_DEV_IDEDMA */
#if PDC202_DEBUG_CABLE
printk("%s: %s-pin cable\n",
hwif->name, hwif->udma_four ? "80" : "40");
#endif /* PDC202_DEBUG_CABLE */
}
static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase)
{
u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0;
if (hwif->channel) {
ide_setup_dma(hwif, dmabase, 8);
return;
}
udma_speed_flag = hwif->INB((dmabase|0x1f));
primary_mode = hwif->INB((dmabase|0x1a));
secondary_mode = hwif->INB((dmabase|0x1b));
printk("%s: (U)DMA Burst Bit %sABLED " \
"Primary %s Mode " \
"Secondary %s Mode.\n", hwif->cds->name,
(udma_speed_flag & 1) ? "EN" : "DIS",
(primary_mode & 1) ? "MASTER" : "PCI",
(secondary_mode & 1) ? "MASTER" : "PCI" );
#ifdef CONFIG_PDC202XX_BURST
if (!(udma_speed_flag & 1)) {
printk("%s: FORCING BURST BIT 0x%02x->0x%02x ",
hwif->cds->name, udma_speed_flag,
(udma_speed_flag|1));
hwif->OUTB(udma_speed_flag|1,(dmabase|0x1f));
printk("%sACTIVE\n",
(hwif->INB(dmabase|0x1f)&1) ? "":"IN");
}
#endif /* CONFIG_PDC202XX_BURST */
#ifdef CONFIG_PDC202XX_MASTER
if (!(primary_mode & 1)) {
printk("%s: FORCING PRIMARY MODE BIT "
"0x%02x -> 0x%02x ", hwif->cds->name,
primary_mode, (primary_mode|1));
hwif->OUTB(primary_mode|1, (dmabase|0x1a));
printk("%s\n",
(hwif->INB((dmabase|0x1a)) & 1) ? "MASTER" : "PCI");
}
if (!(secondary_mode & 1)) {
printk("%s: FORCING SECONDARY MODE BIT "
"0x%02x -> 0x%02x ", hwif->cds->name,
secondary_mode, (secondary_mode|1));
hwif->OUTB(secondary_mode|1, (dmabase|0x1b));
printk("%s\n",
(hwif->INB((dmabase|0x1b)) & 1) ? "MASTER" : "PCI");
}
#endif /* CONFIG_PDC202XX_MASTER */
ide_setup_dma(hwif, dmabase, 8);
}
static void __init init_dma_pdc202new (ide_hwif_t *hwif, unsigned long dmabase)
{
ide_setup_dma(hwif, dmabase, 8);
}
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t *d)
{
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
u8 irq = 0, irq2 = 0;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
/* 0xbc */
pci_read_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, &irq2);
if (irq != irq2) {
pci_write_config_byte(dev,
(PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */
printk("%s: pci-config space interrupt "
"mirror fixed.\n", d->name);
}
}
#if 0
if (dev->device == PCI_DEVICE_ID_PROMISE_20262)
if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
(tmp & e->mask) != e->val))
if (d->enablebits[0].reg != d->enablebits[1].reg) {
d->enablebits[0].reg = d->enablebits[1].reg;
d->enablebits[0].mask = d->enablebits[1].mask;
d->enablebits[0].val = d->enablebits[1].val;
}
#endif
ide_setup_pci_device(dev, d);
}
static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d)
{
if ((dev->bus->self) &&
(dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) &&
((dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960) ||
(dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960RM))) {
printk(KERN_INFO "ide: Skipping Promise PDC20265 "
"attached to I2O RAID controller.\n");
return;
}
#if 0
{
u8 pri = 0, sec = 0;
if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
(tmp & e->mask) != e->val))
if (d->enablebits[0].reg != d->enablebits[1].reg) {
d->enablebits[0].reg = d->enablebits[1].reg;
d->enablebits[0].mask = d->enablebits[1].mask;
d->enablebits[0].val = d->enablebits[1].val;
}
}
#endif
ide_setup_pci_device(dev, d);
}
static void __init init_setup_pdc202xx (struct pci_dev *dev, ide_pci_device_t *d)
{
ide_setup_pci_device(dev, d);
}
static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d)
{
struct pci_dev *findev;
if ((dev->bus->self &&
dev->bus->self->vendor == PCI_VENDOR_ID_DEC) &&
(dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) {
if (PCI_SLOT(dev->devfn) & 2) {
return;
}
d->extra = 0;
pci_for_each_dev(findev) {
if ((findev->vendor == dev->vendor) &&
(findev->device == dev->device) &&
(PCI_SLOT(findev->devfn) & 2)) {
u8 irq = 0, irq2 = 0;
pci_read_config_byte(dev,
PCI_INTERRUPT_LINE, &irq);
pci_read_config_byte(findev,
PCI_INTERRUPT_LINE, &irq2);
if (irq != irq2) {
findev->irq = dev->irq;
pci_write_config_byte(findev,
PCI_INTERRUPT_LINE, irq);
}
ide_setup_pci_devices(dev, findev, d);
return;
}
}
}
ide_setup_pci_device(dev, d);
}
static void __init init_setup_pdc20276 (struct pci_dev *dev, ide_pci_device_t *d)
{
if ((dev->bus->self) &&
(dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) &&
((dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960) ||
(dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960RM))) {
printk(KERN_INFO "ide: Skipping Promise PDC20276 "
"attached to I2O RAID controller.\n");
return;
}
ide_setup_pci_device(dev, d);
}
int __init pdc202xx_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_PROMISE)
return 0;
for (d = pdc202xx_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
}
......@@ -15,6 +15,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......@@ -646,21 +647,71 @@ static void __init init_setup_pdc20276 (struct pci_dev *dev, ide_pci_device_t *d
ide_setup_pci_device(dev, d);
}
int __init pdcnew_scan_pcidev (struct pci_dev *dev)
/**
* pdc202new_init_one - called when a pdc202xx is found
* @dev: the pdc202new device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit pdc202new_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &pdcnew_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_PROMISE)
return 0;
for (d = pdcnew_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* pdc202new_remove_one - called when a pdc202xx is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdc202new_remove_one(struct pci_dev *dev)
{
panic("Promise IDE removal not yet supported");
}
static struct pci_device_id pdc202new_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20268, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20269, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20270, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20271, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20275, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20276, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20277, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ 0, },
};
static struct pci_driver driver = {
name: "Promise IDE",
id_table: pdc202new_pci_tbl,
probe: pdc202new_init_one,
remove: __devexit_p(pdc202new_remove_one),
};
static int pdc202new_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void pdc202new_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdc202new_ide_init);
module_exit(pdc202new_ide_exit);
MODULE_AUTHOR("Andre Hedrick, Frank Tiernan");
MODULE_DESCRIPTION("PCI driver module for Promise PDC20268 and higher");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -226,7 +226,7 @@ static void init_hwif_pdc202new(ide_hwif_t *);
static void init_dma_pdc202new(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdcnew_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20268,
name: "PDC20268",
......@@ -240,7 +240,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20269,
name: "PDC20269",
......@@ -254,7 +254,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20270,
name: "PDC20270",
......@@ -272,7 +272,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20271,
name: "PDC20271",
......@@ -286,7 +286,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20275,
name: "PDC20275",
......@@ -300,7 +300,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 5 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20276,
name: "PDC20276",
......@@ -318,7 +318,7 @@ static ide_pci_device_t pdcnew_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 0,
},{
},{ /* 6 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20277,
name: "PDC20277",
......
/*
* linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
* linux/drivers/ide/pdc202xx.c Version 0.36 Sept 11, 2002
*
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
*
......@@ -30,6 +30,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -918,21 +919,69 @@ static void __init init_setup_pdc202xx (struct pci_dev *dev, ide_pci_device_t *d
ide_setup_pci_device(dev, d);
}
int __init pdc202xx_scan_pcidev (struct pci_dev *dev)
/**
* pdc202xx_init_one - called when a PDC202xx is found
* @dev: the pdc202xx device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &pdc202xx_chipsets[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_PROMISE)
return 0;
for (d = pdc202xx_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* pdc202xx_remove_one - called with the IDE to be unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdc202xx_remove_one(struct pci_dev *dev)
{
panic("Promise IDE removal not yet supported");
}
static struct pci_device_id pdc202xx_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20263, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20265, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20267, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ 0, },
};
static struct pci_driver driver = {
name: "Promise Old IDE",
id_table: pdc202xx_pci_tbl,
probe: pdc202xx_init_one,
remove: __devexit_p(pdc202xx_remove_one),
};
static int pdc202xx_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void pdc202xx_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdc202xx_ide_init);
module_exit(pdc202xx_ide_exit);
MODULE_AUTHOR("Andre Hedrick, Frank Tiernan");
MODULE_DESCRIPTION("PCI driver module for older Promise IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -226,7 +226,7 @@ static void init_hwif_pdc202xx(ide_hwif_t *);
static void init_dma_pdc202xx(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20246,
name: "PDC20246",
......@@ -244,7 +244,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 16,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20262,
name: "PDC20262",
......@@ -262,7 +262,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 48,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20263,
name: "PDC20263",
......@@ -280,7 +280,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 48,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20265,
name: "PDC20265",
......@@ -297,7 +297,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __initdata = {
#endif
bootable: OFF_BOARD,
extra: 48,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_PROMISE,
device: PCI_DEVICE_ID_PROMISE_20267,
name: "PDC20267",
......
/*
* linux/drivers/ide/pdcadma.c Version 0.01 June 21, 2001
* linux/drivers/ide/pdcadma.c Version 0.05 Sept 10, 2002
*
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* May be copied or modified under the terms of the GNU General Public License
......@@ -127,26 +127,55 @@ static void __init init_dma_pdcadma (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_pdcadma (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit pdcadma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &pdcadma_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 1;
}
int __init pdcadma_scan_pcidev (struct pci_dev *dev)
/**
* pdcadma_remove_one - called when a PDCADMA is unplugged
* @dev: the device that was removed
*
* Disconnect a PDCADMA device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void pdcadma_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_PDC)
return 0;
for (d = pdcadma_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
panic("PDCADMA removal not yet supported");
}
static struct pci_device_id pdcadma_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PDC, PCI_DEVICE_ID_PDC_1841, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
static struct pci_driver driver = {
name: "PDCADMA-IDE",
id_table: pdcadma_pci_tbl,
probe: pdcadma_init_one,
remove: __devexit_p(pdcadma_remove_one),
};
static int pdcadma_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void pdcadma_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(pdcadma_ide_init);
module_exit(pdcadma_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for PDCADMA IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -31,7 +31,7 @@ static void init_hwif_pdcadma(ide_hwif_t *);
static void init_dma_pdcadma(ide_hwif_t *, unsigned long);
static ide_pci_device_t pdcadma_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_PDC,
device: PCI_DEVICE_ID_PDC_1841,
name: "PDCADMA",
......
......@@ -55,6 +55,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/pci.h>
......@@ -664,29 +665,79 @@ static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d)
}
/**
* piix_scan_pcidev - Check for and initialize PIIX IDE
* @dev: PCI device to check
* piix_init_one - called when a PIIX is found
* @dev: the piix device
* @id: the matching pci id
*
* Checks if the passed device is an Intel PIIX device. If so the
* hardware is initialized and we return 1 to claim the device. If not
* we return 0.
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
int __init piix_scan_pcidev (struct pci_dev *dev)
static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d;
ide_pci_device_t *d = &piix_pci_info[id->driver_data];
if (dev->vendor != PCI_VENDOR_ID_INTEL)
return 0;
for (d = piix_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* piix_remove_one - called with a PIIX is unplugged
* @dev: the device that was removed
*
* Disconnect a PIIX device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void piix_remove_one(struct pci_dev *dev)
{
panic("PIIX removal not yet supported");
}
static struct pci_device_id piix_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371MX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82372FB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
{ 0, },
};
static struct pci_driver driver = {
name: "PIIX IDE",
id_table: piix_pci_tbl,
probe: piix_init_one,
remove: __devexit_p(piix_remove_one),
};
static int piix_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void piix_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(piix_ide_init);
module_exit(piix_ide_exit);
MODULE_AUTHOR("Andre Hedrick, Andrzej Krzysztofowicz");
MODULE_DESCRIPTION("PCI driver module for Intel PIIX IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -28,12 +28,18 @@ static ide_pci_host_proc_t piix_procs[] __initdata = {
#endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_piix(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_piix(struct pci_dev *, const char *);
static unsigned int __init init_chipset_piix(struct pci_dev *, const char *);
static void init_hwif_piix(ide_hwif_t *);
static void init_dma_piix(ide_hwif_t *, unsigned long);
static ide_pci_device_t piix_chipsets[] __initdata = {
{
/*
* Table of the various PIIX capability blocks
*
*/
static ide_pci_device_t piix_pci_info[] __initdata = {
{ /* 0 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371FB_0,
name: "PIIXa",
......@@ -47,7 +53,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371FB_1,
name: "PIIXb",
......@@ -61,7 +67,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371MX,
name: "MPIIX",
......@@ -75,7 +81,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371SB_1,
name: "PIIX3",
......@@ -89,7 +95,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 4 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82371AB,
name: "PIIX4",
......@@ -103,7 +109,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 5 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801AB_1,
name: "ICH0",
......@@ -117,7 +123,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 6 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82443MX_1,
name: "PIIX4",
......@@ -131,7 +137,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 7 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801AA_1,
name: "ICH",
......@@ -145,7 +151,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 8 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82372FB_1,
name: "PIIX4",
......@@ -159,7 +165,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 9 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82451NX,
name: "PIIX4",
......@@ -173,7 +179,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 10 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801BA_9,
name: "ICH2",
......@@ -187,7 +193,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 11 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801BA_8,
name: "ICH2M",
......@@ -201,7 +207,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 12 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801CA_10,
name: "ICH3M",
......@@ -215,7 +221,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 13 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801CA_11,
name: "ICH3",
......@@ -229,7 +235,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 14 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801DB_11,
name: "ICH4",
......@@ -243,7 +249,7 @@ static ide_pci_device_t piix_chipsets[] __initdata = {
enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 15 */
vendor: PCI_VENDOR_ID_INTEL,
device: PCI_DEVICE_ID_INTEL_82801E_11,
name: "C-ICH",
......
......@@ -19,6 +19,7 @@
#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -55,26 +56,57 @@ static void __init init_hwif_rz1000 (ide_hwif_t *hwif)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_rz1000 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &rz1000_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init rz1000_scan_pcidev (struct pci_dev *dev)
/**
* rz1000_remove_one - called with an RZ1000 is unplugged
* @dev: the device that was removed
*
* Disconnect an RZ1000 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void rz1000_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_PCTECH)
return 0;
for (d = rz1000_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
panic("RZ1000 removal not yet supported");
}
static struct pci_device_id rz1000_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
static struct pci_driver driver = {
name: "RZ1000 IDE",
id_table: rz1000_pci_tbl,
probe: rz1000_init_one,
remove: __devexit_p(rz1000_remove_one),
};
static int rz1000_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void rz1000_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(rz1000_ide_init);
module_exit(rz1000_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for RZ1000 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -5,7 +5,6 @@
#include <linux/pci.h>
#include <linux/ide.h>
static void init_setup_rz1000(struct pci_dev *, ide_pci_device_t *);
static void init_hwif_rz1000(ide_hwif_t *);
static ide_pci_device_t rz1000_chipsets[] __initdata = {
......@@ -13,7 +12,6 @@ static ide_pci_device_t rz1000_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_RZ1000,
name: "RZ1000",
init_setup: init_setup_rz1000,
init_chipset: NULL,
init_iops: NULL,
init_hwif: init_hwif_rz1000,
......@@ -27,7 +25,6 @@ static ide_pci_device_t rz1000_chipsets[] __initdata = {
vendor: PCI_VENDOR_ID_PCTECH,
device: PCI_DEVICE_ID_PCTECH_RZ1001,
name: "RZ1001",
init_setup: init_setup_rz1000,
init_chipset: NULL,
init_iops: NULL,
init_hwif: init_hwif_rz1000,
......
/*
* linux/drivers/ide/serverworks.c Version 0.6 05 April 2002
* linux/drivers/ide/serverworks.c Version 0.7 10 Sept 2002
*
* Copyright (C) 1998-2000 Michel Aubry
* Copyright (C) 1998-2000 Andrzej Krzysztofowicz
......@@ -25,6 +25,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/pci.h>
......@@ -766,21 +767,73 @@ static void __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
ide_setup_pci_device(dev, d);
}
int __init serverworks_scan_pcidev (struct pci_dev *dev)
{
ide_pci_device_t *d;
if (dev->vendor != PCI_VENDOR_ID_SERVERWORKS)
return 0;
/**
* svwks_init_one - called when a OSB/CSB is found
* @dev: the svwks device
* @id: the matching pci id
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
*/
static int __devinit svwks_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &serverworks_chipsets[id->driver_data];
for (d = serverworks_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
if (dev->device != d->device)
BUG();
d->init_setup(dev, d);
return 0;
}
/**
* svwks_remove_one - called when an OSB/CSB is unplugged
* @dev: the device that was removed
*
* Disconnect a SVWKS device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void svwks_remove_one(struct pci_dev *dev)
{
panic("SVWKS removal not yet supported");
}
static struct pci_device_id svwks_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
{ 0, },
};
static struct pci_driver driver = {
name: "Serverworks IDE",
id_table: svwks_pci_tbl,
probe: svwks_init_one,
remove: __devexit_p(svwks_remove_one),
#if 0 /* FIXME: implement */
suspend: ,
resume: ,
#endif
};
static int svwks_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void svwks_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(svwks_ide_init);
module_exit(svwks_ide_exit);
MODULE_AUTHOR("Michael Aubry. Andrzej Krzysztofowicz, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for Serverworks OSB4/CSB5/CSB6 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -38,7 +38,7 @@ static void init_hwif_svwks(ide_hwif_t *);
static void init_dma_svwks(ide_hwif_t *, unsigned long);
static ide_pci_device_t serverworks_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
name: "SvrWks OSB4",
......@@ -52,7 +52,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
name: "SvrWks CSB5",
......@@ -66,7 +66,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 2 */
vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE,
name: "SvrWks CSB6",
......@@ -80,7 +80,7 @@ static ide_pci_device_t serverworks_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 3 */
vendor: PCI_VENDOR_ID_SERVERWORKS,
device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2,
name: "SvrWks CSB6",
......
/*
* linux/drivers/ide/siimage.c Version 1.00 May 9, 2002
* linux/drivers/ide/siimage.c Version 1.01 Sept 11, 2002
*
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/hdreg.h>
......@@ -836,26 +837,57 @@ static void __init init_dma_siimage (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_siimage (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit siimage_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &siimage_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init siimage_scan_pcidev (struct pci_dev *dev)
/**
* siimage_remove_one - called when an SI IDE is unplugged
* @dev: the device that was removed
*
* Disconnect an IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void siimage_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("SiImage IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_CMD)
return 0;
static struct pci_device_id siimage_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
for (d = siimage_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "SiI IDE",
id_table: siimage_pci_tbl,
probe: siimage_init_one,
remove: __devexit_p(siimage_remove_one),
};
static int siimage_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void siimage_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(siimage_ide_init);
module_exit(siimage_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for SiI IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -107,18 +107,16 @@ static ide_pci_host_proc_t siimage_procs[] __initdata = {
};
#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */
static void init_setup_siimage(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_siimage(struct pci_dev *, const char *);
static void init_iops_siimage(ide_hwif_t *);
static void init_hwif_siimage(ide_hwif_t *);
static void init_dma_siimage(ide_hwif_t *, unsigned long);
static ide_pci_device_t siimage_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_SII_680,
name: "SiI680",
init_setup: init_setup_siimage,
init_chipset: init_chipset_siimage,
init_iops: init_iops_siimage,
init_hwif: init_hwif_siimage,
......@@ -128,11 +126,10 @@ static ide_pci_device_t siimage_chipsets[] __initdata = {
enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_CMD,
device: PCI_DEVICE_ID_SII_3112,
name: "SiI3112 Serial ATA",
init_setup: init_setup_siimage,
init_chipset: init_chipset_siimage,
init_iops: init_iops_siimage,
init_hwif: init_hwif_siimage,
......
/*
* linux/drivers/ide/sis5513.c Version 0.14 July 24, 2002
* linux/drivers/ide/sis5513.c Version 0.14ac Sept 11, 2002
*
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer
......@@ -34,6 +34,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
......@@ -1022,26 +1023,56 @@ static void __init init_dma_sis5513 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_sis5513 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &sis5513_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init sis5513_scan_pcidev (struct pci_dev *dev)
/**
* sis5513_remove_one - called when SIS IDE is unplugged
* @dev: the device that was removed
*
* Disconnect a SIS IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void sis5513_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("SIS IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_SI)
return 0;
static struct pci_device_id sis5513_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = sis5513_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "SIS IDE",
id_table: sis5513_pci_tbl,
probe: sis5513_init_one,
remove: __devexit_p(sis5513_remove_one),
};
static int sis5513_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void sis5513_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(sis5513_ide_init);
module_exit(sis5513_ide_exit);
MODULE_AUTHOR("Lionel Bouton, L C Chang, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for SIS IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,17 +25,15 @@ static ide_pci_host_proc_t sis_procs[] __initdata = {
};
#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_sis5513(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_sis5513(struct pci_dev *, const char *);
static void init_hwif_sis5513(ide_hwif_t *);
static void init_dma_sis5513(ide_hwif_t *, unsigned long);
static ide_pci_device_t sis5513_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_SI,
device: PCI_DEVICE_ID_SI_5513,
name: "SIS5513",
init_setup: init_setup_sis5513,
init_chipset: init_chipset_sis5513,
init_iops: NULL,
init_hwif: init_hwif_sis5513,
......
......@@ -11,6 +11,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linuyx/module.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/mm.h>
......@@ -281,26 +282,54 @@ static void __init init_hwif_sl82c105(ide_hwif_t *hwif)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_sl82c105 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &slc82c105_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init sl82c105_scan_pcidev (struct pci_dev *dev)
/**
* sl82c105_remove_one - called with an SLC82c105 is unplugged
* @dev: the device that was removed
*
* Disconnect an W82C105 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void sl82c105_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("W82C105 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_WINBOND)
return 0;
static struct pci_device_id sl82c105_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = sl82c105_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "W82C105 IDE",
id_table: sl82c105_pci_tbl,
probe: sl82c105_init_one,
remove: __devexit_p(sl82c105_remove_one),
};
static int sl82c105_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void sl82c105_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(sl82c105_ide_init);
module_exit(sl82c105_ide_exit);
MODULE_DESCRIPTION("PCI driver module for W82C105 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -5,17 +5,15 @@
#include <linux/pci.h>
#include <linux/ide.h>
static void init_setup_sl82c105(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_sl82c105(struct pci_dev *, const char *);
static void init_hwif_sl82c105(ide_hwif_t *);
static void init_dma_sl82c105(ide_hwif_t *, unsigned long);
static ide_pci_device_t sl82c105_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_WINBOND,
device: PCI_DEVICE_ID_WINBOND_82C105,
name: "W82C105",
init_setup: init_setup_sl82c105,
init_chipset: init_chipset_sl82c105,
init_iops: NULL,
init_hwif: init_hwif_sl82c105,
......
/*
* linux/drivers/ide/slc90e66.c Version 0.10 October 4, 2000
* linux/drivers/ide/slc90e66.c Version 0.11 September 11, 2002
*
* Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>
*
......@@ -10,6 +10,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/pci.h>
......@@ -364,26 +365,56 @@ static void __init init_dma_slc90e66 (ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static void __init init_setup_slc90e66 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit slc90e66_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &slc90e66_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init slc90e66_scan_pcidev (struct pci_dev *dev)
/**
* slc90e66_remove_one - called with an slc90e66 is unplugged
* @dev: the device that was removed
*
* Disconnect an slc90e66 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void slc90e66_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("slc90e66 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_EFAR)
return 0;
static struct pci_device_id slc90e66_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = slc90e66_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "SLC90e66 IDE",
id_table: slc90e66_pci_tbl,
probe: slc90e66_init_one,
remove: __devexit_p(slc90e66_remove_one),
};
static int slc90e66_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void slc90e66_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(slc90e66_ide_init);
module_exit(slc90e66_ide_exit);
MODULE_AUTHOR("Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for SLC90E66 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -27,17 +27,15 @@ static ide_pci_host_proc_t slc90e66_procs[] __initdata = {
};
#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */
static void init_setup_slc90e66(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *);
static void init_hwif_slc90e66(ide_hwif_t *);
static void init_dma_slc90e66(ide_hwif_t *, unsigned long);
static ide_pci_device_t slc90e66_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_EFAR,
device: PCI_DEVICE_ID_EFAR_SLC90E66_1,
name: "SLC90E66",
init_setup: init_setup_slc90e66,
init_chipset: init_chipset_slc90e66,
init_iops: NULL,
init_hwif: init_hwif_slc90e66,
......
......@@ -126,6 +126,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/ioport.h>
......@@ -191,7 +192,7 @@ static int trm290_ide_dma_write (ide_drive_t *drive /*, struct request *rq */)
trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1;
#endif
if (!(count = ide_build_dmatable(drive, rq))) {
if (!(count = ide_build_dmatable(drive, rq, PCI_DMA_TODEVICE))) {
/* try PIO instead of DMA */
trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1;
......@@ -235,7 +236,7 @@ static int trm290_ide_dma_read (ide_drive_t *drive /*, struct request *rq */)
task_ioreg_t command = WIN_NOP;
unsigned int count, reading = 2, writing = 0;
if (!(count = ide_build_dmatable(drive, rq))) {
if (!(count = ide_build_dmatable(drive, rq, PCI_DMA_FROMDEVICE))) {
/* try PIO instead of DMA */
trm290_prepare_drive(drive, 0); /* select PIO xfer */
return 1;
......@@ -396,26 +397,55 @@ void __init init_hwif_trm290 (ide_hwif_t *hwif)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
void __init init_setup_trm290 (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &trm290_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
int __init trm290_scan_pcidev (struct pci_dev *dev)
/**
* trm290_remove_one - called when an trm290 is unplugged
* @dev: the device that was removed
*
* Disconnect a trm290 device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
static void trm290_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("trm290 removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_TEKRAM)
return 0;
static struct pci_device_id trm290_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_TEKRAM, PCI_DEVICE_ID_TEKRAM_DC290, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
for (d = trm290_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "TRM290 IDE",
id_table: trm290_pci_tbl,
probe: trm290_init_one,
remove: __devexit_p(trm290_remove_one),
};
static int trm290_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void trm290_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(trm290_ide_init);
module_exit(trm290_ide_exit);
MODULE_AUTHOR("Mark Lord");
MODULE_DESCRIPTION("PCI driver module for Tekram TRM290 IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -5,15 +5,13 @@
#include <linux/pci.h>
#include <linux/ide.h>
extern void init_setup_trm290(struct pci_dev *, ide_pci_device_t *);
extern void init_hwif_trm290(ide_hwif_t *);
static ide_pci_device_t trm290_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_TEKRAM,
device: PCI_DEVICE_ID_TEKRAM_DC290,
name: "TRM290",
init_setup: init_setup_trm290,
init_chipset: NULL,
init_iops: NULL,
init_hwif: init_hwif_trm290,
......
/*
* $Id: via82cxxx.c,v 3.35-ac1 2002/08/19 Alan Exp $
* $Id: via82cxxx.c,v 3.35-ac2 2002/09/111 Alan Exp $
*
* Copyright (c) 2000-2001 Vojtech Pavlik
*
......@@ -33,6 +33,7 @@
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
......@@ -161,7 +162,7 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count)
via_print("Highest DMA rate: %s",
via_dma[via_config->flags & VIA_UDMA]);
via_print("BM-DMA base: %#x", via_base);
via_print("BM-DMA base: %#lx", via_base);
via_print("PCI clock: %d.%dMHz",
via_clock / 1000, via_clock / 100 % 10);
......@@ -634,38 +635,56 @@ static void __init init_dma_via82cxxx(ide_hwif_t *hwif, unsigned long dmabase)
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
/*
* FIXME: should not be needed
*/
static void __init init_setup_via82cxxx (struct pci_dev *dev, ide_pci_device_t *d)
static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t *d = &via82cxxx_chipsets[id->driver_data];
if (dev->device != d->device)
BUG();
ide_setup_pci_device(dev, d);
return 0;
}
/**
* via82cxxx_scan_pcidev - set up any via devices
* @dev: PCI device we are offered
* via_remove_one - called with a VIA IDE interface is unplugged
* @dev: the device that was removed
*
* Any controller we are offered that we can configure we set up
* and return 1. Anything we cannot drive we return 0
* Disconnect a VIA IDE device that has been unplugged either by hotplug
* or by a more civilized notification scheme. Not yet supported.
*/
int __init via82cxxx_scan_pcidev (struct pci_dev *dev)
static void via_remove_one(struct pci_dev *dev)
{
ide_pci_device_t *d;
panic("VIA IDE removal not yet supported");
}
if (dev->vendor != PCI_VENDOR_ID_VIA)
return 0;
static struct pci_device_id via_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
for (d = via82cxxx_chipsets; d && d->vendor && d->device; ++d) {
if (((d->vendor == dev->vendor) &&
(d->device == dev->device)) &&
(d->init_setup)) {
d->init_setup(dev, d);
return 1;
}
}
return 0;
static struct pci_driver driver = {
name: "VIA IDE",
id_table: via_pci_tbl,
probe: via_init_one,
remove: __devexit_p(via_remove_one),
};
static int via_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
static void via_ide_exit(void)
{
ide_pci_unregister_driver(&driver);
}
module_init(via_ide_init);
module_exit(via_ide_exit);
MODULE_AUTHOR("Vojtech Pavlik, Michel Aubry, Jeff Garzik, Andre Hedrick");
MODULE_DESCRIPTION("PCI driver module for VIA IDE");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
......@@ -25,17 +25,15 @@ static ide_pci_host_proc_t via_procs[] __initdata = {
};
#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
static void init_setup_via82cxxx(struct pci_dev *, ide_pci_device_t *);
static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *);
static void init_hwif_via82cxxx(ide_hwif_t *);
static void init_dma_via82cxxx(ide_hwif_t *, unsigned long);
static ide_pci_device_t via82cxxx_chipsets[] __initdata = {
{
{ /* 0 */
vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C576_1,
name: "VP_IDE",
init_setup: init_setup_via82cxxx,
init_chipset: init_chipset_via82cxxx,
init_iops: NULL,
init_hwif: init_hwif_via82cxxx,
......@@ -45,11 +43,10 @@ static ide_pci_device_t via82cxxx_chipsets[] __initdata = {
enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
bootable: ON_BOARD,
extra: 0,
},{
},{ /* 1 */
vendor: PCI_VENDOR_ID_VIA,
device: PCI_DEVICE_ID_VIA_82C586_1,
name: "VP_IDE",
init_setup: init_setup_via82cxxx,
init_chipset: init_chipset_via82cxxx,
init_iops: NULL,
init_hwif: init_hwif_via82cxxx,
......
......@@ -712,6 +712,8 @@ void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d)
probe_hwif_init(&ide_hwifs[index_list.b.high]);
}
EXPORT_SYMBOL_GPL(ide_setup_pci_device);
void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_device_t *d)
{
ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1);
......@@ -727,152 +729,10 @@ void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_d
probe_hwif_init(&ide_hwifs[index_list2.b.high]);
}
/*
* ide_scan_pcibus() gets invoked at boot time from ide.c.
* It finds all PCI IDE controllers and calls ide_setup_pci_device for them.
*/
void __init ide_scan_pcidev (struct pci_dev *dev)
{
#if 0
printk(" PCI slot %s, VID=%04x, DID=%04x\n",
dev->slot_name, dev->vendor, dev->device);
#endif
if ((dev->vendor == PCI_VENDOR_ID_CMD) &&
(dev->device == PCI_DEVICE_ID_CMD_640)) {
return;
#ifdef CONFIG_BLK_DEV_ALI15X3
}{
extern int ali15x3_scan_pcidev(struct pci_dev *dev);
if (ali15x3_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_ALI15X3 */
#ifdef CONFIG_BLK_DEV_AMD74XX
}{
extern int amd74xx_scan_pcidev(struct pci_dev *dev);
if (amd74xx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_AMD74XX */
#ifdef CONFIG_BLK_DEV_CS5530
}{
extern int cs5530_scan_pcidev(struct pci_dev *dev);
if (cs5530_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_CS5530 */
#ifdef CONFIG_BLK_DEV_CY82C693
}{
extern int cy82c693_scan_pcidev(struct pci_dev *dev);
if (cy82c693_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_CY82C693 */
#ifdef CONFIG_BLK_DEV_IT8172
}{
extern int it8172_scan_pcidev(struct pci_dev *dev);
if (it8172_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_IT8172 */
#ifdef CONFIG_BLK_DEV_NFORCE
}{
extern int nforce_scan_pcidev(struct pci_dev *dev);
if (nforce_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_NFORCE */
#ifdef CONFIG_BLK_DEV_NS87415
}{
extern int ns87415_scan_pcidev(struct pci_dev *dev);
if (ns87415_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_NS87415 */
#ifdef CONFIG_BLK_DEV_OPTI621
}{
extern int opti621_scan_pcidev(struct pci_dev *dev);
if (opti621_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_OPTI621 */
#ifdef CONFIG_BLK_DEV_PIIX
}{
extern int piix_scan_pcidev(struct pci_dev *dev);
if (piix_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PIIX */
#ifdef CONFIG_BLK_DEV_RZ1000
}{
extern int rz1000_scan_pcidev(struct pci_dev *dev);
if (rz1000_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_RZ1000 */
#ifdef CONFIG_BLK_DEV_SVWKS
}{
extern int serverworks_scan_pcidev(struct pci_dev *dev);
if (serverworks_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SVWKS */
#ifdef CONFIG_BLK_DEV_SIS5513
}{
extern int sis5513_scan_pcidev(struct pci_dev *dev);
if (sis5513_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SIS5513 */
#ifdef CONFIG_BLK_DEV_SLC90E66
}{
extern int slc90e66_scan_pcidev(struct pci_dev *dev);
if (slc90e66_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SLC90E66 */
#ifdef CONFIG_BLK_DEV_VIA82CXXX
}{
extern int via82cxxx_scan_pcidev(struct pci_dev *dev);
if (via82cxxx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_VIA82CXXX */
#ifdef CONFIG_BLK_DEV_AEC62XX
}{
extern int aec62xx_scan_pcidev(struct pci_dev *dev);
if (aec62xx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_AEC62XX */
#ifdef CONFIG_BLK_DEV_CMD64X
}{
extern int cmd64x_scan_pcidev(struct pci_dev *dev);
if (cmd64x_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_CMD64X */
#ifdef CONFIG_BLK_DEV_HPT34X
}{
extern int hpt34x_scan_pcidev(struct pci_dev *dev);
if (hpt34x_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_HPT34X */
#ifdef CONFIG_BLK_DEV_HPT366
}{
extern int hpt366_scan_pcidev(struct pci_dev *dev);
if (hpt366_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_HPT366 */
#ifdef CONFIG_BLK_DEV_PDC202XX_OLD
}{
extern int pdc202xx_scan_pcidev(struct pci_dev *dev);
if (pdc202xx_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PDC202XX_OLD */
#ifdef CONFIG_BLK_DEV_PDC202XX_NEW
}{
extern int pdcnew_scan_pcidev(struct pci_dev *dev);
if (pdcnew_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PDC202XX_NEW */
#ifdef CONFIG_BLK_DEV_PDC_ADMA
}{
extern int pdcadma_scan_pcidev(struct pci_dev *dev);
if (pdcadma_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_PDC_ADMA */
#ifdef CONFIG_BLK_DEV_SIIMAGE
}{
extern int siimage_scan_pcidev(struct pci_dev *dev);
if (siimage_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SIIMAGE */
#ifdef CONFIG_BLK_DEV_SL82C105
}{
extern int sl82c105_scan_pcidev(struct pci_dev *dev);
if (sl82c105_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_SL82C105 */
#ifdef CONFIG_BLK_DEV_TRM290
}{
extern int trm290_scan_pcidev(struct pci_dev *dev);
if (trm290_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_TRM290 */
#ifdef CONFIG_BLK_DEV_GENERIC
}{
extern int generic_scan_pcidev(struct pci_dev *dev);
if (generic_scan_pcidev(dev)) return;
#endif /* CONFIG_BLK_DEV_GENERIC */
}
}
EXPORT_SYMBOL_GPL(ide_setup_pci_devices);
/*
* Module interfaces - not yet functional.
* Module interfaces
*/
static int pre_init = 1; /* Before first ordered IDE scan */
......@@ -893,15 +753,15 @@ static LIST_HEAD(ide_pci_drivers);
* Returns are the same as for pci_register_driver
*/
int ide_register_pci_driver(struct pci_driver *driver)
int ide_pci_register_driver(struct pci_driver *driver)
{
if(!pre_init)
return pci_register_driver(driver);
return pci_module_init(driver);
list_add_tail(&driver->node, &ide_pci_drivers);
return 0;
}
EXPORT_SYMBOL(ide_register_pci_driver);
EXPORT_SYMBOL_GPL(ide_pci_register_driver);
/**
* ide_unregister_pci_driver - unregister an IDE driver
......@@ -911,7 +771,7 @@ EXPORT_SYMBOL(ide_register_pci_driver);
* as for pci_unregister_driver
*/
void ide_unregister_pci_driver(struct pci_driver *driver)
void ide_pci_unregister_driver(struct pci_driver *driver)
{
if(!pre_init)
pci_unregister_driver(driver);
......@@ -919,7 +779,40 @@ void ide_unregister_pci_driver(struct pci_driver *driver)
list_del(&driver->node);
}
EXPORT_SYMBOL(ide_unregister_pci_driver);
EXPORT_SYMBOL_GPL(ide_pci_unregister_driver);
/**
* ide_scan_pcidev - find an IDE driver for a device
* @dev: PCI device to check
*
* Look for an IDE driver to handle the device we are considering.
* This is only used during boot up to get the ordering correct. After
* boot up the pci layer takes over the job.
*/
static int __init ide_scan_pcidev(struct pci_dev *dev)
{
struct list_head *l;
struct pci_driver *d;
list_for_each(l, &ide_pci_drivers)
{
d = list_entry(l, struct pci_driver, node);
if(d->id_table)
{
const struct pci_device_id *id = pci_match_device(d->id_table, dev);
if(id != NULL)
{
if(d->probe(dev, id) >= 0)
{
dev->driver = d;
return 1;
}
}
}
}
return 0;
}
/**
* ide_scan_pcibus - perform the initial IDE driver scan
......@@ -933,6 +826,8 @@ EXPORT_SYMBOL(ide_unregister_pci_driver);
void __init ide_scan_pcibus (int scan_direction)
{
struct pci_dev *dev;
struct pci_driver *d;
struct list_head *l, *n;
pre_init = 0;
if (!scan_direction) {
......@@ -944,5 +839,16 @@ void __init ide_scan_pcibus (int scan_direction)
ide_scan_pcidev(dev);
}
}
/* FIXME: now add the drivers list to the real pci probe list */
/*
* Hand the drivers over to the PCI layer now we
* are post init.
*/
list_for_each_safe(l, n, &ide_pci_drivers)
{
list_del(l);
d = list_entry(l, struct pci_driver, node);
pci_register_driver(d);
}
}
......@@ -33,7 +33,7 @@ static kmem_cache_t *bio_slab;
#define BIOVEC_NR_POOLS 6
struct biovec_pool {
int size;
int nr_vecs;
char *name;
kmem_cache_t *slab;
mempool_t *pool;
......@@ -88,7 +88,7 @@ static inline struct bio_vec *bvec_alloc(int gfp_mask, int nr, int *idx)
bvl = mempool_alloc(bp->pool, gfp_mask);
if (bvl)
memset(bvl, 0, bp->size);
memset(bvl, 0, bp->nr_vecs * sizeof(struct bio_vec));
return bvl;
}
......@@ -457,27 +457,55 @@ void bio_endio(struct bio *bio, int uptodate)
bio->bi_end_io(bio);
}
static void __init biovec_init_pool(void)
static void __init biovec_init_pools(void)
{
int i, size;
int i, size, megabytes, pool_entries = BIO_POOL_SIZE;
int scale = BIOVEC_NR_POOLS;
megabytes = nr_free_pages() >> (20 - PAGE_SHIFT);
/*
* find out where to start scaling
*/
if (megabytes <= 16)
scale = 0;
else if (megabytes <= 32)
scale = 1;
else if (megabytes <= 64)
scale = 2;
else if (megabytes <= 96)
scale = 3;
else if (megabytes <= 128)
scale = 4;
/*
* scale number of entries
*/
pool_entries = megabytes * 2;
if (pool_entries > 256)
pool_entries = 256;
for (i = 0; i < BIOVEC_NR_POOLS; i++) {
struct biovec_pool *bp = bvec_array + i;
size = bp->size * sizeof(struct bio_vec);
printk("biovec: init pool %d, %d entries, %d bytes\n", i,
bp->size, size);
size = bp->nr_vecs * sizeof(struct bio_vec);
bp->slab = kmem_cache_create(bp->name, size, 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if (!bp->slab)
panic("biovec: can't init slab cache\n");
bp->pool = mempool_create(BIO_POOL_SIZE, slab_pool_alloc,
if (i >= scale)
pool_entries >>= 1;
bp->pool = mempool_create(pool_entries, slab_pool_alloc,
slab_pool_free, bp->slab);
if (!bp->pool)
panic("biovec: can't init mempool\n");
bp->size = size;
printk("biovec pool[%d]: %3d bvecs: %3d entries (%d bytes)\n",
i, bp->nr_vecs, pool_entries,
size);
}
}
......@@ -493,7 +521,7 @@ static int __init init_bio(void)
printk("BIO: pool of %d setup, %ZuKb (%Zd bytes/bio)\n", BIO_POOL_SIZE, BIO_POOL_SIZE * sizeof(struct bio) >> 10, sizeof(struct bio));
biovec_init_pool();
biovec_init_pools();
return 0;
}
......
......@@ -4,8 +4,6 @@
typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
struct bio *);
typedef void (elevator_merge_cleanup_fn) (request_queue_t *, struct request *, int);
typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
typedef struct request *(elevator_next_req_fn) (request_queue_t *);
......@@ -21,7 +19,6 @@ typedef void (elevator_exit_fn) (request_queue_t *, elevator_t *);
struct elevator_s
{
elevator_merge_fn *elevator_merge_fn;
elevator_merge_cleanup_fn *elevator_merge_cleanup_fn;
elevator_merge_req_fn *elevator_merge_req_fn;
elevator_next_req_fn *elevator_next_req_fn;
......@@ -42,7 +39,6 @@ struct elevator_s
*/
extern void __elv_add_request(request_queue_t *, struct request *,
struct list_head *);
extern void elv_merge_cleanup(request_queue_t *, struct request *, int);
extern int elv_merge(request_queue_t *, struct request **, struct bio *);
extern void elv_merge_requests(request_queue_t *, struct request *,
struct request *);
......@@ -61,6 +57,7 @@ extern elevator_t elevator_noop;
*/
extern elevator_t elevator_linus;
#define elv_linus_sequence(rq) ((long)(rq)->elevator_private)
#define ELV_LINUS_SEEK_COST 16
/*
* use the /proc/iosched interface, all the below is history ->
......
......@@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/bitops.h>
#include <linux/bio.h>
#include <linux/pci.h>
#include <asm/byteorder.h>
#include <asm/system.h>
#include <asm/hdreg.h>
......@@ -904,9 +905,7 @@ extern inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned l
((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx))
#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1)
#ifdef CONFIG_BLK_DEV_IDEPCI
struct ide_pci_device_s;
#endif /* CONFIG_BLK_DEV_IDEPCI */
typedef struct hwif_s {
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
......@@ -937,10 +936,8 @@ typedef struct hwif_s {
hwif_chipset_t chipset; /* sub-module for tuning.. */
#ifdef CONFIG_BLK_DEV_IDEPCI
struct pci_dev *pci_dev; /* for pci chipsets */
struct ide_pci_device_s *cds; /* chipset device struct */
#endif /* CONFIG_BLK_DEV_IDEPCI */
#if 0
ide_hwif_ops_t *hwifops;
......@@ -1108,12 +1105,10 @@ typedef struct hwgroup_s {
/* ptr to current hwif in linked-list */
ide_hwif_t *hwif;
#ifdef CONFIG_BLK_DEV_IDEPCI
/* for pci chipsets */
struct pci_dev *pci_dev;
/* chipset device struct */
struct ide_pci_device_s *cds;
#endif /* CONFIG_BLK_DEV_IDEPCI */
/* current request */
struct request *rq;
......@@ -1637,23 +1632,16 @@ extern void ide_intr(int irq, void *dev_id, struct pt_regs *regs);
extern void do_ide_request(request_queue_t *);
extern void ide_init_subdrivers(void);
#ifndef _IDE_C
extern struct block_device_operations ide_fops[];
extern ide_proc_entry_t generic_subdriver_entries[];
#endif
extern int ata_attach(ide_drive_t *);
#ifdef _IDE_C
#ifdef CONFIG_BLK_DEV_IDE
extern int ideprobe_init(void);
#ifdef CONFIG_BLK_DEV_IDEPCI
extern void ide_scan_pcibus(int scan_direction) __init;
#endif /* CONFIG_BLK_DEV_IDEPCI */
#endif /* CONFIG_BLK_DEV_IDE */
#endif /* _IDE_C */
extern int ide_pci_register_driver(struct pci_driver *driver);
extern void ide_pci_unregister_driver(struct pci_driver *driver);
extern void default_hwif_iops(ide_hwif_t *);
extern void default_hwif_mmiops(ide_hwif_t *);
......@@ -1665,8 +1653,6 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
int ide_unregister_subdriver (ide_drive_t *drive);
int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
#ifdef CONFIG_BLK_DEV_IDEPCI
#ifdef CONFIG_PROC_FS
typedef struct ide_pci_host_proc_s {
char *name;
......@@ -1716,14 +1702,9 @@ typedef struct ide_pci_device_s {
struct ide_pci_device_s *next;
} ide_pci_device_t;
#ifdef LINUX_PCI_H
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *);
#endif /* LINUX_PCI_H */
#endif /* CONFIG_BLK_DEV_IDEPCI */
#ifdef CONFIG_BLK_DEV_IDEDMA
#define BAD_DMA_DRIVE 0
#define GOOD_DMA_DRIVE 1
extern int ide_build_dmatable(ide_drive_t *, struct request *);
......@@ -1750,7 +1731,6 @@ extern int __ide_dma_verbose(ide_drive_t *);
extern int __ide_dma_retune(ide_drive_t *);
extern int __ide_dma_lostirq(ide_drive_t *);
extern int __ide_dma_timeout(ide_drive_t *);
#endif /* CONFIG_BLK_DEV_IDEDMA */
extern void hwif_unregister(ide_hwif_t *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment