From bd8ad4a510962fd8a43391dc8a22783f9f54398f Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Fri, 9 May 2014 15:03:21 +0200 Subject: [PATCH] staging: rtl8723au: Eliminate struct qos_priv Having struct qos_priv containing a single integer, and carrying a dedicated header file for it, is just plain silly. Move the integer into struct mlme_priv, which is the only place qos_priv was used anyway, and get rid of the header file. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/core/rtw_ap.c | 10 +++---- drivers/staging/rtl8723au/core/rtw_cmd.c | 7 +++-- drivers/staging/rtl8723au/core/rtw_mlme.c | 5 ++-- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 6 ++--- .../staging/rtl8723au/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8723au/core/rtw_xmit.c | 8 +++--- drivers/staging/rtl8723au/include/drv_types.h | 1 - drivers/staging/rtl8723au/include/rtw_mlme.h | 2 +- drivers/staging/rtl8723au/include/rtw_qos.h | 26 ------------------- 9 files changed, 18 insertions(+), 49 deletions(-) delete mode 100644 drivers/staging/rtl8723au/include/rtw_qos.h diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index 9b31412b7521..432f0a29892f 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -672,7 +672,7 @@ static void start_bss_network(struct rtw_adapter *padapter, u8 *pbuf) /* todo: update wmm, ht cap */ /* pmlmeinfo->WMM_enable; */ /* pmlmeinfo->HT_enable; */ - if (pmlmepriv->qospriv.qos_option) + if (pmlmepriv->qos_option) pmlmeinfo->WMM_enable = true; if (pmlmepriv->htpriv.ht_option) { pmlmeinfo->WMM_enable = true; @@ -950,14 +950,14 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, /* wmm */ ie_len = 0; - pmlmepriv->qospriv.qos_option = 0; + pmlmepriv->qos_option = 0; if (pregistrypriv->wmm_enable) { for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2)) { p = rtw_get_ie23a(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); if ((p) && !memcmp(p+2, WMM_PARA_IE, 6)) { - pmlmepriv->qospriv.qos_option = 1; + pmlmepriv->qos_option = 1; *(p+8) |= BIT(7);/* QoS Info, support U-APSD */ @@ -1037,7 +1037,7 @@ int rtw_check_beacon_data23a(struct rtw_adapter *padapter, u8 *pbuf, /* ht_cap */ if (pregistrypriv->ht_enable && ht_cap) { pmlmepriv->htpriv.ht_option = true; - pmlmepriv->qospriv.qos_option = 1; + pmlmepriv->qos_option = 1; if (pregistrypriv->ampdu_enable == 1) pmlmepriv->htpriv.ampdu_enable = true; @@ -1864,7 +1864,7 @@ void sta_info_update23a(struct rtw_adapter *padapter, struct sta_info *psta) else psta->qos_option = 0; - if (pmlmepriv->qospriv.qos_option == 0) + if (pmlmepriv->qos_option == 0) psta->qos_option = 0; /* update 802.11n ht cap. */ diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c index 272fb4f4a047..1ff945caa8f0 100644 --- a/drivers/staging/rtl8723au/core/rtw_cmd.c +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c @@ -481,7 +481,6 @@ u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, struct cmd_obj *pcmd; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv = &pmlmepriv->qospriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; @@ -573,7 +572,7 @@ u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, &psecnetwork->IEs[0], pnetwork->network.IELength); - pqospriv->qos_option = 0; + pmlmepriv->qos_option = 0; if (pregistrypriv->wmm_enable) { u32 tmp_len; @@ -587,10 +586,10 @@ u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, if (psecnetwork->IELength != tmp_len) { psecnetwork->IELength = tmp_len; /* There is WMM IE in this corresp. beacon */ - pqospriv->qos_option = 1; + pmlmepriv->qos_option = 1; } else { /* There is no WMM IE in this corresp. beacon */ - pqospriv->qos_option = 0; + pmlmepriv->qos_option = 0; } } diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index f02b314d25e0..ddbe6c648225 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -2239,7 +2239,6 @@ unsigned int rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie, struct ieee80211_ht_cap ht_capie; unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv = &pmlmepriv->qospriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; phtpriv->ht_option = false; @@ -2248,13 +2247,13 @@ unsigned int rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie, if (p && p[1] > 0) { u32 rx_packet_offset, max_recvbuf_sz; - if (pqospriv->qos_option == 0) { + if (pmlmepriv->qos_option == 0) { out_len = *pout_len; pframe = rtw_set_ie23a(out_ie + out_len, WLAN_EID_VENDOR_SPECIFIC, _WMM_IE_Length_, WMM_IE, pout_len); - pqospriv->qos_option = 1; + pmlmepriv->qos_option = 1; } out_len = *pout_len; diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 3a0a4229e5ed..5ac41131a1a9 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -1540,7 +1540,7 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) pstat->uapsd_vi = 0; pstat->uapsd_be = 0; pstat->uapsd_bk = 0; - if (pmlmepriv->qospriv.qos_option) { + if (pmlmepriv->qos_option) { const u8 *end = pos + left; p = pos; @@ -3225,7 +3225,7 @@ void issue_asocrsp23a(struct rtw_adapter *padapter, unsigned short status, } /* FILL WMM IE */ - if (pstat->flags & WLAN_STA_WME && pmlmepriv->qospriv.qos_option) { + if (pstat->flags & WLAN_STA_WME && pmlmepriv->qos_option) { unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; int ie_len = 0; @@ -5369,7 +5369,7 @@ void update_sta_info23a(struct rtw_adapter *padapter, struct sta_info *psta) psta->htpriv.candidate_tid_bitmap = 0x0;/* reset */ /* QoS */ - if (pmlmepriv->qospriv.qos_option) + if (pmlmepriv->qos_option) psta->qos_option = true; psta->state = _FW_LINKED; diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index 09f3a66010d9..0241a19d5f56 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -506,7 +506,7 @@ int WMM_param_handler23a(struct rtw_adapter *padapter, struct ndis_802_11_var_ie struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; - if (pmlmepriv->qospriv.qos_option == 0) { + if (pmlmepriv->qos_option == 0) { pmlmeinfo->WMM_enable = 0; return _FAIL; } diff --git a/drivers/staging/rtl8723au/core/rtw_xmit.c b/drivers/staging/rtl8723au/core/rtw_xmit.c index 31a44feaab1d..470d868f0f5c 100644 --- a/drivers/staging/rtl8723au/core/rtw_xmit.c +++ b/drivers/staging/rtl8723au/core/rtw_xmit.c @@ -473,7 +473,6 @@ static s32 update_attrib(struct rtw_adapter *padapter, struct sta_priv *pstapriv = &padapter->stapriv; struct security_priv *psecuritypriv = &padapter->securitypriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv = &pmlmepriv->qospriv; int res = _SUCCESS; struct ethhdr *ehdr = (struct ethhdr *) skb->data; @@ -586,7 +585,7 @@ static s32 update_attrib(struct rtw_adapter *padapter, if (psta->qos_option) set_qos(skb, pattrib); } else { - if (pqospriv->qos_option) { + if (pmlmepriv->qos_option) { set_qos(skb, pattrib); if (pmlmepriv->acm_mask != 0) { @@ -767,7 +766,7 @@ static s32 xmitframe_addmic(struct rtw_adapter *padapter, &pframe[10], 6); } - /* if (pqospriv->qos_option == 1) */ + /* if (pmlmepriv->qos_option == 1) */ if (pattrib->qos_en) priority[0] = (u8)pxmitframe->attrib.priority; @@ -905,7 +904,6 @@ s32 rtw_make_wlanhdr23a(struct rtw_adapter *padapter, u8 *hdr, struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct qos_priv *pqospriv = &pmlmepriv->qospriv; u8 qos_option = false; int res = _SUCCESS; __le16 *fctrl = &pwlanhdr->frame_control; @@ -948,7 +946,7 @@ s32 rtw_make_wlanhdr23a(struct rtw_adapter *padapter, u8 *hdr, memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); - if (pqospriv->qos_option) + if (pmlmepriv->qos_option) qos_option = true; } diff --git a/drivers/staging/rtl8723au/include/drv_types.h b/drivers/staging/rtl8723au/include/drv_types.h index bec8fd7126d1..a61408cc7eb3 100644 --- a/drivers/staging/rtl8723au/include/drv_types.h +++ b/drivers/staging/rtl8723au/include/drv_types.h @@ -43,7 +43,6 @@ enum _NIC_VERSION { #include #include #include -#include #include #include #include diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index 50a2f9009526..6dd8fb476553 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -237,7 +237,7 @@ struct mlme_priv { struct timer_list set_scan_deny_timer; atomic_t set_scan_deny; /* 0: allowed, 1: deny */ - struct qos_priv qospriv; + unsigned int qos_option; /* Number of non-HT AP/stations */ int num_sta_no_ht; diff --git a/drivers/staging/rtl8723au/include/rtw_qos.h b/drivers/staging/rtl8723au/include/rtw_qos.h deleted file mode 100644 index 68fc5ba1844a..000000000000 --- a/drivers/staging/rtl8723au/include/rtw_qos.h +++ /dev/null @@ -1,26 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - ******************************************************************************/ - -#ifndef _RTW_QOS_H_ -#define _RTW_QOS_H_ - -#include - -struct qos_priv { - /* bit mask option: u-apsd, s-apsd, ts, block ack... */ - unsigned int qos_option; -}; - -#endif /* _RTL871X_QOS_H_ */ -- 2.39.5