Re: [RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-12 Thread Greg KH
On Mon, Mar 11, 2013 at 11:28:38PM +0100, Bjørn Mork wrote: > Greg KH writes: > > > >> Currently, when a userspace application sees a /dev/cdc-wdmX device, it > >> will have to > >> - check which USB interface it belongs to, > >> - parse the DMM descriptor if it is CDC WDM, > >> - parse the MBIM

Re: [RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-12 Thread Oliver Neukum
On Monday 11 March 2013 14:10:49 Greg KH wrote: > On Mon, Mar 11, 2013 at 10:00:21PM +0100, Bjørn Mork wrote: > > Userspace applications need to know the maximum supported message > > size. > > Can't they get that from sysfs from the USB field that defines this? 1. We do not have a common sysfs l

Re: [RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-11 Thread Bjørn Mork
Greg KH writes: > >> Currently, when a userspace application sees a /dev/cdc-wdmX device, it >> will have to >> - check which USB interface it belongs to, >> - parse the DMM descriptor if it is CDC WDM, >> - parse the MBIM descriptor if it is CDC MBIM >> - check if the driver is qmi_wwan if none

Re: [RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-11 Thread Greg KH
On Mon, Mar 11, 2013 at 10:28:21PM +0100, Bjørn Mork wrote: > Greg KH writes: > > > On Mon, Mar 11, 2013 at 10:00:21PM +0100, Bjørn Mork wrote: > >> Userspace applications need to know the maximum supported message > >> size. > > > > Can't they get that from sysfs from the USB field that defines

Re: [RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-11 Thread Bjørn Mork
Greg KH writes: > On Mon, Mar 11, 2013 at 10:00:21PM +0100, Bjørn Mork wrote: >> Userspace applications need to know the maximum supported message >> size. > > Can't they get that from sysfs from the USB field that defines this? Not at the moment since we don't export it. But that is of course

Re: [RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-11 Thread Greg KH
On Mon, Mar 11, 2013 at 10:00:21PM +0100, Bjørn Mork wrote: > Userspace applications need to know the maximum supported message > size. Can't they get that from sysfs from the USB field that defines this? Adding a new ioctl is usually not a good idea, who is going to change the userspace tools to

[RFC] USB: cdc-wdm: implement IOCTL_WDM_MAX_COMMAND

2013-03-11 Thread Bjørn Mork
Userspace applications need to know the maximum supported message size. Using a character device as interface to USB control messages hides the fact that these messages have a strict size limit. The userspace application must in most cases still be aware of this limit. It must allocate sufficient