Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-22 Thread Bjørn Mork
Oliver Neukum writes: > On Monday 21 January 2013 16:28:48 Bjørn Mork wrote: > >> Agreed. But I believe the condition should be >> >> if (!(info->flags & FLAG_SEND_ZLP) && !(info->flags & FLAG_MULTI_PACKET)) { >> .. >> } else { >> urb->transfer_flags |= URB_ZERO_PACKET; >> } >> >>

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-22 Thread Oliver Neukum
On Monday 21 January 2013 18:59:05 Alexey ORISHKO wrote: > > > Either the FLAG_MULTI_PACKET minidriver will have already padded the > > > buffer so that we do not hit (length % dev->maxpacket == 0), or we > > > should choose one of the alternatives: ZLP or padding. > > > > But we cannot simply ca

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-22 Thread Oliver Neukum
On Monday 21 January 2013 18:59:05 Alexey ORISHKO wrote: > Specification says: > NCM/MBIM shall not send ZLP if buffer size is dwNtbOutMaxSize. > > The problem is: > dwNtbOutMaxSize value is negotiated between host and device NCM/MBIM > entities and usbnet has no knowledge about it. > > Adding

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-22 Thread Oliver Neukum
On Monday 21 January 2013 16:28:48 Bjørn Mork wrote: > Agreed. But I believe the condition should be > > if (!(info->flags & FLAG_SEND_ZLP) && !(info->flags & FLAG_MULTI_PACKET)) { > .. > } else { > urb->transfer_flags |= URB_ZERO_PACKET; > } > > to ensure that we send the ZLP in

RE: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-21 Thread Alexey ORISHKO
> -Original Message- > From: Oliver Neukum [mailto:oneu...@suse.de] > On Monday 21 January 2013 15:47:13 Bjørn Mork wrote: > > But I wonder if this isn't really a generic problem in usbnet. The > > FLAG_MULTI_PACKET test here seems completely bogus: > > > > if (length % dev->maxpac

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-21 Thread Bjørn Mork
Oliver Neukum writes: > On Monday 21 January 2013 15:47:13 Bjørn Mork wrote: >> But I wonder if this isn't really a generic problem in usbnet. The >> FLAG_MULTI_PACKET test here seems completely bogus: >> >> if (length % dev->maxpacket == 0) { >> if (!(info->flags & FLAG_

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-21 Thread Oliver Neukum
On Monday 21 January 2013 15:47:13 Bjørn Mork wrote: > But I wonder if this isn't really a generic problem in usbnet. The > FLAG_MULTI_PACKET test here seems completely bogus: > > if (length % dev->maxpacket == 0) { > if (!(info->flags & FLAG_SEND_ZLP)) { >

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-21 Thread Bjørn Mork
Bjørn Mork writes: > I have another issue with the Sierra firmware which I hope you can help > me with: The MC7710 device requires at ZLP even if we send > dwNtbOutMaxSize sized NTBs. This is a problem because the current code > explicitly prevents this. If anyone found this more than normally c

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-21 Thread Bjørn Mork
Hello Alexey, I have another issue with the Sierra firmware which I hope you can help me with: The MC7710 device requires at ZLP even if we send dwNtbOutMaxSize sized NTBs. This is a problem because the current code explicitly prevents this. The following code in the v3.8 cdc-ncm was written to k

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-21 Thread Bjørn Mork
Alexey Orishko writes: > On Fri, Jan 18, 2013 at 10:17 PM, Bjørn Mork wrote: > Some Sierra Wireless firmwares support CDC MBIM but have no CDC Union funtional descriptor. This violates the MBIM specification, > > I don't believe Sierra Wireless violates MBIM specification. > See in the

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-19 Thread Alexey Orishko
On Fri, Jan 18, 2013 at 10:17 PM, Bjørn Mork wrote: >>> Some Sierra Wireless firmwares support CDC MBIM but have no CDC >>> Union funtional descriptor. This violates the MBIM specification, I don't believe Sierra Wireless violates MBIM specification. See in the specification: "there are two ways

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-19 Thread Bjørn Mork
>+ for (i = 0; i < USB_MAXIADS; i++) { >+ iad = udev->actconfig->intf_assoc[i]; >+ if (iad->bFirstInterface == mnum && iad->bInterfaceCount == 2) >+ return usb_ifnum_to_if(udev, mnum + 1); Ouch. This looks buggy. Please do not apply. I will sen

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-18 Thread Bjørn Mork
Oliver Neukum writes: > On Friday 18 January 2013 15:25:47 Bjørn Mork wrote: >> Adding support for the MBIM mode in some Sierra Wireless devices. >> >> Some Sierra Wireless firmwares support CDC MBIM but have no CDC >> Union funtional descriptor. This violates the MBIM specification, >> but we ca

Re: [PATCH net] net: cdc_ncm: workaround for missing CDC Union

2013-01-18 Thread Oliver Neukum
On Friday 18 January 2013 15:25:47 Bjørn Mork wrote: > Adding support for the MBIM mode in some Sierra Wireless devices. > > Some Sierra Wireless firmwares support CDC MBIM but have no CDC > Union funtional descriptor. This violates the MBIM specification, > but we can easily work around the bug b