diff options
author | Hante Meuleman <meuleman@broadcom.com> | 2013-02-08 09:53:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-02-08 14:51:41 -0500 |
commit | 426d0a562945f9e0391bf685940dfad01e1200dc (patch) | |
tree | 3081d2060bd65e9a882c8efec6d564e979e97881 /drivers/net/wireless/brcm80211/brcmfmac | |
parent | 2fde59d93f8ac5525213996b5e98efb8f4d8c88c (diff) |
brcmfmac: Use role from wdev on AP commands and fix stop_ap.
Use the stored role in wdev struct to determine AP/GO role. This
simplifies code. Fix stop_ap for GO role.
Reviewed-by: Arend Van Spriel <arend@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/brcm80211/brcmfmac')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 301157514be5..58b24373d6cf 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -3655,7 +3655,6 @@ static s32 | |||
3655 | brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | 3655 | brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, |
3656 | struct cfg80211_ap_settings *settings) | 3656 | struct cfg80211_ap_settings *settings) |
3657 | { | 3657 | { |
3658 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | ||
3659 | s32 ie_offset; | 3658 | s32 ie_offset; |
3660 | struct brcmf_if *ifp = netdev_priv(ndev); | 3659 | struct brcmf_if *ifp = netdev_priv(ndev); |
3661 | struct brcmf_tlv *ssid_ie; | 3660 | struct brcmf_tlv *ssid_ie; |
@@ -3675,22 +3674,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
3675 | settings->ssid, settings->ssid_len, settings->auth_type, | 3674 | settings->ssid, settings->ssid_len, settings->auth_type, |
3676 | settings->inactivity_timeout); | 3675 | settings->inactivity_timeout); |
3677 | 3676 | ||
3678 | if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif) { | 3677 | dev_role = ifp->vif->wdev.iftype; |
3679 | brcmf_dbg(TRACE, "Role = AP\n"); | ||
3680 | dev_role = NL80211_IFTYPE_AP; | ||
3681 | if (!test_bit(BRCMF_VIF_STATUS_AP_CREATING, | ||
3682 | &ifp->vif->sme_state)) { | ||
3683 | brcmf_err("Not in AP creation mode\n"); | ||
3684 | return -EPERM; | ||
3685 | } | ||
3686 | } else { | ||
3687 | brcmf_dbg(TRACE, "Role = P2P GO\n"); | ||
3688 | dev_role = NL80211_IFTYPE_P2P_GO; | ||
3689 | if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif) { | ||
3690 | ifp = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; | ||
3691 | ndev = ifp->ndev; | ||
3692 | } | ||
3693 | } | ||
3694 | 3678 | ||
3695 | memset(&ssid_le, 0, sizeof(ssid_le)); | 3679 | memset(&ssid_le, 0, sizeof(ssid_le)); |
3696 | if (settings->ssid == NULL || settings->ssid_len == 0) { | 3680 | if (settings->ssid == NULL || settings->ssid_len == 0) { |
@@ -3826,10 +3810,11 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | |||
3826 | { | 3810 | { |
3827 | struct brcmf_if *ifp = netdev_priv(ndev); | 3811 | struct brcmf_if *ifp = netdev_priv(ndev); |
3828 | s32 err = -EPERM; | 3812 | s32 err = -EPERM; |
3813 | struct brcmf_fil_bss_enable_le bss_enable; | ||
3829 | 3814 | ||
3830 | brcmf_dbg(TRACE, "Enter\n"); | 3815 | brcmf_dbg(TRACE, "Enter\n"); |
3831 | 3816 | ||
3832 | if (ifp->vif->mode == WL_MODE_AP) { | 3817 | if (ifp->vif->wdev.iftype == NL80211_IFTYPE_AP) { |
3833 | /* Due to most likely deauths outstanding we sleep */ | 3818 | /* Due to most likely deauths outstanding we sleep */ |
3834 | /* first to make sure they get processed by fw. */ | 3819 | /* first to make sure they get processed by fw. */ |
3835 | msleep(400); | 3820 | msleep(400); |
@@ -3843,10 +3828,18 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | |||
3843 | brcmf_err("BRCMF_C_UP error %d\n", err); | 3828 | brcmf_err("BRCMF_C_UP error %d\n", err); |
3844 | goto exit; | 3829 | goto exit; |
3845 | } | 3830 | } |
3846 | brcmf_set_mpc(ndev, 1); | 3831 | } else { |
3847 | clear_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); | 3832 | bss_enable.bsscfg_idx = cpu_to_le32(ifp->bssidx); |
3848 | clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); | 3833 | bss_enable.enable = cpu_to_le32(0); |
3834 | err = brcmf_fil_iovar_data_set(ifp, "bss", &bss_enable, | ||
3835 | sizeof(bss_enable)); | ||
3836 | if (err < 0) | ||
3837 | brcmf_err("bss_enable config failed %d\n", err); | ||
3849 | } | 3838 | } |
3839 | brcmf_set_mpc(ndev, 1); | ||
3840 | set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); | ||
3841 | clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); | ||
3842 | |||
3850 | exit: | 3843 | exit: |
3851 | return err; | 3844 | return err; |
3852 | } | 3845 | } |
@@ -3855,27 +3848,11 @@ static s32 | |||
3855 | brcmf_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *ndev, | 3848 | brcmf_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *ndev, |
3856 | struct cfg80211_beacon_data *info) | 3849 | struct cfg80211_beacon_data *info) |
3857 | { | 3850 | { |
3858 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | ||
3859 | struct brcmf_if *ifp = netdev_priv(ndev); | 3851 | struct brcmf_if *ifp = netdev_priv(ndev); |
3860 | s32 err; | 3852 | s32 err; |
3861 | 3853 | ||
3862 | brcmf_dbg(TRACE, "Enter\n"); | 3854 | brcmf_dbg(TRACE, "Enter\n"); |
3863 | 3855 | ||
3864 | if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif) { | ||
3865 | brcmf_dbg(TRACE, "Role = AP\n"); | ||
3866 | if (!test_bit(BRCMF_VIF_STATUS_AP_CREATED, | ||
3867 | &ifp->vif->sme_state)) { | ||
3868 | brcmf_err("AP was not yet created\n"); | ||
3869 | return -EPERM; | ||
3870 | } | ||
3871 | } else { | ||
3872 | brcmf_dbg(TRACE, "Role = P2P GO\n"); | ||
3873 | if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif) { | ||
3874 | ifp = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; | ||
3875 | ndev = ifp->ndev; | ||
3876 | } | ||
3877 | } | ||
3878 | |||
3879 | err = brcmf_config_ap_mgmt_ie(ifp->vif, info); | 3856 | err = brcmf_config_ap_mgmt_ie(ifp->vif, info); |
3880 | 3857 | ||
3881 | return err; | 3858 | return err; |