brcmfmac: introduce module parameter to force successful probe
authorArend van Spriel <arend@broadcom.com>
Sat, 2 Jan 2016 08:41:42 +0000 (09:41 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Jan 2016 09:21:16 +0000 (11:21 +0200)
The module parameter can be used to ensure the probe succeeds thus
claiming the device and allowing post-mortem debugging in case of
firmware crash. It is only available when select CONFIG_BRCMDBG.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c

index bb9e2b3f5012b358ec4038361d5a0078c6ec2978..4265b50faa98126400434f1c28995ded21e9e7f5 100644 (file)
@@ -67,6 +67,13 @@ static int brcmf_roamoff;
 module_param_named(roamoff, brcmf_roamoff, int, S_IRUSR);
 MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine");
 
+#ifdef DEBUG
+/* always succeed brcmf_bus_start() */
+static int brcmf_ignore_probe_fail;
+module_param_named(ignore_probe_fail, brcmf_ignore_probe_fail, int, 0);
+MODULE_PARM_DESC(ignore_probe_fail, "always succeed probe for debugging");
+#endif
+
 struct brcmf_mp_global_t brcmf_mp_global;
 
 int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
@@ -232,7 +239,9 @@ int brcmf_mp_device_attach(struct brcmf_pub *drvr)
        drvr->settings->feature_disable = brcmf_feature_disable;
        drvr->settings->fcmode = brcmf_fcmode;
        drvr->settings->roamoff = !!brcmf_roamoff;
-
+#ifdef DEBUG
+       drvr->settings->ignore_probe_fail = !!brcmf_ignore_probe_fail;
+#endif
        return 0;
 }
 
index abe3764669a61d7d1aa161d883fe39ae2ba87171..3b0a63b98e998682c9654895c2f8ff6667e97bf0 100644 (file)
@@ -55,11 +55,24 @@ struct brcmf_mp_device {
        int     feature_disable;
        int     fcmode;
        bool    roamoff;
+       bool    ignore_probe_fail;
 };
 
 void brcmf_mp_attach(void);
 int brcmf_mp_device_attach(struct brcmf_pub *drvr);
 void brcmf_mp_device_detach(struct brcmf_pub *drvr);
+#ifdef DEBUG
+static inline bool brcmf_ignoring_probe_fail(struct brcmf_pub *drvr)
+{
+       return drvr->settings->ignore_probe_fail;
+}
+#else
+static inline bool brcmf_ignoring_probe_fail(struct brcmf_pub *drvr)
+{
+       return false;
+}
+#endif
+
 /* Sets dongle media info (drv_version, mac address). */
 int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
 
index 3fa7bc5ce4b755485f2d0c90447307e2196e1638..7c75b1acdf00d3d059b5d272dcb1b73469c1f721 100644 (file)
@@ -1183,6 +1183,8 @@ fail:
                        brcmf_net_detach(p2p_ifp->ndev);
                drvr->iflist[0] = NULL;
                drvr->iflist[1] = NULL;
+               if (brcmf_ignoring_probe_fail(drvr))
+                       ret = 0;
                return ret;
        }
        return 0;