aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorMarcus Barrow <marcus.barrow@qlogic.com>2008-01-17 12:02:13 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 12:29:31 -0500
commit0b05a1f0d68bf4714c37aa7843c31df1866b017a (patch)
treee228b6fc9b9afabad5c22bd693159a2eb1e003e7 /drivers/scsi/qla2xxx/qla_os.c
parenta4722cf24d7a0dfa0874d49f61b053a6459761bf (diff)
[SCSI] qla2xxx: Use completion routines.
Instead of abusing the semaphore interfaces for mailbox command completions. Additional cleanups and Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 0a414c0dd580..b9ee56567940 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1692,9 +1692,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1692 /* load the F/W, read paramaters, and init the H/W */ 1692 /* load the F/W, read paramaters, and init the H/W */
1693 ha->instance = num_hosts; 1693 ha->instance = num_hosts;
1694 1694
1695 init_MUTEX(&ha->mbx_cmd_sem);
1696 init_MUTEX(&ha->vport_sem); 1695 init_MUTEX(&ha->vport_sem);
1697 init_MUTEX_LOCKED(&ha->mbx_intr_sem); 1696 init_completion(&ha->mbx_cmd_comp);
1697 complete(&ha->mbx_cmd_comp);
1698 init_completion(&ha->mbx_intr_comp);
1698 1699
1699 INIT_LIST_HEAD(&ha->list); 1700 INIT_LIST_HEAD(&ha->list);
1700 INIT_LIST_HEAD(&ha->fcports); 1701 INIT_LIST_HEAD(&ha->fcports);
@@ -2739,23 +2740,6 @@ qla2x00_timer(scsi_qla_host_t *ha)
2739 qla2x00_restart_timer(ha, WATCH_INTERVAL); 2740 qla2x00_restart_timer(ha, WATCH_INTERVAL);
2740} 2741}
2741 2742
2742/* XXX(hch): crude hack to emulate a down_timeout() */
2743int
2744qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout)
2745{
2746 const unsigned int step = 100; /* msecs */
2747 unsigned int iterations = jiffies_to_msecs(timeout)/100;
2748
2749 do {
2750 if (!down_trylock(sema))
2751 return 0;
2752 if (msleep_interruptible(step))
2753 break;
2754 } while (--iterations > 0);
2755
2756 return -ETIMEDOUT;
2757}
2758
2759/* Firmware interface routines. */ 2743/* Firmware interface routines. */
2760 2744
2761#define FW_BLOBS 6 2745#define FW_BLOBS 6