120-soc_fix.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. diff -ur madwifi.old/ath/if_ath_ahb.c madwifi.dev/ath/if_ath_ahb.c
  2. --- madwifi.old/ath/if_ath_ahb.c 2007-05-30 03:41:18.000000000 +0200
  3. +++ madwifi.dev/ath/if_ath_ahb.c 2007-06-01 12:04:02.887273960 +0200
  4. @@ -275,11 +275,10 @@
  5. static int
  6. -exit_ath_wmac(u_int16_t wlanNum)
  7. +exit_ath_wmac(u_int16_t wlanNum, struct ar531x_config *config)
  8. {
  9. struct ath_ahb_softc *sc = sclist[wlanNum];
  10. struct net_device *dev;
  11. - const char *sysType;
  12. u_int16_t devid;
  13. if (sc == NULL)
  14. @@ -289,13 +288,16 @@
  15. ath_detach(dev);
  16. if (dev->irq)
  17. free_irq(dev->irq, dev);
  18. - sysType = get_system_type();
  19. - if (!strcmp(sysType, "Atheros AR5315"))
  20. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
  21. + devid = (u32) config->tag;
  22. +#else
  23. + if (!strcmp(get_system_type(), "Atheros AR5315"))
  24. devid = (u_int16_t) (sysRegRead(AR5315_SREV) &
  25. (AR5315_REV_MAJ_M | AR5315_REV_MIN_M));
  26. else
  27. devid = (u_int16_t) ((sysRegRead(AR531X_REV) >> 8) &
  28. (AR531X_REV_MAJ | AR531X_REV_MIN));
  29. +#endif
  30. ahb_disable_wmac(devid, wlanNum);
  31. free_netdev(dev);
  32. @@ -401,7 +403,7 @@
  33. static int ahb_wmac_remove(struct platform_device *pdev)
  34. {
  35. - exit_ath_wmac(pdev->id);
  36. + exit_ath_wmac(pdev->id, (struct ar531x_config *) pdev->dev.platform_data);
  37. return 0;
  38. }
  39. @@ -439,7 +441,7 @@
  40. (AR5315_REV_MAJ_M | AR5315_REV_MIN_M));
  41. if (((devid & AR5315_REV_MAJ_M) == AR5315_REV_MAJ) ||
  42. ((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ))
  43. - return init_ath_wmac(devid, 0, &config);
  44. + return init_ath_wmac(devid, 0);
  45. }
  46. devid = (u_int16_t) ((sysRegRead(AR531X_REV) >>8) &
  47. @@ -452,11 +454,11 @@
  48. ar5312BspEepromRead(2 * AR531X_RADIO_MASK_OFF, 2,
  49. (char *) &radioMask);
  50. if ((radioMask & AR531X_RADIO0_MASK) != 0)
  51. - if ((ret = init_ath_wmac(devid, 0, &config)) !=0 )
  52. + if ((ret = init_ath_wmac(devid, 0)) !=0 )
  53. return ret;
  54. /* XXX: Fall through?! */
  55. case AR5212_AR2313_REV8:
  56. - if ((ret = init_ath_wmac(devid, 1, &config)) != 0)
  57. + if ((ret = init_ath_wmac(devid, 1)) != 0)
  58. return ret;
  59. break;
  60. default: