]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/53c700.c
Merge git://git.infradead.org/hdrcleanup-2.6
[linux-2.6-omap-h63xx.git] / drivers / scsi / 53c700.c
index 523d2a97fd27870c60b411fbf8d2a2a93763cf7e..6a0f9506ea00e7631ab60e0fee7f11d437c29309 100644 (file)
@@ -238,14 +238,6 @@ static char *NCR_700_SBCL_to_phase[] = {
        "MSG IN",
 };
 
-static __u8 NCR_700_SDTR_msg[] = {
-       0x01,                   /* Extended message */
-       0x03,                   /* Extended message Length */
-       0x01,                   /* SDTR Extended message */
-       NCR_700_MIN_PERIOD,
-       NCR_700_MAX_OFFSET
-};
-
 /* This translates the SDTR message offset and period to a value
  * which can be loaded into the SXFER_REG.
  *
@@ -266,7 +258,7 @@ NCR_700_offset_period_to_sxfer(struct NCR_700_Host_Parameters *hostdata,
                return 0;
 
        if(period < hostdata->min_period) {
-               printk(KERN_WARNING "53c700: Period %dns is less than this chip's minimum, setting to %d\n", period*4, NCR_700_SDTR_msg[3]*4);
+               printk(KERN_WARNING "53c700: Period %dns is less than this chip's minimum, setting to %d\n", period*4, NCR_700_MIN_PERIOD*4);
                period = hostdata->min_period;
        }
        XFERP = (period*4 * hostdata->sync_clock)/1000 - 4;
@@ -857,7 +849,7 @@ process_extended_message(struct Scsi_Host *host,
                printk(KERN_INFO "scsi%d (%d:%d): Unexpected message %s: ",
                       host->host_no, pun, lun,
                       NCR_700_phase[(dsps & 0xf00) >> 8]);
-               scsi_print_msg(hostdata->msgin);
+               spi_print_msg(hostdata->msgin);
                printk("\n");
                /* just reject it */
                hostdata->msgout[0] = A_REJECT_MSG;
@@ -887,7 +879,7 @@ process_message(struct Scsi_Host *host,     struct NCR_700_Host_Parameters *hostdata
 #ifdef NCR_700_DEBUG
        printk("scsi%d (%d:%d): message %s: ", host->host_no, pun, lun,
               NCR_700_phase[(dsps & 0xf00) >> 8]);
-       scsi_print_msg(hostdata->msgin);
+       spi_print_msg(hostdata->msgin);
        printk("\n");
 #endif
 
@@ -939,7 +931,7 @@ process_message(struct Scsi_Host *host,     struct NCR_700_Host_Parameters *hostdata
                       host->host_no, pun, lun,
                       NCR_700_phase[(dsps & 0xf00) >> 8]);
 
-               scsi_print_msg(hostdata->msgin);
+               spi_print_msg(hostdata->msgin);
                printk("\n");
                /* just reject it */
                hostdata->msgout[0] = A_REJECT_MSG;
@@ -1427,18 +1419,16 @@ NCR_700_start_command(struct scsi_cmnd *SCp)
         * If a contingent allegiance condition exists, the device
         * will refuse all tags, so send the request sense as untagged
         * */
-       if((hostdata->tag_negotiated & (1<<SCp->device->id))
+       if((hostdata->tag_negotiated & (1<<scmd_id(SCp)))
           && (slot->tag != SCSI_NO_TAG && SCp->cmnd[0] != REQUEST_SENSE)) {
                count += scsi_populate_tag_msg(SCp, &hostdata->msgout[count]);
        }
 
        if(hostdata->fast &&
           NCR_700_is_flag_clear(SCp->device, NCR_700_DEV_NEGOTIATED_SYNC)) {
-               memcpy(&hostdata->msgout[count], NCR_700_SDTR_msg,
-                      sizeof(NCR_700_SDTR_msg));
-               hostdata->msgout[count+3] = spi_period(SCp->device->sdev_target);
-               hostdata->msgout[count+4] = spi_offset(SCp->device->sdev_target);
-               count += sizeof(NCR_700_SDTR_msg);
+               count += spi_populate_sync_msg(&hostdata->msgout[count],
+                               spi_period(SCp->device->sdev_target),
+                               spi_offset(SCp->device->sdev_target));
                NCR_700_set_flag(SCp->device, NCR_700_DEV_BEGIN_SYNC_NEGOTIATION);
        }
 
@@ -1446,7 +1436,7 @@ NCR_700_start_command(struct scsi_cmnd *SCp)
 
 
        script_patch_ID(hostdata->script,
-                       Device_ID, 1<<SCp->device->id);
+                       Device_ID, 1<<scmd_id(SCp));
 
        script_patch_32_abs(hostdata->script, CommandAddress, 
                            slot->pCmd);
@@ -2111,7 +2101,7 @@ static int NCR_700_change_queue_type(struct scsi_device *SDp, int tag_type)
                /* shift back to the default unqueued number of commands
                 * (the user can still raise this) */
                scsi_deactivate_tcq(SDp, SDp->host->cmd_per_lun);
-               hostdata->tag_negotiated &= ~(1 << SDp->id);
+               hostdata->tag_negotiated &= ~(1 << sdev_id(SDp));
        } else {
                /* Here, we cleared the negotiation flag above, so this
                 * will force the driver to renegotiate */