diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-11-02 00:54:38 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-11-02 00:54:38 +0000 |
commit | 19b599de4af959c5287bac69d61c3810ae390dfe (patch) | |
tree | 9b84492a0966128feabcb74bbcc277bbdb6640c1 /sys/dev/isp/isp_freebsd.c | |
parent | e6e29e358bcae4e62ea9a2d72c5b2501c75a1850 (diff) | |
download | FreeBSD-src-19b599de4af959c5287bac69d61c3810ae390dfe.zip FreeBSD-src-19b599de4af959c5287bac69d61c3810ae390dfe.tar.gz |
2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.
Reviewed by multitudes.
Diffstat (limited to 'sys/dev/isp/isp_freebsd.c')
-rw-r--r-- | sys/dev/isp/isp_freebsd.c | 138 |
1 files changed, 0 insertions, 138 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index bf00206..5e1d8ce 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, |