Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-03 Thread Pete Batard
On 2012.09.03 03:51, Alan Stern wrote: > It's kind of a shame that Windows goes to such lengths > to provide the illusion of a continuous data stream instead of the > packetized stream that USB actually uses -- this just causes more > complications in the end. But aren't we trying to do the same,

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-03 Thread Xiaofan Chen
On Mon, Sep 3, 2012 at 10:51 AM, Alan Stern wrote: > On Sun, 2 Sep 2012, Orin Eman wrote: > >> > it has a limitation on transfer size. Do you know what a typical value >> > for MAXIMUM_TRANSFER_SIZE is? >> > >> I don't, but comments on the OSR ntdev forum indicate in the order of MB >> for high s

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-02 Thread Alan Stern
On Sun, 2 Sep 2012, Orin Eman wrote: > > it has a limitation on transfer size. Do you know what a typical value > > for MAXIMUM_TRANSFER_SIZE is? > > > > > I don't, but comments on the OSR ntdev forum indicate in the order of MB > for high speed devices, hundreds of KB for low and full speed de

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-02 Thread Xiaofan Chen
On Mon, Sep 3, 2012 at 5:15 AM, Alan Stern wrote: > On Sun, 2 Sep 2012, Orin Eman wrote: > >> Not quite. Without allow partial reads, if your buffer length isn't a >> multiple of the maximum packet size for the endpoint and the device returns >> more than your buffer length, you can lose data. W

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-02 Thread Orin Eman
On Sun, Sep 2, 2012 at 2:15 PM, Alan Stern wrote: > On Sun, 2 Sep 2012, Orin Eman wrote: > > > > Then as said that is a pretty useless feature, since apps can already > > > find out as much by comparing the amount actually read versus the > amount > > > they requested... > > > > > > > > > Not quit

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-02 Thread Alan Stern
On Sun, 2 Sep 2012, Orin Eman wrote: > > Then as said that is a pretty useless feature, since apps can already > > find out as much by comparing the amount actually read versus the amount > > they requested... > > > > > Not quite. Without allow partial reads, if your buffer length isn't a > mul

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-02 Thread Orin Eman
On Sun, Sep 2, 2012 at 7:15 AM, Hans de Goede wrote: > Hi, > > On 09/02/2012 03:47 AM, Pete Batard wrote: > >> On 2012.08.31 20:40, Hans de Goede wrote: > >>> This assumes that the winusb flag causes the ep to halt when the short > >>> read is encountered > > > > Couldn't see much in NetMon, but

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-02 Thread Hans de Goede
Hi, On 09/02/2012 03:47 AM, Pete Batard wrote: >> On 2012.08.31 20:40, Hans de Goede wrote: >>> This assumes that the winusb flag causes the ep to halt when the short >>> read is encountered > > Couldn't see much in NetMon, but it looks like even after WinUSB returns > a short read error, and if I

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-09-01 Thread Pete Batard
> On 2012.08.31 20:40, Hans de Goede wrote: >> This assumes that the winusb flag causes the ep to halt when the short >> read is encountered Couldn't see much in NetMon, but it looks like even after WinUSB returns a short read error, and if I let xusb sleep for a while, I can still query more da

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-08-31 Thread Yves Arrouye
Let me add a vote for properties such as location IDs as identified by the OS. I can se how a general mechanism to retrieve properties would be good. I actually think it would be fine to rely on the OS headers for properties names if possible. After all if you are looking for an OS specific proper

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-08-31 Thread Pete Batard
On 2012.08.31 20:40, Hans de Goede wrote: > The reason I'm still responding is that if I've understood correctly, > the thing sparking this discussion is a property of winusb to treat > short packet reads as errors. Yup. That and #20 for Linux and Windows (report OS driver name [1]), prompted by

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-08-31 Thread Hans de Goede
Hi, I'm afraid I'm too busy with other stuff to comment on this atm, luckily we have a lot of other other capable contributors so I'll let those evaluate this :) The reason I'm still responding is that if I've understood correctly, the thing sparking this discussion is a property of winusb to tre

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-08-31 Thread Pete Batard
On 2012.08.31 15:42, Ludovic Rousseau wrote: > If I understand correctly you want to provide functions/services > specific to an OS. The same function would not be available for > another OS. Am I right? Yeah, though in this instance I'm thinking more about properties/attribute than function call

Re: [Libusbx-devel] RFC: libusbx OS specific API calls

2012-08-31 Thread Ludovic Rousseau
Hello, 2012/8/31 Pete Batard : > OK, let's try to strike the iron while it's hot, and get an idea of how > we could implement these platform/OS specific calls. And since I'm > interested in finding out if there exists a best approach for these kind > of implementations, I'm gonna use a fairly conc

[Libusbx-devel] RFC: libusbx OS specific API calls

2012-08-30 Thread Pete Batard
OK, let's try to strike the iron while it's hot, and get an idea of how we could implement these platform/OS specific calls. And since I'm interested in finding out if there exists a best approach for these kind of implementations, I'm gonna use a fairly concrete example of what we may want to