From bd3fd815a7fbc96f1506dfdcac840b94cff28d00 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Thu, 2 Nov 2006 00:54:38 +0000 Subject: 2nd and final commit that moves us to CAM_NEW_TRAN_CODE as the default. Reviewed by multitudes. --- sys/dev/aac/aac_cam.c | 7 -- sys/dev/advansys/advansys.c | 106 ------------------------ sys/dev/advansys/advlib.c | 7 -- sys/dev/advansys/adwcam.c | 185 ------------------------------------------ sys/dev/aha/aha.c | 56 ------------- sys/dev/ahb/ahb.c | 33 -------- sys/dev/aic/aic.c | 86 -------------------- sys/dev/aic7xxx/aic79xx_osm.c | 175 --------------------------------------- sys/dev/aic7xxx/aic79xx_osm.h | 4 - sys/dev/aic7xxx/aic7xxx_osm.c | 184 ----------------------------------------- sys/dev/aic7xxx/aic7xxx_osm.h | 4 - sys/dev/amd/amd.c | 136 ------------------------------- sys/dev/amr/amr_cam.c | 20 ----- sys/dev/arcmsr/arcmsr.c | 12 --- sys/dev/asr/asr.c | 20 ----- sys/dev/ata/atapi-cam.c | 12 --- sys/dev/buslogic/bt.c | 59 -------------- sys/dev/ciss/ciss.c | 9 -- sys/dev/dpt/dpt_scsi.c | 24 ------ sys/dev/esp/ncr53c9x.c | 67 --------------- sys/dev/firewire/sbp.c | 8 -- sys/dev/iir/iir.c | 21 ----- sys/dev/isp/isp_freebsd.c | 138 ------------------------------- sys/dev/mly/mly.c | 54 ------------ sys/dev/mpt/mpt_cam.c | 91 --------------------- sys/dev/sym/sym_hipd.c | 116 -------------------------- sys/dev/trm/trm.c | 139 ------------------------------- sys/dev/twa/tw_osl_cam.c | 7 -- sys/dev/usb/umass.c | 9 -- 29 files changed, 1789 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c index f6dbb7ecd263..aa852c57f35c 100644 --- a/sys/dev/aac/aac_cam.c +++ b/sys/dev/aac/aac_cam.c @@ -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 --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c index dd14a65e72ce..53d9e424d2a6 100644 --- a/sys/dev/advansys/advansys.c +++ b/sys/dev/advansys/advansys.c @@ -288,19 +288,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; @@ -327,7 +320,6 @@ adv_action(struct cam_sim *sim, union ccb *ccb) } s = splcam(); -#ifdef CAM_NEW_TRAN_CODE scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if ((update_type & ADV_TRANS_GOAL) != 0) { @@ -393,71 +385,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 splx(s); ccb->ccb_h.status = CAM_REQ_CMP; @@ -467,10 +394,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; @@ -479,7 +404,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; @@ -514,34 +438,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); - s = splcam(); - 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; - splx(s); - - 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; @@ -593,12 +489,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; } diff --git a/sys/dev/advansys/advlib.c b/sys/dev/advansys/advlib.c index 04c15a4940d1..2d9d1641431f 100644 --- a/sys/dev/advansys/advlib.c +++ b/sys/dev/advansys/advlib.c @@ -1136,7 +1136,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; @@ -1149,12 +1148,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); } diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c index 2f3c33b4adc5..1ec1877570ad 100644 --- a/sys/dev/advansys/adwcam.c +++ b/sys/dev/advansys/adwcam.c @@ -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; @@ -537,7 +535,6 @@ adw_action(struct cam_sim *sim, union ccb *ccb) target_mask = 0x01 << ccb->ccb_h.target_id; s = splcam(); -#ifdef CAM_NEW_TRAN_CODE scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { @@ -649,117 +646,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 splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -768,16 +654,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; @@ -845,72 +728,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; @@ -965,12 +782,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; diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c index 6678e1c39599..3c7487b38111 100644 --- a/sys/dev/aha/aha.c +++ b/sys/dev/aha/aha.c @@ -901,7 +901,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 = @@ -936,32 +935,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); @@ -1022,12 +995,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; @@ -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); @@ -1738,7 +1707,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 @@ -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 --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c index 213fa1155eb2..738103185869 100644 --- a/sys/dev/ahb/ahb.c +++ b/sys/dev/ahb/ahb.c @@ -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); @@ -1142,7 +1135,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 = @@ -1175,29 +1167,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; } @@ -1259,12 +1228,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; diff --git a/sys/dev/aic/aic.c b/sys/dev/aic/aic.c index c912153ad1ce..cd9fabc4c1e8 100644 --- a/sys/dev/aic/aic.c +++ b/sys/dev/aic/aic.c @@ -167,7 +167,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 = @@ -213,47 +212,6 @@ aic_action(struct cam_sim *sim, union ccb *ccb) ti->flags |= TINFO_SDTR_NEGO; splx(s); -#else - s = splcam(); - 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; - - splx(s); -#endif ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -262,7 +220,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 = @@ -296,31 +253,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 - s = splcam(); - 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; - - splx(s); - - 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); @@ -355,12 +287,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; @@ -678,9 +608,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])) { @@ -767,7 +695,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; @@ -776,12 +703,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); @@ -818,7 +739,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; @@ -827,12 +747,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); diff --git a/sys/dev/aic7xxx/aic79xx_osm.c b/sys/dev/aic7xxx/aic79xx_osm.c index cc416adaa88c..e33fb0ecfd86 100644 --- a/sys/dev/aic7xxx/aic79xx_osm.c +++ b/sys/dev/aic7xxx/aic79xx_osm.c @@ -604,7 +604,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; @@ -612,7 +611,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; @@ -629,7 +627,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; @@ -740,124 +737,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; @@ -918,52 +803,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 @@ -1362,36 +1201,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: diff --git a/sys/dev/aic7xxx/aic79xx_osm.h b/sys/dev/aic7xxx/aic79xx_osm.h index c3b7d67ce879..6d4ac6820f0c 100644 --- a/sys/dev/aic7xxx/aic79xx_osm.h +++ b/sys/dev/aic7xxx/aic79xx_osm.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 --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c index ab6c48cbb97c..0de7e8d22679 100644 --- a/sys/dev/aic7xxx/aic7xxx_osm.c +++ b/sys/dev/aic7xxx/aic7xxx_osm.c @@ -602,7 +602,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; @@ -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: @@ -931,7 +810,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; @@ -942,7 +820,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; @@ -958,7 +835,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; @@ -1019,52 +895,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 @@ -1538,14 +1368,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; @@ -1553,23 +1379,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: diff --git a/sys/dev/aic7xxx/aic7xxx_osm.h b/sys/dev/aic7xxx/aic7xxx_osm.h index 9dcc88f8a11e..b3c297e4292e 100644 --- a/sys/dev/aic7xxx/aic7xxx_osm.h +++ b/sys/dev/aic7xxx/aic7xxx_osm.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 --git a/sys/dev/amd/amd.c b/sys/dev/amd/amd.c index c92645ae14b3..c20c9b3aa725 100644 --- a/sys/dev/amd/amd.c +++ b/sys/dev/amd/amd.c @@ -504,12 +504,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; @@ -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); @@ -959,23 +839,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); } @@ -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 --git a/sys/dev/amr/amr_cam.c b/sys/dev/amr/amr_cam.c index 7b37ec09bb29..3553d43d35ca 100644 --- a/sys/dev/amr/amr_cam.c +++ b/sys/dev/amr/amr_cam.c @@ -291,12 +291,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; @@ -324,7 +322,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; @@ -348,23 +345,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; } diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index 557791e098a7..2810e2dbe074 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -1891,12 +1891,10 @@ static VOID arcmsr_action(struct cam_sim * psim,union ccb * pccb) strncpy(cpi->dev_name,cam_sim_name(psim),DEV_IDLEN); cpi->unit_number=cam_sim_unit(psim); 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(pccb); break; } @@ -1966,7 +1964,6 @@ static VOID arcmsr_action(struct cam_sim * psim,union ccb * pccb) { struct ccb_trans_settings *cts = &pccb->cts; ULONG s; -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = @@ -1977,14 +1974,12 @@ static VOID arcmsr_action(struct cam_sim * psim,union ccb * pccb) cts->transport = XPORT_SPI; cts->transport_version = 2; -#endif #if ARCMSR_DEBUG0 printf("arcmsr_action: XPT_GET_TRAN_SETTINGS\n" ); #endif s=splcam(); -#ifdef CAM_NEW_TRAN_CODE spi->flags = CTS_SPI_FLAGS_DISC_ENB; spi->sync_period=3; spi->sync_offset=32; @@ -1994,13 +1989,6 @@ static VOID arcmsr_action(struct cam_sim * psim,union ccb * pccb) | CTS_SPI_VALID_SYNC_OFFSET | CTS_SPI_VALID_BUS_WIDTH; scsi->valid = CTS_SCSI_VALID_TQ; -#else - cts->flags=(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - cts->sync_period=3; - cts->sync_offset=32; - cts->bus_width=MSG_EXT_WDTR_BUS_16_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 splx(s); pccb->ccb_h.status=CAM_REQ_CMP; xpt_done(pccb); diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c index 6a4599a222b5..85cd848b9c9c 100644 --- a/sys/dev/asr/asr.c +++ b/sys/dev/asr/asr.c @@ -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 --git a/sys/dev/ata/atapi-cam.c b/sys/dev/ata/atapi-cam.c index e9ef5785b6f7..28a95d073701 100644 --- a/sys/dev/ata/atapi-cam.c +++ b/sys/dev/ata/atapi-cam.c @@ -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); @@ -442,7 +440,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; @@ -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 --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c index 37441f4a5da4..765cabb260d3 100644 --- a/sys/dev/buslogic/bt.c +++ b/sys/dev/buslogic/bt.c @@ -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 --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index cd90d7e8a7b3..a0930e85c009 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -2648,12 +2648,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; } @@ -2662,17 +2660,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; @@ -2680,10 +2675,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; diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c index 2afb3b9e75d2..b533a7c77bde 100644 --- a/sys/dev/dpt/dpt_scsi.c +++ b/sys/dev/dpt/dpt_scsi.c @@ -1005,7 +1005,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 = @@ -1036,27 +1035,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; } @@ -1102,12 +1080,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; diff --git a/sys/dev/esp/ncr53c9x.c b/sys/dev/esp/ncr53c9x.c index 79e977895569..50c6295e7e8c 100644 --- a/sys/dev/esp/ncr53c9x.c +++ b/sys/dev/esp/ncr53c9x.c @@ -928,12 +928,10 @@ ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) strncpy(cpi->hba_vid, "Sun", 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; mtx_unlock(&sc->sc_lock); xpt_done(ccb); @@ -943,7 +941,6 @@ ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) { struct ccb_trans_settings *cts = &ccb->cts; struct ncr53c9x_tinfo *ti = &sc->sc_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 = @@ -978,29 +975,6 @@ ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) CTS_SPI_VALID_SYNC_OFFSET | CTS_SPI_VALID_DISC; scsi->valid = CTS_SCSI_VALID_TQ; -#else - if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) { - cts->sync_period = ti->period; - cts->sync_offset = ti->offset; - cts->bus_width = ti->width; - if ((ti->flags & T_TAG) != 0) - cts->flags |= - (CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - else - cts->flags &= - ~(CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - } else { - cts->sync_period = sc->sc_maxsync; - cts->sync_offset = sc->sc_maxoffset; - cts->bus_width = sc->sc_maxwidth; - cts->flags |= (CCB_TRANS_DISC_ENB | CCB_TRANS_TAG_ENB); - } - cts->valid = CCB_TRANS_BUS_WIDTH_VALID | - CCB_TRANS_SYNC_RATE_VALID | - CCB_TRANS_SYNC_OFFSET_VALID | - CCB_TRANS_DISC_VALID | - CCB_TRANS_TQ_VALID; -#endif ccb->ccb_h.status = CAM_REQ_CMP; mtx_unlock(&sc->sc_lock); xpt_done(ccb); @@ -1081,7 +1055,6 @@ ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) struct ccb_trans_settings *cts = &ccb->cts; int target = ccb->ccb_h.target_id; struct ncr53c9x_tinfo *ti = &sc->sc_tinfo[target]; -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_spi *spi = @@ -1125,46 +1098,6 @@ ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) ti->flags |= T_NEGOTIATE; ti->offset = spi->sync_offset; } -#else - if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) { - if ((sc->sc_cfflags & (1<<((target & 7) + 16))) == 0 && - (cts->flags & CCB_TRANS_TAG_ENB)) { - NCR_MISC(("%s: target %d: tagged queuing\n", - device_get_nameunit(sc->sc_dev), target)); - ti->flags |= T_TAG; - } else - ti->flags &= ~T_TAG; - } - - if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) { - if (cts->bus_width != 0) { - NCR_MISC(("%s: target %d: wide negotiation\n", - device_get_nameunit(sc->sc_dev), target)); - if (sc->sc_rev == NCR_VARIANT_FAS366) { - ti->flags |= T_WIDE; - ti->width = 1; - } - } else { - ti->flags &= ~T_WIDE; - ti->width = 0; - } - ti->flags |= T_NEGOTIATE; - } - - if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) { - NCR_MISC(("%s: target %d: sync period negotiation\n", - device_get_nameunit(sc->sc_dev), target)); - ti->flags |= T_NEGOTIATE; - ti->period = cts->sync_period; - } - - if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) { - NCR_MISC(("%s: target %d: sync offset negotiation\n", - device_get_nameunit(sc->sc_dev), target)); - ti->flags |= T_NEGOTIATE; - ti->offset = cts->sync_offset; - } -#endif mtx_unlock(&sc->sc_lock); ccb->ccb_h.status = CAM_REQ_CMP; diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index d112ffca0dc6..07bf416e8bf1 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -2527,12 +2527,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); @@ -2541,7 +2539,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 = @@ -2555,11 +2552,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) printf("%s:%d:%d XPT_GET_TRAN_SETTINGS:.\n", device_get_nameunit(sbp->fd.dev), diff --git a/sys/dev/iir/iir.c b/sys/dev/iir/iir.c index 885400d4fb68..51a636c08dbd 100644 --- a/sys/dev/iir/iir.c +++ b/sys/dev/iir/iir.c @@ -1349,7 +1349,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; @@ -1375,24 +1374,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; @@ -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 --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index bf00206e8981..5e1d8ce7682a 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -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 --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c index ac72582fec22..19ece614c76f 100644 --- a/sys/dev/mly/mly.c +++ b/sys/dev/mly/mly.c @@ -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 --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index d597d8302bdc..01194590879e 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -2944,11 +2944,7 @@ mpt_action(struct cam_sim *sim, union ccb *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 #define DP_DISC_ENABLE 0x1 #define DP_DISC_DISABL 0x2 #define DP_DISC (DP_DISC_ENABLE|DP_DISC_DISABL) @@ -2965,10 +2961,8 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) case XPT_SET_TRAN_SETTINGS: /* Nexus Settings */ { -#ifdef CAM_NEW_TRAN_CODE struct ccb_trans_settings_scsi *scsi; struct ccb_trans_settings_spi *spi; -#endif uint8_t dval; u_int period; u_int offset; @@ -3009,28 +3003,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) period = 0; offset = 0; -#ifndef CAM_NEW_TRAN_CODE - if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) { - dval |= (cts->flags & CCB_TRANS_DISC_ENB) ? - DP_DISC_ENABLE : DP_DISC_DISABL; - } - - if ((cts->valid & CCB_TRANS_TQ_VALID) != 0) { - dval |= (cts->flags & CCB_TRANS_TAG_ENB) ? - DP_TQING_ENABLE : DP_TQING_DISABL; - } - - if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0) { - dval |= cts->bus_width ? DP_WIDE : DP_NARROW; - } - - 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 scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; @@ -3056,7 +3028,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) period = spi->sync_period; offset = spi->sync_offset; } -#endif CAMLOCK_2_MPTLOCK(mpt); if (dval & DP_DISC_ENABLE) { mpt->mpt_disc_enable |= (1 << tgt); @@ -3088,21 +3059,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) case XPT_GET_TRAN_SETTINGS: cts = &ccb->cts; 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; @@ -3114,20 +3070,7 @@ 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 if (mpt->is_sas) { -#ifndef CAM_NEW_TRAN_CODE - 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_sas *sas = &cts->xport_specific.sas; @@ -3138,7 +3081,6 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) sas->valid = CTS_SAS_VALID_SPEED; sas->bitrate = 300000; /* XXX: Default 3Gbps */ -#endif } else if (mpt_get_spi_settings(mpt, cts) != 0) { mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); break; @@ -3197,32 +3139,24 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) cpi->base_transfer_speed = mpt->mpt_fcport_speed * 100000; cpi->hba_inquiry = PI_TAG_ABLE; -#ifdef CAM_NEW_TRAN_CODE cpi->transport = XPORT_FC; cpi->transport_version = 0; -#endif } else if (mpt->is_sas) { cpi->hba_misc = PIM_NOBUSRESET; cpi->base_transfer_speed = 300000; cpi->hba_inquiry = PI_TAG_ABLE; -#ifdef CAM_NEW_TRAN_CODE cpi->transport = XPORT_SAS; cpi->transport_version = 0; -#endif } else { cpi->hba_misc = PIM_SEQSCAN; cpi->base_transfer_speed = 3300; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; -#ifdef CAM_NEW_TRAN_CODE cpi->transport = XPORT_SPI; cpi->transport_version = 2; -#endif } -#ifdef CAM_NEW_TRAN_CODE cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; -#endif /* * We give our fake RAID passhtru bus a width that is MaxVolumes * wide, restrict it to one lun and have it *not* be a bus @@ -3326,10 +3260,8 @@ mpt_action(struct cam_sim *sim, union ccb *ccb) static int mpt_get_spi_settings(struct mpt_softc *mpt, struct ccb_trans_settings *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; -#endif target_id_t tgt; uint8_t dval, pval, oval; int rv; @@ -3380,28 +3312,6 @@ mpt_get_spi_settings(struct mpt_softc *mpt, struct ccb_trans_settings *cts) oval = (mpt->mpt_port_page0.Capabilities >> 16) & 0xff; pval = (mpt->mpt_port_page0.Capabilities >> 8) & 0xff; } -#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; @@ -3433,7 +3343,6 @@ mpt_get_spi_settings(struct mpt_softc *mpt, struct ccb_trans_settings *cts) } else { scsi->valid = 0; } -#endif mpt_lprt(mpt, MPT_PRT_NEGOTIATION, "mpt_get_spi_settings[%d]: %s 0x%x period 0x%x offset %d\n", tgt, IS_CURRENT_SETTINGS(cts)? "ACTIVE" : "NVRAM ", dval, pval, oval); diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index 9a2549eda595..54849f6020bf 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #define SYM_DRIVER_NAME "sym-1.6.5-20000902" /* #define SYM_DEBUG_GENERIC_SUPPORT */ -/* #define CAM_NEW_TRAN_CODE */ #include @@ -111,13 +110,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. */ @@ -1076,10 +1068,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; @@ -2758,10 +2748,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; @@ -2779,9 +2767,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 } } @@ -3468,7 +3454,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) @@ -3489,21 +3474,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 | \ @@ -3516,19 +3491,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. @@ -4815,10 +4777,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; @@ -8073,20 +8033,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); @@ -8105,7 +8057,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) { @@ -8143,35 +8094,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; } @@ -8208,7 +8130,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; @@ -8219,7 +8140,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; } @@ -8318,7 +8238,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; @@ -8335,14 +8254,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. */ @@ -8356,7 +8267,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. */ @@ -8364,16 +8274,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. @@ -8402,7 +8302,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) { @@ -8420,21 +8319,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 } diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 591e7206f47d..23c20d6e00be 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -711,12 +711,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); } @@ -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 --git a/sys/dev/twa/tw_osl_cam.c b/sys/dev/twa/tw_osl_cam.c index 1dfa60f90d4b..6b6afebf8d35 100644 --- a/sys/dev/twa/tw_osl_cam.c +++ b/sys/dev/twa/tw_osl_cam.c @@ -420,7 +420,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 = @@ -435,10 +434,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 tw_osli_dbg_dprintf(3, sc, "XPT_GET_TRAN_SETTINGS"); ccb_h->status = CAM_REQ_CMP; xpt_done(ccb); @@ -471,12 +466,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; diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 216992031f2a..dc036e6c17a5 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -2606,21 +2606,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); -- cgit v1.2.3