These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / wireless / brcm80211 / brcmfmac / feature.h
1 /*
2  * Copyright (c) 2014 Broadcom Corporation
3  *
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.
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 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.
15  */
16 #ifndef _BRCMF_FEATURE_H
17 #define _BRCMF_FEATURE_H
18
19 /*
20  * Features:
21  *
22  * MBSS: multiple BSSID support (eg. guest network in AP mode).
23  * MCHAN: multi-channel for concurrent P2P.
24  * PNO: preferred network offload.
25  * WOWL: Wake-On-WLAN.
26  * P2P: peer-to-peer
27  */
28 #define BRCMF_FEAT_LIST \
29         BRCMF_FEAT_DEF(MBSS) \
30         BRCMF_FEAT_DEF(MCHAN) \
31         BRCMF_FEAT_DEF(PNO) \
32         BRCMF_FEAT_DEF(WOWL) \
33         BRCMF_FEAT_DEF(P2P)
34 /*
35  * Quirks:
36  *
37  * AUTO_AUTH: workaround needed for automatic authentication type.
38  * NEED_MPC: driver needs to disable MPC during scanning operation.
39  */
40 #define BRCMF_QUIRK_LIST \
41         BRCMF_QUIRK_DEF(AUTO_AUTH) \
42         BRCMF_QUIRK_DEF(NEED_MPC)
43
44 #define BRCMF_FEAT_DEF(_f) \
45         BRCMF_FEAT_ ## _f,
46 /*
47  * expand feature list to enumeration.
48  */
49 enum brcmf_feat_id {
50         BRCMF_FEAT_LIST
51         BRCMF_FEAT_LAST
52 };
53 #undef BRCMF_FEAT_DEF
54
55 #define BRCMF_QUIRK_DEF(_q) \
56         BRCMF_FEAT_QUIRK_ ## _q,
57 /*
58  * expand quirk list to enumeration.
59  */
60 enum brcmf_feat_quirk {
61         BRCMF_QUIRK_LIST
62         BRCMF_FEAT_QUIRK_LAST
63 };
64 #undef BRCMF_QUIRK_DEF
65
66 /**
67  * brcmf_feat_attach() - determine features and quirks.
68  *
69  * @drvr: driver instance.
70  */
71 void brcmf_feat_attach(struct brcmf_pub *drvr);
72
73 /**
74  * brcmf_feat_is_enabled() - query feature.
75  *
76  * @ifp: interface instance.
77  * @id: feature id to check.
78  *
79  * Return: true is feature is enabled; otherwise false.
80  */
81 bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
82
83 /**
84  * brcmf_feat_is_quirk_enabled() - query chip quirk.
85  *
86  * @ifp: interface instance.
87  * @quirk: quirk id to check.
88  *
89  * Return: true is quirk is enabled; otherwise false.
90  */
91 bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
92                                  enum brcmf_feat_quirk quirk);
93
94 #endif /* _BRCMF_FEATURE_H */