Updated Dnsmasq to 2.42 (#3498)
[openwrt.git] / package / madwifi / patches / 341-minrate.patch
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
5 @@ -1308,6 +1308,7 @@
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
17 @@ -638,9 +638,15 @@
18 sn->rs_succ_hist [x] = 0;
19 sn->rs_att_hist [x] = 0;
20 sn->rs_this_tp [x] = 0;
21 -
22 + if (vap->iv_minrateindex && vap->iv_minrateindex<ni->ni_rates.rs_nrates)
23 + {
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];
27 + }else{
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];
30 + }
31 if (sn->rates[x].rix == 0xff) {
32 DPRINTF(sc, "%s: %s ignore bogus rix at %d\n",
33 dev_info, __func__, x);
34 @@ -649,7 +655,7 @@
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;
40 }
41
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
47 @@ -842,8 +842,15 @@
48 sn->num_rates = vap->iv_maxrateindex;
49
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)
54 + {
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];
58 + }else{
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];
61 + }
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
69 @@ -642,6 +642,7 @@
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) */
74 };
75
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
81 @@ -282,6 +282,7 @@
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 */
84 int iv_maxrateindex;
85 + int iv_minrateindex;
86 };
87
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 @@
94 else
95 vap->iv_maxrateindex = 0;
96 break;
97 + case IEEE80211_PARAM_MINRATE:
98 + if (value > 0)
99 + vap->iv_minrateindex = value;
100 + else
101 + vap->iv_minrateindex = 0;
102 + break;
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;
109 break;
110 + case IEEE80211_PARAM_MINRATE:
111 + param[0] = vap->iv_minrateindex;
112 + break;
113 default:
114 return -EOPNOTSUPP;
115 }
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"},
124
125 #ifdef ATH_REVERSE_ENGINEERING
126 /*
This page took 0.04994 seconds and 5 git commands to generate.