mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtl8188eu: Remove wrapper for memset()
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
4e305e82d0
commit
545d963a9e
27 changed files with 195 additions and 202 deletions
|
@ -148,7 +148,7 @@ void indicate_wx_scan_complete_event(struct adapter *padapter)
|
|||
{
|
||||
union iwreq_data wrqu;
|
||||
|
||||
_rtw_memset(&wrqu, 0, sizeof(union iwreq_data));
|
||||
memset(&wrqu, 0, sizeof(union iwreq_data));
|
||||
wireless_send_event(padapter->pnetdev, SIOCGIWSCAN, &wrqu, NULL);
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ void rtw_indicate_wx_assoc_event(struct adapter *padapter)
|
|||
union iwreq_data wrqu;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
_rtw_memset(&wrqu, 0, sizeof(union iwreq_data));
|
||||
memset(&wrqu, 0, sizeof(union iwreq_data));
|
||||
|
||||
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
|
||||
|
@ -171,10 +171,10 @@ void rtw_indicate_wx_disassoc_event(struct adapter *padapter)
|
|||
{
|
||||
union iwreq_data wrqu;
|
||||
|
||||
_rtw_memset(&wrqu, 0, sizeof(union iwreq_data));
|
||||
memset(&wrqu, 0, sizeof(union iwreq_data));
|
||||
|
||||
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
_rtw_memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
|
||||
memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
|
||||
|
||||
DBG_88E_LEVEL(_drv_always_, "indicate disassoc\n");
|
||||
wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL);
|
||||
|
@ -360,33 +360,33 @@ static char *translate_scan(struct adapter *padapter,
|
|||
|
||||
if (wpa_len > 0) {
|
||||
p = buf;
|
||||
_rtw_memset(buf, 0, MAX_WPA_IE_LEN);
|
||||
memset(buf, 0, MAX_WPA_IE_LEN);
|
||||
p += sprintf(p, "wpa_ie =");
|
||||
for (i = 0; i < wpa_len; i++)
|
||||
p += sprintf(p, "%02x", wpa_ie[i]);
|
||||
|
||||
_rtw_memset(&iwe, 0, sizeof(iwe));
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
iwe.u.data.length = strlen(buf);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
|
||||
_rtw_memset(&iwe, 0, sizeof(iwe));
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = IWEVGENIE;
|
||||
iwe.u.data.length = wpa_len;
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, wpa_ie);
|
||||
}
|
||||
if (rsn_len > 0) {
|
||||
p = buf;
|
||||
_rtw_memset(buf, 0, MAX_WPA_IE_LEN);
|
||||
memset(buf, 0, MAX_WPA_IE_LEN);
|
||||
p += sprintf(p, "rsn_ie =");
|
||||
for (i = 0; i < rsn_len; i++)
|
||||
p += sprintf(p, "%02x", rsn_ie[i]);
|
||||
_rtw_memset(&iwe, 0, sizeof(iwe));
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
iwe.u.data.length = strlen(buf);
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, buf);
|
||||
|
||||
_rtw_memset(&iwe, 0, sizeof(iwe));
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
iwe.cmd = IWEVGENIE;
|
||||
iwe.u.data.length = rsn_len;
|
||||
start = iwe_stream_add_point(info, start, stop, &iwe, rsn_ie);
|
||||
|
@ -522,7 +522,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
|
|||
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (" wpa_set_encryption: pwep allocate fail !!!\n"));
|
||||
goto exit;
|
||||
}
|
||||
_rtw_memset(pwep, 0, wep_total_len);
|
||||
memset(pwep, 0, wep_total_len);
|
||||
pwep->KeyLength = wep_key_len;
|
||||
pwep->Length = wep_total_len;
|
||||
if (wep_key_len == 13) {
|
||||
|
@ -975,14 +975,14 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
|
|||
for (j = 0; j < NUM_PMKID_CACHE; j++) {
|
||||
if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN)) {
|
||||
/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
|
||||
_rtw_memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN);
|
||||
memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN);
|
||||
psecuritypriv->PMKIDList[j].bUsed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (pPMK->cmd == IW_PMKSA_FLUSH) {
|
||||
DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n");
|
||||
_rtw_memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
|
||||
psecuritypriv->PMKIDIndex = 0;
|
||||
ret = true;
|
||||
}
|
||||
|
@ -1015,7 +1015,7 @@ static int rtw_wx_get_range(struct net_device *dev,
|
|||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_range. cmd_code =%x\n", info->cmd));
|
||||
|
||||
wrqu->data.length = sizeof(*range);
|
||||
_rtw_memset(range, 0, sizeof(*range));
|
||||
memset(range, 0, sizeof(*range));
|
||||
|
||||
/* Let's try to keep this struct in the same order as in
|
||||
* linux/include/wireless.h
|
||||
|
@ -1187,7 +1187,7 @@ static int rtw_wx_get_wap(struct net_device *dev,
|
|||
|
||||
wrqu->ap_addr.sa_family = ARPHRD_ETHER;
|
||||
|
||||
_rtw_memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
|
||||
memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
|
||||
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_wap\n"));
|
||||
|
||||
|
@ -1198,7 +1198,7 @@ static int rtw_wx_get_wap(struct net_device *dev,
|
|||
((check_fwstate(pmlmepriv, WIFI_AP_STATE)) == true))
|
||||
memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN);
|
||||
else
|
||||
_rtw_memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
|
||||
memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
|
||||
|
||||
|
||||
|
||||
|
@ -1304,7 +1304,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
|
|||
}
|
||||
#endif /* CONFIG_88EU_P2P */
|
||||
|
||||
_rtw_memset(ssid, 0, sizeof(struct ndis_802_11_ssid)*RTW_SSID_SCAN_AMOUNT);
|
||||
memset(ssid, 0, sizeof(struct ndis_802_11_ssid)*RTW_SSID_SCAN_AMOUNT);
|
||||
|
||||
if (wrqu->data.length == sizeof(struct iw_scan_req)) {
|
||||
struct iw_scan_req *req = (struct iw_scan_req *)extra;
|
||||
|
@ -1519,7 +1519,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
|
|||
if (wrqu->essid.length != 33)
|
||||
DBG_88E("ssid =%s, len =%d\n", extra, wrqu->essid.length);
|
||||
|
||||
_rtw_memset(&ndis_ssid, 0, sizeof(struct ndis_802_11_ssid));
|
||||
memset(&ndis_ssid, 0, sizeof(struct ndis_802_11_ssid));
|
||||
ndis_ssid.SsidLength = len;
|
||||
memcpy(ndis_ssid.Ssid, extra, len);
|
||||
src_ssid = ndis_ssid.Ssid;
|
||||
|
@ -1833,7 +1833,7 @@ static int rtw_wx_set_enc(struct net_device *dev,
|
|||
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
|
||||
DBG_88E("+rtw_wx_set_enc, flags = 0x%x\n", erq->flags);
|
||||
|
||||
_rtw_memset(&wep, 0, sizeof(struct ndis_802_11_wep));
|
||||
memset(&wep, 0, sizeof(struct ndis_802_11_wep));
|
||||
|
||||
key = erq->flags & IW_ENCODE_INDEX;
|
||||
|
||||
|
@ -2126,10 +2126,10 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
|
|||
if (param == NULL)
|
||||
return -1;
|
||||
|
||||
_rtw_memset(param, 0, param_len);
|
||||
memset(param, 0, param_len);
|
||||
|
||||
param->cmd = IEEE_CMD_SET_ENCRYPTION;
|
||||
_rtw_memset(param->sta_addr, 0xff, ETH_ALEN);
|
||||
memset(param->sta_addr, 0xff, ETH_ALEN);
|
||||
|
||||
switch (pext->alg) {
|
||||
case IW_ENCODE_ALG_NONE:
|
||||
|
@ -2886,7 +2886,7 @@ static int rtw_p2p_profilefound(struct net_device *dev,
|
|||
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
|
||||
if (extra[0] == '0') {
|
||||
/* Remove all the profile information of wifidirect_info structure. */
|
||||
_rtw_memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM);
|
||||
memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM);
|
||||
pwdinfo->profileindex = 0;
|
||||
} else {
|
||||
if (pwdinfo->profileindex >= P2P_MAX_PERSISTENT_GROUP_NUM) {
|
||||
|
@ -2918,7 +2918,7 @@ static int rtw_p2p_setDN(struct net_device *dev,
|
|||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
|
||||
DBG_88E("[%s] %s %d\n", __func__, extra, wrqu->data.length - 1);
|
||||
_rtw_memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN);
|
||||
memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN);
|
||||
memcpy(pwdinfo->device_name, extra, wrqu->data.length - 1);
|
||||
pwdinfo->device_name_len = wrqu->data.length - 1;
|
||||
|
||||
|
@ -3193,7 +3193,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
|
|||
/* The P2P Device ID attribute is included in the Beacon frame. */
|
||||
/* The P2P Device Info attribute is included in the probe response frame. */
|
||||
|
||||
_rtw_memset(attr_content, 0x00, 100);
|
||||
memset(attr_content, 0x00, 100);
|
||||
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
|
||||
/* Handle the P2P Device ID attribute of Beacon first */
|
||||
blnMatch = 1;
|
||||
|
@ -3509,8 +3509,8 @@ static int rtw_p2p_connect(struct net_device *dev,
|
|||
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
if (uintPeerChannel) {
|
||||
_rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info));
|
||||
_rtw_memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));
|
||||
memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info));
|
||||
memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));
|
||||
|
||||
pwdinfo->nego_req_info.peer_channel_num[0] = uintPeerChannel;
|
||||
memcpy(pwdinfo->nego_req_info.peerDevAddr, pnetwork->network.MacAddress, ETH_ALEN);
|
||||
|
@ -3572,11 +3572,11 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
|||
} else {
|
||||
/* Reset the content of struct tx_invite_req_info */
|
||||
pinvite_req_info->benable = false;
|
||||
_rtw_memset(pinvite_req_info->go_bssid, 0x00, ETH_ALEN);
|
||||
_rtw_memset(pinvite_req_info->go_ssid, 0x00, WLAN_SSID_MAXLEN);
|
||||
memset(pinvite_req_info->go_bssid, 0x00, ETH_ALEN);
|
||||
memset(pinvite_req_info->go_ssid, 0x00, WLAN_SSID_MAXLEN);
|
||||
pinvite_req_info->ssidlen = 0x00;
|
||||
pinvite_req_info->operating_ch = pwdinfo->operating_channel;
|
||||
_rtw_memset(pinvite_req_info->peer_macaddr, 0x00, ETH_ALEN);
|
||||
memset(pinvite_req_info->peer_macaddr, 0x00, ETH_ALEN);
|
||||
pinvite_req_info->token = 3;
|
||||
}
|
||||
|
||||
|
@ -3709,9 +3709,9 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
|||
return ret;
|
||||
} else {
|
||||
/* Reset the content of struct tx_provdisc_req_info excluded the wps_config_method_request. */
|
||||
_rtw_memset(pwdinfo->tx_prov_disc_info.peerDevAddr, 0x00, ETH_ALEN);
|
||||
_rtw_memset(pwdinfo->tx_prov_disc_info.peerIFAddr, 0x00, ETH_ALEN);
|
||||
_rtw_memset(&pwdinfo->tx_prov_disc_info.ssid, 0x00, sizeof(struct ndis_802_11_ssid));
|
||||
memset(pwdinfo->tx_prov_disc_info.peerDevAddr, 0x00, ETH_ALEN);
|
||||
memset(pwdinfo->tx_prov_disc_info.peerIFAddr, 0x00, ETH_ALEN);
|
||||
memset(&pwdinfo->tx_prov_disc_info.ssid, 0x00, sizeof(struct ndis_802_11_ssid));
|
||||
pwdinfo->tx_prov_disc_info.peer_channel_num[0] = 0;
|
||||
pwdinfo->tx_prov_disc_info.peer_channel_num[1] = 0;
|
||||
pwdinfo->tx_prov_disc_info.benable = false;
|
||||
|
@ -4845,7 +4845,7 @@ static int set_group_key(struct adapter *padapter, u8 *key, u8 alg, int keyid)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
_rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm));
|
||||
memset(psetkeyparm, 0, sizeof(struct setkey_parm));
|
||||
|
||||
psetkeyparm->keyid = (u8)keyid;
|
||||
|
||||
|
@ -4960,7 +4960,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
_rtw_memset(pwep, 0, wep_total_len);
|
||||
memset(pwep, 0, wep_total_len);
|
||||
|
||||
pwep->KeyLength = wep_key_len;
|
||||
pwep->Length = wep_total_len;
|
||||
|
@ -6496,9 +6496,9 @@ static int rtw_mp_read_reg(struct net_device *dev,
|
|||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
_rtw_memset(data, 0, 20);
|
||||
_rtw_memset(tmp, 0, 20);
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
memset(data, 0, 20);
|
||||
memset(tmp, 0, 20);
|
||||
memset(extra, 0, wrqu->length);
|
||||
|
||||
pch = input;
|
||||
pnext = strpbrk(pch, ",.-");
|
||||
|
@ -6624,7 +6624,7 @@ static int rtw_mp_read_reg(struct net_device *dev,
|
|||
if (data > 0xFFFFF)
|
||||
return -EINVAL;
|
||||
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
memset(extra, 0, wrqu->length);
|
||||
|
||||
write_rfreg(padapter, path, addr, data);
|
||||
|
||||
|
@ -6669,7 +6669,7 @@ static int rtw_mp_read_rf(struct net_device *dev,
|
|||
if (addr > 0xFF)
|
||||
return -EINVAL;
|
||||
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
memset(extra, 0, wrqu->length);
|
||||
|
||||
sprintf(data, "%08x", read_rfreg(padapter, path, addr));
|
||||
/* add read data format blank */
|
||||
|
@ -6900,7 +6900,7 @@ static int rtw_mp_ant_rx(struct net_device *dev,
|
|||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
memset(extra, 0, wrqu->length);
|
||||
|
||||
sprintf(extra, "switch Rx antenna to %s", input);
|
||||
|
||||
|
@ -6950,7 +6950,7 @@ static int rtw_mp_ctx(struct net_device *dev,
|
|||
stop = strncmp(extra, "stop", 4);
|
||||
sscanf(extra, "count =%d, pkt", &count);
|
||||
|
||||
_rtw_memset(extra, '\0', sizeof(*extra));
|
||||
memset(extra, '\0', sizeof(*extra));
|
||||
|
||||
if (stop == 0) {
|
||||
bStartTest = 0; /* To set Stop */
|
||||
|
@ -6990,7 +6990,7 @@ static int rtw_mp_ctx(struct net_device *dev,
|
|||
pmp_priv->tx.payload = 2;
|
||||
pattrib = &pmp_priv->tx.attrib;
|
||||
pattrib->pktlen = 1500;
|
||||
_rtw_memset(pattrib->dst, 0xFF, ETH_ALEN);
|
||||
memset(pattrib->dst, 0xFF, ETH_ALEN);
|
||||
SetPacketTx(padapter);
|
||||
} else {
|
||||
return -EFAULT;
|
||||
|
@ -7118,7 +7118,7 @@ static int rtw_mp_trx_query(struct net_device *dev,
|
|||
rxok = padapter->mppriv.rx_pktcount;
|
||||
rxfail = padapter->mppriv.rx_crcerrpktcount;
|
||||
|
||||
_rtw_memset(extra, '\0', 128);
|
||||
memset(extra, '\0', 128);
|
||||
|
||||
sprintf(extra, "Tx OK:%d, Tx Fail:%d, Rx OK:%d, CRC error:%d ", txok, txfail, rxok, rxfail);
|
||||
|
||||
|
@ -7143,7 +7143,7 @@ static int rtw_mp_pwrtrk(struct net_device *dev,
|
|||
kfree(input);
|
||||
return -EFAULT;
|
||||
}
|
||||
_rtw_memset(extra, 0, wrqu->length);
|
||||
memset(extra, 0, wrqu->length);
|
||||
|
||||
enable = 1;
|
||||
if (wrqu->length > 1) {/* not empty string */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue