From 19b599de4af959c5287bac69d61c3810ae390dfe Mon Sep 17 00:00:00 2001 From: mjacob 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/trm/trm.c | 139 ------------------------------------------------------ 1 file changed, 139 deletions(-) (limited to 'sys/dev/trm') diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 591e720..23c20d6 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)) { -- cgit v1.1