Commit e7a6bdfd authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] IDE 105

 - Rename ata-timings.h to timings.h. Same arguments as for agp.

 - Always include hdparm.h just before ide.h. Include them last where
   used. This is preparing to split out the IDE register declarations
   out of this file, since many other files in the kernel include it,
   which don't have anything to do with IDE.

 - Don't use the "IDE special" data type "byte". Just use the u8 data
   type for consistency with the rest of the kernel where applicable.
parent 81fed994
...@@ -42,10 +42,11 @@ ...@@ -42,10 +42,11 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define AEC_DRIVE_TIMING 0x40 #define AEC_DRIVE_TIMING 0x40
...@@ -167,7 +168,7 @@ static void aec62xx_tune_drive(struct ata_device *drive, unsigned char pio) ...@@ -167,7 +168,7 @@ static void aec62xx_tune_drive(struct ata_device *drive, unsigned char pio)
return; return;
} }
aec_set_drive(drive, XFER_PIO_0 + min_t(byte, pio, 5)); aec_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5));
} }
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
......
...@@ -37,12 +37,13 @@ ...@@ -37,12 +37,13 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ide.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
/* port addresses for auto-detection */ /* port addresses for auto-detection */
#define ALI_NUM_PORTS 4 #define ALI_NUM_PORTS 4
......
...@@ -26,30 +26,30 @@ ...@@ -26,30 +26,30 @@
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
static byte m5229_revision; static u8 m5229_revision;
static byte chip_is_1543c_e; static int chip_is_1543c_e;
static struct pci_dev *isa_dev; static struct pci_dev *isa_dev;
static void ali15x3_tune_drive(struct ata_device *drive, byte pio) static void ali15x3_tune_drive(struct ata_device *drive, u8 pio)
{ {
struct ata_timing *t; struct ata_timing *t;
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
int s_time, a_time, c_time; int s_time, a_time, c_time;
byte s_clc, a_clc, r_clc; u8 s_clc, a_clc, r_clc;
unsigned long flags; unsigned long flags;
int port = hwif->unit ? 0x5c : 0x58; int port = hwif->unit ? 0x5c : 0x58;
int portFIFO = hwif->unit ? 0x55 : 0x54; int portFIFO = hwif->unit ? 0x55 : 0x54;
byte cd_dma_fifo = 0; u8 cd_dma_fifo = 0;
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO); pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
else else
pio = XFER_PIO_0 + min_t(byte, pio, 4); pio = XFER_PIO_0 + min_t(u8, pio, 4);
t = ata_timing_data(pio); t = ata_timing_data(pio);
...@@ -100,15 +100,15 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio) ...@@ -100,15 +100,15 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio)
local_irq_restore(flags); local_irq_restore(flags);
} }
static int ali15x3_tune_chipset(struct ata_device *drive, byte speed) static int ali15x3_tune_chipset(struct ata_device *drive, u8 speed)
{ {
struct pci_dev *dev = drive->channel->pci_dev; struct pci_dev *dev = drive->channel->pci_dev;
byte unit = (drive->select.b.unit & 0x01); u8 unit = (drive->select.b.unit & 0x01);
byte tmpbyte = 0x00; u8 tmpbyte = 0x00;
int m5229_udma = drive->channel->unit ? 0x57 : 0x56; int m5229_udma = drive->channel->unit ? 0x57 : 0x56;
if (speed < XFER_UDMA_0) { if (speed < XFER_UDMA_0) {
byte ultra_enable = (unit) ? 0x7f : 0xf7; u8 ultra_enable = unit ? 0x7f : 0xf7;
/* /*
* clear "ultra enable" bit * clear "ultra enable" bit
*/ */
...@@ -135,7 +135,7 @@ static int ali15x3_tune_chipset(struct ata_device *drive, byte speed) ...@@ -135,7 +135,7 @@ static int ali15x3_tune_chipset(struct ata_device *drive, byte speed)
pci_write_config_byte(dev, 0x4b, tmpbyte); pci_write_config_byte(dev, 0x4b, tmpbyte);
} }
} }
#endif /* CONFIG_BLK_DEV_IDEDMA */ #endif
return ide_config_drive_speed(drive, speed); return ide_config_drive_speed(drive, speed);
} }
...@@ -212,10 +212,10 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif) ...@@ -212,10 +212,10 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
unsigned int ata66 = 0; unsigned int ata66 = 0;
byte cable_80_pin[2] = { 0, 0 }; u8 cable_80_pin[2] = { 0, 0 };
unsigned long flags; unsigned long flags;
byte tmpbyte; u8 tmpbyte;
local_irq_save(flags); local_irq_save(flags);
...@@ -305,8 +305,8 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif) ...@@ -305,8 +305,8 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif)
static void __init ali15x3_init_channel(struct ata_channel *hwif) static void __init ali15x3_init_channel(struct ata_channel *hwif)
{ {
#ifndef CONFIG_SPARC64 #ifndef CONFIG_SPARC64
byte ideic, inmir; u8 ideic, inmir;
byte irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, u8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6,
1, 11, 0, 12, 0, 14, 0, 15 }; 1, 11, 0, 12, 0, 14, 0, 15 };
hwif->irq = hwif->unit ? 15 : 14; hwif->irq = hwif->unit ? 15 : 14;
......
...@@ -42,11 +42,12 @@ ...@@ -42,11 +42,12 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define AMD_IDE_ENABLE (0x00 + amd_config->base) #define AMD_IDE_ENABLE (0x00 + amd_config->base)
...@@ -171,7 +172,7 @@ static void amd74xx_tune_drive(struct ata_device *drive, u8 pio) ...@@ -171,7 +172,7 @@ static void amd74xx_tune_drive(struct ata_device *drive, u8 pio)
return; return;
} }
amd_set_drive(drive, XFER_PIO_0 + min_t(byte, pio, 5)); amd_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5));
} }
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
......
...@@ -23,7 +23,10 @@ ...@@ -23,7 +23,10 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include "ata-timing.h" #include <linux/hdreg.h>
#include <linux/ide.h>
#include "timing.h"
/* /*
* PIO 0-5, MWDMA 0-2 and UDMA 0-6 timings (in nanoseconds). These were taken * PIO 0-5, MWDMA 0-2 and UDMA 0-6 timings (in nanoseconds). These were taken
......
...@@ -106,13 +106,13 @@ ...@@ -106,13 +106,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
/* /*
* This flag is set in ide.c by the parameter: ide0=cmd640_vlb * This flag is set in ide.c by the parameter: ide0=cmd640_vlb
...@@ -200,7 +200,7 @@ static struct ata_device *cmd_drives[4]; ...@@ -200,7 +200,7 @@ static struct ata_device *cmd_drives[4];
* Interface to access cmd640x registers * Interface to access cmd640x registers
*/ */
static unsigned int cmd640_key; static unsigned int cmd640_key;
static void (*put_cmd640_reg)(unsigned short reg, byte val); static void (*put_cmd640_reg)(unsigned short reg, u8 val);
static u8 (*get_cmd640_reg)(unsigned short reg); static u8 (*get_cmd640_reg)(unsigned short reg);
/* /*
...@@ -219,7 +219,7 @@ static spinlock_t cmd640_lock = SPIN_LOCK_UNLOCKED; ...@@ -219,7 +219,7 @@ static spinlock_t cmd640_lock = SPIN_LOCK_UNLOCKED;
/* PCI method 1 access */ /* PCI method 1 access */
static void put_cmd640_reg_pci1 (unsigned short reg, byte val) static void put_cmd640_reg_pci1 (unsigned short reg, u8 val)
{ {
unsigned long flags; unsigned long flags;
...@@ -641,7 +641,7 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle ...@@ -641,7 +641,7 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle
/* /*
* Drive PIO mode selection: * Drive PIO mode selection:
*/ */
static void cmd640_tune_drive(struct ata_device *drive, byte mode_wanted) static void cmd640_tune_drive(struct ata_device *drive, u8 mode_wanted)
{ {
u8 b; u8 b;
struct ata_timing *t; struct ata_timing *t;
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define CMD_DEBUG 0 #define CMD_DEBUG 0
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
* Registers and masks for easy access by drive index: * Registers and masks for easy access by drive index:
*/ */
#if 0 #if 0
static byte prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23}; static u8 prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23};
static byte prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3}; static u8 prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3};
#endif #endif
/* /*
...@@ -93,15 +93,15 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int ...@@ -93,15 +93,15 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int
{ {
unsigned long flags; unsigned long flags;
struct ata_device *drives = drive->channel->drives; struct ata_device *drives = drive->channel->drives;
byte temp_b; u8 temp_b;
static const byte setup_counts[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0}; static const u8 setup_counts[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0};
static const byte recovery_counts[] = static const u8 recovery_counts[] =
{15, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0}; {15, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0};
static const byte arttim_regs[2][2] = { static const u8 arttim_regs[2][2] = {
{ ARTTIM0, ARTTIM1 }, { ARTTIM0, ARTTIM1 },
{ ARTTIM23, ARTTIM23 } { ARTTIM23, ARTTIM23 }
}; };
static const byte drwtim_regs[2][2] = { static const u8 drwtim_regs[2][2] = {
{ DRWTIM0, DRWTIM1 }, { DRWTIM0, DRWTIM1 },
{ DRWTIM2, DRWTIM3 } { DRWTIM2, DRWTIM3 }
}; };
...@@ -142,11 +142,11 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int ...@@ -142,11 +142,11 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int
*/ */
(void) pci_read_config_byte(drive->channel->pci_dev, arttim_regs[channel][slave], &temp_b); (void) pci_read_config_byte(drive->channel->pci_dev, arttim_regs[channel][slave], &temp_b);
(void) pci_write_config_byte(drive->channel->pci_dev, arttim_regs[channel][slave], (void) pci_write_config_byte(drive->channel->pci_dev, arttim_regs[channel][slave],
((byte) setup_count) | (temp_b & 0x3f)); ((u8) setup_count) | (temp_b & 0x3f));
(void) pci_write_config_byte(drive->channel->pci_dev, drwtim_regs[channel][slave], (void) pci_write_config_byte(drive->channel->pci_dev, drwtim_regs[channel][slave],
(byte) ((active_count << 4) | recovery_count)); (u8) ((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", ((u8) 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]); cmdprintk ("Write %x to %x\n", (u8) ((active_count << 4) | recovery_count), drwtim_regs[channel][slave]);
local_irq_restore(flags); local_irq_restore(flags);
} }
...@@ -405,7 +405,7 @@ static int cmd64x_tune_chipset(struct ata_device *drive, u8 speed) ...@@ -405,7 +405,7 @@ static int cmd64x_tune_chipset(struct ata_device *drive, u8 speed)
return ide_config_drive_speed(drive, speed); return ide_config_drive_speed(drive, speed);
} }
static int cmd680_tune_chipset(struct ata_device *drive, byte speed) static int cmd680_tune_chipset(struct ata_device *drive, u8 speed)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
...@@ -520,9 +520,9 @@ static int cmd64x_udma_stop(struct ata_device *drive) ...@@ -520,9 +520,9 @@ static int cmd64x_udma_stop(struct ata_device *drive)
dma_stat = inb(dma_base+2); /* get DMA status */ dma_stat = inb(dma_base+2); /* get DMA status */
outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */
if (jack_slap) { if (jack_slap) {
byte dma_intr = 0; u8 dma_intr = 0;
byte dma_mask = (ch->unit) ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; u8 dma_mask = (ch->unit) ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0;
byte dma_reg = (ch->unit) ? ARTTIM2 : CFR; u8 dma_reg = (ch->unit) ? ARTTIM2 : CFR;
(void) pci_read_config_byte(dev, dma_reg, &dma_intr); (void) pci_read_config_byte(dev, dma_reg, &dma_intr);
/* /*
* DAMN BMIDE is not connected to PCI space! * DAMN BMIDE is not connected to PCI space!
......
...@@ -20,22 +20,22 @@ ...@@ -20,22 +20,22 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
/* /*
* Set a new transfer mode at the drive * Set a new transfer mode at the drive
*/ */
int cs5530_set_xfer_mode(struct ata_device *drive, byte mode) int cs5530_set_xfer_mode(struct ata_device *drive, u8 mode)
{ {
int error = 0; int error = 0;
...@@ -67,7 +67,7 @@ static unsigned int cs5530_pio_timings[2][5] = ...@@ -67,7 +67,7 @@ static unsigned int cs5530_pio_timings[2][5] =
* The ide_init_cs5530() routine guarantees that all drives * The ide_init_cs5530() routine guarantees that all drives
* will have valid default PIO timings set up before we get here. * will have valid default PIO timings set up before we get here.
*/ */
static void cs5530_tuneproc(struct ata_device *drive, byte pio) /* pio=255 means "autotune" */ static void cs5530_tuneproc(struct ata_device *drive, u8 pio)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
unsigned int format, basereg = CS5530_BASEREG(hwif); unsigned int format, basereg = CS5530_BASEREG(hwif);
...@@ -75,7 +75,7 @@ static void cs5530_tuneproc(struct ata_device *drive, byte pio) /* pio=255 means ...@@ -75,7 +75,7 @@ static void cs5530_tuneproc(struct ata_device *drive, byte pio) /* pio=255 means
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO); pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
else else
pio = XFER_PIO_0 + min_t(byte, pio, 4); pio = XFER_PIO_0 + min_t(u8, pio, 4);
if (!cs5530_set_xfer_mode(drive, pio)) { if (!cs5530_set_xfer_mode(drive, pio)) {
format = (inl(basereg+4) >> 31) & 1; format = (inl(basereg+4) >> 31) & 1;
...@@ -206,7 +206,7 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev) ...@@ -206,7 +206,7 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
unsigned short pcicmd = 0; unsigned short pcicmd = 0;
unsigned long flags; unsigned long flags;
pci_for_each_dev (dev) { pci_for_each_dev(dev) {
if (dev->vendor == PCI_VENDOR_ID_CYRIX) { if (dev->vendor == PCI_VENDOR_ID_CYRIX) {
switch (dev->device) { switch (dev->device) {
case PCI_DEVICE_ID_CYRIX_PCI_MASTER: case PCI_DEVICE_ID_CYRIX_PCI_MASTER:
...@@ -256,7 +256,7 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev) ...@@ -256,7 +256,7 @@ static unsigned int __init pci_init_cs5530(struct pci_dev *dev)
*/ */
pci_write_config_byte(master_0, 0x40, 0x1e); pci_write_config_byte(master_0, 0x40, 0x1e);
/* /*
* Set max PCI burst size (16-bytes seems to work best): * Set max PCI burst size (16-bytes seems to work best):
* 16bytes: set bit-1 at 0x41 (reg value of 0x16) * 16bytes: set bit-1 at 0x41 (reg value of 0x16)
* all others: clear bit-1 at 0x41, and do: * all others: clear bit-1 at 0x41, and do:
......
...@@ -47,11 +47,12 @@ ...@@ -47,11 +47,12 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
/* the current version */ /* the current version */
...@@ -141,7 +142,7 @@ static u8 calc_clk(int time, int bus_speed) ...@@ -141,7 +142,7 @@ static u8 calc_clk(int time, int bus_speed)
* for mode 3 and 4 drives 8 and 16-bit timings are the same * for mode 3 and 4 drives 8 and 16-bit timings are the same
* *
*/ */
/* FIXME: use generic ata-timings library --bkz */ /* FIXME: use generic timings library --bkz */
static void compute_clocks(u8 pio, pio_clocks_t *p_pclk) static void compute_clocks(u8 pio, pio_clocks_t *p_pclk)
{ {
struct ata_timing *t; struct ata_timing *t;
...@@ -186,8 +187,8 @@ static void compute_clocks(u8 pio, pio_clocks_t *p_pclk) ...@@ -186,8 +187,8 @@ static void compute_clocks(u8 pio, pio_clocks_t *p_pclk)
*/ */
static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single) static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single)
{ {
byte index; u8 index;
byte data; u8 data;
if (mode>2) /* make sure we set a valid mode */ if (mode>2) /* make sure we set a valid mode */
mode = 2; mode = 2;
...@@ -206,7 +207,7 @@ static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single) ...@@ -206,7 +207,7 @@ static void cy82c693_dma_enable(struct ata_device *drive, int mode, int single)
printk (KERN_INFO "%s (ch=%d, dev=%d): DMA mode is %d (single=%d)\n", drive->name, drive->channel->unit, drive->select.b.unit, (data&0x3), ((data>>2)&1)); printk (KERN_INFO "%s (ch=%d, dev=%d): DMA mode is %d (single=%d)\n", drive->name, drive->channel->unit, drive->select.b.unit, (data&0x3), ((data>>2)&1));
#endif #endif
data = (byte)mode|(byte)(single<<2); data = (u8) mode | (u8) (single << 2);
OUT_BYTE(index, CY82_INDEX_PORT); OUT_BYTE(index, CY82_INDEX_PORT);
OUT_BYTE(data, CY82_DATA_PORT); OUT_BYTE(data, CY82_DATA_PORT);
...@@ -271,7 +272,7 @@ static int cy82c693_udma_setup(struct ata_device *drive, int map) ...@@ -271,7 +272,7 @@ static int cy82c693_udma_setup(struct ata_device *drive, int map)
/* /*
* tune ide drive - set PIO mode * tune ide drive - set PIO mode
*/ */
static void cy82c693_tune_drive(struct ata_device *drive, byte pio) static void cy82c693_tune_drive(struct ata_device *drive, u8 pio)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
/* /*
* Changing this #undef to #define may solve start up problems in some systems. * Changing this #undef to #define may solve start up problems in some systems.
...@@ -66,7 +66,7 @@ static void sub22 (char b, char c) ...@@ -66,7 +66,7 @@ static void sub22 (char b, char c)
} }
} }
static void tune_dtc2278(struct ata_device *drive, byte pio) static void tune_dtc2278(struct ata_device *drive, u8 pio)
{ {
unsigned long flags; unsigned long flags;
......
...@@ -21,16 +21,16 @@ ...@@ -21,16 +21,16 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define HPT343_DEBUG_DRIVE_INFO 0 #define HPT343_DEBUG_DRIVE_INFO 0
......
...@@ -53,18 +53,17 @@ ...@@ -53,18 +53,17 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
......
...@@ -105,10 +105,10 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, ...@@ -105,10 +105,10 @@ static int hptraid_ioctl(struct inode *inode, struct file *file,
if (!loc) if (!loc)
return -EINVAL; return -EINVAL;
val = 255; val = 255;
if (put_user(val, (byte *) & loc->heads)) if (put_user(val, (u8 *) & loc->heads))
return -EFAULT; return -EFAULT;
val = 63; val = 63;
if (put_user(val, (byte *) & loc->sectors)) if (put_user(val, (u8 *) & loc->sectors))
return -EFAULT; return -EFAULT;
bios_cyl = raid[minor].sectors / 63 / 255; bios_cyl = raid[minor].sectors / 63 / 255;
if (put_user if (put_user
......
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
/* #define DEBUG */ /* remove comments for DEBUG messages */ /* #define DEBUG */ /* remove comments for DEBUG messages */
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
* bit3 (0x08): "1" 3 cycle time, "0" 2 cycle time (?) * bit3 (0x08): "1" 3 cycle time, "0" 2 cycle time (?)
*/ */
#define HT_CONFIG_PORT 0x3e6 #define HT_CONFIG_PORT 0x3e6
#define HT_CONFIG(drivea) (byte)(((drivea)->drive_data & 0xff00) >> 8) #define HT_CONFIG(drivea) (u8)(((drivea)->drive_data & 0xff00) >> 8)
/* /*
* FIFO + PREFETCH (both a/b-model) * FIFO + PREFETCH (both a/b-model)
*/ */
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
* Active Time for each drive. Smaller value gives higher speed. * Active Time for each drive. Smaller value gives higher speed.
* In case of failures you should probably fall back to a higher value. * In case of failures you should probably fall back to a higher value.
*/ */
#define HT_TIMING(drivea) (byte)((drivea)->drive_data & 0x00ff) #define HT_TIMING(drivea) (u8)((drivea)->drive_data & 0x00ff)
#define HT_TIMING_DEFAULT 0xff #define HT_TIMING_DEFAULT 0xff
/* /*
...@@ -194,7 +194,7 @@ static int __init try_to_init_ht6560b(void) ...@@ -194,7 +194,7 @@ static int __init try_to_init_ht6560b(void)
return 1; return 1;
} }
static byte ht_pio2timings(struct ata_device *drive, byte pio) static u8 ht_pio2timings(struct ata_device *drive, u8 pio)
{ {
int active_time, recovery_time; int active_time, recovery_time;
int active_cycles, recovery_cycles; int active_cycles, recovery_cycles;
...@@ -204,7 +204,7 @@ static byte ht_pio2timings(struct ata_device *drive, byte pio) ...@@ -204,7 +204,7 @@ static byte ht_pio2timings(struct ata_device *drive, byte pio)
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO); pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
else else
pio = XFER_PIO_0 + min_t(byte, pio, 4); pio = XFER_PIO_0 + min_t(u8, pio, 4);
t = ata_timing_data(pio); t = ata_timing_data(pio);
...@@ -233,7 +233,7 @@ static byte ht_pio2timings(struct ata_device *drive, byte pio) ...@@ -233,7 +233,7 @@ static byte ht_pio2timings(struct ata_device *drive, byte pio)
drive->name, pio - XFER_PIO_0, recovery_cycles, recovery_time, active_cycles, active_time); drive->name, pio - XFER_PIO_0, recovery_cycles, recovery_time, active_cycles, active_time);
#endif #endif
return (byte)((recovery_cycles << 4) | active_cycles); return (u8)((recovery_cycles << 4) | active_cycles);
} else { } else {
#ifdef DEBUG #ifdef DEBUG
...@@ -247,7 +247,7 @@ static byte ht_pio2timings(struct ata_device *drive, byte pio) ...@@ -247,7 +247,7 @@ static byte ht_pio2timings(struct ata_device *drive, byte pio)
/* /*
* Enable/Disable so called prefetch mode * Enable/Disable so called prefetch mode
*/ */
static void ht_set_prefetch(struct ata_device *drive, byte state) static void ht_set_prefetch(struct ata_device *drive, u8 state)
{ {
unsigned long flags; unsigned long flags;
int t = HT_PREFETCH_MODE << 8; int t = HT_PREFETCH_MODE << 8;
...@@ -274,10 +274,10 @@ static void ht_set_prefetch(struct ata_device *drive, byte state) ...@@ -274,10 +274,10 @@ static void ht_set_prefetch(struct ata_device *drive, byte state)
#endif #endif
} }
static void tune_ht6560b(struct ata_device *drive, byte pio) static void tune_ht6560b(struct ata_device *drive, u8 pio)
{ {
unsigned long flags; unsigned long flags;
byte timing; u8 timing;
switch (pio) { switch (pio) {
case 8: /* set prefetch off */ case 8: /* set prefetch off */
......
...@@ -377,7 +377,7 @@ icside_config_if(struct ata_device *drive, int xfer_mode) ...@@ -377,7 +377,7 @@ icside_config_if(struct ata_device *drive, int xfer_mode)
return on; return on;
} }
static int icside_set_speed(struct ata_device *drive, byte speed) static int icside_set_speed(struct ata_device *drive, u8 speed)
{ {
return icside_config_if(drive, speed); return icside_config_if(drive, speed);
} }
......
...@@ -1716,7 +1716,7 @@ void msf_from_bcd (struct atapi_msf *msf) ...@@ -1716,7 +1716,7 @@ void msf_from_bcd (struct atapi_msf *msf)
static inline static inline
void lba_to_msf (int lba, byte *m, byte *s, byte *f) void lba_to_msf(int lba, u8 *m, u8 *s, u8 *f)
{ {
lba += CD_MSF_OFFSET; lba += CD_MSF_OFFSET;
lba &= 0xffffff; /* negative lbas use only 24 bits */ lba &= 0xffffff; /* negative lbas use only 24 bits */
...@@ -1728,7 +1728,7 @@ void lba_to_msf (int lba, byte *m, byte *s, byte *f) ...@@ -1728,7 +1728,7 @@ void lba_to_msf (int lba, byte *m, byte *s, byte *f)
static inline static inline
int msf_to_lba (byte m, byte s, byte f) int msf_to_lba(u8 m, u8 s, u8 f)
{ {
return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET; return (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
} }
......
...@@ -80,7 +80,7 @@ struct ide_cd_config_flags { ...@@ -80,7 +80,7 @@ struct ide_cd_config_flags {
__u8 close_tray : 1; /* can close the tray */ __u8 close_tray : 1; /* can close the tray */
__u8 writing : 1; /* pseudo write in progress */ __u8 writing : 1; /* pseudo write in progress */
__u8 reserved : 3; __u8 reserved : 3;
byte max_speed; /* Max speed of the drive */ u8 max_speed; /* Max speed of the drive */
}; };
#define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags)) #define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
...@@ -92,7 +92,7 @@ struct ide_cd_state_flags { ...@@ -92,7 +92,7 @@ struct ide_cd_state_flags {
__u8 door_locked : 1; /* We think that the drive door is locked. */ __u8 door_locked : 1; /* We think that the drive door is locked. */
__u8 writing : 1; /* the drive is currently writing */ __u8 writing : 1; /* the drive is currently writing */
__u8 reserved : 4; __u8 reserved : 4;
byte current_speed; /* Current speed of the drive */ u8 current_speed; /* Current speed of the drive */
}; };
#define CDROM_STATE_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->state_flags)) #define CDROM_STATE_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->state_flags))
...@@ -132,7 +132,7 @@ struct atapi_toc_header { ...@@ -132,7 +132,7 @@ struct atapi_toc_header {
} __attribute__((packed)); } __attribute__((packed));
struct atapi_toc_entry { struct atapi_toc_entry {
byte reserved1; u8 reserved1;
#if defined(__BIG_ENDIAN_BITFIELD) #if defined(__BIG_ENDIAN_BITFIELD)
__u8 adr : 4; __u8 adr : 4;
__u8 control : 4; __u8 control : 4;
...@@ -142,8 +142,8 @@ struct atapi_toc_entry { ...@@ -142,8 +142,8 @@ struct atapi_toc_entry {
#else #else
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
byte track; u8 track;
byte reserved2; u8 reserved2;
union { union {
unsigned lba; unsigned lba;
struct atapi_msf msf; struct atapi_msf msf;
...@@ -176,8 +176,8 @@ struct atapi_cdrom_subchnl { ...@@ -176,8 +176,8 @@ struct atapi_cdrom_subchnl {
#else #else
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
u_char acdsc_trk; u8 acdsc_trk;
u_char acdsc_ind; u8 acdsc_ind;
union { union {
struct atapi_msf msf; struct atapi_msf msf;
int lba; int lba;
...@@ -207,7 +207,7 @@ struct atapi_capabilities_page { ...@@ -207,7 +207,7 @@ struct atapi_capabilities_page {
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
byte page_length; u8 page_length;
#if defined(__BIG_ENDIAN_BITFIELD) #if defined(__BIG_ENDIAN_BITFIELD)
__u8 reserved2 : 2; __u8 reserved2 : 2;
...@@ -435,8 +435,8 @@ struct atapi_mechstat_header { ...@@ -435,8 +435,8 @@ struct atapi_mechstat_header {
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
byte curlba[3]; u8 curlba[3];
byte nslots; u8 nslots;
__u16 slot_tablelen; __u16 slot_tablelen;
}; };
...@@ -454,7 +454,7 @@ struct atapi_slot { ...@@ -454,7 +454,7 @@ struct atapi_slot {
#error "Please fix <asm/byteorder.h>" #error "Please fix <asm/byteorder.h>"
#endif #endif
byte reserved2[3]; u8 reserved2[3];
}; };
struct atapi_changer_info { struct atapi_changer_info {
...@@ -514,13 +514,11 @@ struct cdrom_info { ...@@ -514,13 +514,11 @@ struct cdrom_info {
#define ABORTED_COMMAND 0x0b #define ABORTED_COMMAND 0x0b
#define MISCOMPARE 0x0e #define MISCOMPARE 0x0e
/* This stuff should be in cdrom.h, since it is now generic... */ /* This stuff should be in cdrom.h, since it is now generic... */
#if VERBOSE_IDE_CD_ERRORS #if VERBOSE_IDE_CD_ERRORS
/* The generic packet command opcodes for CD/DVD Logical Units, /* The generic packet command opcodes for CD/DVD Logical Units,
* From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */ * From Table 57 of the SFF8090 Ver. 3 (Mt. Fuji) draft standard. */
const struct { const struct {
unsigned short packet_command; unsigned short packet_command;
const char * const text; const char * const text;
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h>
#include <linux/buffer_head.h> /* for invalidate_bdev() */ #include <linux/buffer_head.h> /* for invalidate_bdev() */
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -245,8 +245,8 @@ typedef struct { ...@@ -245,8 +245,8 @@ typedef struct {
/* /*
* Last error information * Last error information
*/ */
byte sense_key, asc, ascq; u8 sense_key, asc, ascq;
byte ticks; /* delay this long before sending packet command */ u8 ticks; /* delay this long before sending packet command */
int progress_indication; int progress_indication;
/* /*
......
...@@ -29,8 +29,9 @@ ...@@ -29,8 +29,9 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/ide.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/mpc8xx.h> #include <asm/mpc8xx.h>
#include <asm/mmu.h> #include <asm/mmu.h>
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "ata-timing.h" #include "timing.h"
static int identify (volatile unsigned char *p); static int identify (volatile unsigned char *p);
static void print_fixed (volatile unsigned char *p); static void print_fixed (volatile unsigned char *p);
...@@ -51,7 +52,7 @@ static void print_funcid (int func); ...@@ -51,7 +52,7 @@ static void print_funcid (int func);
static int check_ide_device (unsigned long base); static int check_ide_device (unsigned long base);
static int ide_interrupt_ack(struct ata_channel *); static int ide_interrupt_ack(struct ata_channel *);
static void m8xx_ide_tuneproc(struct ata_device *drive, byte pio); static void m8xx_ide_tuneproc(struct ata_device *drive, u8 pio);
typedef struct ide_ioport_desc { typedef struct ide_ioport_desc {
unsigned long base_off; /* Offset to PCMCIA memory */ unsigned long base_off; /* Offset to PCMCIA memory */
...@@ -437,7 +438,7 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw, ...@@ -437,7 +438,7 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw,
/* Calculate PIO timings */ /* Calculate PIO timings */
static void static void
m8xx_ide_tuneproc(struct ata_device *drive, byte pio) m8xx_ide_tuneproc(struct ata_device *drive, u8 pio)
{ {
#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) #if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT)
volatile pcmconf8xx_t *pcmp; volatile pcmconf8xx_t *pcmp;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
/* /*
* This is the list of registered PCI chipset driver data structures. * This is the list of registered PCI chipset driver data structures.
*/ */
static struct ata_pci_device *ata_pci_device_list = NULL; static struct ata_pci_device *ata_pci_device_list; /* = NULL */
/* /*
* This function supplies the data necessary to detect the particular chipset. * This function supplies the data necessary to detect the particular chipset.
......
...@@ -34,8 +34,9 @@ ...@@ -34,8 +34,9 @@
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
#include <linux/adb.h> #include <linux/adb.h>
#include <linux/pmu.h> #include <linux/pmu.h>
#endif #endif
#include "ata-timing.h" #include "timing.h"
#undef IDE_PMAC_DEBUG #undef IDE_PMAC_DEBUG
...@@ -262,8 +263,8 @@ static int pmac_udma_init(struct ata_device *drive, struct request *rq); ...@@ -262,8 +263,8 @@ static int pmac_udma_init(struct ata_device *drive, struct request *rq);
static int pmac_udma_irq_status(struct ata_device *drive); static int pmac_udma_irq_status(struct ata_device *drive);
static int pmac_udma_setup(struct ata_device *drive, int map); static int pmac_udma_setup(struct ata_device *drive, int map);
static int pmac_ide_build_dmatable(struct ata_device *drive, struct request *rq, int ix, int wr); static int pmac_ide_build_dmatable(struct ata_device *drive, struct request *rq, int ix, int wr);
static int pmac_ide_tune_chipset(struct ata_device *drive, byte speed); static int pmac_ide_tune_chipset(struct ata_device *drive, u8 speed);
static void pmac_ide_tuneproc(struct ata_device *drive, byte pio); static void pmac_ide_tuneproc(struct ata_device *drive, u8 pio);
static void pmac_ide_selectproc(struct ata_device *drive); static void pmac_ide_selectproc(struct ata_device *drive);
#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
...@@ -457,7 +458,7 @@ pmac_ide_do_setfeature(struct ata_device *drive, u8 command) ...@@ -457,7 +458,7 @@ pmac_ide_do_setfeature(struct ata_device *drive, u8 command)
/* Calculate PIO timings */ /* Calculate PIO timings */
static void __pmac static void __pmac
pmac_ide_tuneproc(struct ata_device *drive, byte pio) pmac_ide_tuneproc(struct ata_device *drive, u8 pio)
{ {
struct ata_timing *t; struct ata_timing *t;
int i; int i;
...@@ -472,7 +473,7 @@ pmac_ide_tuneproc(struct ata_device *drive, byte pio) ...@@ -472,7 +473,7 @@ pmac_ide_tuneproc(struct ata_device *drive, byte pio)
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO); pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
else else
pio = XFER_PIO_0 + min_t(byte, pio, 4); pio = XFER_PIO_0 + min_t(u8, pio, 4);
t = ata_timing_data(pio); t = ata_timing_data(pio);
...@@ -523,8 +524,7 @@ pmac_ide_tuneproc(struct ata_device *drive, byte pio) ...@@ -523,8 +524,7 @@ pmac_ide_tuneproc(struct ata_device *drive, byte pio)
} }
#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
static int __pmac static int __pmac set_timings_udma(u32 *timings, u8 speed)
set_timings_udma(u32 *timings, byte speed)
{ {
unsigned rdyToPauseTicks, wrDataSetupTicks, addrTicks; unsigned rdyToPauseTicks, wrDataSetupTicks, addrTicks;
...@@ -546,7 +546,7 @@ set_timings_udma(u32 *timings, byte speed) ...@@ -546,7 +546,7 @@ set_timings_udma(u32 *timings, byte speed)
} }
static int __pmac static int __pmac
set_timings_mdma(int intf_type, u32 *timings, byte speed, int drive_cycle_time) set_timings_mdma(int intf_type, u32 *timings, u8 speed, int drive_cycle_time)
{ {
int cycleTime, accessTime, recTime; int cycleTime, accessTime, recTime;
unsigned accessTicks, recTicks; unsigned accessTicks, recTicks;
...@@ -659,7 +659,7 @@ set_timings_mdma(int intf_type, u32 *timings, byte speed, int drive_cycle_time) ...@@ -659,7 +659,7 @@ set_timings_mdma(int intf_type, u32 *timings, byte speed, int drive_cycle_time)
* our, normal mdma function is supposed to be more precise * our, normal mdma function is supposed to be more precise
*/ */
static int __pmac static int __pmac
pmac_ide_tune_chipset (struct ata_device *drive, byte speed) pmac_ide_tune_chipset (struct ata_device *drive, u8 speed)
{ {
int intf = pmac_ide_find(drive); int intf = pmac_ide_find(drive);
int unit = (drive->select.b.unit & 0x01); int unit = (drive->select.b.unit & 0x01);
...@@ -1211,8 +1211,8 @@ udma_bits_to_command(unsigned char bits, int high_speed) ...@@ -1211,8 +1211,8 @@ udma_bits_to_command(unsigned char bits, int high_speed)
static int __pmac static int __pmac
pmac_ide_mdma_enable(struct ata_device *drive, int idx) pmac_ide_mdma_enable(struct ata_device *drive, int idx)
{ {
byte bits = drive->id->dma_mword & 0x07; u8 bits = drive->id->dma_mword & 0x07;
byte feature = dma_bits_to_command(bits); u8 feature = dma_bits_to_command(bits);
u32 *timings; u32 *timings;
int drive_cycle_time; int drive_cycle_time;
struct hd_driveid *id = drive->id; struct hd_driveid *id = drive->id;
...@@ -1249,8 +1249,8 @@ pmac_ide_mdma_enable(struct ata_device *drive, int idx) ...@@ -1249,8 +1249,8 @@ pmac_ide_mdma_enable(struct ata_device *drive, int idx)
static int __pmac static int __pmac
pmac_ide_udma_enable(struct ata_device *drive, int idx, int high_speed) pmac_ide_udma_enable(struct ata_device *drive, int idx, int high_speed)
{ {
byte bits = drive->id->dma_ultra & 0x1f; u8 bits = drive->id->dma_ultra & 0x1f;
byte feature = udma_bits_to_command(bits, high_speed); u8 feature = udma_bits_to_command(bits, high_speed);
u32 *timings; u32 *timings;
int ret; int ret;
......
...@@ -827,7 +827,7 @@ typedef struct { ...@@ -827,7 +827,7 @@ typedef struct {
/* /*
* Read position information * Read position information
*/ */
byte partition; u8 partition;
unsigned int first_frame_position; /* Current block */ unsigned int first_frame_position; /* Current block */
unsigned int last_frame_position; unsigned int last_frame_position;
unsigned int blocks_in_buffer; unsigned int blocks_in_buffer;
...@@ -835,7 +835,7 @@ typedef struct { ...@@ -835,7 +835,7 @@ typedef struct {
/* /*
* Last error information * Last error information
*/ */
byte sense_key, asc, ascq; u8 sense_key, asc, ascq;
/* /*
* Character device operation * Character device operation
...@@ -1237,7 +1237,7 @@ static int idetape_chrdev_present = 0; ...@@ -1237,7 +1237,7 @@ static int idetape_chrdev_present = 0;
* DO NOT REMOVE, BUILDING A VERBOSE DEBUG SCHEME FOR ATAPI * DO NOT REMOVE, BUILDING A VERBOSE DEBUG SCHEME FOR ATAPI
*/ */
char *idetape_sense_key_verbose (byte idetape_sense_key) char *idetape_sense_key_verbose(u8 idetape_sense_key)
{ {
switch (idetape_sense_key) { switch (idetape_sense_key) {
default: { default: {
......
...@@ -49,12 +49,13 @@ ...@@ -49,12 +49,13 @@
#endif #endif
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h>
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -62,7 +63,7 @@ ...@@ -62,7 +63,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/bitops.h> #include <asm/bitops.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#include "ioctl.h" #include "ioctl.h"
...@@ -258,7 +259,7 @@ static struct ata_bit_messages ata_error_msgs[] = { ...@@ -258,7 +259,7 @@ static struct ata_bit_messages ata_error_msgs[] = {
{ MARK_ERR, MARK_ERR, "addr mark not found" } { MARK_ERR, MARK_ERR, "addr mark not found" }
}; };
static void dump_bits(struct ata_bit_messages *msgs, int nr, byte bits) static void dump_bits(struct ata_bit_messages *msgs, int nr, u8 bits)
{ {
int i; int i;
int first = 1; int first = 1;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -230,13 +230,13 @@ int ata_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned ...@@ -230,13 +230,13 @@ int ata_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
if (!loc || (drive->type != ATA_DISK && drive->type != ATA_FLOPPY)) if (!loc || (drive->type != ATA_DISK && drive->type != ATA_FLOPPY))
return -EINVAL; return -EINVAL;
if (put_user(drive->bios_head, (byte *) &loc->heads)) if (put_user(drive->bios_head, (u8 *) &loc->heads))
return -EFAULT; return -EFAULT;
if (put_user(drive->bios_sect, (byte *) &loc->sectors)) if (put_user(drive->bios_sect, (u8 *) &loc->sectors))
return -EFAULT; return -EFAULT;
if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) if (put_user(bios_cyl, (u16 *) &loc->cylinders))
return -EFAULT; return -EFAULT;
if (put_user((unsigned)drive->part[minor(inode->i_rdev)&PARTN_MASK].start_sect, if (put_user((unsigned)drive->part[minor(inode->i_rdev)&PARTN_MASK].start_sect,
...@@ -283,18 +283,18 @@ int ata_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned ...@@ -283,18 +283,18 @@ int ata_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
case HDIO_GET_NICE: case HDIO_GET_NICE:
return put_user(drive->dsc_overlap << IDE_NICE_DSC_OVERLAP | return put_user(drive->dsc_overlap | drive->atapi_overlap << 1,
drive->atapi_overlap << IDE_NICE_ATAPI_OVERLAP,
(long *) arg); (long *) arg);
case HDIO_SET_NICE: case HDIO_SET_NICE:
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
if (arg != (arg & ((1 << IDE_NICE_DSC_OVERLAP)))) if (arg != (arg & 1))
return -EPERM; return -EPERM;
drive->dsc_overlap = (arg >> IDE_NICE_DSC_OVERLAP) & 1; drive->dsc_overlap = arg & 1;
/* Only CD-ROM's and tapes support DSC overlap. */ /* Only CD-ROM's and tapes support DSC overlap. */
if (drive->dsc_overlap && !(drive->type == ATA_ROM || drive->type == ATA_TAPE)) { if (drive->dsc_overlap && !(drive->type == ATA_ROM || drive->type == ATA_TAPE)) {
drive->dsc_overlap = 0; drive->dsc_overlap = 0;
......
...@@ -33,16 +33,15 @@ ...@@ -33,16 +33,15 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/it8172/it8172_int.h> #include <asm/it8172/it8172_int.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
......
...@@ -35,12 +35,13 @@ ...@@ -35,12 +35,13 @@
#endif #endif
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h>
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/bitops.h> #include <asm/bitops.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#include "ioctl.h" #include "ioctl.h"
......
...@@ -126,7 +126,7 @@ static void __init ide_init_ns87415(struct ata_channel *hwif) ...@@ -126,7 +126,7 @@ static void __init ide_init_ns87415(struct ata_channel *hwif)
{ {
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
unsigned int ctrl, using_inta; unsigned int ctrl, using_inta;
byte progif; u8 progif;
/* Set a good latency timer and cache line size value. */ /* Set a good latency timer and cache line size value. */
(void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define OPTI621_MAX_PIO 3 #define OPTI621_MAX_PIO 3
...@@ -137,7 +137,7 @@ int reg_base; ...@@ -137,7 +137,7 @@ int reg_base;
/* there are stored pio numbers from other calls of opti621_tune_drive */ /* there are stored pio numbers from other calls of opti621_tune_drive */
static void compute_pios(struct ata_device *drive, byte pio) static void compute_pios(struct ata_device *drive, u8 pio)
/* Store values into drive->drive_data /* Store values into drive->drive_data
* second_contr - 0 for primary controller, 1 for secondary * second_contr - 0 for primary controller, 1 for secondary
* slave_drive - 0 -> pio is for master, 1 -> pio is for slave * slave_drive - 0 -> pio is for master, 1 -> pio is for slave
...@@ -178,7 +178,7 @@ static int cmpt_clk(int time, int bus_speed) ...@@ -178,7 +178,7 @@ static int cmpt_clk(int time, int bus_speed)
return ((time*bus_speed+999999)/1000000); return ((time*bus_speed+999999)/1000000);
} }
static void write_reg(byte value, int reg) static void write_reg(u8 value, int reg)
/* Write value to register reg, base of register /* Write value to register reg, base of register
* is at reg_base (0x1f0 primary, 0x170 secondary, * is at reg_base (0x1f0 primary, 0x170 secondary,
* if not changed by PCI configuration). * if not changed by PCI configuration).
...@@ -192,14 +192,14 @@ static void write_reg(byte value, int reg) ...@@ -192,14 +192,14 @@ static void write_reg(byte value, int reg)
outb(0x83, reg_base+2); outb(0x83, reg_base+2);
} }
static byte read_reg(int reg) static u8 read_reg(int reg)
/* Read value from register reg, base of register /* Read value from register reg, base of register
* is at reg_base (0x1f0 primary, 0x170 secondary, * is at reg_base (0x1f0 primary, 0x170 secondary,
* if not changed by PCI configuration). * if not changed by PCI configuration).
* This is from setupvic.exe program. * This is from setupvic.exe program.
*/ */
{ {
byte ret; u8 ret;
inw(reg_base+1); inw(reg_base+1);
inw(reg_base+1); inw(reg_base+1);
outb(3, reg_base+2); outb(3, reg_base+2);
...@@ -245,16 +245,16 @@ static void compute_clocks(int pio, pio_clocks_t *clks) ...@@ -245,16 +245,16 @@ static void compute_clocks(int pio, pio_clocks_t *clks)
} }
/* Main tune procedure, called from tuneproc. */ /* Main tune procedure, called from tuneproc. */
static void opti621_tune_drive(struct ata_device *drive, byte pio) static void opti621_tune_drive(struct ata_device *drive, u8 pio)
{ {
/* primary and secondary drives share some registers, /* primary and secondary drives share some registers,
* so we have to program both drives * so we have to program both drives
*/ */
unsigned long flags; unsigned long flags;
byte pio1, pio2; u8 pio1, pio2;
pio_clocks_t first, second; pio_clocks_t first, second;
int ax, drdy; int ax, drdy;
byte cycle1, cycle2, misc; u8 cycle1, cycle2, misc;
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
/* sets drive->drive_data for both drives */ /* sets drive->drive_data for both drives */
......
...@@ -24,10 +24,11 @@ ...@@ -24,10 +24,11 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ide.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include "ata-timing.h" #include "timing.h"
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
......
...@@ -48,16 +48,16 @@ ...@@ -48,16 +48,16 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define PDC202XX_DEBUG_DRIVE_INFO 0 #define PDC202XX_DEBUG_DRIVE_INFO 0
...@@ -105,7 +105,7 @@ static struct pdc_bit_messages pdc_reg_C[] = { ...@@ -105,7 +105,7 @@ static struct pdc_bit_messages pdc_reg_C[] = {
/* MC3-MC0 - DMA "C" timing */ /* MC3-MC0 - DMA "C" timing */
}; };
static void pdc_dump_bits(struct pdc_bit_messages *msgs, byte bits) static void pdc_dump_bits(struct pdc_bit_messages *msgs, u8 bits)
{ {
int i; int i;
...@@ -174,7 +174,7 @@ static int __init pdc202xx_modes_map(struct ata_channel *ch) ...@@ -174,7 +174,7 @@ static int __init pdc202xx_modes_map(struct ata_channel *ch)
return map; return map;
} }
static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed) static int pdc202xx_tune_chipset(struct ata_device *drive, u8 speed)
{ {
struct pci_dev *dev = drive->channel->pci_dev; struct pci_dev *dev = drive->channel->pci_dev;
u32 drive_conf; u32 drive_conf;
...@@ -315,7 +315,7 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed) ...@@ -315,7 +315,7 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed)
OUT_BYTE(value, reg); \ OUT_BYTE(value, reg); \
mdelay(delay); mdelay(delay);
static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed) static int pdc202xx_new_tune_chipset(struct ata_device *drive, u8 speed)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
u32 high_16 = pci_resource_start(hwif->pci_dev, 4); u32 high_16 = pci_resource_start(hwif->pci_dev, 4);
...@@ -453,7 +453,7 @@ static void pdc202xx_tune_drive(struct ata_device *drive, u8 pio) ...@@ -453,7 +453,7 @@ static void pdc202xx_tune_drive(struct ata_device *drive, u8 pio)
if (pio == 255) if (pio == 255)
speed = ata_best_pio_mode(drive); speed = ata_best_pio_mode(drive);
else else
speed = XFER_PIO_0 + min_t(byte, pio, 4); speed = XFER_PIO_0 + min_t(u8, pio, 4);
pdc202xx_tune_chipset(drive, speed); pdc202xx_tune_chipset(drive, speed);
} }
...@@ -695,7 +695,7 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev) ...@@ -695,7 +695,7 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev)
break; break;
default: default:
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
byte irq = 0, irq2 = 0; u8 irq = 0, irq2 = 0;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, pci_read_config_byte(dev, PCI_INTERRUPT_LINE,
&irq); &irq);
pci_read_config_byte(dev, (PCI_INTERRUPT_LINE) | 0x80, &irq2); /* 0xbc */ pci_read_config_byte(dev, (PCI_INTERRUPT_LINE) | 0x80, &irq2); /* 0xbc */
......
...@@ -175,10 +175,10 @@ static void promise_selectproc(struct ata_device *drive) ...@@ -175,10 +175,10 @@ static void promise_selectproc(struct ata_device *drive)
* by command F0. They all have the same success/failure notification - * by command F0. They all have the same success/failure notification -
* 'P' (=0x50) on success, 'p' (=0x70) on failure. * 'P' (=0x50) on success, 'p' (=0x70) on failure.
*/ */
int pdc4030_cmd(struct ata_device *drive, byte cmd) int pdc4030_cmd(struct ata_device *drive, u8 cmd)
{ {
unsigned long timeout, timer; unsigned long timeout, timer;
byte status_val; u8 status_val;
promise_selectproc(drive); /* redundant? */ promise_selectproc(drive); /* redundant? */
outb(0xF3, IDE_SECTOR_REG); outb(0xF3, IDE_SECTOR_REG);
......
...@@ -135,11 +135,11 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, ...@@ -135,11 +135,11 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file,
return -EINVAL; return -EINVAL;
if (put_user if (put_user
(raid[minor].geom.heads, (raid[minor].geom.heads,
(byte *) & loc->heads)) (u8 *) & loc->heads))
return -EFAULT; return -EFAULT;
if (put_user if (put_user
(raid[minor].geom.sectors, (raid[minor].geom.sectors,
(byte *) & loc->sectors)) (u8 *) & loc->sectors))
return -EFAULT; return -EFAULT;
if (put_user if (put_user
(bios_cyl, (unsigned short *) &loc->cylinders)) (bios_cyl, (unsigned short *) &loc->cylinders))
......
...@@ -45,11 +45,12 @@ ...@@ -45,11 +45,12 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define PIIX_IDETIM0 0x40 #define PIIX_IDETIM0 0x40
...@@ -240,7 +241,7 @@ static void piix_tune_drive(struct ata_device *drive, unsigned char pio) ...@@ -240,7 +241,7 @@ static void piix_tune_drive(struct ata_device *drive, unsigned char pio)
return; return;
} }
piix_set_drive(drive, XFER_PIO_0 + min_t(byte, pio, 5)); piix_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5));
} }
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
......
...@@ -28,9 +28,10 @@ ...@@ -28,9 +28,10 @@
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ide.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -302,18 +303,18 @@ void ide_fixstring(char *s, const int bytecount, const int byteswap) ...@@ -302,18 +303,18 @@ void ide_fixstring(char *s, const int bytecount, const int byteswap)
/* /*
* All hosts that use the 80c ribbon must use this! * All hosts that use the 80c ribbon must use this!
*/ */
byte eighty_ninty_three(struct ata_device *drive) int eighty_ninty_three(struct ata_device *drive)
{ {
return ((u8) ((drive->channel->udma_four) && return ((drive->channel->udma_four) &&
#ifndef CONFIG_IDEDMA_IVB #ifndef CONFIG_IDEDMA_IVB
(drive->id->hw_config & 0x4000) && (drive->id->hw_config & 0x4000) &&
#endif #endif
(drive->id->hw_config & 0x6000)) ? 1 : 0); (drive->id->hw_config & 0x6000)) ? 1 : 0;
} }
/* FIXME: Channel lock should be held. /* FIXME: Channel lock should be held.
*/ */
int ide_config_drive_speed(struct ata_device *drive, byte speed) int ide_config_drive_speed(struct ata_device *drive, u8 speed)
{ {
struct ata_channel *ch = drive->channel; struct ata_channel *ch = drive->channel;
int ret; int ret;
......
...@@ -29,12 +29,13 @@ ...@@ -29,12 +29,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "qd65xx.h" #include "qd65xx.h"
/* /*
...@@ -85,7 +86,7 @@ ...@@ -85,7 +86,7 @@
static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */ static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */
static void qd_write_reg(byte content, byte reg) static void qd_write_reg(u8 content, unsigned int reg)
{ {
unsigned long flags; unsigned long flags;
...@@ -95,10 +96,10 @@ static void qd_write_reg(byte content, byte reg) ...@@ -95,10 +96,10 @@ static void qd_write_reg(byte content, byte reg)
restore_flags(flags); /* all CPUs */ restore_flags(flags); /* all CPUs */
} }
byte __init qd_read_reg(byte reg) static u8 __init qd_read_reg(unsigned int reg)
{ {
unsigned long flags; unsigned long flags;
byte read; u8 read;
save_flags(flags); /* all CPUs */ save_flags(flags); /* all CPUs */
cli(); /* all CPUs */ cli(); /* all CPUs */
...@@ -115,8 +116,8 @@ byte __init qd_read_reg(byte reg) ...@@ -115,8 +116,8 @@ byte __init qd_read_reg(byte reg)
static void qd_select(struct ata_device *drive) static void qd_select(struct ata_device *drive)
{ {
byte index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) | u8 index = (((QD_TIMREG(drive)) & 0x80 ) >> 7) |
(QD_TIMREG(drive) & 0x02); (QD_TIMREG(drive) & 0x02);
if (timings[index] != QD_TIMING(drive)) if (timings[index] != QD_TIMING(drive))
qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
...@@ -130,9 +131,9 @@ static void qd_select(struct ata_device *drive) ...@@ -130,9 +131,9 @@ static void qd_select(struct ata_device *drive)
* upper nibble represents recovery time, in count of VLB clocks * upper nibble represents recovery time, in count of VLB clocks
*/ */
static byte qd6500_compute_timing(struct ata_channel *hwif, int active_time, int recovery_time) static u8 qd6500_compute_timing(struct ata_channel *hwif, int active_time, int recovery_time)
{ {
byte active_cycle,recovery_cycle; u8 active_cycle,recovery_cycle;
if (system_bus_speed <= 33333) { if (system_bus_speed <= 33333) {
active_cycle = 9 - IDE_IN(active_time * system_bus_speed / 1000000 + 1, 2, 9); active_cycle = 9 - IDE_IN(active_time * system_bus_speed / 1000000 + 1, 2, 9);
...@@ -151,12 +152,12 @@ static byte qd6500_compute_timing(struct ata_channel *hwif, int active_time, int ...@@ -151,12 +152,12 @@ static byte qd6500_compute_timing(struct ata_channel *hwif, int active_time, int
* idem for qd6580 * idem for qd6580
*/ */
static byte qd6580_compute_timing(int active_time, int recovery_time) static u8 qd6580_compute_timing(int active_time, int recovery_time)
{ {
byte active_cycle = 17 - IDE_IN(active_time * system_bus_speed / 1000000 + 1, 2, 17); u8 active_cycle = 17 - IDE_IN(active_time * system_bus_speed / 1000000 + 1, 2, 17);
byte recovery_cycle = 15 - IDE_IN(recovery_time * system_bus_speed / 1000000 + 1, 2, 15); u8 recovery_cycle = 15 - IDE_IN(recovery_time * system_bus_speed / 1000000 + 1, 2, 15);
return((recovery_cycle<<4) | active_cycle); return (recovery_cycle<<4) | active_cycle;
} }
/* /*
...@@ -205,7 +206,7 @@ static int qd_timing_ok(struct ata_device drives[]) ...@@ -205,7 +206,7 @@ static int qd_timing_ok(struct ata_device drives[])
* records the timing, and enables selectproc as needed * records the timing, and enables selectproc as needed
*/ */
static void qd_set_timing(struct ata_device *drive, byte timing) static void qd_set_timing(struct ata_device *drive, u8 timing)
{ {
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
...@@ -224,7 +225,7 @@ static void qd_set_timing(struct ata_device *drive, byte timing) ...@@ -224,7 +225,7 @@ static void qd_set_timing(struct ata_device *drive, byte timing)
* qd6500_tune_drive * qd6500_tune_drive
*/ */
static void qd6500_tune_drive(struct ata_device *drive, byte pio) static void qd6500_tune_drive(struct ata_device *drive, u8 pio)
{ {
int active_time = 175; int active_time = 175;
int recovery_time = 415; /* worst case values from the dos driver */ int recovery_time = 415; /* worst case values from the dos driver */
...@@ -245,7 +246,7 @@ static void qd6500_tune_drive(struct ata_device *drive, byte pio) ...@@ -245,7 +246,7 @@ static void qd6500_tune_drive(struct ata_device *drive, byte pio)
* qd6580_tune_drive * qd6580_tune_drive
*/ */
static void qd6580_tune_drive(struct ata_device *drive, byte pio) static void qd6580_tune_drive(struct ata_device *drive, u8 pio)
{ {
struct ata_timing *t; struct ata_timing *t;
int base = drive->channel->select_data; int base = drive->channel->select_data;
...@@ -257,7 +258,7 @@ static void qd6580_tune_drive(struct ata_device *drive, byte pio) ...@@ -257,7 +258,7 @@ static void qd6580_tune_drive(struct ata_device *drive, byte pio)
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO); pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
else else
pio = XFER_PIO_0 + min_t(byte, pio, 4); pio = XFER_PIO_0 + min_t(u8, pio, 4);
t = ata_timing_data(pio); t = ata_timing_data(pio);
...@@ -305,8 +306,8 @@ static void qd6580_tune_drive(struct ata_device *drive, byte pio) ...@@ -305,8 +306,8 @@ static void qd6580_tune_drive(struct ata_device *drive, byte pio)
static int __init qd_testreg(int port) static int __init qd_testreg(int port)
{ {
byte savereg; u8 savereg;
byte readreg; u8 readreg;
unsigned long flags; unsigned long flags;
save_flags(flags); /* all CPUs */ save_flags(flags); /* all CPUs */
...@@ -333,7 +334,7 @@ static int __init qd_testreg(int port) ...@@ -333,7 +334,7 @@ static int __init qd_testreg(int port)
* called to setup an ata channel : adjusts attributes & links for tuning * called to setup an ata channel : adjusts attributes & links for tuning
*/ */
void __init qd_setup(int unit, int base, int config, unsigned int data0, unsigned int data1, void (*tuneproc) (struct ata_device *, byte pio)) void __init qd_setup(int unit, int base, int config, unsigned int data0, unsigned int data1, void (*tuneproc) (struct ata_device *, u8 pio))
{ {
struct ata_channel *hwif = &ide_hwifs[unit]; struct ata_channel *hwif = &ide_hwifs[unit];
...@@ -354,7 +355,7 @@ void __init qd_setup(int unit, int base, int config, unsigned int data0, unsigne ...@@ -354,7 +355,7 @@ void __init qd_setup(int unit, int base, int config, unsigned int data0, unsigne
*/ */
void __init qd_unsetup(int unit) { void __init qd_unsetup(int unit) {
struct ata_channel *hwif = &ide_hwifs[unit]; struct ata_channel *hwif = &ide_hwifs[unit];
byte config = hwif->config_data; u8 config = hwif->config_data;
int base = hwif->select_data; int base = hwif->select_data;
void *tuneproc = (void *) hwif->tuneproc; void *tuneproc = (void *) hwif->tuneproc;
...@@ -390,7 +391,7 @@ void __init qd_unsetup(int unit) { ...@@ -390,7 +391,7 @@ void __init qd_unsetup(int unit) {
int __init qd_probe(int base) int __init qd_probe(int base)
{ {
byte config; u8 config;
int unit; int unit;
config = qd_read_reg(QD_CONFIG_PORT); config = qd_read_reg(QD_CONFIG_PORT);
...@@ -417,7 +418,7 @@ int __init qd_probe(int base) ...@@ -417,7 +418,7 @@ int __init qd_probe(int base)
} }
if (((config & 0xf0) == QD_CONFIG_QD6580_A) || ((config & 0xf0) == QD_CONFIG_QD6580_B)) { if (((config & 0xf0) == QD_CONFIG_QD6580_A) || ((config & 0xf0) == QD_CONFIG_QD6580_B)) {
byte control; u8 control;
if (qd_testreg(base) || qd_testreg(base+0x02)) return 1; if (qd_testreg(base) || qd_testreg(base+0x02)) return 1;
/* bad registers */ /* bad registers */
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff) #define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff)
#define QD_CONTROL(hwif) (((hwif)->config_data & 0xff00) >> 8) #define QD_CONTROL(hwif) (((hwif)->config_data & 0xff00) >> 8)
#define QD_TIMING(drive) (byte)(((drive)->drive_data) & 0x00ff) #define QD_TIMING(drive) (u8)(((drive)->drive_data) & 0x00ff)
#define QD_TIMREG(drive) (byte)((((drive)->drive_data) & 0xff00) >> 8) #define QD_TIMREG(drive) (u8)((((drive)->drive_data) & 0xff00) >> 8)
#define QD6500_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08)) #define QD6500_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08))
#define QD6580_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) #define QD6580_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00))
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ide.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -153,14 +154,14 @@ int check_drive_lists(struct ata_device *drive, int good_bad) ...@@ -153,14 +154,14 @@ int check_drive_lists(struct ata_device *drive, int good_bad)
/* Consult the list of known "good" drives */ /* Consult the list of known "good" drives */
list = good_dma_drives; list = good_dma_drives;
while (*list) { while (*list) {
if (!strcmp(*list++,id->model)) if (!strcmp(*list++, id->model))
return 1; return 1;
} }
} else { } else {
/* Consult the list of known "bad" drives */ /* Consult the list of known "bad" drives */
list = bad_dma_drives; list = bad_dma_drives;
while (*list) { while (*list) {
if (!strcmp(*list++,id->model)) { if (!strcmp(*list++, id->model)) {
printk("%s: Disabling (U)DMA for %s\n", printk("%s: Disabling (U)DMA for %s\n",
drive->name, id->model); drive->name, id->model);
return 1; return 1;
......
...@@ -85,14 +85,14 @@ ...@@ -85,14 +85,14 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/hdreg.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#undef SVWKS_DEBUG_DRIVE_INFO #undef SVWKS_DEBUG_DRIVE_INFO
......
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ide.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
/* When DEBUG is defined it outputs initial PCI config register /* When DEBUG is defined it outputs initial PCI config register
...@@ -84,7 +84,7 @@ static unsigned char chipset_family; ...@@ -84,7 +84,7 @@ static unsigned char chipset_family;
Fewer might be used depending on the actual chipset */ Fewer might be used depending on the actual chipset */
static unsigned char ide_regs_copy[0x58]; static unsigned char ide_regs_copy[0x58];
static byte sis5513_max_config_register(void) { static u8 sis5513_max_config_register(void) {
switch(chipset_family) { switch(chipset_family) {
case ATA_00: case ATA_00:
case ATA_16: return 0x4f; case ATA_16: return 0x4f;
...@@ -100,9 +100,9 @@ static byte sis5513_max_config_register(void) { ...@@ -100,9 +100,9 @@ static byte sis5513_max_config_register(void) {
/* Read config registers, print differences from previous read */ /* Read config registers, print differences from previous read */
static void sis5513_load_verify_registers(struct pci_dev* dev, char* info) { static void sis5513_load_verify_registers(struct pci_dev* dev, char* info) {
int i; int i;
byte reg_val; u8 reg_val;
byte changed=0; u8 changed = 0;
byte max = sis5513_max_config_register(); u8 max = sis5513_max_config_register();
printk("SIS5513: %s, changed registers:\n", info); printk("SIS5513: %s, changed registers:\n", info);
for(i=0; i<=max; i++) { for(i=0; i<=max; i++) {
...@@ -121,9 +121,10 @@ static void sis5513_load_verify_registers(struct pci_dev* dev, char* info) { ...@@ -121,9 +121,10 @@ static void sis5513_load_verify_registers(struct pci_dev* dev, char* info) {
} }
/* Load config registers, no printing */ /* Load config registers, no printing */
static void sis5513_load_registers(struct pci_dev* dev) { static void sis5513_load_registers(struct pci_dev* dev)
{
int i; int i;
byte max = sis5513_max_config_register(); u8 max = sis5513_max_config_register();
for(i=0; i<=max; i++) { for(i=0; i<=max; i++) {
pci_read_config_byte(dev, i, &(ide_regs_copy[i])); pci_read_config_byte(dev, i, &(ide_regs_copy[i]));
...@@ -131,14 +132,15 @@ static void sis5513_load_registers(struct pci_dev* dev) { ...@@ -131,14 +132,15 @@ static void sis5513_load_registers(struct pci_dev* dev) {
} }
/* Print a register */ /* Print a register */
static void sis5513_print_register(int reg) { static void sis5513_print_register(int reg)
{
printk(" %0#x:%0#x", reg, ide_regs_copy[reg]); printk(" %0#x:%0#x", reg, ide_regs_copy[reg]);
} }
/* Print valuable registers */ /* Print valuable registers */
static void sis5513_print_registers(struct pci_dev* dev, char* marker) { static void sis5513_print_registers(struct pci_dev* dev, char* marker) {
int i; int i;
byte max = sis5513_max_config_register(); u8 max = sis5513_max_config_register();
sis5513_load_registers(dev); sis5513_load_registers(dev);
printk("SIS5513 %s\n", marker); printk("SIS5513 %s\n", marker);
...@@ -193,9 +195,9 @@ static const struct { ...@@ -193,9 +195,9 @@ static const struct {
/* Cycle time bits and values vary accross chip dma capabilities /* Cycle time bits and values vary accross chip dma capabilities
These three arrays hold the register layout and the values to set. These three arrays hold the register layout and the values to set.
Indexed by chipset_family and (dma_mode - XFER_UDMA_0) */ Indexed by chipset_family and (dma_mode - XFER_UDMA_0) */
static byte cycle_time_offset[] = {0,0,5,4,4,0,0}; static u8 cycle_time_offset[] = {0,0,5,4,4,0,0};
static byte cycle_time_range[] = {0,0,2,3,3,4,4}; static u8 cycle_time_range[] = {0,0,2,3,3,4,4};
static byte cycle_time_value[][XFER_UDMA_5 - XFER_UDMA_0 + 1] = { static u8 cycle_time_value[][XFER_UDMA_5 - XFER_UDMA_0 + 1] = {
{0,0,0,0,0,0}, /* no udma */ {0,0,0,0,0,0}, /* no udma */
{0,0,0,0,0,0}, /* no udma */ {0,0,0,0,0,0}, /* no udma */
{3,2,1,0,0,0}, {3,2,1,0,0,0},
...@@ -317,7 +319,7 @@ static int sis5513_tune_chipset(struct ata_device *drive, u8 speed) ...@@ -317,7 +319,7 @@ static int sis5513_tune_chipset(struct ata_device *drive, u8 speed)
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
byte drive_pci, reg; u8 drive_pci, reg;
#ifdef DEBUG #ifdef DEBUG
sis5513_load_verify_registers(dev, "sis5513_tune_chipset start"); sis5513_load_verify_registers(dev, "sis5513_tune_chipset start");
...@@ -418,7 +420,7 @@ static unsigned int __init pci_init_sis5513(struct pci_dev *dev) ...@@ -418,7 +420,7 @@ static unsigned int __init pci_init_sis5513(struct pci_dev *dev)
#endif #endif
if (SiSHostChipInfo[i].flags & SIS5513_LATENCY) { if (SiSHostChipInfo[i].flags & SIS5513_LATENCY) {
byte latency = (chipset_family == ATA_100)? 0x80 : 0x10; /* Lacking specs */ u8 latency = (chipset_family == ATA_100)? 0x80 : 0x10; /* Lacking specs */
pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency); pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency);
} }
} }
...@@ -427,7 +429,7 @@ static unsigned int __init pci_init_sis5513(struct pci_dev *dev) ...@@ -427,7 +429,7 @@ static unsigned int __init pci_init_sis5513(struct pci_dev *dev)
1/ tell IDE channels to operate in Compabitility mode only 1/ tell IDE channels to operate in Compabitility mode only
2/ tell old chips to allow per drive IDE timings */ 2/ tell old chips to allow per drive IDE timings */
if (host_dev) { if (host_dev) {
byte reg; u8 reg;
switch(chipset_family) { switch(chipset_family) {
case ATA_133: case ATA_133:
case ATA_100: case ATA_100:
......
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/dma.h> #include <asm/dma.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
/* /*
...@@ -82,7 +82,7 @@ static void config_for_pio(struct ata_device *drive, int pio, int report) ...@@ -82,7 +82,7 @@ static void config_for_pio(struct ata_device *drive, int pio, int report)
if (pio == 255) if (pio == 255)
xfer_mode = ata_timing_mode(drive, XFER_PIO | XFER_EPIO); xfer_mode = ata_timing_mode(drive, XFER_PIO | XFER_EPIO);
else else
xfer_mode = XFER_PIO_0 + min_t(byte, pio, 4); xfer_mode = XFER_PIO_0 + min_t(u8, pio, 4);
t = ata_timing_data(xfer_mode); t = ata_timing_data(xfer_mode);
...@@ -258,7 +258,7 @@ static void sl82c105_lostirq(struct ata_device *drive) ...@@ -258,7 +258,7 @@ static void sl82c105_lostirq(struct ata_device *drive)
* We only deal with PIO mode here - DMA mode 'using_dma' is not * We only deal with PIO mode here - DMA mode 'using_dma' is not
* initialised at the point that this function is called. * initialised at the point that this function is called.
*/ */
static void tune_sl82c105(struct ata_device *drive, byte pio) static void tune_sl82c105(struct ata_device *drive, u8 pio)
{ {
config_for_pio(drive, pio, 1); config_for_pio(drive, pio, 1);
...@@ -320,7 +320,7 @@ static unsigned int __init sl82c105_init_chipset(struct pci_dev *dev) ...@@ -320,7 +320,7 @@ static unsigned int __init sl82c105_init_chipset(struct pci_dev *dev)
static void __init sl82c105_init_dma(struct ata_channel *ch, unsigned long dma_base) static void __init sl82c105_init_dma(struct ata_channel *ch, unsigned long dma_base)
{ {
unsigned int bridge_rev; unsigned int bridge_rev;
byte dma_state; u8 dma_state;
dma_state = inb(dma_base + 2); dma_state = inb(dma_base + 2);
bridge_rev = sl82c105_bridge_revision(ch->pci_dev); bridge_rev = sl82c105_bridge_revision(ch->pci_dev);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/delay.h> #include <asm/delay.h>
......
#ifndef _ATA_TIMING_H
#define _ATA_TIMING_H
/* /*
* $Id: ata-timing.h,v 2.0 2002/03/12 13:02:22 vojtech Exp $
*
* Copyright (C) 1996 Linus Torvalds, Igor Abramov, and Mark Lord * Copyright (C) 1996 Linus Torvalds, Igor Abramov, and Mark Lord
* Copyright (C) 1999-2001 Vojtech Pavlik * Copyright (C) 1999-2001 Vojtech Pavlik
*/ *
/*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -24,9 +17,6 @@ ...@@ -24,9 +17,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <linux/hdreg.h>
#include <linux/ide.h>
#define XFER_PIO_5 0x0d #define XFER_PIO_5 0x0d
#define XFER_UDMA_SLOW 0x4f #define XFER_UDMA_SLOW 0x4f
...@@ -91,5 +81,3 @@ extern struct ata_timing* ata_timing_data(short speed); ...@@ -91,5 +81,3 @@ extern struct ata_timing* ata_timing_data(short speed);
extern int ata_timing_compute(struct ata_device *drive, extern int ata_timing_compute(struct ata_device *drive,
short speed, struct ata_timing *t, int T, int UT); short speed, struct ata_timing *t, int T, int UT);
extern u8 ata_best_pio_mode(struct ata_device *drive); extern u8 ata_best_pio_mode(struct ata_device *drive);
#endif
...@@ -251,7 +251,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif) ...@@ -251,7 +251,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif)
{ {
unsigned int cfgbase = 0; unsigned int cfgbase = 0;
unsigned long flags; unsigned long flags;
byte reg; u8 reg;
struct pci_dev *dev = hwif->pci_dev; struct pci_dev *dev = hwif->pci_dev;
hwif->chipset = ide_trm290; hwif->chipset = ide_trm290;
......
...@@ -46,13 +46,13 @@ ...@@ -46,13 +46,13 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/init.h>
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
/* /*
* Default speeds. These can be changed with "auto-tune" and/or hdparm. * Default speeds. These can be changed with "auto-tune" and/or hdparm.
...@@ -62,11 +62,11 @@ ...@@ -62,11 +62,11 @@
#define UMC_DRIVE2 1 /* 11 = Fastest Speed */ #define UMC_DRIVE2 1 /* 11 = Fastest Speed */
#define UMC_DRIVE3 1 /* In case of crash reduce speed */ #define UMC_DRIVE3 1 /* In case of crash reduce speed */
static byte current_speeds[4] = {UMC_DRIVE0, UMC_DRIVE1, UMC_DRIVE2, UMC_DRIVE3}; static u8 current_speeds[4] = {UMC_DRIVE0, UMC_DRIVE1, UMC_DRIVE2, UMC_DRIVE3};
static const byte pio_to_umc [5] = {0,3,7,10,11}; /* rough guesses */ static const u8 pio_to_umc[5] = {0,3,7,10,11}; /* rough guesses */
/* 0 1 2 3 4 5 6 7 8 9 10 11 */ /* 0 1 2 3 4 5 6 7 8 9 10 11 */
static const byte speedtab [3][12] = { static const u8 speedtab[3][12] = {
{0xf, 0xb, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, {0xf, 0xb, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 },
{0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, {0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 },
{0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}}; {0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}};
...@@ -77,13 +77,13 @@ static void out_umc (char port,char wert) ...@@ -77,13 +77,13 @@ static void out_umc (char port,char wert)
outb_p (wert,0x109); outb_p (wert,0x109);
} }
static inline byte in_umc (char port) static inline u8 in_umc (char port)
{ {
outb_p (port,0x108); outb_p (port,0x108);
return inb_p (0x109); return inb_p (0x109);
} }
static void umc_set_speeds (byte speeds[]) static void umc_set_speeds(u8 speeds[])
{ {
int i, tmp; int i, tmp;
...@@ -106,14 +106,14 @@ static void umc_set_speeds (byte speeds[]) ...@@ -106,14 +106,14 @@ static void umc_set_speeds (byte speeds[])
speeds[0], speeds[1], speeds[2], speeds[3]); speeds[0], speeds[1], speeds[2], speeds[3]);
} }
static void tune_umc(struct ata_device *drive, byte pio) static void tune_umc(struct ata_device *drive, u8 pio)
{ {
unsigned long flags; unsigned long flags;
if (pio == 255) if (pio == 255)
pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0; pio = ata_timing_mode(drive, XFER_PIO | XFER_EPIO) - XFER_PIO_0;
else else
pio = min_t(byte, pio, 4); pio = min_t(u8, pio, 4);
printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]); printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]);
save_flags(flags); /* all CPUs */ save_flags(flags); /* all CPUs */
......
...@@ -65,11 +65,12 @@ ...@@ -65,11 +65,12 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/ide.h> #include <linux/ide.h>
#include <asm/io.h> #include <asm/io.h>
#include "ata-timing.h" #include "timing.h"
#include "pcihost.h" #include "pcihost.h"
#define VIA_IDE_ENABLE 0x40 #define VIA_IDE_ENABLE 0x40
...@@ -217,7 +218,7 @@ static void via82cxxx_tune_drive(struct ata_device *drive, unsigned char pio) ...@@ -217,7 +218,7 @@ static void via82cxxx_tune_drive(struct ata_device *drive, unsigned char pio)
return; return;
} }
via_set_drive(drive, XFER_PIO_0 + min_t(byte, pio, 5)); via_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5));
} }
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/buffer_head.h> /* for invalidate_bdev() */ #include <linux/buffer_head.h> /* for invalidate_bdev() */
#ifdef CONFIG_BLK_DEV_IDE #ifdef CONFIG_BLK_DEV_IDE
#include <linux/hdreg.h>
#include <linux/ide.h> /* IDE xlate */ #include <linux/ide.h> /* IDE xlate */
#elif defined(CONFIG_BLK_DEV_IDE_MODULE) #elif defined(CONFIG_BLK_DEV_IDE_MODULE)
#include <linux/module.h> #include <linux/module.h>
......
...@@ -285,8 +285,8 @@ struct ata_device { ...@@ -285,8 +285,8 @@ struct ata_device {
unsigned long sleep; /* sleep until this time */ unsigned long sleep; /* sleep until this time */
byte retry_pio; /* retrying dma capable host in pio */ u8 retry_pio; /* retrying dma capable host in pio */
byte state; /* retry state */ u8 state; /* retry state */
unsigned using_dma : 1; /* disk is using dma for read/write */ unsigned using_dma : 1; /* disk is using dma for read/write */
unsigned using_tcq : 1; /* disk is using queueing */ unsigned using_tcq : 1; /* disk is using queueing */
...@@ -307,20 +307,20 @@ struct ata_device { ...@@ -307,20 +307,20 @@ struct ata_device {
unsigned remap_0_to_1 : 2; /* 0=remap if ezdrive, 1=remap, 2=noremap */ unsigned remap_0_to_1 : 2; /* 0=remap if ezdrive, 1=remap, 2=noremap */
unsigned ata_flash : 1; /* 1=present, 0=default */ unsigned ata_flash : 1; /* 1=present, 0=default */
unsigned addressing; /* : 2; 0=28-bit, 1=48-bit, 2=64-bit */ unsigned addressing; /* : 2; 0=28-bit, 1=48-bit, 2=64-bit */
byte scsi; /* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */ u8 scsi; /* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */
select_t select; /* basic drive/head select reg value */ select_t select; /* basic drive/head select reg value */
u8 status; /* last retrived status value for device */ u8 status; /* last retrived status value for device */
byte ready_stat; /* min status value for drive ready */ u8 ready_stat; /* min status value for drive ready */
byte mult_count; /* current multiple sector setting */ u8 mult_count; /* current multiple sector setting */
byte bad_wstat; /* used for ignoring WRERR_STAT */ u8 bad_wstat; /* used for ignoring WRERR_STAT */
byte nowerr; /* used for ignoring WRERR_STAT */ u8 nowerr; /* used for ignoring WRERR_STAT */
byte sect0; /* offset of first sector for DM6:DDO */ u8 sect0; /* offset of first sector for DM6:DDO */
byte head; /* "real" number of heads */ u8 head; /* "real" number of heads */
byte sect; /* "real" sectors per track */ u8 sect; /* "real" sectors per track */
byte bios_head; /* BIOS/fdisk/LILO number of heads */ u8 bios_head; /* BIOS/fdisk/LILO number of heads */
byte bios_sect; /* BIOS/fdisk/LILO sectors per track */ u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */
unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */
unsigned int cyl; /* "real" number of cyls */ unsigned int cyl; /* "real" number of cyls */
u64 capacity; /* total number of sectors */ u64 capacity; /* total number of sectors */
...@@ -343,13 +343,12 @@ struct ata_device { ...@@ -343,13 +343,12 @@ struct ata_device {
int lun; /* logical unit */ int lun; /* logical unit */
int crc_count; /* crc counter to reduce drive speed */ int crc_count; /* crc counter to reduce drive speed */
byte quirk_list; /* drive is considered quirky if set for a specific host */ int quirk_list; /* drive is considered quirky if set for a specific host */
byte suspend_reset; /* drive suspend mode flag, soft-reset recovers */ u8 current_speed; /* current transfer rate set */
byte current_speed; /* current transfer rate set */ u8 dn; /* now wide spread use */
byte dn; /* now wide spread use */ u8 wcache; /* status of write cache */
byte wcache; /* status of write cache */ u8 acoustic; /* acoustic management */
byte acoustic; /* acoustic management */ unsigned int queue_depth; /* max queue depth */
byte queue_depth; /* max queue depth */
unsigned int failures; /* current failure count */ unsigned int failures; /* current failure count */
unsigned int max_failures; /* maximum allowed failure count */ unsigned int max_failures; /* maximum allowed failure count */
struct device dev; /* global device tree handle */ struct device dev; /* global device tree handle */
...@@ -370,7 +369,7 @@ typedef enum { ...@@ -370,7 +369,7 @@ typedef enum {
ATA_OP_FINISHED, /* no drive operation was started */ ATA_OP_FINISHED, /* no drive operation was started */
ATA_OP_CONTINUES, /* a drive operation was started, and a handler was set */ ATA_OP_CONTINUES, /* a drive operation was started, and a handler was set */
ATA_OP_RELEASED, /* started and released bus */ ATA_OP_RELEASED, /* started and released bus */
ATA_OP_READY, /* indicate status poll finished fine */ ATA_OP_READY /* indicate status poll finished fine */
} ide_startstop_t; } ide_startstop_t;
/* /*
...@@ -428,10 +427,10 @@ struct ata_channel { ...@@ -428,10 +427,10 @@ struct ata_channel {
*/ */
/* setup disk on a channel for a particular PIO transfer mode */ /* setup disk on a channel for a particular PIO transfer mode */
void (*tuneproc) (struct ata_device *, byte pio); void (*tuneproc) (struct ata_device *, u8 pio);
/* setup the chipset timing for a particular transfer mode */ /* setup the chipset timing for a particular transfer mode */
int (*speedproc) (struct ata_device *, byte pio); int (*speedproc) (struct ata_device *, u8 pio);
/* tweaks hardware to select drive */ /* tweaks hardware to select drive */
void (*selectproc) (struct ata_device *); void (*selectproc) (struct ata_device *);
...@@ -640,10 +639,8 @@ extern void ata_read(struct ata_device *, void *, unsigned int); ...@@ -640,10 +639,8 @@ extern void ata_read(struct ata_device *, void *, unsigned int);
extern void ata_write(struct ata_device *, void *, unsigned int); extern void ata_write(struct ata_device *, void *, unsigned int);
extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *, char *); extern int ide_raw_taskfile(struct ata_device *, struct ata_taskfile *, char *);
extern int ide_config_drive_speed(struct ata_device *, byte); extern int ide_config_drive_speed(struct ata_device *, u8);
extern byte eighty_ninty_three(struct ata_device *); extern int eighty_ninty_three(struct ata_device *);
extern void ide_stall_queue(struct ata_device *, unsigned long);
extern int system_bus_speed; extern int system_bus_speed;
...@@ -656,11 +653,11 @@ extern int system_bus_speed; ...@@ -656,11 +653,11 @@ extern int system_bus_speed;
extern int drive_is_flashcard(struct ata_device *); extern int drive_is_flashcard(struct ata_device *);
int ide_spin_wait_hwgroup(struct ata_device *); extern int ide_spin_wait_hwgroup(struct ata_device *);
void ide_timer_expiry (unsigned long data); extern void ide_timer_expiry(unsigned long data);
extern void ata_irq_request(int irq, void *data, struct pt_regs *regs); extern void ata_irq_request(int irq, void *data, struct pt_regs *regs);
void do_ide_request (request_queue_t * q); extern void do_ide_request(request_queue_t * q);
void ide_init_subdrivers (void); extern void ide_init_subdrivers(void);
extern struct block_device_operations ide_fops[]; extern struct block_device_operations ide_fops[];
...@@ -742,12 +739,12 @@ static inline int udma_irq_status(struct ata_device *drive) ...@@ -742,12 +739,12 @@ static inline int udma_irq_status(struct ata_device *drive)
static inline void udma_timeout(struct ata_device *drive) static inline void udma_timeout(struct ata_device *drive)
{ {
return drive->channel->udma_timeout(drive); drive->channel->udma_timeout(drive);
} }
static inline void udma_irq_lost(struct ata_device *drive) static inline void udma_irq_lost(struct ata_device *drive)
{ {
return drive->channel->udma_irq_lost(drive); drive->channel->udma_irq_lost(drive);
} }
#ifdef CONFIG_BLK_DEV_IDEDMA #ifdef CONFIG_BLK_DEV_IDEDMA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment