blob: 4bf40ff327d6ecc279f02b85e673e2dc00a0f21e [file] [log] [blame]
Arend van Sprielc08437b2014-07-12 08:49:39 +02001/*
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 *
Arend van Spriel28d96e52015-04-14 20:10:26 +020022 * MBSS: multiple BSSID support (eg. guest network in AP mode).
Arend van Sprielc08437b2014-07-12 08:49:39 +020023 * MCHAN: multi-channel for concurrent P2P.
Arend van Spriel28d96e52015-04-14 20:10:26 +020024 * WOWL: Wake-On-WLAN.
Arend van Sprielc08437b2014-07-12 08:49:39 +020025 */
26#define BRCMF_FEAT_LIST \
Hante Meulemana44aa402014-12-03 21:05:33 +010027 BRCMF_FEAT_DEF(MBSS) \
Hante Meuleman4eb3af72014-09-30 10:23:18 +020028 BRCMF_FEAT_DEF(MCHAN) \
29 BRCMF_FEAT_DEF(WOWL)
Arend van Sprielc08437b2014-07-12 08:49:39 +020030/*
31 * Quirks:
32 *
33 * AUTO_AUTH: workaround needed for automatic authentication type.
34 * NEED_MPC: driver needs to disable MPC during scanning operation.
35 */
36#define BRCMF_QUIRK_LIST \
37 BRCMF_QUIRK_DEF(AUTO_AUTH) \
38 BRCMF_QUIRK_DEF(NEED_MPC)
39
40#define BRCMF_FEAT_DEF(_f) \
41 BRCMF_FEAT_ ## _f,
42/*
43 * expand feature list to enumeration.
44 */
45enum brcmf_feat_id {
46 BRCMF_FEAT_LIST
47 BRCMF_FEAT_LAST
48};
49#undef BRCMF_FEAT_DEF
50
51#define BRCMF_QUIRK_DEF(_q) \
52 BRCMF_FEAT_QUIRK_ ## _q,
53/*
54 * expand quirk list to enumeration.
55 */
56enum brcmf_feat_quirk {
57 BRCMF_QUIRK_LIST
58 BRCMF_FEAT_QUIRK_LAST
59};
60#undef BRCMF_QUIRK_DEF
61
62/**
63 * brcmf_feat_attach() - determine features and quirks.
64 *
65 * @drvr: driver instance.
66 */
67void brcmf_feat_attach(struct brcmf_pub *drvr);
68
69/**
70 * brcmf_feat_is_enabled() - query feature.
71 *
72 * @ifp: interface instance.
73 * @id: feature id to check.
74 *
75 * Return: true is feature is enabled; otherwise false.
76 */
77bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
78
79/**
80 * brcmf_feat_is_quirk_enabled() - query chip quirk.
81 *
82 * @ifp: interface instance.
83 * @quirk: quirk id to check.
84 *
85 * Return: true is quirk is enabled; otherwise false.
86 */
87bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
88 enum brcmf_feat_quirk quirk);
89
90#endif /* _BRCMF_FEATURE_H */