diff options
| author | Matt Jacob <mjacob@FreeBSD.org> | 2006-11-02 00:54:38 +0000 |
|---|---|---|
| committer | Matt Jacob <mjacob@FreeBSD.org> | 2006-11-02 00:54:38 +0000 |
| commit | bd3fd815a7fbc96f1506dfdcac840b94cff28d00 (patch) | |
| tree | 9b84492a0966128feabcb74bbcc277bbdb6640c1 /lib/libcam | |
| parent | edc9f4ae99fa00b065cb47c1d0d0737686ab3dca (diff) | |
Notes
Diffstat (limited to 'lib/libcam')
| -rw-r--r-- | lib/libcam/camlib.c | 16 |
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); |
