summaryrefslogtreecommitdiffstats
path: root/sys/dev/ral/rt2560.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2007-09-17 19:07:24 +0000
committersam <sam@FreeBSD.org>2007-09-17 19:07:24 +0000
commitd2e6b6eac7970920eccfe2d65f03d9ca3c6542ae (patch)
treedd53d98ae592f4e1d6caa3458fddec6956ad9dd5 /sys/dev/ral/rt2560.c
parentb6c4c36f72b670e2821f1e630182572a7b96337c (diff)
downloadFreeBSD-src-d2e6b6eac7970920eccfe2d65f03d9ca3c6542ae.zip
FreeBSD-src-d2e6b6eac7970920eccfe2d65f03d9ca3c6542ae.tar.gz
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)
Diffstat (limited to 'sys/dev/ral/rt2560.c')
-rw-r--r--sys/dev/ral/rt2560.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c
index b3bb76a..b72ca40 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);
OpenPOWER on IntegriCloud