diff a/lib/libcam/camlib.c b/lib/libcam/camlib.c (rejected hunks) @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libcam/camlib.c,v 1.15 2006/04/30 07:08:43 marcus Exp $"); +__FBSDID("$FreeBSD: src/lib/libcam/camlib.c,v 1.16 2006/11/02 00:54:32 mjacob Exp $"); #include #include diff a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c (rejected hunks) @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sbin/camcontrol/camcontrol.c,v 1.54 2006/08/21 13:24:49 ken Exp $"); +__FBSDID("$FreeBSD: src/sbin/camcontrol/camcontrol.c,v 1.55 2006/11/02 00:54:32 mjacob Exp $"); #include #include diff a/sys/bus/cam/scsi/scsi_low.c b/sys/bus/cam/scsi/scsi_low.c (rejected hunks) @@ -2,7 +2,7 @@ /* $NetBSD$ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.25 2006/10/31 05:53:24 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.26 2006/11/02 00:54:33 mjacob Exp $"); #define SCSI_LOW_STATICS #define SCSI_LOW_DEBUG diff a/sys/bus/cam/cam_ccb.h b/sys/bus/cam/cam_ccb.h (rejected hunks) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.32 2006/06/05 22:22:14 mjacob Exp $ + * $FreeBSD: src/sys/cam/cam_ccb.h,v 1.33 2006/11/02 00:54:32 mjacob Exp $ */ #ifndef _CAM_CAM_CCB_H @@ -34,9 +34,7 @@ #include #include #include -#ifdef CAM_NEW_TRAN_CODE #include -#endif /* CAM_NEW_TRAN_CODE */ #ifndef _KERNEL #include #endif diff a/sys/bus/cam/cam_xpt.c b/sys/bus/cam/cam_xpt.c (rejected hunks) @@ -1708,112 +1703,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; - - GIANT_REQUIRED; - - 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, @@ -5955,19 +5833,10 @@ 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); 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); } @@ -6668,194 +6534,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 - && (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; - } - - 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; - /* FALLTHROUGH 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; - } - /* FALLTHROUGH 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) diff a/sys/dev/disk/advansys/advansys.c b/sys/dev/disk/advansys/advansys.c (rejected hunks) @@ -46,7 +46,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/advansys/advansys.c,v 1.31 2006/10/31 05:53:25 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/advansys/advansys.c,v 1.32 2006/11/02 00:54:33 mjacob Exp $"); #include #include @@ -327,7 +320,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) { diff a/sys/dev/disk/advansys/advlib.c b/sys/dev/disk/advansys/advlib.c (rejected hunks) @@ -42,7 +42,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/advansys/advlib.c,v 1.25 2006/10/31 05:53:25 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/advansys/advlib.c,v 1.26 2006/11/02 00:54:33 mjacob Exp $"); #include #include diff a/sys/dev/disk/advansys/adwcam.c b/sys/dev/disk/advansys/adwcam.c (rejected hunks) @@ -44,7 +44,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/advansys/adwcam.c,v 1.23 2006/10/31 05:53:25 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/advansys/adwcam.c,v 1.24 2006/11/02 00:54:33 mjacob Exp $"); #include #include @@ -525,10 +525,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; int s; diff a/sys/dev/disk/aha/aha.c b/sys/dev/disk/aha/aha.c (rejected hunks) @@ -58,7 +58,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aha/aha.c,v 1.60 2006/10/31 05:53:25 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aha/aha.c,v 1.61 2006/11/02 00:54:34 mjacob Exp $"); #include #include @@ -1714,9 +1685,7 @@ ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts) int error; uint8_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); @@ -1761,30 +1729,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); } diff a/sys/dev/disk/ahb/ahb.c b/sys/dev/disk/ahb/ahb.c (rejected hunks) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.36 2006/10/31 05:53:25 mjacob Exp $ + * $FreeBSD: src/sys/dev/ahb/ahb.c,v 1.37 2006/11/02 00:54:34 mjacob Exp $ */ #include @@ -728,24 +728,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); printf("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); diff a/sys/dev/disk/aic/aic.c b/sys/dev/disk/aic/aic.c (rejected hunks) @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aic/aic.c,v 1.24 2006/10/31 05:53:25 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aic/aic.c,v 1.25 2006/11/02 00:54:34 mjacob Exp $"); #include #include @@ -213,47 +212,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 > aic->min_period) { - ti->goal.period = 0; - ti->goal.offset = 0; - } else if (ti->goal.period < aic->max_period) - ti->goal.period = aic->max_period; - } - - if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) { - ti->goal.offset = cts->sync_offset; - if (ti->goal.offset == 0) - ti->goal.period = 0; - else if (ti->goal.offset > AIC_SYNC_OFFSET) - ti->goal.offset = AIC_SYNC_OFFSET; - } - - if ((ti->goal.period != ti->current.period) - || (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; diff a/sys/dev/disk/aic7xxx/aic79xx_osm.c b/sys/dev/disk/aic7xxx/aic79xx_osm.c (rejected hunks) @@ -33,7 +33,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.24 2006/03/07 22:17:06 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.25 2006/11/02 00:54:34 mjacob Exp $"); #include #include diff a/sys/dev/disk/aic7xxx/aic79xx_osm.h b/sys/dev/disk/aic7xxx/aic79xx_osm.h (rejected hunks) @@ -32,7 +32,7 @@ * * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#23 $ * - * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.19 2006/05/16 14:36:22 phk Exp $ + * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.20 2006/11/02 00:54:34 mjacob Exp $ */ #ifndef _AIC79XX_FREEBSD_H_ @@ -77,10 +77,6 @@ #include #include -#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) diff a/sys/dev/disk/aic7xxx/aic7xxx_osm.c b/sys/dev/disk/aic7xxx/aic7xxx_osm.c (rejected hunks) @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.45 2006/09/05 20:28:28 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.46 2006/11/02 00:54:34 mjacob Exp $"); #include #include @@ -731,126 +730,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb) ahc_unlock(ahc, &s); 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; - long s; - - 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; - } - - ahc_lock(ahc, &s); - - 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); - } - ahc_unlock(ahc, &s); - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); -#endif break; } case XPT_GET_TRAN_SETTINGS: diff a/sys/dev/disk/aic7xxx/aic7xxx_osm.h b/sys/dev/disk/aic7xxx/aic7xxx_osm.h (rejected hunks) @@ -31,7 +31,7 @@ * * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.h#18 $ * - * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.h,v 1.31 2006/05/16 14:36:22 phk Exp $ + * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.h,v 1.32 2006/11/02 00:54:34 mjacob Exp $ */ #ifndef _AIC7XXX_FREEBSD_H_ @@ -85,10 +85,6 @@ #include #include -#ifdef CAM_NEW_TRAN_CODE -#define AHC_NEW_TRAN_SETTINGS -#endif /* CAM_NEW_TRAN_CODE */ - /*************************** Attachment Bookkeeping ***************************/ extern devclass_t ahc_devclass; diff a/sys/dev/disk/amd/amd.c b/sys/dev/disk/amd/amd.c (rejected hunks) @@ -30,7 +30,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************* - * $FreeBSD: src/sys/dev/amd/amd.c,v 1.31 2006/10/31 05:53:26 mjacob Exp $ + * $FreeBSD: src/sys/dev/amd/amd.c,v 1.32 2006/11/02 00:54:34 mjacob Exp $ */ /* @@ -549,7 +547,6 @@ amd_action(struct cam_sim * psim, union ccb * pccb) struct amd_target_info *targ_info = &amd->tinfo[target_id]; struct amd_transinfo *tinfo; int intflag; -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = @@ -598,54 +595,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 - intflag = splcam(); - 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; - splx(intflag); - - 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; @@ -653,12 +608,10 @@ amd_action(struct cam_sim * psim, union ccb * pccb) u_int update_type = 0; int intflag; 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)) { @@ -670,7 +623,6 @@ amd_action(struct cam_sim * psim, union ccb * pccb) xpt_done(pccb); } -#ifdef CAM_NEW_TRAN_CODE intflag = splcam(); targ_info = &amd->tinfo[target_id]; @@ -745,78 +697,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 - intflag = splcam(); - 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 splx(intflag); pccb->ccb_h.status = CAM_REQ_CMP; xpt_done(pccb); @@ -1627,21 +1498,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 printf("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); diff a/sys/dev/disk/ata/atapi-cam.c b/sys/dev/disk/ata/atapi-cam.c (rejected hunks) @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.45 2006/10/31 05:53:26 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.46 2006/11/02 00:54:35 mjacob Exp $"); #include #include @@ -363,12 +363,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) { mtx_lock(&softc->state_lock); @@ -450,15 +447,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); diff a/sys/dev/disk/buslogic/bt.c b/sys/dev/disk/buslogic/bt.c (rejected hunks) @@ -32,7 +32,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/buslogic/bt.c,v 1.45 2005/05/29 04:42:19 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/buslogic/bt.c,v 1.46 2006/11/02 00:54:35 mjacob Exp $"); /* * Special thanks to Leonard N. Zubkoff for writing such a complete and @@ -1290,7 +1290,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; @@ -1336,36 +1335,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); } @@ -1436,12 +1405,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; } @@ -1757,7 +1724,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; @@ -1767,11 +1733,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); printf("refuses tagged commands. Performing " "non-tagged I/O\n"); @@ -2214,7 +2175,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 = @@ -2222,10 +2182,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); @@ -2306,7 +2262,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; @@ -2326,20 +2281,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); } diff a/sys/dev/disk/isp/isp_freebsd.c b/sys/dev/disk/isp/isp_freebsd.c (rejected hunks) @@ -29,7 +29,7 @@ * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. */ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.124 2006/10/31 05:53:28 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.125 2006/11/02 00:54:37 mjacob Exp $"); #include #include #include @@ -2422,11 +2422,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)) { @@ -2437,66 +2433,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; - uint16_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 = @@ -2551,7 +2487,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, @@ -2569,21 +2504,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; @@ -2606,14 +2526,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)); uint16_t dval, pval, oval; @@ -2634,31 +2551,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; @@ -2690,7 +2582,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", @@ -2790,10 +2681,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)); @@ -2801,15 +2690,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); @@ -2885,10 +2770,8 @@ isp_async(ispsoftc_t *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; @@ -2913,7 +2796,6 @@ isp_async(ispsoftc_t *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; @@ -2942,26 +2824,6 @@ isp_async(ispsoftc_t *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, diff a/sys/dev/disk/sym/sym_hipd.c b/sys/dev/disk/sym/sym_hipd.c (rejected hunks) @@ -56,12 +56,11 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sym/sym_hipd.c,v 1.59 2006/05/12 05:04:43 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sym/sym_hipd.c,v 1.60 2006/11/02 00:54:37 mjacob Exp $"); #define SYM_DRIVER_NAME "sym-1.6.5-20000902" /* #define SYM_DEBUG_GENERIC_SUPPORT */ -/* #define CAM_NEW_TRAN_CODE */ #include @@ -112,13 +111,6 @@ 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. */ #include diff a/sys/dev/disk/trm/trm.c b/sys/dev/disk/trm/trm.c (rejected hunks) @@ -11,7 +11,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/trm/trm.c,v 1.28 2006/10/31 05:53:29 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/trm/trm.c,v 1.29 2006/11/02 00:54:37 mjacob Exp $"); /* * HISTORY: @@ -839,7 +837,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb) int intflag; 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 = @@ -894,53 +891,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]; - intflag = splcam(); - /* - * 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); - - splx(intflag); - 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); } @@ -955,7 +905,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb) u_int update_type; int intflag; PDCB pDCB; -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = @@ -1041,88 +990,6 @@ trm_action(struct cam_sim *psim, union ccb *pccb) pDCB->tinfo.goal.width = spi->bus_width; } splx(intflag); -#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; - intflag = splcam(); - 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; - } - splx(intflag); -#endif pccb->ccb_h.status = CAM_REQ_CMP; xpt_done(pccb); break; @@ -2431,16 +2298,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)) { diff a/sys/dev/raid/aac/aac_cam.c b/sys/dev/raid/aac/aac_cam.c (rejected hunks) @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.24 2006/10/31 05:53:25 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac_cam.c,v 1.25 2006/11/02 00:54:33 mjacob Exp $"); /* * CAM front-end for communicating with non-DASD devices @@ -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; diff a/sys/dev/raid/amr/amr_cam.c b/sys/dev/raid/amr/amr_cam.c (rejected hunks) @@ -55,7 +55,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/amr/amr_cam.c,v 1.19 2006/10/31 05:53:26 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr_cam.c,v 1.20 2006/11/02 00:54:35 mjacob Exp $"); #include #include diff a/sys/dev/raid/asr/asr.c b/sys/dev/raid/asr/asr.c (rejected hunks) @@ -162,7 +162,7 @@ #include -__FBSDID("$FreeBSD: src/sys/dev/asr/asr.c,v 1.79 2006/10/31 05:53:26 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/asr/asr.c,v 1.80 2006/11/02 00:54:35 mjacob Exp $"); #define ASR_VERSION 1 #define ASR_REVISION '1' @@ -2792,7 +2792,6 @@ asr_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 = @@ -2819,23 +2818,6 @@ asr_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 = 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; } @@ -2902,12 +2884,10 @@ asr_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; } diff a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c (rejected hunks) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.72 2006/10/31 05:53:27 mjacob Exp $ + * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.73 2006/11/02 00:54:36 mjacob Exp $ */ /* diff a/sys/dev/raid/dpt/dpt_scsi.c b/sys/dev/raid/dpt/dpt_scsi.c (rejected hunks) @@ -27,9 +27,9 @@ * SUCH DAMAGE. */ -#ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.53 2006/10/31 05:53:27 mjacob Exp $" +#ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.54 2006/11/02 00:54:36 mjacob Exp $" #include -__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.53 2006/10/31 05:53:27 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.54 2006/11/02 00:54:36 mjacob Exp $"); /* * dpt_scsi.c: SCSI dependant code for the DPT driver diff a/sys/dev/raid/iir/iir.c b/sys/dev/raid/iir/iir.c (rejected hunks) @@ -43,7 +43,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/iir/iir.c,v 1.16 2006/10/31 05:53:28 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/iir/iir.c,v 1.17 2006/11/02 00:54:36 mjacob Exp $"); #define _IIR_C_ @@ -1454,12 +1435,10 @@ iir_action( struct cam_sim *sim, union ccb *ccb ) else strncpy(cpi->hba_vid, "ICP vortex ", 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); diff a/sys/dev/raid/mly/mly.c b/sys/dev/raid/mly/mly.c (rejected hunks) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mly/mly.c,v 1.40 2006/10/31 05:53:28 mjacob Exp $ + * $FreeBSD: src/sys/dev/mly/mly.c,v 1.41 2006/11/02 00:54:37 mjacob Exp $ */ #include @@ -2097,12 +2097,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; } @@ -2111,7 +2109,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; @@ -2168,57 +2165,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; diff a/sys/dev/usbmisc/umass/umass.c b/sys/dev/usbmisc/umass/umass.c (rejected hunks) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/usb/umass.c,v 1.139 2006/10/31 05:53:29 mjacob Exp $ + * $FreeBSD: src/sys/dev/usb/umass.c,v 1.140 2006/11/02 00:54:38 mjacob Exp $ * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ */