rtl8188eu: Backport kernel version

This driver was added to the kernel with version 3.12. The changes in that
version are now brought back to the GitHub repo. Essentually all of the code
is updated.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-10-19 12:45:47 -05:00
parent 868a407435
commit 19db43ecbd
89 changed files with 2026 additions and 5957 deletions

View file

@ -132,7 +132,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
unsigned int *frlen)
{
_rtw_memcpy((void *)pbuf, (void *)source, len);
memcpy((void *)pbuf, (void *)source, len);
*frlen = *frlen + len;
return pbuf + len;
}
@ -153,7 +153,7 @@ _func_enter_;
*(pbuf + 1) = (u8)len;
if (len > 0)
_rtw_memcpy((void *)(pbuf + 2), (void *)source, len);
memcpy((void *)(pbuf + 2), (void *)source, len);
*frlen = *frlen + (len + 2);
@ -277,7 +277,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
target_ie = &in_ie[cnt];
if (ie)
_rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
if (ielen)
*ielen = in_ie[cnt+1]+2;
@ -322,8 +322,8 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
u8 *remain_ies = target_ie + target_ielen;
uint remain_len = search_len - (remain_ies - start);
_rtw_memcpy(buf, remain_ies, remain_len);
_rtw_memcpy(target_ie, buf, remain_len);
memcpy(buf, remain_ies, remain_len);
memcpy(target_ie, buf, remain_len);
*ies_len = *ies_len - target_ielen;
ret = _SUCCESS;
@ -345,20 +345,20 @@ _func_enter_;
switch (mode) {
case WIRELESS_11B:
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
break;
case WIRELESS_11G:
case WIRELESS_11A:
case WIRELESS_11_5N:
case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
_rtw_memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
break;
case WIRELESS_11BG:
case WIRELESS_11G_24N:
case WIRELESS_11_24N:
case WIRELESS_11BG_24N:
_rtw_memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
_rtw_memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
memcpy(SupportedRates + IEEE80211_CCK_RATE_LEN, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
break;
}
_func_exit_;
@ -467,7 +467,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
goto check_next_ie;
/* check version... */
_rtw_memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
memcpy((u8 *)&le_tmp, (pbuf + 6), sizeof(val16));
val16 = le16_to_cpu(le_tmp);
if (val16 != 0x0001)
@ -689,7 +689,7 @@ _func_enter_;
sec_idx, in_ie[cnt+1]+2));
if (wpa_ie) {
_rtw_memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2);
for (i = 0; i < (in_ie[cnt+1]+2); i += 8) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
@ -708,7 +708,7 @@ _func_enter_;
sec_idx, in_ie[cnt+1]+2));
if (rsn_ie) {
_rtw_memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt+1]+2);
for (i = 0; i < (in_ie[cnt+1]+2); i += 8) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
@ -778,7 +778,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
wpsie_ptr = &in_ie[cnt];
if (wps_ie)
_rtw_memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
if (wps_ielen)
*wps_ielen = in_ie[cnt+1]+2;
@ -828,7 +828,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_at
if (attr_id == target_attr_id) {
target_attr_ptr = attr_ptr;
if (buf_attr)
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
memcpy(buf_attr, attr_ptr, attr_len);
if (len_attr)
*len_attr = attr_len;
break;
@ -861,7 +861,7 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8
if (attr_ptr && attr_len) {
if (buf_content)
_rtw_memcpy(buf_content, attr_ptr+4, attr_len-4);
memcpy(buf_content, attr_ptr+4, attr_len-4);
if (len_content)
*len_content = attr_len-4;
@ -1114,9 +1114,9 @@ void rtw_macaddr_cfg(u8 *mac_addr)
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk + 1]);
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
memcpy(mac_addr, mac, ETH_ALEN);
} else { /* Use the mac address stored in the Efuse */
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
memcpy(mac, mac_addr, ETH_ALEN);
}
if (((mac[0] == 0xff) && (mac[1] == 0xff) && (mac[2] == 0xff) &&
@ -1130,7 +1130,7 @@ void rtw_macaddr_cfg(u8 *mac_addr)
mac[4] = 0x00;
mac[5] = 0x00;
/* use default mac addresss */
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
memcpy(mac_addr, mac, ETH_ALEN);
DBG_88E("MAC Address from efuse error, assign default one !!!\n");
}
@ -1147,7 +1147,7 @@ void dump_ies(u8 *buf, u32 buf_len)
len = *(pos+1);
DBG_88E("%s ID:%u, LEN:%u\n", __func__, id, len);
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
dump_p2p_ie(pos, len);
#endif
dump_wps_ie(pos, len);
@ -1177,7 +1177,7 @@ void dump_wps_ie(u8 *ie, u32 ie_len)
}
}
#ifdef CONFIG_P2P
#ifdef CONFIG_88EU_P2P
void dump_p2p_ie(u8 *ie, u32 ie_len)
{
u8 *pos = (u8 *)ie;
@ -1227,7 +1227,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
p2p_ie_ptr = in_ie + cnt;
if (p2p_ie != NULL)
_rtw_memcpy(p2p_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
memcpy(p2p_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
if (p2p_ielen != NULL)
*p2p_ielen = in_ie[cnt + 1] + 2;
return p2p_ie_ptr;
@ -1274,7 +1274,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_att
target_attr_ptr = attr_ptr;
if (buf_attr)
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
memcpy(buf_attr, attr_ptr, attr_len);
if (len_attr)
*len_attr = attr_len;
break;
@ -1307,7 +1307,7 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8
if (attr_ptr && attr_len) {
if (buf_content)
_rtw_memcpy(buf_content, attr_ptr+3, attr_len-3);
memcpy(buf_content, attr_ptr+3, attr_len-3);
if (len_content)
*len_content = attr_len-3;
@ -1328,7 +1328,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
RTW_PUT_LE16(pbuf + 1, attr_len);
if (pdata_attr)
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
memcpy(pbuf + 3, pdata_attr, attr_len);
a_len = attr_len + 3;
@ -1348,7 +1348,7 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
uint remain_len = ielen-(next_attr-ie);
_rtw_memset(target_attr, 0, target_attr_len);
_rtw_memcpy(target_attr, next_attr, remain_len);
memcpy(target_attr, next_attr, remain_len);
_rtw_memset(target_attr+remain_len, 0, target_attr_len);
*(ie+1) -= target_attr_len;
ielen -= target_attr_len;
@ -1372,14 +1372,14 @@ void rtw_wlan_bssid_ex_remove_p2p_attr(struct wlan_bssid_ex *bss_ex, u8 attr_id)
u8 *next_ie = p2p_ie+p2p_ielen;
uint remain_len = bss_ex->IELength-(next_ie_ori-bss_ex->IEs);
_rtw_memcpy(next_ie, next_ie_ori, remain_len);
memcpy(next_ie, next_ie_ori, remain_len);
_rtw_memset(next_ie+remain_len, 0, p2p_ielen_ori-p2p_ielen);
bss_ex->IELength -= p2p_ielen_ori-p2p_ielen;
}
}
}
#endif /* CONFIG_P2P */
#endif /* CONFIG_88EU_P2P */
/* Baron adds to avoid FreeBSD warning */
int ieee80211_is_empty_essid(const char *essid, int essid_len)
@ -1475,7 +1475,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
unsigned int len;
unsigned char *p;
_rtw_memcpy((u8 *)&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
memcpy(&le_tmp, rtw_get_capability_from_ie(pnetwork->network.IEs), 2);
cap = le16_to_cpu(le_tmp);
if (cap & WLAN_CAPABILITY_PRIVACY) {
bencrypt = 1;
@ -1588,7 +1588,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
{
const u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
u16 fc;
u8 c, a;
u8 c, a = 0;
fc = le16_to_cpu(((struct rtw_ieee80211_hdr_3addr *)frame)->frame_ctl);