brcmfmac: avoid firmware commands when bus is down
Upon rmmod a few attempts are made to inform firmware, but there is no point as the bus is down and these will fail. Avoid them to keep the logs clean. Reported-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com> Reviewed-by: Franky Lin <franky.lin@broadcom.com> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
c33330ac06
commit
1ac11ae949
|
@ -1286,17 +1286,21 @@ static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
|
||||||
{
|
{
|
||||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
|
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
|
||||||
struct brcmf_pub *drvr = cfg->pub;
|
struct brcmf_pub *drvr = cfg->pub;
|
||||||
|
bool bus_up = drvr->bus_if->state == BRCMF_BUS_UP;
|
||||||
s32 err = 0;
|
s32 err = 0;
|
||||||
|
|
||||||
brcmf_dbg(TRACE, "Enter\n");
|
brcmf_dbg(TRACE, "Enter\n");
|
||||||
|
|
||||||
if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state)) {
|
if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state)) {
|
||||||
brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n");
|
if (bus_up) {
|
||||||
err = brcmf_fil_cmd_data_set(vif->ifp,
|
brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n");
|
||||||
BRCMF_C_DISASSOC, NULL, 0);
|
err = brcmf_fil_cmd_data_set(vif->ifp,
|
||||||
if (err) {
|
BRCMF_C_DISASSOC, NULL, 0);
|
||||||
bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
|
if (err)
|
||||||
|
bphy_err(drvr, "WLC_DISASSOC failed (%d)\n",
|
||||||
|
err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
|
if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
|
||||||
(vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
|
(vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
|
||||||
cfg80211_disconnected(vif->wdev.netdev, reason, NULL, 0,
|
cfg80211_disconnected(vif->wdev.netdev, reason, NULL, 0,
|
||||||
|
@ -1306,7 +1310,8 @@ static void brcmf_link_down(struct brcmf_cfg80211_vif *vif, u16 reason)
|
||||||
clear_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status);
|
clear_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status);
|
||||||
brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0);
|
brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0);
|
||||||
if (vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
|
if (vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
|
||||||
brcmf_set_pmk(vif->ifp, NULL, 0);
|
if (bus_up)
|
||||||
|
brcmf_set_pmk(vif->ifp, NULL, 0);
|
||||||
vif->profile.use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
|
vif->profile.use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
|
||||||
}
|
}
|
||||||
brcmf_dbg(TRACE, "Exit\n");
|
brcmf_dbg(TRACE, "Exit\n");
|
||||||
|
@ -5004,18 +5009,16 @@ static int brcmf_cfg80211_get_channel(struct wiphy *wiphy,
|
||||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||||
struct net_device *ndev = wdev->netdev;
|
struct net_device *ndev = wdev->netdev;
|
||||||
struct brcmf_pub *drvr = cfg->pub;
|
struct brcmf_pub *drvr = cfg->pub;
|
||||||
struct brcmf_if *ifp;
|
|
||||||
struct brcmu_chan ch;
|
struct brcmu_chan ch;
|
||||||
enum nl80211_band band = 0;
|
enum nl80211_band band = 0;
|
||||||
enum nl80211_chan_width width = 0;
|
enum nl80211_chan_width width = 0;
|
||||||
u32 chanspec;
|
u32 chanspec;
|
||||||
int freq, err;
|
int freq, err;
|
||||||
|
|
||||||
if (!ndev)
|
if (!ndev || drvr->bus_if->state != BRCMF_BUS_UP)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
ifp = netdev_priv(ndev);
|
|
||||||
|
|
||||||
err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
|
err = brcmf_fil_iovar_int_get(netdev_priv(ndev), "chanspec", &chanspec);
|
||||||
if (err) {
|
if (err) {
|
||||||
bphy_err(drvr, "chanspec failed (%d)\n", err);
|
bphy_err(drvr, "chanspec failed (%d)\n", err);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in New Issue