1 Index: madwifi-dfs-r3246/ath/if_ath.c
2 ===================================================================
3 --- madwifi-dfs-r3246.orig/ath/if_ath.c 2008-01-25 16:30:04.921659489 +0100
4 +++ madwifi-dfs-r3246/ath/if_ath.c 2008-01-25 16:33:11.528293596 +0100
6 rfilt |= HAL_RX_FILTER_PROM;
7 if (ic->ic_opmode == IEEE80211_M_STA ||
8 sc->sc_opmode == HAL_M_IBSS || /* NB: AHDEMO too */
9 - (sc->sc_nostabeacons) || sc->sc_scanning)
10 + (sc->sc_nostabeacons) || sc->sc_scanning ||
11 + ((ic->ic_opmode == IEEE80211_M_HOSTAP) &&
12 + (ic->ic_protmode != IEEE80211_PROT_NONE)))
13 rfilt |= HAL_RX_FILTER_BEACON;
14 if (sc->sc_nmonvaps > 0)
15 rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON |
16 Index: madwifi-dfs-r3246/net80211/ieee80211_input.c
17 ===================================================================
18 --- madwifi-dfs-r3246.orig/net80211/ieee80211_input.c 2008-01-25 16:32:53.171247487 +0100
19 +++ madwifi-dfs-r3246/net80211/ieee80211_input.c 2008-01-25 16:35:46.341115878 +0100
24 - * Validate the bssid.
25 + * Validate the bssid. Let beacons get through though for 11g protection mode.
28 if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bssid) &&
29 - !IEEE80211_ADDR_EQ(bssid, dev->broadcast)) {
30 + !IEEE80211_ADDR_EQ(bssid, dev->broadcast) &&
31 + (subtype != IEEE80211_FC0_SUBTYPE_BEACON)) {
34 * allow MGT frames to vap->iv_xrvap.
35 * this will allow roaming between XR and normal vaps
37 vap->iv_stats.is_rx_wrongbss++;
42 - if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bssid) &&
43 - !IEEE80211_ADDR_EQ(bssid, dev->broadcast)) {
44 /* not interested in */
45 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
46 bssid, NULL, "%s", "not to bss");
47 vap->iv_stats.is_rx_wrongbss++;
55 if (skb->len < sizeof(struct ieee80211_frame_addr4)) {
58 u_int8_t *ssid, *rates, *xrates, *suppchan, *wpa, *rsn, *wme, *ath;
60 - int reassoc, resp, allocbs = 0;
61 + int reassoc, resp, allocbs = 0, has_erp = 0;
64 if (ni_or_null == NULL)
65 @@ -3053,11 +3050,15 @@
66 * o station mode when associated (to collect state
67 * updates such as 802.11g slot time), or
68 * o adhoc mode (to discover neighbors)
69 + * o ap mode in protection mode (beacons only)
70 * Frames otherwise received are discarded.
72 if (!((ic->ic_flags & IEEE80211_F_SCAN) ||
73 (vap->iv_opmode == IEEE80211_M_STA && ni->ni_associd) ||
74 - vap->iv_opmode == IEEE80211_M_IBSS)) {
75 + (vap->iv_opmode == IEEE80211_M_IBSS) ||
76 + ((subtype == IEEE80211_FC0_SUBTYPE_BEACON) &&
77 + (vap->iv_opmode == IEEE80211_M_HOSTAP) &&
78 + (ic->ic_protmode != IEEE80211_PROT_NONE)))) {
79 vap->iv_stats.is_rx_mgtdiscard++;
88 case IEEE80211_ELEMID_RSN:
90 @@ -3357,6 +3359,20 @@
91 ieee80211_bg_scan(vap);
95 + /* Update AP protection mode when in 11G mode */
96 + if ((vap->iv_opmode == IEEE80211_M_HOSTAP) &&
97 + IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
99 + /* Assume no ERP IE == 11b AP */
100 + if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) &&
101 + !(ic->ic_flags & IEEE80211_F_USEPROT)) {
103 + ic->ic_flags |= IEEE80211_F_USEPROT;
104 + ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
109 * If scanning, just pass information to the scan module.
111 Index: madwifi-dfs-r3246/net80211/ieee80211_node.c
112 ===================================================================
113 --- madwifi-dfs-r3246.orig/net80211/ieee80211_node.c 2008-01-25 16:27:28.000000000 +0100
114 +++ madwifi-dfs-r3246/net80211/ieee80211_node.c 2008-01-25 16:33:11.540294282 +0100
115 @@ -383,10 +383,16 @@
116 /* Update country ie information */
117 ieee80211_build_countryie(ic);
119 - if (IEEE80211_IS_CHAN_HALF(chan))
120 + if (IEEE80211_IS_CHAN_HALF(chan)) {
121 ni->ni_rates = ic->ic_sup_half_rates;
122 - else if (IEEE80211_IS_CHAN_QUARTER(chan))
123 + } else if (IEEE80211_IS_CHAN_QUARTER(chan)) {
124 ni->ni_rates = ic->ic_sup_quarter_rates;
127 + if ((vap->iv_flags & IEEE80211_F_PUREG) &&
128 + IEEE80211_IS_CHAN_ANYG(chan)) {
129 + ieee80211_setpuregbasicrates(&ni->ni_rates);
132 (void) ieee80211_sta_join1(PASS_NODE(ni));
134 Index: madwifi-dfs-r3246/net80211/ieee80211_proto.c
135 ===================================================================
136 --- madwifi-dfs-r3246.orig/net80211/ieee80211_proto.c 2008-01-25 16:27:28.000000000 +0100
137 +++ madwifi-dfs-r3246/net80211/ieee80211_proto.c 2008-01-25 16:33:11.544294507 +0100
139 { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */
142 +static const struct ieee80211_rateset basicpureg[] = {
143 + { 7, {2, 4, 11, 22, 12, 24, 48 } },
147 + * Mark basic rates for the 11g rate table based on the pureg setting
150 +ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs)
154 + for (i = 0; i < rs->rs_nrates; i++) {
155 + rs->rs_rates[i] &= IEEE80211_RATE_VAL;
156 + for (j = 0; j < basicpureg[0].rs_nrates; j++)
157 + if (basicpureg[0].rs_rates[j] == rs->rs_rates[i]) {
158 + rs->rs_rates[i] |= IEEE80211_RATE_BASIC;
165 * Mark the basic rates for the 11g rate table based on the
166 * specified mode. For 11b compatibility we mark only 11b
167 Index: madwifi-dfs-r3246/net80211/ieee80211_var.h
168 ===================================================================
169 --- madwifi-dfs-r3246.orig/net80211/ieee80211_var.h 2008-01-25 16:27:28.000000000 +0100
170 +++ madwifi-dfs-r3246/net80211/ieee80211_var.h 2008-01-25 16:33:11.548294736 +0100
172 void ieee80211_build_sc_ie(struct ieee80211com *);
173 void ieee80211_dfs_action(struct ieee80211com *);
174 void ieee80211_expire_channel_non_occupancy_restrictions(struct ieee80211com *);
175 +void ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs);
178 * Iterate through ic_channels to enumerate all distinct ic_ieee channel numbers.