018-greth_compat_mode.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From a498d7076ee0f82ec3f508293a9cf1ccba15829e Mon Sep 17 00:00:00 2001
  2. From: Daniel Hellstrom <[email protected]>
  3. Date: Wed, 1 Dec 2010 16:52:19 +0100
  4. Subject: [PATCH] GRETH: added greth_compat_mode module parameter
  5. The greth_compat_mode option can be used to set a GRETH GBit capable MAC
  6. in operate as if the GRETH 10/100 device was found. The GRETH GBit supports
  7. TCP/UDP checksum offloading, unaligned frame buffers, scatter gather etc.
  8. Enabling this mode allows the developer to test the GRETH 10/100 device
  9. without all features mentioned above on a GBit MAC capable of the above.
  10. Signed-off-by: Daniel Hellstrom <[email protected]>
  11. ---
  12. drivers/net/greth.c | 9 +++++++++
  13. 1 files changed, 9 insertions(+), 0 deletions(-)
  14. --- a/drivers/net/greth.c
  15. +++ b/drivers/net/greth.c
  16. @@ -70,6 +70,11 @@ static int no_gbit = 0;
  17. module_param(no_gbit, int, S_IRUGO);
  18. MODULE_PARM_DESC(no_gbit, "GRETH report GBit not supported by MAC enable. Only affects GRETH GBit MAC, default 0 (off).");
  19. +/* Use this option to enable GRETH 10/100 code on GRETH_GBIT hardware (debug legacy code option) */
  20. +static int compat_mode = 0;
  21. +module_param(compat_mode, int, S_IRUGO);
  22. +MODULE_PARM_DESC(compat_mode, "GRETH 10/100 legacy mode enable. Only affects GRETH GBit MAC, default 0 (off).");
  23. +
  24. static int greth_open(struct net_device *dev);
  25. static netdev_tx_t greth_start_xmit(struct sk_buff *skb,
  26. struct net_device *dev);
  27. @@ -1452,6 +1457,10 @@ static int __devinit greth_of_probe(stru
  28. else
  29. greth->gbit_phy_support = 0;
  30. + /* Force GBit MAC in legacy 10/100 mode (no offloading etc.) */
  31. + if (compat_mode == 1)
  32. + greth->gbit_mac = 0;
  33. +
  34. /* Check for multicast capability */
  35. greth->multicast = (tmp >> 25) & 1;