Make CAM_NEW_TRAN_CODE default.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 10 Feb 2008 00:01:03 +0000 (00:01 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 10 Feb 2008 00:01:03 +0000 (00:01 +0000)
As previously mentioned, this makes a huge performance difference for one
of my disks, and future work depends on this change.

Obtained-from: FreeBSD

37 files changed:
lib/libcam/camlib.c
sbin/camcontrol/camcontrol.c
share/man/man4/scsi.4
sys/bus/cam/cam_ccb.h
sys/bus/cam/cam_xpt.c
sys/bus/cam/scsi/scsi_low.c
sys/conf/options
sys/config/LINT
sys/dev/disk/advansys/advansys.c
sys/dev/disk/advansys/advlib.c
sys/dev/disk/advansys/adwcam.c
sys/dev/disk/aha/aha.c
sys/dev/disk/ahb/ahb.c
sys/dev/disk/aic/aic.c
sys/dev/disk/aic7xxx/aic79xx_osm.c
sys/dev/disk/aic7xxx/aic79xx_osm.h
sys/dev/disk/aic7xxx/aic7xxx_osm.c
sys/dev/disk/aic7xxx/aic7xxx_osm.h
sys/dev/disk/amd/amd.c
sys/dev/disk/ata/atapi-cam.c
sys/dev/disk/buslogic/bt.c
sys/dev/disk/isp/isp_freebsd.c
sys/dev/disk/mpt/mpt_freebsd.c
sys/dev/disk/nata/atapi-cam.c
sys/dev/disk/ncr/ncr.c
sys/dev/disk/sbp/sbp.c
sys/dev/disk/sym/sym_hipd.c
sys/dev/disk/trm/trm.c
sys/dev/raid/aac/aac_cam.c
sys/dev/raid/amr/amr_cam.c
sys/dev/raid/asr/asr.c
sys/dev/raid/ciss/ciss.c
sys/dev/raid/dpt/dpt_scsi.c
sys/dev/raid/iir/iir.c
sys/dev/raid/mly/mly.c
sys/dev/raid/twa/twa_cam.c
sys/dev/usbmisc/umass/umass.c

index d524025..9c055d7 100644 (file)
@@ -23,7 +23,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/lib/libcam/camlib.c,v 1.8.2.2 2002/05/23 04:19:22 ken Exp $
- * $DragonFly: src/lib/libcam/camlib.c,v 1.6 2007/11/28 21:41:41 pavalos Exp $
+ * $DragonFly: src/lib/libcam/camlib.c,v 1.7 2008/02/10 00:01:01 pavalos Exp $
  */
 
 #include <sys/types.h>
@@ -676,16 +676,24 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device,
         */
        ccb.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 
-       ccb.cts.flags = CCB_TRANS_CURRENT_SETTINGS;
+       ccb.cts.type = CTS_TYPE_CURRENT_SETTINGS;
 
        if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
                sprintf(cam_errbuf, "%s: Get Transfer Settings CCB failed\n"
                        "%s: %s", func_name, func_name, strerror(errno));
                goto crod_bailout;
        }
-       device->sync_period = ccb.cts.sync_period;
-       device->sync_offset = ccb.cts.sync_offset;
-       device->bus_width = ccb.cts.bus_width;
+       if (ccb.cts.protocol == XPORT_SPI) {
+               struct ccb_trans_settings_spi *spi =
+                   &ccb.cts.xport_specific.spi;
+               device->sync_period = spi->sync_period;
+               device->sync_offset = spi->sync_offset;
+               device->bus_width = spi->bus_width;
+       } else {
+               device->sync_period = 0;
+               device->sync_offset = 0;
+               device->bus_width = 0;
+       }
 
        return(device);
 
index ca9d51c..a86d0d4 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sbin/camcontrol/camcontrol.c,v 1.21.2.13 2003/01/08 17:55:02 njl Exp $
- * $DragonFly: src/sbin/camcontrol/camcontrol.c,v 1.9 2007/12/02 04:44:03 pavalos Exp $
+ * $DragonFly: src/sbin/camcontrol/camcontrol.c,v 1.10 2008/02/10 00:01:01 pavalos Exp $
  */
 
 #include <sys/ioctl.h>
@@ -840,8 +840,8 @@ scsiserial(struct cam_device *device, int retry_count, int timeout)
 static int
 scsixferrate(struct cam_device *device)
 {
-       u_int32_t freq;
-       u_int32_t speed;
+       u_int32_t freq = 0;
+       u_int32_t speed = 0;
        union ccb *ccb;
        u_int mb;
        int retval = 0;
@@ -857,7 +857,7 @@ scsixferrate(struct cam_device *device)
              sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr));
 
        ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
-       ccb->cts.flags = CCB_TRANS_CURRENT_SETTINGS;
+       ccb->cts.type = CTS_TYPE_CURRENT_SETTINGS;
 
        if (((retval = cam_send_ccb(device, ccb)) < 0)
         || ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)) {
@@ -878,10 +878,49 @@ scsixferrate(struct cam_device *device)
 
        }
 
-       if (((ccb->cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-        && (ccb->cts.sync_offset != 0)) {
-               freq = scsi_calc_syncsrate(ccb->cts.sync_period);
-               speed = freq;
+       if (ccb->cts.transport == XPORT_SPI) {
+               struct ccb_trans_settings_spi *spi =
+                   &ccb->cts.xport_specific.spi;
+
+               if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0) {
+                       freq = scsi_calc_syncsrate(spi->sync_period);
+                       speed = freq;
+               }
+
+               fprintf(stdout, "%s%d: ", device->device_name,
+                       device->dev_unit_num);
+
+               if ((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) {
+                       speed *= (0x01 << spi->bus_width);
+               }
+
+               mb = speed / 1000;
+
+               if (mb > 0) 
+                       fprintf(stdout, "%d.%03dMB/s transfers ",
+                               mb, speed % 1000);
+               else
+                       fprintf(stdout, "%dKB/s transfers ",
+                               speed);
+
+               if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)
+                && (spi->sync_offset != 0))
+                       fprintf(stdout, "(%d.%03dMHz, offset %d", freq / 1000,
+                               freq % 1000, spi->sync_offset);
+
+               if (((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0)
+                && (spi->bus_width > 0)) {
+                       if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)
+                        && (spi->sync_offset != 0)) {
+                               fprintf(stdout, ", ");
+                       } else {
+                               fprintf(stdout, " (");
+                       }
+                       fprintf(stdout, "%dbit)", 8 * (0x01 << spi->bus_width));
+               } else if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0)
+                && (spi->sync_offset != 0)) {
+                       fprintf(stdout, ")");
+               }
        } else {
                struct ccb_pathinq cpi;
 
@@ -892,46 +931,28 @@ scsixferrate(struct cam_device *device)
 
                speed = cpi.base_transfer_speed;
                freq = 0;
-       }
 
-       fprintf(stdout, "%s%d: ", device->device_name,
-               device->dev_unit_num);
+               mb = speed / 1000;
 
