mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-09 14:53:05 +00:00
rtl8188eu: Fix some sparse warnings
The driver did not work on PowerPC, which is big endian. This patch fixes all the sparse warnings concerning improper use of __le16 and __le32 variables. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
77e8b5de91
commit
7c7f632ac7
25 changed files with 502 additions and 684 deletions
|
@ -417,20 +417,20 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
|||
ie += sz;
|
||||
|
||||
//beacon interval : 2bytes
|
||||
*(u16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
|
||||
*(__le16*)ie = cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);//BCN_INTERVAL;
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
||||
//capability info
|
||||
*(u16*)ie = 0;
|
||||
|
||||
*(u16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
*(__le16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
|
||||
if(pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
*(u16*)ie |= cpu_to_le16(cap_ShortPremble);
|
||||
*(__le16*)ie |= cpu_to_le16(cap_ShortPremble);
|
||||
|
||||
if (pdev_network->Privacy)
|
||||
*(u16*)ie |= cpu_to_le16(cap_Privacy);
|
||||
*(__le16*)ie |= cpu_to_le16(cap_Privacy);
|
||||
|
||||
sz += 2;
|
||||
ie += 2;
|
||||
|
@ -501,6 +501,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
|||
{
|
||||
int len;
|
||||
u16 val16;
|
||||
__le16 le_tmp;
|
||||
unsigned char wpa_oui_type[] = {0x00, 0x50, 0xf2, 0x01};
|
||||
u8 *pbuf = pie;
|
||||
int limit_new = limit;
|
||||
|
@ -518,9 +519,9 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
|||
}
|
||||
|
||||
//check version...
|
||||
_rtw_memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
|
||||
memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
|
||||
|
||||
val16 = le16_to_cpu(val16);
|
||||
val16 = le16_to_cpu(le_tmp);
|
||||
if (val16 != 0x0001)
|
||||
goto check_next_ie;
|
||||
|
||||
|
@ -1983,9 +1984,10 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
struct rtw_ieee80211_ht_cap *pht_cap = NULL;
|
||||
unsigned int len;
|
||||
unsigned char *p;
|
||||
__le16 le_tmp;
|
||||
|
||||
_rtw_memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
|
||||
cap = le16_to_cpu(cap);
|
||||
memcpy((u8 *)&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
|
||||
cap = le16_to_cpu(le_tmp);
|
||||
if (cap & WLAN_CAPABILITY_PRIVACY) {
|
||||
bencrypt = 1;
|
||||
pnetwork->network.Privacy = 1;
|
||||
|
@ -2017,7 +2019,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
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);
|
||||
pnetwork->BcnInfo.ht_cap_info = pht_cap->cap_info;
|
||||
pnetwork->BcnInfo.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
|
||||
} else {
|
||||
pnetwork->BcnInfo.ht_cap_info = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue