Commit 78929a18 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.21 ide 92

 - Finally unify task_in_intr and task_mulin_intr. One crucial code path less to
   watch out, but a quite dangerous step in itself. PIO reading is functional
   again. The next step will be the unification of the write path of course.

 - Introduce a small helper for the execution of task file commands which
   basically just send a simple command down to the drive.

 - Add a buffer parameter to ide_raw_taskfile allowing to unify the handling of
   ioctl and normal ide_raw_taskfile request.

 - Fix some small function pointer type mismatches.

Apply more host chip controller clenups by Bartlomiej:

     - move setting drive->current_speed from *_tune_chipset()
       to ide_config_drive_speed()

    cmd64x.c:
	- convert cmd64x_tuneproc() to use ata-timing library
	- clean cmd64x_tune_chipset() and cmd680_tune_chipset()

    hpt366.c:
	- remove empty timings table

    it8172.c:
	- kill prototypes
	- update to new udma_setup() scheme

    - misc cleanups
parent 47496445
......@@ -185,28 +185,6 @@ struct dmi_blacklist
#define NO_MATCH { NONE, NULL}
#define MATCH(a,b) { a, b }
/*
* We have problems with IDE DMA on some platforms. In paticular the
* KT7 series. On these it seems the newer BIOS has fixed them. The
* rule needs to be improved to match specific BIOS revisions with
* corruption problems
*/
#if 0
static __init int disable_ide_dma(struct dmi_blacklist *d)
{
#ifdef CONFIG_BLK_DEV_IDE
extern int noautodma;
if(noautodma == 0)
{
noautodma = 1;
printk(KERN_INFO "%s series board detected. Disabling IDE DMA.\n", d->ident);
}
#endif
return 0;
}
#endif
/*
* Reboot options and system auto-detection code provided by
* Dell Computer Corporation so their systems "just work". :-)
......@@ -511,12 +489,6 @@ static __init int print_if_true(struct dmi_blacklist *d)
*/
static __initdata struct dmi_blacklist dmi_blacklist[]={
#if 0
{ disable_ide_dma, "KT7", { /* Overbroad right now - kill DMA on problem KT7 boards */
MATCH(DMI_PRODUCT_NAME, "KT7-RAID"),
NO_MATCH, NO_MATCH, NO_MATCH
} },
#endif
{ broken_ps2_resume, "Dell Latitude C600", { /* Handle problems with APM on the C600 */
MATCH(DMI_SYS_VENDOR, "Dell"),
MATCH(DMI_PRODUCT_NAME, "Latitude C600"),
......
......@@ -372,6 +372,8 @@ CONFIG_BLK_DEV_HPT366
HPT366 is an Ultra DMA chipset for ATA-66.
HPT368 is an Ultra DMA chipset for ATA-66 RAID Based.
HPT370 is an Ultra DMA chipset for ATA-100.
HPT372 is an Ultra DMA chipset for ATA-100.
HPT374 is an Ultra DMA chipset for ATA-100.
This driver adds up to 4 more EIDE devices sharing a single
interrupt.
......
......@@ -50,7 +50,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
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 (EXPERMENTAL)' CONFIG_HPT34X_AUTODMA $CONFIG_BLK_DEV_HPT34X $CONFIG_EXPERIMENTAL
dep_bool ' HPT366 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' HPT36X/37X chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Intel and Efar (SMsC) chipset 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
......
......@@ -141,8 +141,6 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed)
else
aec_set_speed_new(drive->channel->pci_dev, drive->dn, &t);
drive->current_speed = speed;
return 0;
}
......
......@@ -53,6 +53,7 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio)
t = ata_timing_data(pio);
/* FIXME: use generic ata-timing library --bkz */
s_time = t->setup;
a_time = t->active;
if ((s_clc = (s_time * system_bus_speed + 999999) / 1000000) >= 8)
......@@ -171,8 +172,6 @@ static int ali15x3_tune_chipset(struct ata_device *drive, byte speed)
}
#endif /* CONFIG_BLK_DEV_IDEDMA */
drive->current_speed = speed;
return ide_config_drive_speed(drive, speed);
}
......
......@@ -153,8 +153,6 @@ static int amd_set_drive(struct ata_device *drive, unsigned char speed)
amd_set_speed(drive->channel->pci_dev, drive->dn, &t);
drive->current_speed = speed;
return 0;
}
......
This diff is collapsed.
......@@ -204,7 +204,7 @@ static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single)
data = IN_BYTE(CY82_DATA_PORT);
printk (KERN_INFO "%s (ch=%d, dev=%d): DMA mode is %d (single=%d)\n", drive->name, drive->channel->unit, drive->select.b.unit, (data&0x3), ((data>>2)&1));
#endif /* CY82C693_DEBUG_LOGS */
#endif
data = (byte)mode|(byte)(single<<2);
......@@ -213,7 +213,7 @@ static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single)
#if CY82C693_DEBUG_INFO
printk (KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n", drive->name, drive->channel->unit, drive->select.b.unit, mode, single);
#endif /* CY82C693_DEBUG_INFO */
#endif
/*
* note: below we set the value for Bus Master IDE TimeOut Register
......@@ -231,7 +231,7 @@ static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single)
#if CY82C693_DEBUG_INFO
printk (KERN_INFO "%s: Set IDE Bus Master TimeOut Register to 0x%X\n", drive->name, data);
#endif /* CY82C693_DEBUG_INFO */
#endif
}
/*
......@@ -331,7 +331,7 @@ static void cy82c693_tune_drive(struct ata_device *drive, byte pio)
#if CY82C693_DEBUG_INFO
printk (KERN_INFO "%s: Selected PIO mode %d\n", drive->name, pio);
#endif /* CY82C693_DEBUG_INFO */
#endif
compute_clocks(pio, &pclk); /* let's calc the values for this PIO mode */
......
......@@ -63,7 +63,6 @@ static int hpt34x_tune_chipset(struct ata_device *drive, u8 speed)
udma, pio, err);
#endif
drive->current_speed = speed;
return ide_config_drive_speed(drive, speed);
}
......
......@@ -140,7 +140,7 @@ struct chipset_bus_clock_list_entry {
unsigned int chipset_settings;
};
/* key for bus clock timings
/* key for bus clock timings for HPT370
* bit
* 0:3 data_high_time. inactive time of DIOW_/DIOR_ for PIO and MW
* DMA. cycles = value + 1
......@@ -408,26 +408,6 @@ static struct chipset_bus_clock_list_entry thirty_three_base_hpt374[] = {
{ 0, 0x06814e93 }
};
#if 0
static struct chipset_bus_clock_list_entry fifty_base_hpt374[] = {
{ XFER_UDMA_6, },
{ XFER_UDMA_5, },
{ XFER_UDMA_4, },
{ XFER_UDMA_3, },
{ XFER_UDMA_2, },
{ XFER_UDMA_1, },
{ XFER_UDMA_0, },
{ XFER_MW_DMA_2, },
{ XFER_MW_DMA_1, },
{ XFER_MW_DMA_0, },
{ XFER_PIO_4, },
{ XFER_PIO_3, },
{ XFER_PIO_2, },
{ XFER_PIO_1, },
{ XFER_PIO_0, },
{ 0, }
};
#endif
#if 0
static struct chipset_bus_clock_list_entry sixty_six_base_hpt374[] = {
{ XFER_UDMA_6, 0x12406231 }, /* checkme */
......@@ -678,21 +658,13 @@ static int hpt3xx_tune_chipset(struct ata_device *drive, u8 speed)
} else {
hpt366_tune_chipset(drive, speed);
}
drive->current_speed = speed;
return ide_config_drive_speed(drive, speed);
}
static void hpt3xx_tune_drive(struct ata_device *drive, u8 pio)
{
u8 speed;
switch(pio) {
case 4: speed = XFER_PIO_4;break;
case 3: speed = XFER_PIO_3;break;
case 2: speed = XFER_PIO_2;break;
case 1: speed = XFER_PIO_1;break;
default: speed = XFER_PIO_0;break;
}
(void) hpt3xx_tune_chipset(drive, speed);
(void) hpt3xx_tune_chipset(drive, XFER_PIO_0 + min_t(u8, pio, 4));
}
#ifdef CONFIG_BLK_DEV_IDEDMA
......
This diff is collapsed.
......@@ -341,21 +341,6 @@ pmac_ide_init_hwif_ports(hw_regs_t *hw,
}
}
#if 0
/* This one could be later extended to handle CMD IDE and be used by some kind
* of /proc interface. I want to be able to get the devicetree path of a block
* device for yaboot configuration
*/
struct device_node*
pmac_ide_get_devnode(struct ata_device *drive)
{
int i = pmac_ide_find(drive);
if (i < 0)
return NULL;
return pmac_ide[i].node;
}
#endif
/* Setup timings for the selected drive (master/slave). I still need to verify if this
* is enough, I beleive selectproc will be called whenever an IDE command is started,
* but... */
......@@ -1365,7 +1350,7 @@ static int pmac_udma_start(struct ata_device *drive, struct request *rq)
*/
ix = pmac_ide_find(drive);
if (ix < 0)
return ide_started;
return ide_stopped;
dma = pmac_ide[ix].dma_regs;
ata4 = (pmac_ide[ix].kind == controller_kl_ata4 ||
......
......@@ -242,8 +242,9 @@ int ide_do_drive_cmd(struct ata_device *drive, struct request *rq, ide_action_t
/*
* Invoked on completion of a special REQ_SPECIAL command.
*/
ide_startstop_t ata_special_intr(struct ata_device *drive, struct
request *rq) {
static ide_startstop_t special_intr(struct ata_device *drive,
struct request *rq)
{
struct ata_taskfile *ar = rq->special;
ide_startstop_t ret = ide_stopped;
......@@ -292,16 +293,18 @@ ide_startstop_t ata_special_intr(struct ata_device *drive, struct
return ret;
}
int ide_raw_taskfile(struct ata_device *drive, struct ata_taskfile *ar)
int ide_raw_taskfile(struct ata_device *drive, struct ata_taskfile *ar,
char *buffer)
{
struct request req;
ar->command_type = IDE_DRIVE_TASK_NO_DATA;
ar->XXX_handler = ata_special_intr;
ar->XXX_handler = special_intr;
memset(&req, 0, sizeof(req));
req.flags = REQ_SPECIAL;
req.special = ar;
req.buffer = buffer;
return ide_do_drive_cmd(drive, &req, ide_wait);
}
......@@ -310,5 +313,4 @@ EXPORT_SYMBOL(drive_is_ready);
EXPORT_SYMBOL(ide_do_drive_cmd);
EXPORT_SYMBOL(ata_read);
EXPORT_SYMBOL(ata_write);
EXPORT_SYMBOL(ata_special_intr);
EXPORT_SYMBOL(ide_raw_taskfile);
......@@ -560,7 +560,7 @@ static int do_recalibrate(struct ata_device *drive)
memset(&args, 0, sizeof(args));
args.taskfile.sector_count = drive->sect;
args.cmd = WIN_RESTORE;
ide_raw_taskfile(drive, &args);
ide_raw_taskfile(drive, &args, NULL);
printk(KERN_INFO "%s: done!\n", drive->name);
}
......
......@@ -47,7 +47,6 @@ static int do_cmd_ioctl(struct ata_device *drive, unsigned long arg)
u8 *argbuf = vals;
int argsize = 4;
struct ata_taskfile args;
struct request req;
/* Second phase.
*/
......@@ -78,17 +77,7 @@ static int do_cmd_ioctl(struct ata_device *drive, unsigned long arg)
memset(argbuf + 4, 0, argsize - 4);
}
/* Issue ATA command and wait for completion.
*/
args.command_type = IDE_DRIVE_TASK_NO_DATA;
args.XXX_handler = ata_special_intr;
memset(&req, 0, sizeof(req));
req.flags = REQ_SPECIAL;
req.special = &args;
req.buffer = argbuf + 4;
err = ide_do_drive_cmd(drive, &req, ide_wait);
err = ide_raw_taskfile(drive, &args, argbuf + 4);
argbuf[0] = drive->status;
argbuf[1] = args.taskfile.feature;
......
......@@ -45,21 +45,11 @@
#include "ata-timing.h"
#include "pcihost.h"
/*
* Prototypes
*/
static void it8172_tune_drive (struct ata_device *drive, byte pio);
#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_IT8172_TUNING)
static byte it8172_dma_2_pio (byte xfer_rate);
static int it8172_tune_chipset (struct ata_device *drive, byte speed);
static int it8172_config_chipset_for_dma (struct ata_device *drive);
static int it8172_dmaproc(ide_dma_action_t func, struct ata_device *drive);
#endif
void __init ide_init_it8172(struct ata_channel *channel);
static void it8172_tune_drive (struct ata_device *drive, byte pio)
/* FIXME: fix locking --bkz */
static void it8172_tune_drive (struct ata_device *drive, u8 pio)
{
struct pci_dev *dev = drive->channel->pci_dev;
unsigned long flags;
u16 drive_enables;
u32 drive_timing;
......@@ -70,8 +60,8 @@ static void it8172_tune_drive (struct ata_device *drive, byte pio)
else
pio = min_t(byte, pio, 4);
pci_read_config_word(drive->channel->pci_dev, master_port, &master_data);
pci_read_config_dword(drive->channel->pci_dev, slave_port, &slave_data);
pci_read_config_word(dev, master_port, &master_data);
pci_read_config_dword(dev, slave_port, &slave_data);
/*
* FIX! The DIOR/DIOW pulse width and recovery times in port 0x44
......@@ -102,7 +92,7 @@ static void it8172_tune_drive (struct ata_device *drive, byte pio)
save_flags(flags);
cli();
pci_write_config_word(drive->channel->pci_dev, master_port, master_data);
pci_write_config_word(dev, master_port, master_data);
restore_flags(flags);
}
......@@ -110,7 +100,7 @@ static void it8172_tune_drive (struct ata_device *drive, byte pio)
/*
*
*/
static byte it8172_dma_2_pio (byte xfer_rate)
static u8 it8172_dma_2_pio(u8 xfer_rate)
{
switch(xfer_rate) {
case XFER_UDMA_5:
......@@ -139,7 +129,7 @@ static byte it8172_dma_2_pio (byte xfer_rate)
}
}
static int it8172_tune_chipset (struct ata_device *drive, byte speed)
static int it8172_tune_chipset(struct ata_device *drive, u8 speed)
{
struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev;
......@@ -147,7 +137,7 @@ static int it8172_tune_chipset (struct ata_device *drive, byte speed)
int u_flag = 1 << drive->dn;
int u_speed = 0;
int err = 0;
byte reg48, reg4a;
u8 reg48, reg4a;
pci_read_config_byte(dev, 0x48, &reg48);
pci_read_config_byte(dev, 0x4a, &reg4a);
......@@ -187,52 +177,28 @@ static int it8172_tune_chipset (struct ata_device *drive, byte speed)
it8172_tune_drive(drive, it8172_dma_2_pio(speed));
err = ide_config_drive_speed(drive, speed);
drive->current_speed = speed;
return err;
return ide_config_drive_speed(drive, speed);
}
static int it8172_config_chipset_for_dma(struct ata_device *drive)
static int it8172_udma_setup(struct ata_device *drive)
{
struct hd_driveid *id = drive->id;
byte speed;
speed = ata_timing_mode(drive, XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA | XFER_UDMA);
u8 speed = ata_timing_mode(drive, XFER_PIO | XFER_EPIO |
XFER_SWDMA | XFER_MWDMA | XFER_UDMA);
(void) it8172_tune_chipset(drive, speed);
return ((int)((id->dma_ultra >> 11) & 7) ? ide_dma_on :
((id->dma_ultra >> 8) & 7) ? ide_dma_on :
((id->dma_mword >> 8) & 7) ? ide_dma_on :
((id->dma_1word >> 8) & 7) ? ide_dma_on :
ide_dma_off_quietly);
}
static int it8172_dmaproc(ide_dma_action_t func, struct ata_device *drive)
{
switch (func) {
case ide_dma_check:
return ide_dmaproc((ide_dma_action_t)it8172_config_chipset_for_dma(drive),
drive);
default :
break;
}
/* Other cases are done by generic IDE-DMA code. */
return ide_dmaproc(func, drive);
return !it8172_tune_chipset(drive, speed);
}
#endif /* defined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_IT8172_TUNING) */
static unsigned int __init pci_init_it8172 (struct pci_dev *dev)
static unsigned int __init pci_init_it8172(struct pci_dev *dev)
{
unsigned char progif;
u8 progif;
/*
* Place both IDE interfaces into PCI "native" mode
*/
(void)pci_read_config_byte(dev, PCI_CLASS_PROG, &progif);
(void)pci_write_config_byte(dev, PCI_CLASS_PROG, progif | 0x05);
pci_read_config_byte(dev, PCI_CLASS_PROG, &progif);
pci_write_config_byte(dev, PCI_CLASS_PROG, progif | 0x05);
return IT8172_IDE_IRQ;
}
......
......@@ -342,9 +342,8 @@ int __init init_opti621(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
}
return 0;
}
......@@ -415,7 +415,7 @@ void udma_destroy_table(struct ata_channel *ch)
*
* Channel lock should be held.
*/
int udma_pci_start(struct ata_device *drive, struct request *rq)
void udma_pci_start(struct ata_device *drive, struct request *rq)
{
struct ata_channel *ch = drive->channel;
unsigned long dma_base = ch->dma_base;
......
......@@ -230,8 +230,6 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed)
printk(KERN_DEBUG "DP(%x)\n", DP);
#endif
drive->current_speed = speed;
#if PDC202XX_DEBUG_DRIVE_INFO
printk("%s: %02x drive%d 0x%08x ",
drive->name, speed,
......@@ -352,8 +350,6 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed)
;
}
drive->current_speed = speed;
return ide_config_drive_speed(drive, speed);
}
......@@ -551,7 +547,7 @@ static int pdc202xx_udma_setup(struct ata_device *drive)
return 0;
}
static int pdc202xx_udma_start(struct ata_device *drive, struct request *rq)
static void pdc202xx_udma_start(struct ata_device *drive, struct request *rq)
{
struct ata_channel *ch = drive->channel;
u32 high_16 = pci_resource_start(ch->pci_dev, 4);
......
......@@ -222,8 +222,6 @@ static int piix_set_drive(struct ata_device *drive, unsigned char speed)
piix_set_speed(drive->channel->pci_dev, drive->dn, &t, umul);
drive->current_speed = speed;
return 0;
}
......
......@@ -339,6 +339,8 @@ int ide_config_drive_speed(struct ata_device *drive, byte speed)
ata_irq_enable(drive, 1);
udelay(1);
/* FIXME: use ata_status_poll() --bkz */
ata_busy_poll(drive, WAIT_CMD);
/*
......@@ -395,6 +397,8 @@ int ide_config_drive_speed(struct ata_device *drive, byte speed)
default: break;
}
drive->current_speed = speed;
return error;
}
......
......@@ -123,23 +123,21 @@ static int svwks_ratemask(struct ata_device *drive)
return map;
}
static int svwks_tune_chipset(struct ata_device *drive, byte speed)
static int svwks_tune_chipset(struct ata_device *drive, u8 speed)
{
static u8 dma_modes[] = { 0x77, 0x21, 0x20 };
static u8 pio_modes[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 };
struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev;
byte unit = (drive->select.b.unit & 0x01);
byte csb5 = (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ? 1 : 0;
byte drive_pci, drive_pci2;
byte drive_pci3 = hwif->unit ? 0x57 : 0x56;
struct ata_channel *ch = drive->channel;
struct pci_dev *dev = ch->pci_dev;
u8 unit = drive->select.b.unit & 0x01;
u8 drive_pci, drive_pci2;
u8 drive_pci3 = ch->unit ? 0x57 : 0x56;
byte ultra_enable, ultra_timing, dma_timing, pio_timing;
unsigned short csb5_pio;
u8 ultra_enable, ultra_timing, dma_timing, pio_timing;
u16 csb5_pio;
byte pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
u8 pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
switch (drive->dn) {
case 0: drive_pci = 0x41; break;
......@@ -213,7 +211,8 @@ static int svwks_tune_chipset(struct ata_device *drive, byte speed)
#endif
pci_write_config_byte(dev, drive_pci, pio_timing);
if (csb5)
if (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
pci_write_config_word(dev, 0x4A, csb5_pio);
#ifdef CONFIG_BLK_DEV_IDEDMA
......@@ -221,29 +220,20 @@ static int svwks_tune_chipset(struct ata_device *drive, byte speed)
pci_write_config_byte(dev, drive_pci3, ultra_timing);
pci_write_config_byte(dev, 0x54, ultra_enable);
#endif
drive->current_speed = speed;
return ide_config_drive_speed(drive, speed);
}
static void svwks_tune_drive(struct ata_device *drive, byte pio)
static void svwks_tune_drive(struct ata_device *drive, u8 pio)
{
byte speed;
switch(pio) {
case 4: speed = XFER_PIO_4;break;
case 3: speed = XFER_PIO_3;break;
case 2: speed = XFER_PIO_2;break;
case 1: speed = XFER_PIO_1;break;
default: speed = XFER_PIO_0;break;
}
(void) svwks_tune_chipset(drive, speed);
(void) svwks_tune_chipset(drive, XFER_PIO_0 + min_t(u8, pio, 4));
}
#ifdef CONFIG_BLK_DEV_IDEDMA
static int config_chipset_for_dma(struct ata_device *drive)
{
int map;
byte mode;
u8 mode;
/* FIXME: check SWDMA modes --bkz */
map = XFER_MWDMA | svwks_ratemask(drive);
......@@ -354,7 +344,7 @@ static int svwks_udma_stop(struct ata_device *drive)
static unsigned int __init svwks_init_chipset(struct pci_dev *dev)
{
unsigned int reg;
byte btr;
u8 btr;
/* save revision id to determine DMA capability */
pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision);
......@@ -404,8 +394,7 @@ static unsigned int __init svwks_init_chipset(struct pci_dev *dev)
static unsigned int __init ata66_svwks_dell(struct ata_channel *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
(dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE ||
dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE))
return ((1 << (hwif->unit + 14)) &
......@@ -422,8 +411,7 @@ static unsigned int __init ata66_svwks_dell(struct ata_channel *hwif)
static unsigned int __init ata66_svwks_cobalt(struct ata_channel *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN &&
dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
return ((1 << (hwif->unit + 14)) &
dev->subsystem_device) ? 1 : 0;
......@@ -501,9 +489,8 @@ int __init init_svwks(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
}
return 0;
}
......@@ -267,7 +267,7 @@ static int config_art_rwp_pio(struct ata_device *drive, u8 pio)
{
struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev;
u8 drive_pci, test1, test2, speed;
u8 drive_pci, test1, test2;
#ifdef DEBUG
sis5513_load_verify_registers(dev, "config_drive_art_rwp_pio start");
......@@ -280,13 +280,10 @@ static int config_art_rwp_pio(struct ata_device *drive, u8 pio)
drive->dn, pio, timing);
#endif
switch(drive->dn) {
case 0: drive_pci = 0x40; break;
case 1: drive_pci = 0x42; break;
case 2: drive_pci = 0x44; break;
case 3: drive_pci = 0x46; break;
default: return 1;
}
if (drive->dn > 3) /* FIXME: remove this --bkz */
return 1;
drive_pci = 0x40 + (drive->dn << 1);
/* register layout changed with newer ATA100 chips */
if (chipset_family < ATA_100) {
......@@ -321,9 +318,8 @@ static int config_art_rwp_pio(struct ata_device *drive, u8 pio)
#ifdef DEBUG
sis5513_load_verify_registers(dev, "config_drive_art_rwp_pio start");
#endif
speed = XFER_PIO_0 + min_t(u8, pio, 4);
drive->current_speed = speed;
return ide_config_drive_speed(drive, speed);
return ide_config_drive_speed(drive, XFER_PIO_0 + min_t(u8, pio, 4));
}
static int sis5513_tune_chipset(struct ata_device *drive, u8 speed)
......@@ -338,13 +334,11 @@ static int sis5513_tune_chipset(struct ata_device *drive, u8 speed)
printk("SIS5513: sis5513_tune_chipset, drive %d, speed %d\n",
drive->dn, speed);
#endif
switch(drive->dn) {
case 0: drive_pci = 0x40; break;
case 1: drive_pci = 0x42; break;
case 2: drive_pci = 0x44; break;
case 3: drive_pci = 0x46; break;
default: return 0;
}
if (drive->dn > 3) /* FIXME: remove this --bkz */
return 1;
drive_pci = 0x40 + (drive->dn << 1);
#ifdef BROKEN_LEVEL
#ifdef DEBUG
......@@ -396,11 +390,10 @@ static int sis5513_tune_chipset(struct ata_device *drive, u8 speed)
default:
return config_art_rwp_pio(drive, 0);
}
drive->current_speed = speed;
#ifdef DEBUG
sis5513_load_verify_registers(dev, "sis5513_tune_chipset end");
#endif
return ((int) ide_config_drive_speed(drive, speed));
return ide_config_drive_speed(drive, speed);
}
static void sis5513_tune_drive(struct ata_device *drive, u8 pio)
......@@ -568,8 +561,8 @@ static unsigned int __init pci_init_sis5513(struct pci_dev *dev)
static unsigned int __init ata66_sis5513(struct ata_channel *hwif)
{
byte reg48h = 0, ata66 = 0;
byte mask = hwif->unit ? 0x20 : 0x10;
u8 reg48h, ata66 = 0;
u8 mask = hwif->unit ? 0x20 : 0x10;
pci_read_config_byte(hwif->pci_dev, 0x48, &reg48h);
if (chipset_family >= ATA_66) {
......
......@@ -430,7 +430,7 @@ static int check_autopoll(struct ata_device *drive)
memset(&args, 0, sizeof(args));
args.taskfile.feature = 0x01;
args.cmd = WIN_NOP;
ide_raw_taskfile(drive, &args);
ide_raw_taskfile(drive, &args, NULL);
if (args.taskfile.feature & ABRT_ERR)
return 1;
......@@ -458,7 +458,7 @@ static int configure_tcq(struct ata_device *drive)
memset(&args, 0, sizeof(args));
args.taskfile.feature = SETFEATURES_EN_WCACHE;
args.cmd = WIN_SETFEATURES;
if (ide_raw_taskfile(drive, &args)) {
if (ide_raw_taskfile(drive, &args, NULL)) {
printk("%s: failed to enable write cache\n", drive->name);
return 1;
}
......@@ -470,7 +470,7 @@ static int configure_tcq(struct ata_device *drive)
memset(&args, 0, sizeof(args));
args.taskfile.feature = SETFEATURES_DIS_RI;
args.cmd = WIN_SETFEATURES;
if (ide_raw_taskfile(drive, &args)) {
if (ide_raw_taskfile(drive, &args, NULL)) {
printk("%s: disabling release interrupt fail\n", drive->name);
return 1;
}
......@@ -482,7 +482,7 @@ static int configure_tcq(struct ata_device *drive)
memset(&args, 0, sizeof(args));
args.taskfile.feature = SETFEATURES_EN_SI;
args.cmd = WIN_SETFEATURES;
if (ide_raw_taskfile(drive, &args)) {
if (ide_raw_taskfile(drive, &args, NULL)) {
printk("%s: enabling service interrupt fail\n", drive->name);
return 1;
}
......
......@@ -176,7 +176,7 @@ static void trm290_selectproc(struct ata_device *drive)
}
#ifdef CONFIG_BLK_DEV_IDEDMA
static int trm290_udma_start(struct ata_device *drive, struct request *__rq)
static void trm290_udma_start(struct ata_device *drive, struct request *__rq)
{
/* Nothing to be done here. */
}
......
......@@ -199,8 +199,6 @@ static int via_set_drive(struct ata_device *drive, unsigned char speed)
via_set_speed(drive->channel->pci_dev, drive->dn, &t);
drive->current_speed = speed;
return 0;
}
......
......@@ -680,8 +680,7 @@ static inline void ide_unmap_rq(struct request *rq, char *to,
bio_kunmap_irq(to, flags);
}
extern ide_startstop_t ata_special_intr(struct ata_device *, struct request *);
extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *);
extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *, char *);
extern void ide_fix_driveid(struct hd_driveid *id);
extern int ide_config_drive_speed(struct ata_device *, byte);
......@@ -785,7 +784,7 @@ static inline void udma_irq_lost(struct ata_device *drive)
#ifdef CONFIG_BLK_DEV_IDEDMA
extern void udma_pci_enable(struct ata_device *drive, int on, int verbose);
extern int udma_pci_start(struct ata_device *drive, struct request *rq);
extern void udma_pci_start(struct ata_device *drive, struct request *rq);
extern int udma_pci_stop(struct ata_device *drive);
extern int udma_pci_init(struct ata_device *drive, struct request *rq);
extern int udma_pci_irq_status(struct ata_device *drive);
......
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