-       if ((ccb->cts.valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-               speed *= (0x01 << device->bus_width);
-
-       mb = speed / 1000;
+               if (mb > 0) 
+                       fprintf(stdout, "%d.%03dMB/s transfers ",
+                               mb, speed % 1000);
+               else
+                       fprintf(stdout, "%dKB/s transfers ",
+                               speed);
+       }
 
-       if (mb > 0) 
-               fprintf(stdout, "%d.%03dMB/s transfers ",
-                       mb, speed % 1000);
-       else
-               fprintf(stdout, "%dKB/s transfers ",
-                       speed);
-
-       if (((ccb->cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-        && (ccb->cts.sync_offset != 0))
-                fprintf(stdout, "(%d.%03dMHz, offset %d", freq / 1000,
-                       freq % 1000, ccb->cts.sync_offset);
-
-       if (((ccb->cts.valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-        && (ccb->cts.bus_width > 0)) {
-               if (((ccb->cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-                && (ccb->cts.sync_offset != 0)) {
-                       fprintf(stdout, ", ");
-               } else {
-                       fprintf(stdout, " (");
+       if (ccb->cts.protocol == PROTO_SCSI) {
+               struct ccb_trans_settings_scsi *scsi =
+                   &ccb->cts.proto_specific.scsi;
+               if (scsi->valid & CTS_SCSI_VALID_TQ) {
+                       if (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB)
+                               fprintf(stdout, ", Command Queueing Enabled");
+                       else
+                               fprintf(stdout, ", Command Queueing Supported");
                }
-               fprintf(stdout, "%dbit)", 8 * (0x01 << ccb->cts.bus_width));
-       } else if (((ccb->cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-               && (ccb->cts.sync_offset != 0)) {
-               fprintf(stdout, ")");
        }
 
-       if (((ccb->cts.valid & CCB_TRANS_TQ_VALID) != 0)
-        && (ccb->cts.flags & CCB_TRANS_TAG_ENB))
-                fprintf(stdout, ", Tagged Queueing Enabled");
         fprintf(stdout, "\n");
 
 xferrate_bailout:
@@ -2252,36 +2273,51 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts)
 
        cam_path_string(device, pathstr, sizeof(pathstr));
 
-       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
+       if (cts->transport == XPORT_SPI) {
+               struct ccb_trans_settings_spi *spi =
+                   &cts->xport_specific.spi;
 
-               fprintf(stdout, "%ssync parameter: %d\n", pathstr,
-                       cts->sync_period);
+               if ((spi->valid & CTS_SPI_VALID_SYNC_RATE) != 0) {
 
-               if (cts->sync_offset != 0) {
-                       u_int freq;
+                       fprintf(stdout, "%ssync parameter: %d\n", pathstr,
+                               spi->sync_period);
 
-                       freq = scsi_calc_syncsrate(cts->sync_period);
-                       fprintf(stdout, "%sfrequency: %d.%03dMHz\n", pathstr,
-                               freq / 1000, freq % 1000);
+                       if (spi->sync_offset != 0) {
+                               u_int freq;
+
+                               freq = scsi_calc_syncsrate(spi->sync_period);
+                               fprintf(stdout, "%sfrequency: %d.%03dMHz\n",
+                                       pathstr, freq / 1000, freq % 1000);
+                       }
+               }
+
+               if (spi->valid & CTS_SPI_VALID_SYNC_OFFSET) {
+                       fprintf(stdout, "%soffset: %d\n", pathstr,
+                           spi->sync_offset);
                }
-       }
 
-       if (cts->valid & CCB_TRANS_SYNC_OFFSET_VALID)
-               fprintf(stdout, "%soffset: %d\n", pathstr, cts->sync_offset);
+               if (spi->valid & CTS_SPI_VALID_BUS_WIDTH) {
+                       fprintf(stdout, "%sbus width: %d bits\n", pathstr,
+                               (0x01 << spi->bus_width) * 8);
+               }
 
-       if (cts->valid & CCB_TRANS_BUS_WIDTH_VALID)
-               fprintf(stdout, "%sbus width: %d bits\n", pathstr,
-                       (0x01 << cts->bus_width) * 8);
+               if (spi->valid & CTS_SPI_VALID_DISC) {
+                       fprintf(stdout, "%sdisconnection is %s\n", pathstr,
+                               (spi->flags & CTS_SPI_FLAGS_DISC_ENB) ?
+                               "enabled" : "disabled");
+               }
+       }
 
-       if (cts->valid & CCB_TRANS_DISC_VALID)
-               fprintf(stdout, "%sdisconnection is %s\n", pathstr,
-                       (cts->flags & CCB_TRANS_DISC_ENB) ? "enabled" :
-                       "disabled");
+       if (cts->protocol == PROTO_SCSI) {
+               struct ccb_trans_settings_scsi *scsi=
+                   &cts->proto_specific.scsi;
 
-       if (cts->valid & CCB_TRANS_TQ_VALID)
-               fprintf(stdout, "%stagged queueing is %s\n", pathstr,
-                       (cts->flags & CCB_TRANS_TAG_ENB) ? "enabled" :
-                       "disabled");
+               if (scsi->valid & CTS_SCSI_VALID_TQ) {
+                       fprintf(stdout, "%stagged queueing is %s\n", pathstr,
+                               (scsi->flags & CTS_SCSI_FLAGS_TAG_ENB) ?
+                               "enabled" : "disabled");
+               }
+       }
 
 }
 
@@ -2493,9 +2529,9 @@ get_print_cts(struct cam_device *device, int user_settings, int quiet,
        ccb->ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
 
        if (user_settings == 0)
-               ccb->cts.flags = CCB_TRANS_CURRENT_SETTINGS;
+               ccb->cts.type = CTS_TYPE_CURRENT_SETTINGS;
        else
-               ccb->cts.flags = CCB_TRANS_USER_SETTINGS;
+               ccb->cts.type = CTS_TYPE_USER_SETTINGS;
 
        if (cam_send_ccb(device, ccb) < 0) {
                perror("error sending XPT_GET_TRAN_SETTINGS CCB");
@@ -2669,16 +2705,27 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                cpi_print(&cpi);
 
        if (change_settings) {
-               if (disc_enable != -1) {
-                       ccb->cts.valid |= CCB_TRANS_DISC_VALID;
+               int didsettings = 0;
+               struct ccb_trans_settings_spi *spi = NULL;
+               struct ccb_trans_settings_scsi *scsi = NULL;
+
+               if (ccb->cts.transport == XPORT_SPI) {
+                       spi = &ccb->cts.xport_specific.spi;
+                       spi->valid = 0;
+               }
+               if (ccb->cts.protocol == PROTO_SCSI) {
+                       scsi = &ccb->cts.proto_specific.scsi;
+                       scsi->valid = 0;
+               }
+               if (spi && disc_enable != -1) {
+                       spi->valid |= CTS_SPI_VALID_DISC;
                        if (disc_enable == 0)
-                               ccb->cts.flags &= ~CCB_TRANS_DISC_ENB;
+                               spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB;
                        else
-                               ccb->cts.flags |= CCB_TRANS_DISC_ENB;
-               } else
-                       ccb->cts.valid &= ~CCB_TRANS_DISC_VALID;
+                               spi->flags |= CTS_SPI_FLAGS_DISC_ENB;
+               }
 
-               if (tag_enable != -1) {
+               if (scsi && tag_enable != -1) {
                        if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) {
                                warnx("HBA does not support tagged queueing, "
                                      "so you cannot modify tag settings");
@@ -2686,16 +2733,16 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                                goto ratecontrol_bailout;
                        }
 
-                       ccb->cts.valid |= CCB_TRANS_TQ_VALID;
+                       scsi->valid |= CTS_SCSI_VALID_TQ;
 
                        if (tag_enable == 0)
-                               ccb->cts.flags &= ~CCB_TRANS_TAG_ENB;
+                               scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
                        else
-                               ccb->cts.flags |= CCB_TRANS_TAG_ENB;
-               } else
-                       ccb->cts.valid &= ~CCB_TRANS_TQ_VALID;
+                               scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB;
+                       didsettings++;
+               }
 
-               if (offset != -1) {
+               if (spi && offset != -1) {
                        if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) {
                                warnx("HBA at %s%d is not cable of changing "
                                      "offset", cpi.dev_name,
@@ -2703,12 +2750,12 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                                retval = 1;
                                goto ratecontrol_bailout;
                        }
-                       ccb->cts.valid |= CCB_TRANS_SYNC_OFFSET_VALID;
-                       ccb->cts.sync_offset = offset;
-               } else
-                       ccb->cts.valid &= ~CCB_TRANS_SYNC_OFFSET_VALID;
+                       spi->valid |= CTS_SPI_VALID_SYNC_OFFSET;
+                       spi->sync_offset = offset;
+                       didsettings++;
+               }
 
-               if (syncrate != -1) {
+               if (spi && syncrate != -1) {
                        int prelim_sync_period;
                        u_int freq;
 
@@ -2720,7 +2767,7 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                                goto ratecontrol_bailout;
                        }
 
-                       ccb->cts.valid |= CCB_TRANS_SYNC_RATE_VALID;
+                       spi->valid |= CTS_SPI_VALID_SYNC_RATE;
 
                        /*
                         * The sync rate the user gives us is in MHz.
@@ -2738,12 +2785,12 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                        else
                                prelim_sync_period = 10000000 / syncrate;
 
-                       ccb->cts.sync_period =
+                       spi->sync_period =
                                scsi_calc_syncparam(prelim_sync_period);
 
-                       freq = scsi_calc_syncsrate(ccb->cts.sync_period);
-               } else
-                       ccb->cts.valid &= ~CCB_TRANS_SYNC_RATE_VALID;
+                       freq = scsi_calc_syncsrate(spi->sync_period);
+                       didsettings++;
+               }
 
                /*
                 * The bus_width argument goes like this:
@@ -2754,7 +2801,7 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                 * command line right by 4, you should get the correct
                 * number.
                 */
-               if (bus_width != -1) {
+               if (spi && bus_width != -1) {
 
                        /*
                         * We might as well validate things here with a
@@ -2780,11 +2827,14 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
                                goto ratecontrol_bailout;
                        }
 
-                       ccb->cts.valid |= CCB_TRANS_BUS_WIDTH_VALID;
-                       ccb->cts.bus_width = bus_width >> 4;
-               } else
-                       ccb->cts.valid &= ~CCB_TRANS_BUS_WIDTH_VALID;
+                       spi->valid |= CTS_SPI_VALID_BUS_WIDTH;
+                       spi->bus_width = bus_width >> 4;
+                       didsettings++;
+               }
 
+               if  (didsettings == 0) {
+                       goto ratecontrol_bailout;
+               }
                ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
 
                if (cam_send_ccb(device, ccb) < 0) {
index 7153a86..29aaeb2 100644 (file)
@@ -24,7 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/share/man/man4/scsi.4,v 1.18.2.7 2001/08/17 13:08:39 ru Exp $
-.\" $DragonFly: src/share/man/man4/scsi.4,v 1.4 2007/12/21 00:14:58 pavalos Exp $
+.\" $DragonFly: src/share/man/man4/scsi.4,v 1.5 2008/02/10 00:01:01 pavalos Exp $
 .Dd October 15, 1998
 .Dt SCSI 4
 .Os
@@ -50,7 +50,6 @@
 .Cd "options CAM_DEBUG_LUN=-1"
 .Cd "options CAM_DEBUG_FLAGS=CAM_DEBUG_INFO|CAM_DEBUG_CDB"
 .Cd "options CAM_MAX_HIGHPOWER=4"
-.Cd "options CAM_NEW_TRAN_CODE"
 .Cd "options SCSI_NO_SENSE_STRINGS"
 .Cd "options SCSI_NO_OP_STRINGS"
 .Cd "options SCSI_DELAY=8000"
@@ -92,8 +91,6 @@ START UNIT command.  Starting a SCSI disk often takes significantly more
 electrical power than normal operation of the disk.  This option allows the
 user to specify how many concurrent high power commands may be outstanding
 without overloading the power supply on his computer.
-.It Dv CAM_NEW_TRAN_CODE
-This is a new transport layer code for CAM.
 .It Dv SCSI_NO_SENSE_STRINGS
 This eliminates text descriptions of each
 .Tn SCSI
index b4ad60e..a4054b8 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.15.2.3 2003/07/29 04:00:34 njl Exp $
- * $DragonFly: src/sys/bus/cam/cam_ccb.h,v 1.16 2007/12/24 00:14:52 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_ccb.h,v 1.17 2008/02/10 00:01:01 pavalos Exp $
  */
 
 #ifndef _CAM_CAM_CCB_H
@@ -35,9 +35,7 @@
 #include <sys/queue.h>
 #include <sys/cdefs.h>
 #include <sys/time.h>
-#ifdef CAM_NEW_TRAN_CODE
 #include <machine/limits.h>
-#endif
 #include <sys/callout.h>
 #include "cam_debug.h"
 #include "scsi/scsi_all.h"
@@ -208,7 +206,6 @@ typedef enum {
 #define XPT_FC_IS_QUEUED(ccb)  \
     (((ccb)->ccb_h.func_code & XPT_FC_QUEUED) != 0)
 
-#ifdef CAM_NEW_TRAN_CODE
 typedef enum {
        PROTO_UNKNOWN,
        PROTO_UNSPECIFIED,
@@ -233,7 +230,6 @@ typedef enum {
 #define PROTO_VERSION_UNSPECIFIED UINT_MAX
 #define XPORT_VERSION_UNKNOWN (UINT_MAX - 1)
 #define XPORT_VERSION_UNSPECIFIED UINT_MAX
-#endif /* CAM_NEW_TRAN_CODE */
 
 typedef union {
        LIST_ENTRY(ccb_hdr) le;
@@ -517,7 +513,6 @@ typedef enum {
        PIM_SEQSCAN     = 0x04  /* Do bus scans sequentially, not in parallel */
 } pi_miscflag;
 
-#ifdef CAM_NEW_TRAN_CODE
 /* Path Inquiry CCB */
 struct ccb_pathinq_settings_spi {
        u_int8_t ppr_options;
@@ -532,7 +527,6 @@ struct ccb_pathinq_settings_sas {
        u_int32_t bitrate;      /* Mbps */
 };
 #define        PATHINQ_SETTINGS_SIZE   128
-#endif /* CAM_NEW_TRAN_CODE */
 
 struct ccb_pathinq {
        struct      ccb_hdr ccb_h;
@@ -554,7 +548,6 @@ struct ccb_pathinq {
        u_int32_t   unit_number;        /* Unit number for SIM */
        u_int32_t   bus_id;             /* Bus ID for SIM */
        u_int32_t   base_transfer_speed;/* Base bus speed in KB/sec */
-#ifdef CAM_NEW_TRAN_CODE
        cam_proto   protocol;
        u_int       protocol_version;
        cam_xport   transport;
@@ -565,7 +558,6 @@ struct ccb_pathinq {
                struct ccb_pathinq_settings_sas sas;
                char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE];
        } xport_specific;
-#endif /* CAM_NEW_TRAN_CODE */
 };
 
 /* Path Statistics CCB */
@@ -703,27 +695,6 @@ struct ccb_termio {
        union   ccb *termio_ccb;        /* Pointer to CCB to terminate */
 };
 
-#ifndef CAM_NEW_TRAN_CODE
-/* Get/Set transfer rate/width/disconnection/tag queueing settings */
-struct ccb_trans_settings {
-       struct  ccb_hdr ccb_h;
-       u_int   valid;  /* Which fields to honor */
-#define                CCB_TRANS_SYNC_RATE_VALID       0x01
-#define                CCB_TRANS_SYNC_OFFSET_VALID     0x02
-#define                CCB_TRANS_BUS_WIDTH_VALID       0x04
-#define                CCB_TRANS_DISC_VALID            0x08
-#define                CCB_TRANS_TQ_VALID              0x10
-       u_int   flags;
-#define                CCB_TRANS_CURRENT_SETTINGS      0x01
-#define                CCB_TRANS_USER_SETTINGS         0x02
-#define                CCB_TRANS_DISC_ENB              0x04
-#define                CCB_TRANS_TAG_ENB               0x08
-       u_int   sync_period;
-       u_int   sync_offset;
-       u_int   bus_width;
-};
-
-#else /* CAM_NEW_TRAN_CODE */
 typedef enum {
        CTS_TYPE_CURRENT_SETTINGS,
        CTS_TYPE_USER_SETTINGS
@@ -792,8 +763,6 @@ struct ccb_trans_settings {
        } xport_specific;
 };
 
-#endif /* CAM_NEW_TRAN_CODE */
-
 /*
  * Calculate the geometry parameters for a device
  * give the block size and volume size in blocks.
index c9c1db7..8a8e1b2 100644 (file)
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/cam/cam_xpt.c,v 1.80.2.18 2002/12/09 17:31:55 gibbs Exp $
- * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.63 2007/12/21 00:02:53 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.64 2008/02/10 00:01:01 pavalos Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,12 +124,10 @@ struct cam_ed {
        struct  cam_periph *owner;      /* Peripheral driver's ownership tag */
        struct  xpt_quirk_entry *quirk; /* Oddities about this device */
                                        /* Storage for the inquiry data */
-#ifdef CAM_NEW_TRAN_CODE
        cam_proto        protocol;
        u_int            protocol_version;
        cam_xport        transport;
        u_int            transport_version;
-#endif /* CAM_NEW_TRAN_CODE */
        struct           scsi_inquiry_data inq_data;
        u_int8_t         inq_flags;     /*
                                         * Current settings for inquiry flags.
@@ -880,9 +878,7 @@ static void  proberequestdefaultnegotiation(struct cam_periph *periph);
 static void     probedone(struct cam_periph *periph, union ccb *done_ccb);
 static void     probecleanup(struct cam_periph *periph);
 static void     xpt_find_quirk(struct cam_ed *device);
-#ifdef CAM_NEW_TRAN_CODE
 static void     xpt_devise_transport(struct cam_path *path);
-#endif /* CAM_NEW_TRAN_CODE */
 static void     xpt_set_transfer_settings(struct ccb_trans_settings *cts,
                                           struct cam_ed *device,
                                           int async_update);
@@ -1563,8 +1559,6 @@ xpt_remove_periph(struct cam_periph *periph)
 
 }
 
-#ifdef CAM_NEW_TRAN_CODE
-
 void
 xpt_announce_periph(struct cam_periph *periph, char *announce_string)
 {
@@ -1697,110 +1691,6 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
                       periph->unit_number, announce_string);
        crit_exit();
 }
-#else /* CAM_NEW_TRAN_CODE */
-void
-xpt_announce_periph(struct cam_periph *periph, char *announce_string)
-{
-       u_int mb;
-       struct cam_path *path;
-       struct ccb_trans_settings cts;
-
-       path = periph->path;
-       /*
-        * To ensure that this is printed in one piece,
-        * mask out CAM interrupts.
-        */
-       crit_enter();
-       kprintf("%s%d at %s%d bus %d target %d lun %d\n",
-              periph->periph_name, periph->unit_number,
-              path->bus->sim->sim_name,
-              path->bus->sim->unit_number,
-              path->bus->sim->bus_id,
-              path->target->target_id,
-              path->device->lun_id);
-       kprintf("%s%d: ", periph->periph_name, periph->unit_number);
-       scsi_print_inquiry(&path->device->inq_data);
-       if ((bootverbose)
-        && (path->device->serial_num_len > 0)) {
-               /* Don't wrap the screen  - print only the first 60 chars */
-               kprintf("%s%d: Serial Number %.60s\n", periph->periph_name,
-                      periph->unit_number, path->device->serial_num);
-       }
-       xpt_setup_ccb(&cts.ccb_h, path, /*priority*/1);
-       cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
-       cts.flags = CCB_TRANS_CURRENT_SETTINGS;
-       xpt_action((union ccb*)&cts);
-       if (cts.ccb_h.status == CAM_REQ_CMP) {
-               u_int speed;
-               u_int freq;
-
-               if ((cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0
-                 && cts.sync_offset != 0) {
-                       freq = scsi_calc_syncsrate(cts.sync_period);
-                       speed = freq;
-               } else {
-                       struct ccb_pathinq cpi;
-
-                       /* Ask the SIM for its base transfer speed */
-                       xpt_setup_ccb(&cpi.ccb_h, path, /*priority*/1);
-                       cpi.ccb_h.func_code = XPT_PATH_INQ;
-                       xpt_action((union ccb *)&cpi);
-
-                       speed = cpi.base_transfer_speed;
-                       freq = 0;
-               }
-               if ((cts.valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-                       speed *= (0x01 << cts.bus_width);
-               mb = speed / 1000;
-               if (mb > 0)
-                       kprintf("%s%d: %d.%03dMB/s transfers",
-                              periph->periph_name, periph->unit_number,
-                              mb, speed % 1000);
-               else
-                       kprintf("%s%d: %dKB/s transfers", periph->periph_name,
-                              periph->unit_number, speed);
-               if ((cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0
-                && cts.sync_offset != 0) {
-                       kprintf(" (%d.%03dMHz, offset %d", freq / 1000,
-                              freq % 1000, cts.sync_offset);
-               }
-               if ((cts.valid & CCB_TRANS_BUS_WIDTH_VALID) != 0
-                && cts.bus_width > 0) {
-                       if ((cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0
-                        && cts.sync_offset != 0) {
-                               kprintf(", ");
-                       } else {
-                               kprintf(" (");
-                       }
-                       kprintf("%dbit)", 8 * (0x01 << cts.bus_width));
-               } else if ((cts.valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0
-                       && cts.sync_offset != 0) {
-                       kprintf(")");
-               }
-
-               if (path->device->inq_flags & SID_CmdQue
-                || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) {
-                       kprintf(", Tagged Queueing Enabled");
-               }
-
-               kprintf("\n");
-       } else if (path->device->inq_flags & SID_CmdQue
-               || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) {
-               kprintf("%s%d: Tagged Queueing Enabled\n",
-                      periph->periph_name, periph->unit_number);
-       }
-
-       /*
-        * We only want to print the caller's announce string if they've
-        * passed one in..
-        */
-       if (announce_string != NULL)
-               kprintf("%s%d: %s\n", periph->periph_name,
-                      periph->unit_number, announce_string);
-       crit_exit();
-}
-
-#endif /* CAM_NEW_TRAN_CODE */
 
 static dev_match_ret
 xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns,
@@ -3011,9 +2901,7 @@ xpt_action(union ccb *start_ccb)
        switch (start_ccb->ccb_h.func_code) {
        case XPT_SCSI_IO:
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct cam_ed *device;
-#endif /* CAM_NEW_TRAN_CODE */
 #ifdef CAMDEBUG
                char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
                struct cam_path *path;
@@ -3037,12 +2925,8 @@ xpt_action(union ccb *start_ccb)
                 * This means that this code will be exercised while probing
                 * devices with an ANSI revision greater than 2.
                 */
-#ifdef CAM_NEW_TRAN_CODE
                device = start_ccb->ccb_h.path->device;
                if (device->protocol_version <= SCSI_REV_2
-#else /* CAM_NEW_TRAN_CODE */
-               if (SID_ANSI_REV(&start_ccb->ccb_h.path->device->inq_data) <= 2
-#endif /* CAM_NEW_TRAN_CODE */
                 && start_ccb->ccb_h.target_lun < 8
                 && (start_ccb->ccb_h.flags & CAM_CDB_POINTER) == 0) {
 
@@ -4961,9 +4845,7 @@ xpt_release_target(struct cam_eb *bus, struct cam_et *target)
 static struct cam_ed *
 xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
 {
-#ifdef CAM_NEW_TRAN_CODE
        struct     cam_path path;
-#endif /* CAM_NEW_TRAN_CODE */
        struct     cam_ed *device;
        struct     cam_devq *devq;
        cam_status status;
@@ -5045,7 +4927,6 @@ xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
                        TAILQ_INSERT_TAIL(&target->ed_entries, device, links);
                }
                target->generation++;
-#ifdef CAM_NEW_TRAN_CODE
                if (lun_id != CAM_LUN_WILDCARD) {
                        xpt_compile_path(&path,
                                         NULL,
@@ -5055,7 +4936,6 @@ xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id)
                        xpt_devise_transport(&path);
                        xpt_release_path(&path);
                }
-#endif /* CAM_NEW_TRAN_CODE */
        }
        return (device);
 }
@@ -5778,22 +5658,13 @@ proberequestdefaultnegotiation(struct cam_periph *periph)
 
        xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1);
        cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
-#ifdef CAM_NEW_TRAN_CODE
        cts.type = CTS_TYPE_USER_SETTINGS;
-#else /* CAM_NEW_TRAN_CODE */
-       cts.flags = CCB_TRANS_USER_SETTINGS;
-#endif /* CAM_NEW_TRAN_CODE */
        xpt_action((union ccb *)&cts);
        if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
                return;
        }
        cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS;
-#ifdef CAM_NEW_TRAN_CODE
        cts.type = CTS_TYPE_CURRENT_SETTINGS;
-#else /* CAM_NEW_TRAN_CODE */
-       cts.flags &= ~CCB_TRANS_USER_SETTINGS;
-       cts.flags |= CCB_TRANS_CURRENT_SETTINGS;
-#endif /* CAM_NEW_TRAN_CODE */
        xpt_action((union ccb *)&cts);
 }
 
@@ -5869,9 +5740,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
 
                                xpt_find_quirk(path->device);
 
-#ifdef CAM_NEW_TRAN_CODE
                                xpt_devise_transport(path);
-#endif /* CAM_NEW_TRAN_CODE */
                                if (INQ_DATA_TQ_ENABLED(inq_buf))
                                        softc->action = PROBE_MODE_SENSE;
                                else
@@ -6123,8 +5992,6 @@ sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS)
        }
 }
 
-#ifdef CAM_NEW_TRAN_CODE
-
 static void
 xpt_devise_transport(struct cam_path *path)
 {
@@ -6495,206 +6362,6 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
                (*(sim->sim_action))(sim, (union ccb *)cts);
 }
 
-#else /* CAM_NEW_TRAN_CODE */
-
-static void
-xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
-                         int async_update)
-{
-       struct  cam_sim *sim;
-       int     qfrozen;
-
-       sim = cts->ccb_h.path->bus->sim;
-       if (async_update == FALSE) {
-               struct  scsi_inquiry_data *inq_data;
-               struct  ccb_pathinq cpi;
-               struct  ccb_trans_settings cur_cts;
-
-               if (device == NULL) {
-                       cts->ccb_h.status = CAM_PATH_INVALID;
-                       xpt_done((union ccb *)cts);
-                       return;
-               }
-
-               /*
-                * Perform sanity checking against what the
-                * controller and device can do.
-                */
-               xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, /*priority*/1);
-               cpi.ccb_h.func_code = XPT_PATH_INQ;
-               xpt_action((union ccb *)&cpi);
-               xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, /*priority*/1);
-               cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
-               cur_cts.flags = CCB_TRANS_CURRENT_SETTINGS;
-               xpt_action((union ccb *)&cur_cts);
-               inq_data = &device->inq_data;
-
-               /* Fill in any gaps in what the user gave us */
-               if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) == 0)
-                       cts->sync_period = cur_cts.sync_period;
-               if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0)
-                       cts->sync_offset = cur_cts.sync_offset;
-               if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) == 0)
-                       cts->bus_width = cur_cts.bus_width;
-               if ((cts->valid & CCB_TRANS_DISC_VALID) == 0) {
-                       cts->flags &= ~CCB_TRANS_DISC_ENB;
-                       cts->flags |= cur_cts.flags & CCB_TRANS_DISC_ENB;
-               }
-               if ((cts->valid & CCB_TRANS_TQ_VALID) == 0) {
-                       cts->flags &= ~CCB_TRANS_TAG_ENB;
-                       cts->flags |= cur_cts.flags & CCB_TRANS_TAG_ENB;
-               }
-
-               if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0
-                 && (inq_data->flags & SID_Sync) == 0)
-                || ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0)
-                || (cts->sync_offset == 0)
-                || (cts->sync_period == 0)) {
-                       /* Force async */
-                       cts->sync_period = 0;
-                       cts->sync_offset = 0;
-               } else if ((device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) {
-
-                       if ((inq_data->spi3data & SID_SPI_CLOCK_DT) == 0
-                        && cts->sync_period <= 0x9) {
-                               /*
-                                * Don't allow DT transmission rates if the
-                                * device does not support it.
-                                */
-                               cts->sync_period = 0xa;
-                       }
-                       if ((inq_data->spi3data & SID_SPI_IUS) == 0
-                        && cts->sync_period <= 0x8) {
-                               /*
-                                * Don't allow PACE transmission rates
-                                * if the device does support packetized
-                                * transfers.
-                                */
-                               cts->sync_period = 0x9;
-                       }
-               }
-
-               switch (cts->bus_width) {
-               case MSG_EXT_WDTR_BUS_32_BIT:
-                       if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) == 0
-                         || (inq_data->flags & SID_WBus32) != 0)
-                        && (cpi.hba_inquiry & PI_WIDE_32) != 0)
-                               break;
-                       /* Fall Through to 16-bit */
-               case MSG_EXT_WDTR_BUS_16_BIT:
-                       if (((device->flags & CAM_DEV_INQUIRY_DATA_VALID) == 0
-                         || (inq_data->flags & SID_WBus16) != 0)
-                        && (cpi.hba_inquiry & PI_WIDE_16) != 0) {
-                               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                               break;
-                       }
-                       /* Fall Through to 8-bit */
-               default: /* New bus width?? */
-               case MSG_EXT_WDTR_BUS_8_BIT:
-                       /* All targets can do this */
-                       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-                       break;
-               }
-
-               if ((cts->flags & CCB_TRANS_DISC_ENB) == 0) {
-                       /*
-                        * Can't tag queue without disconnection.
-                        */
-                       cts->flags &= ~CCB_TRANS_TAG_ENB;
-                       cts->valid |= CCB_TRANS_TQ_VALID;
-               }
-
-               if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0
-                || (INQ_DATA_TQ_ENABLED(inq_data)) == 0
-                || (device->queue_flags & SCP_QUEUE_DQUE) != 0
-                || (device->quirk->mintags == 0)) {
-                       /*
-                        * Can't tag on hardware that doesn't support,
-                        * doesn't have it enabled, or has broken tag support.
-                        */
-                       cts->flags &= ~CCB_TRANS_TAG_ENB;
-               }
-       }
-
-       qfrozen = FALSE;
-       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-               int device_tagenb;
-
-               /*
-                * If we are transitioning from tags to no-tags or
-                * vice-versa, we need to carefully freeze and restart
-                * the queue so that we don't overlap tagged and non-tagged
-                * commands.  We also temporarily stop tags if there is
-                * a change in transfer negotiation settings to allow
-                * "tag-less" negotiation.
-                */
-               if ((device->flags & CAM_DEV_TAG_AFTER_COUNT) != 0
-                || (device->inq_flags & SID_CmdQue) != 0)
-                       device_tagenb = TRUE;
-               else
-                       device_tagenb = FALSE;
-
-               if (((cts->flags & CCB_TRANS_TAG_ENB) != 0
-                 && device_tagenb == FALSE)
-                || ((cts->flags & CCB_TRANS_TAG_ENB) == 0
-                 && device_tagenb == TRUE)) {
-
-                       if ((cts->flags & CCB_TRANS_TAG_ENB) != 0) {
-                               /*
-                                * Delay change to use tags until after a
-                                * few commands have gone to this device so
-                                * the controller has time to perform transfer
-                                * negotiations without tagged messages getting
-                                * in the way.
-                                */
-                               device->tag_delay_count = CAM_TAG_DELAY_COUNT;
-                               device->flags |= CAM_DEV_TAG_AFTER_COUNT;
-                       } else {
-                               xpt_freeze_devq(cts->ccb_h.path, /*count*/1);
-                               qfrozen = TRUE;
-                               device->inq_flags &= ~SID_CmdQue;
-                               xpt_dev_ccbq_resize(cts->ccb_h.path,
-                                                   sim->max_dev_openings);
-                               device->flags &= ~CAM_DEV_TAG_AFTER_COUNT;
-                               device->tag_delay_count = 0;
-                       }
-               }
-       }
-
-       if (async_update == FALSE) {
-               /*
-                * If we are currently performing tagged transactions to
-                * this device and want to change its negotiation parameters,
-                * go non-tagged for a bit to give the controller a chance to
-                * negotiate unhampered by tag messages.
-                */
-               if ((device->inq_flags & SID_CmdQue) != 0
-                && (cts->flags & (CCB_TRANS_SYNC_RATE_VALID|
-                                  CCB_TRANS_SYNC_OFFSET_VALID|
-                                  CCB_TRANS_BUS_WIDTH_VALID)) != 0)
-                       xpt_toggle_tags(cts->ccb_h.path);
-
-               (*(sim->sim_action))(sim, (union ccb *)cts);
-       }
-
-       if (qfrozen) {
-               struct ccb_relsim crs;
-
-               xpt_setup_ccb(&crs.ccb_h, cts->ccb_h.path,
-                             /*priority*/1);
-               crs.ccb_h.func_code = XPT_REL_SIMQ;
-               crs.release_flags = RELSIM_RELEASE_AFTER_QEMPTY;
-               crs.openings
-                   = crs.release_timeout 
-                   = crs.qfrozen_cnt
-                   = 0;
-               xpt_action((union ccb *)&crs);
-       }
-}
-
-
-#endif /* CAM_NEW_TRAN_CODE */
-
 static void
 xpt_toggle_tags(struct cam_path *path)
 {
@@ -6714,24 +6381,15 @@ xpt_toggle_tags(struct cam_path *path)
                struct ccb_trans_settings cts;
 
                xpt_setup_ccb(&cts.ccb_h, path, 1);
-#ifdef CAM_NEW_TRAN_CODE
                cts.protocol = PROTO_SCSI;
                cts.protocol_version = PROTO_VERSION_UNSPECIFIED;
                cts.transport = XPORT_UNSPECIFIED;
                cts.transport_version = XPORT_VERSION_UNSPECIFIED;
                cts.proto_specific.scsi.flags = 0;
                cts.proto_specific.scsi.valid = CTS_SCSI_VALID_TQ;
-#else /* CAM_NEW_TRAN_CODE */
-               cts.flags = 0;
-               cts.valid = CCB_TRANS_TQ_VALID;
-#endif /* CAM_NEW_TRAN_CODE */
                xpt_set_transfer_settings(&cts, path->device,
                                          /*async_update*/TRUE);
-#ifdef CAM_NEW_TRAN_CODE
                cts.proto_specific.scsi.flags = CTS_SCSI_FLAGS_TAG_ENB;
-#else /* CAM_NEW_TRAN_CODE */
-               cts.flags = CCB_TRANS_TAG_ENB;
-#endif /* CAM_NEW_TRAN_CODE */
                xpt_set_transfer_settings(&cts, path->device,
                                          /*async_update*/TRUE);
        }
@@ -6995,12 +6653,10 @@ xptaction(struct cam_sim *sim, union ccb *work_ccb)
                cpi->unit_number = sim->unit_number;
                cpi->bus_id = sim->bus_id;
                cpi->base_transfer_speed = 0;
-#ifdef CAM_NEW_TRAN_CODE
                cpi->protocol = PROTO_UNSPECIFIED;
                cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
                cpi->transport = XPORT_UNSPECIFIED;
                cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
-#endif /* CAM_NEW_TRAN_CODE */
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(work_ccb);
                break;
index baa6bb4..9249aff 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.1.2.5 2003/08/09 06:18:30 non Exp $
- * $DragonFly: src/sys/bus/cam/scsi/scsi_low.c,v 1.26 2007/12/23 07:00:55 pavalos Exp $
+ * $DragonFly: src/sys/bus/cam/scsi/scsi_low.c,v 1.27 2008/02/10 00:01:01 pavalos Exp $
  * $NetBSD: scsi_low.c,v 1.24.10.8 2001/06/26 07:39:44 honda Exp $
  */
 
@@ -523,10 +523,8 @@ scsi_low_scsi_action_cam(struct cam_sim *sim, union ccb *ccb)
                break;
 
        case XPT_SET_TRAN_SETTINGS: {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi;
                struct ccb_trans_settings_spi *spi;
-#endif
                struct ccb_trans_settings *cts;
                u_int val;
 
@@ -545,57 +543,6 @@ scsi_low_scsi_action_cam(struct cam_sim *sim, union ccb *ccb)
                        lun = 0;
 
                crit_enter();
-#ifndef        CAM_NEW_TRAN_CODE
-               if ((cts->valid & (CCB_TRANS_BUS_WIDTH_VALID |
-                                  CCB_TRANS_SYNC_RATE_VALID |
-                                  CCB_TRANS_SYNC_OFFSET_VALID)) != 0)
-               {
-                       if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) {
-                               val = cts->bus_width;
-                               if (val < ti->ti_width)
-                                       ti->ti_width = val;
-                       }
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
-                               val = cts->sync_period;
-                               if (val == 0 || val > ti->ti_maxsynch.period)
-                                       ti->ti_maxsynch.period = val;
-                       }
-                       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
-                               val = cts->sync_offset;
-                               if (val < ti->ti_maxsynch.offset)
-                                       ti->ti_maxsynch.offset = val;
-                       }
-
-                       ti->ti_flags_valid |= SCSI_LOW_TARG_FLAGS_QUIRKS_VALID;
-                       scsi_low_calcf_target(ti);
-               }
-
-               if ((cts->valid & (CCB_TRANS_DISC_VALID |
-                                  CCB_TRANS_TQ_VALID)) != 0)
-               {
-                       li = scsi_low_alloc_li(ti, lun, 1);
-                       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0)
-                       {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                                       li->li_quirks |= SCSI_LOW_DISK_DISC;
-                               else
-                                       li->li_quirks &= ~SCSI_LOW_DISK_DISC;
-                       }
-                       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0)
-                       {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                                       li->li_quirks |= SCSI_LOW_DISK_QTAG;
-                               else
-                                       li->li_quirks &= ~SCSI_LOW_DISK_QTAG;
-                       }
-
-                       li->li_flags_valid |= SCSI_LOW_LUN_FLAGS_QUIRKS_VALID;
-                       scsi_low_calcf_target(ti);
-                       scsi_low_calcf_lun(li);
-                       if ((slp->sl_show_result & SHOW_CALCF_RES) != 0)
-                               scsi_low_calcf_show(li);
-               }
-#else
                scsi = &cts->proto_specific.scsi;
                spi = &cts->xport_specific.spi;
                if ((spi->valid & (CTS_SPI_VALID_BUS_WIDTH |
@@ -642,7 +589,6 @@ scsi_low_scsi_action_cam(struct cam_sim *sim, union ccb *ccb)
                        if ((slp->sl_show_result & SHOW_CALCF_RES) != 0)
                                scsi_low_calcf_show(li);
                }
-#endif
                crit_exit();
 
                ccb->ccb_h.status = CAM_REQ_CMP;
@@ -670,7 +616,6 @@ scsi_low_scsi_action_cam(struct cam_sim *sim, union ccb *ccb)
 
                crit_enter();
                li = scsi_low_alloc_li(ti, lun, 1);
-#ifdef CAM_NEW_TRAN_CODE
                if (li != NULL && cts->type == CTS_TYPE_CURRENT_SETTINGS) {
                        struct ccb_trans_settings_scsi *scsi =
                                &cts->proto_specific.scsi;
@@ -714,65 +659,6 @@ scsi_low_scsi_action_cam(struct cam_sim *sim, union ccb *ccb)
                                scsi->valid = 0;
                } else
                        ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0)
-               {
-#ifdef SCSI_LOW_DIAGNOSTIC
-                       if ((li->li_flags_valid & SCSI_LOW_LUN_FLAGS_DISK_VALID) == 0)
-                       {
-                               ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-                               kprintf("%s: invalid GET_TRANS_USER_SETTINGS call\n",
-                                       slp->sl_xname);
-                               goto settings_out;
-                       }
-#endif /* SCSI_LOW_DIAGNOSTIC */
-                       diskflags = li->li_diskflags & li->li_cfgflags;
-                       if ((diskflags & SCSI_LOW_DISK_DISC) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_DISC_ENB;
-                       if ((diskflags & SCSI_LOW_DISK_QTAG) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_TAG_ENB;
-               }
-               else if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
-               {
-#ifdef SCSI_LOW_DIAGNOSTIC
-                       if (li->li_flags_valid != SCSI_LOW_LUN_FLAGS_ALL_VALID)
-                       {
-                               ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-                               kprintf("%s: invalid GET_TRANS_CURRENT_SETTINGS call\n",
-                                       slp->sl_xname);
-                               goto settings_out;
-                       }
-#endif /* SCSI_LOW_DIAGNOSTIC */
-                       if ((li->li_flags & SCSI_LOW_DISC) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_DISC_ENB;
-                       if ((li->li_flags & SCSI_LOW_QTAG) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_TAG_ENB;
-               }
-               else
-               {
-                       ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-                       goto settings_out;
-               }
-
-               cts->sync_period = ti->ti_maxsynch.period;
-               cts->sync_offset = ti->ti_maxsynch.offset;
-               cts->bus_width = ti->ti_width;
-
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID
-                          | CCB_TRANS_DISC_VALID
-                          | CCB_TRANS_TQ_VALID;
-               ccb->ccb_h.status = CAM_REQ_CMP;
-#endif
 settings_out:
                crit_exit();
                xpt_done(ccb);
@@ -853,12 +739,10 @@ settings_out:
                cpi->initiator_id = slp->sl_hostid;
                cpi->bus_id = cam_sim_bus(sim);
                cpi->base_transfer_speed = 3300;
-#ifdef CAM_NEW_TRAN_CODE
                cpi->transport = XPORT_SPI;
                cpi->transport_version = 2;
                cpi->protocol = PROTO_SCSI;
                cpi->protocol_version = SCSI_REV_2;
-#endif
                strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
                strncpy(cpi->hba_vid, "SCSI_LOW", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
index ac1d9c2..0783d89 100644 (file)
@@ -1,5 +1,5 @@
 # $FreeBSD: src/sys/conf/options,v 1.191.2.53 2003/06/04 17:56:58 sam Exp $
-# $DragonFly: src/sys/conf/options,v 1.76 2007/12/23 04:46:04 pavalos Exp $
+# $DragonFly: src/sys/conf/options,v 1.77 2008/02/10 00:01:02 pavalos Exp $
 #
 #        On the handling of kernel options
 #
@@ -205,7 +205,6 @@ CAM_DEBUG_BUS               opt_cam.h
 CAM_DEBUG_TARGET       opt_cam.h
 CAM_DEBUG_LUN          opt_cam.h
 CAM_DEBUG_FLAGS                opt_cam.h
-CAM_NEW_TRAN_CODE      opt_cam.h
 SCSI_DELAY             opt_scsi.h
 SCSI_NO_SENSE_STRINGS  opt_scsi.h
 SCSI_NO_OP_STRINGS     opt_scsi.h
index 3756dfb..48a029d 100644 (file)
@@ -3,7 +3,7 @@
 #      as much of the source tree as it can.
 #
 # $FreeBSD: src/sys/i386/conf/LINT,v 1.749.2.144 2003/06/04 17:56:59 sam Exp $
-# $DragonFly: src/sys/config/LINT,v 1.147 2008/02/01 13:18:49 sephe Exp $
+# $DragonFly: src/sys/config/LINT,v 1.148 2008/02/10 00:01:02 pavalos Exp $
 #
 # NB: You probably don't want to try running a kernel built from this
 # file.  Instead, you should start from GENERIC, and add options from
@@ -934,7 +934,6 @@ device              ses                     #SCSI SES/SAF-TE driver
 #                   CAM_DEBUG_SUBTRACE, and CAM_DEBUG_CDB
 #
 # CAM_MAX_HIGHPOWER: Maximum number of concurrent high power (start unit) cmds
-# CAM_NEW_TRAN_CODE: New transport layer code for CAM.
 # SCSI_NO_SENSE_STRINGS: When defined disables sense descriptions
 # SCSI_NO_OP_STRINGS: When defined disables opcode descriptions
 # SCSI_DELAY: The number of MILLISECONDS to freeze the SIM (scsi adapter)
@@ -948,7 +947,6 @@ options     CAM_DEBUG_TARGET=-1
 options        CAM_DEBUG_LUN=-1
 options        CAM_DEBUG_FLAGS="CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB"
 options        CAM_MAX_HIGHPOWER=4
-options                CAM_NEW_TRAN_CODE
 options        SCSI_NO_SENSE_STRINGS
 options        SCSI_NO_OP_STRINGS
 options        SCSI_DELAY=8000 # Be pessimistic about Joe SCSI device
index abefe0d..22986ab 100644 (file)
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/advansys/advansys.c,v 1.14.2.4 2002/01/06 21:21:42 dwmalone Exp $
- * $DragonFly: src/sys/dev/disk/advansys/advansys.c,v 1.12 2007/12/23 07:00:55 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/advansys/advansys.c,v 1.13 2008/02/10 00:01:02 pavalos Exp $
  */
 /*
  * Ported from:
@@ -281,19 +281,12 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
                ccb->ccb_h.status = CAM_REQ_INVALID;
                xpt_done(ccb);
                break;
-#ifdef  CAM_NEW_TRAN_CODE
 #define        IS_CURRENT_SETTINGS(c)  (c->type == CTS_TYPE_CURRENT_SETTINGS)
 #define        IS_USER_SETTINGS(c)     (c->type == CTS_TYPE_USER_SETTINGS)
-#else
-#define        IS_CURRENT_SETTINGS(c)  (c->flags & CCB_TRANS_CURRENT_SETTINGS)
-#define        IS_USER_SETTINGS(c)     (c->flags & CCB_TRANS_USER_SETTINGS)
-#endif
        case XPT_SET_TRAN_SETTINGS:
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi;
                struct ccb_trans_settings_spi *spi;
-#endif
                struct   ccb_trans_settings *cts;
                target_bit_vector targ_mask;
                struct adv_transinfo *tconf;
@@ -319,7 +312,6 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
                }
 
                crit_enter();
-#ifdef CAM_NEW_TRAN_CODE
                scsi = &cts->proto_specific.scsi;
                spi = &cts->xport_specific.spi;
                if ((update_type & ADV_TRANS_GOAL) != 0) {
@@ -385,71 +377,6 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
                                         cts->ccb_h.target_id, spi->sync_period,
                                         spi->sync_offset, update_type);
                }
-#else
-               if ((update_type & ADV_TRANS_GOAL) != 0) {
-                       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                                       adv->disc_enable |= targ_mask;
-                               else
-                                       adv->disc_enable &= ~targ_mask;
-                               adv_write_lram_8(adv, ADVV_DISC_ENABLE_B,
-                                                adv->disc_enable); 
-                       }
-
-                       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                                       adv->cmd_qng_enabled |= targ_mask;
-                               else
-                                       adv->cmd_qng_enabled &= ~targ_mask;
-                       }
-               }
-
-               if ((update_type & ADV_TRANS_USER) != 0) {
-                       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                                       adv->user_disc_enable |= targ_mask;
-                               else
-                                       adv->user_disc_enable &= ~targ_mask;
-                       }
-
-                       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                                       adv->user_cmd_qng_enabled |= targ_mask;
-                               else
-                                       adv->user_cmd_qng_enabled &= ~targ_mask;
-                       }
-               }
-               
-               /*
-                * If the user specifies either the sync rate, or offset,
-                * but not both, the unspecified parameter defaults to its
-                * current value in transfer negotiations.
-                */
-               if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-                || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) {
-                       /*
-                        * If the user provided a sync rate but no offset,
-                        * use the current offset.
-                        */
-                       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0)
-                               cts->sync_offset = tconf->offset;
-
-                       /*
-                        * If the user provided an offset but no sync rate,
-                        * use the current sync rate.
-                        */
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) == 0)
-                               cts->sync_period = tconf->period;
-
-                       adv_period_offset_to_sdtr(adv, &cts->sync_period,
-                                                 &cts->sync_offset,
-                                                 cts->ccb_h.target_id);
-                       
-                       adv_set_syncrate(adv, /*struct cam_path */NULL,
-                                        cts->ccb_h.target_id, cts->sync_period,
-                                        cts->sync_offset, update_type);
-               }
-#endif
 
                crit_exit();
                ccb->ccb_h.status = CAM_REQ_CMP;
@@ -459,10 +386,8 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
        case XPT_GET_TRAN_SETTINGS:
        /* Get default/user set transfer settings for the target */
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi;
                struct ccb_trans_settings_spi *spi;
-#endif
                struct ccb_trans_settings *cts;
                struct adv_transinfo *tconf;
                target_bit_vector target_mask;
@@ -470,7 +395,6 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
                cts = &ccb->cts;
                target_mask = ADV_TID_TO_TARGET_MASK(cts->ccb_h.target_id);
 
-#ifdef CAM_NEW_TRAN_CODE
                scsi = &cts->proto_specific.scsi;
                spi = &cts->xport_specific.spi;
 
@@ -505,34 +429,6 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
                           | CTS_SPI_VALID_BUS_WIDTH
                           | CTS_SPI_VALID_DISC;
                scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-               cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-               crit_enter();
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       tconf = &adv->tinfo[cts->ccb_h.target_id].current;
-                       if ((adv->disc_enable & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       if ((adv->cmd_qng_enabled & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-               } else {
-                       tconf = &adv->tinfo[cts->ccb_h.target_id].user;
-                       if ((adv->user_disc_enable & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       if ((adv->user_cmd_qng_enabled & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-               }
-
-               cts->sync_period = tconf->period;
-               cts->sync_offset = tconf->offset;
-               crit_exit();
-
-               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID
-                          | CCB_TRANS_DISC_VALID
-                          | CCB_TRANS_TQ_VALID;
-#endif
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -598,12 +494,10 @@ adv_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
                cpi->ccb_h.status = CAM_REQ_CMP;
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                xpt_done(ccb);
                break;
        }
index af64b4f..16d57fd 100644 (file)
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/advansys/advlib.c,v 1.15.2.1 2000/04/14 13:32:49 nyan Exp $
- * $DragonFly: src/sys/dev/disk/advansys/advlib.c,v 1.9 2007/12/23 07:00:55 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/advansys/advlib.c,v 1.10 2008/02/10 00:01:02 pavalos Exp $
  */
 /*
  * Ported from:
@@ -1129,7 +1129,6 @@ adv_set_syncrate(struct adv_softc *adv, struct cam_path *path,
                         */
                        struct  ccb_trans_settings neg;
                        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_spi *spi =
                            &neg.xport_specific.spi;
 
@@ -1142,12 +1141,6 @@ adv_set_syncrate(struct adv_softc *adv, struct cam_path *path,
                        spi->sync_period = period;
                        spi->valid |= CTS_SPI_VALID_SYNC_OFFSET;
                        spi->valid |= CTS_SPI_VALID_SYNC_RATE;
-#else
-                       neg.sync_period = period;
-                       neg.sync_offset = offset;
-                       neg.valid = CCB_TRANS_SYNC_RATE_VALID
-                                 | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
                        xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
                        xpt_async(AC_TRANSFER_NEG, path, &neg);
                }
index 4f8ff3a..e1e60da 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/advansys/adwcam.c,v 1.7.2.2 2001/03/05 13:08:55 obrien Exp $
- * $DragonFly: src/sys/dev/disk/advansys/adwcam.c,v 1.17 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/advansys/adwcam.c,v 1.18 2008/02/10 00:01:02 pavalos Exp $
  */
 /*
  * Ported from:
@@ -512,10 +512,8 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
                break;
        case XPT_SET_TRAN_SETTINGS:
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi;
                struct ccb_trans_settings_spi *spi;
-#endif
                struct    ccb_trans_settings *cts;
                u_int     target_mask;
 
@@ -523,7 +521,6 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
                target_mask = 0x01 << ccb->ccb_h.target_id;
 
                crit_enter();
-#ifdef CAM_NEW_TRAN_CODE
                scsi = &cts->proto_specific.scsi;
                spi = &cts->xport_specific.spi;
                if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
@@ -635,117 +632,6 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
                                }
                        }
                }
-#else
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       u_int sdtrdone;
-
-                       sdtrdone = adw_lram_read_16(adw, ADW_MC_SDTR_DONE);
-                       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                               u_int discenb;
-
-                               discenb =
-                                   adw_lram_read_16(adw, ADW_MC_DISC_ENABLE);
-
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                                       discenb |= target_mask;
-                               else
-                                       discenb &= ~target_mask;
-
-                               adw_lram_write_16(adw, ADW_MC_DISC_ENABLE,
-                                                 discenb);
-                       }
-               
-                       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                                       adw->tagenb |= target_mask;
-                               else
-                                       adw->tagenb &= ~target_mask;
-                       }       
-
-                       if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) {
-                               u_int wdtrenb_orig;
-                               u_int wdtrenb;
-                               u_int wdtrdone;
-
-                               wdtrenb_orig =
-                                   adw_lram_read_16(adw, ADW_MC_WDTR_ABLE);
-                               wdtrenb = wdtrenb_orig;
-                               wdtrdone = adw_lram_read_16(adw,
-                                                           ADW_MC_WDTR_DONE);
-                               switch (cts->bus_width) {
-                               case MSG_EXT_WDTR_BUS_32_BIT:
-                               case MSG_EXT_WDTR_BUS_16_BIT:
-                                       wdtrenb |= target_mask;
-                                       break;
-                               case MSG_EXT_WDTR_BUS_8_BIT:
-                               default:
-                                       wdtrenb &= ~target_mask;
-                                       break;
-                               }
-                               if (wdtrenb != wdtrenb_orig) {
-                                       adw_lram_write_16(adw,
-                                                         ADW_MC_WDTR_ABLE,
-                                                         wdtrenb);
-                                       wdtrdone &= ~target_mask;
-                                       adw_lram_write_16(adw,
-                                                         ADW_MC_WDTR_DONE,
-                                                         wdtrdone);
-                                       /* Wide negotiation forces async */
-                                       sdtrdone &= ~target_mask;
-                                       adw_lram_write_16(adw,
-                                                         ADW_MC_SDTR_DONE,
-                                                         sdtrdone);
-                               }
-                       }
-
-                       if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-                        || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) {
-                               u_int sdtr_orig;
-                               u_int sdtr;
-                               u_int sdtrable_orig;
-                               u_int sdtrable;
-
-                               sdtr = adw_get_chip_sdtr(adw,
-                                                        ccb->ccb_h.target_id);
-                               sdtr_orig = sdtr;
-                               sdtrable = adw_lram_read_16(adw,
-                                                           ADW_MC_SDTR_ABLE);
-                               sdtrable_orig = sdtrable;
-
-                               if ((cts->valid
-                                  & CCB_TRANS_SYNC_RATE_VALID) != 0) {
-
-                                       sdtr =
-                                           adw_find_sdtr(adw,
-                                                         cts->sync_period);
-                               }
-                                       
-                               if ((cts->valid
-                                  & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
-                                       if (cts->sync_offset == 0)
-                                               sdtr = ADW_MC_SDTR_ASYNC;
-                               }
-
-                               if (sdtr == ADW_MC_SDTR_ASYNC)
-                                       sdtrable &= ~target_mask;
-                               else
-                                       sdtrable |= target_mask;
-                               if (sdtr != sdtr_orig
-                                || sdtrable != sdtrable_orig) {
-                                       adw_set_chip_sdtr(adw,
-                                                         ccb->ccb_h.target_id,
-                                                         sdtr);
-                                       sdtrdone &= ~target_mask;
-                                       adw_lram_write_16(adw, ADW_MC_SDTR_ABLE,
-                                                         sdtrable);
-                                       adw_lram_write_16(adw, ADW_MC_SDTR_DONE,
-                                                         sdtrdone);
-                                       
-                               }
-                       } 
-               }
-#endif
                crit_exit();
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
@@ -754,16 +640,13 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
        case XPT_GET_TRAN_SETTINGS:
        /* Get default/user set transfer settings for the target */
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi;
                struct ccb_trans_settings_spi *spi;
-#endif
                struct  ccb_trans_settings *cts;
                u_int   target_mask;
  
                cts = &ccb->cts;
                target_mask = 0x01 << ccb->ccb_h.target_id;
-#ifdef CAM_NEW_TRAN_CODE
                cts->protocol = PROTO_SCSI;
                cts->protocol_version = SCSI_REV_2;
                cts->transport = XPORT_SPI;
@@ -831,72 +714,6 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
                           | CTS_SPI_VALID_BUS_WIDTH
                           | CTS_SPI_VALID_DISC;
                scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-                       u_int mc_sdtr;
-
-                       cts->flags = 0;
-                       if ((adw->user_discenb & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-
-                       if ((adw->user_tagenb & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-
-                       if ((adw->user_wdtr & target_mask) != 0)
-                               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                       else
-                               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-
-                       mc_sdtr = adw_get_user_sdtr(adw, ccb->ccb_h.target_id);
-                       cts->sync_period = adw_find_period(adw, mc_sdtr);
-                       if (cts->sync_period != 0)
-                               cts->sync_offset = 15; /* XXX ??? */
-                       else
-                               cts->sync_offset = 0;
-
-                       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                                  | CCB_TRANS_SYNC_OFFSET_VALID
-                                  | CCB_TRANS_BUS_WIDTH_VALID
-                                  | CCB_TRANS_DISC_VALID
-                                  | CCB_TRANS_TQ_VALID;
-                       ccb->ccb_h.status = CAM_REQ_CMP;
-               } else {
-                       u_int targ_tinfo;
-
-                       cts->flags = 0;
-                       if ((adw_lram_read_16(adw, ADW_MC_DISC_ENABLE)
-                         & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-
-                       if ((adw->tagenb & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-
-                       targ_tinfo =
-                           adw_lram_read_16(adw,
-                                            ADW_MC_DEVICE_HSHK_CFG_TABLE
-                                            + (2 * ccb->ccb_h.target_id));
-
-                       if ((targ_tinfo & ADW_HSHK_CFG_WIDE_XFR) != 0)
-                               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                       else
-                               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-
-                       cts->sync_period =
-                           adw_hshk_cfg_period_factor(targ_tinfo);
-
-                       cts->sync_offset = targ_tinfo & ADW_HSHK_CFG_OFFSET;
-                       if (cts->sync_period == 0)
-                               cts->sync_offset = 0;
-
-                       if (cts->sync_offset == 0)
-                               cts->sync_period = 0;
-               }
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID
-                          | CCB_TRANS_DISC_VALID
-                          | CCB_TRANS_TQ_VALID;
-#endif
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -970,12 +787,10 @@ adw_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "AdvanSys", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
index dd6f500..2c0f6c0 100644 (file)
@@ -56,7 +56,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/aha/aha.c,v 1.34.2.1 2000/08/02 22:24:39 peter Exp $
- * $DragonFly: src/sys/dev/disk/aha/aha.c,v 1.18 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/aha/aha.c,v 1.19 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include <sys/param.h>
@@ -981,7 +981,6 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
        {
                struct  ccb_trans_settings *cts = &ccb->cts;
                u_int   target_mask = 0x01 << ccb->ccb_h.target_id;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -1016,32 +1015,6 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
                } else {
                        ahafetchtransinfo(aha, cts);
                }
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-                       cts->flags = 0;
-                       if ((aha->disc_permitted & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-                       if ((aha->sync_permitted & target_mask) != 0) {
-                               if (aha->boardid >= BOARD_1542CF)
-                                       cts->sync_period = 25;
-                               else
-                                       cts->sync_period = 50;
-                       } else
-                               cts->sync_period = 0;
-
-                       if (cts->sync_period != 0)
-                               cts->sync_offset = 15;
-
-                       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                                  | CCB_TRANS_SYNC_OFFSET_VALID
-                                  | CCB_TRANS_BUS_WIDTH_VALID
-                                  | CCB_TRANS_DISC_VALID
-                                  | CCB_TRANS_TQ_VALID;
-               } else {
-                       ahafetchtransinfo(aha, cts);
-               }
-#endif
 
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
@@ -1105,12 +1078,10 @@ ahaaction(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -1800,9 +1771,7 @@ ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts)
        int             error;
        u_int8_t        param;
        targ_syncinfo_t sync_info;
-#ifdef CAM_NEW_TRAN_CODE
        struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi;
-#endif
 
        target = cts->ccb_h.target_id;
        targ_offset = (target & 0x7);
@@ -1825,7 +1794,6 @@ ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts)
 
        sync_info = setup_info.syncinfo[targ_offset];
 
-#ifdef CAM_NEW_TRAN_CODE
        if (sync_info.sync == 0)
                spi->sync_offset = 0;
        else
@@ -1848,30 +1816,6 @@ ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts)
        spi->valid = CTS_SPI_VALID_SYNC_RATE
                   | CTS_SPI_VALID_SYNC_OFFSET
                   | CTS_SPI_VALID_BUS_WIDTH;
-#else
-       if (sync_info.sync == 0)
-               cts->sync_offset = 0;
-       else
-               cts->sync_offset = sync_info.offset;
-
-       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-
-       if (aha->boardid >= BOARD_1542CF)
-               sync_period = 1000;
-       else
-               sync_period = 2000;
-       sync_period += 500 * sync_info.period;
-
-       /* Convert ns value to standard SCSI sync rate */
-       if (cts->sync_offset != 0)
-               cts->sync_period = scsi_calc_syncparam(sync_period);
-       else
-               cts->sync_period = 0;
-       
-       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                  | CCB_TRANS_SYNC_OFFSET_VALID
-                  | CCB_TRANS_BUS_WIDTH_VALID;
-#endif
         xpt_async(AC_TRANSFER_NEG, cts->ccb_h.path, cts);
 }
 
index 94fd206..1b0a273 100644 (file)
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.18.2.3 2001/03/05 13:08:55 obrien Exp $
- * $DragonFly: src/sys/dev/disk/ahb/ahb.c,v 1.17 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/ahb/ahb.c,v 1.18 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include <sys/param.h>
@@ -701,24 +701,17 @@ ahbprocesserror(struct ahb_softc *ahb, struct ecb *ecb, union ccb *ccb)
        case HS_TAG_MSG_REJECTED:
        {
                struct ccb_trans_settings neg; 
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi = &neg.proto_specific.scsi;
-#endif
 
                xpt_print_path(ccb->ccb_h.path);
                kprintf("refuses tagged commands.  Performing "
                       "non-tagged I/O\n");
                memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
                neg.protocol = PROTO_SCSI;
                neg.protocol_version = SCSI_REV_2;
                neg.transport = XPORT_SPI;
                neg.transport_version = 2;
                scsi->flags = CTS_SCSI_VALID_TQ;
-#else
-               neg.flags = 0;
-               neg.valid = CCB_TRANS_TQ_VALID;
-#endif
                xpt_setup_ccb(&neg.ccb_h, ccb->ccb_h.path, /*priority*/1); 
                xpt_async(AC_TRANSFER_NEG, ccb->ccb_h.path, &neg);
                ahb->tags_permitted &= ~(0x01 << ccb->ccb_h.target_id);
@@ -1113,7 +1106,6 @@ ahbaction(struct cam_sim *sim, union ccb *ccb)
        {
                struct  ccb_trans_settings *cts = &ccb->cts;
                u_int   target_mask = 0x01 << ccb->ccb_h.target_id;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -1146,29 +1138,6 @@ ahbaction(struct cam_sim *sim, union ccb *ccb)
                } else {
                        ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
                }
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-                       cts->flags = 0;
-                       if ((ahb->disc_permitted & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       if ((ahb->tags_permitted & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-                       cts->sync_period = 25; /* 10MHz */
-
-                       if (cts->sync_period != 0)
-                               cts->sync_offset = 15;
-
-                       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                                  | CCB_TRANS_SYNC_OFFSET_VALID
-                                  | CCB_TRANS_BUS_WIDTH_VALID
-                                  | CCB_TRANS_DISC_VALID
-                                  | CCB_TRANS_TQ_VALID;
-                       ccb->ccb_h.status = CAM_REQ_CMP;
-               } else {
-                       ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-               }
-#endif
                xpt_done(ccb);
                break;
        }
@@ -1246,12 +1215,10 @@ ahbaction(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
index 2b91e04..a02e7b5 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/aic/aic.c,v 1.8 2000/01/14 23:42:35 imp Exp $
- * $DragonFly: src/sys/dev/disk/aic/aic.c,v 1.12 2008/01/05 07:27:09 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/aic/aic.c,v 1.13 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include <sys/param.h>
@@ -170,7 +170,6 @@ aic_action(struct cam_sim *sim, union ccb *ccb)
        {
                struct ccb_trans_settings *cts = cts = &ccb->cts;
                struct aic_tinfo *ti = &aic->tinfo[ccb->ccb_h.target_id];
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -216,37 +215,6 @@ aic_action(struct cam_sim *sim, union ccb *ccb)
                        ti->flags |= TINFO_SDTR_NEGO;
 
                crit_exit();
-#else
-               crit_enter();
-               if ((cts->valid & CCB_TRANS_DISC_VALID) != 0 &&
-                   (aic->flags & AIC_DISC_ENABLE) != 0) {
-                       if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                               ti->flags |= TINFO_DISC_ENB;
-                       else
-                               ti->flags &= ~TINFO_DISC_ENB;
-               }
-
-               if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                       if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                               ti->flags |= TINFO_TAG_ENB;
-                       else
-                               ti->flags &= ~TINFO_TAG_ENB;
-               }
-
-               if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
-                       ti->goal.period = cts->sync_period;
-                       if (ti->goal.period != ti->current.period)
-                               ti->flags |= TINFO_SDTR_NEGO;
-               }
-
-               if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
-                       ti->goal.offset = cts->sync_offset;
-                       if (ti->goal.offset != ti->current.offset)
-                               ti->flags |= TINFO_SDTR_NEGO;
-               }
-
-               crit_exit();
-#endif
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -255,7 +223,6 @@ aic_action(struct cam_sim *sim, union ccb *ccb)
        {
                struct ccb_trans_settings *cts = &ccb->cts;
                struct aic_tinfo *ti = &aic->tinfo[ccb->ccb_h.target_id];
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -289,31 +256,6 @@ aic_action(struct cam_sim *sim, union ccb *ccb)
                           | CTS_SPI_VALID_BUS_WIDTH
                           | CTS_SPI_VALID_DISC;
                scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-               crit_enter();
-               cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-               if ((ti->flags & TINFO_DISC_ENB) != 0)
-                       cts->flags |= CCB_TRANS_DISC_ENB;
-               if ((ti->flags & TINFO_TAG_ENB) != 0)
-                       cts->flags |= CCB_TRANS_TAG_ENB;
-
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       cts->sync_period = ti->current.period;
-                       cts->sync_offset = ti->current.offset;
-               } else {
-                       cts->sync_period = ti->user.period;
-                       cts->sync_offset = ti->user.offset;
-               }
-               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-
-               crit_exit();
-
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID
-                          | CCB_TRANS_DISC_VALID
-                          | CCB_TRANS_TQ_VALID;
-#endif
 
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
@@ -348,12 +290,10 @@ aic_action(struct cam_sim *sim, union ccb *ccb)
                 strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
                 strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                 cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                 cpi->ccb_h.status = CAM_REQ_CMP;
                 xpt_done(ccb);
                 break;
@@ -670,9 +610,7 @@ aic_handle_msgin(struct aic_softc *aic)
        struct ccb_hdr *ccb_h;
        struct aic_tinfo *ti;
        struct ccb_trans_settings neg;
-#ifdef CAM_NEW_TRAN_CODE
        struct ccb_trans_settings_spi *spi = &neg.xport_specific.spi;
-#endif
 
        if (aic->state == AIC_RESELECTED) {
                if (!MSG_ISIDENTIFY(aic->msg_buf[0])) {
@@ -759,7 +697,6 @@ aic_handle_msgin(struct aic_softc *aic)
                            ((ti->current.period * 4 + 49) / 50 - 2) << 4 : 0;
                        aic_outb(aic, SCSIRATE, ti->scsirate);
                        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
                        neg.protocol = PROTO_SCSI;
                        neg.protocol_version = SCSI_REV_2;
                        neg.transport = XPORT_SPI;
@@ -768,12 +705,6 @@ aic_handle_msgin(struct aic_softc *aic)
                        spi->sync_offset = ti->goal.offset = ti->current.offset;
                        spi->valid = CTS_SPI_VALID_SYNC_RATE
                                  | CTS_SPI_VALID_SYNC_OFFSET;
-#else
-                       neg.sync_period = ti->goal.period = ti->current.period;
-                       neg.sync_offset = ti->goal.offset = ti->current.offset;
-                       neg.valid = CCB_TRANS_SYNC_RATE_VALID
-                                 | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
                        ccb_h = &scb->ccb->ccb_h;
                        xpt_setup_ccb(&neg.ccb_h, ccb_h->path, 1);
                        xpt_async(AC_TRANSFER_NEG, ccb_h->path, &neg);
@@ -810,7 +741,6 @@ aic_handle_msgin(struct aic_softc *aic)
                        ti->scsirate = 0;
                        aic_outb(aic, SCSIRATE, ti->scsirate);
                        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
                        neg.protocol = PROTO_SCSI;
                        neg.protocol_version = SCSI_REV_2;
                        neg.transport = XPORT_SPI;
@@ -819,12 +749,6 @@ aic_handle_msgin(struct aic_softc *aic)
                        spi->sync_offset = ti->current.offset;
                        spi->valid = CTS_SPI_VALID_SYNC_RATE
                                  | CTS_SPI_VALID_SYNC_OFFSET;
-#else
-                       neg.sync_period = ti->current.period;
-                       neg.sync_offset = ti->current.offset;
-                       neg.valid = CCB_TRANS_SYNC_RATE_VALID
-                                 | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
                        ccb_h = &scb->ccb->ccb_h;
                        xpt_setup_ccb(&neg.ccb_h, ccb_h->path, 1);
                        xpt_async(AC_TRANSFER_NEG, ccb_h->path, &neg);
index 846f869..2a39ef7 100644 (file)
@@ -32,7 +32,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.c#35 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.23 2005/12/04 02:12:40 ru Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.22 2008/02/09 18:13:13 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.23 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include "aic79xx_osm.h"
@@ -581,7 +581,6 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef AHD_NEW_TRAN_SETTINGS
                cpi->protocol = PROTO_SCSI;
                cpi->protocol_version = SCSI_REV_2;
                cpi->transport = XPORT_SPI;
@@ -589,7 +588,6 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
                cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_ST;
                cpi->transport_version = 4;
                cpi->xport_specific.spi.ppr_options = SID_SPI_CLOCK_DT_ST;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -606,7 +604,6 @@ static void
 ahd_set_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
                      struct ccb_trans_settings *cts)
 {
-#ifdef AHD_NEW_TRAN_SETTINGS
        struct    ahd_devinfo devinfo;
        struct    ccb_trans_settings_scsi *scsi;
        struct    ccb_trans_settings_spi *spi;
@@ -717,124 +714,12 @@ ahd_set_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
                                 update_type, /*paused*/FALSE);
        }
        cts->ccb_h.status = CAM_REQ_CMP;
-#else
-       struct    ahd_devinfo devinfo;
-       struct    ahd_initiator_tinfo *tinfo;
-       struct    ahd_tmode_tstate *tstate;
-       uint16_t *discenable;
-       uint16_t *tagenable;
-       u_int     update_type;
-
-       ahd_compile_devinfo(&devinfo, SIM_SCSI_ID(ahd, sim),
-                           cts->ccb_h.target_id,
-                           cts->ccb_h.target_lun,
-                           SIM_CHANNEL(ahd, sim),
-                           ROLE_UNKNOWN);
-       tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
-                                   devinfo.our_scsiid,
-                                   devinfo.target, &tstate);
-       update_type = 0;
-       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-               update_type |= AHD_TRANS_GOAL;
-               discenable = &tstate->discenable;
-               tagenable = &tstate->tagenable;
-       } else if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-               update_type |= AHD_TRANS_USER;
-               discenable = &ahd->user_discenable;
-               tagenable = &ahd->user_tagenable;
-       } else {
-               cts->ccb_h.status = CAM_REQ_INVALID;
-               return;
-       }
-       
-       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                       *discenable |= devinfo.target_mask;
-               else
-                       *discenable &= ~devinfo.target_mask;
-       }
-       
-       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                       *tagenable |= devinfo.target_mask;
-               else
-                       *tagenable &= ~devinfo.target_mask;
-       }       
-
-       if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) {
-               ahd_validate_width(ahd, /*tinfo limit*/NULL,
-                                  &cts->bus_width, ROLE_UNKNOWN);
-               ahd_set_width(ahd, &devinfo, cts->bus_width,
-                             update_type, /*paused*/FALSE);
-       }
-
-       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0) {
-               if (update_type == AHD_TRANS_USER)
-                       cts->sync_offset = tinfo->user.offset;
-               else
-                       cts->sync_offset = tinfo->goal.offset;
-       }
-
-       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) == 0) {
-               if (update_type == AHD_TRANS_USER)
-                       cts->sync_period = tinfo->user.period;
-               else
-                       cts->sync_period = tinfo->goal.period;
-       }
-
-       if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-        || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-        || ((cts->valid & CCB_TRANS_TQ_VALID) != 0)
-        || ((cts->valid & CCB_TRANS_DISC_VALID) != 0)) {
-               u_int ppr_options;
-               u_int maxsync;
-
-               maxsync = AHD_SYNCRATE_MAX;
-               ppr_options = 0;
-               if (cts->sync_period <= AHD_SYNCRATE_DT
-                && cts->bus_width == MSG_EXT_WDTR_BUS_16_BIT) {
-                       ppr_options = tinfo->user.ppr_options
-                                   | MSG_EXT_PPR_DT_REQ;
-               }
-
-               if ((*tagenable & devinfo.target_mask) == 0
-                || (*discenable & devinfo.target_mask) == 0)
-                       ppr_options &= ~MSG_EXT_PPR_IU_REQ;
-
-               ahd_find_syncrate(ahd, &cts->sync_period,
-                                 &ppr_options, maxsync);
-               ahd_validate_offset(ahd, /*tinfo limit*/NULL,
-                                   cts->sync_period, &cts->sync_offset,
-                                   MSG_EXT_WDTR_BUS_8_BIT,
-                                   ROLE_UNKNOWN);
-
-               /* We use a period of 0 to represent async */
-               if (cts->sync_offset == 0) {
-                       cts->sync_period = 0;
-                       ppr_options = 0;
-               }
-
-               if (ppr_options != 0
-                && tinfo->user.transport_version >= 3) {
-                       tinfo->goal.transport_version =
-                           tinfo->user.transport_version;
-                       tinfo->curr.transport_version =
-                           tinfo->user.transport_version;
-               }
-               
-               ahd_set_syncrate(ahd, &devinfo, cts->sync_period,
-                                cts->sync_offset, ppr_options,
-                                update_type, /*paused*/FALSE);
-       }
-       cts->ccb_h.status = CAM_REQ_CMP;
-#endif
 }
 
 static void
 ahd_get_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
                      struct ccb_trans_settings *cts)
 {
-#ifdef AHD_NEW_TRAN_SETTINGS
        struct  ahd_devinfo devinfo;
        struct  ccb_trans_settings_scsi *scsi;
        struct  ccb_trans_settings_spi *spi;
@@ -895,52 +780,6 @@ ahd_get_tran_settings(struct ahd_softc *ahd, int our_id, char channel,
        }
 
        cts->ccb_h.status = CAM_REQ_CMP;
-#else
-       struct  ahd_devinfo devinfo;
-       struct  ahd_initiator_tinfo *targ_info;
-       struct  ahd_tmode_tstate *tstate;
-       struct  ahd_transinfo *tinfo;
-
-       ahd_compile_devinfo(&devinfo, our_id,
-                           cts->ccb_h.target_id,
-                           cts->ccb_h.target_lun,
-                           channel, ROLE_UNKNOWN);
-       targ_info = ahd_fetch_transinfo(ahd, devinfo.channel,
-                                       devinfo.our_scsiid,
-                                       devinfo.target, &tstate);
-       
-       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
-               tinfo = &targ_info->curr;
-       else
-               tinfo = &targ_info->user;
-       
-       cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) == 0) {
-               if ((ahd->user_discenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_DISC_ENB;
-
-               if ((ahd->user_tagenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_TAG_ENB;
-       } else {
-               if ((tstate->discenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_DISC_ENB;
-
-               if ((tstate->tagenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_TAG_ENB;
-       }
-       cts->sync_period = tinfo->period;
-       cts->sync_offset = tinfo->offset;
-       cts->bus_width = tinfo->width;
-       
-       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                  | CCB_TRANS_SYNC_OFFSET_VALID
-                  | CCB_TRANS_BUS_WIDTH_VALID;
-
-       if (cts->ccb_h.target_lun != CAM_LUN_WILDCARD)
-               cts->valid |= CCB_TRANS_DISC_VALID|CCB_TRANS_TQ_VALID;
-
-       cts->ccb_h.status = CAM_REQ_CMP;
-#endif
 }
 
 static void
@@ -1321,36 +1160,22 @@ ahd_send_async(struct ahd_softc *ahd, char channel, u_int target,
        switch (code) {
        case AC_TRANSFER_NEG:
        {
-#ifdef AHD_NEW_TRAN_SETTINGS
                struct  ccb_trans_settings_scsi *scsi;
        
                cts.type = CTS_TYPE_CURRENT_SETTINGS;
                scsi = &cts.proto_specific.scsi;
-#else
-               cts.flags = CCB_TRANS_CURRENT_SETTINGS;
-#endif
                cts.ccb_h.path = path;
                cts.ccb_h.target_id = target;
                cts.ccb_h.target_lun = lun;
                ahd_get_tran_settings(ahd, ahd->our_id, channel, &cts);
                arg = &cts;
-#ifdef AHD_NEW_TRAN_SETTINGS
                scsi->valid &= ~CTS_SCSI_VALID_TQ;
                scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
-#else
-               cts.valid &= ~CCB_TRANS_TQ_VALID;
-               cts.flags &= ~CCB_TRANS_TAG_ENB;
-#endif
                if (opt_arg == NULL)
                        break;
                if (*((ahd_queue_alg *)opt_arg) == AHD_QUEUE_TAGGED)
-#ifdef AHD_NEW_TRAN_SETTINGS
                        scsi->flags |= ~CTS_SCSI_FLAGS_TAG_ENB;
                scsi->valid |= CTS_SCSI_VALID_TQ;
-#else
-                       cts.flags |= CCB_TRANS_TAG_ENB;
-               cts.valid |= CCB_TRANS_TQ_VALID;
-#endif
                break;
        }
        case AC_SENT_BDR:
index dcaadf8..73f8877 100644 (file)
@@ -33,7 +33,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#23 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.18 2005/12/06 11:19:36 ru Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.h,v 1.12 2008/02/09 18:13:13 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.h,v 1.13 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #ifndef _AIC79XX_FREEBSD_H_
 #include <bus/cam/scsi/scsi_message.h>
 #include <bus/cam/scsi/scsi_iu.h>
 
-#ifdef CAM_NEW_TRAN_CODE
-#define AHD_NEW_TRAN_SETTINGS
-#endif /* CAM_NEW_TRAN_CODE */
-
 /****************************** Platform Macros *******************************/
 #define        SIM_IS_SCSIBUS_B(ahd, sim)      \
        (0)
index c6c1069..0aa9094 100644 (file)
@@ -31,7 +31,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.c#20 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.45 2006/09/05 20:28:28 mjacob Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.21 2008/02/09 18:13:13 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.22 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include "aic7xxx_osm.h"
@@ -587,7 +587,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
        }
        case XPT_SET_TRAN_SETTINGS:
        {
-#ifdef AHC_NEW_TRAN_SETTINGS
                struct  ahc_devinfo devinfo;
                struct  ccb_trans_settings *cts;
                struct  ccb_trans_settings_scsi *scsi;
@@ -713,122 +712,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                }
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
-#else
-               struct    ahc_devinfo devinfo;
-               struct    ccb_trans_settings *cts;
-               struct    ahc_initiator_tinfo *tinfo;
-               struct    ahc_tmode_tstate *tstate;
-               uint16_t *discenable;
-               uint16_t *tagenable;
-               u_int     update_type;
-
-               cts = &ccb->cts;
-               ahc_compile_devinfo(&devinfo, SIM_SCSI_ID(ahc, sim),
-                                   cts->ccb_h.target_id,
-                                   cts->ccb_h.target_lun,
-                                   SIM_CHANNEL(ahc, sim),
-                                   ROLE_UNKNOWN);
-               tinfo = ahc_fetch_transinfo(ahc, devinfo.channel,
-                                           devinfo.our_scsiid,
-                                           devinfo.target, &tstate);
-               update_type = 0;
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       update_type |= AHC_TRANS_GOAL;
-                       discenable = &tstate->discenable;
-                       tagenable = &tstate->tagenable;
-               } else if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-                       update_type |= AHC_TRANS_USER;
-                       discenable = &ahc->user_discenable;
-                       tagenable = &ahc->user_tagenable;
-               } else {
-                       ccb->ccb_h.status = CAM_REQ_INVALID;
-                       xpt_done(ccb);
-                       break;
-               }
-               
-               if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                       if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                               *discenable |= devinfo.target_mask;
-                       else
-                               *discenable &= ~devinfo.target_mask;
-               }
-               
-               if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                       if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                               *tagenable |= devinfo.target_mask;
-                       else
-                               *tagenable &= ~devinfo.target_mask;
-               }       
-
-               if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) {
-                       ahc_validate_width(ahc, /*tinfo limit*/NULL,
-                                          &cts->bus_width, ROLE_UNKNOWN);
-                       ahc_set_width(ahc, &devinfo, cts->bus_width,
-                                     update_type, /*paused*/FALSE);
-               }
-
-               if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0) {
-                       if (update_type == AHC_TRANS_USER)
-                               cts->sync_offset = tinfo->user.offset;
-                       else
-                               cts->sync_offset = tinfo->goal.offset;
-               }
-
-               if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) == 0) {
-                       if (update_type == AHC_TRANS_USER)
-                               cts->sync_period = tinfo->user.period;
-                       else
-                               cts->sync_period = tinfo->goal.period;
-               }
-
-               if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-                || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) {
-                       struct ahc_syncrate *syncrate;
-                       u_int ppr_options;
-                       u_int maxsync;
-
-                       if ((ahc->features & AHC_ULTRA2) != 0)
-                               maxsync = AHC_SYNCRATE_DT;
-                       else if ((ahc->features & AHC_ULTRA) != 0)
-                               maxsync = AHC_SYNCRATE_ULTRA;
-                       else
-                               maxsync = AHC_SYNCRATE_FAST;
-
-                       ppr_options = 0;
-                       if (cts->sync_period <= 9
-                        && cts->bus_width == MSG_EXT_WDTR_BUS_16_BIT)
-                               ppr_options = MSG_EXT_PPR_DT_REQ;
-
-                       syncrate = ahc_find_syncrate(ahc, &cts->sync_period,
-                                                    &ppr_options,
-                                                    maxsync);
-                       ahc_validate_offset(ahc, /*tinfo limit*/NULL,
-                                           syncrate, &cts->sync_offset,
-                                           MSG_EXT_WDTR_BUS_8_BIT,
-                                           ROLE_UNKNOWN);
-
-                       /* We use a period of 0 to represent async */
-                       if (cts->sync_offset == 0) {
-                               cts->sync_period = 0;
-                               ppr_options = 0;
-                       }
-
-                       if (ppr_options == MSG_EXT_PPR_DT_REQ
-                        && tinfo->user.transport_version >= 3) {
-                               tinfo->goal.transport_version =
-                                   tinfo->user.transport_version;
-                               tinfo->curr.transport_version =
-                                   tinfo->user.transport_version;
-                       }
-                       
-                       ahc_set_syncrate(ahc, &devinfo, syncrate,
-                                        cts->sync_period, cts->sync_offset,
-                                        ppr_options, update_type,
-                                        /*paused*/FALSE);
-               }
-               ccb->ccb_h.status = CAM_REQ_CMP;
-               xpt_done(ccb);
-#endif
                break;
        }
        case XPT_GET_TRAN_SETTINGS:
