4 vap->iv_key_set = ath_key_set;
5 vap->iv_key_update_begin = ath_key_update_begin;
6 vap->iv_key_update_end = ath_key_update_end;
7 + vap->iv_maxrateindex = 0;
8 if (sc->sc_default_ieee80211_debug) {
9 /* User specified defaults for new VAPs were provided, so
10 * use those (only). */
11 --- a/ath_rate/sample/sample.c
12 +++ b/ath_rate/sample/sample.c
15 sn->static_rate_ndx = -1;
17 - sn->num_rates = ni->ni_rates.rs_nrates;
18 + if (vap->iv_maxrateindex == 0 || ni->ni_rates.rs_nrates <= 0
19 + || vap->iv_maxrateindex > ni->ni_rates.rs_nrates)
20 + sn->num_rates = ni->ni_rates.rs_nrates;
22 + sn->num_rates = vap->iv_maxrateindex;
24 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {
25 sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
26 sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
27 --- a/net80211/ieee80211_var.h
28 +++ b/net80211/ieee80211_var.h
30 struct ieee80211_spy iv_spy; /* IWSPY support */
31 struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */
32 u_int32_t app_filter; /* filters which management frames are forwarded to app */
33 + int iv_maxrateindex;
36 /* Debug functions need the defintion of struct ieee80211vap because iv_debug
37 --- a/net80211/ieee80211_wireless.c
38 +++ b/net80211/ieee80211_wireless.c
39 @@ -2873,6 +2873,12 @@
41 ic->ic_flags_ext &= ~IEEE80211_FEXT_MARKDFS;
43 + case IEEE80211_PARAM_MAXRATE:
45 + vap->iv_maxrateindex = value;
47 + vap->iv_maxrateindex = 0;
49 #ifdef ATH_REVERSE_ENGINEERING
50 case IEEE80211_PARAM_DUMPREGS:
51 ieee80211_dump_registers(dev, info, w, extra);
56 + case IEEE80211_PARAM_MAXRATE:
57 + param[0] = vap->iv_maxrateindex;
62 @@ -5666,6 +5675,10 @@
63 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "debug_scanbufs" },
64 { IEEE80211_PARAM_LEAKTXBUFS,
65 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "debug_leaktxbufs" },
66 + {IEEE80211_PARAM_MAXRATE,
67 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"},
68 + {IEEE80211_PARAM_MAXRATE,
69 + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"},
71 #ifdef ATH_REVERSE_ENGINEERING
73 --- a/net80211/ieee80211_ioctl.h
74 +++ b/net80211/ieee80211_ioctl.h
76 IEEE80211_PARAM_RESETTXBUFS = 80, /* Reset transmit DMA */
77 IEEE80211_PARAM_SCANBUFS = 81, /* Heap analysis for TX DMA */
78 IEEE80211_PARAM_LEAKTXBUFS = 82, /* Leak tx buffers */
79 + IEEE80211_PARAM_MAXRATE = 83, /* Maximum rate (by table index) */
82 #define SIOCG80211STATS (SIOCDEVPRIVATE+2)
83 --- a/ath_rate/minstrel/minstrel.c
84 +++ b/ath_rate/minstrel/minstrel.c
88 sn->static_rate_ndx = -1;
89 + if (vap->iv_maxrateindex == 0 || ni->ni_rates.rs_nrates <= 0
90 + || vap->iv_maxrateindex > ni->ni_rates.rs_nrates)
91 + sn->num_rates = ni->ni_rates.rs_nrates;
93 + sn->num_rates = vap->iv_maxrateindex;
95 sn->num_rates = ni->ni_rates.rs_nrates;
96 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {