From: Martin Dalecki Date: Fri, 19 Jul 2002 02:34:06 +0000 (-0700) Subject: [PATCH] IDE 100 X-Git-Tag: v2.5.27~19^2 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=84f4a1c476b850edf3e54bf0db060b481b7a78d6;p=history.git [PATCH] IDE 100 Trivia time: - C99 conforming initializations by Rusty. - ide__sti() -> local_irq_enable() and its friends. --- diff --git a/drivers/ide/aec62xx.c b/drivers/ide/aec62xx.c index 855139e39ac3..d2dca5e1a1a4 100644 --- a/drivers/ide/aec62xx.c +++ b/drivers/ide/aec62xx.c @@ -61,22 +61,25 @@ #define AEC_CABLEPINS_INPUT 0x10 static unsigned char aec_cyc2udma[9] = { 5, 5, 5, 4, 3, 2, 2, 1, 1 }; -static unsigned char aec_cyc2act[16] = { 1, 1, 2, 3, 4, 5, 6, 0, 0, 7, 7, 7, 7, 7, 7, 7 }; -static unsigned char aec_cyc2rec[16] = { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 12, 13, 14 }; +static unsigned char aec_cyc2act[16] = + { 1, 1, 2, 3, 4, 5, 6, 0, 0, 7, 7, 7, 7, 7, 7, 7 }; +static unsigned char aec_cyc2rec[16] = + { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 12, 13, 14 }; /* * aec_set_speed_old() writes timing values to * the chipset registers for ATP850UF */ -static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, struct ata_timing *timing) +static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, + struct ata_timing *timing) { unsigned char t; pci_write_config_byte(dev, AEC_DRIVE_TIMING + (dn << 1), - aec_cyc2act[FIT(timing->active, 0, 15)]); + aec_cyc2act[FIT(timing->active, 0, 15)]); pci_write_config_byte(dev, AEC_DRIVE_TIMING + (dn << 1) + 1, - aec_cyc2rec[FIT(timing->recover, 0, 15)]); + aec_cyc2rec[FIT(timing->recover, 0, 15)]); pci_read_config_byte(dev, AEC_UDMA_OLD, &t); t &= ~(3 << (dn << 1)); @@ -90,19 +93,22 @@ static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, struct ata_ * other Artop chips */ -static void aec_set_speed_new(struct pci_dev *dev, unsigned char dn, struct ata_timing *timing) +static void aec_set_speed_new(struct pci_dev *dev, unsigned char dn, + struct ata_timing *timing) { unsigned char t; pci_write_config_byte(dev, AEC_DRIVE_TIMING + dn, - (aec_cyc2act[FIT(timing->active, 0, 15)] << 4) - | aec_cyc2rec[FIT(timing->recover, 0, 15)]); + (aec_cyc2act[FIT(timing->active, 0, 15)] << + 4) + | aec_cyc2rec[FIT(timing->recover, 0, 15)]); pci_read_config_byte(dev, AEC_UDMA_NEW + (dn >> 1), &t); t &= ~(0xf << ((dn & 1) << 2)); if (timing->udma) { if (timing->udma >= 2) - t |= aec_cyc2udma[FIT(timing->udma, 2, 8)] << ((dn & 1) << 2); + t |= aec_cyc2udma[FIT(timing->udma, 2, 8)] << + ((dn & 1) << 2); if (timing->mode == XFER_UDMA_5) t |= 6; if (timing->mode == XFER_UDMA_6) @@ -123,12 +129,15 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed) int T, UT; int aec_old; - aec_old = (drive->channel->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF); + aec_old = + (drive->channel->pci_dev->device == + PCI_DEVICE_ID_ARTOP_ATP850UF); if (speed != XFER_PIO_SLOW && speed != drive->current_speed) if (ide_config_drive_speed(drive, speed)) - printk(KERN_WARNING "ide%d: Drive %d didn't accept speed setting. Oh, well.\n", - drive->dn >> 1, drive->dn & 1); + printk(KERN_WARNING + "ide%d: Drive %d didn't accept speed setting. Oh, well.\n", + drive->dn >> 1, drive->dn & 1); T = 1000000000 / system_bus_speed; UT = T / (aec_old ? 1 : 2); @@ -152,7 +161,9 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed) static void aec62xx_tune_drive(struct ata_device *drive, unsigned char pio) { if (pio == 255) { - aec_set_drive(drive, ata_timing_mode(drive, XFER_PIO | XFER_EPIO)); + aec_set_drive(drive, + ata_timing_mode(drive, + XFER_PIO | XFER_EPIO)); return; } @@ -169,14 +180,17 @@ static int __init aec62xx_modes_map(struct ata_channel *ch) if (ch->udma_four) switch (ch->pci_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP865R: - case PCI_DEVICE_ID_ARTOP_ATP865: - /* Can't use these modes simultaneously, - based on which PLL clock was chosen. */ - map |= inb (bmide + AEC_BM_STAT_PCH) & AEC_PLLCLK_ATA133 ? XFER_UDMA_133 : XFER_UDMA_100; - case PCI_DEVICE_ID_ARTOP_ATP860R: - case PCI_DEVICE_ID_ARTOP_ATP860: - map |= XFER_UDMA_66; + case PCI_DEVICE_ID_ARTOP_ATP865R: + case PCI_DEVICE_ID_ARTOP_ATP865: + /* Can't use these modes simultaneously, + based on which PLL clock was chosen. */ + map |= + inb(bmide + + AEC_BM_STAT_PCH) & AEC_PLLCLK_ATA133 ? + XFER_UDMA_133 : XFER_UDMA_100; + case PCI_DEVICE_ID_ARTOP_ATP860R: + case PCI_DEVICE_ID_ARTOP_ATP860: + map |= XFER_UDMA_66; } return map; @@ -200,27 +214,28 @@ static unsigned int __init aec62xx_init_chipset(struct pci_dev *dev) switch (dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP865R: - case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + case PCI_DEVICE_ID_ARTOP_ATP865: - /* Clear reset and test bits. */ - pci_read_config_byte(dev, AEC_MISC, &t); - pci_write_config_byte(dev, AEC_MISC, t & ~0x30); + /* Clear reset and test bits. */ + pci_read_config_byte(dev, AEC_MISC, &t); + pci_write_config_byte(dev, AEC_MISC, t & ~0x30); - /* Enable chip interrupt output. */ - pci_read_config_byte(dev, AEC_IDE_ENABLE, &t); - pci_write_config_byte(dev, AEC_IDE_ENABLE, t & ~0x01); + /* Enable chip interrupt output. */ + pci_read_config_byte(dev, AEC_IDE_ENABLE, &t); + pci_write_config_byte(dev, AEC_IDE_ENABLE, t & ~0x01); #ifdef CONFIG_AEC6280_BURST - /* Must be greater than 0x80 for burst mode. */ - pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x90); + /* Must be greater than 0x80 for burst mode. */ + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x90); - /* Enable burst mode. */ - pci_read_config_byte(dev, AEC_IDE_ENABLE, &t); - pci_write_config_byte(dev, AEC_IDE_ENABLE, t | 0x80); + /* Enable burst mode. */ + pci_read_config_byte(dev, AEC_IDE_ENABLE, &t); + pci_write_config_byte(dev, AEC_IDE_ENABLE, t | 0x80); #endif - /* switch cable detection pins to input-only. */ - outb (inb (bmide + AEC_BM_STAT_SCH) | AEC_CABLEPINS_INPUT, bmide + AEC_BM_STAT_SCH); + /* switch cable detection pins to input-only. */ + outb(inb(bmide + AEC_BM_STAT_SCH) | AEC_CABLEPINS_INPUT, + bmide + AEC_BM_STAT_SCH); } /* @@ -229,7 +244,7 @@ static unsigned int __init aec62xx_init_chipset(struct pci_dev *dev) pci_read_config_byte(dev, PCI_REVISION_ID, &t); printk(KERN_INFO "AEC_IDE: %s (rev %02x) controller on pci%s\n", - dev->name, t, dev->slot_name); + dev->name, t, dev->slot_name); return dev->irq; } @@ -274,7 +289,8 @@ static void __init aec62xx_init_channel(struct ata_channel *ch) /* * We allow the BM-DMA driver only work on enabled interfaces. */ -static void __init aec62xx_init_dma(struct ata_channel *ch, unsigned long dmabase) +static void __init aec62xx_init_dma(struct ata_channel *ch, + unsigned long dmabase) { unsigned char t; @@ -286,50 +302,49 @@ static void __init aec62xx_init_dma(struct ata_channel *ch, unsigned long dmabas /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_ARTOP, - device: PCI_DEVICE_ID_ARTOP_ATP850UF, - init_chipset: aec62xx_init_chipset, - init_channel: aec62xx_init_channel, - init_dma: aec62xx_init_dma, - enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, - bootable: OFF_BOARD, - flags: ATA_F_SER | ATA_F_IRQ | ATA_F_DMA + .vendor = PCI_VENDOR_ID_ARTOP, + .device = PCI_DEVICE_ID_ARTOP_ATP850UF, + .init_chipset = aec62xx_init_chipset, + .init_channel = aec62xx_init_channel, + .init_dma = aec62xx_init_dma, + .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}}, + .bootable = OFF_BOARD, + .flags = ATA_F_SER | ATA_F_IRQ | ATA_F_DMA }, { - vendor: PCI_VENDOR_ID_ARTOP, - device: PCI_DEVICE_ID_ARTOP_ATP860, - init_chipset: aec62xx_init_chipset, - init_channel: aec62xx_init_channel, - enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, - bootable: NEVER_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA + .vendor = PCI_VENDOR_ID_ARTOP, + .device = PCI_DEVICE_ID_ARTOP_ATP860, + .init_chipset = aec62xx_init_chipset, + .init_channel = aec62xx_init_channel, + .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}}, + .bootable = NEVER_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA }, { - vendor: PCI_VENDOR_ID_ARTOP, - device: PCI_DEVICE_ID_ARTOP_ATP860R, - init_chipset: aec62xx_init_chipset, - init_channel: aec62xx_init_channel, - enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_ARTOP, + .device = PCI_DEVICE_ID_ARTOP_ATP860R, + .init_chipset = aec62xx_init_chipset, + .init_channel = aec62xx_init_channel, + .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}}, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_ARTOP, - device: PCI_DEVICE_ID_ARTOP_ATP865, - init_chipset: aec62xx_init_chipset, - init_channel: aec62xx_init_channel, - enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, - bootable: NEVER_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA + .vendor = PCI_VENDOR_ID_ARTOP, + .device = PCI_DEVICE_ID_ARTOP_ATP865, + .init_chipset = aec62xx_init_chipset, + .init_channel = aec62xx_init_channel, + .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}}, + .bootable = NEVER_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA }, { - vendor: PCI_VENDOR_ID_ARTOP, - device: PCI_DEVICE_ID_ARTOP_ATP865R, - init_chipset: aec62xx_init_chipset, - init_channel: aec62xx_init_channel, - enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA + .vendor = PCI_VENDOR_ID_ARTOP, + .device = PCI_DEVICE_ID_ARTOP_ATP865R, + .init_chipset = aec62xx_init_chipset, + .init_channel = aec62xx_init_channel, + .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}}, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA } }; diff --git a/drivers/ide/ali14xx.c b/drivers/ide/ali14xx.c index a60910c79768..33f175c92e0b 100644 --- a/drivers/ide/ali14xx.c +++ b/drivers/ide/ali14xx.c @@ -46,11 +46,12 @@ /* port addresses for auto-detection */ #define ALI_NUM_PORTS 4 -static int ports[ALI_NUM_PORTS] __initdata = { 0x074, 0x0f4, 0x034, 0x0e4 }; +static int ports[ALI_NUM_PORTS] __initdata = + { 0x074, 0x0f4, 0x034, 0x0e4 }; /* register initialization data */ struct reg_initializer { - u8 reg, data; + u8 reg, data; }; static struct reg_initializer init_data[] __initdata = { @@ -67,17 +68,21 @@ static struct reg_initializer init_data[] __initdata = { static struct { u8 reg1, reg2, reg3, reg4; } reg_tab[4] = { - { 0x03, 0x26, 0x04, 0x27 }, /* drive 0 */ - { 0x05, 0x28, 0x06, 0x29 }, /* drive 1 */ - { 0x2b, 0x30, 0x2c, 0x31 }, /* drive 2 */ - { 0x2d, 0x32, 0x2e, 0x33 }, /* drive 3 */ + { + 0x03, 0x26, 0x04, 0x27}, /* drive 0 */ + { + 0x05, 0x28, 0x06, 0x29}, /* drive 1 */ + { + 0x2b, 0x30, 0x2c, 0x31}, /* drive 2 */ + { + 0x2d, 0x32, 0x2e, 0x33}, /* drive 3 */ }; -static int base_port; /* base port address */ -static int reg_port; /* port for register number */ -static int data_port; /* port for register data */ -static u8 reg_on; /* output to base port to access registers */ -static u8 reg_off; /* output to base port to close registers */ +static int base_port; /* base port address */ +static int reg_port; /* port for register number */ +static int data_port; /* port for register data */ +static u8 reg_on; /* output to base port to access registers */ +static u8 reg_off; /* output to base port to close registers */ /* * Read a controller register. @@ -121,13 +126,16 @@ static void ali14xx_tune_drive(struct ata_device *drive, u8 pio) time1 = t->cycle; time2 = t->active; param3 = param1 = (time2 * system_bus_speed + 999999) / 1000000; - param4 = param2 = (time1 * system_bus_speed + 999999) / 1000000 - param1; + param4 = param2 = + (time1 * system_bus_speed + 999999) / 1000000 - param1; if (pio < XFER_PIO_3) { param3 += 8; param4 += 8; } - printk(KERN_DEBUG "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n", - drive->name, pio - XFER_PIO_0, time1, time2, param1, param2, param3, param4); + printk(KERN_DEBUG + "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n", + drive->name, pio - XFER_PIO_0, time1, time2, param1, param2, + param3, param4); /* stuff timing parameters into controller registers */ drive_num = (drive->channel->index << 1) + drive->select.b.unit; @@ -150,8 +158,7 @@ static int __init find_port(void) int i; unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); for (i = 0; i < ALI_NUM_PORTS; i++) { base_port = ports[i]; reg_off = inb(base_port); @@ -163,7 +170,7 @@ static int __init find_port(void) data_port = base_port + 8; t = in_reg(0) & 0xf0; outb_p(reg_off, base_port); - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); if (t != 0x50) return 0; return 1; /* success */ @@ -171,7 +178,8 @@ static int __init find_port(void) } outb_p(reg_off, base_port); } - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); + return 0; } @@ -184,15 +192,15 @@ static int __init init_registers(void) unsigned long flags; u8 t; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); outb_p(reg_on, base_port); for (p = init_data; p->reg != 0; ++p) out_reg(p->data, p->reg); outb_p(0x01, reg_port); t = inb(reg_port) & 0x01; outb_p(reg_off, base_port); - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); + return t; } @@ -205,7 +213,7 @@ void __init init_ali14xx(void) } printk(KERN_DEBUG "ali14xx: base=%#03x, reg_on=%#02x\n", - base_port, reg_on); + base_port, reg_on); ide_hwifs[0].chipset = ide_ali14xx; ide_hwifs[1].chipset = ide_ali14xx; ide_hwifs[0].tuneproc = &ali14xx_tune_drive; diff --git a/drivers/ide/alim15x3.c b/drivers/ide/alim15x3.c index 63ccfd52a64d..f8422ad5e897 100644 --- a/drivers/ide/alim15x3.c +++ b/drivers/ide/alim15x3.c @@ -73,10 +73,10 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio) if (r_clc >= 16) r_clc = 0; } - __save_flags(flags); - __cli(); - - /* + + local_irq_save(flags); + + /* * PIO mode => ATA FIFO on, ATAPI FIFO off */ pci_read_config_byte(dev, portFIFO, &cd_dma_fifo); @@ -96,7 +96,8 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio) pci_write_config_byte(dev, port, s_clc); pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc); - __restore_flags(flags); + + local_irq_restore(flags); } static int ali15x3_tune_chipset(struct ata_device *drive, byte speed) @@ -216,8 +217,7 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif) unsigned long flags; byte tmpbyte; - __save_flags(flags); - __cli(); + local_irq_save(flags); if (m5229_revision >= 0xC2) { /* @@ -297,9 +297,9 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif) pci_write_config_byte(dev, 0x53, tmpbyte); - __restore_flags(flags); + local_irq_restore(flags); - return(ata66); + return (ata66); } static void __init ali15x3_init_channel(struct ata_channel *hwif) @@ -374,22 +374,22 @@ static void __init ali15x3_init_dma(struct ata_channel *ch, unsigned long dmabas /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_AL, - device: PCI_DEVICE_ID_AL_M5219, + .vendor = PCI_VENDOR_ID_AL, + .device = PCI_DEVICE_ID_AL_M5219, /* FIXME: Perhaps we should use the same init routines * as below here. */ - enablebits: { {0x00,0x00,0x00}, {0x00,0x00,0x00} }, - bootable: ON_BOARD, - flags: ATA_F_SIMPLEX + .enablebits = { {0x00,0x00,0x00}, {0x00,0x00,0x00} }, + .bootable = ON_BOARD, + .flags = ATA_F_SIMPLEX }, { - vendor: PCI_VENDOR_ID_AL, - device: PCI_DEVICE_ID_AL_M5229, - init_chipset: ali15x3_init_chipset, - init_channel: ali15x3_init_channel, - init_dma: ali15x3_init_dma, - enablebits: { {0x00,0x00,0x00}, {0x00,0x00,0x00} }, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_AL, + .device = PCI_DEVICE_ID_AL_M5229, + .init_chipset = ali15x3_init_chipset, + .init_channel = ali15x3_init_channel, + .init_dma = ali15x3_init_dma, + .enablebits = { {0x00,0x00,0x00}, {0x00,0x00,0x00} }, + .bootable = ON_BOARD } }; @@ -397,9 +397,8 @@ int __init init_ali15x3(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; } diff --git a/drivers/ide/amd74xx.c b/drivers/ide/amd74xx.c index 49a2bb3fb9dd..485f31e3f4cb 100644 --- a/drivers/ide/amd74xx.c +++ b/drivers/ide/amd74xx.c @@ -303,59 +303,59 @@ static void __init amd74xx_init_dma(struct ata_channel *ch, unsigned long dmabas /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_AMD, - device: PCI_DEVICE_ID_AMD_COBRA_7401, - init_chipset: amd74xx_init_chipset, - init_channel: amd74xx_init_channel, - init_dma: amd74xx_init_dma, - enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_AMD, + .device = PCI_DEVICE_ID_AMD_COBRA_7401, + .init_chipset = amd74xx_init_chipset, + .init_channel = amd74xx_init_channel, + .init_dma = amd74xx_init_dma, + .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_AMD, - device: PCI_DEVICE_ID_AMD_VIPER_7409, - init_chipset: amd74xx_init_chipset, - init_channel: amd74xx_init_channel, - init_dma: amd74xx_init_dma, - enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, - bootable: ON_BOARD, - flags: ATA_F_SIMPLEX + .vendor = PCI_VENDOR_ID_AMD, + .device = PCI_DEVICE_ID_AMD_VIPER_7409, + .init_chipset = amd74xx_init_chipset, + .init_channel = amd74xx_init_channel, + .init_dma = amd74xx_init_dma, + .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + .bootable = ON_BOARD, + .flags = ATA_F_SIMPLEX }, { - vendor: PCI_VENDOR_ID_AMD, - device: PCI_DEVICE_ID_AMD_VIPER_7411, - init_chipset: amd74xx_init_chipset, - init_channel: amd74xx_init_channel, - init_dma: amd74xx_init_dma, - enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_AMD, + .device = PCI_DEVICE_ID_AMD_VIPER_7411, + .init_chipset = amd74xx_init_chipset, + .init_channel = amd74xx_init_channel, + .init_dma = amd74xx_init_dma, + .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_AMD, - device: PCI_DEVICE_ID_AMD_OPUS_7441, - init_chipset: amd74xx_init_chipset, - init_channel: amd74xx_init_channel, - init_dma: amd74xx_init_dma, - enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_AMD, + .device = PCI_DEVICE_ID_AMD_OPUS_7441, + .init_chipset = amd74xx_init_chipset, + .init_channel = amd74xx_init_channel, + .init_dma = amd74xx_init_dma, + .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_AMD, - device: PCI_DEVICE_ID_AMD_8111_IDE, - init_chipset: amd74xx_init_chipset, - init_channel: amd74xx_init_channel, - init_dma: amd74xx_init_dma, - enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_AMD, + .device = PCI_DEVICE_ID_AMD_8111_IDE, + .init_chipset = amd74xx_init_chipset, + .init_channel = amd74xx_init_channel, + .init_dma = amd74xx_init_dma, + .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_NVIDIA, - device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, - init_chipset: amd74xx_init_chipset, - init_channel: amd74xx_init_channel, - init_dma: amd74xx_init_dma, - enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_NVIDIA, + .device = PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, + .init_chipset = amd74xx_init_chipset, + .init_channel = amd74xx_init_channel, + .init_dma = amd74xx_init_dma, + .enablebits = {{0x50,0x01,0x01}, {0x50,0x02,0x02}}, + .bootable = ON_BOARD }, }; @@ -363,9 +363,8 @@ int __init init_amd74xx(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; } diff --git a/drivers/ide/ataraid.c b/drivers/ide/ataraid.c index a4c5704ff27a..04520f4e3fbf 100644 --- a/drivers/ide/ataraid.c +++ b/drivers/ide/ataraid.c @@ -34,12 +34,14 @@ #include "ataraid.h" -static struct raid_device_operations* ataraid_ops[16]; +static struct raid_device_operations *ataraid_ops[16]; -static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static int ataraid_open(struct inode * inode, struct file * filp); -static int ataraid_release(struct inode * inode, struct file * filp); -static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh); +static int ataraid_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); +static int ataraid_open(struct inode *inode, struct file *filp); +static int ataraid_release(struct inode *inode, struct file *filp); +static void ataraid_split_request(request_queue_t * q, int rw, + struct buffer_head *bh); struct gendisk ataraid_gendisk; @@ -47,12 +49,12 @@ static int ataraid_gendisk_sizes[256]; static int ataraid_readahead[256]; static struct block_device_operations ataraid_fops = { - owner: THIS_MODULE, - open: ataraid_open, - release: ataraid_release, - ioctl: ataraid_ioctl, + .owner = THIS_MODULE, + .open = ataraid_open, + .release = ataraid_release, + .ioctl = ataraid_ioctl, }; - + static DECLARE_MUTEX(ataraid_sem); @@ -63,48 +65,50 @@ static unsigned int ataraiduse; /* stub fops functions */ -static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +static int ataraid_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { int minor; - minor = minor(inode->i_rdev)>>SHIFT; - - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl)) - return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg); + minor = minor(inode->i_rdev) >> SHIFT; + + if ((ataraid_ops[minor]) && (ataraid_ops[minor]->ioctl)) + return (ataraid_ops[minor]->ioctl) (inode, file, cmd, arg); return -EINVAL; } -static int ataraid_open(struct inode * inode, struct file * filp) +static int ataraid_open(struct inode *inode, struct file *filp) { int minor; - minor = minor(inode->i_rdev)>>SHIFT; + minor = minor(inode->i_rdev) >> SHIFT; - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open)) - return (ataraid_ops[minor]->open)(inode,filp); + if ((ataraid_ops[minor]) && (ataraid_ops[minor]->open)) + return (ataraid_ops[minor]->open) (inode, filp); return -EINVAL; } -static int ataraid_release(struct inode * inode, struct file * filp) +static int ataraid_release(struct inode *inode, struct file *filp) { int minor; - minor = minor(inode->i_rdev)>>SHIFT; + minor = minor(inode->i_rdev) >> SHIFT; - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release)) - return (ataraid_ops[minor]->release)(inode,filp); + if ((ataraid_ops[minor]) && (ataraid_ops[minor]->release)) + return (ataraid_ops[minor]->release) (inode, filp); return -EINVAL; } -static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +static int ataraid_make_request(request_queue_t * q, int rw, + struct buffer_head *bh) { int minor; int retval; - minor = minor(bh->b_rdev)>>SHIFT; + minor = minor(bh->b_rdev) >> SHIFT; + + if ((ataraid_ops[minor]) && (ataraid_ops[minor]->make_request)) { - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) { - - retval= (ataraid_ops[minor]->make_request)(q,rw,bh); + retval = (ataraid_ops[minor]->make_request) (q, rw, bh); if (retval == -1) { - ataraid_split_request(q,rw,bh); + ataraid_split_request(q, rw, bh); return 0; } else return retval; @@ -116,7 +120,7 @@ struct buffer_head *ataraid_get_bhead(void) { void *ptr = NULL; while (!ptr) { - ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO); + ptr = kmalloc(sizeof(struct buffer_head), GFP_NOIO); if (!ptr) yield(); } @@ -129,7 +133,7 @@ struct ataraid_bh_private *ataraid_get_private(void) { void *ptr = NULL; while (!ptr) { - ptr=kmalloc(sizeof(struct ataraid_bh_private),GFP_NOIO); + ptr = kmalloc(sizeof(struct ataraid_bh_private), GFP_NOIO); if (!ptr) yield(); } @@ -142,11 +146,11 @@ void ataraid_end_request(struct buffer_head *bh, int uptodate) { struct ataraid_bh_private *private = bh->b_private; - if (private==NULL) + if (private == NULL) BUG(); if (atomic_dec_and_test(&private->count)) { - private->parent->b_end_io(private->parent,uptodate); + private->parent->b_end_io(private->parent, uptodate); private->parent = NULL; kfree(private); } @@ -155,23 +159,24 @@ void ataraid_end_request(struct buffer_head *bh, int uptodate) EXPORT_SYMBOL(ataraid_end_request); -static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh) +static void ataraid_split_request(request_queue_t * q, int rw, + struct buffer_head *bh) { - struct buffer_head *bh1,*bh2; + struct buffer_head *bh1, *bh2; struct ataraid_bh_private *private; - bh1=ataraid_get_bhead(); - bh2=ataraid_get_bhead(); + bh1 = ataraid_get_bhead(); + bh2 = ataraid_get_bhead(); /* If either of those ever fails we're doomed */ - if ((!bh1)||(!bh2)) + if ((!bh1) || (!bh2)) BUG(); private = ataraid_get_private(); - if (private==NULL) + if (private == NULL) BUG(); - + memcpy(bh1, bh, sizeof(*bh)); memcpy(bh2, bh, sizeof(*bh)); - + bh1->b_end_io = ataraid_end_request; bh2->b_end_io = ataraid_end_request; @@ -182,12 +187,12 @@ static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head bh1->b_private = private; bh2->b_private = private; - atomic_set(&private->count,2); + atomic_set(&private->count, 2); - bh2->b_data += bh->b_size/2; + bh2->b_data += bh->b_size / 2; - generic_make_request(rw,bh1); - generic_make_request(rw,bh2); + generic_make_request(rw, bh1); + generic_make_request(rw, bh2); } @@ -200,12 +205,12 @@ int ataraid_get_device(struct raid_device_operations *fops) { int bit; down(&ataraid_sem); - if (ataraiduse==~0U) { + if (ataraiduse == ~0U) { up(&ataraid_sem); return -ENODEV; } - bit=ffz(ataraiduse); - ataraiduse |= 1<resource[3].start); pci_write_config_word(dev, PCI_COMMAND, cmd); - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); return dev->irq; } @@ -202,13 +201,13 @@ static void __init ide_init_hpt34x(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipset __initdata = { - vendor: PCI_VENDOR_ID_TTI, - device: PCI_DEVICE_ID_TTI_HPT343, - init_chipset: pci_init_hpt34x, - init_channel: ide_init_hpt34x, - bootable: NEVER_BOARD, - extra: 16, - flags: ATA_F_DMA + .vendor = PCI_VENDOR_ID_TTI, + .device = PCI_DEVICE_ID_TTI_HPT343, + .init_chipset = pci_init_hpt34x, + .init_channel = ide_init_hpt34x, + .bootable = NEVER_BOARD, + .extra = 16, + .flags = ATA_F_DMA }; int __init init_hpt34x(void) diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 0afee25c1289..a24e170bee2e 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c @@ -1222,34 +1222,34 @@ static void __init hpt366_init_dma(struct ata_channel *ch, unsigned long dmabase /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_TTI, - device: PCI_DEVICE_ID_TTI_HPT366, - init_chipset: hpt366_init_chipset, - init_channel: hpt366_init_channel, - init_dma: hpt366_init_dma, - bootable: OFF_BOARD, - extra: 240, - flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA + .vendor = PCI_VENDOR_ID_TTI, + .device = PCI_DEVICE_ID_TTI_HPT366, + .init_chipset = hpt366_init_chipset, + .init_channel = hpt366_init_channel, + .init_dma = hpt366_init_dma, + .bootable = OFF_BOARD, + .extra = 240, + .flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA }, { - vendor: PCI_VENDOR_ID_TTI, - device: PCI_DEVICE_ID_TTI_HPT372, - init_chipset: hpt366_init_chipset, - init_channel: hpt366_init_channel, - init_dma: hpt366_init_dma, - bootable: OFF_BOARD, - extra: 0, - flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA + .vendor = PCI_VENDOR_ID_TTI, + .device = PCI_DEVICE_ID_TTI_HPT372, + .init_chipset = hpt366_init_chipset, + .init_channel = hpt366_init_channel, + .init_dma = hpt366_init_dma, + .bootable = OFF_BOARD, + .extra = 0, + .flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA }, { - vendor: PCI_VENDOR_ID_TTI, - device: PCI_DEVICE_ID_TTI_HPT374, - init_chipset: hpt366_init_chipset, - init_channel: hpt366_init_channel, - init_dma: hpt366_init_dma, - bootable: OFF_BOARD, - extra: 0, - flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA + .vendor = PCI_VENDOR_ID_TTI, + .device = PCI_DEVICE_ID_TTI_HPT374, + .init_chipset = hpt366_init_chipset, + .init_channel = hpt366_init_channel, + .init_dma = hpt366_init_dma, + .bootable = OFF_BOARD, + .extra = 0, + .flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA }, }; diff --git a/drivers/ide/hptraid.c b/drivers/ide/hptraid.c index 9414f4821a6b..9e8e07b35a2f 100644 --- a/drivers/ide/hptraid.c +++ b/drivers/ide/hptraid.c @@ -35,15 +35,17 @@ #include "ataraid.h" -static int hptraid_open(struct inode * inode, struct file * filp); -static int hptraid_release(struct inode * inode, struct file * filp); -static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh); +static int hptraid_open(struct inode *inode, struct file *filp); +static int hptraid_release(struct inode *inode, struct file *filp); +static int hptraid_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); +static int hptraid_make_request(request_queue_t * q, int rw, + struct buffer_head *bh); struct hptdisk { - kdev_t device; + kdev_t device; unsigned long sectors; struct block_device *bdev; }; @@ -53,79 +55,93 @@ struct hptraid { unsigned int disks; unsigned long sectors; struct geom geom; - + struct hptdisk disk[8]; - + unsigned long cutoff[8]; - unsigned int cutoff_disks[8]; + unsigned int cutoff_disks[8]; }; static struct raid_device_operations hptraid_ops = { - open: hptraid_open, - release: hptraid_release, - ioctl: hptraid_ioctl, - make_request: hptraid_make_request + .open = hptraid_open, + .release = hptraid_release, + .ioctl = hptraid_ioctl, + .make_request = hptraid_make_request }; static struct hptraid raid[16]; -static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +static int hptraid_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { unsigned int minor; unsigned char val; unsigned long sectors; - + if (!inode || kdev_none(inode->i_rdev)) return -EINVAL; - minor = minor(inode->i_rdev)>>SHIFT; - + minor = minor(inode->i_rdev) >> SHIFT; + switch (cmd) { - case BLKGETSIZE: /* Return device size */ - if (!arg) return -EINVAL; - sectors = ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects; - if (minor(inode->i_rdev)&15) - return put_user(sectors, (unsigned long *) arg); - return put_user(raid[minor].sectors , (unsigned long *) arg); - break; - + case BLKGETSIZE: /* Return device size */ + if (!arg) + return -EINVAL; + sectors = + ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects; + if (minor(inode->i_rdev) & 15) + return put_user(sectors, (unsigned long *) arg); + return put_user(raid[minor].sectors, + (unsigned long *) arg); + break; + - case HDIO_GETGEO: + case HDIO_GETGEO: { - struct hd_geometry *loc = (struct hd_geometry *) arg; + struct hd_geometry *loc = + (struct hd_geometry *) arg; unsigned short bios_cyl; - - if (!loc) return -EINVAL; + + if (!loc) + return -EINVAL; val = 255; - if (put_user(val, (byte *) &loc->heads)) return -EFAULT; - val=63; - if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; - bios_cyl = raid[minor].sectors/63/255; - if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; - if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect, - (unsigned long *) &loc->start)) return -EFAULT; + if (put_user(val, (byte *) & loc->heads)) + return -EFAULT; + val = 63; + if (put_user(val, (byte *) & loc->sectors)) + return -EFAULT; + bios_cyl = raid[minor].sectors / 63 / 255; + if (put_user + (bios_cyl, (unsigned short *) &loc->cylinders)) + return -EFAULT; + if (put_user + ((unsigned) ataraid_gendisk. + part[minor(inode->i_rdev)].start_sect, + (unsigned long *) &loc->start)) + return -EFAULT; return 0; } - case BLKROSET: - case BLKROGET: - case BLKSSZGET: - return blk_ioctl(inode->i_bdev, cmd, arg); + case BLKROSET: + case BLKROGET: + case BLKSSZGET: + return blk_ioctl(inode->i_bdev, cmd, arg); - default: - return -EINVAL; + default: + return -EINVAL; }; return 0; } -static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +static int hptraid_make_request(request_queue_t * q, int rw, + struct buffer_head *bh) { unsigned long rsect; - unsigned long rsect_left,rsect_accum = 0; + unsigned long rsect_left, rsect_accum = 0; unsigned long block; - unsigned int disk=0,real_disk=0; + unsigned int disk = 0, real_disk = 0; int i; int device; struct hptraid *thisraid; @@ -143,61 +159,70 @@ static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff * point, we have to divide by one less. */ - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + + device = (bh->b_rdev >> SHIFT) & MAJOR_MASK; thisraid = &raid[device]; - if (thisraid->stride==0) - thisraid->stride=1; + if (thisraid->stride == 0) + thisraid->stride = 1; /* Partitions need adding of the start sector of the partition to the requested sector */ - + rsect += ataraid_gendisk.part[minor(bh->b_rdev)].start_sect; /* Woops we need to split the request to avoid crossing a stride barrier */ - if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { + if ((rsect / thisraid->stride) != + ((rsect + (bh->b_size / 512) - 1) / thisraid->stride)) { return -1; } - + rsect_left = rsect; - - for (i=0;i<8;i++) { - if (thisraid->cutoff_disks[i]==0) + + for (i = 0; i < 8; i++) { + if (thisraid->cutoff_disks[i] == 0) break; if (rsect > thisraid->cutoff[i]) { /* we're in the wrong area so far */ rsect_left -= thisraid->cutoff[i]; - rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i]; + rsect_accum += + thisraid->cutoff[i] / + thisraid->cutoff_disks[i]; } else { block = rsect_left / thisraid->stride; disk = block % thisraid->cutoff_disks[i]; - block = (block / thisraid->cutoff_disks[i]) * thisraid->stride; - rsect = rsect_accum + (rsect_left % thisraid->stride) + block; + block = + (block / thisraid->cutoff_disks[i]) * + thisraid->stride; + rsect = + rsect_accum + (rsect_left % thisraid->stride) + + block; break; } } - - for (i=0;i<8;i++) { - if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) { + + for (i = 0; i < 8; i++) { + if ((disk == 0) + && (thisraid->disk[i].sectors > rsect_accum)) { real_disk = i; break; } - if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) { + if ((disk > 0) + && (thisraid->disk[i].sectors >= rsect_accum)) { disk--; } - + } disk = real_disk; - + /* All but the first disk have a 10 sector offset */ - if (i>0) - rsect+=10; - - + if (i > 0) + rsect += 10; + + /* * The new BH_Lock semantics in ll_rw_blk.c guarantee that this * is the only IO operation happening on this bh. */ - + bh->b_rdev = thisraid->disk[disk].device; bh->b_rsector = rsect; @@ -211,7 +236,7 @@ static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head #include "hptraid.h" static int __init read_disk_sb(struct block_device *bdev, - struct highpoint_raid_conf *buf) + struct highpoint_raid_conf *buf) { /* Superblock is at 9*512 bytes */ Sector sect; @@ -226,22 +251,22 @@ static int __init read_disk_sb(struct block_device *bdev, return -1; } -static unsigned long maxsectors (int major,int minor) +static unsigned long maxsectors(int major, int minor) { unsigned long lba = 0; kdev_t dev; struct ata_device *ideinfo; - dev = mk_kdev(major,minor); - ideinfo = get_info_ptr (dev); - if (ideinfo==NULL) + dev = mk_kdev(major, minor); + ideinfo = get_info_ptr(dev); + if (ideinfo == NULL) return 0; /* first sector of the last cluster */ - if (ideinfo->head==0) + if (ideinfo->head == 0) return 0; - if (ideinfo->sect==0) + if (ideinfo->sect == 0) return 0; lba = (ideinfo->capacity); @@ -249,131 +274,136 @@ static unsigned long maxsectors (int major,int minor) } static struct highpoint_raid_conf __initdata prom; -static void __init probedisk(int major, int minor,int device) +static void __init probedisk(int major, int minor, int device) { int i; - struct block_device *bdev = bdget(mk_kdev(major,minor)); + struct block_device *bdev = bdget(mk_kdev(major, minor)); struct gendisk *gd; if (!bdev) return; - if (blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) < 0) + if (blkdev_get(bdev, FMODE_READ | FMODE_WRITE, 0, BDEV_RAW) < 0) return; - if (maxsectors(major,minor)==0) + if (maxsectors(major, minor) == 0) goto out; - if (read_disk_sb(bdev, &prom)) - goto out; + if (read_disk_sb(bdev, &prom)) + goto out; - if (prom.magic!= 0x5a7816f0) - goto out; - if (prom.type) { - printk(KERN_INFO "hptraid: only RAID0 is supported currently\n"); - goto out; - } + if (prom.magic != 0x5a7816f0) + goto out; + if (prom.type) { + printk(KERN_INFO + "hptraid: only RAID0 is supported currently\n"); + goto out; + } i = prom.disk_number; - if (i<0) + if (i < 0) goto out; - if (i>8) + if (i > 8) goto out; raid[device].disk[i].bdev = bdev; /* This is supposed to prevent others from stealing our underlying disks */ /* now blank the /proc/partitions table for the wrong partition table, so that scripts don't accidentally mount it and crash the kernel */ - /* XXX: the 0 is an utter hack --hch */ - gd=get_gendisk(mk_kdev(major, 0)); - if (gd!=NULL) { + /* XXX: the 0 is an utter hack --hch */ + gd = get_gendisk(mk_kdev(major, 0)); + if (gd != NULL) { int j; - for (j=1+(minor<minor_shift);j<((minor+1)<minor_shift);j++) - gd->part[j].nr_sects=0; + for (j = 1 + (minor << gd->minor_shift); + j < ((minor + 1) << gd->minor_shift); j++) + gd->part[j].nr_sects = 0; } - raid[device].disk[i].device = mk_kdev(major,minor); - raid[device].disk[i].sectors = maxsectors(major,minor); - raid[device].stride = (1<bar)) + for (j = 0; j < 8; j++) + if ((raid[device].disk[j].sectors < smallest) + && (raid[device].disk[j].sectors > bar)) smallest = raid[device].disk[j].sectors; count = 0; - for (j=0;j<8;j++) + for (j = 0; j < 8; j++) if (raid[device].disk[j].sectors >= smallest) count++; - - smallest = smallest * count; + + smallest = smallest * count; bar = smallest; raid[device].cutoff[i] = smallest; raid[device].cutoff_disks[i] = count; - + } } static __init int hptraid_init_one(int device) { - int i,count; + int i, count; - probedisk(IDE0_MAJOR, 0, device); + probedisk(IDE0_MAJOR, 0, device); probedisk(IDE0_MAJOR, 64, device); - probedisk(IDE1_MAJOR, 0, device); + probedisk(IDE1_MAJOR, 0, device); probedisk(IDE1_MAJOR, 64, device); - probedisk(IDE2_MAJOR, 0, device); + probedisk(IDE2_MAJOR, 0, device); probedisk(IDE2_MAJOR, 64, device); - probedisk(IDE3_MAJOR, 0, device); + probedisk(IDE3_MAJOR, 0, device); probedisk(IDE3_MAJOR, 64, device); - + fill_cutoff(device); - + /* Initialize the gendisk structure */ - - ataraid_register_disk(device,raid[device].sectors); - - count=0; - printk(KERN_INFO "Highpoint HPT370 Softwareraid driver for linux version 0.01\n"); - - for (i=0;i<8;i++) { - if (raid[device].disk[i].device!=0) { + + ataraid_register_disk(device, raid[device].sectors); + + count = 0; + printk(KERN_INFO + "Highpoint HPT370 Softwareraid driver for linux version 0.01\n"); + + for (i = 0; i < 8; i++) { + if (raid[device].disk[i].device != 0) { printk(KERN_INFO "Drive %i is %li Mb \n", - i,raid[device].disk[i].sectors/2048); + i, raid[device].disk[i].sectors / 2048); count++; } } if (count) { - printk(KERN_INFO "Raid array consists of %i drives. \n",count); + printk(KERN_INFO "Raid array consists of %i drives. \n", + count); return 0; } else { printk(KERN_INFO "No raid array found\n"); return -ENODEV; } - + } static __init int hptraid_init(void) { - int retval,device; - - device=ataraid_get_device(&hptraid_ops); - if (device<0) + int retval, device; + + device = ataraid_get_device(&hptraid_ops); + if (device < 0) return -ENODEV; retval = hptraid_init_one(device); if (retval) @@ -381,28 +411,29 @@ static __init int hptraid_init(void) return retval; } -static void __exit hptraid_exit (void) +static void __exit hptraid_exit(void) { - int i,device; - for (device = 0; device<16; device++) { - for (i=0;i<8;i++) { - struct block_device *bdev = raid[device].disk[i].bdev; + int i, device; + for (device = 0; device < 16; device++) { + for (i = 0; i < 8; i++) { + struct block_device *bdev = + raid[device].disk[i].bdev; raid[device].disk[i].bdev = NULL; if (bdev) blkdev_put(bdev, BDEV_RAW); - } + } if (raid[device].sectors) ataraid_release_device(device); } } -static int hptraid_open(struct inode * inode, struct file * filp) +static int hptraid_open(struct inode *inode, struct file *filp) { MOD_INC_USE_COUNT; return 0; } -static int hptraid_release(struct inode * inode, struct file * filp) -{ +static int hptraid_release(struct inode *inode, struct file *filp) +{ MOD_DEC_USE_COUNT; return 0; } diff --git a/drivers/ide/ht6560b.c b/drivers/ide/ht6560b.c index ff785d6514d8..55f39b8c506e 100644 --- a/drivers/ide/ht6560b.c +++ b/drivers/ide/ht6560b.c @@ -127,8 +127,7 @@ static void ht6560b_selectproc(struct ata_device *drive) static u8 current_timing = 0; u8 select, timing; - __save_flags (flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); select = HT_CONFIG(drive); timing = HT_TIMING(drive); @@ -152,7 +151,7 @@ static void ht6560b_selectproc(struct ata_device *drive) printk("ht6560b: %s: select=%#x timing=%#x\n", drive->name, select, timing); #endif } - __restore_flags (flags); /* local CPU only */ + local_irq_restore(flags); } /* diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 70917c42b27f..166971c7307d 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -2453,26 +2453,26 @@ void ide_cdrom_release_real (struct cdrom_device_info *cdi) * Device initialization. */ static struct cdrom_device_ops ide_cdrom_dops = { - open: ide_cdrom_open_real, - release: ide_cdrom_release_real, - drive_status: ide_cdrom_drive_status, - media_changed: ide_cdrom_check_media_change_real, - tray_move: ide_cdrom_tray_move, - lock_door: ide_cdrom_lock_door, - select_speed: ide_cdrom_select_speed, - get_last_session: ide_cdrom_get_last_session, - get_mcn: ide_cdrom_get_mcn, - reset: ide_cdrom_reset, - audio_ioctl: ide_cdrom_audio_ioctl, - dev_ioctl: ide_cdrom_dev_ioctl, - capability: CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK | + .open = ide_cdrom_open_real, + .release = ide_cdrom_release_real, + .drive_status = ide_cdrom_drive_status, + .media_changed = ide_cdrom_check_media_change_real, + .tray_move = ide_cdrom_tray_move, + .lock_door = ide_cdrom_lock_door, + .select_speed = ide_cdrom_select_speed, + .get_last_session = ide_cdrom_get_last_session, + .get_mcn = ide_cdrom_get_mcn, + .reset = ide_cdrom_reset, + .audio_ioctl = ide_cdrom_audio_ioctl, + .dev_ioctl = ide_cdrom_dev_ioctl, + .capability = CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK | CDC_SELECT_SPEED | CDC_SELECT_DISC | CDC_MULTI_SESSION | CDC_MCN | CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET | CDC_IOCTLS | CDC_DRIVE_STATUS | CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM | CDC_GENERIC_PACKET, - generic_packet: ide_cdrom_packet, + .generic_packet = ide_cdrom_packet, }; static int ide_cdrom_register(struct ata_device *drive, int nslots) @@ -2932,18 +2932,18 @@ int ide_cdrom_cleanup(struct ata_device *drive) static void ide_cdrom_attach(struct ata_device *drive); static struct ata_operations ide_cdrom_driver = { - owner: THIS_MODULE, - attach: ide_cdrom_attach, - cleanup: ide_cdrom_cleanup, - standby: NULL, - do_request: ide_cdrom_do_request, - end_request: NULL, - ioctl: ide_cdrom_ioctl, - open: ide_cdrom_open, - release: ide_cdrom_release, - check_media_change: ide_cdrom_check_media_change, - revalidate: ide_cdrom_revalidate, - capacity: ide_cdrom_capacity, + .owner = THIS_MODULE, + .attach = ide_cdrom_attach, + .cleanup = ide_cdrom_cleanup, + .standby = NULL, + .do_request = ide_cdrom_do_request, + .end_request = NULL, + .ioctl = ide_cdrom_ioctl, + .open = ide_cdrom_open, + .release = ide_cdrom_release, + .check_media_change = ide_cdrom_check_media_change, + .revalidate = ide_cdrom_revalidate, + .capacity = ide_cdrom_capacity, }; /* options */ diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 8ebd46f0e963..cd3fd43b4b23 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -1443,18 +1443,18 @@ static void idedisk_attach(struct ata_device *drive); * Subdriver functions. */ static struct ata_operations idedisk_driver = { - owner: THIS_MODULE, - attach: idedisk_attach, - cleanup: idedisk_cleanup, - standby: idedisk_standby, - do_request: idedisk_do_request, - end_request: NULL, - ioctl: idedisk_ioctl, - open: idedisk_open, - release: idedisk_release, - check_media_change: idedisk_check_media_change, - revalidate: NULL, /* use default method */ - capacity: idedisk_capacity, + .owner = THIS_MODULE, + .attach = idedisk_attach, + .cleanup = idedisk_cleanup, + .standby = idedisk_standby, + .do_request = idedisk_do_request, + .end_request = NULL, + .ioctl = idedisk_ioctl, + .open = idedisk_open, + .release = idedisk_release, + .check_media_change = idedisk_check_media_change, + .revalidate = NULL, /* use default method */ + .capacity = idedisk_capacity, }; static void idedisk_attach(struct ata_device *drive) diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 9dca9511a417..a05c8b00c9ce 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -593,9 +593,9 @@ static ide_startstop_t idefloppy_pc_intr(struct ata_device *drive, struct reques #if IDEFLOPPY_DEBUG_LOG printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred); #endif /* IDEFLOPPY_DEBUG_LOG */ - clear_bit (PC_DMA_IN_PROGRESS, &pc->flags); + clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); - ide__sti(); /* local CPU only */ + local_irq_enable(); if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) { /* Error detected */ #if IDEFLOPPY_DEBUG_LOG @@ -1345,18 +1345,18 @@ static int idefloppy_get_format_progress(struct ata_device *drive, progress_indication=floppy->progress_indication; } /* Else assume format_unit has finished, and we're - ** at 0x10000 */ + * at 0x10000 + */ } else { atapi_status_reg_t status; unsigned long flags; - __save_flags(flags); - __cli(); + local_irq_save(flags); ata_status(drive, 0, 0); status.all = drive->status; - __restore_flags(flags); + local_irq_restore(flags); progress_indication= !status.b.dsc ? 0:0x10000; } @@ -1735,18 +1735,18 @@ static void idefloppy_attach(struct ata_device *drive); * IDE subdriver functions, registered with ide.c */ static struct ata_operations idefloppy_driver = { - owner: THIS_MODULE, - attach: idefloppy_attach, - cleanup: idefloppy_cleanup, - standby: NULL, - do_request: idefloppy_do_request, - end_request: idefloppy_end_request, - ioctl: idefloppy_ioctl, - open: idefloppy_open, - release: idefloppy_release, - check_media_change: idefloppy_check_media_change, - revalidate: NULL, /* use default method */ - capacity: idefloppy_capacity, + .owner = THIS_MODULE, + .attach = idefloppy_attach, + .cleanup = idefloppy_cleanup, + .standby = NULL, + .do_request = idefloppy_do_request, + .end_request = idefloppy_end_request, + .ioctl = idefloppy_ioctl, + .open = idefloppy_open, + .release = idefloppy_release, + .check_media_change = idefloppy_check_media_change, + .revalidate = NULL, /* use default method */ + .capacity = idefloppy_capacity, }; static void idefloppy_attach(struct ata_device *drive) diff --git a/drivers/ide/ide-pci.c b/drivers/ide/ide-pci.c index fc6ccc4f6a8f..e9076cb4869c 100644 --- a/drivers/ide/ide-pci.c +++ b/drivers/ide/ide-pci.c @@ -697,75 +697,75 @@ void __init ide_scan_pcibus(int scan_direction) */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_PCTECH, - device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_PCTECH, + .device = PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_CMD, - device: PCI_DEVICE_ID_CMD_640, - init_channel: ATA_PCI_IGNORE, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_CMD, + .device = PCI_DEVICE_ID_CMD_640, + .init_channel = ATA_PCI_IGNORE, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_NS, - device: PCI_DEVICE_ID_NS_87410, - enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_NS, + .device = PCI_DEVICE_ID_NS_87410, + .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_HINT, - device: PCI_DEVICE_ID_HINT_VXPROII_IDE, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_HINT, + .device = PCI_DEVICE_ID_HINT_VXPROII_IDE, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_HOLTEK, - device: PCI_DEVICE_ID_HOLTEK_6565, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_HOLTEK, + .device = PCI_DEVICE_ID_HOLTEK_6565, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82371MX, - enablebits: {{0x6D,0x80,0x80}, {0x00,0x00,0x00}}, - bootable: ON_BOARD, - flags: ATA_F_NODMA + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82371MX, + .enablebits = {{0x6D,0x80,0x80}, {0x00,0x00,0x00}}, + .bootable = ON_BOARD, + .flags = ATA_F_NODMA }, { - vendor: PCI_VENDOR_ID_UMC, - device: PCI_DEVICE_ID_UMC_UM8673F, - bootable: ON_BOARD, - flags: ATA_F_FIXIRQ + .vendor = PCI_VENDOR_ID_UMC, + .device = PCI_DEVICE_ID_UMC_UM8673F, + .bootable = ON_BOARD, + .flags = ATA_F_FIXIRQ }, { - vendor: PCI_VENDOR_ID_UMC, - device: PCI_DEVICE_ID_UMC_UM8886A, - bootable: ON_BOARD, - flags: ATA_F_FIXIRQ + .vendor = PCI_VENDOR_ID_UMC, + .device = PCI_DEVICE_ID_UMC_UM8886A, + .bootable = ON_BOARD, + .flags = ATA_F_FIXIRQ }, { - vendor: PCI_VENDOR_ID_UMC, - device: PCI_DEVICE_ID_UMC_UM8886BF, - bootable: ON_BOARD, - flags: ATA_F_FIXIRQ + .vendor = PCI_VENDOR_ID_UMC, + .device = PCI_DEVICE_ID_UMC_UM8886BF, + .bootable = ON_BOARD, + .flags = ATA_F_FIXIRQ }, { - vendor: PCI_VENDOR_ID_VIA, - device: PCI_DEVICE_ID_VIA_82C561, - bootable: ON_BOARD, - flags: ATA_F_NOADMA + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_82C561, + .bootable = ON_BOARD, + .flags = ATA_F_NOADMA }, { - vendor: PCI_VENDOR_ID_VIA, - device: PCI_DEVICE_ID_VIA_82C586_1, - bootable: ON_BOARD, - flags: ATA_F_NOADMA + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_82C586_1, + .bootable = ON_BOARD, + .flags = ATA_F_NOADMA }, { - vendor: PCI_VENDOR_ID_TTI, - device: PCI_DEVICE_ID_TTI_HPT366, - bootable: OFF_BOARD, - extra: 240, - flags: ATA_F_IRQ | ATA_F_HPTHACK + .vendor = PCI_VENDOR_ID_TTI, + .device = PCI_DEVICE_ID_TTI_HPT366, + .bootable = OFF_BOARD, + .extra = 240, + .flags = ATA_F_IRQ | ATA_F_HPTHACK } }; diff --git a/drivers/ide/ide-pmac.c b/drivers/ide/ide-pmac.c index b66b002b7223..b3089a4bca47 100644 --- a/drivers/ide/ide-pmac.c +++ b/drivers/ide/ide-pmac.c @@ -419,10 +419,10 @@ pmac_ide_do_setfeature(struct ata_device *drive, u8 command) OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG); OUT_BYTE(WIN_SETFEATURES, IDE_COMMAND_REG); udelay(1); - __save_flags(flags); /* local CPU only */ - ide__sti(); /* local CPU only -- for jiffies */ + __save_flags(flags); + local_irq_enable(); result = wait_for_ready(drive); - __restore_flags(flags); /* local CPU only */ + __restore_flags(flags); ata_irq_enable(drive, 1); if (result) printk(KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n"); diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 70e052d6097d..2c1fe77c4cb2 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -1881,9 +1881,9 @@ static ide_startstop_t idetape_pc_intr(struct ata_device *drive, struct request if (tape->debug_level >= 2) printk (KERN_INFO "ide-tape: Packet command completed, %d bytes transferred\n", pc->actually_transferred); #endif - clear_bit (PC_DMA_IN_PROGRESS, &pc->flags); + clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); - ide__sti(); /* local CPU only */ + local_irq_enable(); #if SIMULATE_ERRORS if ((pc->c[0] == IDETAPE_WRITE_CMD || pc->c[0] == IDETAPE_READ_CMD) && (++error_sim_count % 100) == 0) { @@ -5926,17 +5926,17 @@ static void idetape_revalidate(struct ata_device *_dummy) static void idetape_attach(struct ata_device *); static struct ata_operations idetape_driver = { - owner: THIS_MODULE, - attach: idetape_attach, - cleanup: idetape_cleanup, - standby: NULL, - do_request: idetape_do_request, - end_request: idetape_end_request, - ioctl: idetape_blkdev_ioctl, - open: idetape_blkdev_open, - release: idetape_blkdev_release, - check_media_change: NULL, - revalidate: idetape_revalidate, + .owner = THIS_MODULE, + .attach = idetape_attach, + .cleanup = idetape_cleanup, + .standby = NULL, + .do_request = idetape_do_request, + .end_request = idetape_end_request, + .ioctl = idetape_blkdev_ioctl, + .open = idetape_blkdev_open, + .release = idetape_blkdev_release, + .check_media_change = NULL, + .revalidate = idetape_revalidate, }; @@ -5945,12 +5945,12 @@ static struct ata_operations idetape_driver = { * Our character device supporting functions, passed to register_chrdev. */ static struct file_operations idetape_fops = { - owner: THIS_MODULE, - read: idetape_chrdev_read, - write: idetape_chrdev_write, - ioctl: idetape_chrdev_ioctl, - open: idetape_chrdev_open, - release: idetape_chrdev_release, + .owner = THIS_MODULE, + .read = idetape_chrdev_read, + .write = idetape_chrdev_write, + .ioctl = idetape_chrdev_ioctl, + .open = idetape_chrdev_open, + .release = idetape_chrdev_release, }; static void idetape_attach(struct ata_device *drive) diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 2699a3f5de9a..f05ea73895b4 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -143,7 +143,7 @@ static ide_startstop_t special_intr(struct ata_device *drive, struct request *rq struct ata_taskfile *ar = rq->special; ide_startstop_t ret = ATA_OP_FINISHED; - ide__sti(); + local_irq_enable(); if (rq->buffer && ar->taskfile.sector_number) { if (!ata_status(drive, 0, DRQ_STAT) && ar->taskfile.sector_number) { diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 851ac69d6a8d..a83f8e7ee6d6 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -288,8 +288,8 @@ u8 ata_dump(struct ata_device *drive, struct request * rq, const char *msg) u8 err = 0; /* FIXME: --bzolnier */ - __save_flags (flags); /* local CPU only */ - ide__sti(); /* local CPU only */ + __save_flags(flags); + local_irq_enable(); printk("%s: %s: status=0x%02x", drive->name, msg, drive->status); dump_bits(ata_status_msgs, ARRAY_SIZE(ata_status_msgs), drive->status); @@ -337,7 +337,8 @@ u8 ata_dump(struct ata_device *drive, struct request * rq, const char *msg) #endif printk("\n"); } - __restore_flags (flags); /* local CPU only */ + __restore_flags (flags); + return err; } @@ -522,7 +523,7 @@ static void do_request(struct ata_channel *channel) unsigned int unit; ide_startstop_t ret; - __cli(); /* necessary paranoia: ensure IRQs are masked on local CPU */ + local_irq_disable(); /* necessary paranoia */ /* * Select the next device which will be serviced. This selects @@ -683,7 +684,8 @@ static void do_request(struct ata_channel *channel) drive->rq = rq; spin_unlock(ch->lock); - ide__sti(); /* allow other IRQs while we start this request */ + /* allow other IRQs while we start this request */ + local_irq_enable(); /* * This initiates handling of a new I/O request. @@ -837,8 +839,8 @@ void ide_timer_expiry(unsigned long data) #else disable_irq(ch->irq); /* disable_irq_nosync ?? */ #endif - /* FIXME: IRQs are already disabled by spin_lock_irqsave() --bzolnier */ - __cli(); /* local CPU only, as if we were handling an interrupt */ + + local_irq_disable(); if (ch->poll_timeout) { ret = handler(drive, drive->rq); } else if (ata_status_irq(drive)) { @@ -906,7 +908,7 @@ void ide_timer_expiry(unsigned long data) * drive enters "idle", "standby", or "sleep" mode, so if the status looks * "good", we just ignore the interrupt completely. * - * This routine assumes __cli() is in effect when called. + * This routine assumes IRQ are disabled on entry. * * If an unexpected interrupt happens on irq15 while we are handling irq14 * and if the two interfaces are "serialized" (CMD640), then it looks like @@ -955,7 +957,7 @@ static void unexpected_irq(int irq) } /* - * Entry point for all interrupts, caller does __cli() for us. + * Entry point for all interrupts. Aussumes disabled IRQs. */ void ata_irq_request(int irq, void *data, struct pt_regs *regs) { @@ -1024,7 +1026,7 @@ void ata_irq_request(int irq, void *data, struct pt_regs *regs) spin_unlock(ch->lock); if (ch->unmask) - ide__sti(); + local_irq_enable(); /* * Service this interrupt, this may setup handler for next interrupt. @@ -1185,12 +1187,12 @@ static int ide_check_media_change(kdev_t i_rdev) } struct block_device_operations ide_fops[] = {{ - owner: THIS_MODULE, - open: ide_open, - release: ide_release, - ioctl: ata_ioctl, - check_media_change: ide_check_media_change, - revalidate: ata_revalidate + .owner = THIS_MODULE, + .open = ide_open, + .release = ide_release, + .ioctl = ata_ioctl, + .check_media_change = ide_check_media_change, + .revalidate = ata_revalidate }}; EXPORT_SYMBOL(ide_fops); diff --git a/drivers/ide/it8172.c b/drivers/ide/it8172.c index 1c18bae107ef..002dc1766fd0 100644 --- a/drivers/ide/it8172.c +++ b/drivers/ide/it8172.c @@ -225,12 +225,12 @@ static void __init ide_init_it8172(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipset __initdata = { - vendor: PCI_VENDOR_ID_ITE, - device: PCI_DEVICE_ID_ITE_IT8172G, - init_chipset: pci_init_it8172, - init_channel: ide_init_it8172, - exnablebits: {{0x00,0x00,0x00}, {0x40,0x00,0x01} }, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_ITE, + .device = PCI_DEVICE_ID_ITE_IT8172G, + .init_chipset = pci_init_it8172, + .init_channel = ide_init_it8172, + .exnablebits = {{0x00,0x00,0x00}, {0x40,0x00,0x01} }, + .bootable = ON_BOARD }; int __init init_it8172(void) diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c index 0431c648b720..379bde73032d 100644 --- a/drivers/ide/ns87415.c +++ b/drivers/ide/ns87415.c @@ -40,8 +40,7 @@ static void ns87415_prepare_drive(struct ata_device *drive, unsigned int use_dma struct pci_dev *dev = hwif->pci_dev; unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); new = *old; /* Adjust IRQ enable bit */ @@ -75,7 +74,7 @@ static void ns87415_prepare_drive(struct ata_device *drive, unsigned int use_dma udelay(10); } - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); } static void ns87415_selectproc(struct ata_device *drive) @@ -215,10 +214,10 @@ static void __init ide_init_ns87415(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipset __initdata = { - vendor: PCI_VENDOR_ID_NS, - device: PCI_DEVICE_ID_NS_87415, - init_channel: ide_init_ns87415, - bootable: ON_BOARD, + .vendor = PCI_VENDOR_ID_NS, + .device = PCI_DEVICE_ID_NS_87415, + .init_channel = ide_init_ns87415, + .bootable = ON_BOARD, }; int __init init_ns87415(void) diff --git a/drivers/ide/opti621.c b/drivers/ide/opti621.c index b77ba88ff4c8..6b025f3e93ce 100644 --- a/drivers/ide/opti621.c +++ b/drivers/ide/opti621.c @@ -323,18 +323,18 @@ static void __init ide_init_opti621(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_OPTI, - device: PCI_DEVICE_ID_OPTI_82C621, - init_channel: ide_init_opti621, - enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_OPTI, + .device = PCI_DEVICE_ID_OPTI_82C621, + .init_channel = ide_init_opti621, + .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_OPTI, - device: PCI_DEVICE_ID_OPTI_82C825, - init_channel: ide_init_opti621, - enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_OPTI, + .device = PCI_DEVICE_ID_OPTI_82C825, + .init_channel = ide_init_opti621, + .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, + .bootable = ON_BOARD }, }; diff --git a/drivers/ide/pdc202xx.c b/drivers/ide/pdc202xx.c index 940ce70f6e30..28f888d4a9c4 100644 --- a/drivers/ide/pdc202xx.c +++ b/drivers/ide/pdc202xx.c @@ -84,24 +84,24 @@ struct pdc_bit_messages { }; static struct pdc_bit_messages pdc_reg_A[] = { - { 0x80, "SYNC_IN" }, - { 0x40, "ERRDY_EN" }, - { 0x20, "IORDY_EN" }, - { 0x10, "PREFETCH_EN" }, + {0x80, "SYNC_IN"}, + {0x40, "ERRDY_EN"}, + {0x20, "IORDY_EN"}, + {0x10, "PREFETCH_EN"}, /* PA3-PA0 - PIO "A" timing */ }; static struct pdc_bit_messages pdc_reg_B[] = { /* MB2-MB0 - DMA "B" timing */ - { 0x10, "PIO_FORCED/PB4" }, /* PIO_FORCE 1:0 */ + {0x10, "PIO_FORCED/PB4"}, /* PIO_FORCE 1:0 */ /* PB3-PB0 - PIO "B" timing */ }; static struct pdc_bit_messages pdc_reg_C[] = { - { 0x80, "DMARQp" }, - { 0x40, "IORDYp" }, - { 0x20, "DMAR_EN" }, - { 0x10, "DMAW_EN" }, + {0x80, "DMARQp"}, + {0x40, "IORDYp"}, + {0x20, "DMAR_EN"}, + {0x10, "DMAW_EN"}, /* MC3-MC0 - DMA "C" timing */ }; @@ -117,9 +117,9 @@ static void pdc_dump_bits(struct pdc_bit_messages *msgs, byte bits) printk(KERN_DEBUG " }\n"); } -#endif /* PDC202XX_DECODE_REGISTER_INFO */ +#endif /* PDC202XX_DECODE_REGISTER_INFO */ -static struct ata_device* drives[4]; +static struct ata_device *drives[4]; int check_in_drive_lists(struct ata_device *drive) { @@ -135,7 +135,7 @@ int check_in_drive_lists(struct ata_device *drive) NULL }; - const char**list = pdc_quirk_drives; + const char **list = pdc_quirk_drives; struct hd_driveid *id = drive->id; while (*list) @@ -148,25 +148,27 @@ static int __init pdc202xx_modes_map(struct ata_channel *ch) { int map = XFER_EPIO | XFER_SWDMA | XFER_MWDMA | XFER_UDMA; - switch(ch->pci_dev->device) { - case PCI_DEVICE_ID_PROMISE_20276: - case PCI_DEVICE_ID_PROMISE_20275: - case PCI_DEVICE_ID_PROMISE_20271: - case PCI_DEVICE_ID_PROMISE_20269: - map |= XFER_UDMA_133; - case PCI_DEVICE_ID_PROMISE_20268R: - case PCI_DEVICE_ID_PROMISE_20268: - map &= ~XFER_SWDMA; - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: - map |= XFER_UDMA_100; - case PCI_DEVICE_ID_PROMISE_20262: - map |= XFER_UDMA_66; - - if (!ch->udma_four) { - printk(KERN_WARNING "%s: 40-pin cable, speed reduced to UDMA(33) mode.\n", ch->name); - map &= ~XFER_UDMA_80W; - } + switch (ch->pci_dev->device) { + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + map |= XFER_UDMA_133; + case PCI_DEVICE_ID_PROMISE_20268R: + case PCI_DEVICE_ID_PROMISE_20268: + map &= ~XFER_SWDMA; + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: + map |= XFER_UDMA_100; + case PCI_DEVICE_ID_PROMISE_20262: + map |= XFER_UDMA_66; + + if (!ch->udma_four) { + printk(KERN_WARNING + "%s: 40-pin cable, speed reduced to UDMA(33) mode.\n", + ch->name); + map &= ~XFER_UDMA_80W; + } } return map; @@ -191,38 +193,89 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed) pci_read_config_byte(dev, drive_pci + 1, &BP); pci_read_config_byte(dev, drive_pci + 2, &CP); - switch(speed) { + switch (speed) { #ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_UDMA_5: - case XFER_UDMA_4: TB = 0x20; TC = 0x01; break; - case XFER_UDMA_3: TB = 0x40; TC = 0x02; break; - case XFER_UDMA_2: TB = 0x20; TC = 0x01; break; - case XFER_UDMA_1: TB = 0x40; TC = 0x02; break; - case XFER_UDMA_0: TB = 0x60; TC = 0x03; break; - 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: TB = 0x60; TC = 0x05; break; - 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; + case XFER_UDMA_5: + case XFER_UDMA_4: + TB = 0x20; + TC = 0x01; + break; + case XFER_UDMA_3: + TB = 0x40; + TC = 0x02; + break; + case XFER_UDMA_2: + TB = 0x20; + TC = 0x01; + break; + case XFER_UDMA_1: + TB = 0x40; + TC = 0x02; + break; + case XFER_UDMA_0: + TB = 0x60; + TC = 0x03; + break; + 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: + TB = 0x60; + TC = 0x05; + break; + 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 - 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; + 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; } #ifdef CONFIG_BLK_DEV_IDEDMA - if (speed >= XFER_SW_DMA_0) { - pci_write_config_byte(dev, drive_pci + 1, (BP & ~0xf0) | TB); - pci_write_config_byte(dev, drive_pci + 2, (CP & ~0x0f) | TC); + if (speed >= XFER_SW_DMA_0) { + pci_write_config_byte(dev, drive_pci + 1, + (BP & ~0xf0) | TB); + pci_write_config_byte(dev, drive_pci + 2, + (CP & ~0x0f) | TC); } else #endif { pci_write_config_byte(dev, drive_pci, (AP & ~0x0f) | TA); - pci_write_config_byte(dev, drive_pci + 1, (BP & ~0x07) | TB); + pci_write_config_byte(dev, drive_pci + 1, + (BP & ~0x07) | TB); } #if PDC202XX_DECODE_REGISTER_INFO @@ -235,7 +288,7 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed) pdc_dump_bits(pdc_reg_A, AP); printk(KERN_DEBUG "BP(%x): DMA(B) = %d PIO(B) = %d\n", - BP, (BP & 0xe0) >> 5, BP & 0x0f); + BP, (BP & 0xe0) >> 5, BP & 0x0f); pdc_dump_bits(pdc_reg_B, BP); printk(KERN_DEBUG "CP(%x): DMA(C) = %d\n", CP, CP & 0x0f); @@ -246,9 +299,8 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed) #if PDC202XX_DEBUG_DRIVE_INFO printk("%s: %02x drive%d 0x%08x ", - drive->name, speed, - drive->dn, drive_conf); - pci_read_config_dword(dev, drive_pci, &drive_conf); + drive->name, speed, drive->dn, drive_conf); + pci_read_config_dword(dev, drive_pci, &drive_conf); printk("0x%08x\n", drive_conf); #endif @@ -282,9 +334,9 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed) } #endif - for (i = 0 ; i < 2 ; i++) + for (i = 0; i < 2; i++) if (hwif->drives[i].present) - drives[i+j] = &hwif->drives[i]; + drives[i + j] = &hwif->drives[i]; err = ide_config_drive_speed(drive, speed); @@ -293,7 +345,7 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed) return err; /* We need to adjust timings to ATA133 clock if ATA133 drives exist */ - for (i = 0 ; i < 4 ; i++) { + for (i = 0; i < 4; i++) { if (!drives[i]) continue; @@ -306,81 +358,81 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed) switch (drives[i]->current_speed) { #ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_UDMA_6: - set_2regs(0x10, 0x1a); - set_2regs(0x11, 0x01); - set_2regs(0x12, 0xcb); - break; - case XFER_UDMA_5: - set_2regs(0x10, 0x1a); - set_2regs(0x11, 0x02); - set_2regs(0x12, 0xcb); - break; - case XFER_UDMA_4: - set_2regs(0x10, 0x1a); - set_2regs(0x11, 0x03); - set_2regs(0x12, 0xcd); - break; - case XFER_UDMA_3: - set_2regs(0x10, 0x1a); - set_2regs(0x11, 0x05); - set_2regs(0x12, 0xcd); - break; - case XFER_UDMA_2: - set_2regs(0x10, 0x2a); - set_2regs(0x11, 0x07); - set_2regs(0x12, 0xcd); - break; - case XFER_UDMA_1: - set_2regs(0x10, 0x3a); - set_2regs(0x11, 0x0a); - set_2regs(0x12, 0xd0); - break; - case XFER_UDMA_0: - set_2regs(0x10, 0x4a); - set_2regs(0x11, 0x0f); - set_2regs(0x12, 0xd5); - break; - case XFER_MW_DMA_2: - set_2regs(0x0e, 0x69); - set_2regs(0x0f, 0x25); - break; - case XFER_MW_DMA_1: - set_2regs(0x0e, 0x6b); - set_2regs(0x0f, 0x27); - break; - case XFER_MW_DMA_0: - set_2regs(0x0e, 0xdf); - set_2regs(0x0f, 0x5f); - break; + case XFER_UDMA_6: + set_2regs(0x10, 0x1a); + set_2regs(0x11, 0x01); + set_2regs(0x12, 0xcb); + break; + case XFER_UDMA_5: + set_2regs(0x10, 0x1a); + set_2regs(0x11, 0x02); + set_2regs(0x12, 0xcb); + break; + case XFER_UDMA_4: + set_2regs(0x10, 0x1a); + set_2regs(0x11, 0x03); + set_2regs(0x12, 0xcd); + break; + case XFER_UDMA_3: + set_2regs(0x10, 0x1a); + set_2regs(0x11, 0x05); + set_2regs(0x12, 0xcd); + break; + case XFER_UDMA_2: + set_2regs(0x10, 0x2a); + set_2regs(0x11, 0x07); + set_2regs(0x12, 0xcd); + break; + case XFER_UDMA_1: + set_2regs(0x10, 0x3a); + set_2regs(0x11, 0x0a); + set_2regs(0x12, 0xd0); + break; + case XFER_UDMA_0: + set_2regs(0x10, 0x4a); + set_2regs(0x11, 0x0f); + set_2regs(0x12, 0xd5); + break; + case XFER_MW_DMA_2: + set_2regs(0x0e, 0x69); + set_2regs(0x0f, 0x25); + break; + case XFER_MW_DMA_1: + set_2regs(0x0e, 0x6b); + set_2regs(0x0f, 0x27); + break; + case XFER_MW_DMA_0: + set_2regs(0x0e, 0xdf); + set_2regs(0x0f, 0x5f); + break; #endif - case XFER_PIO_4: - set_2regs(0x0c, 0x23); - set_2regs(0x0d, 0x09); - set_2regs(0x13, 0x25); - break; - case XFER_PIO_3: - set_2regs(0x0c, 0x27); - set_2regs(0x0d, 0x0d); - set_2regs(0x13, 0x35); - break; - case XFER_PIO_2: - set_2regs(0x0c, 0x23); - set_2regs(0x0d, 0x26); - set_2regs(0x13, 0x64); - break; - case XFER_PIO_1: - set_2regs(0x0c, 0x46); - set_2regs(0x0d, 0x29); - set_2regs(0x13, 0xa4); - break; - case XFER_PIO_0: - set_2regs(0x0c, 0xfb); - set_2regs(0x0d, 0x2b); - set_2regs(0x13, 0xac); - break; - default: - ; + case XFER_PIO_4: + set_2regs(0x0c, 0x23); + set_2regs(0x0d, 0x09); + set_2regs(0x13, 0x25); + break; + case XFER_PIO_3: + set_2regs(0x0c, 0x27); + set_2regs(0x0d, 0x0d); + set_2regs(0x13, 0x35); + break; + case XFER_PIO_2: + set_2regs(0x0c, 0x23); + set_2regs(0x0d, 0x26); + set_2regs(0x13, 0x64); + break; + case XFER_PIO_1: + set_2regs(0x0c, 0x46); + set_2regs(0x0d, 0x29); + set_2regs(0x13, 0xa4); + break; + case XFER_PIO_0: + set_2regs(0x0c, 0xfb); + set_2regs(0x0d, 0x2b); + set_2regs(0x13, 0xac); + break; + default: + ; } } @@ -400,7 +452,8 @@ static void pdc202xx_tune_drive(struct ata_device *drive, u8 pio) if (pio == 255) speed = ata_best_pio_mode(drive); - else speed = XFER_PIO_0 + min_t(byte, pio, 4); + else + speed = XFER_PIO_0 + min_t(byte, pio, 4); pdc202xx_tune_chipset(drive, speed); } @@ -419,7 +472,7 @@ static int pdc202xx_tx_udma_setup(struct ata_device *drive, int map) /* IORDY_EN & PREFETCH_EN */ if (id->capability & 4) - set_2regs(0x13, (IN_BYTE(datareg)|0x03)); + set_2regs(0x13, (IN_BYTE(datareg) | 0x03)); return udma_generic_setup(drive, map); } @@ -428,7 +481,7 @@ static int pdc202xx_udma_setup(struct ata_device *drive, int map) { struct hd_driveid *id = drive->id; struct ata_channel *hwif = drive->channel; - struct hd_driveid *mate_id = hwif->drives[!(drive->dn%2)].id; + struct hd_driveid *mate_id = hwif->drives[!(drive->dn % 2)].id; struct pci_dev *dev = hwif->pci_dev; u32 high_16 = pci_resource_start(dev, 4); u32 drive_conf; @@ -467,30 +520,32 @@ static int pdc202xx_udma_setup(struct ata_device *drive, int map) goto chipset_is_set; /* FIXME: what if SYNC_ERRDY is enabled for slave - and disabled for master? --bkz */ + and disabled for master? --bkz */ pci_read_config_byte(dev, drive_pci, &AP); /* enable SYNC_ERRDY for master and slave (if enabled for master) */ if (!(AP & SYNC_ERRDY_EN)) { if (!(drive->dn % 2)) { - pci_write_config_byte(dev, drive_pci, AP|SYNC_ERRDY_EN); + pci_write_config_byte(dev, drive_pci, + AP | SYNC_ERRDY_EN); } else { pci_read_config_byte(dev, drive_pci - 4, &tmp); if (tmp & SYNC_ERRDY_EN) - pci_write_config_byte(dev, drive_pci, AP|SYNC_ERRDY_EN); + pci_write_config_byte(dev, drive_pci, + AP | SYNC_ERRDY_EN); } } -chipset_is_set: + chipset_is_set: if (drive->type != ATA_DISK) return 0; pci_read_config_byte(dev, drive_pci, &AP); - if (id->capability & 4) /* IORDY_EN */ - pci_write_config_byte(dev, drive_pci, AP|IORDY_EN); + 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->type == ATA_DISK) /* PREFETCH_EN */ - pci_write_config_byte(dev, drive_pci, AP|PREFETCH_EN); + pci_write_config_byte(dev, drive_pci, AP | PREFETCH_EN); map = hwif->modes_map; @@ -507,7 +562,8 @@ chipset_is_set: return udma_generic_setup(drive, map); } -static void 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); @@ -521,7 +577,8 @@ static void pdc202xx_udma_start(struct ata_device *drive, struct request *rq) OUT_BYTE(clock | (ch->unit ? 0x08 : 0x02), clockreg); word_count = (rq->nr_sectors << 8); - hankval = (rq_data_dir(rq) == READ) ? 0x05 << 24 : 0x06 << 24; + hankval = + (rq_data_dir(rq) == READ) ? 0x05 << 24 : 0x06 << 24; hankval |= word_count; outl(hankval, atapi_port); } @@ -531,7 +588,7 @@ static void pdc202xx_udma_start(struct ata_device *drive, struct request *rq) * when we do this part before issuing the drive cmd. */ - outb(inb(ch->dma_base) | 1, ch->dma_base); /* start DMA */ + outb(inb(ch->dma_base) | 1, ch->dma_base); /* start DMA */ } static int pdc202xx_udma_stop(struct ata_device *drive) @@ -547,15 +604,15 @@ static int pdc202xx_udma_stop(struct ata_device *drive) u32 clockreg = high_16 + PDC_CLK; u8 clock; - outl(0, atapi_port); /* zero out extra */ + outl(0, atapi_port); /* zero out extra */ clock = IN_BYTE(clockreg); OUT_BYTE(clock & ~(ch->unit ? 0x08 : 0x02), clockreg); } - outb(inb(dma_base)&~1, dma_base); /* stop DMA */ - dma_stat = inb(dma_base+2); /* get DMA status */ - outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - udma_destroy_table(ch); /* purge DMA mappings */ + outb(inb(dma_base) & ~1, dma_base); /* stop DMA */ + dma_stat = inb(dma_base + 2); /* get DMA status */ + outb(dma_stat | 6, dma_base + 2); /* clear the INTR & ERROR bits */ + udma_destroy_table(ch); /* purge DMA mappings */ return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; /* verify good DMA status */ } @@ -577,7 +634,7 @@ static void pdc202xx_reset(struct ata_device *drive) udelay(10); outb(0x00, drive->channel->io_ports[IDE_CONTROL_OFFSET]); printk(KERN_INFO "PDC202XX: %s channel reset.\n", - drive->channel->unit ? "Secondary" : "Primary"); + drive->channel->unit ? "Secondary" : "Primary"); } /* @@ -623,28 +680,33 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev) set_reg_and_wait(burst & ~0x10, burstreg, 2000); 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(KERN_INFO "%s: ROM enabled at 0x%08lx\n", dev->name, 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(KERN_INFO "%s: ROM enabled at 0x%08lx\n", dev->name, + dev->resource[PCI_ROM_RESOURCE].start); } - #if 0 switch (dev->device) { - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: - case PCI_DEVICE_ID_PROMISE_20262: - pdc202xx_reset_host(dev); - break; - default: - if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { - byte irq = 0, irq2 = 0; - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); - pci_read_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, &irq2); /* 0xbc */ - if (irq != irq2) { - pci_write_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */ - printk("%s: pci-config space interrupt mirror fixed.\n", dev->name); - } + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: + case PCI_DEVICE_ID_PROMISE_20262: + pdc202xx_reset_host(dev); + break; + default: + if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { + byte irq = 0, irq2 = 0; + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, + &irq); + pci_read_config_byte(dev, (PCI_INTERRUPT_LINE) | 0x80, &irq2); /* 0xbc */ + if (irq != irq2) { + pci_write_config_byte(dev, (PCI_INTERRUPT_LINE) | 0x80, irq); /* 0xbc */ + printk + ("%s: pci-config space interrupt mirror fixed.\n", + dev->name); } - break; + } + break; } #endif @@ -656,10 +718,10 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev) } #endif printk(KERN_INFO "%s: (U)DMA BURST %sabled, " - "primary %s mode, secondary %s mode.\n", + "primary %s mode, secondary %s mode.\n", dev->name, (burst & 1) ? "en" : "dis", (IN_BYTE(high_16 + PDC_PRIMARY) & 1) ? "MASTER" : "PCI", - (IN_BYTE(high_16 + PDC_SECONDARY) & 1) ? "MASTER" : "PCI" ); + (IN_BYTE(high_16 + PDC_SECONDARY) & 1) ? "MASTER" : "PCI"); return dev->irq; } @@ -669,8 +731,11 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev) static unsigned int __init pdc202xx_tx_init_chipset(struct pci_dev *dev) { 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(KERN_INFO "%s: ROM enabled at 0x%08lx.\n", dev->name, 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(KERN_INFO "%s: ROM enabled at 0x%08lx.\n", + dev->name, dev->resource[PCI_ROM_RESOURCE].start); } return dev->irq; } @@ -693,46 +758,46 @@ static unsigned int __init pdc202xx_tx_ata66_check(struct ata_channel *ch) static void __init ide_init_pdc202xx(struct ata_channel *hwif) { - hwif->tuneproc = &pdc202xx_tune_drive; + hwif->tuneproc = &pdc202xx_tune_drive; hwif->quirkproc = &check_in_drive_lists; hwif->resetproc = &pdc202xx_reset; - switch(hwif->pci_dev->device) { - 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_20268R: - hwif->udma_four = pdc202xx_tx_ata66_check(hwif); + switch (hwif->pci_dev->device) { + 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_20268R: + hwif->udma_four = pdc202xx_tx_ata66_check(hwif); - hwif->speedproc = &pdc202xx_new_tune_chipset; + hwif->speedproc = &pdc202xx_new_tune_chipset; #ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) - hwif->udma_setup = pdc202xx_tx_udma_setup; + if (hwif->dma_base) + hwif->udma_setup = pdc202xx_tx_udma_setup; #endif - break; - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: + break; + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: #ifdef CONFIG_BLK_DEV_IDEDMA - /* we need special functions for lba48 */ - if (hwif->dma_base) { - hwif->udma_start = pdc202xx_udma_start; - hwif->udma_stop = pdc202xx_udma_stop; - } + /* we need special functions for lba48 */ + if (hwif->dma_base) { + hwif->udma_start = pdc202xx_udma_start; + hwif->udma_stop = pdc202xx_udma_stop; + } #endif /* PDC20262 doesn't support LBA48 */ - case PCI_DEVICE_ID_PROMISE_20262: - hwif->udma_four = pdc202xx_ata66_check(hwif); + case PCI_DEVICE_ID_PROMISE_20262: + hwif->udma_four = pdc202xx_ata66_check(hwif); - case PCI_DEVICE_ID_PROMISE_20246: + case PCI_DEVICE_ID_PROMISE_20246: #ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) - hwif->udma_setup = pdc202xx_udma_setup; + if (hwif->dma_base) + hwif->udma_setup = pdc202xx_udma_setup; #endif - hwif->speedproc = &pdc202xx_tune_chipset; - default: - break; + hwif->speedproc = &pdc202xx_tune_chipset; + default: + break; } #ifdef CONFIG_BLK_DEV_IDEDMA @@ -753,107 +818,97 @@ static void __init ide_init_pdc202xx(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20246, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20246, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, #ifndef CONFIG_PDC202XX_FORCE - enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, + .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}}, #endif - bootable: OFF_BOARD, - extra: 16, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .bootable = OFF_BOARD, + .extra = 16, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20262, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20262, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, #ifndef CONFIG_PDC202XX_FORCE - enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, + .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}}, #endif - bootable: OFF_BOARD, - extra: 48, - flags: ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA - }, + .bootable = OFF_BOARD, + .extra = 48, + .flags = ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20265, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20265, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, #ifndef CONFIG_PDC202XX_FORCE - enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, - bootable: OFF_BOARD, + .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}}, + .bootable = OFF_BOARD, #else - bootable: ON_BOARD, + .bootable = ON_BOARD, #endif - extra: 48, - flags: ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA - }, + .extra = 48, + .flags = ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20267, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20267, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, #ifndef CONFIG_PDC202XX_FORCE - enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, + .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}}, #endif - bootable: OFF_BOARD, - extra: 48, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .bootable = OFF_BOARD, + .extra = 48, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20268, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20268, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, /* Promise used a different PCI identification for the raid card * apparently to try and prevent Linux detecting it and using our own * raid code. We want to detect it for the ataraid drivers, so we have * to list both here.. */ { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20268R, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20268R, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20269, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20269, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20271, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20271, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20275, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20275, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, { - vendor: PCI_VENDOR_ID_PROMISE, - device: PCI_DEVICE_ID_PROMISE_20276, - init_chipset: pdc202xx_init_chipset, - init_channel: ide_init_pdc202xx, - bootable: OFF_BOARD, - flags: ATA_F_IRQ | ATA_F_DMA - }, + .vendor = PCI_VENDOR_ID_PROMISE, + .device = PCI_DEVICE_ID_PROMISE_20276, + .init_chipset = pdc202xx_init_chipset, + .init_channel = ide_init_pdc202xx, + .bootable = OFF_BOARD, + .flags = ATA_F_IRQ | ATA_F_DMA}, }; int __init init_pdc202xx(void) @@ -863,5 +918,5 @@ int __init init_pdc202xx(void) for (i = 0; i < ARRAY_SIZE(chipsets); ++i) ata_register_chipset(&chipsets[i]); - return 0; + return 0; } diff --git a/drivers/ide/pdc4030.c b/drivers/ide/pdc4030.c index 5fff033d2891..323be48b0e30 100644 --- a/drivers/ide/pdc4030.c +++ b/drivers/ide/pdc4030.c @@ -106,26 +106,24 @@ static void read_vlb(struct ata_device *drive, void *buffer, unsigned int wcount { unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); inb(IDE_NSECTOR_REG); inb(IDE_NSECTOR_REG); inb(IDE_NSECTOR_REG); insl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); } static void write_vlb(struct ata_device *drive, void *buffer, unsigned int wcount) { unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); inb(IDE_NSECTOR_REG); inb(IDE_NSECTOR_REG); inb(IDE_NSECTOR_REG); outsl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); } static void read_16(struct ata_device *drive, void *buffer, unsigned int wcount) @@ -701,7 +699,7 @@ ide_startstop_t do_pdc4030_io(struct ata_device *drive, struct ata_taskfile *arg return ret; } if (!drive->channel->unmask) - __cli(); /* local CPU only */ + local_irq_disable(); return promise_do_write(drive, rq); } diff --git a/drivers/ide/pdcraid.c b/drivers/ide/pdcraid.c index c10d82515001..4d6f81507582 100644 --- a/drivers/ide/pdcraid.c +++ b/drivers/ide/pdcraid.c @@ -31,11 +31,14 @@ #include "ataraid.h" -static int pdcraid_open(struct inode * inode, struct file * filp); -static int pdcraid_release(struct inode * inode, struct file * filp); -static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh); -static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh); +static int pdcraid_open(struct inode *inode, struct file *filp); +static int pdcraid_release(struct inode *inode, struct file *filp); +static int pdcraid_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); +static int pdcraid0_make_request(request_queue_t * q, int rw, + struct buffer_head *bh); +static int pdcraid1_make_request(request_queue_t * q, int rw, + struct buffer_head *bh); struct disk_dev { int major; @@ -43,26 +46,26 @@ struct disk_dev { int device; }; -static struct disk_dev devlist[]= { - {IDE0_MAJOR, 0, -1 }, - {IDE0_MAJOR, 64, -1 }, - {IDE1_MAJOR, 0, -1 }, - {IDE1_MAJOR, 64, -1 }, - {IDE2_MAJOR, 0, -1 }, - {IDE2_MAJOR, 64, -1 }, - {IDE3_MAJOR, 0, -1 }, - {IDE3_MAJOR, 64, -1 }, - {IDE4_MAJOR, 0, -1 }, - {IDE4_MAJOR, 64, -1 }, - {IDE5_MAJOR, 0, -1 }, - {IDE5_MAJOR, 64, -1 }, - {IDE6_MAJOR, 0, -1 }, - {IDE6_MAJOR, 64, -1 }, +static struct disk_dev devlist[] = { + {IDE0_MAJOR, 0, -1}, + {IDE0_MAJOR, 64, -1}, + {IDE1_MAJOR, 0, -1}, + {IDE1_MAJOR, 64, -1}, + {IDE2_MAJOR, 0, -1}, + {IDE2_MAJOR, 64, -1}, + {IDE3_MAJOR, 0, -1}, + {IDE3_MAJOR, 64, -1}, + {IDE4_MAJOR, 0, -1}, + {IDE4_MAJOR, 64, -1}, + {IDE5_MAJOR, 0, -1}, + {IDE5_MAJOR, 64, -1}, + {IDE6_MAJOR, 0, -1}, + {IDE6_MAJOR, 64, -1}, }; struct pdcdisk { - kdev_t device; + kdev_t device; unsigned long sectors; struct block_device *bdev; unsigned long last_pos; @@ -73,133 +76,163 @@ struct pdcraid { unsigned int disks; unsigned long sectors; struct geom geom; - + struct pdcdisk disk[8]; - + unsigned long cutoff[8]; unsigned int cutoff_disks[8]; }; static struct raid_device_operations pdcraid0_ops = { - open: pdcraid_open, - release: pdcraid_release, - ioctl: pdcraid_ioctl, - make_request: pdcraid0_make_request + .open = pdcraid_open, + .release = pdcraid_release, + .ioctl = pdcraid_ioctl, + .make_request = pdcraid0_make_request }; static struct raid_device_operations pdcraid1_ops = { - open: pdcraid_open, - release: pdcraid_release, - ioctl: pdcraid_ioctl, - make_request: pdcraid1_make_request + .open = pdcraid_open, + .release = pdcraid_release, + .ioctl = pdcraid_ioctl, + .make_request = pdcraid1_make_request }; static struct pdcraid raid[16]; -static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +static int pdcraid_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { unsigned int minor; - unsigned long sectors; + unsigned long sectors; - if (!inode || kdev_none(inode->i_rdev)) + if (!inode || kdev_none(inode->i_rdev)) return -EINVAL; - minor = minor(inode->i_rdev)>>SHIFT; - + minor = minor(inode->i_rdev) >> SHIFT; + switch (cmd) { - case BLKGETSIZE: /* Return device size */ - if (!arg) return -EINVAL; - sectors = ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects; - if (minor(inode->i_rdev)&15) - return put_user(sectors, (unsigned long *) arg); - return put_user(raid[minor].sectors , (unsigned long *) arg); - break; - + case BLKGETSIZE: /* Return device size */ + if (!arg) + return -EINVAL; + sectors = + ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects; + if (minor(inode->i_rdev) & 15) + return put_user(sectors, (unsigned long *) arg); + return put_user(raid[minor].sectors, + (unsigned long *) arg); + break; + - case HDIO_GETGEO: + case HDIO_GETGEO: { - struct hd_geometry *loc = (struct hd_geometry *) arg; - unsigned short bios_cyl = raid[minor].geom.cylinders; /* truncate */ - - if (!loc) return -EINVAL; - if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; - if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; - if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; - if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect, - (unsigned long *) &loc->start)) return -EFAULT; + struct hd_geometry *loc = + (struct hd_geometry *) arg; + unsigned short bios_cyl = raid[minor].geom.cylinders; /* truncate */ + + if (!loc) + return -EINVAL; + if (put_user + (raid[minor].geom.heads, + (byte *) & loc->heads)) + return -EFAULT; + if (put_user + (raid[minor].geom.sectors, + (byte *) & loc->sectors)) + return -EFAULT; + if (put_user + (bios_cyl, (unsigned short *) &loc->cylinders)) + return -EFAULT; + if (put_user + ((unsigned) ataraid_gendisk. + part[minor(inode->i_rdev)].start_sect, + (unsigned long *) &loc->start)) + return -EFAULT; return 0; } - case BLKROSET: - case BLKROGET: - case BLKSSZGET: - return blk_ioctl(inode->i_bdev, cmd, arg); + case BLKROSET: + case BLKROGET: + case BLKSSZGET: + return blk_ioctl(inode->i_bdev, cmd, arg); - default: - printk("Invalid ioctl \n"); - return -EINVAL; + default: + printk("Invalid ioctl \n"); + return -EINVAL; }; return 0; } -unsigned long partition_map_normal(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) +unsigned long partition_map_normal(unsigned long block, + unsigned long partition_off, + unsigned long partition_size, + int stride) { return block + partition_off; } -unsigned long partition_map_linux(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) +unsigned long partition_map_linux(unsigned long block, + unsigned long partition_off, + unsigned long partition_size, int stride) { unsigned long newblock; - - newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0; + + newblock = stride - (partition_off % stride); + if (newblock == stride) + newblock = 0; newblock += block; newblock = newblock % partition_size; newblock += partition_off; - + return newblock; } -static int funky_remap[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; +static int funky_remap[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; -unsigned long partition_map_linux_raid0_4disk(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) +unsigned long partition_map_linux_raid0_4disk(unsigned long block, + unsigned long partition_off, + unsigned long partition_size, + int stride) { - unsigned long newblock,temp,temp2; - - newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0; + unsigned long newblock, temp, temp2; + + newblock = stride - (partition_off % stride); + if (newblock == stride) + newblock = 0; - if (block < (partition_size / (8*stride))*8*stride ) { + if (block < (partition_size / (8 * stride)) * 8 * stride) { temp = block % stride; temp2 = block / stride; - temp2 = ((temp2>>3)<<3)|(funky_remap[temp2&7]); - block = temp2*stride+temp; + temp2 = ((temp2 >> 3) << 3) | (funky_remap[temp2 & 7]); + block = temp2 * stride + temp; } - + newblock += block; newblock = newblock % partition_size; newblock += partition_off; - + return newblock; } -static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +static int pdcraid0_make_request(request_queue_t * q, int rw, + struct buffer_head *bh) { unsigned long rsect; - unsigned long rsect_left,rsect_accum = 0; + unsigned long rsect_left, rsect_accum = 0; unsigned long block; - unsigned int disk=0,real_disk=0; + unsigned int disk = 0, real_disk = 0; int i; int device; struct pdcraid *thisraid; rsect = bh->b_rsector; - + /* Ok. We need to modify this sector number to a new disk + new sector number. * If there are disks of different sizes, this gets tricky. * Example with 3 disks (1Gb, 4Gb and 5 GB): @@ -211,52 +244,66 @@ static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff * point, we have to divide by one less. */ - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + + device = (bh->b_rdev >> SHIFT) & MAJOR_MASK; thisraid = &raid[device]; - if (thisraid->stride==0) - thisraid->stride=1; + if (thisraid->stride == 0) + thisraid->stride = 1; /* Partitions need adding of the start sector of the partition to the requested sector */ - - rsect = partition_map_normal(rsect, ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect, ataraid_gendisk.part[MINOR(bh->b_rdev)].nr_sects, thisraid->stride); + + rsect = + partition_map_normal(rsect, + ataraid_gendisk.part[MINOR(bh->b_rdev)]. + start_sect, + ataraid_gendisk.part[MINOR(bh->b_rdev)]. + nr_sects, thisraid->stride); /* Woops we need to split the request to avoid crossing a stride barrier */ - if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { - return -1; + if ((rsect / thisraid->stride) != + ((rsect + (bh->b_size / 512) - 1) / thisraid->stride)) { + return -1; } - + rsect_left = rsect; - - for (i=0;i<8;i++) { - if (thisraid->cutoff_disks[i]==0) + + for (i = 0; i < 8; i++) { + if (thisraid->cutoff_disks[i] == 0) break; if (rsect > thisraid->cutoff[i]) { /* we're in the wrong area so far */ rsect_left -= thisraid->cutoff[i]; - rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i]; + rsect_accum += + thisraid->cutoff[i] / + thisraid->cutoff_disks[i]; } else { block = rsect_left / thisraid->stride; disk = block % thisraid->cutoff_disks[i]; - block = (block / thisraid->cutoff_disks[i]) * thisraid->stride; - rsect = rsect_accum + (rsect_left % thisraid->stride) + block; + block = + (block / thisraid->cutoff_disks[i]) * + thisraid->stride; + rsect = + rsect_accum + (rsect_left % thisraid->stride) + + block; break; } } - - for (i=0;i<8;i++) { - if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) { + + for (i = 0; i < 8; i++) { + if ((disk == 0) + && (thisraid->disk[i].sectors > rsect_accum)) { real_disk = i; break; } - if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) { + if ((disk > 0) + && (thisraid->disk[i].sectors >= rsect_accum)) { disk--; } - + } disk = real_disk; - - + + /* * The new BH_Lock semantics in ll_rw_blk.c guarantee that this * is the only IO operation happening on this bh. @@ -270,106 +317,112 @@ static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head return 1; } -static int pdcraid1_write_request(request_queue_t *q, int rw, struct buffer_head * bh) +static int pdcraid1_write_request(request_queue_t * q, int rw, + struct buffer_head *bh) { struct buffer_head *bh1; struct ataraid_bh_private *private; int device; int i; - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + device = (bh->b_rdev >> SHIFT) & MAJOR_MASK; private = ataraid_get_private(); - if (private==NULL) + if (private == NULL) BUG(); private->parent = bh; - - atomic_set(&private->count,raid[device].disks); + + atomic_set(&private->count, raid[device].disks); - for (i = 0; i< raid[device].disks; i++) { - bh1=ataraid_get_bhead(); + for (i = 0; i < raid[device].disks; i++) { + bh1 = ataraid_get_bhead(); /* If this ever fails we're doomed */ if (!bh1) BUG(); - + /* dupe the bufferhead and update the parts that need to be different */ memcpy(bh1, bh, sizeof(*bh)); - + bh1->b_end_io = ataraid_end_request; bh1->b_private = private; - bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; /* partition offset */ + bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; /* partition offset */ bh1->b_rdev = raid[device].disk[i].device; /* update the last known head position for the drive */ - raid[device].disk[i].last_pos = bh1->b_rsector+(bh1->b_size>>9); + raid[device].disk[i].last_pos = + bh1->b_rsector + (bh1->b_size >> 9); - generic_make_request(rw,bh1); + generic_make_request(rw, bh1); } return 0; } -static int pdcraid1_read_request (request_queue_t *q, int rw, struct buffer_head * bh) +static int pdcraid1_read_request(request_queue_t * q, int rw, + struct buffer_head *bh) { int device; int dist; - int bestsofar,bestdist,i; + int bestsofar, bestdist, i; static int previous; /* Reads are simple in principle. Pick a disk and go. Initially I cheat by just picking the one which the last known head position is closest by. Later on, online/offline checking and performance needs adding */ - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; - bh->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; - bestsofar = 0; + device = (bh->b_rdev >> SHIFT) & MAJOR_MASK; + bh->b_rsector += + ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; + + bestsofar = 0; bestdist = raid[device].disk[0].last_pos - bh->b_rsector; - if (bestdist<0) - bestdist=-bestdist; - if (bestdist>4095) - bestdist=4095; + if (bestdist < 0) + bestdist = -bestdist; + if (bestdist > 4095) + bestdist = 4095; - for (i=1 ; ib_rsector; - if (dist<0) + if (dist < 0) dist = -dist; - if (dist>4095) - dist=4095; - - if (bestdist==dist) { /* it's a tie; try to do some read balancing */ - if ((previous>bestsofar)&&(previous<=i)) + if (dist > 4095) + dist = 4095; + + if (bestdist == dist) { /* it's a tie; try to do some read balancing */ + if ((previous > bestsofar) && (previous <= i)) bestsofar = i; previous = (previous + 1) % raid[device].disks; - } else if (bestdist>dist) { + } else if (bestdist > dist) { bestdist = dist; bestsofar = i; } - + } - - bh->b_rdev = raid[device].disk[bestsofar].device; - raid[device].disk[bestsofar].last_pos = bh->b_rsector+(bh->b_size>>9); + + bh->b_rdev = raid[device].disk[bestsofar].device; + raid[device].disk[bestsofar].last_pos = + bh->b_rsector + (bh->b_size >> 9); /* * Let the main block layer submit the IO and resolve recursion: */ - + return 1; } -static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +static int pdcraid1_make_request(request_queue_t * q, int rw, + struct buffer_head *bh) { /* Read and Write are totally different cases; split them totally here */ - if (rw==READA) + if (rw == READA) rw = READ; - - if (rw==READ) - return pdcraid1_read_request(q,rw,bh); + + if (rw == READ) + return pdcraid1_read_request(q, rw, bh); else - return pdcraid1_write_request(q,rw,bh); + return pdcraid1_write_request(q, rw, bh); } #include "pdcraid.h" @@ -379,23 +432,24 @@ static unsigned long calc_pdcblock_offset(struct block_device *bdev) unsigned long lba = 0; struct ata_device *ideinfo = get_info_ptr(to_kdev_t(bdev->bd_dev)); - if (ideinfo==NULL) + if (ideinfo == NULL) return 0; /* first sector of the last cluster */ - if (ideinfo->head==0) + if (ideinfo->head == 0) return 0; - if (ideinfo->sect==0) + if (ideinfo->sect == 0) return 0; - lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect)); - lba = lba * (ideinfo->head*ideinfo->sect); + lba = (ideinfo->capacity / (ideinfo->head * ideinfo->sect)); + lba = lba * (ideinfo->head * ideinfo->sect); lba = lba - ideinfo->sect; return lba; } -static int read_disk_sb(struct block_device *bdev, struct promise_raid_conf *p) +static int read_disk_sb(struct block_device *bdev, + struct promise_raid_conf *p) { unsigned long sb_offset; char *buffer; @@ -407,14 +461,15 @@ static int read_disk_sb(struct block_device *bdev, struct promise_raid_conf *p) */ sb_offset = calc_pdcblock_offset(bdev); - if (sb_offset==0) - return -1; + if (sb_offset == 0) + return -1; - for (i = 0, buffer = (char*)p; i < 4; i++, buffer += 512) { + for (i = 0, buffer = (char *) p; i < 4; i++, buffer += 512) { Sector sect; char *q = read_dev_sector(bdev, sb_offset + i, §); if (!p) { - printk(KERN_ERR "pdcraid: Error reading superblock.\n"); + printk(KERN_ERR + "pdcraid: Error reading superblock.\n"); return -1; } memcpy(buffer, q, 512); @@ -423,127 +478,133 @@ static int read_disk_sb(struct block_device *bdev, struct promise_raid_conf *p) return 0; } -static unsigned int calc_sb_csum (unsigned int* ptr) -{ +static unsigned int calc_sb_csum(unsigned int *ptr) +{ unsigned int sum; int count; - + sum = 0; - for (count=0;count<511;count++) + for (count = 0; count < 511; count++) sum += *ptr++; - + return sum; } static int cookie = 0; static struct promise_raid_conf __initdata prom; -static void __init probedisk(int devindex,int device, int raidlevel) +static void __init probedisk(int devindex, int device, int raidlevel) { int i; int major, minor; struct block_device *bdev; - if (devlist[devindex].device!=-1) /* already assigned to another array */ + if (devlist[devindex].device != -1) /* already assigned to another array */ return; - + major = devlist[devindex].major; - minor = devlist[devindex].minor; + minor = devlist[devindex].minor; - bdev = bdget(mk_kdev(major,minor)); + bdev = bdget(mk_kdev(major, minor)); if (!bdev) return; - if (blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW) != 0) + if (blkdev_get(bdev, FMODE_READ | FMODE_WRITE, 0, BDEV_RAW) != 0) return; - if (read_disk_sb(bdev, &prom)) - goto out; + if (read_disk_sb(bdev, &prom)) + goto out; - /* the checksums must match */ - if (prom.checksum != calc_sb_csum((unsigned int*)&prom)) + /* the checksums must match */ + if (prom.checksum != calc_sb_csum((unsigned int *) &prom)) goto out; - if (prom.raid.type!=raidlevel) /* different raidlevel */ + if (prom.raid.type != raidlevel) /* different raidlevel */ goto out; - if ((cookie!=0) && (cookie != prom.raid.magic_1)) /* different array */ + if ((cookie != 0) && (cookie != prom.raid.magic_1)) /* different array */ goto out; - + cookie = prom.raid.magic_1; /* This looks evil. But basically, we have to search for our adapternumber - in the arraydefinition, both of which are in the superblock */ - for (i=0;(ibar)) + for (j = 0; j < 8; j++) + if ((raid[device].disk[j].sectors < smallest) + && (raid[device].disk[j].sectors > bar)) smallest = raid[device].disk[j].sectors; count = 0; - for (j=0;j<8;j++) + for (j = 0; j < 8; j++) if (raid[device].disk[j].sectors >= smallest) count++; - + smallest = smallest * count; bar = smallest; raid[device].cutoff[i] = smallest; raid[device].cutoff_disks[i] = count; } } - -static __init int pdcraid_init_one(int device,int raidlevel) + +static __init int pdcraid_init_one(int device, int raidlevel) { int i, count; - for (i=0; i<14; i++) + for (i = 0; i < 14; i++) probedisk(i, device, raidlevel); - - if (raidlevel==0) + + if (raidlevel == 0) fill_cutoff(device); - + /* Initialize the gendisk structure */ - - ataraid_register_disk(device,raid[device].sectors); - - count=0; - - for (i=0;i<8;i++) { - if (raid[device].disk[i].device!=0) { + + ataraid_register_disk(device, raid[device].sectors); + + count = 0; + + for (i = 0; i < 8; i++) { + if (raid[device].disk[i].device != 0) { printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n", - i,raid[device].disk[i].sectors/2048,major(raid[device].disk[i].device),minor(raid[device].disk[i].device)); + i, raid[device].disk[i].sectors / 2048, + major(raid[device].disk[i].device), + minor(raid[device].disk[i].device)); count++; } } if (count) { - printk(KERN_INFO "Raid%i array consists of %i drives. \n",raidlevel,count); + printk(KERN_INFO "Raid%i array consists of %i drives. \n", + raidlevel, count); return 0; } else { return -ENODEV; @@ -556,10 +617,10 @@ static __init int pdcraid_init(void) do { cookie = 0; - device=ataraid_get_device(&pdcraid0_ops); - if (device<0) + device = ataraid_get_device(&pdcraid0_ops); + if (device < 0) break; - retval = pdcraid_init_one(device,0); + retval = pdcraid_init_one(device, 0); if (retval) { ataraid_release_device(device); break; @@ -569,12 +630,12 @@ static __init int pdcraid_init(void) } while (1); do { - + cookie = 0; - device=ataraid_get_device(&pdcraid1_ops); - if (device<0) + device = ataraid_get_device(&pdcraid1_ops); + if (device < 0) break; - retval = pdcraid_init_one(device,1); + retval = pdcraid_init_one(device, 1); if (retval) { ataraid_release_device(device); break; @@ -584,35 +645,38 @@ static __init int pdcraid_init(void) } while (1); if (count) { - printk(KERN_INFO "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n"); + printk(KERN_INFO + "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n"); return 0; } - printk(KERN_DEBUG "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n"); + printk(KERN_DEBUG + "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n"); return -ENODEV; } -static void __exit pdcraid_exit (void) +static void __exit pdcraid_exit(void) { - int i,device; - for (device = 0; device<16; device++) { - for (i=0;i<8;i++) { - struct block_device *bdev = raid[device].disk[i].bdev; + int i, device; + for (device = 0; device < 16; device++) { + for (i = 0; i < 8; i++) { + struct block_device *bdev = + raid[device].disk[i].bdev; raid[device].disk[i].bdev = NULL; if (bdev) blkdev_put(bdev, BDEV_RAW); - } + } if (raid[device].sectors) ataraid_release_device(device); } } -static int pdcraid_open(struct inode * inode, struct file * filp) +static int pdcraid_open(struct inode *inode, struct file *filp) { MOD_INC_USE_COUNT; return 0; } -static int pdcraid_release(struct inode * inode, struct file * filp) -{ +static int pdcraid_release(struct inode *inode, struct file *filp) +{ MOD_DEC_USE_COUNT; return 0; } diff --git a/drivers/ide/piix.c b/drivers/ide/piix.c index 111d451dd3e7..a5fb9998bf56 100644 --- a/drivers/ide/piix.c +++ b/drivers/ide/piix.c @@ -388,130 +388,130 @@ static void __init piix_init_dma(struct ata_channel *ch, unsigned long dmabase) /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82371FB_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82371FB_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82371SB_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82371SB_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82371AB, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82371AB, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82443MX_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82443MX_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82372FB_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82372FB_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801AA_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801AA_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801AB_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801AB_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801BA_9, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801BA_9, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801BA_8, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801BA_8, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801E_9, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801E_9, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801CA_10, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801CA_10, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801CA_11, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801CA_11, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_INTEL, - device: PCI_DEVICE_ID_INTEL_82801DB_9, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_INTEL, + .device = PCI_DEVICE_ID_INTEL_82801DB_9, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_EFAR, - device: PCI_DEVICE_ID_EFAR_SLC90E66_1, - init_chipset: piix_init_chipset, - init_channel: piix_init_channel, - init_dma: piix_init_dma, - enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_EFAR, + .device = PCI_DEVICE_ID_EFAR_SLC90E66_1, + .init_chipset = piix_init_chipset, + .init_channel = piix_init_channel, + .init_dma = piix_init_dma, + .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + .bootable = ON_BOARD }, }; @@ -519,9 +519,8 @@ int __init init_piix(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; } diff --git a/drivers/ide/probe.c b/drivers/ide/probe.c index da683c0783f5..3bdb1de45817 100644 --- a/drivers/ide/probe.c +++ b/drivers/ide/probe.c @@ -403,7 +403,7 @@ static inline void do_identify(struct ata_device *drive, u8 cmd) */ ata_read(drive, id, SECTOR_WORDS); - ide__sti(); /* local CPU only */ + local_irq_enable(); ata_fix_driveid(id); if (id->word156 == 0x4d42) { @@ -616,12 +616,12 @@ static int identify(struct ata_device *drive, u8 cmd) if (ata_status(drive, DRQ_STAT, BAD_R_STAT)) { unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only; some systems need this */ + + local_irq_save(flags); /* some systems need this */ do_identify(drive, cmd); /* drive returned ID */ rc = 0; /* drive responded with ID */ ata_status(drive, 0, 0); /* clear drive IRQ */ - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); /* local CPU only */ } else rc = 2; /* drive refused ID */ @@ -733,8 +733,8 @@ static void channel_probe(struct ata_channel *ch) ch->straight8 = 0; - __save_flags(flags); /* local CPU only */ - __sti(); /* local CPU only; needed for jiffies and irq probing */ + __save_flags(flags); + local_irq_enable(); /* needed for jiffies and irq probing */ /* * Check for the presence of a channel by probing for drives on it. @@ -852,7 +852,7 @@ static void channel_probe(struct ata_channel *ch) if (ch->reset) ata_reset(ch); - __restore_flags(flags); /* local CPU only */ + __restore_flags(flags); /* * Now setup the PIO transfer modes of the drives on this channel. diff --git a/drivers/ide/q40ide.c b/drivers/ide/q40ide.c index ce37509af397..eebbfb582413 100644 --- a/drivers/ide/q40ide.c +++ b/drivers/ide/q40ide.c @@ -57,7 +57,7 @@ static const int pcide_offsets[IDE_NR_PORTS] = { static int q40ide_default_irq(q40ide_ioreg_t base) { - switch (base) { + switch (base) { case 0x1f0: return 14; case 0x170: return 15; case 0x1e8: return 11; @@ -66,12 +66,9 @@ static int q40ide_default_irq(q40ide_ioreg_t base) } } - - - /* - * Probe for Q40 IDE interfaces - */ - +/* + * Probe for Q40 IDE interfaces + */ void q40ide_init(void) { int i; diff --git a/drivers/ide/rz1000.c b/drivers/ide/rz1000.c index 2538ba50b6d3..b1bad3dcfb16 100644 --- a/drivers/ide/rz1000.c +++ b/drivers/ide/rz1000.c @@ -51,16 +51,16 @@ static void __init rz1000_init_channel(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_PCTECH, - device: PCI_DEVICE_ID_PCTECH_RZ1000, - init_channel: rz1000_init_channel, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_PCTECH, + .device = PCI_DEVICE_ID_PCTECH_RZ1000, + .init_channel = rz1000_init_channel, + .bootable = ON_BOARD }, { - vendor: PCI_VENDOR_ID_PCTECH, - device: PCI_DEVICE_ID_PCTECH_RZ1001, - init_channel: rz1000_init_channel, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_PCTECH, + .device = PCI_DEVICE_ID_PCTECH_RZ1001, + .init_channel = rz1000_init_channel, + .bootable = ON_BOARD }, }; @@ -68,9 +68,8 @@ int __init init_rz1000(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; } diff --git a/drivers/ide/serverworks.c b/drivers/ide/serverworks.c index 798bc253bdce..ff8e39ef3b9f 100644 --- a/drivers/ide/serverworks.c +++ b/drivers/ide/serverworks.c @@ -394,20 +394,20 @@ static void __init ide_init_svwks(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_SERVERWORKS, - device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, - init_chipset: svwks_init_chipset, - init_channel: ide_init_svwks, - bootable: ON_BOARD, - flags: ATA_F_DMA + .vendor = PCI_VENDOR_ID_SERVERWORKS, + .device = PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, + .init_chipset = svwks_init_chipset, + .init_channel = ide_init_svwks, + .bootable = ON_BOARD, + .flags = ATA_F_DMA }, { - vendor: PCI_VENDOR_ID_SERVERWORKS, - device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, - init_chipset: svwks_init_chipset, - init_channel: ide_init_svwks, - bootable: ON_BOARD, - flags: ATA_F_SIMPLEX + .vendor = PCI_VENDOR_ID_SERVERWORKS, + .device = PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, + .init_chipset = svwks_init_chipset, + .init_channel = ide_init_svwks, + .bootable = ON_BOARD, + .flags = ATA_F_SIMPLEX }, }; diff --git a/drivers/ide/sis5513.c b/drivers/ide/sis5513.c index e83fe6667b62..fb1a56cd0140 100644 --- a/drivers/ide/sis5513.c +++ b/drivers/ide/sis5513.c @@ -505,12 +505,12 @@ static void __init ide_init_sis5513(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipset __initdata = { - vendor: PCI_VENDOR_ID_SI, - device: PCI_DEVICE_ID_SI_5513, - init_chipset: pci_init_sis5513, - init_channel: ide_init_sis5513, - enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, - bootable: ON_BOARD, + .vendor = PCI_VENDOR_ID_SI, + .device = PCI_DEVICE_ID_SI_5513, + .init_chipset = pci_init_sis5513, + .init_channel = ide_init_sis5513, + .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, + .bootable = ON_BOARD, }; int __init init_sis5513(void) diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c index abaa3d61a8d8..488b0018bb43 100644 --- a/drivers/ide/sl82c105.c +++ b/drivers/ide/sl82c105.c @@ -360,13 +360,13 @@ static void __init sl82c105_init_channel(struct ata_channel *ch) /* module data table */ static struct ata_pci_device chipset __initdata = { - vendor: PCI_VENDOR_ID_WINBOND, - device: PCI_DEVICE_ID_WINBOND_82C105, - init_chipset: sl82c105_init_chipset, - init_channel: sl82c105_init_channel, - init_dma: sl82c105_init_dma, - enablebits: { {0x40,0x01,0x01}, {0x40,0x10,0x10} }, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_WINBOND, + .device = PCI_DEVICE_ID_WINBOND_82C105, + .init_chipset = sl82c105_init_chipset, + .init_channel = sl82c105_init_channel, + .init_dma = sl82c105_init_dma, + .enablebits = { {0x40,0x01,0x01}, {0x40,0x10,0x10} }, + .bootable = ON_BOARD }; int __init init_sl82c105(void) diff --git a/drivers/ide/tcq.c b/drivers/ide/tcq.c index 2d05fd15fb49..83c63ff13f7d 100644 --- a/drivers/ide/tcq.c +++ b/drivers/ide/tcq.c @@ -61,7 +61,7 @@ static ide_startstop_t tcq_nop_handler(struct ata_device *drive, struct request struct ata_taskfile *args = rq->special; struct ata_channel *ch = drive->channel; - ide__sti(); + local_irq_enable(); spin_lock_irqsave(ch->lock, flags); diff --git a/drivers/ide/trm290.c b/drivers/ide/trm290.c index 0e6587f65152..4e1995b62a47 100644 --- a/drivers/ide/trm290.c +++ b/drivers/ide/trm290.c @@ -151,8 +151,7 @@ static void trm290_prepare_drive(struct ata_device *drive, unsigned int use_dma) /* select PIO or DMA */ reg = use_dma ? (0x21 | 0x82) : (0x21 & ~0x82); - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); if (reg != hwif->select_data) { hwif->select_data = reg; @@ -167,7 +166,7 @@ static void trm290_prepare_drive(struct ata_device *drive, unsigned int use_dma) outw(reg, hwif->config_data+3); } - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); } static void trm290_selectproc(struct ata_device *drive) @@ -266,8 +265,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif) printk("TRM290: using default config base at 0x%04lx\n", hwif->config_data); } - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); /* put config reg into first byte of hwif->select_data */ outb(0x51|(hwif->unit<<3), hwif->config_data+1); hwif->select_data = 0x21; /* select PIO as default */ @@ -275,7 +273,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif) reg = inb(hwif->config_data+3); /* get IRQ info */ reg = (reg & 0x10) | 0x03; /* mask IRQs for both ports */ outb(reg, hwif->config_data+3); - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); if ((reg & 0x10)) hwif->irq = hwif->unit ? 15 : 14; /* legacy mode */ @@ -327,10 +325,10 @@ static void __init trm290_init_channel(struct ata_channel *hwif) /* module data table */ static struct ata_pci_device chipset __initdata = { - vendor: PCI_VENDOR_ID_TEKRAM, - device: PCI_DEVICE_ID_TEKRAM_DC290, - init_channel: trm290_init_channel, - bootable: ON_BOARD + .vendor = PCI_VENDOR_ID_TEKRAM, + .device = PCI_DEVICE_ID_TEKRAM_DC290, + .init_channel = trm290_init_channel, + .bootable = ON_BOARD }; int __init init_trm290(void) diff --git a/drivers/ide/umc8672.c b/drivers/ide/umc8672.c index 2769442f4e33..fb7f1a6116b9 100644 --- a/drivers/ide/umc8672.c +++ b/drivers/ide/umc8672.c @@ -127,30 +127,29 @@ void __init init_umc8672(void) /* called from ide.c */ { unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + local_irq_save(flags); if (!request_region(0x108, 2, "umc8672")) { - __restore_flags(flags); + local_irq_restore(flags); printk("\numc8672: PORTS 0x108-0x109 ALREADY IN USE\n"); return; } outb_p (0x5A,0x108); /* enable umc */ if (in_umc (0xd5) != 0xa0) { - __restore_flags(flags); /* local CPU only */ - release_region(0x108, 2); + local_irq_restore(flags); + release_region(0x108, 2); printk ("umc8672: not found\n"); return; } outb_p (0xa5,0x108); /* disable umc */ - umc_set_speeds (current_speeds); - __restore_flags(flags); /* local CPU only */ + umc_set_speeds(current_speeds); + local_irq_restore(flags); ide_hwifs[0].chipset = ide_umc8672; ide_hwifs[1].chipset = ide_umc8672; - ide_hwifs[0].tuneproc = &tune_umc; - ide_hwifs[1].tuneproc = &tune_umc; + ide_hwifs[0].tuneproc = tune_umc; + ide_hwifs[1].tuneproc = tune_umc; ide_hwifs[0].unit = ATA_PRIMARY; ide_hwifs[1].unit = ATA_SECONDARY; } diff --git a/drivers/ide/via82cxxx.c b/drivers/ide/via82cxxx.c index 1706d4b6f42e..54838f9a8975 100644 --- a/drivers/ide/via82cxxx.c +++ b/drivers/ide/via82cxxx.c @@ -380,22 +380,22 @@ static void __init via82cxxx_init_dma(struct ata_channel *hwif, unsigned long dm /* module data table */ static struct ata_pci_device chipsets[] __initdata = { { - vendor: PCI_VENDOR_ID_VIA, - device: PCI_DEVICE_ID_VIA_82C576_1, - init_chipset: via82cxxx_init_chipset, - init_channel: via82cxxx_init_channel, - init_dma: via82cxxx_init_dma, - enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, - bootable: ON_BOARD, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_82C576_1, + .init_chipset = via82cxxx_init_chipset, + .init_channel = via82cxxx_init_channel, + .init_dma = via82cxxx_init_dma, + .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, + .bootable = ON_BOARD, }, { - vendor: PCI_VENDOR_ID_VIA, - device: PCI_DEVICE_ID_VIA_82C586_1, - init_chipset: via82cxxx_init_chipset, - init_channel: via82cxxx_init_channel, - init_dma: via82cxxx_init_dma, - enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, - bootable: ON_BOARD, + .vendor = PCI_VENDOR_ID_VIA, + .device = PCI_DEVICE_ID_VIA_82C586_1, + .init_chipset = via82cxxx_init_chipset, + .init_channel = via82cxxx_init_channel, + .init_dma = via82cxxx_init_dma, + .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, + .bootable = ON_BOARD, }, }; @@ -403,9 +403,8 @@ int __init init_via82cxxx(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; } diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 1f001b4172cc..6cb967d14650 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -318,10 +318,11 @@ static ide_startstop_t idescsi_pc_intr(struct ata_device *drive, struct request if (ata_status(drive, 0, DRQ_STAT)) { /* No more interrupts */ if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred); - ide__sti(); + local_irq_enable(); if (drive->status & ERR_STAT) rq->errors++; idescsi_end_request(drive, rq, 1); + return ATA_OP_FINISHED; } bcount = IN_BYTE (IDE_BCOUNTH_REG) << 8 | IN_BYTE (IDE_BCOUNTL_REG); diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h index 5ec5fe1da2c1..63bb9f785498 100644 --- a/include/asm-alpha/ide.h +++ b/include/asm-alpha/ide.h @@ -19,8 +19,6 @@ #define MAX_HWIFS 4 #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { switch (base) { diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index f1cbbe4876ea..741b223b06f0 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h @@ -17,8 +17,6 @@ #define MAX_HWIFS 4 #endif -#define ide__sti() __sti() - #include /* diff --git a/include/asm-cris/ide.h b/include/asm-cris/ide.h index 051e96142e10..8f4bd8c131f4 100644 --- a/include/asm-cris/ide.h +++ b/include/asm-cris/ide.h @@ -22,8 +22,6 @@ #define MAX_HWIFS 4 -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { /* all IDE busses share the same IRQ, number 4. diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index 9bec7f280cde..b2ad635bdf94 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h @@ -23,8 +23,6 @@ # endif #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { switch (base) { diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h index 50370ff4de3d..3c9fe4910181 100644 --- a/include/asm-ia64/ide.h +++ b/include/asm-ia64/ide.h @@ -25,8 +25,6 @@ # endif #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq (ide_ioreg_t base) { diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index 28c7e66668ea..1471687982a9 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -171,36 +171,5 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, } } #endif /* CONFIG_ATARI */ - -/* - * On the Atari, we sometimes can't enable interrupts: - */ - -/* MSch: changed sti() to STI() wherever possible in ide.c; moved STI() def. - * to asm/ide.h - */ -/* The Atari interrupt structure strictly requires that the IPL isn't lowered - * uncontrolled in an interrupt handler. In the concrete case, the IDE - * interrupt is already a slow int, so the irq is already disabled at the time - * the handler is called, and the IPL has been lowered to the minimum value - * possible. To avoid going below that, STI() checks for being called inside - * an interrupt, and in that case it does nothing. Hope that is reasonable and - * works. (Roman) - */ -#ifdef MACH_ATARI_ONLY -#define ide__sti() \ - do { \ - if (!in_interrupt()) __sti(); \ - } while(0) -#elif defined(CONFIG_ATARI) -#define ide__sti() \ - do { \ - if (!MACH_IS_ATARI || !in_interrupt()) sti(); \ - } while(0) -#else /* !defined(CONFIG_ATARI) */ -#define ide__sti() __sti() -#endif - #endif /* __KERNEL__ */ - #endif /* _M68K_IDE_H */ diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h index 85447877a181..33cd055aea35 100644 --- a/include/asm-mips/ide.h +++ b/include/asm-mips/ide.h @@ -24,8 +24,6 @@ # endif #endif -#define ide__sti() __sti() - struct ide_ops { int (*ide_default_irq)(ide_ioreg_t base); ide_ioreg_t (*ide_default_io_base)(int index); diff --git a/include/asm-mips64/ide.h b/include/asm-mips64/ide.h index ce6635f97a0c..de357ad5070e 100644 --- a/include/asm-mips64/ide.h +++ b/include/asm-mips64/ide.h @@ -27,8 +27,6 @@ # endif #endif -#define ide__sti() __sti() - struct ide_ops { int (*ide_default_irq)(ide_ioreg_t base); ide_ioreg_t (*ide_default_io_base)(int index); diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index 133997006872..be46fbf6af79 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h @@ -19,8 +19,6 @@ #define MAX_HWIFS 10 #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { switch (base) { diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index 48dafbc1655b..db9bd31d08c5 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -44,8 +44,6 @@ extern struct ide_machdep_calls ppc_ide_md; #undef SUPPORT_SLOW_DATA_PORTS #define SUPPORT_SLOW_DATA_PORTS 0 -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { if (ppc_ide_md.default_irq) diff --git a/include/asm-ppc64/ide.h b/include/asm-ppc64/ide.h index 4752dee41b2f..717dd566c7e7 100644 --- a/include/asm-ppc64/ide.h +++ b/include/asm-ppc64/ide.h @@ -7,7 +7,7 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. - */ + */ /* * This file contains the ppc64 architecture specific IDE code. @@ -19,11 +19,9 @@ #ifdef __KERNEL__ #ifndef MAX_HWIFS -#define MAX_HWIFS 4 +# define MAX_HWIFS 4 #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { return 0; } static __inline__ ide_ioreg_t ide_default_io_base(int index) { return 0; } diff --git a/include/asm-s390/ide.h b/include/asm-s390/ide.h index b5ca760a3097..01d7765f7ef4 100644 --- a/include/asm-s390/ide.h +++ b/include/asm-s390/ide.h @@ -15,8 +15,6 @@ #define MAX_HWIFS 0 #endif -#define ide__sti() do {} while (0) - /* * We always use the new IDE port registering, * so these are fixed here. diff --git a/include/asm-s390x/ide.h b/include/asm-s390x/ide.h deleted file mode 100644 index b5ca760a3097..000000000000 --- a/include/asm-s390x/ide.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * linux/include/asm-s390/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -/* s390 does not have IDE */ - -#ifndef __ASMS390_IDE_H -#define __ASMS390_IDE_H - -#ifdef __KERNEL__ - -#ifndef MAX_HWIFS -#define MAX_HWIFS 0 -#endif - -#define ide__sti() do {} while (0) - -/* - * We always use the new IDE port registering, - * so these are fixed here. - */ -#define ide_default_io_base(i) ((ide_ioreg_t)0) -#define ide_default_irq(b) (0) - -#endif /* __KERNEL__ */ - -#endif /* __ASMS390_IDE_H */ diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h index 9a2ddc373224..eb551e50d57f 100644 --- a/include/asm-sh/ide.h +++ b/include/asm-sh/ide.h @@ -22,8 +22,6 @@ #define MAX_HWIFS 2 #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq_hp600(ide_ioreg_t base) { switch (base) { diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index 7ac2eda1d0e7..07bb6650f34c 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h @@ -20,8 +20,6 @@ #undef MAX_HWIFS #define MAX_HWIFS 2 -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { return 0; diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h index de65170ba834..d5672caf1628 100644 --- a/include/asm-sparc64/ide.h +++ b/include/asm-sparc64/ide.h @@ -20,8 +20,6 @@ #undef MAX_HWIFS #define MAX_HWIFS 2 -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { return 0; diff --git a/include/asm-x86_64/ide.h b/include/asm-x86_64/ide.h index 9bec7f280cde..b2ad635bdf94 100644 --- a/include/asm-x86_64/ide.h +++ b/include/asm-x86_64/ide.h @@ -23,8 +23,6 @@ # endif #endif -#define ide__sti() __sti() - static __inline__ int ide_default_irq(ide_ioreg_t base) { switch (base) {