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 _BRCM_BSSCFG_H_
18 #define _BRCM_BSSCFG_H_
20 /* Check if a particular BSS config is AP or STA */
21 #define BSSCFG_AP(cfg) (0)
22 #define BSSCFG_STA(cfg) (1)
24 #define BSSCFG_IBSS(cfg) (!(cfg)->BSS)
26 #define NTXRATE 64 /* # tx MPDUs rate is reported for */
27 #define MAXMACLIST 64 /* max # source MAC matches */
28 #define BCN_TEMPLATE_COUNT 2
30 /* Iterator for "associated" STA bss configs:
31 (struct wlc_info *wlc, int idx, struct wlc_bsscfg *cfg) */
32 #define FOREACH_AS_STA(wlc, idx, cfg) \
33 for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
34 if ((cfg = (wlc)->bsscfg[idx]) && BSSCFG_STA(cfg) && cfg->associated)
36 /* As above for all non-NULL BSS configs */
37 #define FOREACH_BSS(wlc, idx, cfg) \
38 for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
39 if ((cfg = (wlc)->bsscfg[idx]))
41 /* BSS configuration state */
43 struct wlc_info *wlc; /* wlc to which this bsscfg belongs to. */
44 bool up; /* is this configuration up operational */
45 bool enable; /* is this configuration enabled */
46 bool associated; /* is BSS in ASSOCIATED state */
47 bool BSS; /* infraustructure or adhac */
50 u8 SSID_len; /* the length of SSID */
51 u8 SSID[IEEE80211_MAX_SSID_LEN]; /* SSID string */
52 struct scb *bcmc_scb[MAXBANDS]; /* one bcmc_scb per band */
53 s8 _idx; /* the index of this bsscfg,
54 * assigned at wlc_bsscfg_alloc()
57 uint nmac; /* # of entries on maclist array */
58 int macmode; /* allow/deny stations on maclist array */
59 struct ether_addr *maclist; /* list of source MAC addrs to match */
62 u32 wsec; /* wireless security bitvec */
63 s16 auth; /* 802.11 authentication: Open, Shared Key, WPA */
64 s16 openshared; /* try Open auth first, then Shared Key */
65 bool wsec_restrict; /* drop unencrypted packets if wsec is enabled */
66 bool eap_restrict; /* restrict data until 802.1X auth succeeds */
67 u16 WPA_auth; /* WPA: authenticated key management */
68 bool wpa2_preauth; /* default is true, wpa_cap sets value */
69 bool wsec_portopen; /* indicates keys are plumbed */
70 wsec_iv_t wpa_none_txiv; /* global txiv for WPA_NONE, tkip and aes */
71 int wsec_index; /* 0-3: default tx key, -1: not set */
72 wsec_key_t *bss_def_keys[WLC_DEFAULT_KEYS]; /* default key storage */
74 /* TKIP countermeasures */
75 bool tkip_countermeasures; /* flags TKIP no-assoc period */
76 u32 tk_cm_dt; /* detect timer */
77 u32 tk_cm_bt; /* blocking timer */
78 u32 tk_cm_bt_tmstmp; /* Timestamp when TKIP BT is activated */
79 bool tk_cm_activate; /* activate countermeasures after EAPOL-Key sent */
81 u8 BSSID[ETH_ALEN]; /* BSSID (associated) */
82 u8 cur_etheraddr[ETH_ALEN]; /* h/w address */
83 u16 bcmc_fid; /* the last BCMC FID queued to TX_BCMC_FIFO */
84 u16 bcmc_fid_shm; /* the last BCMC FID written to shared mem */
86 u32 flags; /* WLC_BSSCFG flags; see below */
88 u8 *bcn; /* AP beacon */
89 uint bcn_len; /* AP beacon length */
90 bool ar_disassoc; /* disassociated in associated recreation */
92 int auth_atmptd; /* auth type (open/shared) attempted */
94 pmkid_cand_t pmkid_cand[MAXPMKID]; /* PMKID candidate list */
95 uint npmkid_cand; /* num PMKID candidates */
96 pmkid_t pmkid[MAXPMKID]; /* PMKID cache */
97 uint npmkid; /* num cached PMKIDs */
99 wlc_bss_info_t *current_bss; /* BSS parms in ASSOCIATED state */
102 bool PMawakebcn; /* bcn recvd during current waking state */
103 bool PMpending; /* waiting for tx status with PM indicated set */
104 bool priorPMstate; /* Detecting PM state transitions */
105 bool PSpoll; /* whether there is an outstanding PS-Poll frame */
107 /* BSSID entry in RCMTA, use the wsec key management infrastructure to
108 * manage the RCMTA entries.
112 /* 'unique' ID of this bsscfg, assigned at bsscfg allocation */
115 uint txrspecidx; /* index into tx rate circular buffer */
116 ratespec_t txrspec[NTXRATE][2]; /* circular buffer of prev MPDUs tx rates */
119 #define WLC_BSSCFG_11N_DISABLE 0x1000 /* Do not advertise .11n IEs for this BSS */
120 #define WLC_BSSCFG_HW_BCN 0x20 /* The BSS is generating beacons in HW */
122 #define HWBCN_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_BCN) != 0)
123 #define HWPRB_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_PRB) != 0)
125 /* Extend N_ENAB to per-BSS */
126 #define BSS_N_ENAB(wlc, cfg) \
127 (N_ENAB((wlc)->pub) && !((cfg)->flags & WLC_BSSCFG_11N_DISABLE))
129 #define MBSS_BCN_ENAB(cfg) 0
130 #define MBSS_PRB_ENAB(cfg) 0
131 #define SOFTBCN_ENAB(pub) (0)
132 #define SOFTPRB_ENAB(pub) (0)
133 #define wlc_bsscfg_tx_check(a) do { } while (0);
135 #endif /* _BRCM_BSSCFG_H_ */