From: Olaf Hering changing CONFIG_LOCALVERSION rebuilds too much, for no appearent reason. remove code for obsolete kernels Signed-off-by: Olaf Hering Signed-off-by: Andrew Morton --- dev/null | 200 ----------------------- drivers/scsi/3w-xxxx.h | 1 drivers/scsi/a2091.c | 1 drivers/scsi/aic7xxx/aic79xx_osm.c | 262 ------------------------------- drivers/scsi/aic7xxx/aic79xx_osm.h | 20 -- drivers/scsi/aic7xxx/aic79xx_osm_pci.c | 6 drivers/scsi/aic7xxx/aic79xx_proc.c | 12 - drivers/scsi/aic7xxx/aic7xxx_osm.h | 1 drivers/scsi/aic7xxx/aiclib.c | 1 drivers/scsi/aic7xxx/aiclib.h | 10 - drivers/scsi/amiga7xx.c | 1 drivers/scsi/bvme6000.c | 1 drivers/scsi/cpqfcTSinit.c | 32 --- drivers/scsi/dpt/dpti_i2o.h | 11 - drivers/scsi/gvp11.c | 1 drivers/scsi/ibmmca.c | 6 drivers/scsi/ips.c | 104 ------------ drivers/scsi/ips.h | 33 --- drivers/scsi/megaraid/mega_common.h | 1 drivers/scsi/megaraid/megaraid_mm.h | 1 drivers/scsi/mvme147.c | 1 drivers/scsi/mvme16x.c | 1 drivers/scsi/pcmcia/nsp_cs.c | 158 ------------------ drivers/scsi/pcmcia/nsp_cs.h | 68 -------- drivers/scsi/qla1280.c | 277 --------------------------------- drivers/scsi/scsi_debug.c | 4 drivers/scsi/sg.c | 4 drivers/scsi/sgiwd93.c | 1 drivers/scsi/wd33c93.c | 1 29 files changed, 1220 deletions(-) diff -puN drivers/scsi/3w-xxxx.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/3w-xxxx.h --- devel/drivers/scsi/3w-xxxx.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/3w-xxxx.h 2005-07-12 15:21:41.000000000 -0700 @@ -54,7 +54,6 @@ #ifndef _3W_XXXX_H #define _3W_XXXX_H -#include #include /* AEN strings */ diff -puN drivers/scsi/a2091.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/a2091.c --- devel/drivers/scsi/a2091.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/a2091.c 2005-07-12 15:21:41.000000000 -0700 @@ -2,7 +2,6 @@ #include #include #include -#include #include #include diff -puN drivers/scsi/aic7xxx/aic79xx_osm.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aic79xx_osm.c --- devel/drivers/scsi/aic7xxx/aic79xx_osm.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aic79xx_osm.c 2005-07-12 15:21:41.000000000 -0700 @@ -54,10 +54,6 @@ #include /* __setup */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "sd.h" /* For geometry detection */ -#endif - #include /* For fetching system memory size */ #include /* For ssleep/msleep */ @@ -66,11 +62,6 @@ */ spinlock_t ahd_list_spinlock; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -/* For dynamic sglist size calculation. */ -u_int ahd_linux_nseg; -#endif - /* * Bucket size for counting good commands in between bad ones. */ @@ -709,7 +700,6 @@ ahd_linux_unmap_scb(struct ahd_softc *ah static int ahd_linux_detect(Scsi_Host_Template *); static const char *ahd_linux_info(struct Scsi_Host *); static int ahd_linux_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int ahd_linux_slave_alloc(Scsi_Device *); static int ahd_linux_slave_configure(Scsi_Device *); static void ahd_linux_slave_destroy(Scsi_Device *); @@ -717,14 +707,6 @@ static void ahd_linux_slave_destroy(S static int ahd_linux_biosparam(struct scsi_device*, struct block_device*, sector_t, int[]); #endif -#else -static int ahd_linux_release(struct Scsi_Host *); -static void ahd_linux_select_queue_depth(struct Scsi_Host *host, - Scsi_Device *scsi_devs); -#if defined(__i386__) -static int ahd_linux_biosparam(Disk *, kdev_t, int[]); -#endif -#endif static int ahd_linux_bus_reset(Scsi_Cmnd *); static int ahd_linux_dev_reset(Scsi_Cmnd *); static int ahd_linux_abort(Scsi_Cmnd *); @@ -749,45 +731,6 @@ static int ahd_linux_abort(Scsi_Cmnd static void ahd_linux_size_nseg(void) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - u_int cur_size; - u_int best_size; - - /* - * The SCSI allocator rounds to the nearest 512 bytes - * an cannot allocate across a page boundary. Our algorithm - * is to start at 1K of scsi malloc space per-command and - * loop through all factors of the PAGE_SIZE and pick the best. - */ - best_size = 0; - for (cur_size = 1024; cur_size <= PAGE_SIZE; cur_size *= 2) { - u_int nseg; - - nseg = cur_size / sizeof(struct scatterlist); - if (nseg < AHD_LINUX_MIN_NSEG) - continue; - - if (best_size == 0) { - best_size = cur_size; - ahd_linux_nseg = nseg; - } else { - u_int best_rem; - u_int cur_rem; - - /* - * Compare the traits of the current "best_size" - * with the current size to determine if the - * current size is a better size. - */ - best_rem = best_size % sizeof(struct scatterlist); - cur_rem = cur_size % sizeof(struct scatterlist); - if (cur_rem < best_rem) { - best_size = cur_size; - ahd_linux_nseg = nseg; - } - } - } -#endif } /* @@ -800,14 +743,6 @@ ahd_linux_detect(Scsi_Host_Template *tem int found; int error = 0; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - /* - * It is a bug that the upper layer takes - * this lock just prior to calling us. - */ - spin_unlock_irq(&io_request_lock); -#endif - /* * Sanity checking of Linux SCSI data structures so * that some of our hacks^H^H^H^H^Hassumptions aren't @@ -855,47 +790,10 @@ ahd_linux_detect(Scsi_Host_Template *tem if (ahd_linux_register_host(ahd, template) == 0) found++; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - spin_lock_irq(&io_request_lock); -#endif aic79xx_detect_complete++; return 0; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -/* - * Free the passed in Scsi_Host memory structures prior to unloading the - * module. - */ -static int -ahd_linux_release(struct Scsi_Host * host) -{ - struct ahd_softc *ahd; - u_long l; - - ahd_list_lock(&l); - if (host != NULL) { - - /* - * We should be able to just perform - * the free directly, but check our - * list for extra sanity. - */ - ahd = ahd_find_softc(*(struct ahd_softc **)host->hostdata); - if (ahd != NULL) { - u_long s; - - ahd_lock(ahd, &s); - ahd_intr_enable(ahd, FALSE); - ahd_unlock(ahd, &s); - ahd_free(ahd); - } - } - ahd_list_unlock(&l); - return (0); -} -#endif - /* * Return a string describing the driver. */ @@ -983,7 +881,6 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (* return (0); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) static int ahd_linux_slave_alloc(Scsi_Device *device) { @@ -1056,92 +953,16 @@ ahd_linux_slave_destroy(Scsi_Device *dev } ahd_midlayer_entrypoint_unlock(ahd, &flags); } -#else -/* - * Sets the queue depth for each SCSI device hanging - * off the input host adapter. - */ -static void -ahd_linux_select_queue_depth(struct Scsi_Host * host, - Scsi_Device * scsi_devs) -{ - Scsi_Device *device; - Scsi_Device *ldev; - struct ahd_softc *ahd; - u_long flags; - - ahd = *((struct ahd_softc **)host->hostdata); - ahd_lock(ahd, &flags); - for (device = scsi_devs; device != NULL; device = device->next) { - - /* - * Watch out for duplicate devices. This works around - * some quirks in how the SCSI scanning code does its - * device management. - */ - for (ldev = scsi_devs; ldev != device; ldev = ldev->next) { - if (ldev->host == device->host - && ldev->channel == device->channel - && ldev->id == device->id - && ldev->lun == device->lun) - break; - } - /* Skip duplicate. */ - if (ldev != device) - continue; - - if (device->host == host) { - struct ahd_linux_device *dev; - - /* - * Since Linux has attached to the device, configure - * it so we don't free and allocate the device - * structure on every command. - */ - dev = ahd_linux_get_device(ahd, device->channel, - device->id, device->lun, - /*alloc*/TRUE); - if (dev != NULL) { - dev->flags &= ~AHD_DEV_UNCONFIGURED; - dev->scsi_device = device; - ahd_linux_device_queue_depth(ahd, dev); - device->queue_depth = dev->openings - + dev->active; - if ((dev->flags & (AHD_DEV_Q_BASIC - | AHD_DEV_Q_TAGGED)) == 0) { - /* - * We allow the OS to queue 2 untagged - * transactions to us at any time even - * though we can only execute them - * serially on the controller/device. - * This should remove some latency. - */ - device->queue_depth = 2; - } - } - } - } - ahd_unlock(ahd, &flags); -} -#endif #if defined(__i386__) /* * Return the disk geometry for the given SCSI device. */ static int -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ahd_linux_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[]) { uint8_t *bh; -#else -ahd_linux_biosparam(Disk *disk, kdev_t dev, int geom[]) -{ - struct scsi_device *sdev = disk->device; - u_long capacity = disk->capacity; - struct buffer_head *bh; -#endif int heads; int sectors; int cylinders; @@ -1151,22 +972,12 @@ ahd_linux_biosparam(Disk *disk, kdev_t d ahd = *((struct ahd_softc **)sdev->host->hostdata); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) bh = scsi_bios_ptable(bdev); -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,17) - bh = bread(MKDEV(MAJOR(dev), MINOR(dev) & ~0xf), 0, block_size(dev)); -#else - bh = bread(MKDEV(MAJOR(dev), MINOR(dev) & ~0xf), 0, 1024); -#endif if (bh) { ret = scsi_partsize(bh, capacity, &geom[2], &geom[0], &geom[1]); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) kfree(bh); -#else - brelse(bh); -#endif if (ret != -1) return (ret); } @@ -1997,11 +1808,7 @@ ahd_linux_register_host(struct ahd_softc *((struct ahd_softc **)host->hostdata) = ahd; ahd_lock(ahd, &s); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) scsi_assign_lock(host, &ahd->platform_data->spin_lock); -#elif AHD_SCSI_HAS_HOST_LOCK != 0 - host->lock = &ahd->platform_data->spin_lock; -#endif ahd->platform_data->host = host; host->can_queue = AHD_MAX_QUEUE; host->cmd_per_lun = 2; @@ -2020,9 +1827,6 @@ ahd_linux_register_host(struct ahd_softc ahd_set_name(ahd, new_name); } host->unique_id = ahd->unit; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - scsi_set_pci_device(host, ahd->dev_softc); -#endif ahd_linux_setup_user_rd_strm_settings(ahd); ahd_linux_initialize_scsi_bus(ahd); ahd_unlock(ahd, &s); @@ -2064,10 +1868,8 @@ ahd_linux_register_host(struct ahd_softc ahd_linux_start_dv(ahd); ahd_unlock(ahd, &s); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) scsi_add_host(host, &ahd->dev_softc->dev); /* XXX handle failure */ scsi_scan_host(host); -#endif return (0); } @@ -2192,9 +1994,7 @@ ahd_platform_free(struct ahd_softc *ahd) ahd_linux_kill_dv_thread(ahd); ahd_teardown_runq_tasklet(ahd); if (ahd->platform_data->host != NULL) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) scsi_remove_host(ahd->platform_data->host); -#endif scsi_host_put(ahd->platform_data->host); } @@ -2233,16 +2033,6 @@ ahd_platform_free(struct ahd_softc *ahd) release_mem_region(ahd->platform_data->mem_busaddr, 0x1000); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - /* - * In 2.4 we detach from the scsi midlayer before the PCI - * layer invokes our remove callback. No per-instance - * detach is provided, so we must reach inside the PCI - * subsystem's internals and detach our driver manually. - */ - if (ahd->dev_softc != NULL) - ahd->dev_softc->driver = NULL; -#endif free(ahd->platform_data, M_DEVBUF); } } @@ -2339,7 +2129,6 @@ ahd_platform_set_tags(struct ahd_softc * dev->maxtags = 0; dev->openings = 1 - dev->active; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) if (dev->scsi_device != NULL) { switch ((dev->flags & (AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED))) { case AHD_DEV_Q_BASIC: @@ -2365,7 +2154,6 @@ ahd_platform_set_tags(struct ahd_softc * break; } } -#endif } int @@ -2478,18 +2266,8 @@ ahd_linux_dv_thread(void *data) * Complete thread creation. */ lock_kernel(); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,60) - /* - * Don't care about any signals. - */ - siginitsetinv(¤t->blocked, 0); - - daemonize(); - sprintf(current->comm, "ahd_dv_%d", ahd->unit); -#else daemonize("ahd_dv_%d", ahd->unit); current->flags |= PF_NOFREEZE; -#endif unlock_kernel(); while (1) { @@ -3985,7 +3763,6 @@ ahd_linux_run_device_queue(struct ahd_so } if ((dev->flags & (AHD_DEV_Q_TAGGED|AHD_DEV_Q_BASIC)) != 0) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) int msg_bytes; uint8_t tag_msgs[2]; @@ -3995,7 +3772,6 @@ ahd_linux_run_device_queue(struct ahd_so if (tag_msgs[0] == MSG_ORDERED_TASK) dev->commands_since_idle_or_otag = 0; } else -#endif if (dev->commands_since_idle_or_otag == AHD_OTAG_THRESH && (dev->flags & AHD_DEV_Q_TAGGED) != 0) { hscb->control |= MSG_ORDERED_TASK; @@ -4264,28 +4040,9 @@ ahd_send_async(struct ahd_softc *ahd, ch } case AC_SENT_BDR: { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) WARN_ON(lun != CAM_LUN_WILDCARD); scsi_report_device_reset(ahd->platform_data->host, channel - 'A', target); -#else - Scsi_Device *scsi_dev; - - /* - * Find the SCSI device associated with this - * request and indicate that a UA is expected. - */ - for (scsi_dev = ahd->platform_data->host->host_queue; - scsi_dev != NULL; scsi_dev = scsi_dev->next) { - if (channel - 'A' == scsi_dev->channel - && target == scsi_dev->id - && (lun == CAM_LUN_WILDCARD - || lun == scsi_dev->lun)) { - scsi_dev->was_reset = 1; - scsi_dev->expecting_cc_ua = 1; - } - } -#endif break; } case AC_BUS_RESET: @@ -4972,18 +4729,7 @@ ahd_platform_dump_card_state(struct ahd_ static int __init ahd_linux_init(void) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) return ahd_linux_detect(&aic79xx_driver_template); -#else - scsi_register_module(MODULE_SCSI_HA, &aic79xx_driver_template); - if (aic79xx_driver_template.present == 0) { - scsi_unregister_module(MODULE_SCSI_HA, - &aic79xx_driver_template); - return (-ENODEV); - } - - return (0); -#endif } static void __exit @@ -5002,14 +4748,6 @@ ahd_linux_exit(void) ahd_linux_kill_dv_thread(ahd); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - /* - * In 2.4 we have to unregister from the PCI core _after_ - * unregistering from the scsi midlayer to avoid dangling - * references. - */ - scsi_unregister_module(MODULE_SCSI_HA, &aic79xx_driver_template); -#endif ahd_linux_pci_exit(); } diff -puN drivers/scsi/aic7xxx/aic79xx_osm.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aic79xx_osm.h --- devel/drivers/scsi/aic7xxx/aic79xx_osm.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aic79xx_osm.h 2005-07-12 15:21:41.000000000 -0700 @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -252,11 +251,7 @@ ahd_scb_timer_reset(struct scb *scb, u_i /***************************** SMP support ************************************/ #include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) || defined(SCSI_HAS_HOST_LOCK)) #define AHD_SCSI_HAS_HOST_LOCK 1 -#else -#define AHD_SCSI_HAS_HOST_LOCK 0 -#endif #define AIC79XX_DRIVER_VERSION "1.3.11" @@ -453,18 +448,7 @@ struct ahd_linux_target { * manner and are allocated below 4GB, the number of S/G segments is * unrestricted. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -/* - * We dynamically adjust the number of segments in pre-2.5 kernels to - * avoid fragmentation issues in the SCSI mid-layer's private memory - * allocator. See aic79xx_osm.c ahd_linux_size_nseg() for details. - */ -extern u_int ahd_linux_nseg; -#define AHD_NSEG ahd_linux_nseg -#define AHD_LINUX_MIN_NSEG 64 -#else #define AHD_NSEG 128 -#endif /* * Per-SCB OSM storage. @@ -925,12 +909,8 @@ ahd_flush_device_writes(struct ahd_softc } /**************************** Proc FS Support *********************************/ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -int ahd_linux_proc_info(char *, char **, off_t, int, int, int); -#else int ahd_linux_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); -#endif /*************************** Domain Validation ********************************/ #define AHD_DV_CMD(cmd) ((cmd)->scsi_done == ahd_linux_dv_complete) diff -puN drivers/scsi/aic7xxx/aic79xx_osm_pci.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aic79xx_osm_pci.c --- devel/drivers/scsi/aic7xxx/aic79xx_osm_pci.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2005-07-12 15:21:41.000000000 -0700 @@ -195,13 +195,7 @@ ahd_linux_pci_dev_probe(struct pci_dev * } pci_set_drvdata(pdev, ahd); if (aic79xx_detect_complete) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) ahd_linux_register_host(ahd, &aic79xx_driver_template); -#else - printf("aic79xx: ignoring PCI device found after " - "initialization\n"); - return (-ENODEV); -#endif } return (0); } diff -puN drivers/scsi/aic7xxx/aic79xx_proc.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aic79xx_proc.c --- devel/drivers/scsi/aic7xxx/aic79xx_proc.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aic79xx_proc.c 2005-07-12 15:21:41.000000000 -0700 @@ -278,13 +278,8 @@ done: * Return information to handle /proc support for the driver. */ int -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -ahd_linux_proc_info(char *buffer, char **start, off_t offset, - int length, int hostno, int inout) -#else ahd_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length, int inout) -#endif { struct ahd_softc *ahd; struct info_str info; @@ -296,14 +291,7 @@ ahd_linux_proc_info(struct Scsi_Host *sh retval = -EINVAL; ahd_list_lock(&l); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - TAILQ_FOREACH(ahd, &ahd_tailq, links) { - if (ahd->platform_data->host->host_no == hostno) - break; - } -#else ahd = ahd_find_softc(*(struct ahd_softc **)shost->hostdata); -#endif if (ahd == NULL) goto done; diff -puN drivers/scsi/aic7xxx/aic7xxx_osm.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aic7xxx_osm.h --- devel/drivers/scsi/aic7xxx/aic7xxx_osm.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aic7xxx_osm.h 2005-07-12 15:21:41.000000000 -0700 @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/scsi/aic7xxx/aiclib.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aiclib.c --- devel/drivers/scsi/aic7xxx/aiclib.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aiclib.c 2005-07-12 15:21:41.000000000 -0700 @@ -32,7 +32,6 @@ #include #include -#include /* Core SCSI definitions */ #include diff -puN drivers/scsi/aic7xxx/aiclib.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/aic7xxx/aiclib.h --- devel/drivers/scsi/aic7xxx/aiclib.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/aic7xxx/aiclib.h 2005-07-12 15:21:41.000000000 -0700 @@ -866,15 +866,6 @@ typedef enum { extern const char *scsi_sense_key_text[]; /************************* Large Disk Handling ********************************/ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -static __inline int aic_sector_div(u_long capacity, int heads, int sectors); - -static __inline int -aic_sector_div(u_long capacity, int heads, int sectors) -{ - return (capacity / (heads * sectors)); -} -#else static __inline int aic_sector_div(sector_t capacity, int heads, int sectors); static __inline int @@ -884,7 +875,6 @@ aic_sector_div(sector_t capacity, int he sector_div(capacity, (heads * sectors)); return (int)capacity; } -#endif /**************************** Module Library Hack *****************************/ /* diff -puN drivers/scsi/amiga7xx.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/amiga7xx.c --- devel/drivers/scsi/amiga7xx.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/amiga7xx.c 2005-07-12 15:21:41.000000000 -0700 @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/scsi/bvme6000.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/bvme6000.c --- devel/drivers/scsi/bvme6000.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/bvme6000.c 2005-07-12 15:21:41.000000000 -0700 @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff -puN drivers/scsi/cpqfcTSinit.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/cpqfcTSinit.c --- devel/drivers/scsi/cpqfcTSinit.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/cpqfcTSinit.c 2005-07-12 15:21:41.000000000 -0700 @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -66,37 +65,10 @@ MODULE_LICENSE("GPL"); int cpqfcTS_TargetDeviceReset( Scsi_Device *ScsiDev, unsigned int reset_flags); -// This struct was originally defined in -// /usr/src/linux/include/linux/proc_fs.h -// since it's only partially implemented, we only use first -// few fields... -// NOTE: proc_fs changes in 2.4 kernel - -#if LINUX_VERSION_CODE < LinuxVersionCode(2,3,27) -static struct proc_dir_entry proc_scsi_cpqfcTS = -{ - PROC_SCSI_CPQFCTS, // ushort low_ino (enumerated list) - 7, // ushort namelen - DEV_NAME, // const char* name - S_IFDIR | S_IRUGO | S_IXUGO, // mode_t mode - 2 // nlink_t nlink - // etc. ... -}; - - -#endif - -#if LINUX_VERSION_CODE >= LinuxVersionCode(2,4,7) # define CPQFC_DECLARE_COMPLETION(x) DECLARE_COMPLETION(x) # define CPQFC_WAITING waiting # define CPQFC_COMPLETE(x) complete(x) # define CPQFC_WAIT_FOR_COMPLETION(x) wait_for_completion(x); -#else -# define CPQFC_DECLARE_COMPLETION(x) DECLARE_MUTEX_LOCKED(x) -# define CPQFC_WAITING sem -# define CPQFC_COMPLETE(x) up(x) -# define CPQFC_WAIT_FOR_COMPLETION(x) down(x) -#endif static int cpqfc_alloc_private_data_pool(CPQFCHBA *hba); @@ -288,11 +260,7 @@ int cpqfcTS_detect(Scsi_Host_Template *S ENTER("cpqfcTS_detect"); -#if LINUX_VERSION_CODE < LinuxVersionCode(2,3,27) - ScsiHostTemplate->proc_dir = &proc_scsi_cpqfcTS; -#else ScsiHostTemplate->proc_name = "cpqfcTS"; -#endif for( i=0; i < HBA_TYPES; i++) { diff -puN drivers/scsi/dpt/dpti_i2o.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/dpt/dpti_i2o.h --- devel/drivers/scsi/dpt/dpti_i2o.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/dpt/dpti_i2o.h 2005-07-12 15:21:41.000000000 -0700 @@ -22,7 +22,6 @@ #include #include /* Needed for MUTEX init macros */ -#include #include #include #include @@ -48,21 +47,11 @@ * I2O Interface Objects */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) - -#define DECLARE_MUTEX(name) struct semaphore name=MUTEX - -typedef struct wait_queue *adpt_wait_queue_head_t; -#define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) adpt_wait_queue_head_t wait = NULL -typedef struct wait_queue adpt_wait_queue_t; -#else - #include typedef wait_queue_head_t adpt_wait_queue_head_t; #define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) DECLARE_WAIT_QUEUE_HEAD(wait) typedef wait_queue_t adpt_wait_queue_t; -#endif /* * message structures */ diff -puN drivers/scsi/gvp11.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/gvp11.c --- devel/drivers/scsi/gvp11.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/gvp11.c 2005-07-12 15:21:41.000000000 -0700 @@ -2,7 +2,6 @@ #include #include #include -#include #include #include diff -puN drivers/scsi/ibmmca.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/ibmmca.c --- devel/drivers/scsi/ibmmca.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/ibmmca.c 2005-07-12 15:21:41.000000000 -0700 @@ -18,12 +18,6 @@ */ #include -#ifndef LINUX_VERSION_CODE -#include -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45) -#error "This driver works only with kernel 2.5.45 or higher!" -#endif #include #include #include diff -puN drivers/scsi/ips.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/ips.c --- devel/drivers/scsi/ips.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/ips.c 2005-07-12 15:21:41.000000000 -0700 @@ -162,7 +162,6 @@ #include #include #include -#include #include #include #include @@ -180,12 +179,7 @@ #include #include "scsi.h" - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) -#include "hosts.h" -#else #include -#endif #include "ips.h" @@ -214,21 +208,10 @@ module_param(ips, charp, 0); #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" #endif -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0) -#include -#include "sd.h" -#define IPS_SG_ADDRESS(sg) ((sg)->address) -#define IPS_LOCK_SAVE(lock,flags) spin_lock_irqsave(&io_request_lock,flags) -#define IPS_UNLOCK_RESTORE(lock,flags) spin_unlock_irqrestore(&io_request_lock,flags) -#ifndef __devexit_p -#define __devexit_p(x) x -#endif -#else #define IPS_SG_ADDRESS(sg) (page_address((sg)->page) ? \ page_address((sg)->page)+(sg)->offset : NULL) #define IPS_LOCK_SAVE(lock,flags) do{spin_lock(lock);(void)flags;}while(0) #define IPS_UNLOCK_RESTORE(lock,flags) do{spin_unlock(lock);(void)flags;}while(0) -#endif #define IPS_DMA_DIR(scb) ((!scb->scsi_cmd || ips_is_passthru(scb->scsi_cmd) || \ DMA_NONE == scb->scsi_cmd->sc_data_direction) ? \ @@ -384,24 +367,13 @@ static Scsi_Host_Template ips_driver_tem .eh_abort_handler = ips_eh_abort, .eh_host_reset_handler = ips_eh_reset, .proc_name = "ips", -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) .proc_info = ips_proc_info, .slave_configure = ips_slave_configure, -#else - .proc_info = ips_proc24_info, - .select_queue_depths = ips_select_queue_depth, -#endif .bios_param = ips_biosparam, .this_id = -1, .sg_tablesize = IPS_MAX_SG, .cmd_per_lun = 3, .use_clustering = ENABLE_CLUSTERING, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - .use_new_eh_code = 1, -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) && LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - .highmem_io = 1, -#endif }; static IPS_DEFINE_COMPAT_TABLE( Compatable ); /* Version Compatability Table */ @@ -1186,17 +1158,10 @@ ips_queue(Scsi_Cmnd * SC, void (*done) ( /* */ /****************************************************************************/ static int -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -ips_biosparam(Disk * disk, kdev_t dev, int geom[]) -{ - ips_ha_t *ha = (ips_ha_t *) disk->device->host->hostdata; - unsigned long capacity = disk->capacity; -#else ips_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[]) { ips_ha_t *ha = (ips_ha_t *) sdev->host->hostdata; -#endif int heads; int sectors; int cylinders; @@ -1234,70 +1199,6 @@ ips_biosparam(struct scsi_device *sdev, return (0); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - -/* ips_proc24_info is a wrapper around ips_proc_info * - * for compatibility with the 2.4 scsi parameters */ -static int -ips_proc24_info(char *buffer, char **start, off_t offset, int length, - int hostno, int func) -{ - int i; - - for (i = 0; i < ips_next_controller; i++) { - if (ips_sh[i] && ips_sh[i]->host_no == hostno) { - return ips_proc_info(ips_sh[i], buffer, start, - offset, length, func); - } - } - return -EINVAL; -} - -/****************************************************************************/ -/* */ -/* Routine Name: ips_select_queue_depth */ -/* */ -/* Routine Description: */ -/* */ -/* Select queue depths for the devices on the contoller */ -/* */ -/****************************************************************************/ -static void -ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) -{ - Scsi_Device *device; - ips_ha_t *ha; - int count = 0; - int min; - - ha = IPS_HA(host); - min = ha->max_cmds / 4; - - for (device = scsi_devs; device; device = device->next) { - if (device->host == host) { - if ((device->channel == 0) && (device->type == 0)) - count++; - } - } - - for (device = scsi_devs; device; device = device->next) { - if (device->host == host) { - if ((device->channel == 0) && (device->type == 0)) { - device->queue_depth = - (ha->max_cmds - 1) / count; - if (device->queue_depth < min) - device->queue_depth = min; - } else { - device->queue_depth = 2; - } - - if (device->queue_depth < 2) - device->queue_depth = 2; - } - } -} - -#else /****************************************************************************/ /* */ /* Routine Name: ips_slave_configure */ @@ -1322,7 +1223,6 @@ ips_slave_configure(Scsi_Device * SDptr) } return 0; } -#endif /****************************************************************************/ /* */ @@ -7044,9 +6944,7 @@ ips_register_scsi(int index) sh->unchecked_isa_dma = sh->hostt->unchecked_isa_dma; sh->use_clustering = sh->hostt->use_clustering; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7) sh->max_sectors = 128; -#endif sh->max_id = ha->ntargets; sh->max_lun = ha->nlun; @@ -7470,9 +7368,7 @@ ips_init_phase2(int index) return SUCCESS; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9) MODULE_LICENSE("GPL"); -#endif MODULE_DESCRIPTION("IBM ServeRAID Adapter Driver " IPS_VER_STRING); diff -puN drivers/scsi/ips.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/ips.h --- devel/drivers/scsi/ips.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/ips.h 2005-07-12 15:21:41.000000000 -0700 @@ -56,9 +56,7 @@ /* * Some handy macros */ - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20) || defined CONFIG_HIGHIO #define IPS_HIGHIO - #endif #define IPS_HA(x) ((ips_ha_t *) x->hostdata) #define IPS_COMMAND_ID(ha, scb) (int) (scb - ha->scbs) @@ -82,31 +80,7 @@ #define IPS_SGLIST_SIZE(ha) (IPS_USE_ENH_SGLIST(ha) ? \ sizeof(IPS_ENH_SG_LIST) : sizeof(IPS_STD_SG_LIST)) - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4) - #define pci_set_dma_mask(dev,mask) ( mask > 0xffffffff ? 1:0 ) - #define scsi_set_pci_device(sh,dev) (0) - #endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - - #ifndef irqreturn_t - typedef void irqreturn_t; - #endif - - #define IRQ_NONE - #define IRQ_HANDLED - #define IRQ_RETVAL(x) - #define IPS_REGISTER_HOSTS(SHT) scsi_register_module(MODULE_SCSI_HA,SHT) - #define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT) - #define IPS_ADD_HOST(shost,device) - #define IPS_REMOVE_HOST(shost) - #define IPS_SCSI_SET_DEVICE(sh,ha) scsi_set_pci_device(sh, (ha)->pcidev) - #define IPS_PRINTK(level, pcidev, format, arg...) \ - printk(level "%s %s:" format , "ips" , \ - (pcidev)->slot_name , ## arg) - #define scsi_host_alloc(sh,size) scsi_register(sh,size) - #define scsi_host_put(sh) scsi_unregister(sh) - #else #define IPS_REGISTER_HOSTS(SHT) (!ips_detect(SHT)) #define IPS_UNREGISTER_HOSTS(SHT) #define IPS_ADD_HOST(shost,device) do { scsi_add_host(shost,device); scsi_scan_host(shost); } while (0) @@ -114,7 +88,6 @@ #define IPS_SCSI_SET_DEVICE(sh,ha) do { } while (0) #define IPS_PRINTK(level, pcidev, format, arg...) \ dev_printk(level , &((pcidev)->dev) , format , ## arg) - #endif #ifndef MDELAY #define MDELAY mdelay @@ -444,16 +417,10 @@ /* * Scsi_Host Template */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - static int ips_proc24_info(char *, char **, off_t, int, int, int); - static void ips_select_queue_depth(struct Scsi_Host *, Scsi_Device *); - static int ips_biosparam(Disk *disk, kdev_t dev, int geom[]); -#else static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); static int ips_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[]); static int ips_slave_configure(Scsi_Device *SDptr); -#endif /* * Raid Command Formats diff -puN drivers/scsi/megaraid/mega_common.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/megaraid/mega_common.h --- devel/drivers/scsi/megaraid/mega_common.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/megaraid/mega_common.h 2005-07-12 15:21:41.000000000 -0700 @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/scsi/megaraid/megaraid_mm.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/megaraid/megaraid_mm.h --- devel/drivers/scsi/megaraid/megaraid_mm.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/megaraid/megaraid_mm.h 2005-07-12 15:21:41.000000000 -0700 @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/scsi/mvme147.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/mvme147.c --- devel/drivers/scsi/mvme147.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/mvme147.c 2005-07-12 15:21:41.000000000 -0700 @@ -2,7 +2,6 @@ #include #include #include -#include #include #include diff -puN drivers/scsi/mvme16x.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/mvme16x.c --- devel/drivers/scsi/mvme16x.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/mvme16x.c 2005-07-12 15:21:41.000000000 -0700 @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff -L drivers/scsi/pci2000.h -puN drivers/scsi/pci2000.h~remove-linux-versionh-from-drivers-scsi /dev/null --- devel/drivers/scsi/pci2000.h +++ /dev/null 2003-09-15 06:40:47.000000000 -0700 @@ -1,200 +0,0 @@ -/**************************************************************************** - * Perceptive Solutions, Inc. PCI-2000 device driver for Linux. - * - * pci2000.h - Linux Host Driver for PCI-2000 IntelliCache SCSI Adapters - * - * Copyright (c) 1997-1999 Perceptive Solutions, Inc. - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that redistributions of source - * code retain the above copyright notice and this comment without - * modification. - * - * Technical updates and product information at: - * http://www.psidisk.com - * - * Please send questions, comments, bug reports to: - * tech@psidisk.com Technical Support - * - ****************************************************************************/ -#ifndef _PCI2000_H -#define _PCI2000_H - -#include - -#ifndef PSI_EIDE_SCSIOP -#define PSI_EIDE_SCSIOP 1 - -#ifndef LINUX_VERSION_CODE -#include -#endif -#define LINUXVERSION(v,p,s) (((v)<<16) + ((p)<<8) + (s)) - -/************************************************/ -/* definition of standard data types */ -/************************************************/ -#define CHAR char -#define UCHAR unsigned char -#define SHORT short -#define USHORT unsigned short -#define BOOL long -#define LONG long -#define ULONG unsigned long -#define VOID void - -typedef CHAR *PCHAR; -typedef UCHAR *PUCHAR; -typedef SHORT *PSHORT; -typedef USHORT *PUSHORT; -typedef BOOL *PBOOL; -typedef LONG *PLONG; -typedef ULONG *PULONG; -typedef VOID *PVOID; - - -/************************************************/ -/* Misc. macros */ -/************************************************/ -#define ANY2SCSI(up, p) \ -((UCHAR *)up)[0] = (((ULONG)(p)) >> 8); \ -((UCHAR *)up)[1] = ((ULONG)(p)); - -#define SCSI2LONG(up) \ -( (((long)*(((UCHAR *)up))) << 16) \ -+ (((long)(((UCHAR *)up)[1])) << 8) \ -+ ((long)(((UCHAR *)up)[2])) ) - -#define XANY2SCSI(up, p) \ -((UCHAR *)up)[0] = ((long)(p)) >> 24; \ -((UCHAR *)up)[1] = ((long)(p)) >> 16; \ -((UCHAR *)up)[2] = ((long)(p)) >> 8; \ -((UCHAR *)up)[3] = ((long)(p)); - -#define XSCSI2LONG(up) \ -( (((long)(((UCHAR *)up)[0])) << 24) \ -+ (((long)(((UCHAR *)up)[1])) << 16) \ -+ (((long)(((UCHAR *)up)[2])) << 8) \ -+ ((long)(((UCHAR *)up)[3])) ) - -/************************************************/ -/* SCSI CDB operation codes */ -/************************************************/ -#define SCSIOP_TEST_UNIT_READY 0x00 -#define SCSIOP_REZERO_UNIT 0x01 -#define SCSIOP_REWIND 0x01 -#define SCSIOP_REQUEST_BLOCK_ADDR 0x02 -#define SCSIOP_REQUEST_SENSE 0x03 -#define SCSIOP_FORMAT_UNIT 0x04 -#define SCSIOP_READ_BLOCK_LIMITS 0x05 -#define SCSIOP_REASSIGN_BLOCKS 0x07 -#define SCSIOP_READ6 0x08 -#define SCSIOP_RECEIVE 0x08 -#define SCSIOP_WRITE6 0x0A -#define SCSIOP_PRINT 0x0A -#define SCSIOP_SEND 0x0A -#define SCSIOP_SEEK6 0x0B -#define SCSIOP_TRACK_SELECT 0x0B -#define SCSIOP_SLEW_PRINT 0x0B -#define SCSIOP_SEEK_BLOCK 0x0C -#define SCSIOP_PARTITION 0x0D -#define SCSIOP_READ_REVERSE 0x0F -#define SCSIOP_WRITE_FILEMARKS 0x10 -#define SCSIOP_FLUSH_BUFFER 0x10 -#define SCSIOP_SPACE 0x11 -#define SCSIOP_INQUIRY 0x12 -#define SCSIOP_VERIFY6 0x13 -#define SCSIOP_RECOVER_BUF_DATA 0x14 -#define SCSIOP_MODE_SELECT 0x15 -#define SCSIOP_RESERVE_UNIT 0x16 -#define SCSIOP_RELEASE_UNIT 0x17 -#define SCSIOP_COPY 0x18 -#define SCSIOP_ERASE 0x19 -#define SCSIOP_MODE_SENSE 0x1A -#define SCSIOP_START_STOP_UNIT 0x1B -#define SCSIOP_STOP_PRINT 0x1B -#define SCSIOP_LOAD_UNLOAD 0x1B -#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C -#define SCSIOP_SEND_DIAGNOSTIC 0x1D -#define SCSIOP_MEDIUM_REMOVAL 0x1E -#define SCSIOP_READ_CAPACITY 0x25 -#define SCSIOP_READ 0x28 -#define SCSIOP_WRITE 0x2A -#define SCSIOP_SEEK 0x2B -#define SCSIOP_LOCATE 0x2B -#define SCSIOP_WRITE_VERIFY 0x2E -#define SCSIOP_VERIFY 0x2F -#define SCSIOP_SEARCH_DATA_HIGH 0x30 -#define SCSIOP_SEARCH_DATA_EQUAL 0x31 -#define SCSIOP_SEARCH_DATA_LOW 0x32 -#define SCSIOP_SET_LIMITS 0x33 -#define SCSIOP_READ_POSITION 0x34 -#define SCSIOP_SYNCHRONIZE_CACHE 0x35 -#define SCSIOP_COMPARE 0x39 -#define SCSIOP_COPY_COMPARE 0x3A -#define SCSIOP_WRITE_DATA_BUFF 0x3B -#define SCSIOP_READ_DATA_BUFF 0x3C -#define SCSIOP_CHANGE_DEFINITION 0x40 -#define SCSIOP_READ_SUB_CHANNEL 0x42 -#define SCSIOP_READ_TOC 0x43 -#define SCSIOP_READ_HEADER 0x44 -#define SCSIOP_PLAY_AUDIO 0x45 -#define SCSIOP_PLAY_AUDIO_MSF 0x47 -#define SCSIOP_PLAY_TRACK_INDEX 0x48 -#define SCSIOP_PLAY_TRACK_RELATIVE 0x49 -#define SCSIOP_PAUSE_RESUME 0x4B -#define SCSIOP_LOG_SELECT 0x4C -#define SCSIOP_LOG_SENSE 0x4D -#define SCSIOP_MODE_SELECT10 0x55 -#define SCSIOP_MODE_SENSE10 0x5A -#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6 -#define SCSIOP_MECHANISM_STATUS 0xBD -#define SCSIOP_READ_CD 0xBE - -// SCSI read capacity structure -typedef struct _READ_CAPACITY_DATA - { - ULONG blks; /* total blocks (converted to little endian) */ - ULONG blksiz; /* size of each (converted to little endian) */ - } READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA; - -// SCSI inquiry data -typedef struct _INQUIRYDATA - { - UCHAR DeviceType :5; - UCHAR DeviceTypeQualifier :3; - UCHAR DeviceTypeModifier :7; - UCHAR RemovableMedia :1; - UCHAR Versions; - UCHAR ResponseDataFormat; - UCHAR AdditionalLength; - UCHAR Reserved[2]; - UCHAR SoftReset :1; - UCHAR CommandQueue :1; - UCHAR Reserved2 :1; - UCHAR LinkedCommands :1; - UCHAR Synchronous :1; - UCHAR Wide16Bit :1; - UCHAR Wide32Bit :1; - UCHAR RelativeAddressing :1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; - } INQUIRYDATA, *PINQUIRYDATA; - -#endif - -// function prototypes -int Pci2000_Detect (Scsi_Host_Template *tpnt); -int Pci2000_Command (Scsi_Cmnd *SCpnt); -int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)); -int Pci2000_Abort (Scsi_Cmnd *SCpnt); -int Pci2000_Reset (Scsi_Cmnd *SCpnt, unsigned int flags); -int Pci2000_Release (struct Scsi_Host *pshost); -int Pci2000_BiosParam (struct scsi_device *sdev, - struct block_device *bdev, - sector_t capacity, int geom[]); - -#endif diff -puN drivers/scsi/pcmcia/nsp_cs.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/pcmcia/nsp_cs.c --- devel/drivers/scsi/pcmcia/nsp_cs.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/pcmcia/nsp_cs.c 2005-07-12 15:21:41.000000000 -0700 @@ -27,7 +27,6 @@ /* $Id: nsp_cs.c,v 1.23 2003/08/18 11:09:19 elca Exp $ */ -#include #include #include #include @@ -85,10 +84,6 @@ static Scsi_Host_Template nsp_driver_tem .proc_name = "nsp_cs", .proc_info = nsp_proc_info, .name = "WorkBit NinjaSCSI-3/32Bi(16bit)", -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) - .detect = nsp_detect_old, - .release = nsp_release_old, -#endif .info = nsp_info, .queuecommand = nsp_queuecommand, /* .eh_abort_handler = nsp_eh_abort,*/ @@ -99,9 +94,6 @@ static Scsi_Host_Template nsp_driver_tem .sg_tablesize = SG_ALL, .cmd_per_lun = 1, .use_clustering = DISABLE_CLUSTERING, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,2)) - .use_new_eh_code = 1, -#endif }; static dev_link_t *dev_list = NULL; @@ -1316,11 +1308,7 @@ static struct Scsi_Host *nsp_detect(Scsi nsp_hw_data *data_b = &nsp_data_base, *data; nsp_dbg(NSP_DEBUG_INIT, "this_id=%d", sht->this_id); -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) host = scsi_host_alloc(&nsp_driver_template, sizeof(nsp_hw_data)); -#else - host = scsi_register(sht, sizeof(nsp_hw_data)); -#endif if (host == NULL) { nsp_dbg(NSP_DEBUG_INIT, "host failed"); return NULL; @@ -1357,37 +1345,6 @@ static struct Scsi_Host *nsp_detect(Scsi return host; /* detect done. */ } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -static int nsp_detect_old(Scsi_Host_Template *sht) -{ - if (nsp_detect(sht) == NULL) { - return 0; - } else { - //MOD_INC_USE_COUNT; - return 1; - } -} - - -static int nsp_release_old(struct Scsi_Host *shpnt) -{ - //nsp_hw_data *data = (nsp_hw_data *)shpnt->hostdata; - - /* PCMCIA Card Service dose same things below. */ - /* So we do nothing. */ - //if (shpnt->irq) { - // free_irq(shpnt->irq, data->ScsiInfo); - //} - //if (shpnt->io_port) { - // release_region(shpnt->io_port, shpnt->n_io_port); - //} - - //MOD_DEC_USE_COUNT; - - return 0; -} -#endif - /*----------------------------------------------------------------*/ /* return info string */ /*----------------------------------------------------------------*/ @@ -1408,16 +1365,11 @@ static const char *nsp_info(struct Scsi_ } while(0) static int nsp_proc_info( -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) struct Scsi_Host *host, -#endif char *buffer, char **start, off_t offset, int length, -#if !(LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) - int hostno, -#endif int inout) { int id; @@ -1426,24 +1378,12 @@ nsp_proc_info( int speed; unsigned long flags; nsp_hw_data *data; -#if !(LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) - struct Scsi_Host *host; -#else int hostno; -#endif if (inout) { return -EINVAL; } -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) hostno = host->host_no; -#else - /* search this HBA host */ - host = scsi_host_hn_get(hostno); - if (host == NULL) { - return -ESRCH; - } -#endif data = (nsp_hw_data *)host->hostdata; @@ -1716,10 +1656,6 @@ static void nsp_cs_config(dev_link_t *li cistpl_cftable_entry_t dflt = { 0 }; struct Scsi_Host *host; nsp_hw_data *data = &nsp_data_base; -#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) - Scsi_Device *dev; - dev_node_t **tail, *node; -#endif nsp_dbg(NSP_DEBUG_INIT, "in"); @@ -1865,17 +1801,7 @@ static void nsp_cs_config(dev_link_t *li goto cs_failed; } -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)) host = nsp_detect(&nsp_driver_template); -#else - scsi_register_host(&nsp_driver_template); - for (host = scsi_host_get_next(NULL); host != NULL; - host = scsi_host_get_next(host)) { - if (host->hostt == &nsp_driver_template) { - break; - } - } -#endif if (host == NULL) { nsp_dbg(NSP_DEBUG_INIT, "detect failed"); @@ -1883,7 +1809,6 @@ static void nsp_cs_config(dev_link_t *li } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) scsi_add_host (host, NULL); scsi_scan_host(host); @@ -1891,52 +1816,6 @@ static void nsp_cs_config(dev_link_t *li link->dev = &info->node; info->host = host; -#else - nsp_dbg(NSP_DEBUG_INIT, "GET_SCSI_INFO"); - tail = &link->dev; - info->ndev = 0; - - nsp_dbg(NSP_DEBUG_INIT, "host=0x%p", host); - - for (dev = host->host_queue; dev != NULL; dev = dev->next) { - unsigned long id; - id = (dev->id & 0x0f) + ((dev->lun & 0x0f) << 4) + - ((dev->channel & 0x0f) << 8) + - ((dev->host->host_no & 0x0f) << 12); - node = &info->node[info->ndev]; - node->minor = 0; - switch (dev->type) { - case TYPE_TAPE: - node->major = SCSI_TAPE_MAJOR; - snprintf(node->dev_name, sizeof(node->dev_name), "st#%04lx", id); - break; - case TYPE_DISK: - case TYPE_MOD: - node->major = SCSI_DISK0_MAJOR; - snprintf(node->dev_name, sizeof(node->dev_name), "sd#%04lx", id); - break; - case TYPE_ROM: - case TYPE_WORM: - node->major = SCSI_CDROM_MAJOR; - snprintf(node->dev_name, sizeof(node->dev_name), "sr#%04lx", id); - break; - default: - node->major = SCSI_GENERIC_MAJOR; - snprintf(node->dev_name, sizeof(node->dev_name), "sg#%04lx", id); - break; - } - *tail = node; tail = &node->next; - info->ndev++; - info->host = dev->host; - } - - *tail = NULL; - if (info->ndev == 0) { - nsp_msg(KERN_INFO, "no SCSI devices found"); - } - nsp_dbg(NSP_DEBUG_INIT, "host=0x%p", host); -#endif - /* Finally, report what we've done */ printk(KERN_INFO "nsp_cs: index 0x%02x: Vcc %d.%d", link->conf.ConfigIndex, @@ -1991,13 +1870,9 @@ static void nsp_cs_release(dev_link_t *l nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); /* Unlink the device chain */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)) if (info->host != NULL) { scsi_remove_host(info->host); } -#else - scsi_unregister_host(&nsp_driver_template); -#endif link->dev = NULL; if (link->win) { @@ -2014,11 +1889,9 @@ static void nsp_cs_release(dev_link_t *l pcmcia_release_irq(link->handle, &link->irq); } link->state &= ~DEV_CONFIG; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,2)) if (info->host != NULL) { scsi_host_put(info->host); } -#endif } /* nsp_cs_release */ /*====================================================================== @@ -2057,9 +1930,6 @@ static int nsp_cs_event(event_t case CS_EVENT_CARD_INSERTION: nsp_dbg(NSP_DEBUG_INIT, "event: insert"); link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) - info->bus = args->bus; -#endif nsp_cs_config(link); break; @@ -2118,7 +1988,6 @@ static int nsp_cs_event(event_t /*======================================================================* * module entry point *====================================================================*/ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68)) static struct pcmcia_device_id nsp_cs_ids[] = { PCMCIA_DEVICE_PROD_ID123("IO DATA", "CBSC16 ", "1", 0x547e66dc, 0x0d63a3fd, 0x51de003a), PCMCIA_DEVICE_PROD_ID123("KME ", "SCSI-CARD-001", "1", 0x534c02bc, 0x52008408, 0x51de003a), @@ -2141,47 +2010,20 @@ static struct pcmcia_driver nsp_driver = .detach = nsp_cs_detach, .id_table = nsp_cs_ids, }; -#endif static int __init nsp_cs_init(void) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68)) nsp_msg(KERN_INFO, "loading..."); return pcmcia_register_driver(&nsp_driver); -#else - servinfo_t serv; - - nsp_msg(KERN_INFO, "loading..."); - pcmcia_get_card_services_info(&serv); - if (serv.Revision != CS_RELEASE_CODE) { - nsp_msg(KERN_DEBUG, "Card Services release does not match!"); - return -EINVAL; - } - register_pcmcia_driver(&dev_info, &nsp_cs_attach, &nsp_cs_detach); - - nsp_dbg(NSP_DEBUG_INIT, "out"); - return 0; -#endif } static void __exit nsp_cs_exit(void) { nsp_msg(KERN_INFO, "unloading..."); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,68)) pcmcia_unregister_driver(&nsp_driver); BUG_ON(dev_list != NULL); -#else - unregister_pcmcia_driver(&dev_info); - /* XXX: this really needs to move into generic code.. */ - while (dev_list != NULL) { - if (dev_list->state & DEV_CONFIG) { - nsp_cs_release(dev_list); - } - nsp_cs_detach(dev_list); - } -#endif } diff -puN drivers/scsi/pcmcia/nsp_cs.h~remove-linux-versionh-from-drivers-scsi drivers/scsi/pcmcia/nsp_cs.h --- devel/drivers/scsi/pcmcia/nsp_cs.h~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/pcmcia/nsp_cs.h 2005-07-12 15:21:41.000000000 -0700 @@ -227,13 +227,7 @@ typedef struct scsi_info_t { dev_link_t link; struct Scsi_Host *host; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,74)) dev_node_t node; -#else - int ndev; - dev_node_t node[8]; - struct bus_operations *bus; -#endif int stop; } scsi_info_t; @@ -304,22 +298,13 @@ static int nsp_cs_event (event_ /* Linux SCSI subsystem specific functions */ static struct Scsi_Host *nsp_detect (Scsi_Host_Template *sht); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -static int nsp_detect_old (Scsi_Host_Template *sht); -static int nsp_release_old(struct Scsi_Host *shpnt); -#endif static const char *nsp_info (struct Scsi_Host *shpnt); static int nsp_proc_info ( -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) struct Scsi_Host *host, -#endif char *buffer, char **start, off_t offset, int length, -#if !(LINUX_VERSION_CODE > KERNEL_VERSION(2,5,73)) - int hostno, -#endif int inout); static int nsp_queuecommand(Scsi_Cmnd *SCpnt, void (* done)(Scsi_Cmnd *SCpnt)); @@ -412,61 +397,8 @@ enum _burst_mode { #define MSG_EXT_SDTR 0x01 -/************************************************************************** - * Compatibility functions - */ - -/* for Kernel 2.4 */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) -# define scsi_register_host(template) scsi_register_module(MODULE_SCSI_HA, template) -# define scsi_unregister_host(template) scsi_unregister_module(MODULE_SCSI_HA, template) -# define scsi_host_put(host) scsi_unregister(host) - -typedef void irqreturn_t; -# define IRQ_NONE /* */ -# define IRQ_HANDLED /* */ -# define IRQ_RETVAL(x) /* */ - -/* This is ad-hoc version of scsi_host_get_next() */ -static inline struct Scsi_Host *scsi_host_get_next(struct Scsi_Host *host) -{ - if (host == NULL) { - return scsi_hostlist; - } else { - return host->next; - } -} - -/* This is ad-hoc version of scsi_host_hn_get() */ -static inline struct Scsi_Host *scsi_host_hn_get(unsigned short hostno) -{ - struct Scsi_Host *host; - - for (host = scsi_host_get_next(NULL); host != NULL; - host = scsi_host_get_next(host)) { - if (host->host_no == hostno) { - break; - } - } - - return host; -} - -static void cs_error(client_handle_t handle, int func, int ret) -{ - error_info_t err = { func, ret }; - pcmcia_report_error(handle, &err); -} - -/* scatter-gather table */ -# define BUFFER_ADDR (SCpnt->SCp.buffer->address) -#endif - -/* for Kernel 2.6 */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) /* scatter-gather table */ # define BUFFER_ADDR ((char *)((unsigned int)(SCpnt->SCp.buffer->page) + SCpnt->SCp.buffer->offset)) -#endif #endif /*__nsp_cs__*/ /* end */ diff -puN drivers/scsi/qla1280.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/qla1280.c --- devel/drivers/scsi/qla1280.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/qla1280.c 2005-07-12 15:21:41.000000000 -0700 @@ -332,7 +332,6 @@ #include #include -#include #include #include #include @@ -356,28 +355,16 @@ #include #include -#if LINUX_VERSION_CODE >= 0x020545 #include #include #include #include #include -#else -#include -#include "scsi.h" -#include -#include "sd.h" -#endif #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_SGI_SN2) #include #endif -#if LINUX_VERSION_CODE < 0x020407 -#error "Kernels older than 2.4.7 are no longer supported" -#endif - - /* * Compile time Options: * 0 - Disable and 1 - Enable @@ -441,52 +428,8 @@ #define NVRAM_DELAY() udelay(500) /* 2 microseconds */ -#if LINUX_VERSION_CODE < 0x020500 -#define HOST_LOCK &io_request_lock -#define irqreturn_t void -#define IRQ_RETVAL(foo) -#define MSG_ORDERED_TAG 1 - -#define DMA_BIDIRECTIONAL SCSI_DATA_UNKNOWN -#define DMA_TO_DEVICE SCSI_DATA_WRITE -#define DMA_FROM_DEVICE SCSI_DATA_READ -#define DMA_NONE SCSI_DATA_NONE - -#ifndef HAVE_SECTOR_T -typedef unsigned int sector_t; -#endif - -static inline void -scsi_adjust_queue_depth(struct scsi_device *device, int tag, int depth) -{ - if (tag) { - device->tagged_queue = tag; - device->current_tag = 0; - } - device->queue_depth = depth; -} -static inline struct Scsi_Host *scsi_host_alloc(Scsi_Host_Template *t, size_t s) -{ - return scsi_register(t, s); -} -static inline void scsi_host_put(struct Scsi_Host *h) -{ - scsi_unregister(h); -} -#else #define HOST_LOCK ha->host->host_lock -#endif -#if LINUX_VERSION_CODE < 0x020600 -#define DEV_SIMPLE_TAGS(device) device->tagged_queue -/* - * Hack around that qla1280_remove_one is called from - * qla1280_release in 2.4 - */ -#undef __devexit -#define __devexit -#else #define DEV_SIMPLE_TAGS(device) device->simple_tags -#endif #if defined(__ia64__) && !defined(ia64_platform_is) #define ia64_platform_is(foo) (!strcmp(x, platform_name)) #endif @@ -506,9 +449,6 @@ static void qla1280_remove_one(struct pc * QLogic Driver Support Function Prototypes. */ static void qla1280_done(struct scsi_qla_host *); -#if LINUX_VERSION_CODE < 0x020545 -static void qla1280_get_target_options(struct scsi_cmnd *, struct scsi_qla_host *); -#endif static int qla1280_get_token(char *); static int qla1280_setup(char *s) __init; @@ -610,11 +550,7 @@ __setup("qla1280=", qla1280_setup); #define CMD_SNSLEN(Cmnd) sizeof(Cmnd->sense_buffer) #define CMD_RESULT(Cmnd) Cmnd->result #define CMD_HANDLE(Cmnd) Cmnd->host_scribble -#if LINUX_VERSION_CODE < 0x020545 -#define CMD_REQUEST(Cmnd) Cmnd->request.cmd -#else #define CMD_REQUEST(Cmnd) Cmnd->request->cmd -#endif #define CMD_HOST(Cmnd) Cmnd->device->host #define SCSI_BUS_32(Cmnd) Cmnd->device->channel @@ -1179,97 +1115,6 @@ qla1280_biosparam(struct scsi_device *sd return 0; } -#if LINUX_VERSION_CODE < 0x020600 -static int -qla1280_detect(Scsi_Host_Template *template) -{ - struct pci_device_id *id = &qla1280_pci_tbl[0]; - struct pci_dev *pdev = NULL; - int num_hosts = 0; - - if (sizeof(struct srb) > sizeof(Scsi_Pointer)) { - printk(KERN_WARNING - "qla1280: struct srb too big, aborting\n"); - return 0; - } - - if ((DMA_BIDIRECTIONAL != PCI_DMA_BIDIRECTIONAL) || - (DMA_TO_DEVICE != PCI_DMA_TODEVICE) || - (DMA_FROM_DEVICE != PCI_DMA_FROMDEVICE) || - (DMA_NONE != PCI_DMA_NONE)) { - printk(KERN_WARNING - "qla1280: dma direction bits don't match\n"); - return 0; - } - -#ifdef MODULE - /* - * If we are called as a module, the qla1280 pointer may not be null - * and it would point to our bootup string, just like on the lilo - * command line. IF not NULL, then process this config string with - * qla1280_setup - * - * Boot time Options - * To add options at boot time add a line to your lilo.conf file like: - * append="qla1280=verbose,max_tags:{{255,255,255,255},{255,255,255,255}}" - * which will result in the first four devices on the first two - * controllers being set to a tagged queue depth of 32. - */ - if (qla1280) - qla1280_setup(qla1280); -#endif - - /* First Initialize QLA12160 on PCI Bus 1 Dev 2 */ - while ((pdev = pci_find_device(id->vendor, id->device, pdev))) { - if (pdev->bus->number == 1 && PCI_SLOT(pdev->devfn) == 2) { - if (!qla1280_probe_one(pdev, id)) - num_hosts++; - } - } - - pdev = NULL; - /* Try and find each different type of adapter we support */ - for (id = &qla1280_pci_tbl[0]; id->device; id++) { - while ((pdev = pci_find_device(id->vendor, id->device, pdev))) { - /* - * skip QLA12160 already initialized on - * PCI Bus 1 Dev 2 since we already initialized - * and presented it - */ - if (id->device == PCI_DEVICE_ID_QLOGIC_ISP12160 && - pdev->bus->number == 1 && - PCI_SLOT(pdev->devfn) == 2) - continue; - - if (!qla1280_probe_one(pdev, id)) - num_hosts++; - } - } - - return num_hosts; -} - -/* - * This looks a bit ugly as we could just pass down host to - * qla1280_remove_one, but I want to keep qla1280_release purely a wrapper - * around pci_driver::remove as used from 2.6 onwards. - */ -static int -qla1280_release(struct Scsi_Host *host) -{ - struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; - - qla1280_remove_one(ha->pdev); - return 0; -} - -static int -qla1280_biosparam_old(Disk * disk, kdev_t dev, int geom[]) -{ - return qla1280_biosparam(disk->device, NULL, disk->capacity, geom); -} -#endif - /************************************************************************** * qla1280_intr_handler * Handles the H/W interrupt @@ -1388,11 +1233,9 @@ qla1280_slave_configure(struct scsi_devi scsi_adjust_queue_depth(device, 0, default_depth); } -#if LINUX_VERSION_CODE > 0x020500 nv->bus[bus].target[target].parameter.f.enable_sync = device->sdtr; nv->bus[bus].target[target].parameter.f.enable_wide = device->wdtr; nv->bus[bus].target[target].ppr_1x160.flags.enable_ppr = device->ppr; -#endif if (driver_setup.no_sync || (driver_setup.sync_mask && @@ -1417,31 +1260,6 @@ qla1280_slave_configure(struct scsi_devi return status; } -#if LINUX_VERSION_CODE < 0x020545 -/************************************************************************** - * qla1280_select_queue_depth - * - * Sets the queue depth for each SCSI device hanging off the input - * host adapter. We use a queue depth of 2 for devices that do not - * support tagged queueing. - **************************************************************************/ -static void -qla1280_select_queue_depth(struct Scsi_Host *host, struct scsi_device *sdev_q) -{ - struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; - struct scsi_device *sdev; - - ENTER("qla1280_select_queue_depth"); - for (sdev = sdev_q; sdev; sdev = sdev->next) - if (sdev->host == host) - qla1280_slave_configure(sdev); - - if (sdev_q) - qla1280_check_for_dead_scsi_bus(ha, sdev_q->channel); - LEAVE("qla1280_select_queue_depth"); -} -#endif - /* * qla1280_done * Process completed commands. @@ -1501,10 +1319,6 @@ qla1280_done(struct scsi_qla_host *ha) CMD_HANDLE(sp->cmd) = (unsigned char *)INVALID_HANDLE; ha->actthreads--; -#if LINUX_VERSION_CODE < 0x020500 - if (cmd->cmnd[0] == INQUIRY) - qla1280_get_target_options(cmd, ha); -#endif (*(cmd)->scsi_done)(cmd); if(sp->wait != NULL) @@ -1667,9 +1481,7 @@ qla1280_initialize_adapter(struct scsi_q struct device_reg __iomem *reg; int status; int bus; -#if LINUX_VERSION_CODE > 0x020500 unsigned long flags; -#endif ENTER("qla1280_initialize_adapter"); @@ -1708,7 +1520,6 @@ qla1280_initialize_adapter(struct scsi_q "NVRAM\n"); } -#if LINUX_VERSION_CODE >= 0x020500 /* * It's necessary to grab the spin here as qla1280_mailbox_command * needs to be able to drop the lock unconditionally to wait @@ -1716,7 +1527,6 @@ qla1280_initialize_adapter(struct scsi_q * In 2.4 ->detect is called with the io_request_lock held. */ spin_lock_irqsave(HOST_LOCK, flags); -#endif status = qla1280_load_firmware(ha); if (status) { @@ -1748,9 +1558,7 @@ qla1280_initialize_adapter(struct scsi_q ha->flags.online = 1; out: -#if LINUX_VERSION_CODE >= 0x020500 spin_unlock_irqrestore(HOST_LOCK, flags); -#endif if (status) dprintk(2, "qla1280_initialize_adapter: **** FAILED ****\n"); @@ -3967,51 +3775,6 @@ qla1280_rst_aen(struct scsi_qla_host *ha LEAVE("qla1280_rst_aen"); } - -#if LINUX_VERSION_CODE < 0x020500 -/* - * - */ -static void -qla1280_get_target_options(struct scsi_cmnd *cmd, struct scsi_qla_host *ha) -{ - unsigned char *result; - struct nvram *n; - int bus, target, lun; - - bus = SCSI_BUS_32(cmd); - target = SCSI_TCN_32(cmd); - lun = SCSI_LUN_32(cmd); - - /* - * Make sure to not touch anything if someone is using the - * sg interface. - */ - if (cmd->use_sg || (CMD_RESULT(cmd) >> 16) != DID_OK || lun) - return; - - result = cmd->request_buffer; - n = &ha->nvram; - - n->bus[bus].target[target].parameter.f.enable_wide = 0; - n->bus[bus].target[target].parameter.f.enable_sync = 0; - n->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 0; - - if (result[7] & 0x60) - n->bus[bus].target[target].parameter.f.enable_wide = 1; - if (result[7] & 0x10) - n->bus[bus].target[target].parameter.f.enable_sync = 1; - if ((result[2] >= 3) && (result[4] + 5 > 56) && - (result[56] & 0x4)) - n->bus[bus].target[target].ppr_1x160.flags.enable_ppr = 1; - - dprintk(2, "get_target_options(): wide %i, sync %i, ppr %i\n", - n->bus[bus].target[target].parameter.f.enable_wide, - n->bus[bus].target[target].parameter.f.enable_sync, - n->bus[bus].target[target].ppr_1x160.flags.enable_ppr); -} -#endif - /* * qla1280_status_entry * Processes received ISP status entry. @@ -4564,7 +4327,6 @@ qla1280_get_token(char *str) return ret; } -#if LINUX_VERSION_CODE >= 0x020600 static struct scsi_host_template qla1280_driver_template = { .module = THIS_MODULE, .proc_name = "qla1280", @@ -4583,27 +4345,6 @@ static struct scsi_host_template qla1280 .cmd_per_lun = 1, .use_clustering = ENABLE_CLUSTERING, }; -#else -static Scsi_Host_Template qla1280_driver_template = { - .proc_name = "qla1280", - .name = "Qlogic ISP 1280/12160", - .detect = qla1280_detect, - .release = qla1280_release, - .info = qla1280_info, - .queuecommand = qla1280_queuecommand, - .eh_abort_handler = qla1280_eh_abort, - .eh_device_reset_handler= qla1280_eh_device_reset, - .eh_bus_reset_handler = qla1280_eh_bus_reset, - .eh_host_reset_handler = qla1280_eh_adapter_reset, - .bios_param = qla1280_biosparam_old, - .can_queue = 0xfffff, - .this_id = -1, - .sg_tablesize = SG_ALL, - .cmd_per_lun = 1, - .use_clustering = ENABLE_CLUSTERING, - .use_new_eh_code = 1, -}; -#endif static int __devinit qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) @@ -4694,10 +4435,6 @@ qla1280_probe_one(struct pci_dev *pdev, host->max_sectors = 1024; host->unique_id = host->host_no; -#if LINUX_VERSION_CODE < 0x020545 - host->select_queue_depths = qla1280_select_queue_depth; -#endif - error = -ENODEV; #if MEMORY_MAPPED_IO @@ -4745,21 +4482,15 @@ qla1280_probe_one(struct pci_dev *pdev, pci_set_drvdata(pdev, host); -#if LINUX_VERSION_CODE >= 0x020600 error = scsi_add_host(host, &pdev->dev); if (error) goto error_disable_adapter; scsi_scan_host(host); -#else - scsi_set_pci_device(host, pdev); -#endif return 0; -#if LINUX_VERSION_CODE >= 0x020600 error_disable_adapter: WRT_REG_WORD(&ha->iobase->ictrl, 0); -#endif error_free_irq: free_irq(pdev->irq, ha); error_release_region: @@ -4791,9 +4522,7 @@ qla1280_remove_one(struct pci_dev *pdev) struct Scsi_Host *host = pci_get_drvdata(pdev); struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata; -#if LINUX_VERSION_CODE >= 0x020600 scsi_remove_host(host); -#endif WRT_REG_WORD(&ha->iobase->ictrl, 0); @@ -4817,7 +4546,6 @@ qla1280_remove_one(struct pci_dev *pdev) scsi_host_put(host); } -#if LINUX_VERSION_CODE >= 0x020600 static struct pci_driver qla1280_pci_driver = { .name = "qla1280", .id_table = qla1280_pci_tbl, @@ -4863,11 +4591,6 @@ qla1280_exit(void) module_init(qla1280_init); module_exit(qla1280_exit); -#else -# define driver_template qla1280_driver_template -# include "scsi_module.c" -#endif - MODULE_AUTHOR("Qlogic & Jes Sorensen"); MODULE_DESCRIPTION("Qlogic ISP SCSI (qla1x80/qla1x160) driver"); MODULE_LICENSE("GPL"); diff -puN drivers/scsi/scsi_debug.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/scsi_debug.c --- devel/drivers/scsi/scsi_debug.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/scsi_debug.c 2005-07-12 15:21:41.000000000 -0700 @@ -48,10 +48,6 @@ #include -#ifndef LINUX_VERSION_CODE -#include -#endif - #include "scsi_logging.h" #include "scsi_debug.h" diff -puN drivers/scsi/sg.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/sg.c --- devel/drivers/scsi/sg.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/sg.c 2005-07-12 15:21:41.000000000 -0700 @@ -67,10 +67,6 @@ static int sg_proc_init(void); static void sg_proc_cleanup(void); #endif -#ifndef LINUX_VERSION_CODE -#include -#endif /* LINUX_VERSION_CODE */ - #define SG_ALLOW_DIO_DEF 0 #define SG_ALLOW_DIO_CODE /* compile out by commenting this define */ diff -puN drivers/scsi/sgiwd93.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/sgiwd93.c --- devel/drivers/scsi/sgiwd93.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/sgiwd93.c 2005-07-12 15:21:41.000000000 -0700 @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/scsi/wd33c93.c~remove-linux-versionh-from-drivers-scsi drivers/scsi/wd33c93.c --- devel/drivers/scsi/wd33c93.c~remove-linux-versionh-from-drivers-scsi 2005-07-12 15:21:41.000000000 -0700 +++ devel-akpm/drivers/scsi/wd33c93.c 2005-07-12 15:21:41.000000000 -0700 @@ -77,7 +77,6 @@ #include #include #include -#include #include #include #include _