105491d2cSKalle Valo /*
205491d2cSKalle Valo  * Copyright (c) 2014 Broadcom Corporation
305491d2cSKalle Valo  *
405491d2cSKalle Valo  * Permission to use, copy, modify, and/or distribute this software for any
505491d2cSKalle Valo  * purpose with or without fee is hereby granted, provided that the above
605491d2cSKalle Valo  * copyright notice and this permission notice appear in all copies.
705491d2cSKalle Valo  *
805491d2cSKalle Valo  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
905491d2cSKalle Valo  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1005491d2cSKalle Valo  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
1105491d2cSKalle Valo  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1205491d2cSKalle Valo  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
1305491d2cSKalle Valo  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
1405491d2cSKalle Valo  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1505491d2cSKalle Valo  */
1605491d2cSKalle Valo #ifndef _BRCMF_FEATURE_H
1705491d2cSKalle Valo #define _BRCMF_FEATURE_H
1805491d2cSKalle Valo 
1905491d2cSKalle Valo /*
2005491d2cSKalle Valo  * Features:
2105491d2cSKalle Valo  *
2205491d2cSKalle Valo  * MBSS: multiple BSSID support (eg. guest network in AP mode).
2305491d2cSKalle Valo  * MCHAN: multi-channel for concurrent P2P.
2405491d2cSKalle Valo  * PNO: preferred network offload.
2505491d2cSKalle Valo  * WOWL: Wake-On-WLAN.
2605491d2cSKalle Valo  * P2P: peer-to-peer
278abffd81SHante Meuleman  * RSDB: Real Simultaneous Dual Band
28a7b82d47SHante Meuleman  * TDLS: Tunneled Direct Link Setup
2948ed16e8SHante Meuleman  * SCAN_RANDOM_MAC: Random MAC during (net detect) scheduled scan.
305c22fb85SHante Meuleman  * WOWL_ND: WOWL net detect (PNO)
315c22fb85SHante Meuleman  * WOWL_GTK: (WOWL) GTK rekeying offload
3273ef9e64SHante Meuleman  * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL.
33240d61a9SHante Meuleman  * MFP: 802.11w Management Frame Protection.
349fe929aaSArend van Spriel  * GSCAN: enhanced scan offload feature.
3505491d2cSKalle Valo  */
3605491d2cSKalle Valo #define BRCMF_FEAT_LIST \
3705491d2cSKalle Valo 	BRCMF_FEAT_DEF(MBSS) \
3805491d2cSKalle Valo 	BRCMF_FEAT_DEF(MCHAN) \
3905491d2cSKalle Valo 	BRCMF_FEAT_DEF(PNO) \
4005491d2cSKalle Valo 	BRCMF_FEAT_DEF(WOWL) \
418abffd81SHante Meuleman 	BRCMF_FEAT_DEF(P2P) \
42a7b82d47SHante Meuleman 	BRCMF_FEAT_DEF(RSDB) \
4348ed16e8SHante Meuleman 	BRCMF_FEAT_DEF(TDLS) \
445c22fb85SHante Meuleman 	BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \
455c22fb85SHante Meuleman 	BRCMF_FEAT_DEF(WOWL_ND) \
4673ef9e64SHante Meuleman 	BRCMF_FEAT_DEF(WOWL_GTK) \
47240d61a9SHante Meuleman 	BRCMF_FEAT_DEF(WOWL_ARP_ND) \
489fe929aaSArend van Spriel 	BRCMF_FEAT_DEF(MFP) \
499fe929aaSArend van Spriel 	BRCMF_FEAT_DEF(GSCAN)
508abffd81SHante Meuleman 
5105491d2cSKalle Valo /*
5205491d2cSKalle Valo  * Quirks:
5305491d2cSKalle Valo  *
5405491d2cSKalle Valo  * AUTO_AUTH: workaround needed for automatic authentication type.
5505491d2cSKalle Valo  * NEED_MPC: driver needs to disable MPC during scanning operation.
5605491d2cSKalle Valo  */
5705491d2cSKalle Valo #define BRCMF_QUIRK_LIST \
5805491d2cSKalle Valo 	BRCMF_QUIRK_DEF(AUTO_AUTH) \
5905491d2cSKalle Valo 	BRCMF_QUIRK_DEF(NEED_MPC)
6005491d2cSKalle Valo 
6105491d2cSKalle Valo #define BRCMF_FEAT_DEF(_f) \
6205491d2cSKalle Valo 	BRCMF_FEAT_ ## _f,
6305491d2cSKalle Valo /*
6405491d2cSKalle Valo  * expand feature list to enumeration.
6505491d2cSKalle Valo  */
6605491d2cSKalle Valo enum brcmf_feat_id {
6705491d2cSKalle Valo 	BRCMF_FEAT_LIST
6805491d2cSKalle Valo 	BRCMF_FEAT_LAST
6905491d2cSKalle Valo };
7005491d2cSKalle Valo #undef BRCMF_FEAT_DEF
7105491d2cSKalle Valo 
7205491d2cSKalle Valo #define BRCMF_QUIRK_DEF(_q) \
7305491d2cSKalle Valo 	BRCMF_FEAT_QUIRK_ ## _q,
7405491d2cSKalle Valo /*
7505491d2cSKalle Valo  * expand quirk list to enumeration.
7605491d2cSKalle Valo  */
7705491d2cSKalle Valo enum brcmf_feat_quirk {
7805491d2cSKalle Valo 	BRCMF_QUIRK_LIST
7905491d2cSKalle Valo 	BRCMF_FEAT_QUIRK_LAST
8005491d2cSKalle Valo };
8105491d2cSKalle Valo #undef BRCMF_QUIRK_DEF
8205491d2cSKalle Valo 
8305491d2cSKalle Valo /**
8405491d2cSKalle Valo  * brcmf_feat_attach() - determine features and quirks.
8505491d2cSKalle Valo  *
8605491d2cSKalle Valo  * @drvr: driver instance.
8705491d2cSKalle Valo  */
8805491d2cSKalle Valo void brcmf_feat_attach(struct brcmf_pub *drvr);
8905491d2cSKalle Valo 
9005491d2cSKalle Valo /**
9105491d2cSKalle Valo  * brcmf_feat_is_enabled() - query feature.
9205491d2cSKalle Valo  *
9305491d2cSKalle Valo  * @ifp: interface instance.
9405491d2cSKalle Valo  * @id: feature id to check.
9505491d2cSKalle Valo  *
9605491d2cSKalle Valo  * Return: true is feature is enabled; otherwise false.
9705491d2cSKalle Valo  */
9805491d2cSKalle Valo bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
9905491d2cSKalle Valo 
10005491d2cSKalle Valo /**
10105491d2cSKalle Valo  * brcmf_feat_is_quirk_enabled() - query chip quirk.
10205491d2cSKalle Valo  *
10305491d2cSKalle Valo  * @ifp: interface instance.
10405491d2cSKalle Valo  * @quirk: quirk id to check.
10505491d2cSKalle Valo  *
10605491d2cSKalle Valo  * Return: true is quirk is enabled; otherwise false.
10705491d2cSKalle Valo  */
10805491d2cSKalle Valo bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
10905491d2cSKalle Valo 				 enum brcmf_feat_quirk quirk);
11005491d2cSKalle Valo 
11105491d2cSKalle Valo #endif /* _BRCMF_FEATURE_H */
112