From: Aurelio <sk...@us...> - 2007-08-22 18:15:35
|
Update of /cvsroot/zyxel630-11/amedyn2/module In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24132 Modified Files: amedyn2.c Log Message: This modem don't support isochronous transfer. Index: amedyn2.c =================================================================== RCS file: /cvsroot/zyxel630-11/amedyn2/module/amedyn2.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** amedyn2.c 22 Aug 2007 17:10:29 -0000 1.20 --- amedyn2.c 22 Aug 2007 18:15:36 -0000 1.21 *************** *** 68,72 **** #define DEFAULT_BULK_ALTSETTING 1 - #define DEFAULT_ISOC_ALTSETTING 1 /* This modem don't have iso*/ static unsigned int altsetting = DEFAULT_BULK_ALTSETTING; --- 68,71 ---- *************** *** 689,693 **** int num_interfaces = usb_dev->actconfig->desc.bNumInterfaces; int i, ret; - int use_isoc; /* This modem don't have iso*/ usb_dbg(usbatm, "%s entered\n", __func__); --- 688,691 ---- *************** *** 731,737 **** instance->usbatm = usbatm; ! /* altsetting and enable_isoc may change at any moment, so take a snapshot */ instance->altsetting = altsetting; - use_isoc = 0; if (instance->altsetting) --- 729,734 ---- instance->usbatm = usbatm; ! /* altsetting may change at any moment, so take a snapshot */ instance->altsetting = altsetting; if (instance->altsetting) *************** *** 741,782 **** } ! if (!instance->altsetting && use_isoc) ! if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, DEFAULT_ISOC_ALTSETTING)) < 0) { ! usb_dbg(usbatm, "%s: setting interface to %2d failed (%d)!\n", __func__, DEFAULT_ISOC_ALTSETTING, ret); ! use_isoc = 0; /* fall back to bulk */ ! } ! ! 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 */ ! ! 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) == ! USB_ENDPOINT_XFER_ISOC; ! break; ! } ! } ! ! if (!use_isoc) ! usb_info(usbatm, "isochronous transfer not supported - using bulk\n"); ! } ! ! 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 %2d failed (%d)!\n", __func__, DEFAULT_BULK_ALTSETTING, ret); goto fail_free; } - if (!instance->altsetting) - instance->altsetting = use_isoc ? DEFAULT_ISOC_ALTSETTING : DEFAULT_BULK_ALTSETTING; - - usbatm->flags |= (use_isoc ? UDSL_USE_ISOC : 0); - INIT_DELAYED_WORK(&instance->status_checker, amedyn_check_status); --- 738,749 ---- } ! if (!instance->altsetting) { if ((ret = usb_set_interface(usb_dev, INTERFACE_DATA, DEFAULT_BULK_ALTSETTING)) < 0) { usb_err(usbatm, "%s: setting interface to %2d failed (%d)!\n", __func__, DEFAULT_BULK_ALTSETTING, ret); goto fail_free; + } + instance->altsetting = DEFAULT_BULK_ALTSETTING; } INIT_DELAYED_WORK(&instance->status_checker, amedyn_check_status); |