@@ -905,7 +788,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef AHC_NEW_TRAN_SETTINGS
                cpi->protocol = PROTO_SCSI;
                cpi->protocol_version = SCSI_REV_2;
                cpi->transport = XPORT_SPI;
@@ -916,7 +798,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                        cpi->xport_specific.spi.ppr_options =
                            SID_SPI_CLOCK_DT_ST;
                }
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -932,7 +813,6 @@ static void
 ahc_get_tran_settings(struct ahc_softc *ahc, int our_id, char channel,
                      struct ccb_trans_settings *cts)
 {
-#ifdef AHC_NEW_TRAN_SETTINGS
        struct  ahc_devinfo devinfo;
        struct  ccb_trans_settings_scsi *scsi;
        struct  ccb_trans_settings_spi *spi;
@@ -993,52 +873,6 @@ ahc_get_tran_settings(struct ahc_softc *ahc, int our_id, char channel,
        }
 
        cts->ccb_h.status = CAM_REQ_CMP;
-#else
-       struct  ahc_devinfo devinfo;
-       struct  ahc_initiator_tinfo *targ_info;
-       struct  ahc_tmode_tstate *tstate;
-       struct  ahc_transinfo *tinfo;
-
-       ahc_compile_devinfo(&devinfo, our_id,
-                           cts->ccb_h.target_id,
-                           cts->ccb_h.target_lun,
-                           channel, ROLE_UNKNOWN);
-       targ_info = ahc_fetch_transinfo(ahc, devinfo.channel,
-                                       devinfo.our_scsiid,
-                                       devinfo.target, &tstate);
-       
-       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
-               tinfo = &targ_info->curr;
-       else
-               tinfo = &targ_info->user;
-       
-       cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) == 0) {
-               if ((ahc->user_discenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_DISC_ENB;
-
-               if ((ahc->user_tagenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_TAG_ENB;
-       } else {
-               if ((tstate->discenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_DISC_ENB;
-
-               if ((tstate->tagenable & devinfo.target_mask) != 0)
-                       cts->flags |= CCB_TRANS_TAG_ENB;
-       }
-       cts->sync_period = tinfo->period;
-       cts->sync_offset = tinfo->offset;
-       cts->bus_width = tinfo->width;
-       
-       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                  | CCB_TRANS_SYNC_OFFSET_VALID
-                  | CCB_TRANS_BUS_WIDTH_VALID;
-
-       if (cts->ccb_h.target_lun != CAM_LUN_WILDCARD)
-               cts->valid |= CCB_TRANS_DISC_VALID|CCB_TRANS_TQ_VALID;
-
-       cts->ccb_h.status = CAM_REQ_CMP;
-#endif
 }
 
 static void
@@ -1493,14 +1327,10 @@ ahc_send_async(struct ahc_softc *ahc, char channel, u_int target,
        switch (code) {
        case AC_TRANSFER_NEG:
        {
-#ifdef AHC_NEW_TRAN_SETTINGS
                struct  ccb_trans_settings_scsi *scsi;
        
                cts.type = CTS_TYPE_CURRENT_SETTINGS;
                scsi = &cts.proto_specific.scsi;
-#else
-               cts.flags = CCB_TRANS_CURRENT_SETTINGS;
-#endif
                cts.ccb_h.path = path;
                cts.ccb_h.target_id = target;
                cts.ccb_h.target_lun = lun;
@@ -1508,23 +1338,13 @@ ahc_send_async(struct ahc_softc *ahc, char channel, u_int target,
                                                          : ahc->our_id_b,
                                      channel, &cts);
                arg = &cts;
-#ifdef AHC_NEW_TRAN_SETTINGS
                scsi->valid &= ~CTS_SCSI_VALID_TQ;
                scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB;
-#else
-               cts.valid &= ~CCB_TRANS_TQ_VALID;
-               cts.flags &= ~CCB_TRANS_TAG_ENB;
-#endif
                if (opt_arg == NULL)
                        break;
                if (*((ahc_queue_alg *)opt_arg) == AHC_QUEUE_TAGGED)
-#ifdef AHC_NEW_TRAN_SETTINGS
                        scsi->flags |= ~CTS_SCSI_FLAGS_TAG_ENB;
                scsi->valid |= CTS_SCSI_VALID_TQ;
-#else
-                       cts.flags |= CCB_TRANS_TAG_ENB;
-               cts.valid |= CCB_TRANS_TQ_VALID;
-#endif
                break;
        }
        case AC_SENT_BDR:
index 4a39bc0..ec3c0ab 100644 (file)
@@ -32,7 +32,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.h#18 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.h,v 1.30 2005/12/05 11:58:32 ru Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.h,v 1.13 2008/02/09 18:13:13 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.h,v 1.14 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #ifndef _AIC7XXX_FREEBSD_H_
 #include <bus/cam/scsi/scsi_all.h>
 #include <bus/cam/scsi/scsi_message.h>
 
-#ifdef CAM_NEW_TRAN_CODE
-#define AHC_NEW_TRAN_SETTINGS
-#endif /* CAM_NEW_TRAN_CODE */
-
 /*************************** Attachment Bookkeeping ***************************/
 extern devclass_t ahc_devclass;
 
index 1fe00e4..d4caeef 100644 (file)
@@ -31,7 +31,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *********************************************************************
  * $FreeBSD: src/sys/pci/amd.c,v 1.3.2.2 2001/06/02 04:32:50 nyan Exp $
- * $DragonFly: src/sys/dev/disk/amd/amd.c,v 1.14 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/amd/amd.c,v 1.15 2008/02/10 00:01:02 pavalos Exp $
  */
 
 /*
@@ -476,12 +476,10 @@ amd_action(struct cam_sim * psim, union ccb * pccb)
                strncpy(cpi->hba_vid, "TRM-AMD", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(psim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(pccb);
                break;
@@ -520,7 +518,6 @@ amd_action(struct cam_sim * psim, union ccb * pccb)
                struct ccb_trans_settings *cts = &pccb->cts;
                struct amd_target_info *targ_info = &amd->tinfo[target_id];
                struct amd_transinfo *tinfo;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -569,54 +566,12 @@ amd_action(struct cam_sim * psim, union ccb * pccb)
                           | CTS_SPI_VALID_BUS_WIDTH
                           | CTS_SPI_VALID_DISC;
                scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-               crit_enter();
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       /* current transfer settings */
-                       if (targ_info->disc_tag & AMD_CUR_DISCENB) {
-                               cts->flags = CCB_TRANS_DISC_ENB;
-                       } else {
-                               cts->flags = 0; /* no tag & disconnect */
-                       }
-                       if (targ_info->disc_tag & AMD_CUR_TAGENB) {
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       }
-                       tinfo = &targ_info->current;
-               } else {
-                       /* default(user) transfer settings */
-                       if (targ_info->disc_tag & AMD_USR_DISCENB) {
-                               cts->flags = CCB_TRANS_DISC_ENB;
-                       } else {
-                               cts->flags = 0;
-                       }
-                       if (targ_info->disc_tag & AMD_USR_TAGENB) {
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       }
-                       tinfo = &targ_info->user;
-               }
-
-               cts->sync_period = tinfo->period;
-               cts->sync_offset = tinfo->offset;
-               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-               crit_exit();
-
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID
-                          | CCB_TRANS_DISC_VALID
-                          | CCB_TRANS_TQ_VALID;
-#endif
                pccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(pccb);
                break;
        }
-#ifdef  CAM_NEW_TRAN_CODE
 #define        IS_CURRENT_SETTINGS(c)  (c->type == CTS_TYPE_CURRENT_SETTINGS)
 #define        IS_USER_SETTINGS(c)     (c->type == CTS_TYPE_USER_SETTINGS)
-#else
-#define        IS_CURRENT_SETTINGS(c)  (c->flags & CCB_TRANS_CURRENT_SETTINGS)
-#define        IS_USER_SETTINGS(c)     (c->flags & CCB_TRANS_USER_SETTINGS)
-#endif
        case XPT_SET_TRAN_SETTINGS:
        {
                struct ccb_trans_settings *cts = &pccb->cts;
@@ -624,12 +579,10 @@ amd_action(struct cam_sim * psim, union ccb * pccb)
                u_int  update_type = 0;
                int    last_entry;
 
-#ifdef  CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
                    &cts->xport_specific.spi;
-#endif
                if (IS_CURRENT_SETTINGS(cts)) {
                        update_type |= AMD_TRANS_GOAL;
                } else if (IS_USER_SETTINGS(cts)) {
@@ -641,7 +594,6 @@ amd_action(struct cam_sim * psim, union ccb * pccb)
                        xpt_done(pccb);
                }
 
-#ifdef CAM_NEW_TRAN_CODE
                crit_enter();
                targ_info = &amd->tinfo[target_id];
 
@@ -716,78 +668,6 @@ amd_action(struct cam_sim * psim, union ccb * pccb)
                        targ_info->goal.period = spi->sync_period;
                        targ_info->goal.offset = spi->sync_offset;
                }
-#else
-               crit_enter();
-               targ_info = &amd->tinfo[target_id];
-
-               if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                       if (update_type & AMD_TRANS_GOAL) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0) {
-                                       targ_info->disc_tag |= AMD_CUR_DISCENB;
-                               } else {
-                                       targ_info->disc_tag &= ~AMD_CUR_DISCENB;
-                               }
-                       }
-                       if (update_type & AMD_TRANS_USER) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0) {
-                                       targ_info->disc_tag |= AMD_USR_DISCENB;
-                               } else {
-                                       targ_info->disc_tag &= ~AMD_USR_DISCENB;
-                               }
-                       }
-               }
-               if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                       if (update_type & AMD_TRANS_GOAL) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0) {
-                                       targ_info->disc_tag |= AMD_CUR_TAGENB;
-                               } else {
-                                       targ_info->disc_tag &= ~AMD_CUR_TAGENB;
-                               }
-                       }
-                       if (update_type & AMD_TRANS_USER) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0) {
-                                       targ_info->disc_tag |= AMD_USR_TAGENB;
-                               } else {
-                                       targ_info->disc_tag &= ~AMD_USR_TAGENB;
-                               }
-                       }
-               }
-
-               if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) == 0) {
-                       if (update_type & AMD_TRANS_GOAL)
-                               cts->sync_offset = targ_info->goal.offset;
-                       else
-                               cts->sync_offset = targ_info->user.offset;
-               }
-
-               if (cts->sync_offset > AMD_MAX_SYNC_OFFSET)
-                       cts->sync_offset = AMD_MAX_SYNC_OFFSET;
-
-               if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) == 0) {
-                       if (update_type & AMD_TRANS_GOAL)
-                               cts->sync_period = targ_info->goal.period;
-                       else
-                               cts->sync_period = targ_info->user.period;
-               }
-
-               last_entry = sizeof(tinfo_sync_period) - 1;
-               if ((cts->sync_period != 0)
-                && (cts->sync_period < tinfo_sync_period[0]))
-                       cts->sync_period = tinfo_sync_period[0];
-               if (cts->sync_period > tinfo_sync_period[last_entry])
-                       cts->sync_period = 0;
-               if (cts->sync_offset == 0)
-                       cts->sync_period = 0;
-
-               if ((update_type & AMD_TRANS_USER) != 0) {
-                       targ_info->user.period = cts->sync_period;
-                       targ_info->user.offset = cts->sync_offset;
-               }
-               if ((update_type & AMD_TRANS_GOAL) != 0) {
-                       targ_info->goal.period = cts->sync_period;
-                       targ_info->goal.offset = cts->sync_offset;
-               }
-#endif
                crit_exit();
                pccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(pccb);
