summaryrefslogtreecommitdiffstats
path: root/sys/dev/amd
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-11-02 00:54:38 +0000
committermjacob <mjacob@FreeBSD.org>2006-11-02 00:54:38 +0000
commit19b599de4af959c5287bac69d61c3810ae390dfe (patch)
tree9b84492a0966128feabcb74bbcc277bbdb6640c1 /sys/dev/amd
parente6e29e358bcae4e62ea9a2d72c5b2501c75a1850 (diff)
downloadFreeBSD-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/amd')
-rw-r--r--sys/dev/amd/amd.c136
1 files changed, 0 insertions, 136 deletions
diff --git a/sys/dev/amd/amd.c b/sys/dev/amd/amd.c
index c92645a..c20c9b3 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);
OpenPOWER on IntegriCloud