Date: Sat, 3 Oct 2015 20:45:44 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288632 - head/sys/dev/usb/wlan Message-ID: <201510032045.t93Kji63006079@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sat Oct 3 20:45:43 2015 New Revision: 288632 URL: https://svnweb.freebsd.org/changeset/base/288632 Log: rum(4): implement iv_update_beacon call (fixes client power save support). Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3632 Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sat Oct 3 20:44:16 2015 (r288631) +++ head/sys/dev/usb/wlan/if_rum.c Sat Oct 3 20:45:43 2015 (r288632) @@ -227,6 +227,9 @@ static int rum_set_beacon(struct rum_so struct ieee80211vap *); static int rum_alloc_beacon(struct rum_softc *, struct ieee80211vap *); +static void rum_update_beacon_cb(struct rum_softc *, + union sec_param *, uint8_t, uint8_t); +static void rum_update_beacon(struct ieee80211vap *, int); static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static void rum_scan_start(struct ieee80211com *); @@ -617,6 +620,7 @@ rum_vap_create(struct ieee80211com *ic, /* override state transition machine */ rvp->newstate = vap->iv_newstate; vap->iv_newstate = rum_newstate; + vap->iv_update_beacon = rum_update_beacon; usb_callout_init_mtx(&rvp->ratectl_ch, &sc->sc_mtx, 0); TASK_INIT(&rvp->ratectl_task, 0, rum_ratectl_task, rvp); @@ -2275,6 +2279,56 @@ rum_alloc_beacon(struct rum_softc *sc, s return (rum_set_beacon(sc, vap)); } +static void +rum_update_beacon_cb(struct rum_softc *sc, union sec_param *data, + uint8_t rn_id, uint8_t rvp_id) +{ + struct ieee80211vap *vap = data->vap; + + rum_set_beacon(sc, vap); +} + +static void +rum_update_beacon(struct ieee80211vap *vap, int item) +{ + struct ieee80211com *ic = vap->iv_ic; + struct rum_softc *sc = ic->ic_softc; + struct rum_vap *rvp = RUM_VAP(vap); + struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off; + struct ieee80211_node *ni = vap->iv_bss; + struct mbuf *m = rvp->bcn_mbuf; + int mcast = 0; + + RUM_LOCK(sc); + if (m == NULL) { + m = ieee80211_beacon_alloc(ni, bo); + if (m == NULL) { + device_printf(sc->sc_dev, + "%s: could not allocate beacon frame\n", __func__); + RUM_UNLOCK(sc); + return; + } + rvp->bcn_mbuf = m; + } + + switch (item) { + case IEEE80211_BEACON_ERP: + rum_update_slot(ic); + break; + case IEEE80211_BEACON_TIM: + mcast = 1; /*TODO*/ + break; + default: + break; + } + RUM_UNLOCK(sc); + + setbit(bo->bo_flags, item); + ieee80211_beacon_update(ni, bo, m, mcast); + + rum_cmd_sleepable(sc, &vap, sizeof(vap), 0, 0, rum_update_beacon_cb); +} + static int rum_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_bpf_params *params)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510032045.t93Kji63006079>