summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>2006-11-02 00:54:38 +0000
committerMatt Jacob <mjacob@FreeBSD.org>2006-11-02 00:54:38 +0000
commitbd3fd815a7fbc96f1506dfdcac840b94cff28d00 (patch)
tree9b84492a0966128feabcb74bbcc277bbdb6640c1 /lib
parentedc9f4ae99fa00b065cb47c1d0d0737686ab3dca (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libcam/camlib.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/libcam/camlib.c b/lib/libcam/camlib.c
index b2523719ed0a..e521ed366cf5 100644
--- a/lib/libcam/camlib.c
+++ b/lib/libcam/camlib.c
@@ -676,16 +676,24 @@ cam_real_open_device(const char *path, int flags, struct cam_device *device,
*/
ccb.ccb_h.func_code = XPT_GET_TRAN_SETTINGS;
- ccb.cts.flags = CCB_TRANS_CURRENT_SETTINGS;
+ ccb.cts.type = CTS_TYPE_CURRENT_SETTINGS;
if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) {
sprintf(cam_errbuf, "%s: Get Transfer Settings CCB failed\n"
"%s: %s", func_name, func_name, strerror(errno));
goto crod_bailout;
}
- device->sync_period = ccb.cts.sync_period;
- device->sync_offset = ccb.cts.sync_offset;
- device->bus_width = ccb.cts.bus_width;
+ if (ccb.cts.protocol == XPORT_SPI) {
+ struct ccb_trans_settings_spi *spi =
+ &ccb.cts.xport_specific.spi;
+ device->sync_period = spi->sync_period;
+ device->sync_offset = spi->sync_offset;
+ device->bus_width = spi->bus_width;
+ } else {
+ device->sync_period = 0;
+ device->sync_offset = 0;
+ device->bus_width = 0;
+ }
return(device);