summaryrefslogtreecommitdiffstats
path: root/lib/libcam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-11-02 00:54:38 +0000
committermjacob <mjacob@FreeBSD.org>2006-11-02 00:54:38 +0000
commit19b599de4af959c5287bac69d61c3810ae390dfe (patch)
tree9b84492a0966128feabcb74bbcc277bbdb6640c1 /lib/libcam
parente6e29e358bcae4e62ea9a2d72c5b2501c75a1850 (diff)
downloadFreeBSD-src-19b599de4af959c5287bac69d61c3810ae390dfe.zip
FreeBSD-src-19b599de4af959c5287bac69d61c3810ae390dfe.tar.gz
2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default. Reviewed by multitudes.
Diffstat (limited to 'lib/libcam')
-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 b252371..e521ed3 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);
OpenPOWER on IntegriCloud