@@ -936,23 +816,14 @@ amdsetsync(struct amd_softc *amd, u_int target, u_int clockrate,
                                    cam_sim_path(amd->psim), target,
                                    CAM_LUN_WILDCARD) == CAM_REQ_CMP) {
                        struct ccb_trans_settings neg;
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_spi *spi =
                            &neg.xport_specific.spi;
-#endif
                        xpt_setup_ccb(&neg.ccb_h, path, /*priority*/1);
                        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
                        spi->sync_period = period;
                        spi->sync_offset = offset;
                        spi->valid = CTS_SPI_VALID_SYNC_RATE
                                  | CTS_SPI_VALID_SYNC_OFFSET;
-#else
-                       neg.sync_period = period;
-                       neg.sync_offset = offset;
-                       neg.valid = CCB_TRANS_SYNC_RATE_VALID
-                                 | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
                        xpt_async(AC_TRANSFER_NEG, path, &neg);
                        xpt_free_path(path);    
                }
@@ -1609,21 +1480,14 @@ amdhandlemsgreject(struct amd_softc *amd)
        } else if ((srb != NULL)
                && (srb->pccb->ccb_h.flags & CAM_TAG_ACTION_VALID) != 0) {
                struct  ccb_trans_settings neg;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi = &neg.proto_specific.scsi;
-#endif
 
                kprintf("amd%d:%d: refuses tagged commands.  Performing "
                       "non-tagged I/O\n", amd->unit, amd->cur_target);
 
                amdsettags(amd, amd->cur_target, FALSE);
                memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
                scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-               neg.flags = 0;
-               neg.valid = CCB_TRANS_TQ_VALID;
-#endif
                xpt_setup_ccb(&neg.ccb_h, srb->pccb->ccb_h.path, /*priority*/1);
                xpt_async(AC_TRANSFER_NEG, srb->pccb->ccb_h.path, &neg);
 
index a196eb1..05144cb 100644 (file)
@@ -26,7 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.10.2.3 2003/05/21 09:24:55 thomas Exp $
- * $DragonFly: src/sys/dev/disk/ata/atapi-cam.c,v 1.13 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/ata/atapi-cam.c,v 1.14 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include <sys/param.h>
@@ -251,12 +251,10 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
        cpi->unit_number = cam_sim_unit(sim);
        cpi->bus_id = cam_sim_bus(sim);
        cpi->base_transfer_speed = 3300;
-#ifdef CAM_NEW_TRAN_CODE
        cpi->transport = XPORT_ATA;
        cpi->transport_version = 2;
        cpi->protocol = PROTO_SCSI;
        cpi->protocol_version = SCSI_REV_2;
-#endif
        if (softc->ata_ch && ccb_h->target_id != CAM_TARGET_WILDCARD) {
            switch (softc->ata_ch->device[ccb_h->target_id].mode) {
            case ATA_PIO1:
@@ -322,7 +320,6 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
 
     case XPT_GET_TRAN_SETTINGS: {
        struct ccb_trans_settings *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
        cts->protocol = PROTO_SCSI;
        cts->protocol_version = SCSI_REV_2;
        cts->transport = XPORT_ATA;
@@ -330,15 +327,6 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
        cts->proto_specific.valid = 0;
        cts->xport_specific.valid = 0;
        /* nothing more to do */
-#else
-       /*
-        * The default CAM transport code is very SCSI-specific and
-        * doesn't understand IDE speeds very well.  Be silent about it
-        * here and let it default to what is set in XPT_PATH_INQ
-        */
-       cts->valid = (CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID);
-       cts->flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
-#endif
        ccb->ccb_h.status = CAM_REQ_CMP;
        CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_SUBTRACE, ("GET_TRAN_SETTINGS\n"));
        xpt_done(ccb);
index 7a5443e..9e2d3c4 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/buslogic/bt.c,v 1.25.2.1 2000/08/02 22:32:26 peter Exp $
- * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.17 2008/01/21 04:51:41 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.18 2008/02/10 00:01:02 pavalos Exp $
  */
 
  /*
@@ -1237,7 +1237,6 @@ btaction(struct cam_sim *sim, union ccb *ccb)
 
                cts = &ccb->cts;
                target_mask = 0x01 << ccb->ccb_h.target_id;
-#ifdef CAM_NEW_TRAN_CODE
                if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
@@ -1283,36 +1282,6 @@ btaction(struct cam_sim *sim, union ccb *ccb)
                        } else
                                scsi->valid = 0;
                } else {
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-                       cts->flags = 0;
-                       if ((bt->disc_permitted & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       if ((bt->tags_permitted & target_mask) != 0)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       if ((bt->wide_permitted & target_mask) != 0)
-                               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                       else
-                               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-                       if ((bt->ultra_permitted & target_mask) != 0)
-                               cts->sync_period = 12;
-                       else if ((bt->fast_permitted & target_mask) != 0)
-                               cts->sync_period = 25;
-                       else if ((bt->sync_permitted & target_mask) != 0)
-                               cts->sync_period = 50;
-                       else
-                               cts->sync_period = 0;
-
-                       if (cts->sync_period != 0)
-                               cts->sync_offset = 15;
-
-                       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                                  | CCB_TRANS_SYNC_OFFSET_VALID
-                                  | CCB_TRANS_BUS_WIDTH_VALID
-                                  | CCB_TRANS_DISC_VALID
-                                  | CCB_TRANS_TQ_VALID;
-               } else {
-#endif
                        btfetchtransinfo(bt, cts);
                }
 
@@ -1383,12 +1352,10 @@ btaction(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
                cpi->ccb_h.status = CAM_REQ_CMP;
-#ifdef CAM_NEW_TRAN_CODE
                cpi->transport = XPORT_SPI;
                cpi->transport_version = 2;
                cpi->protocol = PROTO_SCSI;
                cpi->protocol_version = SCSI_REV_2;
-#endif
                xpt_done(ccb);
                break;
        }
@@ -1702,7 +1669,6 @@ btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code)
                case BTSTAT_TAGGED_MSG_REJECTED:
                {
                        struct ccb_trans_settings neg; 
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_scsi *scsi =
                            &neg.proto_specific.scsi;
 
@@ -1712,11 +1678,6 @@ btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code)
                        neg.transport_version = 2;
                        scsi->valid = CTS_SCSI_VALID_TQ;
                        scsi->flags = 0;
-#else
-
-                       neg.flags = 0;
-                       neg.valid = CCB_TRANS_TQ_VALID;
-#endif
                        xpt_print_path(csio->ccb_h.path);
                        kprintf("refuses tagged commands.  Performing "
                               "non-tagged I/O\n");
@@ -2158,7 +2119,6 @@ btfetchtransinfo(struct bt_softc *bt, struct ccb_trans_settings *cts)
        int             error;
        u_int8_t        param;
        targ_syncinfo_t sync_info;
-#ifdef CAM_NEW_TRAN_CODE
        struct ccb_trans_settings_scsi *scsi =
            &cts->proto_specific.scsi;
        struct ccb_trans_settings_spi *spi =
@@ -2166,10 +2126,6 @@ btfetchtransinfo(struct bt_softc *bt, struct ccb_trans_settings *cts)
 
        spi->valid = 0;
        scsi->valid = 0;
-#else
-
-       cts->valid = 0;
-#endif
 
        target = cts->ccb_h.target_id;
        targ_offset = (target & 0x7);
@@ -2250,7 +2206,6 @@ btfetchtransinfo(struct bt_softc *bt, struct ccb_trans_settings *cts)
                sync_period = 2000 + (500 * sync_info.period);
        }
 
-#ifdef CAM_NEW_TRAN_CODE
        cts->protocol = PROTO_SCSI;
        cts->protocol_version = SCSI_REV_2;
        cts->transport = XPORT_SPI;
@@ -2270,20 +2225,6 @@ btfetchtransinfo(struct bt_softc *bt, struct ccb_trans_settings *cts)
        } else
                scsi->valid = 0;
        
-#else
-       /* Convert ns value to standard SCSI sync rate */
-       if (cts->sync_offset != 0)
-               cts->sync_period = scsi_calc_syncparam(sync_period);
-       else
-               cts->sync_period = 0;
-       cts->sync_offset = sync_offset;
-       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-       
-       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                  | CCB_TRANS_SYNC_OFFSET_VALID
-                  | CCB_TRANS_BUS_WIDTH_VALID;
-
-#endif
         xpt_async(AC_TRANSFER_NEG, cts->ccb_h.path, cts);
 }
 
index 54b2bea..e9c6347 100644 (file)
@@ -1,5 +1,5 @@
 /* $FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.32.2.20 2002/10/11 18:49:25 mjacob Exp $ */
-/* $DragonFly: src/sys/dev/disk/isp/isp_freebsd.c,v 1.19 2008/01/21 07:21:28 pavalos Exp $ */
+/* $DragonFly: src/sys/dev/disk/isp/isp_freebsd.c,v 1.20 2008/02/10 00:01:02 pavalos Exp $ */
 /*
  * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
  *
@@ -2197,11 +2197,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                xpt_done(ccb);
                break;
        }
-#ifdef CAM_NEW_TRAN_CODE
 #define        IS_CURRENT_SETTINGS(c)  (c->type == CTS_TYPE_CURRENT_SETTINGS)
-#else
-#define        IS_CURRENT_SETTINGS(c)  (c->flags & CCB_TRANS_CURRENT_SETTINGS)
-#endif
        case XPT_SET_TRAN_SETTINGS:     /* Nexus Settings */
                cts = &ccb->cts;
                if (!IS_CURRENT_SETTINGS(cts)) {
@@ -2212,66 +2208,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                tgt = cts->ccb_h.target_id;
                CAMLOCK_2_ISPLOCK(isp);
                if (IS_SCSI(isp)) {
-#ifndef        CAM_NEW_TRAN_CODE
-                       sdparam *sdp = isp->isp_param;
-                       u_int16_t *dptr;
-
-                       bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
-
-                       sdp += bus;
-                       /*
-                        * We always update (internally) from goal_flags
-                        * so any request to change settings just gets
-                        * vectored to that location.
-                        */
-                       dptr = &sdp->isp_devparam[tgt].goal_flags;
-
-                       /*
-                        * Note that these operations affect the
-                        * the goal flags (goal_flags)- not
-                        * the current state flags. Then we mark
-                        * things so that the next operation to
-                        * this HBA will cause the update to occur.
-                        */
-                       if (cts->valid & CCB_TRANS_DISC_VALID) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0) {
-                                       *dptr |= DPARM_DISC;
-                               } else {
-                                       *dptr &= ~DPARM_DISC;
-                               }
-                       }
-                       if (cts->valid & CCB_TRANS_TQ_VALID) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0) {
-                                       *dptr |= DPARM_TQING;
-                               } else {
-                                       *dptr &= ~DPARM_TQING;
-                               }
-                       }
-                       if (cts->valid & CCB_TRANS_BUS_WIDTH_VALID) {
-                               switch (cts->bus_width) {
-                               case MSG_EXT_WDTR_BUS_16_BIT:
-                                       *dptr |= DPARM_WIDE;
-                                       break;
-                               default:
-                                       *dptr &= ~DPARM_WIDE;
-                               }
-                       }
-                       /*
-                        * Any SYNC RATE of nonzero and SYNC_OFFSET
-                        * of nonzero will cause us to go to the
-                        * selected (from NVRAM) maximum value for
-                        * this device. At a later point, we'll
-                        * allow finer control.
-                        */
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) &&
-                           (cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) &&
-                           (cts->sync_offset > 0)) {
-                               *dptr |= DPARM_SYNC;
-                       } else {
-                               *dptr &= ~DPARM_SYNC;
-                       }
-                       *dptr |= DPARM_SAFE_DFLT;
-#else
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
                        struct ccb_trans_settings_spi *spi =
