mac80211: brcmfmac: fix getting/setting TX power
[15.05/openwrt.git] / package / kernel / mac80211 / patches / 370-0012-brcmfmac-Add-module-parameter-to-disable-features.patch
1 From: Hante Meuleman <meuleman@broadcom.com>
2 Date: Fri, 18 Sep 2015 22:08:15 +0200
3 Subject: [PATCH] brcmfmac: Add module parameter to disable features.
4
5 For debugging purpose it is very handy to be able to disable
6 features. It has happened a few times that new features turned
7 out not always being properly detected for all devices/firmwares.
8 Making it possible to disable the feature with a module parameter
9 will make testing/debugging easier.
10
11 Reviewed-by: Arend Van Spriel <arend@broadcom.com>
12 Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
13 Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
14 Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
15 Signed-off-by: Arend van Spriel <arend@broadcom.com>
16 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
17 ---
18
19 --- a/drivers/net/wireless/brcm80211/brcmfmac/feature.c
20 +++ b/drivers/net/wireless/brcm80211/brcmfmac/feature.c
21 @@ -15,6 +15,7 @@
22   */
23  
24  #include <linux/netdevice.h>
25 +#include <linux/module.h>
26  
27  #include <brcm_hw_ids.h>
28  #include "core.h"
29 @@ -23,6 +24,12 @@
30  #include "fwil.h"
31  #include "feature.h"
32  
33 +
34 +/* Module param feature_disable (global for all devices) */
35 +static int brcmf_feature_disable;
36 +module_param_named(feature_disable, brcmf_feature_disable, int, 0);
37 +MODULE_PARM_DESC(feature_disable, "Disable features");
38 +
39  /*
40   * expand feature list to array of feature strings.
41   */
42 @@ -131,6 +138,12 @@ void brcmf_feat_attach(struct brcmf_pub
43                 brcmf_feat_iovar_int_set(ifp, BRCMF_FEAT_MBSS, "mbss", 0);
44         brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_P2P, "p2p");
45  
46 +       if (brcmf_feature_disable) {
47 +               brcmf_dbg(INFO, "Features: 0x%02x, disable: 0x%02x\n",
48 +                         ifp->drvr->feat_flags, brcmf_feature_disable);
49 +               ifp->drvr->feat_flags &= ~brcmf_feature_disable;
50 +       }
51 +
52         /* set chip related quirks */
53         switch (drvr->bus_if->chip) {
54         case BRCM_CC_43236_CHIP_ID: