1 Index: madwifi-ng-r2568-20070710/ath/if_ath.c
2 ===================================================================
3 --- madwifi-ng-r2568-20070710.orig/ath/if_ath.c 2007-07-13 11:18:17.733307111 +0200
4 +++ madwifi-ng-r2568-20070710/ath/if_ath.c 2007-07-13 11:18:18.945376179 +0200
6 static char *autocreate = NULL;
7 static char *ratectl = DEF_RATE_CTL;
12 static int countrycode = -1;
13 static int outdoor = -1;
14 static int xchanmode = -1;
16 rfkill ? "on" : "off");
17 ath_hal_setrfsilent(ah, rfkill);
20 - printk(KERN_INFO "ath_pci: ath_pci: switching per-packet transmit power control %s\n",
21 - tpc ? "on" : "off");
22 - ath_hal_settpc(ah, tpc);
26 * Setup rate tables for all potential media types.
31 sc->sc_hastpc = ath_hal_hastpc(ah);
32 - if (sc->sc_hastpc || ath_hal_hastxpowlimit(ah))
33 + if(tpc && !sc->sc_hastpc) {
34 + printk(KERN_WARNING "ath_pci: WARNING: per-packet transmit power control was requested, but is not supported by the hardware.\n");
37 + printk(KERN_INFO "ath_pci: switching per-packet transmit power control %s\n",
38 + tpc ? "on" : "off");
39 + ath_hal_settpc(ah, tpc);
42 - if (ath_hal_hastxpowlimit(ah))
43 + tpc = 0; /* TPC is always zero, when compiled without ATH_CAP_TPC */
45 + if (sc->sc_hastpc || ath_hal_hastxpowlimit(ah))
46 ic->ic_caps |= IEEE80211_C_TXPMGT;
53 - /* Re-enable after suspend (?) */
54 + /* Re-enable after suspend */
55 ath_hal_settpc(ah, tpc);
58 @@ -8787,26 +8786,16 @@
59 * Search for the VAP that needs a txpow change, if any
61 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
63 - if (ic->ic_newtxpowlimit == vap->iv_bss->ni_txpower) {
64 + if (!tpc || ic->ic_newtxpowlimit >= vap->iv_bss->ni_txpower) {
65 vap->iv_bss->ni_txpower = clamped_txpow;
66 ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, set_node_txpower, &clamped_txpow);
69 - vap->iv_bss->ni_txpower = clamped_txpow;
70 - ieee80211_iterate_nodes(&vap->iv_ic->ic_sta, set_node_txpower, &clamped_txpow);
74 - ic->ic_newtxpowlimit = sc->sc_curtxpow = clamped_txpow;
75 + sc->sc_curtxpow = clamped_txpow;
78 - if (ic->ic_newtxpowlimit >= txpowlimit)
79 - ath_hal_settxpowlimit(ah, ic->ic_newtxpowlimit);
81 - if (ic->ic_newtxpowlimit != txpowlimit)
82 - ath_hal_settxpowlimit(ah, ic->ic_newtxpowlimit);
84 + if (clamped_txpow != txpowlimit)
85 + ath_hal_settxpowlimit(ah, clamped_txpow);
89 Index: madwifi-ng-r2568-20070710/net80211/ieee80211_wireless.c
90 ===================================================================
91 --- madwifi-ng-r2568-20070710.orig/net80211/ieee80211_wireless.c 2007-07-13 11:18:13.473064331 +0200
92 +++ madwifi-ng-r2568-20070710/net80211/ieee80211_wireless.c 2007-07-13 11:18:18.949376408 +0200
95 if (!fixed) /* no change */
97 + ic->ic_newtxpowlimit = IEEE80211_TXPOWER_MAX;
98 ic->ic_flags &= ~IEEE80211_F_TXPOW_FIXED;