/* NB: setup here so ath_rate_update is happy */
ath_setcurmode(sc, IEEE80211_MODE_11A);
/* NB: setup here so ath_rate_update is happy */
ath_setcurmode(sc, IEEE80211_MODE_11A);
-@@ -909,10 +929,6 @@ ath_attach(u_int16_t devid, struct net_d
+@@ -908,10 +928,6 @@ ath_attach(u_int16_t devid, struct net_d
if (ic->ic_opmode == IEEE80211_M_HOSTAP)
sc->sc_updateslot = UPDATE;
else if (dev->flags & IFF_RUNNING)
if (ic->ic_opmode == IEEE80211_M_HOSTAP)
sc->sc_updateslot = UPDATE;
else if (dev->flags & IFF_RUNNING)
-@@ -5342,7 +5358,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))
sc->sc_updateslot = COMMIT; /* commit next beacon */
sc->sc_slotupdate = slot;
} else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot))
-@@ -8094,7 +8112,7 @@ ath_tx_start(struct net_device *dev, str
+@@ -8097,7 +8115,7 @@ ath_tx_start(struct net_device *dev, str
-@@ -9061,7 +9079,7 @@ ath_chan_change(struct ath_softc *sc, st
+@@ -9064,7 +9082,7 @@ ath_chan_change(struct ath_softc *sc, st
ath_rate_setup(dev, mode);
ath_setcurmode(sc, mode);
ath_rate_setup(dev, mode);
ath_setcurmode(sc, mode);
-@@ -10110,8 +10128,7 @@ ath_newassoc(struct ieee80211_node *ni,
+@@ -10121,8 +10139,7 @@ ath_newassoc(struct ieee80211_node *ni,
-@@ -10125,17 +10142,31 @@ ath_getchannels(struct net_device *dev,
+@@ -10136,17 +10153,31 @@ ath_getchannels(struct net_device *dev,
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
struct ieee80211_rateset *rs;
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
struct ieee80211_rateset *rs;
-@@ -10451,7 +10441,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;
struct ieee80211com *ic = &sc->sc_ic;
const HAL_RATE_TABLE *rt;
struct ieee80211_rateset *rs;
-@@ -10469,6 +10459,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;
case IEEE80211_MODE_TURBO_G:
sc->sc_rates[mode] = ath_hal_getratetable(ah, HAL_MODE_108G);
break;
default:
DPRINTF(sc, ATH_DEBUG_ANY, "Invalid mode %u\n", mode);
return 0;
default:
DPRINTF(sc, ATH_DEBUG_ANY, "Invalid mode %u\n", mode);
return 0;
-@@ -10483,10 +10479,16 @@ ath_rate_setup(struct net_device *dev, u
+@@ -10496,10 +10492,16 @@ ath_rate_setup(struct net_device *dev, u
-@@ -10515,13 +10517,18 @@ ath_setcurmode(struct ath_softc *sc, enu
+@@ -10528,13 +10530,18 @@ ath_setcurmode(struct ath_softc *sc, enu
memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap));
for (i = 0; i < 32; i++) {
u_int8_t ix = rt->rateCodeToIndex[i];
memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap));
for (i = 0; i < 32; i++) {
u_int8_t ix = rt->rateCodeToIndex[i];
-@@ -10531,7 +10538,7 @@ ath_setcurmode(struct ath_softc *sc, enu
+@@ -10544,7 +10551,7 @@ ath_setcurmode(struct ath_softc *sc, enu
if (rt->info[ix].shortPreamble ||
rt->info[ix].phy == IEEE80211_T_OFDM)
sc->sc_hwmap[i].flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
if (rt->info[ix].shortPreamble ||
rt->info[ix].phy == IEEE80211_T_OFDM)
sc->sc_hwmap[i].flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos)
{
struct ath_softc *sc = ctl->extra1;
ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos)
{
struct ath_softc *sc = ctl->extra1;
-@@ -11036,25 +11141,33 @@ 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) {
+ case ATH_REGDOMAIN:
+ ath_hal_setregdomain(ah, val);
+ break;
lenp, ppos);
if (ret == 0) {
switch ((long)ctl->extra2) {
+ case ATH_REGDOMAIN:
+ ath_hal_setregdomain(ah, val);
+ break;
-@@ -11207,6 +11320,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
+@@ -11220,6 +11334,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
-@@ -11225,6 +11341,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
+@@ -11238,6 +11355,9 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
.proc_handler = ath_sysctl_halparam,
.extra2 = (void *)ATH_REGDOMAIN,
},
.proc_handler = ath_sysctl_halparam,
.extra2 = (void *)ATH_REGDOMAIN,
},
- 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 */
- 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_int16_t sc_curtxpow; /* current tx power limit */
u_int16_t sc_curaid; /* current association id */
HAL_CHANNEL sc_curchan; /* current h/w channel */
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 */
for (i = 0; i < nrates; i++)
if (IEEERATE(ic, mode, i) == rate)
return i;
for (i = 0; i < nrates; i++)
if (IEEERATE(ic, mode, i) == rate)
return i;
int ss_last = ss->ss_last;
struct ieee80211_channel *best;
struct ap_state *as = ss->ss_priv;
int ss_last = ss->ss_last;
struct ieee80211_channel *best;
struct ap_state *as = ss->ss_priv;
"%s: best: channel %u rssi %d\n",
__func__, i, as->as_maxrssi[i]);
}
"%s: best: channel %u rssi %d\n",
__func__, i, as->as_maxrssi[i]);
}
-@@ -647,6 +649,7 @@ ap_end(struct ieee80211_scan_state *ss,
+@@ -609,6 +611,7 @@ ap_end(struct ieee80211_scan_state *ss,
/* XXX: notify all VAPs? */
/* if this is a dynamic turbo frequency , start with normal
* mode first */
/* XXX: notify all VAPs? */
/* if this is a dynamic turbo frequency , start with normal
* mode first */
-@@ -661,6 +664,11 @@ ap_end(struct ieee80211_scan_state *ss,
+@@ -623,6 +626,11 @@ ap_end(struct ieee80211_scan_state *ss,