@@ -2328,7 +2264,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                        } else {
                                *dptr &= ~DPARM_SYNC;
                        }
-#endif
                        isp_prt(isp, ISP_LOGDEBUG0,
                            "SET bus %d targ %d to flags %x off %x per %x",
                            bus, tgt, sdp->isp_devparam[tgt].goal_flags,
@@ -2346,21 +2281,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                tgt = cts->ccb_h.target_id;
                CAMLOCK_2_ISPLOCK(isp);
                if (IS_FC(isp)) {
-#ifndef        CAM_NEW_TRAN_CODE
-                       /*
-                        * a lot of normal SCSI things don't make sense.
-                        */
-                       cts->flags = CCB_TRANS_TAG_ENB | CCB_TRANS_DISC_ENB;
-                       cts->valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-                       /*
-                        * How do you measure the width of a high
-                        * speed serial bus? Well, in bytes.
-                        *
-                        * Offset and period make no sense, though, so we set
-                        * (above) a 'base' transfer speed to be gigabit.
-                        */
-                       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-#else
                        fcparam *fcp = isp->isp_param;
                        struct ccb_trans_settings_fc *fc =
                            &cts->xport_specific.fc;
@@ -2380,14 +2300,11 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                                fc->valid |= CTS_FC_VALID_WWNN |
                                    CTS_FC_VALID_WWPN | CTS_FC_VALID_PORT;
                        }
-#endif
                } else {
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
                        struct ccb_trans_settings_spi *spi =
                            &cts->xport_specific.spi;
-#endif
                        sdparam *sdp = isp->isp_param;
                        int bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
                        u_int16_t dval, pval, oval;
@@ -2408,31 +2325,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                                pval = sdp->isp_devparam[tgt].nvrm_period;
                        }
 
