1 Index: madwifi-ng-r2756-20071018/ath/if_ath.c
2 ===================================================================
3 --- madwifi-ng-r2756-20071018.orig/ath/if_ath.c 2007-10-24 06:20:20.997885880 +0200
4 +++ madwifi-ng-r2756-20071018/ath/if_ath.c 2007-10-24 06:20:21.225898872 +0200
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) || ((sc->sc_nvaps > 0) && (sc->sc_nibssvaps > 0)))
15 rfilt |= (HAL_RX_FILTER_CONTROL | HAL_RX_FILTER_BEACON |
16 Index: madwifi-ng-r2756-20071018/net80211/ieee80211_input.c
17 ===================================================================
18 --- madwifi-ng-r2756-20071018.orig/net80211/ieee80211_input.c 2007-10-24 06:20:20.757872202 +0200
19 +++ madwifi-ng-r2756-20071018/net80211/ieee80211_input.c 2007-10-24 06:20:21.229899101 +0200
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_bss->ni_bssid) &&
29 - !IEEE80211_ADDR_EQ(bssid, dev->broadcast)) {
30 + !IEEE80211_ADDR_EQ(bssid, dev->broadcast) &&
31 + (subtype != IEEE80211_FC0_SUBTYPE_BEACON)) {
33 * allow MGT frames to vap->iv_xrvap.
34 * this will allow roaming between XR and normal vaps
38 if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) &&
39 - !IEEE80211_ADDR_EQ(bssid, dev->broadcast)) {
40 + !IEEE80211_ADDR_EQ(bssid, dev->broadcast) &&
41 + (subtype != IEEE80211_FC0_SUBTYPE_BEACON)) {
42 /* not interested in */
43 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
44 bssid, NULL, "%s", "not to bss");
47 u_int8_t *ssid, *rates, *xrates, *wpa, *rsn, *wme, *ath;
49 - int reassoc, resp, allocbs = 0;
50 + int reassoc, resp, allocbs = 0, has_erp = 0;
53 wh = (struct ieee80211_frame *) skb->data;
54 @@ -2572,11 +2574,15 @@
55 * o station mode when associated (to collect state
56 * updates such as 802.11g slot time), or
57 * o adhoc mode (to discover neighbors)
58 + * o ap mode in protection mode (beacons only)
59 * Frames otherwise received are discarded.
61 if (!((ic->ic_flags & IEEE80211_F_SCAN) ||
62 (vap->iv_opmode == IEEE80211_M_STA && ni->ni_associd) ||
63 - vap->iv_opmode == IEEE80211_M_IBSS)) {
64 + (vap->iv_opmode == IEEE80211_M_IBSS) ||
65 + ((subtype == IEEE80211_FC0_SUBTYPE_BEACON) &&
66 + (vap->iv_opmode == IEEE80211_M_HOSTAP) &&
67 + (ic->ic_protmode != IEEE80211_PROT_NONE)))) {
68 vap->iv_stats.is_rx_mgtdiscard++;
77 case IEEE80211_ELEMID_RSN:
79 @@ -2876,6 +2883,20 @@
80 ieee80211_bg_scan(vap);
84 + /* Update AP protection mode when in 11G mode */
85 + if ((vap->iv_opmode == IEEE80211_M_HOSTAP) &&
86 + IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) {
88 + /* Assume no ERP IE == 11b AP */
89 + if ((!has_erp || (has_erp && (scan.erp & IEEE80211_ERP_NON_ERP_PRESENT))) &&
90 + !(ic->ic_flags & IEEE80211_F_USEPROT)) {
92 + ic->ic_flags |= IEEE80211_F_USEPROT;
93 + ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
98 * If scanning, just pass information to the scan module.
100 Index: madwifi-ng-r2756-20071018/net80211/ieee80211_node.c
101 ===================================================================
102 --- madwifi-ng-r2756-20071018.orig/net80211/ieee80211_node.c 2007-10-24 06:20:19.113778513 +0200
103 +++ madwifi-ng-r2756-20071018/net80211/ieee80211_node.c 2007-10-24 06:20:21.237899558 +0200
104 @@ -332,10 +332,16 @@
105 /* Update country ie information */
106 ieee80211_build_countryie(ic);
108 - if (IEEE80211_IS_CHAN_HALF(chan))
109 + if (IEEE80211_IS_CHAN_HALF(chan)) {
110 ni->ni_rates = ic->ic_sup_half_rates;
111 - else if (IEEE80211_IS_CHAN_QUARTER(chan))
112 + } else if (IEEE80211_IS_CHAN_QUARTER(chan)) {
113 ni->ni_rates = ic->ic_sup_quarter_rates;
116 + if ((vap->iv_flags & IEEE80211_F_PUREG) &&
117 + IEEE80211_IS_CHAN_ANYG(chan)) {
118 + ieee80211_setpuregbasicrates(&ni->ni_rates);
121 (void) ieee80211_sta_join1(PASS_NODE(ni));
123 Index: madwifi-ng-r2756-20071018/net80211/ieee80211_proto.c
124 ===================================================================
125 --- madwifi-ng-r2756-20071018.orig/net80211/ieee80211_proto.c 2007-10-24 06:20:16.117607766 +0200
126 +++ madwifi-ng-r2756-20071018/net80211/ieee80211_proto.c 2007-10-24 06:20:21.237899558 +0200
128 { 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */
131 +static const struct ieee80211_rateset basicpureg[] = {
132 + { 7, {2, 4, 11, 22, 12, 24, 48 } },
136 + * Mark basic rates for the 11g rate table based on the pureg setting
139 +ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs)
143 + for (i = 0; i < rs->rs_nrates; i++) {
144 + rs->rs_rates[i] &= IEEE80211_RATE_VAL;
145 + for (j = 0; j < basicpureg[0].rs_nrates; j++)
146 + if (basicpureg[0].rs_rates[j] == rs->rs_rates[i]) {
147 + rs->rs_rates[i] |= IEEE80211_RATE_BASIC;
154 * Mark the basic rates for the 11g rate table based on the
155 * specified mode. For 11b compatibility we mark only 11b
156 Index: madwifi-ng-r2756-20071018/net80211/ieee80211_var.h
157 ===================================================================
158 --- madwifi-ng-r2756-20071018.orig/net80211/ieee80211_var.h 2007-10-24 06:20:20.453854879 +0200
159 +++ madwifi-ng-r2756-20071018/net80211/ieee80211_var.h 2007-10-24 06:20:21.237899558 +0200
161 void ieee80211_build_countryie(struct ieee80211com *);
162 int ieee80211_media_setup(struct ieee80211com *, struct ifmedia *, u_int32_t,
163 ifm_change_cb_t, ifm_stat_cb_t);
164 +void ieee80211_setpuregbasicrates(struct ieee80211_rateset *rs);
167 /* Key update synchronization methods. XXX should not be visible. */