blob: 961d175f8afb0d5bb062b7a2e51530d10d9483a8 [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 *
22 * MCHAN: multi-channel for concurrent P2P.
23 */
24#define BRCMF_FEAT_LIST \
25 BRCMF_FEAT_DEF(MCHAN)
26/*
27 * Quirks:
28 *
29 * AUTO_AUTH: workaround needed for automatic authentication type.
30 * NEED_MPC: driver needs to disable MPC during scanning operation.
31 */
32#define BRCMF_QUIRK_LIST \
33 BRCMF_QUIRK_DEF(AUTO_AUTH) \
34 BRCMF_QUIRK_DEF(NEED_MPC)
35
36#define BRCMF_FEAT_DEF(_f) \
37 BRCMF_FEAT_ ## _f,
38/*
39 * expand feature list to enumeration.
40 */
41enum brcmf_feat_id {
42 BRCMF_FEAT_LIST
43 BRCMF_FEAT_LAST
44};
45#undef BRCMF_FEAT_DEF
46
47#define BRCMF_QUIRK_DEF(_q) \
48 BRCMF_FEAT_QUIRK_ ## _q,
49/*
50 * expand quirk list to enumeration.
51 */
52enum brcmf_feat_quirk {
53 BRCMF_QUIRK_LIST
54 BRCMF_FEAT_QUIRK_LAST
55};
56#undef BRCMF_QUIRK_DEF
57
58/**
59 * brcmf_feat_attach() - determine features and quirks.
60 *
61 * @drvr: driver instance.
62 */
63void brcmf_feat_attach(struct brcmf_pub *drvr);
64
65/**
66 * brcmf_feat_is_enabled() - query feature.
67 *
68 * @ifp: interface instance.
69 * @id: feature id to check.
70 *
71 * Return: true is feature is enabled; otherwise false.
72 */
73bool brcmf_feat_is_enabled(struct brcmf_if *ifp, enum brcmf_feat_id id);
74
75/**
76 * brcmf_feat_is_quirk_enabled() - query chip quirk.
77 *
78 * @ifp: interface instance.
79 * @quirk: quirk id to check.
80 *
81 * Return: true is quirk is enabled; otherwise false.
82 */
83bool brcmf_feat_is_quirk_enabled(struct brcmf_if *ifp,
84 enum brcmf_feat_quirk quirk);
85
86#endif /* _BRCMF_FEATURE_H */