diff options
| author | Martin Dalecki <dalecki@evision-ventures.com> | 2002-05-17 09:46:39 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-05-17 09:46:39 -0700 |
| commit | 938f5b7250c5dcba9610b0936d50b2d5bb968d72 (patch) | |
| tree | 9efffe5537c82f9af656a47e417c15e4f4127e4a /include | |
| parent | 33f18d46f2a61a15cf501cd2baab4c26583a84bc (diff) | |
[PATCH] 2.5.15 IDE 61
- Fix typo in pdc202xx driver.
- Fix locking order in ioctl.
- Fix wrong time_after usage introduced in 60. Maybe the fact I always get is
wrong is related to the fact that I'm using the mouse with the left hand!?
- Apply arch-clean-2 by Bartlomiej Zolnierkiewicz.
- Don't disable interrupts during ide_wait_stat(). I see no reason too.
- Push flags down from hwgroup to the ata_chaannel structure.
- Apply small fixes from Franz Sirl to make AEC6280 working properly again.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-alpha/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-arm/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-cris/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-i386/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-ia64/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-m68k/ide.h | 11 | ||||
| -rw-r--r-- | include/asm-mips/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-mips64/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-parisc/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-ppc/ide.h | 6 | ||||
| -rw-r--r-- | include/asm-ppc64/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-s390/ide.h | 8 | ||||
| -rw-r--r-- | include/asm-s390x/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-sh/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-sparc/ide.h | 5 | ||||
| -rw-r--r-- | include/asm-sparc64/ide.h | 4 | ||||
| -rw-r--r-- | include/asm-x86_64/ide.h | 4 | ||||
| -rw-r--r-- | include/linux/ide.h | 82 |
18 files changed, 55 insertions, 109 deletions
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h index 4167b025a5b6..5cfd7f3b89a7 100644 --- a/include/asm-alpha/ide.h +++ b/include/asm-alpha/ide.h @@ -82,10 +82,6 @@ static __inline__ void ide_init_default_hwifs(void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASMalpha_IDE_H */ diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index 82ed11237b3f..f1cbbe4876ea 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h @@ -21,10 +21,6 @@ #include <asm/arch/ide.h> -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - /* * We always use the new IDE port registering, * so these are fixed here. diff --git a/include/asm-cris/ide.h b/include/asm-cris/ide.h index 3020c195706c..ac8dc923acc2 100644 --- a/include/asm-cris/ide.h +++ b/include/asm-cris/ide.h @@ -96,10 +96,6 @@ static __inline__ void ide_init_default_hwifs(void) #undef SUPPORT_SLOW_DATA_PORTS #define SUPPORT_SLOW_DATA_PORTS 0 -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - /* the drive addressing is done through a controller register on the Etrax CPU */ void OUT_BYTE(unsigned char data, ide_ioreg_t reg); unsigned char IN_BYTE(ide_ioreg_t reg); diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index f1a0bc9ccb04..6c410e682431 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h @@ -86,10 +86,6 @@ static __inline__ void ide_init_default_hwifs(void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASMi386_IDE_H */ diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h index 6be45989f7a3..cdff475469a7 100644 --- a/include/asm-ia64/ide.h +++ b/include/asm-ia64/ide.h @@ -92,10 +92,6 @@ ide_init_default_hwifs (void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASM_IA64_IDE_H */ diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index af415f72c463..07da86fbd6be 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -145,10 +145,13 @@ static __inline__ void ide_init_default_hwifs(void) #endif /* CONFIG_ATARI || CONFIG_Q40 */ +#define ATA_ARCH_ACK_INTR + +#ifdef CONFIG_ATARI +#define ATA_ARCH_LOCK static __inline__ void ide_release_lock (int *ide_lock) { -#ifdef CONFIG_ATARI if (MACH_IS_ATARI) { if (*ide_lock == 0) { printk("ide_release_lock: bug\n"); @@ -157,12 +160,10 @@ static __inline__ void ide_release_lock (int *ide_lock) *ide_lock = 0; stdma_release(); } -#endif /* CONFIG_ATARI */ } static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, struct pt_regs *), void *data) { -#ifdef CONFIG_ATARI if (MACH_IS_ATARI) { if (*ide_lock == 0) { if (in_interrupt() > 0) @@ -171,10 +172,8 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, *ide_lock = 1; } } -#endif /* CONFIG_ATARI */ } - -#define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1) +#endif /* CONFIG_ATARI */ /* * On the Atari, we sometimes can't enable interrupts: diff --git a/include/asm-mips/ide.h b/include/asm-mips/ide.h index 5fa87ce4a5c4..4ad64b0cca63 100644 --- a/include/asm-mips/ide.h +++ b/include/asm-mips/ide.h @@ -68,10 +68,6 @@ static __inline__ void ide_init_default_hwifs(void) #undef SUPPORT_VLB_SYNC #define SUPPORT_VLB_SYNC 0 -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASM_IDE_H */ diff --git a/include/asm-mips64/ide.h b/include/asm-mips64/ide.h index 1a001d4f8ac9..795b1fda8151 100644 --- a/include/asm-mips64/ide.h +++ b/include/asm-mips64/ide.h @@ -68,10 +68,6 @@ static __inline__ void ide_init_default_hwifs(void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASM_IDE_H */ diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index 640a4a2682cf..2e6442d0e8e1 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h @@ -81,10 +81,6 @@ static __inline__ void ide_init_default_hwifs(void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASMi386_IDE_H */ diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index a91a609cf2ba..616d7b87994e 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -108,12 +108,8 @@ static __inline__ void ide_init_default_hwifs(void) } #if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE ) -#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) -#else -#define ide_ack_intr(hwif) (1) +#define ATA_ARCH_ACK_INTR #endif -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) #endif /* __KERNEL__ */ diff --git a/include/asm-ppc64/ide.h b/include/asm-ppc64/ide.h index d013e70b10ec..4752dee41b2f 100644 --- a/include/asm-ppc64/ide.h +++ b/include/asm-ppc64/ide.h @@ -50,10 +50,6 @@ static __inline__ void ide_init_default_hwifs(void) { } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASMPPC64_IDE_H */ diff --git a/include/asm-s390/ide.h b/include/asm-s390/ide.h index baa9c84a7dfd..b5ca760a3097 100644 --- a/include/asm-s390/ide.h +++ b/include/asm-s390/ide.h @@ -18,14 +18,6 @@ #define ide__sti() do {} while (0) /* - * The following are not needed for the non-m68k ports - */ -#define ide_ack_intr(hwif) (1) -#define ide_fix_driveid(id) do {} while (0) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - -/* * We always use the new IDE port registering, * so these are fixed here. */ diff --git a/include/asm-s390x/ide.h b/include/asm-s390x/ide.h index cdb028ae939e..b5ca760a3097 100644 --- a/include/asm-s390x/ide.h +++ b/include/asm-s390x/ide.h @@ -17,10 +17,6 @@ #define ide__sti() do {} while (0) -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - /* * We always use the new IDE port registering, * so these are fixed here. diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h index 527e3b77422c..fea8b6f84351 100644 --- a/include/asm-sh/ide.h +++ b/include/asm-sh/ide.h @@ -107,10 +107,6 @@ static __inline__ void ide_init_default_hwifs(void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASM_SH_IDE_H */ diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index 1ca23951e680..54a01e5ea900 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h @@ -165,11 +165,6 @@ static __inline__ void ide_outsw(unsigned long port, /* __flush_dcache_range((unsigned long)src, end); */ /* P3 see hme */ } -#define ide_ack_intr(hwif) (1) -/* #define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1) */ -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* _SPARC_IDE_H */ diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h index b97fdb93b4db..4ec8fb624505 100644 --- a/include/asm-sparc64/ide.h +++ b/include/asm-sparc64/ide.h @@ -181,10 +181,6 @@ static __inline__ void ide_outsw(unsigned long port, #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* _SPARC64_IDE_H */ diff --git a/include/asm-x86_64/ide.h b/include/asm-x86_64/ide.h index f1a0bc9ccb04..6c410e682431 100644 --- a/include/asm-x86_64/ide.h +++ b/include/asm-x86_64/ide.h @@ -86,10 +86,6 @@ static __inline__ void ide_init_default_hwifs(void) #endif } -#define ide_ack_intr(hwif) (1) -#define ide_release_lock(lock) do {} while (0) -#define ide_get_lock(lock, hdlr, data) do {} while (0) - #endif /* __KERNEL__ */ #endif /* __ASMi386_IDE_H */ diff --git a/include/linux/ide.h b/include/linux/ide.h index f43f83e807f9..be467744a615 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -239,6 +239,19 @@ void ide_setup_ports(hw_regs_t *hw, #include <asm/ide.h> +/* Currently only m68k, apus and m8xx need it */ +#ifdef ATA_ARCH_ACK_INTR +# define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) +#else +# define ide_ack_intr(hwif) (1) +#endif + +/* Currently only Atari needs it */ +#ifndef ATA_ARCH_LOCK +# define ide_release_lock(lock) do {} while (0) +# define ide_get_lock(lock, hdlr, data) do {} while (0) +#endif + /* * If the arch-dependant ide.h did not declare/define any OUT_BYTE or IN_BYTE * functions, we make some defaults here. The only architecture currently @@ -324,14 +337,16 @@ struct ata_device { * magically just go away. */ request_queue_t queue; /* per device request queue */ + struct request *rq; /* current request */ unsigned long sleep; /* sleep until this time */ - byte using_dma; /* disk is using dma for read/write */ - byte using_tcq; /* disk is using queueing */ byte retry_pio; /* retrying dma capable host in pio */ byte state; /* retry state */ - byte dsc_overlap; /* flag: DSC overlap */ + + unsigned using_dma : 1; /* disk is using dma for read/write */ + unsigned using_tcq : 1; /* disk is using queueing */ + unsigned dsc_overlap : 1; /* flag: DSC overlap */ unsigned waiting_for_dma: 1; /* dma currently in progress */ unsigned busy : 1; /* currently doing revalidate_disk() */ @@ -403,11 +418,39 @@ struct ata_device { int max_depth; } ide_drive_t; +/* + * Status returned by various functions. + */ +typedef enum { + ide_stopped, /* no drive operation was started */ + ide_started, /* a drive operation was started, and a handler was set */ + ide_released /* started and released bus */ +} ide_startstop_t; + +/* + * Interrupt and timeout handler type. + */ +typedef ide_startstop_t (ata_handler_t)(struct ata_device *, struct request *); +typedef int (ata_expiry_t)(struct ata_device *, struct request *); + enum { ATA_PRIMARY = 0, ATA_SECONDARY = 1 }; +enum { + IDE_BUSY, /* awaiting an interrupt */ + IDE_SLEEP, + IDE_DMA /* DMA in progress */ +}; + +typedef struct hwgroup_s { + /* FIXME: We should look for busy request queues instead of looking at + * the !NULL state of this field. + */ + ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */ +} ide_hwgroup_t; + struct ata_channel { struct device dev; /* device handle */ int unit; /* channel number */ @@ -415,7 +458,9 @@ struct ata_channel { struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ struct timer_list timer; /* failsafe timer */ int (*expiry)(struct ata_device *, struct request *); /* irq handler, if active */ + unsigned long poll_timeout; /* timeout value during polled operations */ struct ata_device *drive; /* last serviced drive */ + unsigned long active; /* active processing request */ ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ hw_regs_t hw; /* Hardware info */ @@ -506,9 +551,8 @@ struct ata_channel { #endif /* driver soft-power interface */ int (*busproc)(struct ata_device *, int); - byte bus_state; /* power state of the IDE bus */ - unsigned long poll_timeout; /* timeout value during polled operations */ + byte bus_state; /* power state of the IDE bus */ }; /* @@ -517,27 +561,8 @@ struct ata_channel { extern int ide_register_hw(hw_regs_t *hw, struct ata_channel **hwifp); extern void ide_unregister(struct ata_channel *hwif); -/* - * Status returned by various functions. - */ -typedef enum { - ide_stopped, /* no drive operation was started */ - ide_started, /* a drive operation was started, and a handler was set */ - ide_released /* started and released bus */ -} ide_startstop_t; - -/* - * Interrupt and timeout handler type. - */ -typedef ide_startstop_t (ata_handler_t)(struct ata_device *, struct request *); -typedef int (ata_expiry_t)(struct ata_device *, struct request *); - struct ata_taskfile; -#define IDE_BUSY 0 /* awaiting an interrupt */ -#define IDE_SLEEP 1 -#define IDE_DMA 2 /* DMA in progress */ - #define IDE_MAX_TAG 32 #ifdef CONFIG_BLK_DEV_IDE_TCQ @@ -561,15 +586,6 @@ static inline int ata_can_queue(struct ata_device *drive) # define ata_can_queue(drive) (1) #endif -typedef struct hwgroup_s { - /* FIXME: We should look for busy request queues instead of looking at - * the !NULL state of this field. - */ - ide_startstop_t (*handler)(struct ata_device *, struct request *); /* irq handler, if active */ - unsigned long flags; /* BUSY, SLEEPING */ - struct request *rq; /* current request */ -} ide_hwgroup_t; - /* FIXME: kill this as soon as possible */ #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; |
