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/minstrel/minstrel.c
12 +++ b/ath_rate/minstrel/minstrel.c
16 sn->static_rate_ndx = -1;
17 + if (vap->iv_maxrateindex == 0 || ni->ni_rates.rs_nrates <= 0
18 + || vap->iv_maxrateindex > ni->ni_rates.rs_nrates)
19 + sn->num_rates = ni->ni_rates.rs_nrates;
21 + sn->num_rates = vap->iv_maxrateindex;
23 - sn->num_rates = ni->ni_rates.rs_nrates;
24 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {
25 sn->rs_rateattempts [x] = 0;
26 sn->rs_thisprob [x] = 0;
27 --- a/ath_rate/sample/sample.c
28 +++ b/ath_rate/sample/sample.c
31 sn->static_rate_ndx = -1;
33 - sn->num_rates = ni->ni_rates.rs_nrates;
34 + if (vap->iv_maxrateindex == 0 || ni->ni_rates.rs_nrates <= 0
35 + || vap->iv_maxrateindex > ni->ni_rates.rs_nrates)
36 + sn->num_rates = ni->ni_rates.rs_nrates;
38 + sn->num_rates = vap->iv_maxrateindex;
40 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {
41 sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
42 sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
43 --- a/net80211/ieee80211_ioctl.h
44 +++ b/net80211/ieee80211_ioctl.h
46 FCC requires 30m, so that is the default. */
47 IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */
48 IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */
49 + IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */
52 #define SIOCG80211STATS (SIOCDEVPRIVATE+2)
53 --- a/net80211/ieee80211_var.h
54 +++ b/net80211/ieee80211_var.h
56 struct ieee80211_spy iv_spy; /* IWSPY support */
57 struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */
58 u_int32_t app_filter; /* filters which management frames are forwarded to app */
59 + int iv_maxrateindex;
62 /* Debug functions need the defintion of struct ieee80211vap because iv_debug
63 --- a/net80211/ieee80211_wireless.c
64 +++ b/net80211/ieee80211_wireless.c
65 @@ -2839,6 +2839,12 @@
67 ic->ic_flags_ext &= ~IEEE80211_FEXT_MARKDFS;
69 + case IEEE80211_PARAM_MAXRATE:
71 + vap->iv_maxrateindex = value;
73 + vap->iv_maxrateindex = 0;
75 #ifdef ATH_REVERSE_ENGINEERING
76 case IEEE80211_PARAM_DUMPREGS:
77 ieee80211_dump_registers(dev, info, w, extra);
82 + case IEEE80211_PARAM_MAXRATE:
83 + param[0] = vap->iv_maxrateindex;
88 @@ -5610,6 +5619,10 @@
89 0, IW_PRIV_TYPE_APPIEBUF, "getiebuf" },
90 { IEEE80211_IOCTL_FILTERFRAME,
91 IW_PRIV_TYPE_FILTER , 0, "setfilter" },
92 + {IEEE80211_PARAM_MAXRATE,
93 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"},
94 + {IEEE80211_PARAM_MAXRATE,
95 + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"},
97 #ifdef ATH_REVERSE_ENGINEERING