Commit 5e787f75 authored by Daniel Kim's avatar Daniel Kim Committed by John W. Linville

brcmfmac: Don't control mpc setting during scan operation

Instead of controlling mpc setting during scan operation, initialize
mpc setting and then let firmware take care of it.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarDaniel Kim <dekim@broadcom.com>
[arend@broadcom.com: keep mpc setting for bcm4329]
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2bb443d9
...@@ -282,6 +282,13 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) ...@@ -282,6 +282,13 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
ptr = strrchr(buf, ' ') + 1; ptr = strrchr(buf, ' ') + 1;
strlcpy(ifp->drvr->fwver, ptr, sizeof(ifp->drvr->fwver)); strlcpy(ifp->drvr->fwver, ptr, sizeof(ifp->drvr->fwver));
/* set mpc */
err = brcmf_fil_iovar_int_set(ifp, "mpc", 1);
if (err) {
brcmf_err("failed setting mpc\n");
goto done;
}
/* /*
* Setup timeout if Beacons are lost and roam is off to report * Setup timeout if Beacons are lost and roam is off to report
* link down * link down
......
...@@ -590,6 +590,12 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy, ...@@ -590,6 +590,12 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
} }
} }
static void brcmf_scan_config_mpc(struct brcmf_if *ifp, int mpc)
{
if ((brcmf_get_chip_info(ifp) >> 4) == 0x4329)
brcmf_set_mpc(ifp, mpc);
}
void brcmf_set_mpc(struct brcmf_if *ifp, int mpc) void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
{ {
s32 err = 0; s32 err = 0;
...@@ -643,7 +649,7 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, ...@@ -643,7 +649,7 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
brcmf_err("Scan abort failed\n"); brcmf_err("Scan abort failed\n");
} }
brcmf_set_mpc(ifp, 1); brcmf_scan_config_mpc(ifp, 1);
/* /*
* e-scan can be initiated by scheduled scan * e-scan can be initiated by scheduled scan
...@@ -922,7 +928,7 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy, ...@@ -922,7 +928,7 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy,
brcmf_err("error (%d)\n", err); brcmf_err("error (%d)\n", err);
return err; return err;
} }
brcmf_set_mpc(ifp, 0); brcmf_scan_config_mpc(ifp, 0);
results = (struct brcmf_scan_results *)cfg->escan_info.escan_buf; results = (struct brcmf_scan_results *)cfg->escan_info.escan_buf;
results->version = 0; results->version = 0;
results->count = 0; results->count = 0;
...@@ -930,7 +936,7 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy, ...@@ -930,7 +936,7 @@ brcmf_do_escan(struct brcmf_cfg80211_info *cfg, struct wiphy *wiphy,
err = escan->run(cfg, ifp, request, WL_ESCAN_ACTION_START); err = escan->run(cfg, ifp, request, WL_ESCAN_ACTION_START);
if (err) if (err)
brcmf_set_mpc(ifp, 1); brcmf_scan_config_mpc(ifp, 1);
return err; return err;
} }
...@@ -1021,7 +1027,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif, ...@@ -1021,7 +1027,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err); brcmf_err("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
goto scan_out; goto scan_out;
} }
brcmf_set_mpc(ifp, 0); brcmf_scan_config_mpc(ifp, 0);
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN, err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCAN,
&sr->ssid_le, sizeof(sr->ssid_le)); &sr->ssid_le, sizeof(sr->ssid_le));
if (err) { if (err) {
...@@ -1031,7 +1037,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif, ...@@ -1031,7 +1037,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct brcmf_cfg80211_vif *vif,
else else
brcmf_err("WLC_SCAN error (%d)\n", err); brcmf_err("WLC_SCAN error (%d)\n", err);
brcmf_set_mpc(ifp, 1); brcmf_scan_config_mpc(ifp, 1);
goto scan_out; goto scan_out;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment