X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fscsi%2Fqla1280.c;h=54d8bdf86852b7541542298b05ce1f20b0c55c9e;hb=8dfb537933a87588e83196d14cd9ec245eb065b8;hp=680f6063954b2a94a3246266a68bdd830fa1fe96;hpb=74d0a988d3aa359b6b8a8536c8cb92cce02ca5d5;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 680f606..54d8bdf 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -192,7 +192,7 @@ - Don't walk the entire list in qla1280_putq_t() just to directly grab the pointer to the last element afterwards Rev 3.23.5 Beta August 9, 2001, Jes Sorensen - - Don't use SA_INTERRUPT, it's use is deprecated for this kinda driver + - Don't use IRQF_DISABLED, it's use is deprecated for this kinda driver Rev 3.23.4 Beta August 8, 2001, Jes Sorensen - Set dev->max_sectors to 1024 Rev 3.23.3 Beta August 6, 2001, Jes Sorensen @@ -331,7 +331,6 @@ *****************************************************************************/ -#include #include #include @@ -342,7 +341,6 @@ #include #include #include -#include #include #include #include @@ -814,7 +812,7 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action) uint16_t data; unsigned char *handle; int result, i; - DECLARE_COMPLETION(wait); + DECLARE_COMPLETION_ONSTACK(wait); struct timer_list timer; ha = (struct scsi_qla_host *)(CMD_HOST(cmd)->hostdata); @@ -932,11 +930,10 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action) case BUS_RESET: if (qla1280_verbose) - printk(KERN_INFO "qla1280(%ld:%d): Issuing BUS " - "DEVICE RESET\n", ha->host_no, bus); - if (qla1280_bus_reset(ha, bus == 0)) + printk(KERN_INFO "qla1280(%ld:%d): Issued bus " + "reset.\n", ha->host_no, bus); + if (qla1280_bus_reset(ha, bus) == 0) result = SUCCESS; - break; case ADAPTER_RESET: @@ -1114,7 +1111,7 @@ qla1280_enable_intrs(struct scsi_qla_host *ha) * Handles the H/W interrupt **************************************************************************/ static irqreturn_t -qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs) +qla1280_intr_handler(int irq, void *dev_id) { struct scsi_qla_host *ha; struct device_reg __iomem *reg; @@ -1343,7 +1340,7 @@ qla1280_return_status(struct response * sts, struct scsi_cmnd *cp) int host_status = DID_ERROR; uint16_t comp_status = le16_to_cpu(sts->comp_status); uint16_t state_flags = le16_to_cpu(sts->state_flags); - uint16_t residual_length = le32_to_cpu(sts->residual_length); + uint32_t residual_length = le32_to_cpu(sts->residual_length); uint16_t scsi_status = le16_to_cpu(sts->scsi_status); #if DEBUG_QLA1280_INTR static char *reason[] = { @@ -1415,8 +1412,10 @@ qla1280_return_status(struct response * sts, struct scsi_cmnd *cp) "scsi: Underflow detected - retrying " "command.\n"); host_status = DID_ERROR; - } else + } else { + cp->resid = residual_length; host_status = DID_OK; + } break; default: @@ -2407,7 +2406,7 @@ qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb) uint16_t *optr, *iptr; uint16_t __iomem *mptr; uint16_t data; - DECLARE_COMPLETION(wait); + DECLARE_COMPLETION_ONSTACK(wait); struct timer_list timer; ENTER("qla1280_mailbox_command"); @@ -2863,7 +2862,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) memset(((char *)pkt + 8), 0, (REQUEST_ENTRY_SIZE - 8)); /* Set ISP command timeout. */ - pkt->timeout = cpu_to_le16(30); + pkt->timeout = cpu_to_le16(cmd->timeout_per_command/HZ); /* Set device target ID and LUN */ pkt->lun = SCSI_LUN_32(cmd); @@ -3162,7 +3161,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp) memset(((char *)pkt + 8), 0, (REQUEST_ENTRY_SIZE - 8)); /* Set ISP command timeout. */ - pkt->timeout = cpu_to_le16(30); + pkt->timeout = cpu_to_le16(cmd->timeout_per_command/HZ); /* Set device target ID and LUN */ pkt->lun = SCSI_LUN_32(cmd); @@ -4210,7 +4209,7 @@ qla1280_setup(char *s) } -static int +static int __init qla1280_get_token(char *str) { char *sep; @@ -4294,7 +4293,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ha->devnum = devnum; /* specifies microcode load address */ #ifdef QLA_64BIT_PTR - if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) { + if (pci_set_dma_mask(ha->pdev, DMA_64BIT_MASK)) { if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "scsi(%li): Unable to set a " "suitable DMA mask - aborting\n", ha->host_no); @@ -4370,7 +4369,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) /* Disable ISP interrupts. */ qla1280_disable_intrs(ha); - if (request_irq(pdev->irq, qla1280_intr_handler, SA_SHIRQ, + if (request_irq(pdev->irq, qla1280_intr_handler, IRQF_SHARED, "qla1280", ha)) { printk("qla1280 : Failed to reserve interrupt %d already " "in use\n", pdev->irq); @@ -4485,7 +4484,7 @@ qla1280_init(void) qla1280_setup(qla1280); #endif - return pci_module_init(&qla1280_pci_driver); + return pci_register_driver(&qla1280_pci_driver); } static void __exit