diff --git a/qla2x00t/ql2100.c b/qla2x00t/ql2100.c index f5db2235e..e5e71856b 100644 --- a/qla2x00t/ql2100.c +++ b/qla2x00t/ql2100.c @@ -73,7 +73,7 @@ static struct pci_driver qla2100_pci_driver = { static int __init qla2100_init(void) { - return pci_module_init(&qla2100_pci_driver); + return pci_register_driver(&qla2100_pci_driver); } static void __exit diff --git a/qla2x00t/ql2200.c b/qla2x00t/ql2200.c index 0eef72dc8..519e75018 100644 --- a/qla2x00t/ql2200.c +++ b/qla2x00t/ql2200.c @@ -73,7 +73,7 @@ static struct pci_driver qla2200_pci_driver = { static int __init qla2200_init(void) { - return pci_module_init(&qla2200_pci_driver); + return pci_register_driver(&qla2200_pci_driver); } static void __exit diff --git a/qla2x00t/ql2300.c b/qla2x00t/ql2300.c index e7a93ddda..0798d7d5f 100644 --- a/qla2x00t/ql2300.c +++ b/qla2x00t/ql2300.c @@ -96,7 +96,7 @@ static struct pci_driver qla2300_pci_driver = { static int __init qla2300_init(void) { - return pci_module_init(&qla2300_pci_driver); + return pci_register_driver(&qla2300_pci_driver); } static void __exit diff --git a/qla2x00t/ql2322.c b/qla2x00t/ql2322.c index 3c8cafc12..22f685a27 100644 --- a/qla2x00t/ql2322.c +++ b/qla2x00t/ql2322.c @@ -101,7 +101,7 @@ static struct pci_driver qla2322_pci_driver = { static int __init qla2322_init(void) { - return pci_module_init(&qla2322_pci_driver); + return pci_register_driver(&qla2322_pci_driver); } static void __exit diff --git a/qla2x00t/ql2400.c b/qla2x00t/ql2400.c index ccb016f40..6a79b52a6 100644 --- a/qla2x00t/ql2400.c +++ b/qla2x00t/ql2400.c @@ -121,7 +121,7 @@ static struct pci_driver qla24xx_pci_driver = { static int __init qla24xx_init(void) { - return pci_module_init(&qla24xx_pci_driver); + return pci_register_driver(&qla24xx_pci_driver); } static void __exit diff --git a/qla2x00t/qla_def.h b/qla2x00t/qla_def.h index 47e0fd302..805955931 100644 --- a/qla2x00t/qla_def.h +++ b/qla2x00t/qla_def.h @@ -98,6 +98,13 @@ #define LSD(x) ((uint32_t)((uint64_t)(x))) #define MSD(x) ((uint32_t)((((uint64_t)(x)) >> 16) >> 16)) +#ifndef IRQF_DISABLED +#define IRQF_DISABLED SA_INTERRUPT +#endif + +#ifndef IRQF_SHARED +#define IRQF_SHARED SA_SHIRQ +#endif /* * I/O register diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index e780db53e..f63edacae 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -1557,7 +1557,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) host->transportt = qla2xxx_transport_template; ret = request_irq(pdev->irq, ha->isp_ops.intr_handler, - SA_INTERRUPT|SA_SHIRQ, ha->brd_info->drv_name, ha); + IRQF_DISABLED|IRQF_SHARED, ha->brd_info->drv_name, ha); if (ret) { qla_printk(KERN_WARNING, ha, "Failed to reserve interrupt %d already in use.\n", @@ -2744,7 +2744,7 @@ static struct pci_driver qla2xxx_pci_driver = { static inline int qla2x00_pci_module_init(void) { - return pci_module_init(&qla2xxx_pci_driver); + return pci_register_driver(&qla2xxx_pci_driver); } static inline void diff --git a/scst/kernel/scst_exec_req_fifo-2.6.22.patch b/scst/kernel/scst_exec_req_fifo-2.6.22.patch new file mode 100644 index 000000000..23ff63927 --- /dev/null +++ b/scst/kernel/scst_exec_req_fifo-2.6.22.patch @@ -0,0 +1,109 @@ +diff -upr linux-2.6.22/drivers/scsi/scsi_lib.c linux-2.6.22/drivers/scsi/scsi_lib.c +--- linux-2.6.22/drivers/scsi/scsi_lib.c 2007-07-09 03:32:17.000000000 +0400 ++++ linux-2.6.22/drivers/scsi/scsi_lib.c 2007-07-18 13:34:54.000000000 +0400 +@@ -366,7 +366,7 @@ free_bios: + } + + /** +- * scsi_execute_async - insert request ++ * __scsi_execute_async - insert request + * @sdev: scsi device + * @cmd: scsi command + * @cmd_len: length of scsi cdb +@@ -377,11 +377,14 @@ free_bios: + * @timeout: request timeout in seconds + * @retries: number of times to retry request + * @flags: or into request flags ++ * @at_head: insert request at head or tail of queue + **/ +-int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, ++static inline int __scsi_execute_async(struct scsi_device *sdev, ++ const unsigned char *cmd, + int cmd_len, int data_direction, void *buffer, unsigned bufflen, + int use_sg, int timeout, int retries, void *privdata, +- void (*done)(void *, char *, int, int), gfp_t gfp) ++ void (*done)(void *, char *, int, int), gfp_t gfp, ++ int at_head) + { + struct request *req; + struct scsi_io_context *sioc; +@@ -418,7 +421,7 @@ int scsi_execute_async(struct scsi_devic + sioc->data = privdata; + sioc->done = done; + +- blk_execute_rq_nowait(req->q, NULL, req, 1, scsi_end_async); ++ blk_execute_rq_nowait(req->q, NULL, req, at_head, scsi_end_async); + return 0; + + free_req: +@@ -427,8 +430,53 @@ free_sense: + kmem_cache_free(scsi_io_context_cache, sioc); + return DRIVER_ERROR << 24; + } ++ ++/** ++ * scsi_execute_async - insert request ++ * @sdev: scsi device ++ * @cmd: scsi command ++ * @cmd_len: length of scsi cdb ++ * @data_direction: data direction ++ * @buffer: data buffer (this can be a kernel buffer or scatterlist) ++ * @bufflen: len of buffer ++ * @use_sg: if buffer is a scatterlist this is the number of elements ++ * @timeout: request timeout in seconds ++ * @retries: number of times to retry request ++ * @flags: or into request flags ++ **/ ++int scsi_execute_async(struct scsi_device *sdev, const unsigned char *cmd, ++ int cmd_len, int data_direction, void *buffer, unsigned bufflen, ++ int use_sg, int timeout, int retries, void *privdata, ++ void (*done)(void *, char *, int, int), gfp_t gfp) ++{ ++ return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer, ++ bufflen, use_sg, timeout, retries, privdata, done, gfp, 1); ++} + EXPORT_SYMBOL_GPL(scsi_execute_async); + ++/** ++ * scsi_execute_async_fifo - insert request at tail, in FIFO order ++ * @sdev: scsi device ++ * @cmd: scsi command ++ * @cmd_len: length of scsi cdb ++ * @data_direction: data direction ++ * @buffer: data buffer (this can be a kernel buffer or scatterlist) ++ * @bufflen: len of buffer ++ * @use_sg: if buffer is a scatterlist this is the number of elements ++ * @timeout: request timeout in seconds ++ * @retries: number of times to retry request ++ * @flags: or into request flags ++ **/ ++int scsi_execute_async_fifo(struct scsi_device *sdev, const unsigned char *cmd, ++ int cmd_len, int data_direction, void *buffer, unsigned bufflen, ++ int use_sg, int timeout, int retries, void *privdata, ++ void (*done)(void *, char *, int, int), gfp_t gfp) ++{ ++ return __scsi_execute_async(sdev, cmd, cmd_len, data_direction, buffer, ++ bufflen, use_sg, timeout, retries, privdata, done, gfp, 0); ++} ++EXPORT_SYMBOL_GPL(scsi_execute_async_fifo); ++ + /* + * Function: scsi_init_cmd_errh() + * +diff -upr linux-2.6.22/include/scsi/scsi_device.h linux-2.6.22/include/scsi/scsi_device.h +--- linux-2.6.22/include/scsi/scsi_device.h 2007-07-09 03:32:17.000000000 +0400 ++++ linux-2.6.22/include/scsi/scsi_device.h 2007-07-18 13:34:54.000000000 +0400 +@@ -303,6 +303,13 @@ extern int scsi_execute_async(struct scs + int timeout, int retries, void *privdata, + void (*done)(void *, char *, int, int), + gfp_t gfp); ++#define SCSI_EXEC_REQ_FIFO_DEFINED ++extern int scsi_execute_async_fifo(struct scsi_device *sdev, ++ const unsigned char *cmd, int cmd_len, int data_direction, ++ void *buffer, unsigned bufflen, int use_sg, ++ int timeout, int retries, void *privdata, ++ void (*done)(void *, char *, int, int), ++ gfp_t gfp); + + static inline int __must_check scsi_device_reprobe(struct scsi_device *sdev) + { diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 3b684d8b2..80b5335ce 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -41,6 +41,19 @@ * of the existing SLAB code. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) +#error 2.6.22+ kernels are not supported yet, because some oversmart nerd \ +has deleted support for destructors from SLABs in those kernels and was \ +unresponsible enough to made that without even set it in the deprecated \ +status for some time to allow depending on it projects fix it without \ +disturbing their users. Blame him for that! So, now to be usable on \ +2.6.22+ kernels SCST requires a complete rewrite of one of its major low \ +level parts: all kmem_cache_*() functions in this file should be replaced \ +with new ones with similar functionality. I'm not sure I will have time for \ +that in the near future, therefore you are welcome to implement that. \ +Don't hesitate to ask me how to do it most effectively. VLNB. +#endif + /* Chosen to have one page per slab for all orders */ #ifdef CONFIG_DEBUG_SLAB #define SGV_MAX_LOCAL_SLAB_ORDER 4 @@ -505,9 +518,11 @@ static void sgv_ctor(void *data, struct kmem_cache *c, unsigned long flags) { struct sgv_pool_obj *obj = data; +#ifdef SLAB_CTOR_VERIFY if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) != SLAB_CTOR_CONSTRUCTOR) return; +#endif TRACE_MEM("Constructor for sgv_obj %p", obj); memset(obj, 0, sizeof(*obj)); diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c index 0f5fa217d..c662e9eb7 100644 --- a/scst/src/scst_proc.c +++ b/scst/src/scst_proc.c @@ -167,7 +167,7 @@ static DECLARE_MUTEX(scst_proc_mutex); #include -#if !defined(CONFIG_PPC) +#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) #if defined(DEBUG) || defined(TRACING) static int strcasecmp(const char *s1, const char *s2) @@ -191,7 +191,7 @@ static int strncasecmp(const char *s1, const char *s2, int n) return c1 - c2; } -#endif /* CONFIG_PPC */ +#endif /* !CONFIG_PPC && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) */ #if defined(DEBUG) || defined(TRACING)