]> 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)
commit0605e33f872c2a43ef8b439990a6f8ccd2a90a48
tree5f2e845a45b9829a2f201e777cd89fefc4bbbdb1
parent12fa7521b1b70ef3e686a26dc9512db24c11b293
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