From cfecac2e22ddae7437893da84552da2f4236be92 Mon Sep 17 00:00:00 2001 From: Ivan Safonov Date: Wed, 24 Aug 2016 15:21:33 +0700 Subject: [PATCH] staging: r8188eu: change rtw_ieee80211_ht_cap type of structures members to ieee80211_ht_cap Also cap_info member of ieee80211_ht_cap wrapped by le16_to_cpu function. Signed-off-by: Ivan Safonov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_ap.c | 15 ++++++++++----- drivers/staging/rtl8188eu/include/ieee80211.h | 4 ++-- drivers/staging/rtl8188eu/include/rtw_ht.h | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 1bccd0a4f036..a148e7d0c9bd 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -481,7 +481,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) limit = 8;/* 1R */ for (i = 0; i < limit; i++) { - if (psta_ht->ht_cap.supp_mcs_set[i/8] & BIT(i%8)) + if (psta_ht->ht_cap.mcs.rx_mask[i / 8] & BIT(i % 8)) tx_ra_bitmap |= BIT(i+12); } @@ -658,11 +658,15 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta) phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable; /* check if sta support s Short GI */ - if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) + if (le16_to_cpu(phtpriv_sta->ht_cap.cap_info & + phtpriv_ap->ht_cap.cap_info) & + (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) phtpriv_sta->sgi = true; /* bwmode */ - if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & IEEE80211_HT_CAP_SUP_WIDTH) { + if (le16_to_cpu(phtpriv_sta->ht_cap.cap_info & + phtpriv_ap->ht_cap.cap_info) & + IEEE80211_HT_CAP_SUP_WIDTH) { phtpriv_sta->bwmode = pmlmeext->cur_bwmode; phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset; } @@ -1422,7 +1426,8 @@ static int rtw_ht_operation_update(struct adapter *padapter) if (pmlmepriv->num_sta_no_ht || (pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_GF_DEVS_PRESENT)) new_op_mode = OP_MODE_MIXED; - else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH) && + else if ((le16_to_cpu(phtpriv_ap->ht_cap.cap_info) & + IEEE80211_HT_CAP_SUP_WIDTH) && pmlmepriv->num_sta_ht_20mhz) new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED; else if (pmlmepriv->olbc_ht) @@ -1552,7 +1557,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta) } if (psta->flags & WLAN_STA_HT) { - u16 ht_capab = psta->htpriv.ht_cap.cap_info; + u16 ht_capab = le16_to_cpu(psta->htpriv.ht_cap.cap_info); DBG_88E("HT: STA %pM HT Capabilities Info: 0x%04x\n", (psta->hwaddr), ht_capab); diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h index e45ef1422c6f..b57f5d715eed 100644 --- a/drivers/staging/rtl8188eu/include/ieee80211.h +++ b/drivers/staging/rtl8188eu/include/ieee80211.h @@ -239,7 +239,7 @@ struct ieee_param { u16 capability; int flags; u8 tx_supp_rates[16]; - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; } add_sta; struct { u8 reserved[2];/* for set max_num_sta */ @@ -264,7 +264,7 @@ struct sta_data { u32 sta_set; u8 tx_supp_rates[16]; u32 tx_supp_rates_len; - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; u64 rx_pkts; u64 rx_bytes; u64 rx_drops; diff --git a/drivers/staging/rtl8188eu/include/rtw_ht.h b/drivers/staging/rtl8188eu/include/rtw_ht.h index b45483fd069f..7beb0b1f9e21 100644 --- a/drivers/staging/rtl8188eu/include/rtw_ht.h +++ b/drivers/staging/rtl8188eu/include/rtw_ht.h @@ -15,8 +15,8 @@ #ifndef _RTW_HT_H_ #define _RTW_HT_H_ +#include #include -#include "wifi.h" struct ht_priv { u32 ht_option; @@ -33,7 +33,7 @@ struct ht_priv { u8 agg_enable_bitmap; u8 candidate_tid_bitmap; - struct rtw_ieee80211_ht_cap ht_cap; + struct ieee80211_ht_cap ht_cap; }; #endif /* _RTL871X_HT_H_ */ -- 2.39.5