staging: rtl8723au: Do not xmit BSS Coexistence management action frames
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 9 Jun 2014 13:16:16 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 20:51:53 +0000 (13:51 -0700)
The driver should not be issuing BSS Coexistence management action
frames when scanning. This isn't required by the spec, and if needed,
these should come from wpa_s instead.

Recommended by Johannes Berg.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme_ext.c

index eedac9a..051ea49 100644 (file)
@@ -4174,140 +4174,6 @@ out:
        dump_mgntframe23a(padapter, pmgntframe);
 }
 
-static void issue_action_BSSCoexistPacket(struct rtw_adapter *padapter)
-{
-       struct list_head *plist, *phead, *ptmp;
-       struct xmit_frame *pmgntframe;
-       struct pkt_attrib *pattrib;
-       u8 *pframe;
-       struct ieee80211_mgmt *mgmt;
-       struct wlan_network *pnetwork;
-       struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
-       struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-       struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct rtw_queue *queue = &pmlmepriv->scanned_queue;
-       u8 InfoContent[16] = {0};
-       u8 ICS[8][15];
-       int i;
-
-       if (pmlmepriv->num_FortyMHzIntolerant == 0 ||
-           pmlmepriv->num_sta_no_ht == 0)
-               return;
-
-       if (pmlmeinfo->bwmode_updated)
-               return;
-
-       DBG_8723A("%s\n", __func__);
-
-       pmgntframe = alloc_mgtxmitframe23a(pxmitpriv);
-       if (!pmgntframe)
-               return;
-
-       /* update attribute */
-       pattrib = &pmgntframe->attrib;
-       update_mgntframe_attrib23a(padapter, pattrib);
-
-       memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
-
-       pframe = (u8 *)pmgntframe->buf_addr + TXDESC_OFFSET;
-       mgmt = (struct ieee80211_mgmt *)pframe;
-
-       mgmt->frame_control =
-               cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION);
-
-       ether_addr_copy(mgmt->da, get_my_bssid23a(&pmlmeinfo->network));
-       ether_addr_copy(mgmt->sa, myid(&padapter->eeprompriv));
-       ether_addr_copy(mgmt->bssid, get_my_bssid23a(&pmlmeinfo->network));
-
-       mgmt->seq_ctrl = cpu_to_le16(IEEE80211_SN_TO_SEQ(pmlmeext->mgnt_seq));
-       pmlmeext->mgnt_seq++;
-
-       mgmt->u.action.category = WLAN_CATEGORY_PUBLIC;
-       /*
-        * This is cheating, but as there is currently no coexist_action
-        * defined in struct struct ieee80211_mgmt, abuse chan_switch
-        * for now, since it matches.
-        */
-       mgmt->u.action.u.chan_switch.action_code = ACT_PUBLIC_BSSCOEXIST;
-
-       pframe = mgmt->u.action.u.chan_switch.variable;
-       pattrib->pktlen = offsetof(struct ieee80211_mgmt,
-                                  u.action.u.chan_switch.variable);
-
-       if (pmlmepriv->num_FortyMHzIntolerant > 0) {
-               u8 iedata = BIT(2);/* 20 MHz BSS Width Request */
-
-               pframe = rtw_set_ie23a(pframe, WLAN_EID_BSS_COEX_2040, 1,
-                                      &iedata, &pattrib->pktlen);
-       }
-
-       if (pmlmepriv->num_sta_no_ht <= 0)
-               goto out;
-
-       memset(ICS, 0, sizeof(ICS));
-
-       spin_lock_bh(&pmlmepriv->scanned_queue.lock);
-
-       phead = get_list_head(queue);
-       plist = phead->next;
-
-       list_for_each_safe(plist, ptmp, phead) {
-               const u8 *p;
-               struct wlan_bssid_ex *pbss_network;
-
-               pnetwork = container_of(plist, struct wlan_network, list);
-
-               pbss_network = &pnetwork->network;
-
-               p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY,
-                                    pbss_network->IEs + _FIXED_IE_LENGTH_,
-                                    pbss_network->IELength -_FIXED_IE_LENGTH_);
-               if (!p || !p[1]) { /* non-HT */
-                       if (pbss_network->DSConfig <= 0 ||
-                           pbss_network->DSConfig > 14)
-                               continue;
-
-                       ICS[0][pbss_network->DSConfig] = 1;
-
-                       if (ICS[0][0] == 0)
-                               ICS[0][0] = 1;
-               }
-
-       }
-
-       spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
-
-       for (i = 0; i < 8;i++) {
-               if (ICS[i][0] == 1) {
-                       int j, k = 0;
-
-                       InfoContent[k] = i;
-                       /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */
-                       k++;
-
-                       for (j = 1; j <= 14; j++) {
-                               if (ICS[i][j] == 1) {
-                                       if (k < 16) {
-                                               /* channel number */
-                                               InfoContent[k] = j;
-                                               k++;
-                                       }
-                               }
-                       }
-
-                       pframe = rtw_set_ie23a(pframe,
-                                              EID_BSSIntolerantChlReport, k,
-                                              InfoContent, &pattrib->pktlen);
-               }
-       }
-
-out:
-       pattrib->last_txcmdsz = pattrib->pktlen;
-
-       dump_mgntframe23a(padapter, pmgntframe);
-}
-
 int send_delba23a(struct rtw_adapter *padapter, u8 initiator, u8 *addr)
 {
        struct sta_priv *pstapriv = &padapter->stapriv;
@@ -4485,10 +4351,6 @@ static void rtw_site_survey(struct rtw_adapter *padapter)
 
                pmlmeext->chan_scan_time = SURVEY_TO;
                pmlmeext->sitesurvey_res.state = SCAN_DISABLE;
-
-               issue_action_BSSCoexistPacket(padapter);
-               issue_action_BSSCoexistPacket(padapter);
-               issue_action_BSSCoexistPacket(padapter);
        }
 
        return;