]> git.baikalelectronics.ru Git - kernel.git/commit
can: kvaser_usb: Comply with firmware max tx URBs value
authorAhmed S. Darwish <ahmed.darwish@valeo.com>
Sun, 15 Mar 2015 15:03:38 +0000 (11:03 -0400)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 22 Mar 2015 17:14:49 +0000 (18:14 +0100)
commit52ad0dcb254f883ef65805a4210719463710ee6b
tree5f2e845a45b9829a2f201e777cd89fefc4bbbdb1
parent301c3e34d6b85446e72e020e12c6e77962bb2fd3
can: kvaser_usb: Comply with firmware max tx URBs value

Current driver code arbitrarily assumes a max outstanding tx
value of 16 parallel transmissions. Meanwhile, the device
firmware provides its actual maximum inside its reply to the
CMD_GET_SOFTWARE_INFO message.

Under heavy tx traffic, if the interleaved transmissions count
increases above the limit reported by firmware, the firmware
breaks up badly, reports a massive list of internal errors, and
the candump traces hardly matches the actual frames sent and
received.

On the other hand, in certain models, the firmware can support
up to 48 tx URBs instead of just 16, increasing the driver
throughput by two-fold and reducing the possibility of -ENOBUFs.

Thus dynamically set the driver's max tx URBs value according
to firmware replies.

Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/kvaser_usb.c