#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));
* 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)
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);
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;
}
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;
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);
}
/*
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;
}
/*
* 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;
/* 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
}
};
/* 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 = {
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.
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;
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);
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 */
}
outb_p(reg_off, base_port);
}
- __restore_flags(flags); /* local CPU only */
+ local_irq_restore(flags);
+
return 0;
}
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;
}
}
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;
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);
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)
unsigned long flags;
byte tmpbyte;
- __save_flags(flags);
- __cli();
+ local_irq_save(flags);
if (m5229_revision >= 0xC2) {
/*
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)
/* 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
}
};
{
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;
}
/* 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
},
};
{
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;
}
#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;
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);
/* 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;
{
void *ptr = NULL;
while (!ptr) {
- ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO);
+ ptr = kmalloc(sizeof(struct buffer_head), GFP_NOIO);
if (!ptr)
yield();
}
{
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();
}
{
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);
}
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;
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);
}
{
int bit;
down(&ataraid_sem);
- if (ataraiduse==~0U) {
+ if (ataraiduse == ~0U) {
up(&ataraid_sem);
return -ENODEV;
}
- bit=ffz(ataraiduse);
- ataraiduse |= 1<<bit;
+ bit = ffz(ataraiduse);
+ ataraiduse |= 1 << bit;
ataraid_ops[bit] = fops;
up(&ataraid_sem);
return bit;
void ataraid_release_device(int device)
{
down(&ataraid_sem);
-
- if ((ataraiduse & (1<<device))==0)
- BUG(); /* device wasn't registered at all */
-
- ataraiduse &= ~(1<<device);
+
+ if ((ataraiduse & (1 << device)) == 0)
+ BUG(); /* device wasn't registered at all */
+
+ ataraiduse &= ~(1 << device);
ataraid_ops[device] = NULL;
up(&ataraid_sem);
}
-void ataraid_register_disk(int device,long size)
+void ataraid_register_disk(int device, long size)
{
- register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR,16*device),16,
- &ataraid_fops,size);
+ register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR, 16 * device), 16,
+ &ataraid_fops, size);
}
-static __init int ataraid_init(void)
+static __init int ataraid_init(void)
{
int i;
- for(i=0;i<256;i++)
+ for (i = 0; i < 256; i++)
ataraid_readahead[i] = 1023;
-
- /* setup the gendisk structure */
- ataraid_gendisk.part = kmalloc(256 * sizeof(struct hd_struct),GFP_KERNEL);
- if (ataraid_gendisk.part==NULL) {
- printk(KERN_ERR "ataraid: Couldn't allocate memory, aborting \n");
+
+ /* setup the gendisk structure */
+ ataraid_gendisk.part =
+ kmalloc(256 * sizeof(struct hd_struct), GFP_KERNEL);
+ if (ataraid_gendisk.part == NULL) {
+ printk(KERN_ERR
+ "ataraid: Couldn't allocate memory, aborting \n");
return -1;
}
-
- memset(&ataraid_gendisk.part[0],0,256*sizeof(struct hd_struct));
-
-
- ataraid_gendisk.major = ATAMAJOR;
- ataraid_gendisk.major_name = "ataraid";
+
+ memset(&ataraid_gendisk.part[0], 0,
+ 256 * sizeof(struct hd_struct));
+
+
+ ataraid_gendisk.major = ATAMAJOR;
+ ataraid_gendisk.major_name = "ataraid";
ataraid_gendisk.minor_shift = 4;
- ataraid_gendisk.sizes = &ataraid_gendisk_sizes[0];
- ataraid_gendisk.nr_real = 16;
- ataraid_gendisk.fops = &ataraid_fops;
-
-
+ ataraid_gendisk.sizes = &ataraid_gendisk_sizes[0];
+ ataraid_gendisk.nr_real = 16;
+ ataraid_gendisk.fops = &ataraid_fops;
+
+
add_gendisk(&ataraid_gendisk);
-
+
if (register_blkdev(ATAMAJOR, "ataraid", &ataraid_fops)) {
- printk(KERN_ERR "ataraid: Could not get major %d \n",ATAMAJOR);
+ printk(KERN_ERR "ataraid: Could not get major %d \n",
+ ATAMAJOR);
return -1;
}
-
-
-
- blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),ataraid_make_request);
-
- return 0;
+
+
+
+ blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),
+ ataraid_make_request);
+
+ return 0;
}
blk_size[ATAMAJOR] = NULL;
del_gendisk(&ataraid_gendisk);
-
+
if (ataraid_gendisk.part) {
kfree(ataraid_gendisk.part);
ataraid_gendisk.part = NULL;
EXPORT_SYMBOL(ataraid_gendisk);
EXPORT_SYMBOL(ataraid_register_disk);
MODULE_LICENSE("GPL");
-
/*
* Now that everything is ready, program the new timings
*/
- __save_flags (flags);
- __cli();
+ local_irq_save(flags);
/*
* Program the address_setup clocks into ARTTIM reg,
* and then the active/recovery counts into the DRWTIM reg
(byte) ((active_count << 4) | recovery_count));
cmdprintk ("Write %x to %x\n", ((byte) setup_count) | (temp_b & 0x3f), arttim_regs[channel][slave]);
cmdprintk ("Write %x to %x\n", (byte) ((active_count << 4) | recovery_count), drwtim_regs[channel][slave]);
- __restore_flags(flags);
+ local_irq_restore(flags);
}
/*
/* module data table */
static struct ata_pci_device chipsets[] __initdata = {
{
- vendor: PCI_VENDOR_ID_CMD,
- device: PCI_DEVICE_ID_CMD_643,
- init_chipset: cmd64x_init_chipset,
- init_channel: cmd64x_init_channel,
- bootable: ON_BOARD,
- flags: ATA_F_SIMPLEX,
+ .vendor = PCI_VENDOR_ID_CMD,
+ .device = PCI_DEVICE_ID_CMD_643,
+ .init_chipset = cmd64x_init_chipset,
+ .init_channel = cmd64x_init_channel,
+ .bootable = ON_BOARD,
+ .flags = ATA_F_SIMPLEX,
},
{
- vendor: PCI_VENDOR_ID_CMD,
- device: PCI_DEVICE_ID_CMD_646,
- init_chipset: cmd64x_init_chipset,
- init_channel: cmd64x_init_channel,
- enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
- bootable: ON_BOARD,
- flags: ATA_F_DMA
+ .vendor = PCI_VENDOR_ID_CMD,
+ .device = PCI_DEVICE_ID_CMD_646,
+ .init_chipset = cmd64x_init_chipset,
+ .init_channel = cmd64x_init_channel,
+ .enablebits = {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
+ .bootable = ON_BOARD,
+ .flags = ATA_F_DMA
},
{
- vendor: PCI_VENDOR_ID_CMD,
- device: PCI_DEVICE_ID_CMD_648,
- init_chipset: cmd64x_init_chipset,
- init_channel: cmd64x_init_channel,
- bootable: ON_BOARD,
- flags: ATA_F_DMA
+ .vendor = PCI_VENDOR_ID_CMD,
+ .device = PCI_DEVICE_ID_CMD_648,
+ .init_chipset = cmd64x_init_chipset,
+ .init_channel = cmd64x_init_channel,
+ .bootable = ON_BOARD,
+ .flags = ATA_F_DMA
},
{
- vendor: PCI_VENDOR_ID_CMD,
- device: PCI_DEVICE_ID_CMD_649,
- init_chipset: cmd64x_init_chipset,
- init_channel: cmd64x_init_channel,
- bootable: ON_BOARD,
- flags: ATA_F_DMA
+ .vendor = PCI_VENDOR_ID_CMD,
+ .device = PCI_DEVICE_ID_CMD_649,
+ .init_chipset = cmd64x_init_chipset,
+ .init_channel = cmd64x_init_channel,
+ .bootable = ON_BOARD,
+ .flags = ATA_F_DMA
},
{
- vendor: PCI_VENDOR_ID_CMD,
- device: PCI_DEVICE_ID_CMD_680,
- init_chipset: cmd64x_init_chipset,
- init_channel: cmd64x_init_channel,
- bootable: ON_BOARD,
- flags: ATA_F_DMA
+ .vendor = PCI_VENDOR_ID_CMD,
+ .device = PCI_DEVICE_ID_CMD_680,
+ .init_chipset = cmd64x_init_chipset,
+ .init_channel = cmd64x_init_channel,
+ .bootable = ON_BOARD,
+ .flags = ATA_F_DMA
},
};
/* module data table */
static struct ata_pci_device chipset __initdata = {
- vendor: PCI_VENDOR_ID_CYRIX,
- device: PCI_DEVICE_ID_CYRIX_5530_IDE,
- init_chipset: pci_init_cs5530,
- init_channel: ide_init_cs5530,
- bootable: ON_BOARD,
- flags: ATA_F_DMA
+ .vendor = PCI_VENDOR_ID_CYRIX,
+ .device = PCI_DEVICE_ID_CYRIX_5530_IDE,
+ .init_chipset = pci_init_cs5530,
+ .init_channel = ide_init_cs5530,
+ .bootable = ON_BOARD,
+ .flags = ATA_F_DMA
};
int __init init_cs5530(void)
/* module data table */
static struct ata_pci_device chipset __initdata = {
- vendor: PCI_VENDOR_ID_CONTAQ,
- device: PCI_DEVICE_ID_CONTAQ_82C693,
- init_chipset: pci_init_cy82c693,
- init_channel: ide_init_cy82c693,
- bootable: ON_BOARD,
- flags: ATA_F_DMA
+ .vendor = PCI_VENDOR_ID_CONTAQ,
+ .device = PCI_DEVICE_ID_CONTAQ_82C693,
+ .init_chipset = pci_init_cy82c693,
+ .init_channel = ide_init_cy82c693,
+ .bootable = ON_BOARD,
+ .flags = ATA_F_DMA
};
int __init init_cy82c693(void)
unsigned long flags;
__save_flags(flags);
- ide__sti();
+ local_irq_enable();
timeout += jiffies;
while (!ata_status(drive, 0, BUSY_STAT)) {
if (time_after(jiffies, timeout)) {
{
unsigned long flags;
- __save_flags(flags); /* local CPU only */
- __cli(); /* local CPU only */
+ local_irq_save(flags);
/*
* This enables the second interface
*/
sub22(1,0xc3);
sub22(0,0xa0);
#endif
- __restore_flags(flags); /* local CPU only */
+ local_irq_restore(flags);
ide_hwifs[0].serialized = 1;
ide_hwifs[1].serialized = 1;
extern struct block_device_operations hd_fops;
static struct gendisk hd_gendisk = {
- major: MAJOR_NR,
- major_name: "hd",
- minor_shift: 6,
- part: hd,
- sizes: hd_sizes,
- fops: &hd_fops,
+ .major = MAJOR_NR,
+ .major_name = "hd",
+ .minor_shift = 6,
+ .part = hd,
+ .sizes = hd_sizes,
+ .fops = &hd_fops,
};
static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
static struct block_device_operations hd_fops = {
- open: hd_open,
- release: hd_release,
- ioctl: hd_ioctl,
+ .open = hd_open,
+ .release = hd_release,
+ .ioctl = hd_ioctl,
};
/*
unsigned short cmd;
unsigned long flags;
- __save_flags(flags); /* local CPU only */
- __cli(); /* local CPU only */
+ local_irq_save(flags);
pci_write_config_byte(dev, HPT34X_PCI_INIT_REG, 0x00);
pci_read_config_word(dev, PCI_COMMAND, &cmd);
pci_write_config_dword(dev, PCI_BASE_ADDRESS_3, dev->resource[3].start);
pci_write_config_word(dev, PCI_COMMAND, cmd);
- __restore_flags(flags); /* local CPU only */
+ local_irq_restore(flags);
return dev->irq;
}
/* 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)
/* 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
},
};
#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;
};
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;
* 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;
#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;
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);
}
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<<gd->minor_shift);j<((minor+1)<<gd->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<<prom.raid0_shift);
+ raid[device].disk[i].device = mk_kdev(major, minor);
+ raid[device].disk[i].sectors = maxsectors(major, minor);
+ raid[device].stride = (1 << prom.raid0_shift);
raid[device].disks = prom.raid_disks;
raid[device].sectors = prom.total_secs;
return;
-out:
+ out:
blkdev_put(bdev);
}
static void __init fill_cutoff(int device)
{
- int i,j;
+ int i, j;
unsigned long smallest;
unsigned long bar;
int count;
-
+
bar = 0;
- for (i=0;i<8;i++) {
+ for (i = 0; i < 8; i++) {
smallest = ~0;
- for (j=0;j<8;j++)
- if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>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)
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;
}
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);
printk("ht6560b: %s: select=%#x timing=%#x\n", drive->name, select, timing);
#endif
}
- __restore_flags (flags); /* local CPU only */
+ local_irq_restore(flags);
}
/*
* 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)
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 */
* 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)
#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
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;
}
* 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)
*/
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
}
};
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");
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) {
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,
};
* 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)
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) {
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);
#endif
printk("\n");
}
- __restore_flags (flags); /* local CPU only */
+ __restore_flags (flags);
+
return err;
}
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
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.
#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)) {
* 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
}
/*
- * 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)
{
spin_unlock(ch->lock);
if (ch->unmask)
- ide__sti();
+ local_irq_enable();
/*
* Service this interrupt, this may setup handler for next interrupt.
}
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);
/* 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)
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 */
udelay(10);
}
- __restore_flags(flags); /* local CPU only */
+ local_irq_restore(flags);
}
static void ns87415_selectproc(struct ata_device *drive)
/* 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)
/* 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
},
};
};
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 */
};
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)
{
NULL
};
- const char**list = pdc_quirk_drives;
+ const char **list = pdc_quirk_drives;
struct hd_driveid *id = drive->id;
while (*list)
{
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;
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
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);
#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
}
#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);
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;
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:
+ ;
}
}
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);
}
/* 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);
}
{
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;
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;
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);
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);
}
* 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)
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 */
}
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");
}
/*
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
}
#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;
}
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;
}
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
/* 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)
for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
ata_register_chipset(&chipsets[i]);
- return 0;
+ return 0;
}
{
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)
return ret;
}
if (!drive->channel->unmask)
- __cli(); /* local CPU only */
+ local_irq_disable();
return promise_do_write(drive, rq);
}
#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;
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;
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):
* 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.
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 ; i<raid[device].disks; i++) {
+ for (i = 1; i < raid[device].disks; i++) {
dist = raid[device].disk[i].last_pos - bh->b_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"
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;
*/
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);
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;(i<prom.raid.total_disks)&&(i<8);i++) {
- if ( (prom.raid.disk[i].channel== prom.raid.channel) &&
- (prom.raid.disk[i].device == prom.raid.device) ) {
+ in the arraydefinition, both of which are in the superblock */
+ for (i = 0; (i < prom.raid.total_disks) && (i < 8); i++) {
+ if ((prom.raid.disk[i].channel == prom.raid.channel) &&
+ (prom.raid.disk[i].device == prom.raid.device)) {
raid[device].disk[i].bdev = bdev;
- raid[device].disk[i].device = mk_kdev(major,minor);
+ raid[device].disk[i].device =
+ mk_kdev(major, minor);
raid[device].disk[i].sectors = prom.raid.disk_secs;
- raid[device].stride = (1<<prom.raid.raid0_shift);
+ raid[device].stride = (1 << prom.raid.raid0_shift);
raid[device].disks = prom.raid.total_disks;
raid[device].sectors = prom.raid.total_secs;
- raid[device].geom.heads = prom.raid.heads+1;
+ raid[device].geom.heads = prom.raid.heads + 1;
raid[device].geom.sectors = prom.raid.sectors;
- raid[device].geom.cylinders = prom.raid.cylinders+1;
- devlist[devindex].device=device;
+ raid[device].geom.cylinders =
+ prom.raid.cylinders + 1;
+ devlist[devindex].device = device;
return;
}
- }
-out:
+ }
+ out:
blkdev_put(bdev, BDEV_RAW);
}
static void __init fill_cutoff(int device)
{
- int i,j;
+ int i, j;
unsigned long smallest;
unsigned long bar;
int count;
-
+
bar = 0;
- for (i=0;i<8;i++) {
+ for (i = 0; i < 8; i++) {
smallest = ~0;
- for (j=0;j<8;j++)
- if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>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;
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;
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;
} 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;
} 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;
}
/* 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
},
};
{
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;
}
*/
ata_read(drive, id, SECTOR_WORDS);
- ide__sti(); /* local CPU only */
+ local_irq_enable();
ata_fix_driveid(id);
if (id->word156 == 0x4d42) {
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 */
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.
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.
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;
}
}
-
-
- /*
- * Probe for Q40 IDE interfaces
- */
-
+/*
+ * Probe for Q40 IDE interfaces
+ */
void q40ide_init(void)
{
int i;
/* 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
},
};
{
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;
}
/* 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
},
};
/* 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)
/* 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)
struct ata_taskfile *args = rq->special;
struct ata_channel *ch = drive->channel;
- ide__sti();
+ local_irq_enable();
spin_lock_irqsave(ch->lock, flags);
/* 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;
outw(reg, hwif->config_data+3);
}
- __restore_flags(flags); /* local CPU only */
+ local_irq_restore(flags);
}
static void trm290_selectproc(struct ata_device *drive)
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 */
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 */
/* 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)
{
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;
}
/* 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,
},
};
{
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;
}
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);
#define MAX_HWIFS 4
#endif
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
switch (base) {
#define MAX_HWIFS 4
#endif
-#define ide__sti() __sti()
-
#include <asm/arch/ide.h>
/*
#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.
# endif
#endif
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
switch (base) {
# endif
#endif
-#define ide__sti() __sti()
-
static __inline__ int
ide_default_irq (ide_ioreg_t base)
{
}
}
#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 */
# 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);
# 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);
#define MAX_HWIFS 10
#endif
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
switch (base) {
#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)
* 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.
#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; }
#define MAX_HWIFS 0
#endif
-#define ide__sti() do {} while (0)
-
/*
* We always use the new IDE port registering,
* so these are fixed here.
+++ /dev/null
-/*
- * 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 */
#define MAX_HWIFS 2
#endif
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq_hp600(ide_ioreg_t base)
{
switch (base) {
#undef MAX_HWIFS
#define MAX_HWIFS 2
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
return 0;
#undef MAX_HWIFS
#define MAX_HWIFS 2
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
return 0;
# endif
#endif
-#define ide__sti() __sti()
-
static __inline__ int ide_default_irq(ide_ioreg_t base)
{
switch (base) {