speedtch cxacru.c, 1.36, 1.37 speedtch.c, 1.68, 1.69 usbatm.c, 1.53,
1.54 usbatm.h, 1.25, 1.26 xusbatm.c, 1.14, 1.15
Duncan Sands
duncan at infradead.org
Fri Nov 18 05:35:09 EST 2005
Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv21362
Modified Files:
cxacru.c speedtch.c usbatm.c usbatm.h xusbatm.c
Log Message:
In the bind method, change use_isoc into a general flags parameter.
Index: cxacru.c
===================================================================
RCS file: /home/cvs/speedtch/cxacru.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- cxacru.c 26 Sep 2005 20:19:40 -0000 1.36
+++ cxacru.c 18 Nov 2005 10:35:04 -0000 1.37
@@ -667,7 +667,7 @@
static int cxacru_bind(struct usbatm_data *usbatm_instance,
struct usb_interface *intf, const struct usb_device_id *id,
- int *need_heavy_init, int *use_isoc)
+ int *need_heavy_init, int *flags)
{
struct cxacru_data *instance;
struct usb_device *usb_dev = interface_to_usbdev(intf);
Index: speedtch.c
===================================================================
RCS file: /home/cvs/speedtch/speedtch.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- speedtch.c 3 Nov 2005 17:40:05 -0000 1.68
+++ speedtch.c 18 Nov 2005 10:35:04 -0000 1.69
@@ -698,7 +698,7 @@
static int speedtch_bind(struct usbatm_data *usbatm,
struct usb_interface *intf,
const struct usb_device_id *id,
- int *need_heavy_init, int *use_isoc)
+ int *need_heavy_init, int *flags)
{
struct usb_device *usb_dev = interface_to_usbdev(intf);
struct usb_interface *cur_intf, *data_intf;
@@ -706,6 +706,7 @@
int ifnum = intf->altsetting->desc.bInterfaceNumber;
int num_interfaces = usb_dev->actconfig->desc.bNumInterfaces;
int i, ret;
+ int use_isoc;
usb_dbg(usbatm, "%s entered\n", __func__);
@@ -749,7 +750,7 @@
/* altsetting and enable_isoc may change at any moment, so take a snapshot */
instance->altsetting = altsetting;
- *use_isoc = enable_isoc;
+ use_isoc = enable_isoc;
if (instance->altsetting)
if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, instance->altsetting)) < 0) {
@@ -757,41 +758,43 @@
instance->altsetting = 0; /* fall back to default */
}
- if (!instance->altsetting && *use_isoc)
+ if (!instance->altsetting && use_isoc)
if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, DEFAULT_ISOC_ALTSETTING)) < 0) {
usb_dbg(usbatm, "%s: usb_set_interface %d failed (%d)!\n", __func__, DEFAULT_ISOC_ALTSETTING, ret);
- *use_isoc = 0; /* fall back to bulk */
+ use_isoc = 0; /* fall back to bulk */
}
- if (*use_isoc) {
+ if (use_isoc) {
const struct usb_host_interface *desc = data_intf->cur_altsetting;
const __u8 target_address = USB_DIR_IN | usbatm->driver->isoc_in;
int i;
- *use_isoc = 0; /* fall back to bulk if endpoint not found */
+ use_isoc = 0; /* fall back to bulk if endpoint not found */
for (i=0; i<desc->desc.bNumEndpoints; i++) {
const struct usb_endpoint_descriptor *endpoint_desc = &desc->endpoint[i].desc;
if ((endpoint_desc->bEndpointAddress == target_address)) {
- *use_isoc = (endpoint_desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+ use_isoc = (endpoint_desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_ISOC;
break;
}
}
- if (!*use_isoc)
+ if (!use_isoc)
usb_info(usbatm, "isochronous transfer not supported - using bulk\n");
}
- if (!*use_isoc && !instance->altsetting)
+ if (!use_isoc && !instance->altsetting)
if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, DEFAULT_BULK_ALTSETTING)) < 0) {
usb_err(usbatm, "%s: setting interface to %d failed (%d)!\n", __func__, DEFAULT_BULK_ALTSETTING, ret);
goto fail_free;
}
if (!instance->altsetting)
- instance->altsetting = *use_isoc ? DEFAULT_ISOC_ALTSETTING : DEFAULT_BULK_ALTSETTING;
+ instance->altsetting = use_isoc ? DEFAULT_ISOC_ALTSETTING : DEFAULT_BULK_ALTSETTING;
+
+ *flags = use_isoc ? USBATM_USE_ISOC : 0;
INIT_WORK(&instance->status_checker, (void *)speedtch_check_status, instance);
Index: usbatm.c
===================================================================
RCS file: /home/cvs/speedtch/usbatm.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- usbatm.c 18 Nov 2005 10:11:33 -0000 1.53
+++ usbatm.c 18 Nov 2005 10:35:04 -0000 1.54
@@ -1050,7 +1050,7 @@
char *buf;
int error = -ENOMEM;
int i, length;
- int need_heavy, use_isoc;
+ int need_heavy, flags;
dev_dbg(dev, "%s: trying driver %s with vendor=0x%x, product=0x%x, ifnum %d\n",
__func__, driver->driver_name,
@@ -1096,8 +1096,8 @@
bind:
need_heavy = 1;
- use_isoc = 0;
- if (driver->bind && (error = driver->bind(instance, intf, id, &need_heavy, &use_isoc)) < 0) {
+ flags = 0;
+ if (driver->bind && (error = driver->bind(instance, intf, id, &need_heavy, &flags)) < 0) {
dev_err(dev, "%s: bind failed: %d!\n", __func__, error);
goto fail_free;
}
@@ -1124,7 +1124,7 @@
instance->tx_channel.buf_size = snd_buf_size;
instance->rx_channel.usbatm = instance->tx_channel.usbatm = instance;
- if (use_isoc && driver->isoc_in)
+ if ((flags & USBATM_USE_ISOC) && driver->isoc_in)
instance->rx_channel.endpoint = usb_rcvisocpipe(usb_dev, driver->isoc_in);
else
instance->rx_channel.endpoint = usb_rcvbulkpipe(usb_dev, driver->bulk_in);
Index: usbatm.h
===================================================================
RCS file: /home/cvs/speedtch/usbatm.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- usbatm.h 18 Nov 2005 10:11:33 -0000 1.25
+++ usbatm.h 18 Nov 2005 10:35:04 -0000 1.26
@@ -90,6 +90,11 @@
#endif
+/* bind flags */
+
+#define USBATM_USE_ISOC (1<<0)
+
+
/* mini driver */
struct usbatm_data;
@@ -110,7 +115,7 @@
* method can avoid having it called by setting need_heavy_init to zero.
*/
int (*bind) (struct usbatm_data *, struct usb_interface *,
- const struct usb_device_id *id, int *need_heavy_init, int *use_isoc);
+ const struct usb_device_id *id, int *need_heavy_init, int *flags);
/* additional device initialization that is too slow to be done in probe() */
int (*heavy_init) (struct usbatm_data *, struct usb_interface *);
Index: xusbatm.c
===================================================================
RCS file: /home/cvs/speedtch/xusbatm.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- xusbatm.c 26 Sep 2005 20:19:41 -0000 1.14
+++ xusbatm.c 18 Nov 2005 10:35:04 -0000 1.15
@@ -63,7 +63,7 @@
static int xusbatm_bind(struct usbatm_data *usbatm_instance,
struct usb_interface *intf, const struct usb_device_id *id,
- int *need_heavy_init, int *use_isoc)
+ int *need_heavy_init, int *flags)
{
struct usb_device *usb_dev = interface_to_usbdev(intf);
int drv_ix = id - xusbatm_usb_ids;
More information about the Usbatm-commits
mailing list