210-b44_phy_fix.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --- a/drivers/net/ethernet/broadcom/b44.c
  2. +++ b/drivers/net/ethernet/broadcom/b44.c
  3. @@ -431,10 +431,34 @@ static void b44_wap54g10_workaround(stru
  4. error:
  5. pr_warn("PHY: cannot reset MII transceiver isolate bit\n");
  6. }
  7. +
  8. +static void b44_bcm47xx_workarounds(struct b44 *bp)
  9. +{
  10. + char buf[20];
  11. + struct ssb_device *sdev = bp->sdev;
  12. +
  13. + /* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */
  14. + if (sdev->bus->sprom.board_num == 100) {
  15. + bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
  16. + } else {
  17. + /* WL-HDD */
  18. + if (bcm47xx_nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0 &&
  19. + !strncmp(buf, "WL300-", strlen("WL300-"))) {
  20. + if (sdev->bus->sprom.et0phyaddr == 0 &&
  21. + sdev->bus->sprom.et1phyaddr == 1)
  22. + bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
  23. + }
  24. + }
  25. + return;
  26. +}
  27. #else
  28. static inline void b44_wap54g10_workaround(struct b44 *bp)
  29. {
  30. }
  31. +
  32. +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
  33. +{
  34. +}
  35. #endif
  36. static int b44_setup_phy(struct b44 *bp)
  37. @@ -443,6 +467,7 @@ static int b44_setup_phy(struct b44 *bp)
  38. int err;
  39. b44_wap54g10_workaround(bp);
  40. + b44_bcm47xx_workarounds(bp);
  41. if (bp->flags & B44_FLAG_EXTERNAL_PHY)
  42. return 0;
  43. @@ -2169,6 +2194,8 @@ static int b44_get_invariants(struct b44
  44. * valid PHY address. */
  45. bp->phy_addr &= 0x1F;
  46. + b44_bcm47xx_workarounds(bp);
  47. +
  48. memcpy(bp->dev->dev_addr, addr, ETH_ALEN);
  49. if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){