]> git.baikalelectronics.ru Git - kernel.git/commit
net: huawei_cdc_ncm: increase command buffer size
authorBjørn Mork <bjorn@mork.no>
Wed, 18 Jun 2014 12:21:24 +0000 (14:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Jun 2014 02:33:17 +0000 (19:33 -0700)
commit4bab6caaed1de131238e263d54c5a0b8e1d30d8b
tree2f7f8d8e8dc146c91eb0b9a5dc22da93ebf32eba
parentb5d2d88c4063b348e518c88b82dc78f83d8df369
net: huawei_cdc_ncm: increase command buffer size

Messages from the modem exceeding 256 bytes cause communication
failure.

The WDM protocol is strictly "read on demand", meaning that we only
poll for unread data after receiving a notification from the modem.
Since we have no way to know how much data the modem has to send,
we must make sure that the buffer we provide is "big enough".
Message truncation does not work. Truncated messages are left unread
until the modem has another message to send.  Which often won't
happen until the userspace application has given up waiting for the
final part of the last message, and therefore sends another command.

With a proper CDC WDM function there is a descriptor telling us
which buffer size the modem uses. But with this vendor specific
implementation there is no known way to calculate the exact "big
enough" number.  It is an unknown property of the modem firmware.
Experience has shown that 256 is too small.  The discussion of
this failure ended up concluding that 512 might be too small as
well. So 1024 seems like a reasonable value for now.

Fixes: bd92114aeb37 ("net: huawei_cdc_ncm: Introduce the huawei_cdc_ncm driver")
Cc: Enrico Mioso <mrkiko.rs@gmail.com>
Reported-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-By: Enrico Mioso <mrkiko.rs@gmail.com>
Tested-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/huawei_cdc_ncm.c