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