-#ifndef        CAM_NEW_TRAN_CODE
-                       cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-
-                       if (dval & DPARM_DISC) {
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       }
-                       if (dval & DPARM_TQING) {
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       }
-                       if (dval & DPARM_WIDE) {
-                               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                       } else {
-                               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-                       }
-                       cts->valid = CCB_TRANS_BUS_WIDTH_VALID |
-                           CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-
-                       if ((dval & DPARM_SYNC) && oval != 0) {
-                               cts->sync_period = pval;
-                               cts->sync_offset = oval;
-                               cts->valid |=
-                                   CCB_TRANS_SYNC_RATE_VALID |
-                                   CCB_TRANS_SYNC_OFFSET_VALID;
-                       }
-#else
                        cts->protocol = PROTO_SCSI;
                        cts->protocol_version = SCSI_REV_2;
                        cts->transport = XPORT_SPI;
@@ -2464,7 +2356,6 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                        } else {
                                scsi->valid = 0;
                        }
-#endif
                        isp_prt(isp, ISP_LOGDEBUG0,
                            "GET %s bus %d targ %d to flags %x off %x per %x",
                            IS_CURRENT_SETTINGS(cts)? "ACTIVE" : "NVRAM",
@@ -2559,10 +2450,8 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                        else
                                cpi->base_transfer_speed = 100000;
                        cpi->hba_inquiry = PI_TAG_ABLE;
-#ifdef CAM_NEW_TRAN_CODE
                        cpi->transport = XPORT_FC;
                        cpi->transport_version = 0;     /* WHAT'S THIS FOR? */
-#endif
                } else {
                        sdparam *sdp = isp->isp_param;
                        sdp += cam_sim_bus(xpt_path_sim(cpi->ccb_h.path));
@@ -2570,15 +2459,11 @@ isp_action(struct cam_sim *sim, union ccb *ccb)
                        cpi->hba_misc = 0;
                        cpi->initiator_id = sdp->isp_initiator_id;
                        cpi->base_transfer_speed = 3300;
-#ifdef CAM_NEW_TRAN_CODE
                        cpi->transport = XPORT_SPI;
                        cpi->transport_version = 2;     /* WHAT'S THIS FOR? */
-#endif
                }
-#ifdef CAM_NEW_TRAN_CODE
                cpi->protocol = PROTO_SCSI;
                cpi->protocol_version = SCSI_REV_2;
-#endif
                strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
                strncpy(cpi->hba_vid, "Qlogic", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
@@ -2654,10 +2539,8 @@ isp_async(struct ispsoftc *isp, ispasync_t cmd, void *arg)
        switch (cmd) {
        case ISPASYNC_NEW_TGT_PARAMS:
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi;
                struct ccb_trans_settings_spi *spi;
-#endif
                int flags, tgt;
                sdparam *sdp = isp->isp_param;
                struct ccb_trans_settings cts;
@@ -2682,7 +2565,6 @@ isp_async(struct ispsoftc *isp, ispasync_t cmd, void *arg)
                }
                CAMLOCK_2_ISPLOCK(isp);
                flags = sdp->isp_devparam[tgt].actv_flags;
-#ifdef CAM_NEW_TRAN_CODE
                cts.type = CTS_TYPE_CURRENT_SETTINGS;
                cts.protocol = PROTO_SCSI;
                cts.transport = XPORT_SPI;
@@ -2711,26 +2593,6 @@ isp_async(struct ispsoftc *isp, ispasync_t cmd, void *arg)
                        spi->sync_period = sdp->isp_devparam[tgt].actv_period;
                        spi->sync_offset = sdp->isp_devparam[tgt].actv_offset;
                }
-#else
-               cts.flags = CCB_TRANS_CURRENT_SETTINGS;
-               cts.valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-               if (flags & DPARM_DISC) {
-                       cts.flags |= CCB_TRANS_DISC_ENB;
-               }
-               if (flags & DPARM_TQING) {
-                       cts.flags |= CCB_TRANS_TAG_ENB;
-               }
-               cts.valid |= CCB_TRANS_BUS_WIDTH_VALID;
-               cts.bus_width = (flags & DPARM_WIDE)?
-                   MSG_EXT_WDTR_BUS_8_BIT : MSG_EXT_WDTR_BUS_16_BIT;
-               cts.sync_period = sdp->isp_devparam[tgt].actv_period;
-               cts.sync_offset = sdp->isp_devparam[tgt].actv_offset;
-               if (flags & DPARM_SYNC) {
-                       cts.valid |=
-                           CCB_TRANS_SYNC_RATE_VALID |
-                           CCB_TRANS_SYNC_OFFSET_VALID;
-               }
-#endif
                isp_prt(isp, ISP_LOGDEBUG2,
                    "NEW_TGT_PARAMS bus %d tgt %d period %x offset %x flags %x",
                    bus, tgt, sdp->isp_devparam[tgt].actv_period,
index 4fe6296..28612d3 100644 (file)
@@ -1,5 +1,5 @@
 /* $FreeBSD: src/sys/dev/mpt/mpt_freebsd.c,v 1.3.2.3 2002/09/24 21:37:25 mjacob Exp $ */
-/* $DragonFly: src/sys/dev/disk/mpt/mpt_freebsd.c,v 1.9 2006/12/22 23:26:16 swildner Exp $ */
+/* $DragonFly: src/sys/dev/disk/mpt/mpt_freebsd.c,v 1.10 2008/02/10 00:01:02 pavalos Exp $ */
 /*
  * FreeBSD/CAM specific routines for LSI '909 FC  adapters.
  * FreeBSD Version.
@@ -1119,11 +1119,7 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                MPT_UNLOCK(mpt);
                break;
 
-#ifdef CAM_NEW_TRAN_CODE
 #define        IS_CURRENT_SETTINGS(c)  (c->type == CTS_TYPE_CURRENT_SETTINGS)
-#else
-#define        IS_CURRENT_SETTINGS(c)  (c->flags & CCB_TRANS_CURRENT_SETTINGS)
-#endif
 #define        DP_DISC_ENABLE  0x1
 #define        DP_DISC_DISABL  0x2
 #define        DP_DISC         (DP_DISC_ENABLE|DP_DISC_DISABL)
@@ -1151,33 +1147,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                if (mpt->is_fc == 0) {
                        u_int8_t dval = 0;
                        u_int period = 0, offset = 0;
-#ifndef        CAM_NEW_TRAN_CODE
-                       if (cts->valid & CCB_TRANS_DISC_VALID) {
-                               dval |= DP_DISC_ENABLE;
-                       }
-                       if (cts->valid & CCB_TRANS_TQ_VALID) {
-                               dval |= DP_TQING_ENABLE;
-                       }
-                       if (cts->valid & CCB_TRANS_BUS_WIDTH_VALID) {
-                               if (cts->bus_width)
-                                       dval |= DP_WIDE;
-                               else
-                                       dval |= DP_NARROW;
-                       }
-                       /*
-                        * Any SYNC RATE of nonzero and SYNC_OFFSET
-                        * of nonzero will cause us to go to the
-                        * selected (from NVRAM) maximum value for
-                        * this device. At a later point, we'll
-                        * allow finer control.
-                        */
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) &&
-                           (cts->valid & CCB_TRANS_SYNC_OFFSET_VALID)) {
-                               dval |= DP_SYNC;
-                               period = cts->sync_period;
-                               offset = cts->sync_offset;
-                       }
-#else
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
                        struct ccb_trans_settings_spi *spi =
@@ -1211,7 +1180,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                                period = spi->sync_period;
                                offset = spi->sync_offset;
                        }
-#endif
                        if (dval & DP_DISC_ENABLE) {
                                mpt->mpt_disc_enable |= (1 << tgt);
                        } else if (dval & DP_DISC_DISABL) {
@@ -1256,21 +1224,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                cts = &ccb->cts;
                tgt = cts->ccb_h.target_id;
                if (mpt->is_fc) {
-#ifndef        CAM_NEW_TRAN_CODE
-                       /*
-                        * a lot of normal SCSI things don't make sense.
-                        */
-                       cts->flags = CCB_TRANS_TAG_ENB | CCB_TRANS_DISC_ENB;
-                       cts->valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-                       /*
-                        * How do you measure the width of a high
-                        * speed serial bus? Well, in bytes.
-                        *
-                        * Offset and period make no sense, though, so we set
-                        * (above) a 'base' transfer speed to be gigabit.
-                        */
-                       cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-#else
                        struct ccb_trans_settings_fc *fc =
                            &cts->xport_specific.fc;
 
@@ -1282,14 +1235,11 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                        fc->valid = CTS_FC_VALID_SPEED;
                        fc->bitrate = 100000;   /* XXX: Need for 2Gb/s */
                        /* XXX: need a port database for each target */
-#endif
                } else {
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
                        struct ccb_trans_settings_spi *spi =
                            &cts->xport_specific.spi;
-#endif
                        u_int8_t dval, pval, oval;
 
                        /*
@@ -1339,29 +1289,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                                oval = (mpt->mpt_port_page0.Capabilities >> 16);
                                pval = (mpt->mpt_port_page0.Capabilities >>  8);
                        }
-#ifndef        CAM_NEW_TRAN_CODE
-                       cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-                       if (dval & DP_DISC_ENABLE) {
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       }
-                       if (dval & DP_TQING_ENABLE) {
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       }
-                       if (dval & DP_WIDE) {
-                               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                       } else {
-                               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-                       }
-                       cts->valid = CCB_TRANS_BUS_WIDTH_VALID |
-                           CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-                       if (oval) {
-                               cts->sync_period = pval;
-                               cts->sync_offset = oval;
-                               cts->valid |=
-                                   CCB_TRANS_SYNC_RATE_VALID |
-                                   CCB_TRANS_SYNC_OFFSET_VALID;
-                       }
-#else
                        cts->protocol = PROTO_SCSI;
                        cts->protocol_version = SCSI_REV_2;
                        cts->transport = XPORT_SPI;
@@ -1393,7 +1320,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb)
                        } else {
                                scsi->valid = 0;
                        }
-#endif
                        if (mpt->verbose > 1) {
                                device_printf(mpt->dev, 
                                    "GET %s tgt %d flags %x period %x off %x\n",
index 5197283..ee52df7 100644 (file)
@@ -26,7 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.44 2006/03/31 08:09:05 sos Exp $
- * $DragonFly: src/sys/dev/disk/nata/atapi-cam.c,v 1.8 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/nata/atapi-cam.c,v 1.9 2008/02/10 00:01:02 pavalos Exp $
  */
 
 #include "opt_ata.h"
@@ -359,12 +359,10 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
        cpi->unit_number = cam_sim_unit(sim);
        cpi->bus_id = cam_sim_bus(sim);
        cpi->base_transfer_speed = 3300;
-#ifdef CAM_NEW_TRAN_CODE
        cpi->transport = XPORT_ATA;
        cpi->transport_version = 2;
        cpi->protocol = PROTO_SCSI;
        cpi->protocol_version = SCSI_REV_2;
-#endif
 
        if (softc->ata_ch && tid != CAM_TARGET_WILDCARD) {
            spin_lock_wr(&softc->state_lock);
@@ -438,7 +436,6 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
 
     case XPT_GET_TRAN_SETTINGS: {
        struct ccb_trans_settings *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
        cts->protocol = PROTO_SCSI;
        cts->protocol_version = SCSI_REV_2;
        cts->transport = XPORT_ATA;
@@ -446,15 +443,6 @@ atapi_action(struct cam_sim *sim, union ccb *ccb)
        cts->proto_specific.valid = 0;
        cts->xport_specific.valid = 0;
        /* nothing more to do */
-#else
-       /*
-        * The default CAM transport code is very SCSI-specific and
-        * doesn't understand IDE speeds very well. Be silent about it
-        * here and let it default to what is set in XPT_PATH_INQ
-        */
-       cts->valid = (CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID);
-       cts->flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
-#endif
        ccb->ccb_h.status = CAM_REQ_CMP;
        CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_SUBTRACE, ("GET_TRAN_SETTINGS\n"));
        xpt_done(ccb);
index 09b7721..09293ac 100644 (file)
@@ -1,7 +1,7 @@
 /**************************************************************************
 **
 ** $FreeBSD: src/sys/pci/ncr.c,v 1.155.2.3 2001/03/05 13:09:10 obrien Exp $
-** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.18 2007/12/23 07:00:56 pavalos Exp $
+** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.19 2008/02/10 00:01:02 pavalos Exp $
 **
 **  Device driver for the   NCR 53C8XX   PCI-SCSI-Controller Family.
 **
@@ -4189,15 +4189,12 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
                struct  ccb_trans_settings *cts = &ccb->cts;
                tcb_p   tp;
                u_int   update_type;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
                    &cts->xport_specific.spi;
-#endif
 
                update_type = 0;
-#ifdef CAM_NEW_TRAN_CODE
                if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
                        update_type |= NCR_TRANS_GOAL;
                if (cts->type == CTS_TYPE_USER_SETTINGS)
@@ -4278,88 +4275,6 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
                                tp->tinfo.goal.width = spi->bus_width;
                }
                crit_exit();
-#else
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
-                       update_type |= NCR_TRANS_GOAL;
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0)
-                       update_type |= NCR_TRANS_USER;
-               
-               crit_enter();
-               tp = &np->target[ccb->ccb_h.target_id];
-               /* Tag and disc enables */
-               if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                       if (update_type & NCR_TRANS_GOAL) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                                       tp->tinfo.disc_tag |= NCR_CUR_DISCENB;
-                               else
-                                       tp->tinfo.disc_tag &= ~NCR_CUR_DISCENB;
-                       }
-
-                       if (update_type & NCR_TRANS_USER) {
-                               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                                       tp->tinfo.disc_tag |= NCR_USR_DISCENB;
-                               else
-                                       tp->tinfo.disc_tag &= ~NCR_USR_DISCENB;
-                       }
-
-               }
-
-               if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                       if (update_type & NCR_TRANS_GOAL) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                                       tp->tinfo.disc_tag |= NCR_CUR_TAGENB;
-                               else
-                                       tp->tinfo.disc_tag &= ~NCR_CUR_TAGENB;
-                       }
-
-                       if (update_type & NCR_TRANS_USER) {
-                               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                                       tp->tinfo.disc_tag |= NCR_USR_TAGENB;
-                               else
-                                       tp->tinfo.disc_tag &= ~NCR_USR_TAGENB;
-                       }       
-               }
-
-               /* Filter bus width and sync negotiation settings */
-               if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) {
-                       if (cts->bus_width > np->maxwide)
-                               cts->bus_width = np->maxwide;
-               }
-
-               if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-                || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) {
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
-                               if (cts->sync_period != 0
-                                && (cts->sync_period < np->minsync))
-                                       cts->sync_period = np->minsync;
-                       }
-                       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
-                               if (cts->sync_offset == 0)
-                                       cts->sync_period = 0;
-                               if (cts->sync_offset > np->maxoffs)
-                                       cts->sync_offset = np->maxoffs;
-                       }
-               }
-               if ((update_type & NCR_TRANS_USER) != 0) {
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-                               tp->tinfo.user.period = cts->sync_period;
-                       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-                               tp->tinfo.user.offset = cts->sync_offset;
-                       if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-                               tp->tinfo.user.width = cts->bus_width;
-               }
-               if ((update_type & NCR_TRANS_GOAL) != 0) {
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-                               tp->tinfo.goal.period = cts->sync_period;
-
-                       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-                               tp->tinfo.goal.offset = cts->sync_offset;
-
-                       if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-                               tp->tinfo.goal.width = cts->bus_width;
-               }
-               crit_exit();
-#endif
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -4370,7 +4285,6 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
                struct  ccb_trans_settings *cts = &ccb->cts;
                struct  ncr_transinfo *tinfo;
                tcb_p   tp = &np->target[ccb->ccb_h.target_id];
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -4416,44 +4330,6 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
                           | CTS_SPI_VALID_BUS_WIDTH
                           | CTS_SPI_VALID_DISC;
                scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-               crit_enter();
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       tinfo = &tp->tinfo.current;
-                       if (tp->tinfo.disc_tag & NCR_CUR_DISCENB)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_DISC_ENB;
-
-                       if (tp->tinfo.disc_tag & NCR_CUR_TAGENB)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_TAG_ENB;
-               } else {
-                       tinfo = &tp->tinfo.user;
-                       if (tp->tinfo.disc_tag & NCR_USR_DISCENB)
-                               cts->flags |= CCB_TRANS_DISC_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_DISC_ENB;
-
-                       if (tp->tinfo.disc_tag & NCR_USR_TAGENB)
-                               cts->flags |= CCB_TRANS_TAG_ENB;
-                       else
-                               cts->flags &= ~CCB_TRANS_TAG_ENB;
-               }
-
-               cts->sync_period = tinfo->period;
-               cts->sync_offset = tinfo->offset;
-               cts->bus_width = tinfo->width;
-
-               crit_exit();
-
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID
-                          | CCB_TRANS_DISC_VALID
-                          | CCB_TRANS_TQ_VALID;
-#endif
 
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
@@ -4521,12 +4397,10 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
@@ -5104,7 +4978,6 @@ ncr_setsync(ncb_p np, nccb_p cp, u_char scntl3, u_char sxfer, u_char period)
        ** new transfer parameters.
        */
        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
        neg.protocol = PROTO_SCSI;
        neg.protocol_version = SCSI_REV_2;
        neg.transport = XPORT_SPI;
