From bd3fd815a7fbc96f1506dfdcac840b94cff28d00 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Thu, 2 Nov 2006 00:54:38 +0000 Subject: 2nd and final commit that moves us to CAM_NEW_TRAN_CODE as the default. Reviewed by multitudes. --- lib/libcam/camlib.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib/libcam') 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); -- cgit v1.3