Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

r8152: disable the capability of zero length

The UEFI driver would enable zero length, and the Linux driver doesn't
need it. Zero length let the hw complete the transfer with length 0,
when there is no received packet. It would add the load of USB host
controller and reduce the performance.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

hayeswang and committed by
David S. Miller
e90fba8d f8a9b1bc

+3 -2
+3 -2
drivers/net/usb/r8152.c
··· 339 339 340 340 /* USB_USB_CTRL */ 341 341 #define RX_AGG_DISABLE 0x0010 342 + #define RX_ZERO_EN 0x0080 342 343 343 344 /* USB_U2P3_CTRL */ 344 345 #define U2P3_ENABLE 0x0001 ··· 2706 2705 2707 2706 /* rx aggregation */ 2708 2707 ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); 2709 - ocp_data &= ~RX_AGG_DISABLE; 2708 + ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); 2710 2709 ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); 2711 2710 } 2712 2711 ··· 3228 3227 3229 3228 /* enable rx aggregation */ 3230 3229 ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); 3231 - ocp_data &= ~RX_AGG_DISABLE; 3230 + ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); 3232 3231 ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); 3233 3232 } 3234 3233