Partial update for 2.6.22

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@152 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2007-07-23 11:51:05 +00:00
parent 0f286f40f5
commit 5814b4ba13
10 changed files with 140 additions and 9 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+7
View File
@@ -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
+2 -2
View File
@@ -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
+109
View File
@@ -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)
{
+15
View File
@@ -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));
+2 -2
View File
@@ -167,7 +167,7 @@ static DECLARE_MUTEX(scst_proc_mutex);
#include <linux/ctype.h>
#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)