aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ral
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2007-09-17 19:07:24 +0000
committerSam Leffler <sam@FreeBSD.org>2007-09-17 19:07:24 +0000
commitb105a069080d9362f2ff71a22e2a1702b7e23d42 (patch)
treedd53d98ae592f4e1d6caa3458fddec6956ad9dd5 /sys/dev/ral
parent2badb3db3c992f4424354b2241f7f928d33abee3 (diff)
downloadsrc-b105a069080d9362f2ff71a22e2a1702b7e23d42.tar.gz
src-b105a069080d9362f2ff71a22e2a1702b7e23d42.zip
Update beacon handling to sync w/ vap code base:
o add driver callback to handle notification of beacon changes; this is required for devices that manage beacon frames themselves (devices must override the default handler which does nothing) o move beacon update-related flags from ieee80211com to the beacon offsets storage (or handle however a driver wants) o expand beacon offsets structure with members needed for 11h/dfs and appie's o change calling convention for ieee80211_beacon_alloc and ieee80211_beacon_update o add overlapping bss support for 11g; requires driver to pass beacon frames from overlapping bss up to net80211 which is not presently done by any driver o move HT beacon contents update to a routine in the HT code area Reviewed by: avatar, thompsa, sephe Approved by: re (blanket wireless)
Notes
Notes: svn path=/head/; revision=172211
Diffstat (limited to 'sys/dev/ral')
-rw-r--r--sys/dev/ral/rt2560.c15
-rw-r--r--sys/dev/ral/rt2661.c2
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index b3bb76ad623a..b72ca403f149 100644
--- a/sys/dev/ral/rt2560.c
+++ b/sys/dev/ral/rt2560.c
@@ -105,6 +105,7 @@ static void rt2560_tx_intr(struct rt2560_softc *);
static void rt2560_prio_intr(struct rt2560_softc *);
static void rt2560_decryption_intr(struct rt2560_softc *);
static void rt2560_rx_intr(struct rt2560_softc *);
+static void rt2560_beacon_update(struct ieee80211com *, int item);
static void rt2560_beacon_expire(struct rt2560_softc *);
static void rt2560_wakeup_expire(struct rt2560_softc *);
static uint8_t rt2560_rxrate(struct rt2560_rx_desc *);
@@ -301,6 +302,7 @@ rt2560_attach(device_t dev, int id)
sc->sc_newstate = ic->ic_newstate;
ic->ic_newstate = rt2560_newstate;
ic->ic_raw_xmit = rt2560_raw_xmit;
+ ic->ic_update_beacon = rt2560_beacon_update;
ieee80211_media_init(ic, rt2560_media_change, ieee80211_media_status);
bpfattach2(ifp, DLT_IEEE802_11_RADIO,
@@ -780,7 +782,7 @@ rt2560_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
ic->ic_opmode == IEEE80211_M_IBSS) {
- m = ieee80211_beacon_alloc(ic, ni, &sc->sc_bo);
+ m = ieee80211_beacon_alloc(ni, &sc->sc_bo);
if (m == NULL) {
device_printf(sc->sc_dev,
"could not allocate beacon\n");
@@ -1277,6 +1279,15 @@ rt2560_rx_intr(struct rt2560_softc *sc)
RAL_WRITE(sc, RT2560_SECCSR0, RT2560_KICK_DECRYPT);
}
+static void
+rt2560_beacon_update(struct ieee80211com *ic, int item)
+{
+ struct rt2560_softc *sc = ic->ic_ifp->if_softc;
+ struct ieee80211_beacon_offsets *bo = &sc->sc_bo;
+
+ setbit(bo->bo_flags, item);
+}
+
/*
* This function is called periodically in IBSS mode when a new beacon must be
* sent out.
@@ -1301,7 +1312,7 @@ rt2560_beacon_expire(struct rt2560_softc *sc)
bus_dmamap_sync(sc->bcnq.data_dmat, data->map, BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->bcnq.data_dmat, data->map);
- ieee80211_beacon_update(ic, data->ni, &sc->sc_bo, data->m, 1);
+ ieee80211_beacon_update(data->ni, &sc->sc_bo, data->m, 1);
if (bpf_peers_present(ic->ic_rawbpf))
bpf_mtap(ic->ic_rawbpf, data->m);
diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c
index b7086f532e7a..60171ee6e74b 100644
--- a/sys/dev/ral/rt2661.c
+++ b/sys/dev/ral/rt2661.c
@@ -2803,7 +2803,7 @@ rt2661_prepare_beacon(struct rt2661_softc *sc)
struct mbuf *m0;
int rate;
- m0 = ieee80211_beacon_alloc(ic, ic->ic_bss, &bo);
+ m0 = ieee80211_beacon_alloc(ic->ic_bss, &bo);
if (m0 == NULL) {
device_printf(sc->sc_dev, "could not allocate beacon frame\n");
return ENOBUFS;