@@ -5113,12 +4986,6 @@ ncr_setsync(ncb_p np, nccb_p cp, u_char scntl3, u_char sxfer, u_char period)
        neg.xport_specific.spi.sync_offset = sxfer & 0x1f;
        neg.xport_specific.spi.valid = CTS_SPI_VALID_SYNC_RATE
                | CTS_SPI_VALID_SYNC_OFFSET;
-#else
-       neg.sync_period = period;
-       neg.sync_offset = sxfer & 0x1f;
-       neg.valid = CCB_TRANS_SYNC_RATE_VALID
-               | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
        xpt_setup_ccb(&neg.ccb_h, ccb->ccb_h.path,
                      /*priority*/1);
        xpt_async(AC_TRANSFER_NEG, ccb->ccb_h.path, &neg);
@@ -5188,7 +5055,6 @@ static void ncr_setwide (ncb_p np, nccb_p cp, u_char wide, u_char ack)
 
        /* Tell the SCSI layer about the new transfer params */
        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
        neg.protocol = PROTO_SCSI;
        neg.protocol_version = SCSI_REV_2;
        neg.transport = XPORT_SPI;
@@ -5200,15 +5066,6 @@ static void ncr_setwide (ncb_p np, nccb_p cp, u_char wide, u_char ack)
        neg.xport_specific.spi.valid = CTS_SPI_VALID_SYNC_RATE
                | CTS_SPI_VALID_SYNC_OFFSET
                | CTS_SPI_VALID_BUS_WIDTH;
-#else
-       neg.bus_width = (scntl3 & EWS) ? MSG_EXT_WDTR_BUS_16_BIT
-                                      : MSG_EXT_WDTR_BUS_8_BIT;
-       neg.sync_period = 0;
-       neg.sync_offset = 0;
-       neg.valid = CCB_TRANS_BUS_WIDTH_VALID
-                 | CCB_TRANS_SYNC_RATE_VALID
-                 | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
        xpt_setup_ccb(&neg.ccb_h, ccb->ccb_h.path, /*priority*/1);
        xpt_async(AC_TRANSFER_NEG, ccb->ccb_h.path, &neg);      
 
index a6827da..a71adb4 100644 (file)
@@ -32,7 +32,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  * 
  * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.74 2004/01/08 14:58:09 simokawa Exp $
- * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.26 2007/12/23 07:00:56 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.27 2008/02/10 00:01:03 pavalos Exp $
  *
  */
 
@@ -2437,12 +2437,10 @@ END_DEBUG
                strncpy(cpi->hba_vid, "SBP", HBA_IDLEN);
                strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN);
                cpi->unit_number = sim->unit_number;
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;    /* XX should have a FireWire */
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
 
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
@@ -2451,7 +2449,6 @@ END_DEBUG
        case XPT_GET_TRAN_SETTINGS:
        {
                struct ccb_trans_settings *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -2465,11 +2462,6 @@ END_DEBUG
                spi->flags = CTS_SPI_FLAGS_DISC_ENB;
                scsi->valid = CTS_SCSI_VALID_TQ;
                scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
-#else
-               /* Enable disconnect and tagged queuing */
-               cts->valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-               cts->flags = CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB;
-#endif
 SBP_DEBUG(1)
                kprintf("%s:%d:%d XPT_GET_TRAN_SETTINGS:.\n",
                        device_get_nameunit(sbp->fd.dev),
index 79c315c..b3e6b81 100644 (file)
  */
 
 /* $FreeBSD: src/sys/dev/sym/sym_hipd.c,v 1.6.2.12 2001/12/02 19:01:10 groudier Exp $ */
-/* $DragonFly: src/sys/dev/disk/sym/sym_hipd.c,v 1.22 2007/09/23 04:09:55 yanyh Exp $ */
+/* $DragonFly: src/sys/dev/disk/sym/sym_hipd.c,v 1.23 2008/02/10 00:01:03 pavalos Exp $ */
 
 #define SYM_DRIVER_NAME        "sym-1.6.5-20000902"
 
 /* #define SYM_DEBUG_GENERIC_SUPPORT */
-/* #define CAM_NEW_TRAN_CODE */
 
 #include "use_pci.h"
 #include <sys/param.h>
@@ -125,13 +124,6 @@ typedef u_int8_t  u8;
 typedef u_int16_t u16;
 typedef        u_int32_t u32;
 
-/*
- *  From 'cam.error_recovery_diffs.20010313.context' patch.
- */
-#ifdef  CAM_NEW_TRAN_CODE
-#define FreeBSD_New_Tran_Settings
-#endif  /* CAM_NEW_TRAN_CODE */
-
 /*
  *  Driver definitions.
  */
@@ -1209,10 +1201,8 @@ typedef struct sym_hcb *hcb_p;
  *  Gather negotiable parameters value
  */
 struct sym_trans {
-#ifdef FreeBSD_New_Tran_Settings
        u8 scsi_version;
        u8 spi_version;
-#endif
        u8 period;
        u8 offset;
        u8 width;
@@ -2919,10 +2909,8 @@ static int sym_prepare_setting(hcb_p np, struct sym_nvram *nvram)
        for (i = 0 ; i < SYM_CONF_MAX_TARGET ; i++) {
                tcb_p tp = &np->target[i];
 
-#ifdef FreeBSD_New_Tran_Settings
                tp->tinfo.user.scsi_version = tp->tinfo.current.scsi_version= 2;
                tp->tinfo.user.spi_version  = tp->tinfo.current.spi_version = 2;
-#endif
                tp->tinfo.user.period = np->minsync;
                tp->tinfo.user.offset = np->maxoffs;
                tp->tinfo.user.width  = np->maxwide ? BUS_16_BIT : BUS_8_BIT;
@@ -2940,9 +2928,7 @@ static int sym_prepare_setting(hcb_p np, struct sym_nvram *nvram)
                            tp->tinfo.user.width == BUS_16_BIT) {
                                tp->tinfo.user.options |= PPR_OPT_DT;
                                tp->tinfo.user.offset   = np->maxoffs_dt;
-#ifdef FreeBSD_New_Tran_Settings
                                tp->tinfo.user.spi_version = 3;
-#endif
                        }
                }
 
@@ -3629,7 +3615,6 @@ sym_xpt_async_transfer_neg(hcb_p np, int target, u_int spi_valid)
 
        bzero(&cts, sizeof(cts));
 
-#ifdef FreeBSD_New_Tran_Settings
 #define        cts__scsi (cts.proto_specific.scsi)
 #define        cts__spi  (cts.xport_specific.spi)
 
@@ -3650,21 +3635,11 @@ sym_xpt_async_transfer_neg(hcb_p np, int target, u_int spi_valid)
                cts__spi.ppr_options = tp->tinfo.current.options;
 #undef cts__spi
 #undef cts__scsi
-#else
-       cts.valid = spi_valid;
-       if (spi_valid & CCB_TRANS_SYNC_RATE_VALID)
-               cts.sync_period = tp->tinfo.current.period;
-       if (spi_valid & CCB_TRANS_SYNC_OFFSET_VALID)
-               cts.sync_offset = tp->tinfo.current.offset;
-       if (spi_valid & CCB_TRANS_BUS_WIDTH_VALID)
-               cts.bus_width   = tp->tinfo.current.width;
-#endif
        xpt_setup_ccb(&cts.ccb_h, path, /*priority*/1);
        xpt_async(AC_TRANSFER_NEG, path, &cts);
        xpt_free_path(path);
 }
 
-#ifdef FreeBSD_New_Tran_Settings
 #define SYM_SPI_VALID_WDTR             \
        CTS_SPI_VALID_BUS_WIDTH |       \
        CTS_SPI_VALID_SYNC_RATE |       \
@@ -3677,19 +3652,6 @@ sym_xpt_async_transfer_neg(hcb_p np, int target, u_int spi_valid)
        CTS_SPI_VALID_BUS_WIDTH |       \
        CTS_SPI_VALID_SYNC_RATE |       \
        CTS_SPI_VALID_SYNC_OFFSET
-#else
-#define SYM_SPI_VALID_WDTR             \
-       CCB_TRANS_BUS_WIDTH_VALID |     \
-       CCB_TRANS_SYNC_RATE_VALID |     \
-       CCB_TRANS_SYNC_OFFSET_VALID
-#define SYM_SPI_VALID_SDTR             \
-       CCB_TRANS_SYNC_RATE_VALID |     \
-       CCB_TRANS_SYNC_OFFSET_VALID
-#define SYM_SPI_VALID_PPR              \
-       CCB_TRANS_BUS_WIDTH_VALID |     \
-       CCB_TRANS_SYNC_RATE_VALID |     \
-       CCB_TRANS_SYNC_OFFSET_VALID
-#endif
 
 /*
  *  We received a WDTR.
@@ -4984,10 +4946,8 @@ static void sym_sir_bad_scsi_status(hcb_p np, int num, ccb_p cp)
                 */
                cp->sensecmd[0]         = 0x03;
                cp->sensecmd[1]         = cp->lun << 5;
-#ifdef FreeBSD_New_Tran_Settings
                if (tp->tinfo.current.scsi_version > 2 || cp->lun > 7)
                        cp->sensecmd[1] = 0;
-#endif
                cp->sensecmd[4]         = SYM_SNS_BBUF_LEN;
                cp->data_len            = SYM_SNS_BBUF_LEN;
 
@@ -8412,20 +8372,12 @@ static void sym_action2(struct cam_sim *sim, union ccb *ccb)
                 *  Update SCSI device settings in LUN control block.
                 */
                lp = sym_lp(np, tp, ccb_h->target_lun);
-#ifdef FreeBSD_New_Tran_Settings
                if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
-#else
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-#endif
                        sym_update_trans(np, tp, &tp->tinfo.goal, cts);
                        if (lp)
                                sym_update_dflags(np, &lp->current_flags, cts);
                }
-#ifdef FreeBSD_New_Tran_Settings
                if (cts->type == CTS_TYPE_USER_SETTINGS) {
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-#endif
                        sym_update_trans(np, tp, &tp->tinfo.user, cts);
                        if (lp)
                                sym_update_dflags(np, &lp->user_flags, cts);
@@ -8444,7 +8396,6 @@ static void sym_action2(struct cam_sim *sim, union ccb *ccb)
                tp = &np->target[ccb_h->target_id];
                lp = sym_lp(np, tp, ccb_h->target_lun);
 
-#ifdef FreeBSD_New_Tran_Settings
 #define        cts__scsi (&cts->proto_specific.scsi)
 #define        cts__spi  (&cts->xport_specific.spi)
                if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
@@ -8482,35 +8433,6 @@ static void sym_action2(struct cam_sim *sim, union ccb *ccb)
                cts__scsi->valid |= CTS_SCSI_VALID_TQ;
 #undef cts__spi
 #undef cts__scsi
-#else
-               if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                       tip = &tp->tinfo.current;
-                       dflags = lp ? lp->current_flags : 0;
-               }
-               else {
-                       tip = &tp->tinfo.user;
-                       dflags = lp ? lp->user_flags : tp->usrflags;
-               }
-               
-               cts->sync_period = tip->period;
-               cts->sync_offset = tip->offset;
-               cts->bus_width   = tip->width;
-
-               cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                          | CCB_TRANS_SYNC_OFFSET_VALID
-                          | CCB_TRANS_BUS_WIDTH_VALID;
-
-               cts->flags &= ~(CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB);
-
-               if (dflags & SYM_DISC_ENABLED)
-                       cts->flags |= CCB_TRANS_DISC_ENB;
-
-               if (dflags & SYM_TAGS_ENABLED)
-                       cts->flags |= CCB_TRANS_TAG_ENB;
-
-               cts->valid |= CCB_TRANS_DISC_VALID;
-               cts->valid |= CCB_TRANS_TQ_VALID;
-#endif
                sym_xpt_done2(np, ccb, CAM_REQ_CMP);
                break;
        }
@@ -8568,7 +8490,6 @@ static void sym_action2(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
 
-#ifdef FreeBSD_New_Tran_Settings
                cpi->protocol = PROTO_SCSI;
                cpi->protocol_version = SCSI_REV_2;
                cpi->transport = XPORT_SPI;
@@ -8579,7 +8500,6 @@ static void sym_action2(struct cam_sim *sim, union ccb *ccb)
                        cpi->xport_specific.spi.ppr_options =
                            SID_SPI_CLOCK_DT_ST;
                }
-#endif
                sym_xpt_done2(np, ccb, CAM_REQ_CMP);
                break;
        }
@@ -8677,7 +8597,6 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
        /*
         *  Update the infos.
         */
-#ifdef FreeBSD_New_Tran_Settings
 #define cts__spi (&cts->xport_specific.spi)
        if ((cts__spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0)
                tip->width = cts__spi->bus_width;
@@ -8694,14 +8613,6 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
            cts->transport_version != XPORT_VERSION_UNKNOWN)
                tip->spi_version = cts->transport_version;
 #undef cts__spi
-#else
-       if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
-               tip->width = cts->bus_width;
-       if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
-               tip->offset = cts->sync_offset;
-       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
-               tip->period = cts->sync_period;
-#endif
        /*
         *  Scale against driver configuration limits.
         */
@@ -8715,7 +8626,6 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
        if (tip->width > np->maxwide)
                tip->width  = np->maxwide;
 
-#ifdef FreeBSD_New_Tran_Settings
        /*
         *  Only accept DT if controller supports and SYNC/WIDE asked.
         */
@@ -8723,16 +8633,6 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
            !(tip->width == BUS_16_BIT && tip->offset)) {
                tip->options &= ~PPR_OPT_DT;
        }
-#else
-       /*
-        *  For now, only assume DT if period <= 9, BUS 16 and offset != 0.
-        */
-       tip->options = 0;
-       if ((np->features & (FE_C10|FE_ULTRA3)) == (FE_C10|FE_ULTRA3) &&
-           tip->period <= 9 && tip->width == BUS_16_BIT && tip->offset) {
-               tip->options |= PPR_OPT_DT;
-       }
-#endif
 
        /*
         *  Scale period factor and offset against controller limits.
@@ -8761,7 +8661,6 @@ static void sym_update_trans(hcb_p np, tcb_p tp, struct sym_trans *tip,
 static void 
 sym_update_dflags(hcb_p np, u_char *flags, struct ccb_trans_settings *cts)
 {
-#ifdef FreeBSD_New_Tran_Settings
 #define        cts__scsi (&cts->proto_specific.scsi)
 #define        cts__spi  (&cts->xport_specific.spi)
        if ((cts__spi->valid & CTS_SPI_VALID_DISC) != 0) {
@@ -8779,21 +8678,6 @@ sym_update_dflags(hcb_p np, u_char *flags, struct ccb_trans_settings *cts)
        }
 #undef cts__spi
 #undef cts__scsi
-#else
-       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-               if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
-                       *flags |= SYM_DISC_ENABLED;
-               else
-                       *flags &= ~SYM_DISC_ENABLED;
-       }
-
-       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-               if ((cts->flags & CCB_TRANS_TAG_ENB) != 0)
-                       *flags |= SYM_TAGS_ENABLED;
-               else
-                       *flags &= ~SYM_TAGS_ENABLED;
-       }
-#endif
 }
 
 
index fd5342a..9561dc9 100644 (file)
@@ -49,7 +49,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/trm/trm.c,v 1.2.2.2 2002/12/19 20:34:45 cognet Exp $
- * $DragonFly: src/sys/dev/disk/trm/trm.c,v 1.16 2008/01/05 22:24:08 pavalos Exp $
+ * $DragonFly: src/sys/dev/disk/trm/trm.c,v 1.17 2008/02/10 00:01:03 pavalos Exp $
  */
 
 /*
@@ -703,12 +703,10 @@ trm_action(struct cam_sim *psim, union ccb *pccb)
                        strncpy(cpi->hba_vid, "Tekram_TRM", HBA_IDLEN);
                        strncpy(cpi->dev_name, cam_sim_name(psim), DEV_IDLEN);
                        cpi->unit_number = cam_sim_unit(psim);
-#ifdef CAM_NEW_TRAN_CODE
                        cpi->transport = XPORT_SPI;
                        cpi->transport_version = 2;
                        cpi->protocol = PROTO_SCSI;
                        cpi->protocol_version = SCSI_REV_2;
-#endif
                        cpi->ccb_h.status = CAM_REQ_CMP;
                        xpt_done(pccb);
                                   }
@@ -830,7 +828,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb)
                        struct  ccb_trans_settings *cts = &pccb->cts;
                        struct  trm_transinfo *tinfo;
                        PDCB    pDCB;   
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
                        struct ccb_trans_settings_spi *spi =
@@ -885,53 +882,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb)
                            CTS_SPI_VALID_BUS_WIDTH |
                            CTS_SPI_VALID_DISC;
                        scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-
-                       TRM_DPRINTF(" XPT_GET_TRAN_SETTINGS \n");
-                       pDCB = &pACB->DCBarray[target_id][target_lun];
-                       crit_enter();
-                       /*
-                        * disable interrupt
-                        */
-                       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
-                               /* current transfer settings */
-                               if (pDCB->tinfo.disc_tag & TRM_CUR_DISCENB)
-                                       cts->flags = CCB_TRANS_DISC_ENB;
-                               else
-                                       cts->flags = 0;/* no tag & disconnect */
-                               if (pDCB->tinfo.disc_tag & TRM_CUR_TAGENB)
-                                       cts->flags |= CCB_TRANS_TAG_ENB;
-                               tinfo = &pDCB->tinfo.current;
-                               TRM_DPRINTF("CURRENT:  cts->flags= %2x \n",
-                                   cts->flags);
-                       } else {
-                         /* default(user) transfer settings */
-                               if (pDCB->tinfo.disc_tag & TRM_USR_DISCENB)
-                                       cts->flags = CCB_TRANS_DISC_ENB;
-                               else
-                                       cts->flags = 0;
-                               if (pDCB->tinfo.disc_tag & TRM_USR_TAGENB)
-                                       cts->flags |= CCB_TRANS_TAG_ENB;
-                               tinfo = &pDCB->tinfo.user;
-                               TRM_DPRINTF("USER: cts->flags= %2x \n",
-                                       cts->flags);
-                       }
-                       cts->sync_period = tinfo->period;
-                       cts->sync_offset = tinfo->offset;
-                       cts->bus_width   = tinfo->width;
-                       TRM_DPRINTF("pDCB->SyncPeriod: %d  \n", 
-                               pDCB->SyncPeriod);
-                       TRM_DPRINTF("period: %d  \n", tinfo->period);
-                       TRM_DPRINTF("offset: %d  \n", tinfo->offset);
-                       TRM_DPRINTF("width: %d  \n", tinfo->width);
-
-                       crit_exit();
-                       cts->valid = CCB_TRANS_SYNC_RATE_VALID | 
-                           CCB_TRANS_SYNC_OFFSET_VALID | 
-                           CCB_TRANS_BUS_WIDTH_VALID | 
-                           CCB_TRANS_DISC_VALID | 
-                           CCB_TRANS_TQ_VALID;
-#endif
                        pccb->ccb_h.status = CAM_REQ_CMP;
                        xpt_done(pccb);
                                            }
@@ -945,7 +895,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb)
                        struct  ccb_trans_settings *cts =  &pccb->cts;
                        u_int   update_type;
                        PDCB    pDCB;
-#ifdef CAM_NEW_TRAN_CODE
                        struct ccb_trans_settings_scsi *scsi =
                            &cts->proto_specific.scsi;
                        struct ccb_trans_settings_spi *spi =
@@ -1031,88 +980,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb)
                                pDCB->tinfo.goal.width  = spi->bus_width;
                        }
                        crit_exit();
