diff options
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index ffc1edf5e80d..b4f6c9a84e71 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -49,7 +49,6 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver"); | |||
49 | #include <linux/kernel.h> /* for printk */ | 49 | #include <linux/kernel.h> /* for printk */ |
50 | #include <linux/sched.h> | 50 | #include <linux/sched.h> |
51 | #include <linux/reboot.h> | 51 | #include <linux/reboot.h> |
52 | #include <linux/smp_lock.h> | ||
53 | #include <linux/spinlock.h> | 52 | #include <linux/spinlock.h> |
54 | #include <linux/dma-mapping.h> | 53 | #include <linux/dma-mapping.h> |
55 | 54 | ||
@@ -76,6 +75,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver"); | |||
76 | * Needed for our management apps | 75 | * Needed for our management apps |
77 | *============================================================================ | 76 | *============================================================================ |
78 | */ | 77 | */ |
78 | static DEFINE_MUTEX(adpt_mutex); | ||
79 | static dpt_sig_S DPTI_sig = { | 79 | static dpt_sig_S DPTI_sig = { |
80 | {'d', 'P', 't', 'S', 'i', 'G'}, SIG_VERSION, | 80 | {'d', 'P', 't', 'S', 'i', 'G'}, SIG_VERSION, |
81 | #ifdef __i386__ | 81 | #ifdef __i386__ |
@@ -126,6 +126,7 @@ static const struct file_operations adpt_fops = { | |||
126 | #ifdef CONFIG_COMPAT | 126 | #ifdef CONFIG_COMPAT |
127 | .compat_ioctl = compat_adpt_ioctl, | 127 | .compat_ioctl = compat_adpt_ioctl, |
128 | #endif | 128 | #endif |
129 | .llseek = noop_llseek, | ||
129 | }; | 130 | }; |
130 | 131 | ||
131 | /* Structures and definitions for synchronous message posting. | 132 | /* Structures and definitions for synchronous message posting. |
@@ -422,7 +423,7 @@ static int adpt_slave_configure(struct scsi_device * device) | |||
422 | return 0; | 423 | return 0; |
423 | } | 424 | } |
424 | 425 | ||
425 | static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) | 426 | static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) |
426 | { | 427 | { |
427 | adpt_hba* pHba = NULL; | 428 | adpt_hba* pHba = NULL; |
428 | struct adpt_device* pDev = NULL; /* dpt per device information */ | 429 | struct adpt_device* pDev = NULL; /* dpt per device information */ |
@@ -490,6 +491,8 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *)) | |||
490 | return adpt_scsi_to_i2o(pHba, cmd, pDev); | 491 | return adpt_scsi_to_i2o(pHba, cmd, pDev); |
491 | } | 492 | } |
492 | 493 | ||
494 | static DEF_SCSI_QCMD(adpt_queue) | ||
495 | |||
493 | static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, | 496 | static int adpt_bios_param(struct scsi_device *sdev, struct block_device *dev, |
494 | sector_t capacity, int geom[]) | 497 | sector_t capacity, int geom[]) |
495 | { | 498 | { |
@@ -777,7 +780,7 @@ static int adpt_abort(struct scsi_cmnd * cmd) | |||
777 | return FAILED; | 780 | return FAILED; |
778 | } | 781 | } |
779 | pHba = (adpt_hba*) cmd->device->host->hostdata[0]; | 782 | pHba = (adpt_hba*) cmd->device->host->hostdata[0]; |
780 | printk(KERN_INFO"%s: Trying to Abort cmd=%ld\n",pHba->name, cmd->serial_number); | 783 | printk(KERN_INFO"%s: Trying to Abort\n",pHba->name); |
781 | if ((dptdevice = (void*) (cmd->device->hostdata)) == NULL) { | 784 | if ((dptdevice = (void*) (cmd->device->hostdata)) == NULL) { |
782 | printk(KERN_ERR "%s: Unable to abort: No device in cmnd\n",pHba->name); | 785 | printk(KERN_ERR "%s: Unable to abort: No device in cmnd\n",pHba->name); |
783 | return FAILED; | 786 | return FAILED; |
@@ -799,10 +802,10 @@ static int adpt_abort(struct scsi_cmnd * cmd) | |||
799 | printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name); | 802 | printk(KERN_INFO"%s: Abort cmd not supported\n",pHba->name); |
800 | return FAILED; | 803 | return FAILED; |
801 | } | 804 | } |
802 | printk(KERN_INFO"%s: Abort cmd=%ld failed.\n",pHba->name, cmd->serial_number); | 805 | printk(KERN_INFO"%s: Abort failed.\n",pHba->name); |
803 | return FAILED; | 806 | return FAILED; |
804 | } | 807 | } |
805 | printk(KERN_INFO"%s: Abort cmd=%ld complete.\n",pHba->name, cmd->serial_number); | 808 | printk(KERN_INFO"%s: Abort complete.\n",pHba->name); |
806 | return SUCCESS; | 809 | return SUCCESS; |
807 | } | 810 | } |
808 | 811 | ||
@@ -1732,12 +1735,12 @@ static int adpt_open(struct inode *inode, struct file *file) | |||
1732 | int minor; | 1735 | int minor; |
1733 | adpt_hba* pHba; | 1736 | adpt_hba* pHba; |
1734 | 1737 | ||
1735 | lock_kernel(); | 1738 | mutex_lock(&adpt_mutex); |
1736 | //TODO check for root access | 1739 | //TODO check for root access |
1737 | // | 1740 | // |
1738 | minor = iminor(inode); | 1741 | minor = iminor(inode); |
1739 | if (minor >= hba_count) { | 1742 | if (minor >= hba_count) { |
1740 | unlock_kernel(); | 1743 | mutex_unlock(&adpt_mutex); |
1741 | return -ENXIO; | 1744 | return -ENXIO; |
1742 | } | 1745 | } |
1743 | mutex_lock(&adpt_configuration_lock); | 1746 | mutex_lock(&adpt_configuration_lock); |
@@ -1748,7 +1751,7 @@ static int adpt_open(struct inode *inode, struct file *file) | |||
1748 | } | 1751 | } |
1749 | if (pHba == NULL) { | 1752 | if (pHba == NULL) { |
1750 | mutex_unlock(&adpt_configuration_lock); | 1753 | mutex_unlock(&adpt_configuration_lock); |
1751 | unlock_kernel(); | 1754 | mutex_unlock(&adpt_mutex); |
1752 | return -ENXIO; | 1755 | return -ENXIO; |
1753 | } | 1756 | } |
1754 | 1757 | ||
@@ -1759,7 +1762,7 @@ static int adpt_open(struct inode *inode, struct file *file) | |||
1759 | 1762 | ||
1760 | pHba->in_use = 1; | 1763 | pHba->in_use = 1; |
1761 | mutex_unlock(&adpt_configuration_lock); | 1764 | mutex_unlock(&adpt_configuration_lock); |
1762 | unlock_kernel(); | 1765 | mutex_unlock(&adpt_mutex); |
1763 | 1766 | ||
1764 | return 0; | 1767 | return 0; |
1765 | } | 1768 | } |
@@ -2160,9 +2163,9 @@ static long adpt_unlocked_ioctl(struct file *file, uint cmd, ulong arg) | |||
2160 | 2163 | ||
2161 | inode = file->f_dentry->d_inode; | 2164 | inode = file->f_dentry->d_inode; |
2162 | 2165 | ||
2163 | lock_kernel(); | 2166 | mutex_lock(&adpt_mutex); |
2164 | ret = adpt_ioctl(inode, file, cmd, arg); | 2167 | ret = adpt_ioctl(inode, file, cmd, arg); |
2165 | unlock_kernel(); | 2168 | mutex_unlock(&adpt_mutex); |
2166 | 2169 | ||
2167 | return ret; | 2170 | return ret; |
2168 | } | 2171 | } |
@@ -2176,7 +2179,7 @@ static long compat_adpt_ioctl(struct file *file, | |||
2176 | 2179 | ||
2177 | inode = file->f_dentry->d_inode; | 2180 | inode = file->f_dentry->d_inode; |
2178 | 2181 | ||
2179 | lock_kernel(); | 2182 | mutex_lock(&adpt_mutex); |
2180 | 2183 | ||
2181 | switch(cmd) { | 2184 | switch(cmd) { |
2182 | case DPT_SIGNATURE: | 2185 | case DPT_SIGNATURE: |
@@ -2194,7 +2197,7 @@ static long compat_adpt_ioctl(struct file *file, | |||
2194 | ret = -ENOIOCTLCMD; | 2197 | ret = -ENOIOCTLCMD; |
2195 | } | 2198 | } |
2196 | 2199 | ||
2197 | unlock_kernel(); | 2200 | mutex_unlock(&adpt_mutex); |
2198 | 2201 | ||
2199 | return ret; | 2202 | return ret; |
2200 | } | 2203 | } |