347-tuning.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. --- a/ath/if_ath.c
  2. +++ b/ath/if_ath.c
  3. @@ -10274,11 +10274,11 @@ ath_setcurmode(struct ath_softc *sc, enu
  4. sc->sc_currates = rt;
  5. sc->sc_curmode = mode;
  6. /*
  7. - * All protection frames are transmitted at 2Mb/s for
  8. - * 11g, otherwise at 1Mb/s.
  9. + * All protection frames are transmitted at 11Mb/s for
  10. + * 11g, otherwise at 2Mb/s.
  11. * XXX select protection rate index from rate table.
  12. */
  13. - sc->sc_protrix = (mode == IEEE80211_MODE_11G ? 1 : 0);
  14. + sc->sc_protrix = (mode == IEEE80211_MODE_11G ? 3 : 1);
  15. /* rate index used to send mgt frames */
  16. sc->sc_minrateix = 0;
  17. }
  18. --- a/ath/if_athvar.h
  19. +++ b/ath/if_athvar.h
  20. @@ -272,6 +272,10 @@ static inline struct net_device *_alloc_
  21. #define AES_ICV_FIELD_SIZE 8 /* AES ICV field size */
  22. #define EXT_IV_FIELD_SIZE 4 /* ext IV field size */
  23. +/* This is what the HAL uses by default for 11a+g */
  24. +#define ATH_DEFAULT_CWMIN 15
  25. +#define ATH_DEFAULT_CWMAX 1023
  26. +
  27. /* XR specific macros */
  28. #define XR_DEFAULT_GRPPOLL_RATE_STR "0.25 1 1 3 3 6 6 20"
  29. --- a/ath_rate/minstrel/minstrel.c
  30. +++ b/ath_rate/minstrel/minstrel.c
  31. @@ -197,7 +197,7 @@ calc_usecs_unicast_packet(struct ath_sof
  32. unsigned int x = 0, tt = 0;
  33. unsigned int cix = rt->info[rix].controlRate;
  34. int rts = 0, cts = 0;
  35. - int cw = WIFI_CW_MIN;
  36. + int cw = ATH_DEFAULT_CWMIN;
  37. KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
  38. @@ -281,7 +281,7 @@ calc_usecs_unicast_packet(struct ath_sof
  39. tt += (long_retries + 1) * ath_hal_computetxtime(sc->sc_ah, rt, length,
  40. rix, AH_TRUE);
  41. for (x = 0; x <= short_retries + long_retries; x++) {
  42. - cw = MIN(WIFI_CW_MAX, (cw + 1) * 2);
  43. + cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2);
  44. tt += (t_slot * cw / 2);
  45. }
  46. return tt;
  47. --- a/ath_rate/minstrel/minstrel.h
  48. +++ b/ath_rate/minstrel/minstrel.h
  49. @@ -180,14 +180,6 @@ struct minstrel_node {
  50. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  51. #endif
  52. -#if 0
  53. -#define WIFI_CW_MIN 31
  54. -#define WIFI_CW_MAX 1023
  55. -#else
  56. -#define WIFI_CW_MIN 3
  57. -#define WIFI_CW_MAX 10
  58. -#endif
  59. -
  60. /*
  61. * Definitions for pulling the rate and trie counts from
  62. * a 5212 h/w descriptor. These Don't belong here; the
  63. --- a/ath_rate/sample/sample.c
  64. +++ b/ath_rate/sample/sample.c
  65. @@ -170,7 +170,7 @@ calc_usecs_unicast_packet(struct ath_sof
  66. struct ieee80211com *ic = &sc->sc_ic;
  67. unsigned int tt = 0;
  68. unsigned int x;
  69. - unsigned int cw = WIFI_CW_MIN;
  70. + unsigned int cw = ATH_DEFAULT_CWMIN;
  71. unsigned int cix = rt->info[rix].controlRate;
  72. KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
  73. @@ -254,7 +254,7 @@ calc_usecs_unicast_packet(struct ath_sof
  74. tt += (long_retries+1)*ath_hal_computetxtime(sc->sc_ah, rt, length,
  75. rix, AH_TRUE);
  76. for (x = 0; x <= short_retries + long_retries; x++) {
  77. - cw = MIN(WIFI_CW_MAX, (cw + 1) * 2);
  78. + cw = MIN(ATH_DEFAULT_CWMAX, (cw + 1) * 2);
  79. tt += (t_slot * cw / 2);
  80. }
  81. return tt;
  82. --- a/ath_rate/sample/sample.h
  83. +++ b/ath_rate/sample/sample.h
  84. @@ -106,9 +106,6 @@ struct sample_node {
  85. #define MAX(a,b) ((a) > (b) ? (a) : (b))
  86. #endif
  87. -#define WIFI_CW_MIN 31
  88. -#define WIFI_CW_MAX 1023
  89. -
  90. /*
  91. * Definitions for pulling the rate and trie counts from
  92. * a 5212 h/w descriptor. These Don't belong here; the