1 /*-
2 * Copyright (c) 2015-2016 Andriy Voskoboinyk <avos@FreeBSD.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #include <sys/cdefs.h>
18 #include "opt_wlan.h"
19
20 #include <sys/param.h>
21 #include <sys/lock.h>
22 #include <sys/mutex.h>
23 #include <sys/mbuf.h>
24 #include <sys/kernel.h>
25 #include <sys/socket.h>
26 #include <sys/systm.h>
27 #include <sys/malloc.h>
28 #include <sys/queue.h>
29 #include <sys/taskqueue.h>
30 #include <sys/bus.h>
31 #include <sys/endian.h>
32 #include <sys/linker.h>
33
34 #include <net/if.h>
35 #include <net/ethernet.h>
36 #include <net/if_media.h>
37
38 #include <net80211/ieee80211_var.h>
39 #include <net80211/ieee80211_radiotap.h>
40
41 #include <dev/rtwn/if_rtwnvar.h>
42
43 #include <dev/rtwn/rtl8188e/r88e.h>
44 #include <dev/rtwn/rtl8188e/r88e_reg.h>
45
46 /*
47 * Enable/disable beaconing in AP/IBSS/Mesh modes.
48 */
49 void
r88e_beacon_enable(struct rtwn_softc * sc,int id,int enable)50 r88e_beacon_enable(struct rtwn_softc *sc, int id, int enable)
51 {
52
53 if (enable) {
54 rtwn_setbits_1(sc, R92C_MBID_NUM, 0, R88E_MBID_TXBCN_RPT(id));
55 rtwn_setbits_1(sc, R92C_BCN_CTRL(id),
56 0, R92C_BCN_CTRL_EN_BCN);
57 } else {
58 rtwn_setbits_1(sc, R92C_MBID_NUM, R88E_MBID_TXBCN_RPT(id), 0);
59 rtwn_setbits_1(sc, R92C_BCN_CTRL(id),
60 R92C_BCN_CTRL_EN_BCN, 0);
61 }
62 }
63
64 /*
65 * There's no firmware rate control, beacon processing isn't
66 * needed in STA mode.
67 */
68 void
r88e_sta_beacon_enable(struct rtwn_softc * sc,int id,bool enable)69 r88e_sta_beacon_enable(struct rtwn_softc *sc, int id, bool enable)
70 {
71 }
72