|
From: Dan E. <dan...@ne...> - 2007-06-27 09:38:55
|
Krakora, Robert V wrote: > > You had select_configuration() commented out in pnp.c and if I > uncommented it as it was previously coded with 65536 as the maximum > transfer size, then none of my USB devices would function. With 65535 > as the maximum transfer size, my USB devices function properly. USB > devices being the mouse, keyboard, etc...this is on Windows XP SP2 > running on a Dell Precision M65. > It's not necessarily a good idea to call set_configuration automatically in pnp, since it should really be under control of the application, and it can fail if there is insufficient power. The application should choose which configuration to set (and be aware of what to do if there isn't enough power). Also if the device has multiple interfaces, then you really don't want libusb to be setting the configuration since it should already be set. Linux does set the configuration automatically... I don't understand why you are worried about the maximum transfer size setting, from MS website: http://msdn2.microsoft.com/en-us/library/ms790478.aspx In Windows 2000 *USBD_CreateConfigurationRequestEx* <http://msdn2.microsoft.com/en-us/library/ms790505.aspx> initializes *Pipes[i].MaximumTransferSize* to the default maximum transfer size for a single URB read/write request. The client driver can specify a different maximum transfer size in the *Pipes[i].MaximumTransferSize*. The USB stack ignores this value in Windows XP, Windows Server 2003 and later operating system. So according to that it shouldn't make any difference what it's set to on XP. More assertively: http://msdn2.microsoft.com/en-us/library/ms790486.aspx Windows XP, Windows Server 2003 and Later Operating Systems In Windows XP, Windows Server 2003 and later operating system, the *MaximumTransferSize* member of the USBD_PIPE_INFORMATION <http://msdn2.microsoft.com/en-us/library/ms793357.aspx> structure is obsolete. The USB stack ignores the value in *MaximumTransferSize* for both composite and non-composite devices. To regulate the bandwidth used by their devices, client drivers must either change the Alt settings for an interface or restrict the maximum packet size by setting *MaximumPacketSize* to some value less than or equal to the value of of /wMaxPacketSize /defined in device firmware for the current Alt settings. . Dan Ellis. |