aboutsummaryrefslogtreecommitdiff
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authorKenneth D. Merry <ken@FreeBSD.org>1999-09-27 06:12:57 +0000
committerKenneth D. Merry <ken@FreeBSD.org>1999-09-27 06:12:57 +0000
commit248e49ae05e326b3000f7b3379faa6bd4417e895 (patch)
tree44e582c5039a92ddf548ceda6a4147de0914ecfb /sbin/camcontrol
parentfc821b32644661c53ea99a314f0872e7bb922f75 (diff)
downloadsrc-248e49ae05e326b3000f7b3379faa6bd4417e895.tar.gz
src-248e49ae05e326b3000f7b3379faa6bd4417e895.zip
Fix two rather embarrassing bugs in camcontrol. The first caused the
CAM_PASS_ERR_RECOVER flag to be set unconditionally on READ DEFECTS commands, and also caused the CAM_DIR_IN flag to not be set. This was the cause of all of the "camcontrol defects doesn't work with my NCR controller" bugs. The second prevented camcontrol negotiate from negotiating any bus width other than 8 bits. Submitted by: groudier@club-internet.fr (Gerard Roudier)
Notes
Notes: svn path=/head/; revision=51723
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/camcontrol.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index b6f9e6770b44..7eb0e65dca4d 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -1151,8 +1151,8 @@ readdefects(struct cam_device *device, int argc, char **argv,
cam_fill_csio(&ccb->csio,
/*retries*/ retry_count,
/*cbfcnp*/ NULL,
- /*flags*/ CAM_DIR_IN | (arglist & CAM_ARG_ERR_RECOVER) ?
- CAM_PASS_ERR_RECOVER : 0,
+ /*flags*/ CAM_DIR_IN | ((arglist & CAM_ARG_ERR_RECOVER) ?
+ CAM_PASS_ERR_RECOVER : 0),
/*tag_action*/ MSG_SIMPLE_Q_TAG,
/*data_ptr*/ defect_list,
/*dxfer_len*/ dlist_length,
@@ -2529,7 +2529,9 @@ ratecontrol(struct cam_device *device, int retry_count, int timeout,
warnx("HBA does not support 32 bit bus width");
retval = 1;
goto ratecontrol_bailout;
- } else if (bus_width != 8) {
+ } else if ((bus_width != 8)
+ && (bus_width != 16)
+ && (bus_width != 32)) {
warnx("Invalid bus width %d", bus_width);
retval = 1;
goto ratecontrol_bailout;