4 vap->iv_key_update_begin = ath_key_update_begin;
5 vap->iv_key_update_end = ath_key_update_end;
6 vap->iv_maxrateindex = 0;
7 + vap->iv_minrateindex = 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
15 sn->num_rates = ni->ni_rates.rs_nrates;
16 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {
19 sn->rs_rateattempts [x] = 0;
20 sn->rs_thisprob [x] = 0;
21 sn->rs_ratesuccess [x] = 0;
23 sn->rs_att_hist [x] = 0;
24 sn->rs_this_tp [x] = 0;
26 - sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
27 - sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
28 + if (vap->iv_minrateindex && (vap->iv_minrateindex <
29 + ni->ni_rates.rs_nrates))
30 + idx = vap->iv_minrateindex;
32 + sn->rates[x].rate = ni->ni_rates.rs_rates[idx] & IEEE80211_RATE_VAL;
33 + sn->rates[x].rix = sc->sc_rixmap[sn->rates[idx].rate];
34 if (sn->rates[x].rix == 0xff) {
35 DPRINTF(sc, "%s: %s ignore bogus rix at %d\n",
36 dev_info, __func__, x);
37 --- a/ath_rate/sample/sample.c
38 +++ b/ath_rate/sample/sample.c
40 sn->num_rates = vap->iv_maxrateindex;
42 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {
43 - sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
44 - sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
47 + if (vap->iv_minrateindex && vap->iv_minrateindex <
48 + ni->ni_rates.rs_nrates)
49 + idx = vap->iv_minrateindex;
51 + sn->rates[x].rate = ni->ni_rates.rs_rates[idx] & IEEE80211_RATE_VAL;
52 + sn->rates[x].rix = sc->sc_rixmap[sn->rates[idx].rate];
54 if (sn->rates[x].rix == 0xff) {
55 DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s ignore bogus rix at %u\n",
56 dev_info, __func__, x);
57 --- a/net80211/ieee80211_ioctl.h
58 +++ b/net80211/ieee80211_ioctl.h
60 IEEE80211_PARAM_SCANBUFS = 81, /* Heap analysis for TX DMA */
61 IEEE80211_PARAM_LEAKTXBUFS = 82, /* Leak tx buffers */
62 IEEE80211_PARAM_MAXRATE = 83, /* Maximum rate (by table index) */
63 + IEEE80211_PARAM_MINRATE = 84, /* Minimum rate (by table index) */
66 #define SIOCG80211STATS (SIOCDEVPRIVATE+2)
67 --- a/net80211/ieee80211_var.h
68 +++ b/net80211/ieee80211_var.h
70 struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */
71 u_int32_t app_filter; /* filters which management frames are forwarded to app */
73 + int iv_minrateindex;
76 /* Debug functions need the defintion of struct ieee80211vap because iv_debug
77 --- a/net80211/ieee80211_wireless.c
78 +++ b/net80211/ieee80211_wireless.c
79 @@ -2879,6 +2879,12 @@
81 vap->iv_maxrateindex = 0;
83 + case IEEE80211_PARAM_MINRATE:
85 + vap->iv_minrateindex = value;
87 + vap->iv_minrateindex = 0;
89 #ifdef ATH_REVERSE_ENGINEERING
90 case IEEE80211_PARAM_DUMPREGS:
91 ieee80211_dump_registers(dev, info, w, extra);
93 case IEEE80211_PARAM_MAXRATE:
94 param[0] = vap->iv_maxrateindex;
96 + case IEEE80211_PARAM_MINRATE:
97 + param[0] = vap->iv_minrateindex;
102 @@ -5679,6 +5688,10 @@
103 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"},
104 {IEEE80211_PARAM_MAXRATE,
105 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"},
106 + {IEEE80211_PARAM_MINRATE,
107 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "minrate"},
108 + {IEEE80211_PARAM_MINRATE,
109 + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_minrate"},
111 #ifdef ATH_REVERSE_ENGINEERING