mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Replace rtw_ieee80211_ht_cap with standard kernel version
As shown in the previous commits, keeping alignment beetween the private header and the kernel version is a problem. Solve the issue by using the kernel version. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
496a632c98
commit
d76cbb313d
10 changed files with 29 additions and 49 deletions
|
@ -543,7 +543,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);
|
||||
}
|
||||
|
||||
|
@ -1207,7 +1207,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
{
|
||||
u8 rf_type;
|
||||
|
||||
struct rtw_ieee80211_ht_cap *pht_cap = (struct rtw_ieee80211_ht_cap *)(p+2);
|
||||
struct ieee80211_ht_cap *pht_cap = (struct ieee80211_ht_cap *)(p+2);
|
||||
|
||||
pHT_caps_ie=p;
|
||||
|
||||
|
@ -1230,10 +1230,9 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); /* set Max Rx AMPDU size to 64K */
|
||||
|
||||
if(rf_type == RF_1T1R)
|
||||
{
|
||||
pht_cap->supp_mcs_set[0] = 0xff;
|
||||
pht_cap->supp_mcs_set[1] = 0x0;
|
||||
if(rf_type == RF_1T1R) {
|
||||
pht_cap->mcs.rx_mask[0] = 0xff;
|
||||
pht_cap->mcs.rx_mask[1] = 0x0;
|
||||
}
|
||||
|
||||
memcpy(&pmlmepriv->htpriv.ht_cap, p+2, ie_len);
|
||||
|
|
|
@ -1918,7 +1918,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
/* u8 wpa_ie[255],rsn_ie[255]; */
|
||||
u16 wpa_len=0,rsn_len=0;
|
||||
struct HT_info_element *pht_info = NULL;
|
||||
struct rtw_ieee80211_ht_cap *pht_cap = NULL;
|
||||
struct ieee80211_ht_cap *pht_cap = NULL;
|
||||
unsigned int len;
|
||||
unsigned char *p;
|
||||
__le16 le_tmp;
|
||||
|
@ -1955,7 +1955,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
/* parsing HT_CAP_IE */
|
||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
pht_cap = (struct ieee80211_ht_cap *)(p + 2);
|
||||
pnetwork->BcnInfo.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
|
||||
} else {
|
||||
pnetwork->BcnInfo.ht_cap_info = 0;
|
||||
|
|
|
@ -1194,7 +1194,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
|
|||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
|
||||
struct rtw_ieee80211_ht_cap *pht_capie;
|
||||
struct ieee80211_ht_cap *pht_capie;
|
||||
u8 rf_type = 0;
|
||||
u8 bw_40MHz=0, short_GI_20=0, short_GI_40=0;
|
||||
u16 mcs_rate=0;
|
||||
|
@ -1208,9 +1208,9 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
|
|||
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
|
||||
if(p && ht_ielen>0)
|
||||
{
|
||||
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
|
||||
pht_capie = (struct ieee80211_ht_cap *)(p+2);
|
||||
|
||||
memcpy(&mcs_rate , pht_capie->supp_mcs_set, 2);
|
||||
memcpy(&mcs_rate , pht_capie->mcs.rx_mask, 2);
|
||||
|
||||
/* bw_40MHz = (pht_capie->cap_info&IEEE80211_HT_CAP_SUP_WIDTH) ? 1:0; */
|
||||
/* cur_bwmod is updated by beacon, pmlmeinfo is updated by association response */
|
||||
|
|
|
@ -2826,7 +2826,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
|||
u32 ielen, out_len;
|
||||
enum HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor;
|
||||
unsigned char *p, *pframe;
|
||||
struct rtw_ieee80211_ht_cap ht_capie;
|
||||
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;
|
||||
|
@ -2850,7 +2850,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
|||
|
||||
out_len = *pout_len;
|
||||
|
||||
memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap));
|
||||
memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap));
|
||||
|
||||
ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH |IEEE80211_HT_CAP_SGI_20 |
|
||||
IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_TX_STBC |
|
||||
|
@ -2873,7 +2873,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
|||
|
||||
|
||||
pframe = rtw_set_ie(out_ie+out_len, _HT_CAPABILITY_IE_,
|
||||
sizeof(struct rtw_ieee80211_ht_cap), (unsigned char*)&ht_capie, pout_len);
|
||||
sizeof(struct ieee80211_ht_cap), (unsigned char*)&ht_capie, pout_len);
|
||||
|
||||
phtpriv->ht_option = true;
|
||||
|
||||
|
@ -2896,7 +2896,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
|
|||
u8 *p, max_ampdu_sz;
|
||||
int len;
|
||||
/* struct sta_info *bmc_sta, *psta; */
|
||||
struct rtw_ieee80211_ht_cap *pht_capie;
|
||||
struct ieee80211_ht_cap *pht_capie;
|
||||
struct ieee80211_ht_addt_info *pht_addtinfo;
|
||||
/* struct recv_reorder_ctrl *preorder_ctrl; */
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
@ -2939,7 +2939,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
|
|||
p = rtw_get_ie(pie+sizeof (struct ndis_802_11_fixed_ies), _HT_CAPABILITY_IE_, &len, ie_len-sizeof (struct ndis_802_11_fixed_ies));
|
||||
if(p && len>0)
|
||||
{
|
||||
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
|
||||
pht_capie = (struct ieee80211_ht_cap *)(p+2);
|
||||
max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
|
||||
max_ampdu_sz = 1 << (max_ampdu_sz+3); /* max_ampdu_sz (kbytes); */
|
||||
|
||||
|
|
|
@ -1698,14 +1698,14 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
}
|
||||
|
||||
/* save HT capabilities in the sta object */
|
||||
memset(&pstat->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
|
||||
if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap))
|
||||
memset(&pstat->htpriv.ht_cap, 0, sizeof(struct ieee80211_ht_cap));
|
||||
if (elems.ht_capabilities && elems.ht_capabilities_len >= sizeof(struct ieee80211_ht_cap))
|
||||
{
|
||||
pstat->flags |= WLAN_STA_HT;
|
||||
|
||||
pstat->flags |= WLAN_STA_WME;
|
||||
|
||||
memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct rtw_ieee80211_ht_cap));
|
||||
memcpy(&pstat->htpriv.ht_cap, elems.ht_capabilities, sizeof(struct ieee80211_ht_cap));
|
||||
|
||||
} else
|
||||
pstat->flags &= ~WLAN_STA_HT;
|
||||
|
|
|
@ -1170,7 +1170,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
|||
u32 hidden_ssid = 0;
|
||||
u8 cur_network_type, network_type=0;
|
||||
struct HT_info_element *pht_info = NULL;
|
||||
struct rtw_ieee80211_ht_cap *pht_cap = NULL;
|
||||
struct ieee80211_ht_cap *pht_cap = NULL;
|
||||
u32 bcn_channel;
|
||||
unsigned short ht_cap_info;
|
||||
unsigned char ht_info_infos_0;
|
||||
|
@ -1210,7 +1210,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
|||
/* parsing HT_CAP_IE */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
pht_cap = (struct ieee80211_ht_cap *)(p + 2);
|
||||
ht_cap_info = le16_to_cpu(pht_cap->cap_info);
|
||||
} else {
|
||||
ht_cap_info = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue