rtl8188eu: Fix more sparse warnings

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-10-25 14:23:42 -05:00
parent e36aed3385
commit 7c7b83836e
43 changed files with 677 additions and 862 deletions

View file

@ -29,25 +29,22 @@
#define IP_OFFSET 30
#endif
unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
static unsigned char ATHEROS_OUI1[] = {0x00, 0x03, 0x7f};
static unsigned char ATHEROS_OUI2[] = {0x00, 0x13, 0x74};
unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5};
static unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
static unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
static unsigned char BROADCOM_OUI3[] = {0x00, 0x05, 0xb5};
u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43};
unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
static unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
static unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
static unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43};
static unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
static unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
extern unsigned char RTW_WPA_OUI[];
extern unsigned char WPA_TKIP_CIPHER[4];
extern unsigned char RSN_TKIP_CIPHER[4];
#define R2T_PHY_DELAY (0)
@ -105,7 +102,7 @@ int cckratesonly_included(unsigned char *rate, int ratelen)
}
#ifdef CONFIG_GET_RAID_BY_DRV
s8 rtw_get_tx_nss(_adapter *adapter, struct sta_info *psta)
static s8 rtw_get_tx_nss(_adapter *adapter, struct sta_info *psta)
{
struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter);
u8 rf_type = RF_1T1R, custom_rf_type;
@ -813,11 +810,10 @@ __inline u8 *get_my_bssid(WLAN_BSSID_EX *pnetwork)
u16 get_beacon_interval(WLAN_BSSID_EX *bss)
{
unsigned short val;
__le16 val;
_rtw_memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2);
return le16_to_cpu(val);
}
int is_client_associated_to_ap(_adapter *padapter)
@ -1151,7 +1147,7 @@ inline bool rtw_sec_camid_is_drv_forbid(struct cam_ctl_t *cam_ctl, u8 id)
return 1;
}
bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id)
static bool _rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id)
{
bool ret = _FALSE;
@ -1239,7 +1235,7 @@ inline bool rtw_camid_is_gk(_adapter *adapter, u8 cam_id)
return ret;
}
bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk)
static bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
bool ret = _FALSE;
@ -1257,7 +1253,7 @@ exit:
return ret;
}
s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk)
static s16 _rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1297,7 +1293,7 @@ s16 rtw_camid_search(_adapter *adapter, u8 *addr, s16 kid, s8 gk)
return cam_id;
}
s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16 kid)
static s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16 kid)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1411,7 +1407,7 @@ bitmap_handle:
return cam_id;
}
void rtw_camid_set(_adapter *adapter, u8 cam_id)
static void rtw_camid_set(_adapter *adapter, u8 cam_id)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1494,7 +1490,7 @@ inline void rtw_sec_cam_swap(_adapter *adapter, u8 cam_id_a, u8 cam_id_b)
}
}
s16 rtw_get_empty_cam_entry(_adapter *adapter, u8 start_camid)
static s16 rtw_get_empty_cam_entry(_adapter *adapter, u8 start_camid)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
struct cam_ctl_t *cam_ctl = &dvobj->cam_ctl;
@ -1959,8 +1955,8 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
/* Commented by Albert 2010/07/12 */
/* Have to handle the endian issue after copying. */
/* HT_ext_caps didn't be used yet. */
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info);
pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps);
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info = pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info;
pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps = pmlmeinfo->HT_caps.u.HT_cap_element.HT_ext_caps;
/* update the MCS set */
for (i = 0; i < 16; i++)
@ -2259,7 +2255,7 @@ void update_ldpc_stbc_cap(struct sta_info *psta)
#endif /* CONFIG_80211N_HT */
}
int check_ielen(u8 *start, uint len)
static int check_ielen(u8 *start, uint len)
{
int left = len;
u8 *pos = start;
@ -2325,7 +2321,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len,
_rtw_memset(recv_beacon, 0, sizeof(*recv_beacon));
/* checking capabilities */
capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10));
capability = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 10));
/* checking IEs */
left = packet_len - sizeof(struct rtw_ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_;
@ -2339,7 +2335,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len,
return _FALSE;
pht_cap = (struct rtw_ieee80211_ht_cap *) elems.ht_capabilities;
recv_beacon->ht_cap_info = pht_cap->cap_info;
recv_beacon->ht_cap_info = le16_to_cpu(pht_cap->cap_info);
}
if (elems.ht_operation) {
@ -2715,10 +2711,9 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
case _VENDOR_SPECIFIC_IE_:
/* to update WMM paramter set while receiving beacon */
if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */
(WMM_param_handler(padapter, pIE)) ? report_wmm_edca_update(padapter) : 0;
if (WMM_param_handler(padapter, pIE))
report_wmm_edca_update(padapter);
break;
case _HT_EXTRA_INFO_IE_: /* HT info */
/* HT_info_handler(padapter, pIE); */
bwmode_update_check(padapter, pIE);
@ -2887,7 +2882,6 @@ unsigned int is_ap_in_wep(_adapter *padapter)
}
int wifirate2_ratetbl_inx(unsigned char rate);
int wifirate2_ratetbl_inx(unsigned char rate)
{
int inx = 0;
@ -2983,7 +2977,7 @@ int support_short_GI(_adapter *padapter, struct HT_caps_element *pHT_caps, u8 bw
bit_offset = (bwmode & CHANNEL_WIDTH_40) ? 6 : 5;
if (pHT_caps->u.HT_cap_element.HT_caps_info & (0x1 << bit_offset))
if (le16_to_cpu(pHT_caps->u.HT_cap_element.HT_caps_info) & (0x1 << bit_offset))
return _SUCCESS;
else
return _FAIL;
@ -3065,7 +3059,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_:
if ((_rtw_memcmp(pIE->data, ARTHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ARTHEROS_OUI2, 3))) {
if ((_rtw_memcmp(pIE->data, ATHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ATHEROS_OUI2, 3))) {
RTW_INFO("link to Artheros AP\n");
return HT_IOT_PEER_ATHEROS;
} else if ((_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3))
@ -3369,10 +3363,10 @@ exit:
void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
{
u8 *pIE;
u32 *pbuf;
__le32 *pbuf;
pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
pbuf = (u32 *)pIE;
pbuf = (__le32 *)pIE;
pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1));
@ -3383,23 +3377,22 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
void correct_TSF(_adapter *padapter, struct mlme_ext_priv *pmlmeext)
{
rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, 0);
rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
}
void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
{
int i;
u8 *pIE;
u32 *pbuf;
__le32 *pbuf;
u64 tsf = 0;
u32 delay_ms;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
pmlmeext->bcn_cnt++;
pIE = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
pbuf = (u32 *)pIE;
pbuf = (__le32 *)pIE;
tsf = le32_to_cpu(*(pbuf + 1));
tsf = tsf << 32;