source: branches/chaos_calmer/package/kernel/mac80211/patches/351-0039-brcmfmac-ignore-11d-configuration-errors.patch @ 49407

Last change on this file since 49407 was 49407, checked in by rmilecki, 12 months ago

mac80211: brcmfmac: backport changes from 2016-09-27

This fixes memory leaks, some possible crashes and bug that could cause
WARNING on every add_key/del_key call. It also replaces WARNING with
a simple message. They may still occur e.g. on station going out of
range and A-MPDU stall in the firmware.

Signed-off-by: Rafał Miłecki <rafal@…>

File size: 3.3 KB
  • drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

    From b3589dfe02123a0d0ea82076a9f8ef84a46852c0 Mon Sep 17 00:00:00 2001
    From: Hante Meuleman <hante.meuleman@broadcom.com>
    Date: Mon, 19 Sep 2016 12:09:51 +0100
    Subject: [PATCH] brcmfmac: ignore 11d configuration errors
    
    802.11d is not always supported by firmware anymore. Currently the
    AP configuration of 11d will cause an abort if the ioctl set is
    failing. This behavior is not correct and the error should be
    ignored.
    
    Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
    Reviewed-by: Franky Lin <franky.lin@broadcom.com>
    Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
    Signed-off-by: Hante Meuleman <hante.meuleman@broadcom.com>
    Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    ---
     .../broadcom/brcm80211/brcmfmac/cfg80211.c         | 27 ++++++++++++----------
     1 file changed, 15 insertions(+), 12 deletions(-)
    
    a b brcmf_cfg80211_start_ap(struct wiphy *wi 
    44224422        u16 chanspec = chandef_to_chanspec(&cfg->d11inf, &settings->chandef); 
    44234423        bool mbss; 
    44244424        int is_11d; 
     4425        bool supports_11d; 
    44254426 
    44264427        brcmf_dbg(TRACE, "ctrlchn=%d, center=%d, bw=%d, beacon_interval=%d, dtim_period=%d,\n", 
    44274428                  settings->chandef.chan->hw_value, 
    brcmf_cfg80211_start_ap(struct wiphy *wi 
    44344435        mbss = ifp->vif->mbss; 
    44354436 
    44364437        /* store current 11d setting */ 
    4437         brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY, &ifp->vif->is_11d); 
    4438         country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, 
    4439                                       settings->beacon.tail_len, 
    4440                                       WLAN_EID_COUNTRY); 
    4441         is_11d = country_ie ? 1 : 0; 
     4438        if (brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY, 
     4439                                  &ifp->vif->is_11d)) { 
     4440                supports_11d = false; 
     4441        } else { 
     4442                country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, 
     4443                                              settings->beacon.tail_len, 
     4444                                              WLAN_EID_COUNTRY); 
     4445                is_11d = country_ie ? 1 : 0; 
     4446                supports_11d = true; 
     4447        } 
    44424448 
    44434449        memset(&ssid_le, 0, sizeof(ssid_le)); 
    44444450        if (settings->ssid == NULL || settings->ssid_len == 0) { 
    brcmf_cfg80211_start_ap(struct wiphy *wi 
    44974503 
    44984504        /* Parameters shared by all radio interfaces */ 
    44994505        if (!mbss) { 
    4500                 if (is_11d != ifp->vif->is_11d) { 
     4506                if ((supports_11d) && (is_11d != ifp->vif->is_11d)) { 
    45014507                        err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, 
    45024508                                                    is_11d); 
    45034509                        if (err < 0) { 
    brcmf_cfg80211_start_ap(struct wiphy *wi 
    45394545                        brcmf_err("SET INFRA error %d\n", err); 
    45404546                        goto exit; 
    45414547                } 
    4542         } else if (WARN_ON(is_11d != ifp->vif->is_11d)) { 
     4548        } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) { 
    45434549                /* Multiple-BSS should use same 11d configuration */ 
    45444550                err = -EINVAL; 
    45454551                goto exit; 
    static int brcmf_cfg80211_stop_ap(struct 
    46734679                        brcmf_err("setting INFRA mode failed %d\n", err); 
    46744680                if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) 
    46754681                        brcmf_fil_iovar_int_set(ifp, "mbss", 0); 
    4676                 err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, 
    4677                                             ifp->vif->is_11d); 
    4678                 if (err < 0) 
    4679                         brcmf_err("restoring REGULATORY setting failed %d\n", 
    4680                                   err); 
     4682                brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, 
     4683                                      ifp->vif->is_11d); 
    46814684                /* Bring device back up so it can be used again */ 
    46824685                err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); 
    46834686                if (err < 0) 
Note: See TracBrowser for help on using the repository browser.