Root/package/madwifi/patches/417-beacon_txpower.patch

1--- a/ath/if_ath.c
2+++ b/ath/if_ath.c
3@@ -395,7 +395,7 @@ static int bstuck_thresh = BSTUCK_THRESH
4 static char *autocreate = NULL;
5 static char *ratectl = DEF_RATE_CTL;
6 static int rfkill = 0;
7-static int tpc = 0;
8+static int tpc = 1;
9 static int countrycode = -1;
10 static int maxvaps = -1;
11 static int outdoor = -1;
12@@ -4932,6 +4932,7 @@ ath_beacon_setup(struct ath_softc *sc, s
13     (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\
14         == IEEE80211_F_SHPREAMBLE)
15     struct ieee80211com *ic = bf->bf_node->ni_ic;
16+ struct ieee80211vap *vap = bf->bf_node->ni_vap;
17     struct sk_buff *skb = bf->bf_skb;
18     struct ath_hal *ah = sc->sc_ah;
19     struct ath_desc *ds;
20@@ -4999,7 +5000,7 @@ ath_beacon_setup(struct ath_softc *sc, s
21         skb->len + IEEE80211_CRC_LEN, /* frame length */
22         sizeof(struct ieee80211_frame), /* header length */
23         HAL_PKT_TYPE_BEACON, /* Atheros packet type */
24- bf->bf_node->ni_txpower, /* txpower XXX */
25+ (vap->iv_beacon_txpow ? vap->iv_beacon_txpow : 63),
26         rate, 1, /* series 0 rate/tries */
27         HAL_TXKEYIX_INVALID, /* no encryption */
28         antenna, /* antenna mode */
29--- a/net80211/ieee80211_ioctl.h
30+++ b/net80211/ieee80211_ioctl.h
31@@ -652,6 +652,7 @@ enum {
32     IEEE80211_PARAM_WDS_SEP = 82, /* move wds stations into separate interfaces */
33     IEEE80211_PARAM_MAXASSOC = 83, /* maximum associated stations */
34     IEEE80211_PARAM_PROBEREQ = 84, /* enable handling of probe requests */
35+ IEEE80211_PARAM_BEACON_TXP = 85, /* set beacon tx power */
36 };
37 
38 #define SIOCG80211STATS (SIOCDEVPRIVATE+2)
39--- a/net80211/ieee80211_var.h
40+++ b/net80211/ieee80211_var.h
41@@ -254,6 +254,7 @@ struct ieee80211vap {
42     u_int8_t iv_dtim_period; /* DTIM period */
43     u_int8_t iv_dtim_count; /* DTIM count from last bcn */
44                             /* set/unset aid pwrsav state */
45+ u_int8_t iv_beacon_txpow; /* beacon tx power */
46     void (*iv_set_tim)(struct ieee80211_node *, int);
47     u_int8_t iv_uapsdinfo; /* sta mode QoS Info flags */
48     struct ieee80211_node *iv_bss; /* information for this node */
49--- a/net80211/ieee80211_wireless.c
50+++ b/net80211/ieee80211_wireless.c
51@@ -2871,6 +2871,9 @@ ieee80211_ioctl_setparam(struct net_devi
52     case IEEE80211_PARAM_PROBEREQ:
53         vap->iv_no_probereq = !value;
54         break;
55+ case IEEE80211_PARAM_BEACON_TXP:
56+ vap->iv_beacon_txpow = value;
57+ break;
58 #ifdef ATH_REVERSE_ENGINEERING
59     case IEEE80211_PARAM_DUMPREGS:
60         ieee80211_dump_registers(dev, info, w, extra);
61@@ -3236,6 +3239,9 @@ ieee80211_ioctl_getparam(struct net_devi
62     case IEEE80211_PARAM_PROBEREQ:
63         param[0] = !vap->iv_no_probereq;
64         break;
65+ case IEEE80211_PARAM_BEACON_TXP:
66+ param[0] = vap->iv_beacon_txpow;
67+ break;
68     default:
69         return -EOPNOTSUPP;
70     }
71@@ -5810,6 +5816,10 @@ static const struct iw_priv_args ieee802
72      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "probereq"},
73     { IEEE80211_PARAM_PROBEREQ,
74      0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_probereq"},
75+ { IEEE80211_PARAM_BEACON_TXP,
76+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "beacon_pwr"},
77+ { IEEE80211_PARAM_BEACON_TXP,
78+ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_beacon_pwr"},
79 
80 #ifdef ATH_REVERSE_ENGINEERING
81     /*
82

Archive Download this file



interactive