summaryrefslogtreecommitdiffstats
path: root/sys/pci/ncr.c
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>1999-05-06 20:16:39 +0000
committerken <ken@FreeBSD.org>1999-05-06 20:16:39 +0000
commit2bb789d7a3f2adcda33230cdaeda95918cf54a8d (patch)
tree73c8cd7f798e8bccec0dbcf97e5d0e4447a4ec4e /sys/pci/ncr.c
parentf57a01ebfcda8effff50ce6f1c90b572e76d8cd2 (diff)
downloadFreeBSD-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/pci/ncr.c')
-rw-r--r--sys/pci/ncr.c62
1 files changed, 40 insertions, 22 deletions
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index a32e14a..38dd843 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncr.c,v 1.142 1999/01/27 23:45:43 dillon Exp $
+** $Id: ncr.c,v 1.143 1999/04/24 20:14:02 peter Exp $
**
** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family.
**
@@ -1361,7 +1361,7 @@ static void ncr_attach (pcici_t tag, int unit);
#if !defined(lint)
static const char ident[] =
- "\n$Id: ncr.c,v 1.142 1999/01/27 23:45:43 dillon Exp $\n";
+ "\n$Id: ncr.c,v 1.143 1999/04/24 20:14:02 peter Exp $\n";
#endif
static const u_long ncr_version = NCR_VERSION * 11
@@ -4022,8 +4022,10 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
!= tp->tinfo.goal.width) {
tp->nego_cp = cp;
nego = NS_WIDE;
- } else if (tp->tinfo.current.period
- != tp->tinfo.goal.period) {
+ } else if ((tp->tinfo.current.period
+ != tp->tinfo.goal.period)
+ || (tp->tinfo.current.offset
+ != tp->tinfo.goal.offset)) {
tp->nego_cp = cp;
nego = NS_SYNC;
};
@@ -4327,10 +4329,13 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
cts->bus_width = np->maxwide;
}
- if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
- if (cts->sync_period != 0
- && (cts->sync_period < np->minsync))
- cts->sync_period = np->minsync;
+ if (((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
+ || ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)) {
+ if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0) {
+ if (cts->sync_period != 0
+ && (cts->sync_period < np->minsync))
+ cts->sync_period = np->minsync;
+ }
if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0) {
if (cts->sync_offset == 0)
cts->sync_period = 0;
@@ -4339,14 +4344,22 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
}
}
if ((update_type & NCR_TRANS_USER) != 0) {
- tp->tinfo.user.period = cts->sync_period;
- tp->tinfo.user.offset = cts->sync_offset;
- tp->tinfo.user.width = cts->bus_width;
+ if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
+ tp->tinfo.user.period = cts->sync_period;
+ if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
+ tp->tinfo.user.offset = cts->sync_offset;
+ if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
+ tp->tinfo.user.width = cts->bus_width;
}
if ((update_type & NCR_TRANS_GOAL) != 0) {
- tp->tinfo.goal.period = cts->sync_period;
- tp->tinfo.goal.offset = cts->sync_offset;
- tp->tinfo.goal.width = cts->bus_width;
+ if ((cts->valid & CCB_TRANS_SYNC_RATE_VALID) != 0)
+ tp->tinfo.goal.period = cts->sync_period;
+
+ if ((cts->valid & CCB_TRANS_SYNC_OFFSET_VALID) != 0)
+ tp->tinfo.goal.offset = cts->sync_offset;
+
+ if ((cts->valid & CCB_TRANS_BUS_WIDTH_VALID) != 0)
+ tp->tinfo.goal.width = cts->bus_width;
}
splx(s);
ccb->ccb_h.status = CAM_REQ_CMP;
@@ -4368,21 +4381,25 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
if ((cts->flags & CCB_TRANS_CURRENT_SETTINGS) != 0) {
tinfo = &tp->tinfo.current;
if (tp->tinfo.disc_tag & NCR_CUR_DISCENB)
- cts->flags = CCB_TRANS_DISC_ENB;
+ cts->flags |= CCB_TRANS_DISC_ENB;
else
- cts->flags = 0;
+ cts->flags &= ~CCB_TRANS_DISC_ENB;
if (tp->tinfo.disc_tag & NCR_CUR_TAGENB)
cts->flags |= CCB_TRANS_TAG_ENB;
+ else
+ cts->flags &= ~CCB_TRANS_TAG_ENB;
} else {
tinfo = &tp->tinfo.user;
if (tp->tinfo.disc_tag & NCR_USR_DISCENB)
- cts->flags = CCB_TRANS_DISC_ENB;
+ cts->flags |= CCB_TRANS_DISC_ENB;
else
- cts->flags = 0;
+ cts->flags &= ~CCB_TRANS_DISC_ENB;
if (tp->tinfo.disc_tag & NCR_USR_TAGENB)
cts->flags |= CCB_TRANS_TAG_ENB;
+ else
+ cts->flags &= ~CCB_TRANS_TAG_ENB;
}
cts->sync_period = tinfo->period;
@@ -4458,6 +4475,7 @@ ncr_action (struct cam_sim *sim, union ccb *ccb)
cpi->max_lun = MAX_LUN - 1;
cpi->initiator_id = np->myaddr;
cpi->bus_id = cam_sim_bus(sim);
+ cpi->base_transfer_speed = 3300;
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strncpy(cpi->hba_vid, "Symbios", HBA_IDLEN);
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
@@ -4785,8 +4803,8 @@ ncr_freeze_devq (ncb_p np, struct cam_path *path)
**==========================================================
*/
-void ncr_init
-(ncb_p np, char * msg, u_long code)
+void
+ncr_init(ncb_p np, char * msg, u_long code)
{
int i;
@@ -7074,8 +7092,8 @@ static void ncr_getclock (ncb_p np, u_char multiplier)
stest1 = INB(nc_stest1);
np->multiplier = 1;
- /* always false, except for 875 with clock doubler selected */
- if ((stest1 & (DBLEN+DBLSEL)) == DBLEN+DBLSEL) {
+
+ if (multiplier > 1) {
np->multiplier = multiplier;
np->clock_khz = 40000 * multiplier;
} else {
OpenPOWER on IntegriCloud