speedtch usbatm.c,1.26,1.27

matthieu castet castet.matthieu at free.fr
Tue May 17 17:26:34 EDT 2005


Roman Kagan wrote:
> On Sun, May 15, 2005 at 10:37:39PM +0200, matthieu castet wrote:
> 
> IMHO this is making simple thing complex...  Simply setting
> instance->rx_channel.endpoint to the right pipe in .bind() is easier and
> more concise.
> 
> BTW how are you going to change it in driver's .bind() in your patch?
> It seems to exclude the possibility for the driver to decide at run time
> which transfer type it likes better, and this sounds like a bad idea.
by overwriting subdriver.use_iso in .bind or usb_probe [1]

This is ok as we can't be in 2 differents usb_probe (so usbatm.bind) at
same time.

Cheers

Matthieu

[1]
static struct usbatm_driver euatm_drv = {
         .driver_name = "ueagle-atm",
         .owner = THIS_MODULE,
         .bind = eu_bind,
         .atm_start = eu_atm_open,
         .unbind = eu_unbind,
         .atm_stop = eu_atm_stop,
         .heavy_init = eu_heavy,
         .in = EP_BULK_DATA_OUT,.out = EP_BULK_DATA_OUT,
};

static int eu_probe(struct usb_interface *intf, const struct
usb_device_id *id)
{
[...]
		if (usb_set_interface(usb, USB_INTF_IN, 1) < 0) {
                         eu_err("usb_set_interface failed on iso alt 8\n");
                 }
                 else {
                         euatm_drv.in = EP_ISOC_DATA_IN;
                         euatm_drv.use_iso = 1;
                         eu_report("iso mode\n");
                 }

[...]

The same thing could be done in .bind as usbatm use .in and .use_iso
after .bind().




More information about the Usbatm mailing list