diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2013-04-02 15:06:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-03 14:31:56 -0400 |
commit | 5c33a9420499e384a5b7c2262b17fd608ec76472 (patch) | |
tree | 889a11544e32b6d4112e820c8cb8a652fff06206 /drivers/net/wireless | |
parent | 992f6068f09b3d711ffe247701287a2ee87842cb (diff) |
brcmfmac: fix stopping AP.
on stop_ap the dongle was not properly shutdown. As a result it was
not possible to restart AP or STA after AP operation without
restarting the device. This patch will fix that.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 3bc47eaf167a..b9dbf2c0f63c 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -3827,8 +3827,9 @@ exit: | |||
3827 | static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | 3827 | static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) |
3828 | { | 3828 | { |
3829 | struct brcmf_if *ifp = netdev_priv(ndev); | 3829 | struct brcmf_if *ifp = netdev_priv(ndev); |
3830 | s32 err = -EPERM; | 3830 | s32 err; |
3831 | struct brcmf_fil_bss_enable_le bss_enable; | 3831 | struct brcmf_fil_bss_enable_le bss_enable; |
3832 | struct brcmf_join_params join_params; | ||
3832 | 3833 | ||
3833 | brcmf_dbg(TRACE, "Enter\n"); | 3834 | brcmf_dbg(TRACE, "Enter\n"); |
3834 | 3835 | ||
@@ -3836,16 +3837,21 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | |||
3836 | /* Due to most likely deauths outstanding we sleep */ | 3837 | /* Due to most likely deauths outstanding we sleep */ |
3837 | /* first to make sure they get processed by fw. */ | 3838 | /* first to make sure they get processed by fw. */ |
3838 | msleep(400); | 3839 | msleep(400); |
3839 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); | 3840 | |
3840 | if (err < 0) { | 3841 | memset(&join_params, 0, sizeof(join_params)); |
3841 | brcmf_err("setting AP mode failed %d\n", err); | 3842 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, |
3842 | goto exit; | 3843 | &join_params, sizeof(join_params)); |
3843 | } | 3844 | if (err < 0) |
3845 | brcmf_err("SET SSID error (%d)\n", err); | ||
3844 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0); | 3846 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 0); |
3845 | if (err < 0) { | 3847 | if (err < 0) |
3846 | brcmf_err("BRCMF_C_UP error %d\n", err); | 3848 | brcmf_err("BRCMF_C_UP error %d\n", err); |
3847 | goto exit; | 3849 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); |
3848 | } | 3850 | if (err < 0) |
3851 | brcmf_err("setting AP mode failed %d\n", err); | ||
3852 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0); | ||
3853 | if (err < 0) | ||
3854 | brcmf_err("setting INFRA mode failed %d\n", err); | ||
3849 | } else { | 3855 | } else { |
3850 | bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); | 3856 | bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); |
3851 | bss_enable.enable = cpu_to_le32(0); | 3857 | bss_enable.enable = cpu_to_le32(0); |
@@ -3858,7 +3864,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | |||
3858 | set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); | 3864 | set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); |
3859 | clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); | 3865 | clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); |
3860 | 3866 | ||
3861 | exit: | ||
3862 | return err; | 3867 | return err; |
3863 | } | 3868 | } |
3864 | 3869 | ||