diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/advansys/advansys.c | 45 | ||||
-rw-r--r-- | sys/dev/advansys/advlib.c | 5 | ||||
-rw-r--r-- | sys/dev/advansys/adwcam.c | 26 | ||||
-rw-r--r-- | sys/dev/aha/aha.c | 5 | ||||
-rw-r--r-- | sys/dev/ahb/ahb.c | 3 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx.c | 14 | ||||
-rw-r--r-- | sys/dev/buslogic/bt.c | 5 | ||||
-rw-r--r-- | sys/dev/dpt/dpt_scsi.c | 3 | ||||
-rw-r--r-- | sys/dev/isp/isp_freebsd.c | 19 | ||||
-rw-r--r-- | sys/dev/ppbus/vpo.c | 3 |
10 files changed, 90 insertions, 38 deletions
diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c index 0071950..ee3f887 100644 --- a/sys/dev/advansys/advansys.c +++ b/sys/dev/advansys/advansys.c @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: advansys.c,v 1.8 1999/04/07 22:59:12 gibbs Exp $ + * $Id: advansys.c,v 1.9 1999/04/19 21:27:35 gibbs Exp $ */ /* * Ported from: @@ -237,18 +237,30 @@ adv_action(struct cam_sim *sim, union ccb *ccb) { struct ccb_trans_settings *cts; target_bit_vector targ_mask; - struct adv_target_transinfo *tconf; + struct adv_transinfo *tconf; u_int update_type; int s; cts = &ccb->cts; targ_mask = ADV_TID_TO_TARGET_MASK(cts->ccb_h.target_id); - tconf = &adv->tinfo[cts->ccb_h.target_id]; update_type = 0; - if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) + + /* + * The user must specify which type of settings he wishes + * to change. + */ + if (((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) + && ((cts->flags & CCB_TRANS_USER_SETTINGS) == 0)) { + tconf = &adv->tinfo[cts->ccb_h.target_id].current; update_type |= ADV_TRANS_GOAL; - if ((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) + } else if (((cts->flags & CCB_TRANS_USER_SETTINGS) != 0) + && ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) == 0)) { + tconf = &adv->tinfo[cts->ccb_h.target_id].user; update_type |= ADV_TRANS_USER; + } else { + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } s = splcam(); @@ -286,9 +298,26 @@ adv_action(struct cam_sim *sim, union ccb *ccb) } } - if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) { + /* + * 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 = 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, @@ -298,6 +327,7 @@ adv_action(struct cam_sim *sim, union ccb *ccb) cts->ccb_h.target_id, cts->sync_period, cts->sync_offset, update_type); } + splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -402,6 +432,7 @@ adv_action(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = 7; cpi->initiator_id = adv->scsi_id; cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "Advansys", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/advansys/advlib.c b/sys/dev/advansys/advlib.c index 66640c8..568bf91 100644 --- a/sys/dev/advansys/advlib.c +++ b/sys/dev/advansys/advlib.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: advlib.c,v 1.11 1999/04/11 02:55:50 eivind Exp $ + * $Id: advlib.c,v 1.12 1999/04/19 21:27:36 gibbs Exp $ */ /* * Ported from: @@ -1790,7 +1790,8 @@ adv_put_ready_queue(struct adv_softc *adv, struct adv_scsi_q *scsiq, tid_no = ADV_TIX_TO_TID(scsiq->q2.target_ix); tinfo = &adv->tinfo[tid_no]; - if (tinfo->current.period != tinfo->goal.period) { + if ((tinfo->current.period != tinfo->goal.period) + || (tinfo->current.offset != tinfo->goal.offset)) { adv_msgout_sdtr(adv, tinfo->goal.period, tinfo->goal.offset); scsiq->q1.cntl |= QC_MSG_OUT; diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c index e2c3921..aef4612 100644 --- a/sys/dev/advansys/adwcam.c +++ b/sys/dev/advansys/adwcam.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: adwcam.c,v 1.1 1998/10/07 03:20:46 gibbs Exp $ + * $Id: adwcam.c,v 1.2 1998/10/15 23:47:14 gibbs Exp $ */ /* * Ported from: @@ -595,7 +595,8 @@ adw_action(struct cam_sim *sim, union ccb *ccb) } } - if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) { + if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) + || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) { u_int sdtrenb_orig; u_int sdtrenb; u_int ultraenb_orig; @@ -613,14 +614,18 @@ adw_action(struct cam_sim *sim, union ccb *ccb) sdtrdone = adw_lram_read_16(adw, ADW_MC_SDTR_DONE); - if (cts->sync_period == 0) { - sdtrenb &= ~target_mask; - } else if (cts->sync_period > 12) { - ultraenb &= ~target_mask; - sdtrenb |= target_mask; - } else { - ultraenb |= target_mask; - sdtrenb |= target_mask; + if ((cts->valid + & CCB_TRANS_SYNC_RATE_VALID) != 0) { + + if (cts->sync_period == 0) { + sdtrenb &= ~target_mask; + } else if (cts->sync_period > 12) { + ultraenb &= ~target_mask; + sdtrenb |= target_mask; + } else { + ultraenb |= target_mask; + sdtrenb |= target_mask; + } } if ((cts->valid @@ -786,6 +791,7 @@ adw_action(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = ADW_MAX_LUN; cpi->initiator_id = adw->initiator_id; cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "AdvanSys", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c index 8ab5a85..f0456db 100644 --- a/sys/dev/aha/aha.c +++ b/sys/dev/aha/aha.c @@ -55,7 +55,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aha.c,v 1.20 1999/03/02 20:56:07 imp Exp $ + * $Id: aha.c,v 1.21 1999/04/11 02:55:50 eivind Exp $ */ #include "pnp.h" @@ -1029,7 +1029,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb) case XPT_SET_TRAN_SETTINGS: { /* XXX Implement */ - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_PROVIDE_FAIL; xpt_done(ccb); break; } @@ -1120,6 +1120,7 @@ ahaaction(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = 7; cpi->initiator_id = aha->scsi_id; cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c index 4bdc6bb..6e0db43 100644 --- a/sys/dev/ahb/ahb.c +++ b/sys/dev/ahb/ahb.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ahb.c,v 1.9 1999/04/18 15:50:33 peter Exp $ + * $Id: ahb.c,v 1.10 1999/04/23 23:29:00 gibbs Exp $ */ #include "eisa.h" @@ -1214,6 +1214,7 @@ ahbaction(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = 7; cpi->initiator_id = ahb->scsi_id; cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c index 346e4b8..215e0a4 100644 --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -36,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.c,v 1.23 1999/04/23 23:27:29 gibbs Exp $ + * $Id: aic7xxx.c,v 1.24 1999/04/26 22:03:44 ken Exp $ */ /* * A few notes on features of the driver. @@ -1097,6 +1097,7 @@ ahc_update_target_msg_request(struct ahc_softc *ahc, targ_msg_req_orig = ahc->targ_msg_req; if (tinfo->current.period != tinfo->goal.period || tinfo->current.width != tinfo->goal.width + || tinfo->current.offset != tinfo->goal.offset || (force && (tinfo->goal.period != 0 || tinfo->goal.width != MSG_EXT_WDTR_BUS_8_BIT))) @@ -4480,7 +4481,8 @@ ahc_action(struct cam_sim *sim, union ccb *ccb) cts->bus_width, update_type); } - if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) { + if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) + || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) { struct ahc_syncrate *syncrate; u_int maxsync; @@ -4498,6 +4500,13 @@ ahc_action(struct cam_sim *sim, union ccb *ccb) 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; + } + syncrate = ahc_find_syncrate(ahc, &cts->sync_period, maxsync); ahc_validate_offset(ahc, syncrate, &cts->sync_offset, @@ -4645,6 +4654,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb) cpi->hba_misc |= PIM_NOBUSRESET; } cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c index 343ad91..23de96c 100644 --- a/sys/dev/buslogic/bt.c +++ b/sys/dev/buslogic/bt.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bt.c,v 1.18 1999/04/23 23:28:19 gibbs Exp $ + * $Id: bt.c,v 1.19 1999/05/05 06:45:09 imp Exp $ */ /* @@ -1250,7 +1250,7 @@ btaction(struct cam_sim *sim, union ccb *ccb) case XPT_SET_TRAN_SETTINGS: { /* XXX Implement */ - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_PROVIDE_FAIL; xpt_done(ccb); break; } @@ -1354,6 +1354,7 @@ btaction(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = 7; cpi->initiator_id = bt->scsi_id; cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "BusLogic", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c index 47c12a5..d3143df 100644 --- a/sys/dev/dpt/dpt_scsi.c +++ b/sys/dev/dpt/dpt_scsi.c @@ -43,7 +43,7 @@ * arrays that span controllers (Wow!). */ -#ident "$Id: dpt_scsi.c,v 1.21 1998/12/22 00:52:27 eivind Exp $" +#ident "$Id: dpt_scsi.c,v 1.22 1998/12/22 20:21:12 eivind Exp $" #define _DPT_C_ @@ -974,6 +974,7 @@ dpt_action(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = dpt->max_lun; cpi->initiator_id = dpt->hostid[cam_sim_bus(sim)]; cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "DPT", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index 2c42f81..edeb582 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -1,4 +1,4 @@ -/* $Id: isp_freebsd.c,v 1.15 1999/04/04 01:35:03 mjacob Exp $ */ +/* $Id: isp_freebsd.c,v 1.16 1999/04/04 02:22:42 mjacob Exp $ */ /* release_4_3_99 */ /* * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. @@ -83,15 +83,6 @@ isp_attach(struct ispsoftc *isp) csa.callback_arg = isp->isp_sim; xpt_action((union ccb *)&csa); - /* - * Set base transfer capabilities for Fibre Channel. - * Technically not correct because we don't know - * what media we're running on top of- but we'll - * look good if we always say 100MB/s. - */ - if (isp->isp_type & ISP_HA_FC) { - isp->isp_sim->base_transfer_speed = 100000; - } if (isp->isp_state == ISP_INITSTATE) isp->isp_state = ISP_RUNSTATE; } @@ -524,6 +515,13 @@ isp_action(struct cam_sim *sim, union ccb *ccb) #else cpi->max_lun = (1 << 4) - 1; #endif + /* + * Set base transfer capabilities for Fibre Channel. + * Technically not correct because we don't know + * what media we're running on top of- but we'll + * look good if we always say 100MB/s. + */ + cpi->base_transfer_speed = 100000; } else { cpi->hba_misc = 0; cpi->initiator_id = @@ -542,6 +540,7 @@ isp_action(struct cam_sim *sim, union ccb *ccb) } else { cpi->max_lun = (1 << 3) - 1; } + cpi->base_transfer_speed = 3300; } cpi->bus_id = cam_sim_bus(sim); diff --git a/sys/dev/ppbus/vpo.c b/sys/dev/ppbus/vpo.c index 17b67c5..046d575 100644 --- a/sys/dev/ppbus/vpo.c +++ b/sys/dev/ppbus/vpo.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: vpo.c,v 1.10 1999/01/09 18:05:46 nsouch Exp $ + * $Id: vpo.c,v 1.11 1999/01/10 12:04:55 nsouch Exp $ * */ @@ -421,6 +421,7 @@ vpo_action(struct cam_sim *sim, union ccb *ccb) cpi->max_lun = 0; cpi->initiator_id = VP0_INITIATOR; cpi->bus_id = sim->bus_id; + cpi->base_transfer_speed = 3300; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "Iomega", HBA_IDLEN); strncpy(cpi->dev_name, sim->sim_name, DEV_IDLEN); |