summaryrefslogtreecommitdiff
path: root/package/madwifi/patches/421-channel_handling.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-05-31 02:25:32 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-05-31 02:25:32 +0000
commit26099a3c2345d6fc4abbcbc08f58db15ea04577d (patch)
treea5b51ee707244e5675ccbab468024e45801eb33e /package/madwifi/patches/421-channel_handling.patch
parentd0b60d14ea3ced4a60015cc4d6443369c749d342 (diff)
downloadmtk-20170518-26099a3c2345d6fc4abbcbc08f58db15ea04577d.zip
mtk-20170518-26099a3c2345d6fc4abbcbc08f58db15ea04577d.tar.gz
mtk-20170518-26099a3c2345d6fc4abbcbc08f58db15ea04577d.tar.bz2
madwifi: add better hw detection, use a power offset for setting/getting tx power for cards that have a twisted eeprom
SVN-Revision: 16224
Diffstat (limited to 'package/madwifi/patches/421-channel_handling.patch')
-rw-r--r--package/madwifi/patches/421-channel_handling.patch59
1 files changed, 30 insertions, 29 deletions
diff --git a/package/madwifi/patches/421-channel_handling.patch b/package/madwifi/patches/421-channel_handling.patch
index 6531a9e..8ccecdf 100644
--- a/package/madwifi/patches/421-channel_handling.patch
+++ b/package/madwifi/patches/421-channel_handling.patch
@@ -184,7 +184,7 @@
#ifdef ATH_SUPERG_XR
ic->ic_ath_cap |= (ath_hal_xrsupported(ah) ? IEEE80211_ATHC_XR : 0);
#endif
-@@ -4469,17 +4485,17 @@ ath_mode_init(struct net_device *dev)
+@@ -4470,17 +4486,17 @@ ath_mode_init(struct net_device *dev)
* Set the slot time based on the current setting.
*/
static void
@@ -210,7 +210,7 @@
sc->sc_updateslot = OK;
}
-@@ -4501,7 +4517,7 @@ ath_updateslot(struct net_device *dev)
+@@ -4502,7 +4518,7 @@ ath_updateslot(struct net_device *dev)
if (ic->ic_opmode == IEEE80211_M_HOSTAP)
sc->sc_updateslot = UPDATE;
else if (dev->flags & IFF_RUNNING)
@@ -219,7 +219,7 @@
}
#ifdef ATH_SUPERG_DYNTURBO
-@@ -5345,7 +5361,7 @@ ath_beacon_send(struct ath_softc *sc, in
+@@ -5346,7 +5362,7 @@ ath_beacon_send(struct ath_softc *sc, in
sc->sc_updateslot = COMMIT; /* commit next beacon */
sc->sc_slotupdate = slot;
} else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot))
@@ -228,7 +228,7 @@
if (bfaddr != 0) {
/*
-@@ -7798,12 +7814,14 @@ ath_get_ivlen(struct ieee80211_key *k)
+@@ -7799,12 +7815,14 @@ ath_get_ivlen(struct ieee80211_key *k)
* Get transmit rate index using rate in Kbps
*/
static __inline int
@@ -245,7 +245,7 @@
ndx = i;
break;
}
-@@ -8096,7 +8114,7 @@ ath_tx_start(struct net_device *dev, str
+@@ -8097,7 +8115,7 @@ ath_tx_start(struct net_device *dev, str
atype = HAL_PKT_TYPE_NORMAL; /* default */
if (ismcast) {
@@ -254,7 +254,7 @@
txrate = rt->info[rix].rateCode;
if (shortPreamble)
txrate |= rt->info[rix].shortPreamble;
-@@ -9063,7 +9081,7 @@ ath_chan_change(struct ath_softc *sc, st
+@@ -9064,7 +9082,7 @@ ath_chan_change(struct ath_softc *sc, st
struct net_device *dev = sc->sc_dev;
enum ieee80211_phymode mode;
@@ -263,7 +263,7 @@
ath_rate_setup(dev, mode);
ath_setcurmode(sc, mode);
-@@ -10120,8 +10138,7 @@ ath_newassoc(struct ieee80211_node *ni,
+@@ -10121,8 +10139,7 @@ ath_newassoc(struct ieee80211_node *ni,
}
static int
@@ -273,7 +273,7 @@
{
struct ath_softc *sc = dev->priv;
struct ieee80211com *ic = &sc->sc_ic;
-@@ -10135,17 +10152,31 @@ ath_getchannels(struct net_device *dev,
+@@ -10136,17 +10153,31 @@ ath_getchannels(struct net_device *dev,
EPRINTF(sc, "Insufficient memory for channel table!\n");
return -ENOMEM;
}
@@ -307,7 +307,7 @@
/*
* Convert HAL channels to ieee80211 ones.
*/
-@@ -10389,7 +10420,7 @@ ath_xr_rate_setup(struct net_device *dev
+@@ -10392,7 +10423,7 @@ ath_xr_rate_setup(struct net_device *dev
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
struct ieee80211_rateset *rs;
@@ -316,7 +316,7 @@
sc->sc_xr_rates = ath_hal_getratetable(ah, HAL_MODE_XR);
rt = sc->sc_xr_rates;
if (rt == NULL)
-@@ -10402,57 +10433,16 @@ ath_xr_rate_setup(struct net_device *dev
+@@ -10405,57 +10436,16 @@ ath_xr_rate_setup(struct net_device *dev
} else
maxrates = rt->rateCount;
rs = &ic->ic_sup_xr_rates;
@@ -380,7 +380,7 @@
static int
ath_rate_setup(struct net_device *dev, u_int mode)
{
-@@ -10461,7 +10451,7 @@ ath_rate_setup(struct net_device *dev, u
+@@ -10464,7 +10454,7 @@ ath_rate_setup(struct net_device *dev, u
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
struct ieee80211_rateset *rs;
@@ -389,7 +389,7 @@
switch (mode) {
case IEEE80211_MODE_11A:
-@@ -10479,6 +10469,12 @@ ath_rate_setup(struct net_device *dev, u
+@@ -10482,6 +10472,12 @@ ath_rate_setup(struct net_device *dev, u
case IEEE80211_MODE_TURBO_G:
sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_108G);
break;
@@ -402,7 +402,7 @@
default:
DPRINTF(sc, ATH_DEBUG_ANY, "Invalid mode %u\n", mode);
return 0;
-@@ -10493,10 +10489,16 @@ ath_rate_setup(struct net_device *dev, u
+@@ -10496,10 +10492,16 @@ ath_rate_setup(struct net_device *dev, u
maxrates = IEEE80211_RATE_MAXSIZE;
} else
maxrates = rt->rateCount;
@@ -419,7 +419,7 @@
return 1;
}
-@@ -10525,13 +10527,18 @@ ath_setcurmode(struct ath_softc *sc, enu
+@@ -10528,13 +10530,18 @@ ath_setcurmode(struct ath_softc *sc, enu
{ 0, 500, 130 },
};
const HAL_RATE_TABLE *rt;
@@ -440,7 +440,7 @@
memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap));
for (i = 0; i < 32; i++) {
u_int8_t ix = rt->rateCodeToIndex[i];
-@@ -10541,7 +10548,7 @@ ath_setcurmode(struct ath_softc *sc, enu
+@@ -10544,7 +10551,7 @@ ath_setcurmode(struct ath_softc *sc, enu
continue;
}
sc->sc_hwmap[i].ieeerate =
@@ -449,7 +449,7 @@
if (rt->info[ix].shortPreamble ||
rt->info[ix].phy == IEEE80211_T_OFDM)
sc->sc_hwmap[i].flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
-@@ -10942,9 +10949,106 @@ enum {
+@@ -10945,9 +10952,106 @@ enum {
ATH_MAXVAPS = 26,
ATH_INTMIT = 27,
ATH_NOISE_IMMUNITY = 28,
@@ -557,7 +557,7 @@
static int
ath_sysctl_set_intmit(struct ath_softc *sc, long ctl, u_int val)
{
-@@ -11023,6 +11127,7 @@ static int
+@@ -11026,6 +11130,7 @@ static int
ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos)
{
struct ath_softc *sc = ctl->extra1;
@@ -565,7 +565,7 @@
struct ath_hal *ah = sc->sc_ah;
u_int val;
u_int tab_3_val[3];
-@@ -11046,25 +11151,34 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
+@@ -11049,25 +11154,34 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
lenp, ppos);
if (ret == 0) {
switch ((long)ctl->extra2) {
@@ -613,7 +613,7 @@
break;
case ATH_SOFTLED:
if (val != sc->sc_softled) {
-@@ -11217,6 +11331,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
+@@ -11220,6 +11334,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
}
} else {
switch ((long)ctl->extra2) {
@@ -623,7 +623,7 @@
case ATH_SLOTTIME:
val = ath_hal_getslottime(ah);
break;
-@@ -11235,6 +11352,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
+@@ -11238,6 +11355,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
case ATH_COUNTRYCODE:
ath_hal_getcountrycode(ah, &val);
break;
@@ -633,7 +633,7 @@
case ATH_MAXVAPS:
val = ath_maxvaps;
break;
-@@ -11348,11 +11468,17 @@ static const ctl_table ath_sysctl_templa
+@@ -11351,11 +11471,17 @@ static const ctl_table ath_sysctl_templa
},
{ .ctl_name = CTL_AUTO,
.procname = "countrycode",
@@ -652,7 +652,7 @@
.procname = "maxvaps",
.mode = 0444,
.proc_handler = ath_sysctl_halparam,
-@@ -11360,7 +11486,7 @@ static const ctl_table ath_sysctl_templa
+@@ -11363,7 +11489,7 @@ static const ctl_table ath_sysctl_templa
},
{ .ctl_name = CTL_AUTO,
.procname = "regdomain",
@@ -661,7 +661,7 @@
.proc_handler = ath_sysctl_halparam,
.extra2 = (void *)ATH_REGDOMAIN,
},
-@@ -11423,6 +11549,12 @@ static const ctl_table ath_sysctl_templa
+@@ -11426,6 +11552,12 @@ static const ctl_table ath_sysctl_templa
.extra2 = (void *)ATH_ACKRATE,
},
{ .ctl_name = CTL_AUTO,
@@ -674,7 +674,7 @@
.procname = "rp",
.mode = 0200,
.proc_handler = ath_sysctl_halparam,
-@@ -11663,13 +11795,6 @@ static ctl_table ath_static_sysctls[] =
+@@ -11666,13 +11798,6 @@ static ctl_table ath_static_sysctls[] =
},
#endif
{ .ctl_name = CTL_AUTO,
@@ -688,7 +688,7 @@
.procname = "maxvaps",
.mode = 0444,
.data = &ath_maxvaps,
-@@ -11677,13 +11802,6 @@ static ctl_table ath_static_sysctls[] =
+@@ -11680,13 +11805,6 @@ static ctl_table ath_static_sysctls[] =
.proc_handler = proc_dointvec
},
{ .ctl_name = CTL_AUTO,
@@ -704,7 +704,7 @@
.data = &ath_xchanmode,
--- a/ath/if_athvar.h
+++ b/ath/if_athvar.h
-@@ -688,16 +688,17 @@ struct ath_softc {
+@@ -688,17 +688,18 @@ struct ath_softc {
int8_t sc_ofdm_weak_det; /* OFDM weak frames detection, -1 == auto */
/* rate tables */
@@ -718,6 +718,7 @@
- const HAL_RATE_TABLE *sc_quarter_rates; /* quarter rate table */
HAL_OPMODE sc_opmode; /* current hal operating mode */
enum ieee80211_phymode sc_curmode; /* current phy mode */
+ u_int sc_poweroffset; /* hardware power offset */
u_int16_t sc_curtxpow; /* current tx power limit */
u_int16_t sc_curaid; /* current association id */
HAL_CHANNEL sc_curchan; /* current h/w channel */
@@ -725,7 +726,7 @@
u_int8_t sc_curbssid[IEEE80211_ADDR_LEN];
u_int8_t sc_rixmap[256]; /* IEEE to h/w rate table ix */
struct {
-@@ -808,6 +809,8 @@ struct ath_softc {
+@@ -809,6 +810,8 @@ struct ath_softc {
u_int32_t sc_dturbo_bw_turbo; /* bandwidth threshold */
#endif
u_int sc_slottimeconf; /* manual override for slottime */
@@ -734,7 +735,7 @@
struct timer_list sc_dfs_excl_timer; /* mark expiration timer task */
struct timer_list sc_dfs_cac_timer; /* dfs wait timer */
-@@ -826,6 +829,7 @@ struct ath_softc {
+@@ -827,6 +830,7 @@ struct ath_softc {
int sc_rp_num;
int sc_rp_min;
HAL_BOOL (*sc_rp_analyse)(struct ath_softc *sc);
@@ -742,7 +743,7 @@
struct ATH_TQ_STRUCT sc_rp_tq;
int sc_rp_ignored; /* if set, we ignored all
-@@ -941,6 +945,48 @@ int ar_device(int devid);
+@@ -942,6 +946,48 @@ int ar_device(int devid);
DEV_NAME(_v->iv_ic->ic_dev))
void ath_radar_detected(struct ath_softc *sc, const char* message);