2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or 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.
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 ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef _WLC_BSSCFG_H_
18 #define _WLC_BSSCFG_H_
20 #include <wlc_types.h>
22 /* Check if a particular BSS config is AP or STA */
23 #define BSSCFG_AP(cfg) (0)
24 #define BSSCFG_STA(cfg) (1)
26 #define BSSCFG_IBSS(cfg) (!(cfg)->BSS)
28 /* forward declarations */
29 typedef struct wlc_bsscfg wlc_bsscfg_t
;
33 #define NTXRATE 64 /* # tx MPDUs rate is reported for */
34 #define MAXMACLIST 64 /* max # source MAC matches */
35 #define BCN_TEMPLATE_COUNT 2
37 /* Iterator for "associated" STA bss configs:
38 (struct wlc_info *wlc, int idx, wlc_bsscfg_t *cfg) */
39 #define FOREACH_AS_STA(wlc, idx, cfg) \
40 for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
41 if ((cfg = (wlc)->bsscfg[idx]) && BSSCFG_STA(cfg) && cfg->associated)
43 /* As above for all non-NULL BSS configs */
44 #define FOREACH_BSS(wlc, idx, cfg) \
45 for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
46 if ((cfg = (wlc)->bsscfg[idx]))
48 /* BSS configuration state */
50 struct wlc_info
*wlc
; /* wlc to which this bsscfg belongs to. */
51 bool up
; /* is this configuration up operational */
52 bool enable
; /* is this configuration enabled */
53 bool associated
; /* is BSS in ASSOCIATED state */
54 bool BSS
; /* infraustructure or adhac */
57 bool _ap
; /* is this configuration an AP */
58 struct wlc_if
*wlcif
; /* virtual interface, NULL for primary bsscfg */
59 void *sup
; /* pointer to supplicant state */
60 s8 sup_type
; /* type of supplicant */
61 bool sup_enable_wpa
; /* supplicant WPA on/off */
62 void *authenticator
; /* pointer to authenticator state */
63 bool sup_auth_pending
; /* flag for auth timeout */
65 u8 SSID_len
; /* the length of SSID */
66 u8 SSID
[IEEE80211_MAX_SSID_LEN
]; /* SSID string */
67 struct scb
*bcmc_scb
[MAXBANDS
]; /* one bcmc_scb per band */
68 s8 _idx
; /* the index of this bsscfg,
69 * assigned at wlc_bsscfg_alloc()
72 uint nmac
; /* # of entries on maclist array */
73 int macmode
; /* allow/deny stations on maclist array */
74 struct ether_addr
*maclist
; /* list of source MAC addrs to match */
77 u32 wsec
; /* wireless security bitvec */
78 s16 auth
; /* 802.11 authentication: Open, Shared Key, WPA */
79 s16 openshared
; /* try Open auth first, then Shared Key */
80 bool wsec_restrict
; /* drop unencrypted packets if wsec is enabled */
81 bool eap_restrict
; /* restrict data until 802.1X auth succeeds */
82 u16 WPA_auth
; /* WPA: authenticated key management */
83 bool wpa2_preauth
; /* default is true, wpa_cap sets value */
84 bool wsec_portopen
; /* indicates keys are plumbed */
85 wsec_iv_t wpa_none_txiv
; /* global txiv for WPA_NONE, tkip and aes */
86 int wsec_index
; /* 0-3: default tx key, -1: not set */
87 wsec_key_t
*bss_def_keys
[WLC_DEFAULT_KEYS
]; /* default key storage */
89 /* TKIP countermeasures */
90 bool tkip_countermeasures
; /* flags TKIP no-assoc period */
91 u32 tk_cm_dt
; /* detect timer */
92 u32 tk_cm_bt
; /* blocking timer */
93 u32 tk_cm_bt_tmstmp
; /* Timestamp when TKIP BT is activated */
94 bool tk_cm_activate
; /* activate countermeasures after EAPOL-Key sent */
96 u8 BSSID
[ETH_ALEN
]; /* BSSID (associated) */
97 u8 cur_etheraddr
[ETH_ALEN
]; /* h/w address */
98 u16 bcmc_fid
; /* the last BCMC FID queued to TX_BCMC_FIFO */
99 u16 bcmc_fid_shm
; /* the last BCMC FID written to shared mem */
101 u32 flags
; /* WLC_BSSCFG flags; see below */
103 u8
*bcn
; /* AP beacon */
104 uint bcn_len
; /* AP beacon length */
105 bool ar_disassoc
; /* disassociated in associated recreation */
107 int auth_atmptd
; /* auth type (open/shared) attempted */
109 pmkid_cand_t pmkid_cand
[MAXPMKID
]; /* PMKID candidate list */
110 uint npmkid_cand
; /* num PMKID candidates */
111 pmkid_t pmkid
[MAXPMKID
]; /* PMKID cache */
112 uint npmkid
; /* num cached PMKIDs */
114 wlc_bss_info_t
*target_bss
; /* BSS parms during tran. to ASSOCIATED state */
115 wlc_bss_info_t
*current_bss
; /* BSS parms in ASSOCIATED state */
118 bool PMawakebcn
; /* bcn recvd during current waking state */
119 bool PMpending
; /* waiting for tx status with PM indicated set */
120 bool priorPMstate
; /* Detecting PM state transitions */
121 bool PSpoll
; /* whether there is an outstanding PS-Poll frame */
123 /* BSSID entry in RCMTA, use the wsec key management infrastructure to
124 * manage the RCMTA entries.
128 /* 'unique' ID of this bsscfg, assigned at bsscfg allocation */
131 uint txrspecidx
; /* index into tx rate circular buffer */
132 ratespec_t txrspec
[NTXRATE
][2]; /* circular buffer of prev MPDUs tx rates */
135 #define WLC_BSSCFG_11N_DISABLE 0x1000 /* Do not advertise .11n IEs for this BSS */
136 #define WLC_BSSCFG_HW_BCN 0x20 /* The BSS is generating beacons in HW */
138 #define HWBCN_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_BCN) != 0)
139 #define HWPRB_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_PRB) != 0)
141 extern void wlc_bsscfg_ID_assign(struct wlc_info
*wlc
, wlc_bsscfg_t
* bsscfg
);
143 /* Extend N_ENAB to per-BSS */
144 #define BSS_N_ENAB(wlc, cfg) \
145 (N_ENAB((wlc)->pub) && !((cfg)->flags & WLC_BSSCFG_11N_DISABLE))
147 #define MBSS_BCN_ENAB(cfg) 0
148 #define MBSS_PRB_ENAB(cfg) 0
149 #define SOFTBCN_ENAB(pub) (0)
150 #define SOFTPRB_ENAB(pub) (0)
151 #define wlc_bsscfg_tx_check(a) do { } while (0);
153 #endif /* _WLC_BSSCFG_H_ */