diff options
author | ken <ken@FreeBSD.org> | 1999-05-06 20:16:39 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 1999-05-06 20:16:39 +0000 |
commit | 2bb789d7a3f2adcda33230cdaeda95918cf54a8d (patch) | |
tree | 73c8cd7f798e8bccec0dbcf97e5d0e4447a4ec4e /sys/dev/advansys | |
parent | f57a01ebfcda8effff50ce6f1c90b572e76d8cd2 (diff) | |
download | FreeBSD-src-2bb789d7a3f2adcda33230cdaeda95918cf54a8d.zip FreeBSD-src-2bb789d7a3f2adcda33230cdaeda95918cf54a8d.tar.gz |
Add a number of interrelated CAM feature enhancements and bug fixes.
NOTE: These changes will require recompilation of any userland
applications, like cdrecord, xmcd, etc., that use the CAM passthrough
interface. A make world is recommended.
camcontrol.[c8]:
- We now support two new commands, "tags" and "negotiate".
- The tags commands allows users to view the number of tagged
openings for a device as well as a number of other related
parameters, and it allows users to set tagged openings for
a device.
- The negotiate command allows users to enable and disable
disconnection and tagged queueing, set sync rates, offsets
and bus width. Note that not all of those features are
available for all controllers. Only the adv, ahc, and ncr
drivers fully support all of the features at this point.
Some cards do not allow the setting of sync rates, offsets and
the like, and some of the drivers don't have any facilities to
do so. Some drivers, like the adw driver, only support enabling
or disabling sync negotiation, but do not support setting sync
rates.
- new description in the camcontrol man page of how to format a disk
- cleanup of the camcontrol inquiry command
- add support in the 'devlist' command for skipping unconfigured devices if
-v was not specified on the command line.
- make use of the new base_transfer_speed in the path inquiry CCB.
- fix CCB bzero cases
cam_xpt.c, cam_sim.[ch], cam_ccb.h:
- new flags on many CCB function codes to designate whether they're
non-immediate, use a user-supplied CCB, and can only be passed from
userland programs via the xpt device. Use these flags in the transport
layer and pass driver to categorize CCBs.
- new flag in the transport layer device matching code for device nodes
that indicates whether a device is unconfigured
- bump the CAM version from 0x10 to 0x11
- Change the CAM ioctls to use the version as their group code, so we can
force users to recompile code even when the CCB size doesn't change.
- add + fill in a new value in the path inquiry CCB, base_transfer_speed.
Remove a corresponding field from the cam_sim structure, and add code to
every SIM to set this field to the proper value.
- Fix the set transfer settings code in the transport layer.
scsi_cd.c:
- make some variables volatile instead of just casting them in various
places
- fix a race condition in the changer code
- attach unless we get a "logical unit not supported" error. This should
fix all of the cases where people have devices that return weird errors
when they don't have media in the drive.
scsi_da.c:
- attach unless we get a "logical unit not supported" error
scsi_pass.c:
- for immediate CCBs, just malloc a CCB to send the user request in. This
gets rid of the 'held' count problem in camcontrol tags.
scsi_pass.h:
- change the CAM ioctls to use the CAM version as their group code.
adv driver:
- Allow changing the sync rate and offset separately.
adw driver
- Allow changing the sync rate and offset separately.
aha driver:
- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.
ahc driver:
- Allow setting offset and sync rate separately
bt driver:
- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.
NCR driver:
- Fix the ultra/ultra 2 negotiation bug
- allow setting both the sync rate and offset separately
Other HBA drivers:
- Put code in to set the base_transfer_speed field for
XPT_GET_TRAN_SETTINGS CCBs.
Reviewed by: gibbs, mjacob (isp), imp (aha)
Diffstat (limited to 'sys/dev/advansys')
-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 |
3 files changed, 57 insertions, 19 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); |