fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / scsi / qla1280.c
index 332151e..1548d42 100644 (file)
@@ -931,11 +931,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:
@@ -1113,7 +1112,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;
@@ -1342,7 +1341,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[] = {
@@ -1414,8 +1413,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:
@@ -2862,7 +2863,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);
@@ -3161,7 +3162,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);
@@ -4484,7 +4485,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