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