Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: ISC
0002 /*
0003  * Copyright (c) 2014 Broadcom Corporation
0004  */
0005 #ifndef _BRCMF_FEATURE_H
0006 #define _BRCMF_FEATURE_H
0007 
0008 /*
0009  * Features:
0010  *
0011  * MBSS: multiple BSSID support (eg. guest network in AP mode).
0012  * MCHAN: multi-channel for concurrent P2P.
0013  * PNO: preferred network offload.
0014  * WOWL: Wake-On-WLAN.
0015  * P2P: peer-to-peer
0016  * RSDB: Real Simultaneous Dual Band
0017  * TDLS: Tunneled Direct Link Setup
0018  * SCAN_RANDOM_MAC: Random MAC during (net detect) scheduled scan.
0019  * WOWL_ND: WOWL net detect (PNO)
0020  * WOWL_GTK: (WOWL) GTK rekeying offload
0021  * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL.
0022  * MFP: 802.11w Management Frame Protection.
0023  * GSCAN: enhanced scan offload feature.
0024  * FWSUP: Firmware supplicant.
0025  * MONITOR: firmware can pass monitor packets to host.
0026  * MONITOR_FLAG: firmware flags monitor packets.
0027  * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header
0028  * MONITOR_FMT_HW_RX_HDR: firmware provides monitor packets with hw/ucode header
0029  * DOT11H: firmware supports 802.11h
0030  * SAE: simultaneous authentication of equals
0031  * FWAUTH: Firmware authenticator
0032  */
0033 #define BRCMF_FEAT_LIST \
0034     BRCMF_FEAT_DEF(MBSS) \
0035     BRCMF_FEAT_DEF(MCHAN) \
0036     BRCMF_FEAT_DEF(PNO) \
0037     BRCMF_FEAT_DEF(WOWL) \
0038     BRCMF_FEAT_DEF(P2P) \
0039     BRCMF_FEAT_DEF(RSDB) \
0040     BRCMF_FEAT_DEF(TDLS) \
0041     BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \
0042     BRCMF_FEAT_DEF(WOWL_ND) \
0043     BRCMF_FEAT_DEF(WOWL_GTK) \
0044     BRCMF_FEAT_DEF(WOWL_ARP_ND) \
0045     BRCMF_FEAT_DEF(MFP) \
0046     BRCMF_FEAT_DEF(GSCAN) \
0047     BRCMF_FEAT_DEF(FWSUP) \
0048     BRCMF_FEAT_DEF(MONITOR) \
0049     BRCMF_FEAT_DEF(MONITOR_FLAG) \
0050     BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) \
0051     BRCMF_FEAT_DEF(MONITOR_FMT_HW_RX_HDR) \
0052     BRCMF_FEAT_DEF(DOT11H) \
0053     BRCMF_FEAT_DEF(SAE) \
0054     BRCMF_FEAT_DEF(FWAUTH)
0055 
0056 /*
0057  * Quirks:
0058  *
0059  * AUTO_AUTH: workaround needed for automatic authentication type.
0060  * NEED_MPC: driver needs to disable MPC during scanning operation.
0061  */
0062 #define BRCMF_QUIRK_LIST \
0063     BRCMF_QUIRK_DEF(AUTO_AUTH) \
0064     BRCMF_QUIRK_DEF(NEED_MPC)
0065 
0066 #define BRCMF_FEAT_DEF(_f) \
0067     BRCMF_FEAT_ ## _f,
0068 /*
0069  * expand feature list to enumeration.
0070  */
0071 enum brcmf_feat_id {
0072     BRCMF_FEAT_LIST
0073     BRCMF_FEAT_LAST
0074 };
0075 #undef BRCMF_FEAT_DEF
0076 
0077 #define BRCMF_QUIRK_DEF(_q) \
0078     BRCMF_FEAT_QUIRK_ ## _q,
0079 /*
0080  * expand quirk list to enumeration.
0081  */
0082 enum brcmf_feat_quirk {
0083     BRCMF_QUIRK_LIST
0084     BRCMF_FEAT_QUIRK_LAST
0085 };
0086 #undef BRCMF_QUIRK_DEF
0087 
0088 /**
0089  * brcmf_feat_attach() - determine features and quirks.
0090  *
0091  * @drvr: driver instance.
0092  */
0093 void brcmf_feat_attach(struct brcmf_pub *drvr);
0094 
0095 /**
0096  * brcmf_feat_debugfs_create() - create debugfs entries.
0097  *
0098  * @drvr: driver instance.
0099  */
0100 void brcmf_feat_debugfs_create(struct brcmf_pub *drvr);
0101 
0102 /**
0103  * brcmf_feat_is_enabled() - query feature.
0104  *
0105  * @ifp: interface instance.
0106  * @id: feature id to check.
0107  *
0108  * Return: true is feature is enabled; otherwise false.
0109  */
0110 bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
0111 
0112 /**
0113  * brcmf_feat_is_quirk_enabled() - query chip quirk.
0114  *
0115  * @ifp: interface instance.
0116  * @quirk: quirk id to check.
0117  *
0118  * Return: true is quirk is enabled; otherwise false.
0119  */
0120 bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
0121                  enum brcmf_feat_quirk quirk);
0122 
0123 #endif /* _BRCMF_FEATURE_H */