-#else
-                       TRM_DPRINTF(" XPT_SET_TRAN_SETTINGS \n");
-                       update_type = 0;
-                       if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0)
-                               update_type |= TRM_TRANS_GOAL;
-                       if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0)
-                               update_type |= TRM_TRANS_USER;
-                       crit_enter();
-                       pDCB = &pACB->DCBarray[target_id][target_lun];
-
-                       if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
-                         /*ccb disc enables */
-                               if (update_type & TRM_TRANS_GOAL) {
-                                       if ((cts->flags & CCB_TRANS_DISC_ENB)
-                                           != 0) 
-                                               pDCB->tinfo.disc_tag 
-                                                   |= TRM_CUR_DISCENB;
-                                       else
-                                               pDCB->tinfo.disc_tag &=
-                                                   ~TRM_CUR_DISCENB;
-                               }
-                               if (update_type & TRM_TRANS_USER) {
-                                       if ((cts->flags & CCB_TRANS_DISC_ENB)
-                                           != 0)
-                                               pDCB->tinfo.disc_tag 
-                                                   |= TRM_USR_DISCENB;
-                                       else
-                                               pDCB->tinfo.disc_tag &=
-                                                   ~TRM_USR_DISCENB;
-                               }
-                       }
-                       if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) {
-                         /* if ccb tag q active */
-                               if (update_type & TRM_TRANS_GOAL) {
-                                       if ((cts->flags & CCB_TRANS_TAG_ENB)
-                                           != 0)
-                                               pDCB->tinfo.disc_tag |= 
-                                                   TRM_CUR_TAGENB;
-                                       else
-                                               pDCB->tinfo.disc_tag &= 
-                                                   ~TRM_CUR_TAGENB;
-                               }
-                               if (update_type & TRM_TRANS_USER) {
-                                       if ((cts->flags & CCB_TRANS_TAG_ENB)
-                                           != 0)
-                                               pDCB->tinfo.disc_tag |= 
-                                                   TRM_USR_TAGENB;
-                                       else
-                                               pDCB->tinfo.disc_tag &= 
-                                                   ~TRM_USR_TAGENB;
-                               }       
-                       }
-                       /* Minimum sync period factor   */
-
-                       if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
-                               /* if ccb sync active */
-                               /* TRM-S1040 MinSyncPeriod = 4 clocks/byte */
-                               if ((cts->sync_period != 0) &&
-                                   (cts->sync_period < 125))
-                                       cts->sync_period = 125;
-                               /* 1/(125*4) minsync 2 MByte/sec */
-                               if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID)
-                                   != 0) {
-                                       if (cts->sync_offset == 0)
-                                               cts->sync_period = 0;
-                                       /* TRM-S1040 MaxSyncOffset = 15 bytes*/
-                                       if (cts->sync_offset > 15) 
-                                               cts->sync_offset = 15;
-                               }
-                       }
-                       if ((update_type & TRM_TRANS_USER) != 0) {
-                               pDCB->tinfo.user.period = cts->sync_period;
-                               pDCB->tinfo.user.offset = cts->sync_offset;
-                               pDCB->tinfo.user.width  = cts->bus_width;
-                       }
-                       if ((update_type & TRM_TRANS_GOAL) != 0) {
-                               pDCB->tinfo.goal.period = cts->sync_period;
-                               pDCB->tinfo.goal.offset = cts->sync_offset;
-                               pDCB->tinfo.goal.width  = cts->bus_width;
-                       }
-                       crit_exit();
-#endif
                        pccb->ccb_h.status = CAM_REQ_CMP;
                        xpt_done(pccb);
                        break;
@@ -2419,16 +2286,10 @@ trm_SetXferRate(PACB pACB,PSRB pSRB, PDCB pDCB)
        TRM_DPRINTF("trm_SetXferRate\n");
        pccb = pSRB->pccb;
        memset(&neg, 0, sizeof (neg));
-#ifdef CAM_NEW_TRAN_CODE
        neg.xport_specific.spi.sync_period = pDCB->tinfo.goal.period;
        neg.xport_specific.spi.sync_offset = pDCB->tinfo.goal.offset;
        neg.xport_specific.spi.valid =
            CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET;
-#else
-       neg.sync_period = pDCB->tinfo.goal.period;
-       neg.sync_offset = pDCB->tinfo.goal.offset;
-       neg.valid = CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID;
-#endif
        xpt_setup_ccb(&neg.ccb_h, pccb->ccb_h.path, /* priority */1);
        xpt_async(AC_TRANSFER_NEG, pccb->ccb_h.path, &neg);
        if (!(pDCB->IdentifyMsg & 0x07)) {
index 10c2e4e..b96b129 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  *     $FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.2.2.4 2003/04/08 13:22:08 scottl Exp $
- *     $DragonFly: src/sys/dev/raid/aac/aac_cam.c,v 1.8 2008/01/20 03:40:35 pavalos Exp $
+ *     $DragonFly: src/sys/dev/raid/aac/aac_cam.c,v 1.9 2008/02/10 00:01:03 pavalos Exp $
  */
 
 /*
@@ -263,19 +263,16 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                return;
        }
        case XPT_GET_TRAN_SETTINGS:
        {
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                        &ccb->cts.proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -290,10 +287,6 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
                } else {
                        scsi->valid = 0;
                }
-#else
-               ccb->cts.flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
-               ccb->cts.valid = CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID;
-#endif
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                return;
index e725863..cd04f2c 100644 (file)
@@ -53,7 +53,7 @@
  * SUCH DAMAGE.
  *
  *     $FreeBSD: src/sys/dev/amr/amr_cam.c,v 1.1.2.3 2002/11/11 13:19:10 emoore Exp $
- *     $DragonFly: src/sys/dev/raid/amr/amr_cam.c,v 1.9 2007/12/23 07:00:56 pavalos Exp $
+ *     $DragonFly: src/sys/dev/raid/amr/amr_cam.c,v 1.10 2008/02/10 00:01:03 pavalos Exp $
  */
 
 #include <sys/param.h>
@@ -299,12 +299,10 @@ amr_cam_action(struct cam_sim *sim, union ccb *ccb)
        cpi->unit_number = cam_sim_unit(sim);
        cpi->bus_id = cam_sim_bus(sim);
        cpi->base_transfer_speed = 132 * 1024;  /* XXX get from controller? */
-#ifdef CAM_NEW_TRAN_CODE
        cpi->transport = XPORT_SPI;
        cpi->transport_version = 2;
        cpi->protocol = PROTO_SCSI;
        cpi->protocol_version = SCSI_REV_2;
-#endif
        cpi->ccb_h.status = CAM_REQ_CMP;
 
        break;
@@ -332,7 +330,6 @@ amr_cam_action(struct cam_sim *sim, union ccb *ccb)
 
        debug(3, "XPT_GET_TRAN_SETTINGS");
 
-#ifdef CAM_NEW_TRAN_CODE
        struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
        struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi;
 
@@ -356,23 +353,6 @@ amr_cam_action(struct cam_sim *sim, union ccb *ccb)
            | CTS_SPI_VALID_BUS_WIDTH
            | CTS_SPI_VALID_DISC;
        scsi->valid = CTS_SCSI_VALID_TQ;
-#else
-       if ((cts->flags & CCB_TRANS_USER_SETTINGS) == 0) {
-               ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-               break;
-        }
-
-       cts->flags = CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB;
-       cts->bus_width = MSG_EXT_WDTR_BUS_32_BIT;
-       cts->sync_period = 6;   /* 40MHz how wide is this bus? */
-       cts->sync_offset = 31;  /* How to extract this from board? */
-
-       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-           | CCB_TRANS_SYNC_OFFSET_VALID
-           | CCB_TRANS_BUS_WIDTH_VALID
-           | CCB_TRANS_DISC_VALID
-           | CCB_TRANS_TQ_VALID;
-#endif
        ccb->ccb_h.status = CAM_REQ_CMP;
        break;
     }
index cdd86d4..c6a2db9 100644 (file)
@@ -1,5 +1,5 @@
 /* $FreeBSD: src/sys/dev/asr/asr.c,v 1.3.2.2 2001/08/23 05:21:29 scottl Exp $ */
-/* $DragonFly: src/sys/dev/raid/asr/asr.c,v 1.33 2008/01/06 16:55:51 swildner Exp $ */
+/* $DragonFly: src/sys/dev/raid/asr/asr.c,v 1.34 2008/02/10 00:01:03 pavalos Exp $ */
 /*
  * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
  * Copyright (c) 2000-2001 Adaptec Corporation
@@ -2889,7 +2889,6 @@ asr_action(
         /* Get default/user set transfer settings for the target */
         {
                struct  ccb_trans_settings *cts = &(ccb->cts);
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -2916,23 +2915,6 @@ asr_action(
                } else {
                        ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
                }
-#else
-                if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) {
-                        cts->flags = CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB;
-                        cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                        cts->sync_period = 6; /* 40MHz */
-                        cts->sync_offset = 15;
-
-                        cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                                   | CCB_TRANS_SYNC_OFFSET_VALID
-                                   | CCB_TRANS_BUS_WIDTH_VALID
-                                   | CCB_TRANS_DISC_VALID
-                                   | CCB_TRANS_TQ_VALID;
-                        ccb->ccb_h.status = CAM_REQ_CMP;
-                } else {
-                        ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-                }
-#endif
                 xpt_done(ccb);
                 break;
         }
@@ -2999,12 +2981,10 @@ asr_action(
                 strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                 cpi->unit_number = cam_sim_unit(sim);
                 cpi->ccb_h.status = CAM_REQ_CMP;
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                 xpt_done(ccb);
                 break;
         }
index 18a7ce3..49bf3dc 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  *     $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.2.2.6 2003/02/18 22:27:41 ps Exp $
- *     $DragonFly: src/sys/dev/raid/ciss/ciss.c,v 1.26 2008/01/06 16:55:51 swildner Exp $
+ *     $DragonFly: src/sys/dev/raid/ciss/ciss.c,v 1.27 2008/02/10 00:01:03 pavalos Exp $
  */
 
 /*
@@ -2203,12 +2203,10 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb)
         cpi->unit_number = cam_sim_unit(sim);
         cpi->bus_id = cam_sim_bus(sim);
        cpi->base_transfer_speed = 132 * 1024;  /* XXX what to set this to? */
-#ifdef CAM_NEW_TRAN_CODE
        cpi->transport = XPORT_SPI;
        cpi->transport_version = 2;
        cpi->protocol = PROTO_SCSI;
        cpi->protocol_version = SCSI_REV_2;
-#endif
        ccb->ccb_h.status = CAM_REQ_CMP;
        break;
     }
@@ -2217,17 +2215,14 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb)
     {
        struct ccb_trans_settings       *cts = &ccb->cts;
        int                             bus, target;
-#ifdef CAM_NEW_TRAN_CODE
        struct ccb_trans_settings_spi *spi =
            &cts->xport_specific.spi;
-#endif
 
        bus = cam_sim_bus(sim);
        target = cts->ccb_h.target_id;
 
        debug(1, "XPT_GET_TRAN_SETTINGS %d:%d", bus, target);
        /* disconnect always OK */
-#ifdef CAM_NEW_TRAN_CODE
        cts->protocol = PROTO_SCSI;
        cts->protocol_version = SCSI_REV_2;
        cts->transport = XPORT_SPI;
@@ -2235,10 +2230,6 @@ ciss_cam_action(struct cam_sim *sim, union ccb *ccb)
 
        spi->valid = CTS_SPI_VALID_DISC;
        spi->flags = CTS_SPI_FLAGS_DISC_ENB;
-#else
-       cts->flags |= CCB_TRANS_DISC_ENB;
-       cts->valid = CCB_TRANS_DISC_VALID;
-#endif
 
        cts->ccb_h.status = CAM_REQ_CMP;
        break;
index 8157f41..102c1b2 100644 (file)
@@ -44,7 +44,7 @@
  */
 
 #ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.28.2.3 2003/01/31 02:47:10 grog Exp $"
-#ident "$DragonFly: src/sys/dev/raid/dpt/dpt_scsi.c,v 1.16 2007/12/23 07:00:57 pavalos Exp $"
+#ident "$DragonFly: src/sys/dev/raid/dpt/dpt_scsi.c,v 1.17 2008/02/10 00:01:03 pavalos Exp $"
 
 #define _DPT_C_
 
@@ -979,7 +979,6 @@ dpt_action(struct cam_sim *sim, union ccb *ccb)
        /* Get default/user set transfer settings for the target */
        {
                struct  ccb_trans_settings *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -1010,27 +1009,6 @@ dpt_action(struct cam_sim *sim, union ccb *ccb)
                } else {
                        ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
                }
-#else
-               if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) { 
-                       cts->flags = CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB;
-                       cts->bus_width = (dpt->max_id > 7)
-                                      ? MSG_EXT_WDTR_BUS_8_BIT
-                                      : MSG_EXT_WDTR_BUS_16_BIT;
-                       cts->sync_period = 25; /* 10MHz */
-
-                       if (cts->sync_period != 0)
-                               cts->sync_offset = 15;
-
-                       cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                                  | CCB_TRANS_SYNC_OFFSET_VALID
-                                  | CCB_TRANS_BUS_WIDTH_VALID
-                                  | CCB_TRANS_DISC_VALID
-                                  | CCB_TRANS_TQ_VALID;
-                       ccb->ccb_h.status = CAM_REQ_CMP;
-               } else {
-                       ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-               }
-#endif
                xpt_done(ccb);
                break;
        }
@@ -1095,12 +1073,10 @@ dpt_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(cpi->hba_vid, "DPT", HBA_IDLEN);
                strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
                cpi->unit_number = cam_sim_unit(sim);
-#ifdef CAM_NEW_TRAN_CODE
                 cpi->transport = XPORT_SPI;
                 cpi->transport_version = 2;
                 cpi->protocol = PROTO_SCSI;
                 cpi->protocol_version = SCSI_REV_2;
-#endif
                cpi->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
index 4904fe1..e9722e8 100644 (file)
@@ -1,5 +1,5 @@
 /* $FreeBSD: src/sys/dev/iir/iir.c,v 1.2.2.3 2002/05/05 08:18:12 asmodai Exp $ */
-/* $DragonFly: src/sys/dev/raid/iir/iir.c,v 1.19 2007/12/23 07:00:57 pavalos Exp $ */
+/* $DragonFly: src/sys/dev/raid/iir/iir.c,v 1.20 2008/02/10 00:01:03 pavalos Exp $ */
 /*
  *       Copyright (c) 2000-01 Intel Corporation
  *       All Rights Reserved
@@ -1355,7 +1355,6 @@ iir_action( struct cam_sim *sim, union ccb *ccb )
         /* Get default/user set transfer settings for the target */
           {
               struct        ccb_trans_settings *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
               struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
               struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi;
 
@@ -1381,24 +1380,6 @@ iir_action( struct cam_sim *sim, union ccb *ccb )
               } else {
                   ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
               }
-#else
-              if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) { 
-                  cts->flags = CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB;
-                  cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-                  cts->sync_period = 25; /* 10MHz */
-                  if (cts->sync_period != 0)
-                      cts->sync_offset = 15;
-                  
-                  cts->valid = CCB_TRANS_SYNC_RATE_VALID
-                      | CCB_TRANS_SYNC_OFFSET_VALID
-                      | CCB_TRANS_BUS_WIDTH_VALID
-                      | CCB_TRANS_DISC_VALID
-                      | CCB_TRANS_TQ_VALID;
-                  ccb->ccb_h.status = CAM_REQ_CMP;
-              } else {
-                  ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
-              }
-#endif
               --gdt_stat.io_count_act;
               xpt_done(ccb);
               break;
@@ -1457,12 +1438,10 @@ iir_action( struct cam_sim *sim, union ccb *ccb )
               strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
               strncpy(cpi->hba_vid, "Intel Corp.", HBA_IDLEN);
               strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
-#ifdef CAM_NEW_TRAN_CODE
               cpi->transport = XPORT_SPI;
               cpi->transport_version = 2;
               cpi->protocol = PROTO_SCSI;
               cpi->protocol_version = SCSI_REV_2;
-#endif
               cpi->ccb_h.status = CAM_REQ_CMP;
               --gdt_stat.io_count_act;
               xpt_done(ccb);
index f7ac366..4dea7e5 100644 (file)
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  *
  *     $FreeBSD: src/sys/dev/mly/mly.c,v 1.3.2.3 2001/03/05 20:17:24 msmith Exp $
- *     $DragonFly: src/sys/dev/raid/mly/mly.c,v 1.19 2008/01/21 02:27:37 pavalos Exp $
+ *     $DragonFly: src/sys/dev/raid/mly/mly.c,v 1.20 2008/02/10 00:01:03 pavalos Exp $
  */
 
 #include <sys/param.h>
@@ -2084,12 +2084,10 @@ mly_cam_action(struct cam_sim *sim, union ccb *ccb)
         cpi->unit_number = cam_sim_unit(sim);
         cpi->bus_id = cam_sim_bus(sim);
        cpi->base_transfer_speed = 132 * 1024;  /* XXX what to set this to? */
-#ifdef CAM_NEW_TRAN_CODE
        cpi->transport = XPORT_SPI;
        cpi->transport_version = 2;
        cpi->protocol = PROTO_SCSI;
        cpi->protocol_version = SCSI_REV_2;
-#endif
        ccb->ccb_h.status = CAM_REQ_CMP;
        break;
     }
@@ -2098,7 +2096,6 @@ mly_cam_action(struct cam_sim *sim, union ccb *ccb)
     {
        struct ccb_trans_settings       *cts = &ccb->cts;
        int                             bus, target;
-#ifdef CAM_NEW_TRAN_CODE
        struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
        struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi;
 
@@ -2155,57 +2152,6 @@ mly_cam_action(struct cam_sim *sim, union ccb *ccb)
        /* disconnect always OK */
        spi->flags |= CTS_SPI_FLAGS_DISC_ENB;
        spi->valid |= CTS_SPI_VALID_DISC;
-#else
-       cts->valid = 0;
-
-       bus = cam_sim_bus(sim);
-       target = cts->ccb_h.target_id;
-       /* XXX validate bus/target? */
-
-       debug(2, "XPT_GET_TRAN_SETTINGS %d:%d", bus, target);
-
-       /* logical device? */
-       if (sc->mly_btl[bus][target].mb_flags & MLY_BTL_LOGICAL) {
-           /* nothing special for these */
-
-       /* physical device? */
-       } else if (sc->mly_btl[bus][target].mb_flags & MLY_BTL_PHYSICAL) {
-           /* allow CAM to try tagged transactions */
-           cts->flags |= CCB_TRANS_TAG_ENB;
-           cts->valid |= CCB_TRANS_TQ_VALID;
-
-           /* convert speed (MHz) to usec */
-           if (sc->mly_btl[bus][target].mb_speed == 0) {
-               cts->sync_period = 1000000 / 5;
-           } else {
-               cts->sync_period = 1000000 / sc->mly_btl[bus][target].mb_speed;
-           }
-
-           /* convert bus width to CAM internal encoding */
-           switch (sc->mly_btl[bus][target].mb_width) {
-           case 32:
-               cts->bus_width = MSG_EXT_WDTR_BUS_32_BIT;
-               break;
-           case 16:
-               cts->bus_width = MSG_EXT_WDTR_BUS_16_BIT;
-               break;
-           case 8:
-           default:
-               cts->bus_width = MSG_EXT_WDTR_BUS_8_BIT;
-               break;
-           }
-           cts->valid |= CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_BUS_WIDTH_VALID;
-
-           /* not a device, bail out */
-       } else {
-           cts->ccb_h.status = CAM_REQ_CMP_ERR;
-           break;
-       }
-
-       /* disconnect always OK */
-       cts->flags |= CCB_TRANS_DISC_ENB;
-       cts->valid |= CCB_TRANS_DISC_VALID;
-#endif
 
        cts->ccb_h.status = CAM_REQ_CMP;
        break;
index 969e456..49bd6fc 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  *     $FreeBSD$
- * $DragonFly: src/sys/dev/raid/twa/twa_cam.c,v 1.8 2008/01/21 04:30:04 pavalos Exp $
+ * $DragonFly: src/sys/dev/raid/twa/twa_cam.c,v 1.9 2008/02/10 00:01:03 pavalos Exp $
  */
 
 /*
@@ -381,7 +381,6 @@ twa_action(struct cam_sim *sim, union ccb *ccb)
        case XPT_GET_TRAN_SETTINGS: 
        {
                struct ccb_trans_settings       *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
                struct ccb_trans_settings_scsi *scsi =
                    &cts->proto_specific.scsi;
                struct ccb_trans_settings_spi *spi =
@@ -396,10 +395,6 @@ twa_action(struct cam_sim *sim, union ccb *ccb)
                spi->flags = CTS_SPI_FLAGS_DISC_ENB;
                scsi->valid = CTS_SCSI_VALID_TQ;
                scsi->flags = CTS_SCSI_FLAGS_TAG_ENB;
-#else
-               cts->valid = (CCB_TRANS_DISC_VALID | CCB_TRANS_TQ_VALID);
-               cts->flags &= ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB);
-#endif
                twa_dbg_dprint(3, sc, "XPT_GET_TRAN_SETTINGS");
                ccb_h->status = CAM_REQ_CMP;
                xpt_done(ccb);
@@ -447,12 +442,10 @@ twa_action(struct cam_sim *sim, union ccb *ccb)
                strncpy(path_inq->sim_vid, "FreeBSD", SIM_IDLEN);
                strncpy(path_inq->hba_vid, "3ware", HBA_IDLEN);
                strncpy(path_inq->dev_name, cam_sim_name(sim), DEV_IDLEN);
-#ifdef CAM_NEW_TRAN_CODE
                 path_inq->transport = XPORT_SPI;
                 path_inq->transport_version = 2;
                 path_inq->protocol = PROTO_SCSI;
                 path_inq->protocol_version = SCSI_REV_2;
-#endif
                ccb_h->status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;
index 0c9aea9..8e53c84 100644 (file)
@@ -26,7 +26,7 @@
  *
  * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $
  * $FreeBSD: src/sys/dev/usb/umass.c,v 1.96 2003/12/19 12:19:11 sanpei Exp $
- * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.36 2008/01/16 12:27:49 matthias Exp $
+ * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.37 2008/02/10 00:01:03 pavalos Exp $
  */
 
 /*
@@ -3058,22 +3058,12 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
        case XPT_GET_TRAN_SETTINGS:
        {
                struct ccb_trans_settings *cts = &ccb->cts;
-#ifdef CAM_NEW_TRAN_CODE
                cts->protocol = PROTO_SCSI;
                cts->protocol_version = SCSI_REV_2;
                cts->transport = XPORT_USB;
                cts->transport_version = XPORT_VERSION_UNSPECIFIED;
                cts->xport_specific.valid = 0;
 
-#else
-               DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_GET_TRAN_SETTINGS:.\n",
-                       device_get_nameunit(sc->sc_dev), cam_sim_path(sc->umass_sim),
-                       ccb->ccb_h.target_id, ccb->ccb_h.target_lun));
-
-               cts->valid = 0;
-               cts->flags = 0;         /* no disconnection, tagging */
-#endif
-
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;