]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic7xxx/aic79xx_osm.c
[SCSI] remove use_sg_chaining
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic7xxx / aic79xx_osm.c
index 286ab83116f92eb3f6ea3304aa47baf8b98b32b7..01465479290135bcd4d03719880bc360fc28947e 100644 (file)
@@ -315,8 +315,8 @@ uint32_t aic79xx_slowcrc;
  */
 static char *aic79xx = NULL;
 
-MODULE_AUTHOR("Maintainer: Justin T. Gibbs <gibbs@scsiguy.com>");
-MODULE_DESCRIPTION("Adaptec Aic790X U320 SCSI Host Bus Adapter driver");
+MODULE_AUTHOR("Maintainer: Hannes Reinecke <hare@suse.de>");
+MODULE_DESCRIPTION("Adaptec AIC790X U320 SCSI Host Bus Adapter driver");
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_VERSION(AIC79XX_DRIVER_VERSION);
 module_param(aic79xx, charp, 0444);
@@ -1783,7 +1783,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
                        if (scb->flags & SCB_SENSE) {
                                sense_size = min(sizeof(struct scsi_sense_data)
                                               - ahd_get_sense_residual(scb),
-                                                (u_long)sizeof(cmd->sense_buffer));
+                                                (u_long)SCSI_SENSE_BUFFERSIZE);
                                sense_offset = 0;
                        } else {
                                /*
@@ -1794,11 +1794,11 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
                                    scb->sense_data;
                                sense_size = min_t(size_t,
                                                scsi_4btoul(siu->sense_length),
-                                               sizeof(cmd->sense_buffer));
+                                               SCSI_SENSE_BUFFERSIZE);
                                sense_offset = SIU_SENSE_OFFSET(siu);
                        }
 
-                       memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));
+                       memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
                        memcpy(cmd->sense_buffer,
                               ahd_get_sense_buf(ahd, scb)
                               + sense_offset, sense_size);
@@ -1921,7 +1921,7 @@ ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd)
                                struct scsi_sense_data *sense;
                                
                                sense = (struct scsi_sense_data *)
-                                       &cmd->sense_buffer;
+                                       cmd->sense_buffer;
                                if (sense->extra_len >= 5 &&
                                    (sense->add_sense_code == 0x47
                                     || sense->add_sense_code == 0x48))
@@ -2284,9 +2284,12 @@ static void ahd_linux_set_period(struct scsi_target *starget, int period)
        if (period < 8)
                period = 8;
        if (period < 10) {
-               ppr_options |= MSG_EXT_PPR_DT_REQ;
-               if (period == 8)
-                       ppr_options |= MSG_EXT_PPR_IU_REQ;
+               if (spi_max_width(starget)) {
+                       ppr_options |= MSG_EXT_PPR_DT_REQ;
+                       if (period == 8)
+                               ppr_options |= MSG_EXT_PPR_IU_REQ;
+               } else
+                       period = 10;
        }
 
        dt = ppr_options & MSG_EXT_PPR_DT_REQ;
@@ -2365,7 +2368,7 @@ static void ahd_linux_set_dt(struct scsi_target *starget, int dt)
                printf("%s: %s DT\n", ahd_name(ahd), 
                       dt ? "enabling" : "disabling");
 #endif
-       if (dt) {
+       if (dt && spi_max_width(starget)) {
                ppr_options |= MSG_EXT_PPR_DT_REQ;
                if (!width)
                        ahd_linux_set_width(starget, 1);
@@ -2447,7 +2450,7 @@ static void ahd_linux_set_iu(struct scsi_target *starget, int iu)
                       iu ? "enabling" : "disabling");
 #endif
 
-       if (iu) {
+       if (iu && spi_max_width(starget)) {
                ppr_options |= MSG_EXT_PPR_IU_REQ;
                ppr_options |= MSG_EXT_PPR_DT_REQ; /* IU requires DT */
        }
@@ -2487,7 +2490,7 @@ static void ahd_linux_set_rd_strm(struct scsi_target *starget, int rdstrm)
                       rdstrm  ? "enabling" : "disabling");
 #endif
 
-       if (rdstrm)
+       if (rdstrm && spi_max_width(starget))
                ppr_options |= MSG_EXT_PPR_RD_STRM;
 
        ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2523,7 +2526,7 @@ static void ahd_linux_set_wr_flow(struct scsi_target *starget, int wrflow)
                       wrflow ? "enabling" : "disabling");
 #endif
 
-       if (wrflow)
+       if (wrflow && spi_max_width(starget))
                ppr_options |= MSG_EXT_PPR_WR_FLOW;
 
        ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2567,7 +2570,7 @@ static void ahd_linux_set_rti(struct scsi_target *starget, int rti)
                       rti ? "enabling" : "disabling");
 #endif
 
-       if (rti)
+       if (rti && spi_max_width(starget))
                ppr_options |= MSG_EXT_PPR_RTI;
 
        ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,
@@ -2603,7 +2606,7 @@ static void ahd_linux_set_pcomp_en(struct scsi_target *starget, int pcomp)
                       pcomp ? "Enable" : "Disable");
 #endif
 
-       if (pcomp) {
+       if (pcomp && spi_max_width(starget)) {
                uint8_t precomp;
 
                if (ahd->unit < ARRAY_SIZE(aic79xx_iocell_info)) {
@@ -2647,7 +2650,7 @@ static void ahd_linux_set_hold_mcs(struct scsi_target *starget, int hold)
        unsigned int dt = ppr_options & MSG_EXT_PPR_DT_REQ;
        unsigned long flags;
 
-       if (hold)
+       if (hold && spi_max_width(starget))
                ppr_options |= MSG_EXT_PPR_HOLD_MCS;
 
        ahd_compile_devinfo(&devinfo, shost->this_id, starget->id, 0,