0228-add-smsc95xx-packetsize-module_param.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 7cdc4c771efb56086a303784f012100382018da4 Mon Sep 17 00:00:00 2001
  2. From: Sam Nazarko <email@samnazarko.co.uk>
  3. Date: Fri, 1 Apr 2016 17:27:21 +0100
  4. Subject: [PATCH 228/381] add smsc95xx packetsize module_param
  5. Signed-off-by: Sam Nazarko <email@samnazarko.co.uk>
  6. ---
  7. drivers/net/usb/smsc95xx.c | 14 +++++++++-----
  8. 1 file changed, 9 insertions(+), 5 deletions(-)
  9. --- a/drivers/net/usb/smsc95xx.c
  10. +++ b/drivers/net/usb/smsc95xx.c
  11. @@ -83,6 +83,10 @@ static char *macaddr = ":";
  12. module_param(macaddr, charp, 0);
  13. MODULE_PARM_DESC(macaddr, "MAC address");
  14. +static int packetsize = 0;
  15. +module_param(packetsize, int, 0644);
  16. +MODULE_PARM_DESC(packetsize, "Override the RX URB packet size");
  17. +
  18. static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
  19. u32 *data, int in_pm)
  20. {
  21. @@ -1006,13 +1010,13 @@ static int smsc95xx_reset(struct usbnet
  22. if (!turbo_mode) {
  23. burst_cap = 0;
  24. - dev->rx_urb_size = MAX_SINGLE_PACKET_SIZE;
  25. + dev->rx_urb_size = packetsize ? packetsize : MAX_SINGLE_PACKET_SIZE;
  26. } else if (dev->udev->speed == USB_SPEED_HIGH) {
  27. - burst_cap = DEFAULT_HS_BURST_CAP_SIZE / HS_USB_PKT_SIZE;
  28. - dev->rx_urb_size = DEFAULT_HS_BURST_CAP_SIZE;
  29. + dev->rx_urb_size = packetsize ? packetsize : DEFAULT_HS_BURST_CAP_SIZE;
  30. + burst_cap = dev->rx_urb_size / HS_USB_PKT_SIZE;
  31. } else {
  32. - burst_cap = DEFAULT_FS_BURST_CAP_SIZE / FS_USB_PKT_SIZE;
  33. - dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
  34. + dev->rx_urb_size = packetsize ? packetsize : DEFAULT_FS_BURST_CAP_SIZE;
  35. + burst_cap = dev->rx_urb_size / FS_USB_PKT_SIZE;
  36. }
  37. netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n",