summaryrefslogtreecommitdiffstats
path: root/sys/dev/sym
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/sym
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/sym')
-rw-r--r--sys/dev/sym/sym_hipd.c116
1 files changed, 0 insertions, 116 deletions
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c
index 9a2549e..54849f6 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 <sys/param.h>
@@ -112,13 +111,6 @@ typedef u_int16_t u16;
typedef u_int32_t u32;
/*
- * From 'cam.error_recovery_diffs.20010313.context' patch.
- */
-#ifdef CAM_NEW_TRAN_CODE
-#define FreeBSD_New_Tran_Settings
-#endif /* CAM_NEW_TRAN_CODE */
-
-/*
* Driver definitions.
*/
#include <dev/sym/sym_defs.h>
@@ -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
}
OpenPOWER on IntegriCloud