1 Index: madwifi-trunk-r3314/ath/if_ath.c
2 ===================================================================
3 --- madwifi-trunk-r3314.orig/ath/if_ath.c
4 +++ madwifi-trunk-r3314/ath/if_ath.c
6 vap->iv_key_update_begin = ath_key_update_begin;
7 vap->iv_key_update_end = ath_key_update_end;
8 vap->iv_maxrateindex = 0;
9 + vap->iv_minrateindex = 0;
10 if (sc->sc_default_ieee80211_debug) {
11 /* User specified defaults for new VAPs were provided, so
12 * use those (only). */
13 Index: madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c
14 ===================================================================
15 --- madwifi-trunk-r3314.orig/ath_rate/minstrel/minstrel.c
16 +++ madwifi-trunk-r3314/ath_rate/minstrel/minstrel.c
18 sn->rs_succ_hist [x] = 0;
19 sn->rs_att_hist [x] = 0;
20 sn->rs_this_tp [x] = 0;
22 + if (vap->iv_minrateindex && vap->iv_minrateindex<ni->ni_rates.rs_nrates)
24 + int idx = vap->iv_minrateindex;
25 + sn->rates[x].rate = ni->ni_rates.rs_rates[idx] & IEEE80211_RATE_VAL;
26 + sn->rates[x].rix = sc->sc_rixmap[sn->rates[idx].rate];
28 sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
29 sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
31 if (sn->rates[x].rix == 0xff) {
32 DPRINTF(sc, "%s: %s ignore bogus rix at %d\n",
33 dev_info, __func__, x);
35 sn->rates[x].rateCode = rt->info[sn->rates[x].rix].rateCode;
36 sn->rates[x].shortPreambleRateCode =
37 rt->info[sn->rates[x].rix].rateCode |
38 - rt->info[sn->rates[x].rix].shortPreamble;
39 + rt->info[sn->rates[x].rix].shortPreamble;
42 ath_fill_sample_table(sn);
43 Index: madwifi-trunk-r3314/ath_rate/sample/sample.c
44 ===================================================================
45 --- madwifi-trunk-r3314.orig/ath_rate/sample/sample.c
46 +++ madwifi-trunk-r3314/ath_rate/sample/sample.c
48 sn->num_rates = vap->iv_maxrateindex;
50 for (x = 0; x < ni->ni_rates.rs_nrates; x++) {
51 - sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
52 - sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
53 + if (vap->iv_minrateindex && vap->iv_minrateindex<ni->ni_rates.rs_nrates)
55 + int idx = vap->iv_minrateindex;
56 + sn->rates[x].rate = ni->ni_rates.rs_rates[idx] & IEEE80211_RATE_VAL;
57 + sn->rates[x].rix = sc->sc_rixmap[sn->rates[idx].rate];
59 + sn->rates[x].rate = ni->ni_rates.rs_rates[x] & IEEE80211_RATE_VAL;
60 + sn->rates[x].rix = sc->sc_rixmap[sn->rates[x].rate];
62 if (sn->rates[x].rix == 0xff) {
63 DPRINTF(sc, ATH_DEBUG_RATE, "%s: %s ignore bogus rix at %u\n",
64 dev_info, __func__, x);
65 Index: madwifi-trunk-r3314/net80211/ieee80211_ioctl.h
66 ===================================================================
67 --- madwifi-trunk-r3314.orig/net80211/ieee80211_ioctl.h
68 +++ madwifi-trunk-r3314/net80211/ieee80211_ioctl.h
70 IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */
71 IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */
72 IEEE80211_PARAM_MAXRATE = 75, /* Maximum rate (by table index) */
73 + IEEE80211_PARAM_MINRATE = 76, /* Maximum rate (by table index) */
76 #define SIOCG80211STATS (SIOCDEVPRIVATE+2)
77 Index: madwifi-trunk-r3314/net80211/ieee80211_var.h
78 ===================================================================
79 --- madwifi-trunk-r3314.orig/net80211/ieee80211_var.h
80 +++ madwifi-trunk-r3314/net80211/ieee80211_var.h
82 struct ieee80211_app_ie app_ie[IEEE80211_APPIE_NUM_OF_FRAME]; /* app-specified IEs by frame type */
83 u_int32_t app_filter; /* filters which management frames are forwarded to app */
85 + int iv_minrateindex;
88 /* Debug functions need the defintion of struct ieee80211vap because iv_debug
89 Index: madwifi-trunk-r3314/net80211/ieee80211_wireless.c
90 ===================================================================
91 --- madwifi-trunk-r3314.orig/net80211/ieee80211_wireless.c
92 +++ madwifi-trunk-r3314/net80211/ieee80211_wireless.c
93 @@ -2845,6 +2845,12 @@
95 vap->iv_maxrateindex = 0;
97 + case IEEE80211_PARAM_MINRATE:
99 + vap->iv_minrateindex = value;
101 + vap->iv_minrateindex = 0;
103 #ifdef ATH_REVERSE_ENGINEERING
104 case IEEE80211_PARAM_DUMPREGS:
105 ieee80211_dump_registers(dev, info, w, extra);
106 @@ -3183,6 +3189,9 @@
107 case IEEE80211_PARAM_MAXRATE:
108 param[0] = vap->iv_maxrateindex;
110 + case IEEE80211_PARAM_MINRATE:
111 + param[0] = vap->iv_minrateindex;
116 @@ -5623,6 +5632,10 @@
117 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "maxrate"},
118 {IEEE80211_PARAM_MAXRATE,
119 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_maxrate"},
120 + {IEEE80211_PARAM_MINRATE,
121 + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "minrate"},
122 + {IEEE80211_PARAM_MINRATE,
123 + 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_minrate"},
125 #ifdef ATH_REVERSE_ENGINEERING