From 44a59ad59f4285ce91e61f05e65a3e8fd0943c85 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:29 +0200 Subject: ide: remove unused ->next field from ide_pci_device_t Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 19db0a4ae44..fdd09747305 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1278,7 +1278,6 @@ typedef struct ide_pci_device_s { void (*fixup)(ide_hwif_t *); ide_pci_enablebit_t enablebits[2]; unsigned int extra; - struct ide_pci_device_s *next; u32 host_flags; u8 pio_mask; u8 swdma_mask; -- cgit v1.2.3 From 528a572daea90aa41db92683e5a8756acef514c4 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:30 +0200 Subject: ide: add ->chipset field to ide_pci_device_t Add ->chipset field to ide_pci_device_t and use it in ide_hwif_configure() to set hwif->chipset. Convert cmd64x, cy82c693, rz1000 and trm290 host drivers to use this new ability. While at it define hwif_chipset_t as u8 to save some space in hw_regs_t, ide_hwif_t and ide_pci_device_t instances. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index fdd09747305..b676e51d74f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -200,14 +200,16 @@ typedef int (ide_ack_intr_t)(struct hwif_s *); * hwif_chipset_t is used to keep track of the specific hardware * chipset used by each IDE interface, if known. */ -typedef enum { ide_unknown, ide_generic, ide_pci, +enum { ide_unknown, ide_generic, ide_pci, ide_cmd640, ide_dtc2278, ide_ali14xx, ide_qd65xx, ide_umc8672, ide_ht6560b, ide_rz1000, ide_trm290, ide_cmd646, ide_cy82c693, ide_4drives, ide_pmac, ide_etrax100, ide_acorn, ide_au1xxx, ide_forced -} hwif_chipset_t; +}; + +typedef u8 hwif_chipset_t; /* * Structure to hold all information about the location of this port @@ -1277,6 +1279,7 @@ typedef struct ide_pci_device_s { void (*init_dma)(ide_hwif_t *, unsigned long); void (*fixup)(ide_hwif_t *); ide_pci_enablebit_t enablebits[2]; + hwif_chipset_t chipset; unsigned int extra; u32 host_flags; u8 pio_mask; -- cgit v1.2.3 From 8acf28c090f0e5e049f56b27bdd7cf1fb40c6b98 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:30 +0200 Subject: ide: add IDE_HFLAG_FORCE_LEGACY_IRQS host flag Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag to tell ide_pci_setup_ports() to always set hwif->irq to legacy IRQ 14/15 and convert generic IDE PCI and via82cxxx host drivers to use it. While at it: * Add IDE_HFLAGS_UMC define (generic IDE PCI host driver). * Remove no longer needed init_hwif_generic() (generic IDE PCI host driver). * Set d->udma_mask instead of hwif->ultra_mask (via82cxxx host driver). Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index b676e51d74f..ff9d293f9ae 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1263,6 +1263,8 @@ enum { IDE_HFLAG_SERIALIZE = (1 << 20), /* use legacy IRQs */ IDE_HFLAG_LEGACY_IRQS = (1 << 21), + /* force use of legacy IRQs */ + IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), }; #ifdef CONFIG_BLK_DEV_OFFBOARD -- cgit v1.2.3 From 272a370900e5d2ae84662338397bb7b2375ff5cf Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:30 +0200 Subject: ide: add IDE_HFLAG_RQSIZE_256 host flag Add IDE_HFLAG_RQSIZE_256 host flag to tell ide_pci_setup_ports() to set hwif->rqsize to 256 sectors. Convert pdc202xx_old host driver to use it. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index ff9d293f9ae..c5b52dd16a8 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1265,6 +1265,8 @@ enum { IDE_HFLAG_LEGACY_IRQS = (1 << 21), /* force use of legacy IRQs */ IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), + /* limit LBA48 requests to 256 sectors */ + IDE_HFLAG_RQSIZE_256 = (1 << 23), }; #ifdef CONFIG_BLK_DEV_OFFBOARD -- cgit v1.2.3 From caea7602f309cbd55ba609800fd3c3e5d19ab684 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:30 +0200 Subject: ide: add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flags Add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flag to tell ide_pci_setup_ports() to set drive->{io_32bit,unmask} for both drives on the interface. Convert amd74xx, sl82c105 and via82cxxx host drivers to use these new host flags. While at it: * Add IDE_HFLAGS_AMD define (amd74xx host driver). * Add IDE_HFLAGS_VIA define (via82cxxx host driver). Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index c5b52dd16a8..258a15cc274 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1267,6 +1267,10 @@ enum { IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), /* limit LBA48 requests to 256 sectors */ IDE_HFLAG_RQSIZE_256 = (1 << 23), + /* use 32-bit I/O ops */ + IDE_HFLAG_IO_32BIT = (1 << 24), + /* unmask IRQs */ + IDE_HFLAG_UNMASK_IRQS = (1 << 25), }; #ifdef CONFIG_BLK_DEV_OFFBOARD -- cgit v1.2.3 From fd9bb53942a7ca3398a63f2c238afd8fbed3ec0e Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:31 +0200 Subject: ide: add ->fixup method to ide_hwif_t * Add ->fixup method to ide_hwif_t. * Set hwif->fixup in ide_pci_setup_ports() to d->fixup. * Use hwif->fixup in probe_hwif(). * Use probe_hwif_init() instead of probe_hwif_init_with_fixup() in ide_setup_pci_device(). * Add 'fixup' argument to ide_register_hw() and use it to set hwif->fixup, update all ide_register_hw() users accordingly. * Convert ide-cs/delkin_cb host drivers to use ide_register_hw(). * Restore hwif->fixup in ide_hwif_restore(). * Remove ide_register_hw_with_fixup(), probe_hwif_init_with_fixup() and 'fixup' argument from probe_hwif(). Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 258a15cc274..831b9cc2f1d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -223,12 +223,8 @@ typedef struct hw_regs_s { struct device *dev; } hw_regs_t; -/* - * Register new hardware with ide - */ -int ide_register_hw(hw_regs_t *, int, struct hwif_s **); -int ide_register_hw_with_fixup(hw_regs_t *, int, struct hwif_s **, - void (*)(struct hwif_s *)); +int ide_register_hw(hw_regs_t *, void (*)(struct hwif_s *), int, + struct hwif_s **); /* * Set up hw_regs_t structure before calling ide_register_hw (optional) @@ -727,6 +723,8 @@ typedef struct hwif_s { u8 (*mdma_filter)(ide_drive_t *); u8 (*udma_filter)(ide_drive_t *); + void (*fixup)(struct hwif_s *); + void (*ata_input_data)(ide_drive_t *, void *, u32); void (*ata_output_data)(ide_drive_t *, void *, u32); @@ -1380,7 +1378,6 @@ void ide_unregister_region(struct gendisk *); void ide_undecoded_slave(ide_hwif_t *); -int probe_hwif_init_with_fixup(ide_hwif_t *, void (*)(ide_hwif_t *)); extern int probe_hwif_init(ide_hwif_t *); static inline void *ide_get_hwifdata (ide_hwif_t * hwif) -- cgit v1.2.3 From 8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:31 +0200 Subject: ide: add ide_device_add() * Add ide_device_add() helper and convert host drivers to use it instead of open-coded variants. * Make ide_pci_setup_ports() and do_ide_setup_pci_device() take 'u8 *idx' argument instead of 'ata_index_t *index'. * Remove no longer needed ata_index_t. * Unexport probe_hwif_init() and make it static. * Unexport ide_proc_register_port(). There should be no functionality changes caused by this patch (sgiioc4.c: ide_proc_register_port() requires hwif->present to be set and it won't be set if probe_hwif_init() fails). Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 831b9cc2f1d..7212fe41772 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -361,7 +361,6 @@ typedef union { * ATA DATA Register Special. * ATA NSECTOR Count Register(). * ATAPI Byte Count Register. - * Channel index ordering pairs. */ typedef union { unsigned all :16; @@ -376,7 +375,7 @@ typedef union { #error "Please fix " #endif } b; -} ata_nsector_t, ata_data_t, atapi_bcount_t, ata_index_t; +} ata_nsector_t, ata_data_t, atapi_bcount_t; /* * ATA-IDE Select Register, aka Device-Head @@ -1200,7 +1199,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o #define ide_pci_register_driver(d) pci_register_driver(d) #endif -void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); +void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, u8 *); extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); extern void default_hwif_iops(ide_hwif_t *); @@ -1378,7 +1377,7 @@ void ide_unregister_region(struct gendisk *); void ide_undecoded_slave(ide_hwif_t *); -extern int probe_hwif_init(ide_hwif_t *); +int ide_device_add(u8 idx[4]); static inline void *ide_get_hwifdata (ide_hwif_t * hwif) { -- cgit v1.2.3 From baa8f3e94bc7a7ba3650d80b67d54c3e08365dee Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:31 +0200 Subject: ide: add ide_find_port() helper * Add ide_find_port() helper. * Convert icside, rapide and ide_platform host drivers to use it. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 7212fe41772..9e1cf757b91 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -223,6 +223,8 @@ typedef struct hw_regs_s { struct device *dev; } hw_regs_t; +struct hwif_s * ide_find_port(unsigned long); + int ide_register_hw(hw_regs_t *, void (*)(struct hwif_s *), int, struct hwif_s **); -- cgit v1.2.3 From f9b93097375761930c52b3a20acd374a8d012fbc Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:31 +0200 Subject: ide: remove redundant comments from ide.h There is better documentation for these functions in drivers/ide/. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 9e1cf757b91..17a946b5f55 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -228,9 +228,6 @@ struct hwif_s * ide_find_port(unsigned long); int ide_register_hw(hw_regs_t *, void (*)(struct hwif_s *), int, struct hwif_s **); -/* - * Set up hw_regs_t structure before calling ide_register_hw (optional) - */ void ide_setup_ports( hw_regs_t *hw, unsigned long base, int *offsets, @@ -1031,36 +1028,16 @@ extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, int uptodate, int nr_sectors); -/* - * This is used on exit from the driver to designate the next irq handler - * and also to start the safety timer. - */ extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); -/* - * This is used on exit from the driver to designate the next irq handler - * and start the safety time safely and atomically from the IRQ handler - * with respect to the command issue (which it also does) - */ extern void ide_execute_command(ide_drive_t *, task_ioreg_t cmd, ide_handler_t *, unsigned int, ide_expiry_t *); ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); -/* - * ide_error() takes action based on the error returned by the controller. - * The caller should return immediately after invoking this. - * - * (drive, msg, status) - */ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); ide_startstop_t __ide_abort(ide_drive_t *, struct request *); -/* - * Abort a running command on the controller triggering the abort - * from a host side, non error situation - * (drive, msg) - */ extern ide_startstop_t ide_abort(ide_drive_t *, const char *); extern void ide_fix_driveid(struct hd_driveid *); @@ -1076,15 +1053,8 @@ extern void ide_fixstring(u8 *, const int, const int); int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); -/* - * Start a reset operation for an IDE interface. - * The caller should return immediately after invoking this. - */ extern ide_startstop_t ide_do_reset (ide_drive_t *); -/* - * This function is intended to be used prior to invoking ide_do_drive_cmd(). - */ extern void ide_init_drive_cmd (struct request *rq); /* @@ -1099,13 +1069,6 @@ typedef enum { extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t); -/* - * Clean up after success/failure of an explicit drive cmd. - * stat/err are used only when (HWGROUP(drive)->rq->cmd == IDE_DRIVE_CMD). - * stat/err are used only when (HWGROUP(drive)->rq->cmd == IDE_DRIVE_TASK_MASK). - * - * (ide_drive_t *drive, u8 stat, u8 err) - */ extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); /* @@ -1178,10 +1141,6 @@ extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *); extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); -/* - * ide_stall_queue() can be used by a drive to give excess bandwidth back - * to the hwgroup by sleeping for timeout jiffies. - */ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); extern int ide_spin_wait_hwgroup(ide_drive_t *); -- cgit v1.2.3 From 847ddd2bbe15c6e452606503b5d073826aaaddb7 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:32 +0200 Subject: ide: add CONFIG_IDE_ARCH_OBSOLETE_INIT Add CONFIG_IDE_ARCH_OBSOLETE_INIT to drivers/ide/Kconfig and use it instead of defining IDE_ARCH_OBSOLETE_INIT in . Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-alpha/ide.h | 1 - include/asm-arm/ide.h | 1 - include/asm-blackfin/ide.h | 1 - include/asm-ia64/ide.h | 1 - include/asm-m32r/ide.h | 1 - include/asm-mips/mach-generic/ide.h | 1 - include/asm-parisc/ide.h | 1 - include/asm-powerpc/ide.h | 1 - include/asm-sh64/ide.h | 1 - include/asm-sparc/ide.h | 1 - include/asm-sparc64/ide.h | 1 - include/asm-x86/ide.h | 1 - include/linux/ide.h | 8 ++------ 13 files changed, 2 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h index 2a5cc0b367a..b7bf68d0407 100644 --- a/include/asm-alpha/ide.h +++ b/include/asm-alpha/ide.h @@ -40,7 +40,6 @@ static inline unsigned long ide_default_io_base(int index) } } -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_PCI diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index 4f68c8a5a19..f348fcf3150 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h @@ -18,7 +18,6 @@ #endif #if !defined(CONFIG_ARCH_L7200) -# define IDE_ARCH_OBSOLETE_INIT # ifdef CONFIG_ARCH_CLPS7500 # define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ # else diff --git a/include/asm-blackfin/ide.h b/include/asm-blackfin/ide.h index 41b2db46a16..121e272581d 100644 --- a/include/asm-blackfin/ide.h +++ b/include/asm-blackfin/ide.h @@ -20,7 +20,6 @@ #define MAX_HWIFS 1 /* Legacy ... BLK_DEV_IDECS */ -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h index e928675de35..1ccf2380932 100644 --- a/include/asm-ia64/ide.h +++ b/include/asm-ia64/ide.h @@ -46,7 +46,6 @@ static inline unsigned long ide_default_io_base(int index) } } -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_PCI diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index 4672a49e876..5d2044e529a 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h @@ -65,7 +65,6 @@ static __inline__ unsigned long ide_default_io_base(int index) } } -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_BLK_DEV_IDEPCI diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index a77128362a7..4ec2b930dfb 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h @@ -98,7 +98,6 @@ static __inline__ unsigned long ide_default_io_base(int index) } } -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_BLK_DEV_IDEPCI diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index b27bf7aeb25..be8760fbc8e 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h @@ -17,7 +17,6 @@ #define MAX_HWIFS 2 #endif -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h index 1644e44c875..e61dad73353 100644 --- a/include/asm-powerpc/ide.h +++ b/include/asm-powerpc/ide.h @@ -74,7 +74,6 @@ static __inline__ unsigned long ide_default_io_base(int index) #endif /* __powerpc64__ */ -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #endif /* __KERNEL__ */ diff --git a/include/asm-sh64/ide.h b/include/asm-sh64/ide.h index c9d84d5f772..b6e31e8b941 100644 --- a/include/asm-sh64/ide.h +++ b/include/asm-sh64/ide.h @@ -19,7 +19,6 @@ /* Without this, the initialisation of PCI IDE cards end up calling * ide_init_hwif_ports, which won't work. */ #ifdef CONFIG_BLK_DEV_IDEPCI -#define IDE_ARCH_OBSOLETE_INIT 1 #define ide_default_io_ctl(base) (0) #endif diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index a6d735a1310..404022765fc 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h @@ -18,7 +18,6 @@ #undef MAX_HWIFS #define MAX_HWIFS 2 -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #define __ide_insl(data_reg, buffer, wcount) \ diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h index 55149cf933c..ac7eb210b94 100644 --- a/include/asm-sparc64/ide.h +++ b/include/asm-sparc64/ide.h @@ -24,7 +24,6 @@ # endif #endif -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #define __ide_insl(data_reg, buffer, wcount) \ diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h index e7817a3d657..42130adf9c7 100644 --- a/include/asm-x86/ide.h +++ b/include/asm-x86/ide.h @@ -62,7 +62,6 @@ static __inline__ unsigned long ide_default_io_base(int index) } } -#define IDE_ARCH_OBSOLETE_INIT #define ide_default_io_ctl(base) ((base) + 0x206) /* obsolete */ #ifdef CONFIG_BLK_DEV_IDEPCI diff --git a/include/linux/ide.h b/include/linux/ide.h index 17a946b5f55..39b76aaaa12 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -265,11 +265,7 @@ static inline void ide_std_init_ports(hw_regs_t *hw, # define ide_init_default_irq(base) (0) #endif -/* - * ide_init_hwif_ports() is OBSOLETE and will be removed in 2.7 series. - * New ports shouldn't define IDE_ARCH_OBSOLETE_INIT in . - */ -#ifdef IDE_ARCH_OBSOLETE_INIT +#ifdef CONFIG_IDE_ARCH_OBSOLETE_INIT static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long io_addr, unsigned long ctl_addr, @@ -299,7 +295,7 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, if (io_addr || ctl_addr) printk(KERN_WARNING "%s: must not be called\n", __FUNCTION__); } -#endif /* IDE_ARCH_OBSOLETE_INIT */ +#endif /* CONFIG_IDE_ARCH_OBSOLETE_INIT */ /* Currently only m68k, apus and m8xx need it */ #ifndef IDE_ARCH_ACK_INTR -- cgit v1.2.3 From 86f3a492bb09eee5745b93af35f2212179c251fd Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:32 +0200 Subject: icside: use ec->dma directly * hwif->hwif_data contains pointer to struct expansion_card so use ec->dma directly instead of caching it in hwif->hw.dma. * Remove no longer needed hw_regs_t.dma and NO_DMA define. Cc: Russell King Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 39b76aaaa12..9686cb47eee 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -192,10 +192,6 @@ typedef unsigned char byte; /* used everywhere */ struct hwif_s; typedef int (ide_ack_intr_t)(struct hwif_s *); -#ifndef NO_DMA -#define NO_DMA 255 -#endif - /* * hwif_chipset_t is used to keep track of the specific hardware * chipset used by each IDE interface, if known. @@ -217,7 +213,6 @@ typedef u8 hwif_chipset_t; typedef struct hw_regs_s { unsigned long io_ports[IDE_NR_PORTS]; /* task file registers */ int irq; /* our irq number */ - int dma; /* our dma entry */ ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ hwif_chipset_t chipset; struct device *dev; -- cgit v1.2.3 From 18e181fe13b7340194d09e6dd7f571a5f96f0367 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:32 +0200 Subject: ide: add hwif->ack_intr hook * Add hwif->ack_intr hook and use it instead of hwif->hw.ack_intr. * Add missing brackets to cris-v32 and powerpc ide_ack_intr() macros. Cc: Roman Zippel Cc: Geert Uytterhoeven Cc: Andrew Morton Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-cris/arch-v32/ide.h | 2 +- include/asm-m68k/ide.h | 2 +- include/asm-powerpc/ide.h | 2 +- include/linux/ide.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-cris/arch-v32/ide.h b/include/asm-cris/arch-v32/ide.h index 6590f657500..11296170d05 100644 --- a/include/asm-cris/arch-v32/ide.h +++ b/include/asm-cris/arch-v32/ide.h @@ -54,7 +54,7 @@ static inline unsigned long ide_default_io_base(int index) #define SUPPORT_VLB_SYNC 0 #define IDE_ARCH_ACK_INTR -#define ide_ack_intr(hwif) (hwif)->hw.ack_intr(hwif) +#define ide_ack_intr(hwif) ((hwif)->ack_intr(hwif)) #endif /* __KERNEL__ */ diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index f9ffb2cbbae..909c6dfd385 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -137,7 +137,7 @@ ide_get_lock(irq_handler_t handler, void *data) #endif /* CONFIG_BLK_DEV_FALCON_IDE */ #define IDE_ARCH_ACK_INTR -#define ide_ack_intr(hwif) ((hwif)->hw.ack_intr ? (hwif)->hw.ack_intr(hwif) : 1) +#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1) #endif /* __KERNEL__ */ #endif /* _M68K_IDE_H */ diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h index e61dad73353..fd7f5a430f0 100644 --- a/include/asm-powerpc/ide.h +++ b/include/asm-powerpc/ide.h @@ -69,7 +69,7 @@ static __inline__ unsigned long ide_default_io_base(int index) #ifdef CONFIG_BLK_DEV_MPC8xx_IDE #define IDE_ARCH_ACK_INTR 1 -#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) +#define ide_ack_intr(hwif) ((hwif)->ack_intr ? (hwif)->ack_intr(hwif) : 1) #endif #endif /* __powerpc64__ */ diff --git a/include/linux/ide.h b/include/linux/ide.h index 9686cb47eee..1e6bf04160d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -683,6 +683,8 @@ typedef struct hwif_s { struct pci_dev *pci_dev; /* for pci chipsets */ struct ide_pci_device_s *cds; /* chipset device struct */ + ide_ack_intr_t *ack_intr; + void (*rw_disk)(ide_drive_t *, struct request *); #if 0 -- cgit v1.2.3 From 9239b333939dd1e5b1a9f033a1c136273d58efe8 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:33 +0200 Subject: ide: remove write-only hwif->hw Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 1e6bf04160d..ff1024eadbd 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -659,7 +659,6 @@ typedef struct hwif_s { unsigned long sata_scr[SATA_NR_PORTS]; unsigned long sata_misc[SATA_NR_PORTS]; - hw_regs_t hw; /* Hardware info */ ide_drive_t drives[MAX_DRIVES]; /* drive info */ u8 major; /* our major number */ -- cgit v1.2.3 From 039788e1532368eeca1071a873c14e03920cdf38 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:34 +0200 Subject: ide: replace ide_pci_device_t by struct ide_port_info * Rename struct ide_pci_device_s to struct ide_port_info. * Remove ide_pci_device_t typedef. While at it: * Fix __ide_pci_register_driver() comment. * Fix aec62xx_init_one() comment. * Remove unused 'cds' field from ide_hwgroup_t. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index ff1024eadbd..eaebd4fcb85 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -644,7 +644,7 @@ typedef struct ide_drive_s { ((1<> (c)) & 1) -struct ide_pci_device_s; +struct ide_port_info; typedef struct hwif_s { struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ @@ -680,7 +680,7 @@ typedef struct hwif_s { hwif_chipset_t chipset; /* sub-module for tuning.. */ struct pci_dev *pci_dev; /* for pci chipsets */ - struct ide_pci_device_s *cds; /* chipset device struct */ + struct ide_port_info *cds; /* chipset device struct */ ide_ack_intr_t *ack_intr; @@ -831,8 +831,6 @@ typedef struct hwgroup_s { /* for pci chipsets */ struct pci_dev *pci_dev; - /* chipset device struct */ - struct ide_pci_device_s *cds; /* current request */ struct request *rq; @@ -1152,8 +1150,8 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o #define ide_pci_register_driver(d) pci_register_driver(d) #endif -void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, u8 *); -extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); +void ide_pci_setup_ports(struct pci_dev *, struct ide_port_info *, int, u8 *); +void ide_setup_pci_noise(struct pci_dev *, struct ide_port_info *); extern void default_hwif_iops(ide_hwif_t *); extern void default_hwif_mmiops(ide_hwif_t *); @@ -1229,7 +1227,7 @@ enum { # define IDE_HFLAG_OFF_BOARD 0 #endif -typedef struct ide_pci_device_s { +struct ide_port_info { char *name; unsigned int (*init_chipset)(struct pci_dev *, const char *); void (*init_iops)(ide_hwif_t *); @@ -1244,10 +1242,10 @@ typedef struct ide_pci_device_s { u8 swdma_mask; u8 mwdma_mask; u8 udma_mask; -} ide_pci_device_t; +}; -extern int ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); -extern int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *); +int ide_setup_pci_device(struct pci_dev *, struct ide_port_info *); +int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, struct ide_port_info *); void ide_map_sg(ide_drive_t *, struct request *); void ide_init_sg_cmd(ide_drive_t *, struct request *); -- cgit v1.2.3 From 8562043606430185cad26d085d46adcc7ad67fd1 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 20 Oct 2007 00:32:34 +0200 Subject: ide: constify struct ide_port_info Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index eaebd4fcb85..2e4b8dd03cf 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -680,7 +680,7 @@ typedef struct hwif_s { hwif_chipset_t chipset; /* sub-module for tuning.. */ struct pci_dev *pci_dev; /* for pci chipsets */ - struct ide_port_info *cds; /* chipset device struct */ + const struct ide_port_info *cds; /* chipset device struct */ ide_ack_intr_t *ack_intr; @@ -1150,8 +1150,8 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o #define ide_pci_register_driver(d) pci_register_driver(d) #endif -void ide_pci_setup_ports(struct pci_dev *, struct ide_port_info *, int, u8 *); -void ide_setup_pci_noise(struct pci_dev *, struct ide_port_info *); +void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); +void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); extern void default_hwif_iops(ide_hwif_t *); extern void default_hwif_mmiops(ide_hwif_t *); @@ -1244,8 +1244,8 @@ struct ide_port_info { u8 udma_mask; }; -int ide_setup_pci_device(struct pci_dev *, struct ide_port_info *); -int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, struct ide_port_info *); +int ide_setup_pci_device(struct pci_dev *, const struct ide_port_info *); +int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, const struct ide_port_info *); void ide_map_sg(ide_drive_t *, struct request *); void ide_init_sg_cmd(ide_drive_t *, struct request *); -- cgit v1.2.3