On Tuesday 28 September 2004 19:08, David Woodhouse wrote:
> On Tue, 2004-09-28 at 19:05 +0200, Duncan Sands wrote:
> > > It appears to confirm my belief that the userspace program is doing
> > > _precisely_ what both Duncan's and my kernel versions do.... nothing but
> > > the bulk transfer. I've already triple-checked the endpoints and the
> > > data. We show a CRC on the data and print the length. I've even done a
> > > hex dump of the start and end of the data in my paranoia.
> > 
> > Doesn't the user-space program do a usb_set_configuration?  (It used to).
> > Maybe that resets the device.
> > 
> > Just a passing thought,
> 
>   /*
>     pusb_set_configuration() triggers hotplug. All previous interfaces
>     are removed and all new interfaces are added. In our example, it
>     makes 6 calls to usb.agent (tested on 2.6.5).
> 
>     Both in 2.4 and 2.6 kernels, there is an initial call to
>     pusb_set_interface() to set the default interface before calling
>     hotplug. So, all call to pusb_set_interface() are useless since
>     there is only one interface.
>   */
> #if 0
>       if (pusb_set_configuration(fdusb, 1) < 0) {
>               report(0, REPORT_ERROR, "pusb_set_configuration 1");
>               return(-1);
>       }
> #endif        
> 
> I believe that comment is true even with 
> s/calling hotplug/calling the udsl_usb_probe() routine/

proc_setconfig (devio.c):

...
        /* SET_CONFIGURATION is often abused as a "cheap" driver reset,
         * so avoid usb_set_configuration()'s kick to sysfs
         */
        if (status == 0) {
                if (actconfig && actconfig->desc.bConfigurationValue == u)
                        status = usb_reset_configuration(ps->dev);
                else
                        status = usb_set_configuration(ps->dev, u);
        }
...

/**
 * usb_reset_configuration - lightweight device reset
 * @dev: the device whose configuration is being reset
 *
 * This issues a standard SET_CONFIGURATION request to the device using
 * the current configuration.  The effect is to reset most USB-related
 * state in the device, including interface altsettings (reset to zero),
 * endpoint halts (cleared), and data toggle (only for bulk and interrupt
 * endpoints).  Other usbcore state is unchanged, including bindings of
 * usb device drivers to interfaces.
 *
 * Because this affects multiple interfaces, avoid using this with composite
 * (multi-interface) devices.  Instead, the driver for each interface may
 * use usb_set_interface() on the interfaces it claims.  Resetting the whole
 * configuration would affect other drivers' interfaces.
 *
 * The caller must own the device lock.
 *
 * Returns zero on success, else a negative error code.
 */


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to