Merge pull request #245 from CGarces/staging_cherrypick

Adapted commits from staging area
This commit is contained in:
Carlos Garcés 2021-10-11 12:18:18 +02:00 committed by GitHub
commit 5bc12edecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
88 changed files with 1114 additions and 1648 deletions

View File

@ -8,7 +8,6 @@ EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
#EXTRA_CFLAGS += -Wno-vla #EXTRA_CFLAGS += -Wno-vla
EXTRA_CFLAGS += -Wno-date-time EXTRA_CFLAGS += -Wno-date-time

View File

@ -635,8 +635,8 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_CONTENT_LEN_BANK, (PVOID)&efuse_max, bPseudoTest); EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_CONTENT_LEN_BANK, (PVOID)&efuse_max, bPseudoTest);
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (PVOID)&maprawlen, _FALSE); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (PVOID)&maprawlen, _FALSE);
_rtw_memset(eFuseWord, 0xff, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2)); memset(eFuseWord, 0xff, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2));
_rtw_memset(pEfuseHal->fakeEfuseInitMap, 0xff, EFUSE_MAX_MAP_LEN); memset(pEfuseHal->fakeEfuseInitMap, 0xff, EFUSE_MAX_MAP_LEN);
if (IS_HARDWARE_TYPE_8821(padapter)) if (IS_HARDWARE_TYPE_8821(padapter))
endBank = 3 - 1;/*EFUSE_MAX_BANK_8821A - 1;*/ endBank = 3 - 1;/*EFUSE_MAX_BANK_8821A - 1;*/
@ -688,7 +688,7 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
wden = (efuseHeader & 0x0f); wden = (efuseHeader & 0x0f);
} }
_rtw_memset(efuseData, '\0', EFUSE_MAX_WORD_UNIT * 2); memset(efuseData, '\0', EFUSE_MAX_WORD_UNIT * 2);
dataCnt = 0; dataCnt = 0;
if (offset < max_section) { if (offset < max_section) {
@ -1161,7 +1161,7 @@ u8 rtw_efuse_map_write(PADAPTER adapter, u16 addr, u16 cnts, u8 *data)
} else } else
err = rtw_halmac_write_logical_efuse_map(d, efuse, size, NULL, 0); err = rtw_halmac_write_logical_efuse_map(d, efuse, size, NULL, 0);
} else { } else {
_rtw_memset(mask_buf, 0xFF, sizeof(mask_buf)); memset(mask_buf, 0xFF, sizeof(mask_buf));
RTW_INFO("Efuse mask off\n"); RTW_INFO("Efuse mask off\n");
err = rtw_halmac_write_logical_efuse_map(d, efuse, size, mask_buf, size/16); err = rtw_halmac_write_logical_efuse_map(d, efuse, size, mask_buf, size/16);
} }
@ -1305,8 +1305,8 @@ VOID hal_ReadEFuse_BT_logic_map(
} }
/* 0xff will be efuse default value instead of 0x00. */ /* 0xff will be efuse default value instead of 0x00. */
_rtw_memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN);
_rtw_memset(phyefuse, 0xFF, EFUSE_BT_REAL_CONTENT_LEN); memset(phyefuse, 0xFF, EFUSE_BT_REAL_CONTENT_LEN);
if (rtw_efuse_bt_access(padapter, _FALSE, 0, EFUSE_BT_REAL_CONTENT_LEN, phyefuse)) if (rtw_efuse_bt_access(padapter, _FALSE, 0, EFUSE_BT_REAL_CONTENT_LEN, phyefuse))
dump_buf(phyefuse, EFUSE_BT_REAL_BANK_CONTENT_LEN); dump_buf(phyefuse, EFUSE_BT_REAL_BANK_CONTENT_LEN);
@ -1588,7 +1588,7 @@ Hal_EfuseWordEnableDataWrite(
/* RTW_INFO("%s: efuse_addr=%#x word_en=%#x\n", __FUNCTION__, efuse_addr, word_en); */ /* RTW_INFO("%s: efuse_addr=%#x word_en=%#x\n", __FUNCTION__, efuse_addr, word_en); */
_rtw_memset(tmpdata, 0xFF, PGPKT_DATA_SIZE); memset(tmpdata, 0xFF, PGPKT_DATA_SIZE);
if (!(word_en & BIT(0))) { if (!(word_en & BIT(0))) {
tmpaddr = start_addr; tmpaddr = start_addr;
@ -1638,7 +1638,7 @@ hal_EfuseConstructPGPkt(
u8 *pData, u8 *pData,
PPGPKT_STRUCT pTargetPkt) PPGPKT_STRUCT pTargetPkt)
{ {
_rtw_memset(pTargetPkt->data, 0xFF, PGPKT_DATA_SIZE); memset(pTargetPkt->data, 0xFF, PGPKT_DATA_SIZE);
pTargetPkt->offset = offset; pTargetPkt->offset = offset;
pTargetPkt->word_en = word_en; pTargetPkt->word_en = word_en;
efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data); efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data);
@ -2414,7 +2414,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
return _FAIL; return _FAIL;
} }
_rtw_memset(map, 0xFF, mapLen); memset(map, 0xFF, mapLen);
ret = rtw_efuse_map_read(padapter, 0, mapLen, map); ret = rtw_efuse_map_read(padapter, 0, mapLen, map);
if (ret == _FAIL) if (ret == _FAIL)
@ -2934,7 +2934,7 @@ void EFUSE_ShadowMapUpdate(
mapLen = EEPROM_MAX_SIZE; mapLen = EEPROM_MAX_SIZE;
efuse_map = pHalData->efuse_eeprom_data; efuse_map = pHalData->efuse_eeprom_data;
/* efuse default content is 0xFF */ /* efuse default content is 0xFF */
_rtw_memset(efuse_map, 0xFF, EEPROM_MAX_SIZE); memset(efuse_map, 0xFF, EEPROM_MAX_SIZE);
EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest); EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest);
if (!mapLen) { if (!mapLen) {
@ -2956,7 +2956,7 @@ void EFUSE_ShadowMapUpdate(
EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest); EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest);
if (pHalData->bautoload_fail_flag == _TRUE) if (pHalData->bautoload_fail_flag == _TRUE)
_rtw_memset(pHalData->efuse_eeprom_data, 0xFF, mapLen); memset(pHalData->efuse_eeprom_data, 0xFF, mapLen);
else { else {
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
if (_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pHalData->efuse_eeprom_data)) { if (_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pHalData->efuse_eeprom_data)) {
@ -3161,7 +3161,7 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size)
RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, map_size); RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, map_size);
goto exit; goto exit;
} }
_rtw_memset(map, 0xff, map_size); memset(map, 0xff, map_size);
temp[2] = 0; /* end of string '\0' */ temp[2] = 0; /* end of string '\0' */
@ -3213,9 +3213,9 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size)
exit: exit:
if (file_data) if (file_data)
rtw_vmfree(file_data, file_size); vfree(file_data);
if (map) if (map)
rtw_vmfree(map, map_size); vfree(map);
return ret; return ret;
} }

View File

@ -1165,7 +1165,7 @@ void dump_mesh_networks(void *sel, _adapter *adapter)
); );
} }
rtw_vmfree(mesh_networks, mlme->max_bss_cnt * sizeof(struct wlan_network *)); vfree(mesh_networks);
} }
void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset) void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset)
@ -1512,7 +1512,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si
goto exit; goto exit;
} }
_rtw_memset(&mpm_info, 0, sizeof(struct mpm_frame_info)); memset(&mpm_info, 0, sizeof(struct mpm_frame_info));
if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) { if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) {
mpm_info.aid = (u8 *)frame_body + 4; mpm_info.aid = (u8 *)frame_body + 4;
@ -2101,11 +2101,11 @@ int _rtw_mesh_plink_add(_adapter *adapter, const u8 *hwaddr)
#endif #endif
ent->llid = 0; ent->llid = 0;
ent->plid = 0; ent->plid = 0;
_rtw_memset(ent->chosen_pmk, 0, 16); memset(ent->chosen_pmk, 0, 16);
#ifdef CONFIG_RTW_MESH_AEK #ifdef CONFIG_RTW_MESH_AEK
_rtw_memset(ent->sel_pcs, 0, 4); memset(ent->sel_pcs, 0, 4);
_rtw_memset(ent->l_nonce, 0, 32); memset(ent->l_nonce, 0, 32);
_rtw_memset(ent->p_nonce, 0, 32); memset(ent->p_nonce, 0, 32);
#endif #endif
ent->plink_state = RTW_MESH_PLINK_LISTEN; ent->plink_state = RTW_MESH_PLINK_LISTEN;
#ifndef CONFIG_RTW_MESH_DRIVER_AID #ifndef CONFIG_RTW_MESH_DRIVER_AID
@ -2284,8 +2284,6 @@ void rtw_mesh_plink_ctl_deinit(_adapter *adapter)
} }
_exit_critical_bh(&(plink_ctl->lock), &irqL); _exit_critical_bh(&(plink_ctl->lock), &irqL);
_rtw_spinlock_free(&plink_ctl->lock);
#if CONFIG_RTW_MESH_PEER_BLACKLIST #if CONFIG_RTW_MESH_PEER_BLACKLIST
rtw_mesh_peer_blacklist_flush(adapter); rtw_mesh_peer_blacklist_flush(adapter);
_rtw_deinit_queue(&plink_ctl->peer_blacklist); _rtw_deinit_queue(&plink_ctl->peer_blacklist);
@ -3079,7 +3077,7 @@ void rtw_mesh_init_mesh_info(_adapter *adapter)
{ {
struct rtw_mesh_info *minfo = &adapter->mesh_info; struct rtw_mesh_info *minfo = &adapter->mesh_info;
_rtw_memset(minfo, 0, sizeof(struct rtw_mesh_info)); memset(minfo, 0, sizeof(struct rtw_mesh_info));
rtw_mesh_plink_ctl_init(adapter); rtw_mesh_plink_ctl_init(adapter);
@ -3087,7 +3085,7 @@ void rtw_mesh_init_mesh_info(_adapter *adapter)
/* minfo->last_sn_update = rtw_get_current_time(); */ /* minfo->last_sn_update = rtw_get_current_time(); */
minfo->next_perr = rtw_get_current_time(); minfo->next_perr = rtw_get_current_time();
ATOMIC_SET(&minfo->mpaths, 0); atomic_set(&minfo->mpaths, 0);
rtw_mesh_pathtbl_init(adapter); rtw_mesh_pathtbl_init(adapter);
_rtw_init_queue(&minfo->mpath_tx_queue); _rtw_init_queue(&minfo->mpath_tx_queue);
@ -3461,7 +3459,7 @@ void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *b
{ {
struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)buf; struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)buf;
_rtw_memset(mctrl, 0, XATTRIB_GET_MCTRL_LEN(attrib)); memset(mctrl, 0, XATTRIB_GET_MCTRL_LEN(attrib));
if (attrib->mfwd_ttl if (attrib->mfwd_ttl
#if CONFIG_RTW_MESH_DATA_BMC_TO_UC #if CONFIG_RTW_MESH_DATA_BMC_TO_UC

View File

@ -377,7 +377,7 @@ struct rtw_mesh_info {
/* Last used Path Discovery ID */ /* Last used Path Discovery ID */
u32 preq_id; u32 preq_id;
ATOMIC_T mpaths; atomic_t mpaths;
struct rtw_mesh_table *mesh_paths; struct rtw_mesh_table *mesh_paths;
struct rtw_mesh_table *mpp_paths; struct rtw_mesh_table *mpp_paths;
int mesh_paths_generation; int mesh_paths_generation;

View File

@ -230,7 +230,7 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(adapter, pattrib); update_mgntframe_attrib(adapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pos; pwlanhdr = (struct rtw_ieee80211_hdr *)pos;
@ -344,7 +344,7 @@ int rtw_mesh_path_error_tx(_adapter *adapter,
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(adapter, pattrib); update_mgntframe_attrib(adapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pos; pwlanhdr = (struct rtw_ieee80211_hdr *)pos;

View File

@ -82,7 +82,7 @@ static struct rtw_mesh_table *rtw_mesh_table_alloc(void)
return NULL; return NULL;
rtw_hlist_head_init(&newtbl->known_gates); rtw_hlist_head_init(&newtbl->known_gates);
ATOMIC_SET(&newtbl->entries, 0); atomic_set(&newtbl->entries, 0);
_rtw_spinlock_init(&newtbl->gates_lock); _rtw_spinlock_init(&newtbl->gates_lock);
return newtbl; return newtbl;
@ -544,7 +544,7 @@ struct rtw_mesh_path *rtw_mesh_path_new(_adapter *adapter,
return NULL; return NULL;
_rtw_memcpy(new_mpath->dst, dst, ETH_ALEN); _rtw_memcpy(new_mpath->dst, dst, ETH_ALEN);
_rtw_memset(new_mpath->rann_snd_addr, 0xFF, ETH_ALEN); memset(new_mpath->rann_snd_addr, 0xFF, ETH_ALEN);
new_mpath->is_root = false; new_mpath->is_root = false;
new_mpath->adapter = adapter; new_mpath->adapter = adapter;
new_mpath->flags = 0; new_mpath->flags = 0;
@ -584,7 +584,7 @@ struct rtw_mesh_path *rtw_mesh_path_add(_adapter *adapter,
if (is_multicast_mac_addr(dst)) if (is_multicast_mac_addr(dst))
return ERR_PTR(-ENOTSUPP); return ERR_PTR(-ENOTSUPP);
if (ATOMIC_INC_UNLESS(&adapter->mesh_info.mpaths, RTW_MESH_MAX_MPATHS) == 0) if (atomic_inc_unless(&adapter->mesh_info.mpaths, RTW_MESH_MAX_MPATHS) == 0)
return ERR_PTR(-ENOSPC); return ERR_PTR(-ENOSPC);
new_mpath = rtw_mesh_path_new(adapter, dst); new_mpath = rtw_mesh_path_new(adapter, dst);
@ -739,9 +739,8 @@ static void rtw_mesh_path_free_rcu(struct rtw_mesh_table *tbl,
rtw_mesh_gate_del(tbl, mpath); rtw_mesh_gate_del(tbl, mpath);
exit_critical_bh(&mpath->state_lock); exit_critical_bh(&mpath->state_lock);
_cancel_timer_ex(&mpath->timer); _cancel_timer_ex(&mpath->timer);
ATOMIC_DEC(&adapter->mesh_info.mpaths); atomic_dec(&adapter->mesh_info.mpaths);
ATOMIC_DEC(&tbl->entries); atomic_dec(&tbl->entries);
_rtw_spinlock_free(&mpath->state_lock);
rtw_mesh_path_flush_pending(mpath); rtw_mesh_path_flush_pending(mpath);

View File

@ -140,7 +140,7 @@ struct rtw_mesh_table {
rtw_hlist_head known_gates; rtw_hlist_head known_gates;
_lock gates_lock; _lock gates_lock;
rtw_rhashtable rhead; rtw_rhashtable rhead;
ATOMIC_T entries; atomic_t entries;
}; };
#define RTW_MESH_PATH_EXPIRE (600 * HZ) #define RTW_MESH_PATH_EXPIRE (600 * HZ)

View File

@ -38,7 +38,6 @@ void free_mlme_ap_info(_adapter *padapter)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
stop_ap_mode(padapter); stop_ap_mode(padapter);
_rtw_spinlock_free(&pmlmepriv->bcn_update_lock);
} }
@ -640,7 +639,7 @@ void expire_timeout_chk(_adapter *padapter)
#endif #endif
char del_asoc_list[NUM_STA]; char del_asoc_list[NUM_STA];
_rtw_memset(del_asoc_list, NUM_STA, NUM_STA); memset(del_asoc_list, NUM_STA, NUM_STA);
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
if (pmlmeext->active_keep_alive_check) { if (pmlmeext->active_keep_alive_check) {
@ -991,7 +990,7 @@ void update_bmc_sta(_adapter *padapter)
psta->ieee8021x_blocked = 0; psta->ieee8021x_blocked = 0;
_rtw_memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
/* psta->dot118021XPrivacy = _NO_PRIVACY_; */ /* !!! remove it, because it has been set before this. */ /* psta->dot118021XPrivacy = _NO_PRIVACY_; */ /* !!! remove it, because it has been set before this. */
@ -1171,7 +1170,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
/* todo: init other variables */ /* todo: init other variables */
_rtw_memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
/* add ratid */ /* add ratid */
@ -1510,11 +1509,11 @@ static void rtw_ap_check_scan(_adapter *padapter)
if (pbuf == NULL) { if (pbuf == NULL) {
/* HT CAP INFO IE don't exist, it is b/g mode bss.*/ /* HT CAP INFO IE don't exist, it is b/g mode bss.*/
if (_FALSE == ATOMIC_READ(&pmlmepriv->olbc)) if (_FALSE == atomic_read(&pmlmepriv->olbc))
ATOMIC_SET(&pmlmepriv->olbc, _TRUE); atomic_set(&pmlmepriv->olbc, _TRUE);
if (_FALSE == ATOMIC_READ(&pmlmepriv->olbc_ht)) if (_FALSE == atomic_read(&pmlmepriv->olbc_ht))
ATOMIC_SET(&pmlmepriv->olbc_ht, _TRUE); atomic_set(&pmlmepriv->olbc_ht, _TRUE);
if (padapter->registrypriv.wifi_spec) if (padapter->registrypriv.wifi_spec)
RTW_INFO("%s: %s is a/b/g ap\n", __func__, pnetwork->network.Ssid.Ssid); RTW_INFO("%s: %s is a/b/g ap\n", __func__, pnetwork->network.Ssid.Ssid);
@ -1811,7 +1810,7 @@ update_beacon:
mlme = &(pdvobj->padapters[i]->mlmepriv); mlme = &(pdvobj->padapters[i]->mlmepriv);
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
if ((ATOMIC_READ(&mlme->olbc) == _TRUE) || (ATOMIC_READ(&mlme->olbc_ht) == _TRUE)) { if ((atomic_read(&mlme->olbc) == _TRUE) || (atomic_read(&mlme->olbc_ht) == _TRUE)) {
/* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */ /* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */
mlme->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK); mlme->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK);
mlme->ht_op_mode |= OP_MODE_MAY_BE_LEGACY_STAS; mlme->ht_op_mode |= OP_MODE_MAY_BE_LEGACY_STAS;
@ -1934,7 +1933,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
pbss_network->IELength = len; pbss_network->IELength = len;
_rtw_memset(ie, 0, MAX_IE_SZ); memset(ie, 0, MAX_IE_SZ);
_rtw_memcpy(ie, pbuf, pbss_network->IELength); _rtw_memcpy(ie, pbuf, pbss_network->IELength);
@ -1967,7 +1966,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
/* SSID */ /* SSID */
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) { if (p && ie_len > 0) {
_rtw_memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len); _rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
pbss_network->Ssid.SsidLength = ie_len; pbss_network->Ssid.SsidLength = ie_len;
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
@ -1981,7 +1980,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
if (MLME_IS_MESH(padapter)) { if (MLME_IS_MESH(padapter)) {
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_MESH_ID, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_MESH_ID, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p && ie_len > 0) { if (p && ie_len > 0) {
_rtw_memset(&pbss_network->mesh_id, 0, sizeof(NDIS_802_11_SSID)); memset(&pbss_network->mesh_id, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(pbss_network->mesh_id.Ssid, (p + 2), ie_len); _rtw_memcpy(pbss_network->mesh_id.Ssid, (p + 2), ie_len);
pbss_network->mesh_id.SsidLength = ie_len; pbss_network->mesh_id.SsidLength = ie_len;
} }
@ -1998,7 +1997,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
pbss_network->Configuration.DSConfig = channel; pbss_network->Configuration.DSConfig = channel;
_rtw_memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX);
/* get supported rates */ /* get supported rates */
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if (p != NULL) { if (p != NULL) {
@ -2560,9 +2559,6 @@ static void _rtw_macaddr_acl_deinit(_adapter *adapter, u8 period, bool clear_onl
} }
_exit_critical_bh(&(acl_node_q->lock), &irqL); _exit_critical_bh(&(acl_node_q->lock), &irqL);
if (!clear_only)
_rtw_spinlock_free(&(acl_node_q->lock));
rtw_warn_on(acl->num); rtw_warn_on(acl->num);
acl->mode = RTW_ACL_MODE_DISABLED; acl->mode = RTW_ACL_MODE_DISABLED;
} }
@ -2786,7 +2782,7 @@ static int rtw_ap_set_key(_adapter *padapter, u8 *key, u8 alg, int keyid, u8 set
goto exit; goto exit;
} }
_rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm)); memset(psetkeyparm, 0, sizeof(struct setkey_parm));
psetkeyparm->keyid = (u8)keyid; psetkeyparm->keyid = (u8)keyid;
if (is_wep_enc(alg)) if (is_wep_enc(alg))
@ -2943,7 +2939,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
while (_FALSE == empty && rtw_get_passing_time_ms(start) < 3000) { while (_FALSE == empty && rtw_get_passing_time_ms(start) < 3000) {
rtw_msleep_os(100); msleep(100);
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
} }
@ -3086,7 +3082,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter)
__FUNCTION__, pmlmepriv->ht_op_mode); __FUNCTION__, pmlmepriv->ht_op_mode);
RTW_INFO("num_sta_40mhz_intolerant(%d), 20mhz_width_req(%d), intolerant_ch_rpt(%d), olbc(%d)\n", RTW_INFO("num_sta_40mhz_intolerant(%d), 20mhz_width_req(%d), intolerant_ch_rpt(%d), olbc(%d)\n",
pmlmepriv->num_sta_40mhz_intolerant, pmlmepriv->ht_20mhz_width_req, pmlmepriv->ht_intolerant_ch_reported, ATOMIC_READ(&pmlmepriv->olbc)); pmlmepriv->num_sta_40mhz_intolerant, pmlmepriv->ht_20mhz_width_req, pmlmepriv->ht_intolerant_ch_reported, atomic_read(&pmlmepriv->olbc));
/*parsing HT_INFO_IE, currently only update ht_op_mode - pht_info->infos[1] & pht_info->infos[2] for wifi logo test*/ /*parsing HT_INFO_IE, currently only update ht_op_mode - pht_info->infos[1] & pht_info->infos[2] for wifi logo test*/
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
@ -3098,7 +3094,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter)
/* for STA Channel Width/Secondary Channel Offset*/ /* for STA Channel Width/Secondary Channel Offset*/
if ((pmlmepriv->sw_to_20mhz == 0) && (pmlmeext->cur_channel <= 14)) { if ((pmlmepriv->sw_to_20mhz == 0) && (pmlmeext->cur_channel <= 14)) {
if ((pmlmepriv->num_sta_40mhz_intolerant > 0) || (pmlmepriv->ht_20mhz_width_req == _TRUE) if ((pmlmepriv->num_sta_40mhz_intolerant > 0) || (pmlmepriv->ht_20mhz_width_req == _TRUE)
|| (pmlmepriv->ht_intolerant_ch_reported == _TRUE) || (ATOMIC_READ(&pmlmepriv->olbc) == _TRUE)) { || (pmlmepriv->ht_intolerant_ch_reported == _TRUE) || (atomic_read(&pmlmepriv->olbc) == _TRUE)) {
SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info, 0); SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info, 0);
SET_HT_OP_ELE_STA_CHL_WIDTH(pht_info, 0); SET_HT_OP_ELE_STA_CHL_WIDTH(pht_info, 0);
@ -3115,7 +3111,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter)
} else { } else {
if ((pmlmepriv->num_sta_40mhz_intolerant == 0) && (pmlmepriv->ht_20mhz_width_req == _FALSE) if ((pmlmepriv->num_sta_40mhz_intolerant == 0) && (pmlmepriv->ht_20mhz_width_req == _FALSE)
&& (pmlmepriv->ht_intolerant_ch_reported == _FALSE) && (ATOMIC_READ(&pmlmepriv->olbc) == _FALSE)) { && (pmlmepriv->ht_intolerant_ch_reported == _FALSE) && (atomic_read(&pmlmepriv->olbc) == _FALSE)) {
if (pmlmeext->cur_bwmode >= CHANNEL_WIDTH_40) { if (pmlmeext->cur_bwmode >= CHANNEL_WIDTH_40) {
@ -3467,12 +3463,12 @@ int rtw_ht_operation_update(_adapter *padapter)
} }
if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) && if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) &&
(pmlmepriv->num_sta_no_ht || ATOMIC_READ(&pmlmepriv->olbc_ht))) { (pmlmepriv->num_sta_no_ht || atomic_read(&pmlmepriv->olbc_ht))) {
pmlmepriv->ht_op_mode |= HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT; pmlmepriv->ht_op_mode |= HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT;
op_mode_changes++; op_mode_changes++;
} else if ((pmlmepriv->ht_op_mode & } else if ((pmlmepriv->ht_op_mode &
HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) && HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) &&
(pmlmepriv->num_sta_no_ht == 0 && !ATOMIC_READ(&pmlmepriv->olbc_ht))) { (pmlmepriv->num_sta_no_ht == 0 && !atomic_read(&pmlmepriv->olbc_ht))) {
pmlmepriv->ht_op_mode &= pmlmepriv->ht_op_mode &=
~HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT; ~HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT;
op_mode_changes++; op_mode_changes++;
@ -3489,7 +3485,7 @@ int rtw_ht_operation_update(_adapter *padapter)
else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH) else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH)
&& pmlmepriv->num_sta_ht_20mhz) && pmlmepriv->num_sta_ht_20mhz)
new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED; new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED;
else if (ATOMIC_READ(&pmlmepriv->olbc_ht)) else if (atomic_read(&pmlmepriv->olbc_ht))
new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS; new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS;
else else
new_op_mode = OP_MODE_PURE; new_op_mode = OP_MODE_PURE;
@ -4148,8 +4144,8 @@ void start_ap_mode(_adapter *padapter)
pmlmepriv->num_sta_ht_20mhz = 0; pmlmepriv->num_sta_ht_20mhz = 0;
pmlmepriv->num_sta_40mhz_intolerant = 0; pmlmepriv->num_sta_40mhz_intolerant = 0;
ATOMIC_SET(&pmlmepriv->olbc, _FALSE); atomic_set(&pmlmepriv->olbc, _FALSE);
ATOMIC_SET(&pmlmepriv->olbc_ht, _FALSE); atomic_set(&pmlmepriv->olbc_ht, _FALSE);
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
pmlmepriv->ht_20mhz_width_req = _FALSE; pmlmepriv->ht_20mhz_width_req = _FALSE;
@ -4158,7 +4154,7 @@ void start_ap_mode(_adapter *padapter)
pmlmepriv->sw_to_20mhz = 0; pmlmepriv->sw_to_20mhz = 0;
#endif #endif
_rtw_memset(pmlmepriv->ext_capab_ie_data, 0, sizeof(pmlmepriv->ext_capab_ie_data)); memset(pmlmepriv->ext_capab_ie_data, 0, sizeof(pmlmepriv->ext_capab_ie_data));
pmlmepriv->ext_capab_ie_len = 0; pmlmepriv->ext_capab_ie_len = 0;
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
@ -4223,10 +4219,9 @@ void stop_ap_mode(_adapter *padapter)
pmlmepriv->update_bcn = _FALSE; pmlmepriv->update_bcn = _FALSE;
/*pmlmeext->bstart_bss = _FALSE;*/ /*pmlmeext->bstart_bss = _FALSE;*/
padapter->netif_up = _FALSE; padapter->netif_up = _FALSE;
/* _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); */
/* reset and init security priv , this can refine with rtw_reset_securitypriv */ /* reset and init security priv , this can refine with rtw_reset_securitypriv */
_rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv));
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
@ -5202,7 +5197,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct
sta->wpa2_group_cipher = 0; sta->wpa2_group_cipher = 0;
sta->wpa_pairwise_cipher = 0; sta->wpa_pairwise_cipher = 0;
sta->wpa2_pairwise_cipher = 0; sta->wpa2_pairwise_cipher = 0;
_rtw_memset(sta->wpa_ie, 0, sizeof(sta->wpa_ie)); memset(sta->wpa_ie, 0, sizeof(sta->wpa_ie));
if ((sec->wpa_psk & BIT(1)) && elems->rsn_ie) { if ((sec->wpa_psk & BIT(1)) && elems->rsn_ie) {
wpa_ie = elems->rsn_ie; wpa_ie = elems->rsn_ie;
@ -5427,7 +5422,7 @@ void rtw_ap_parse_sta_ht_ie(_adapter *adapter, struct sta_info *sta, struct rtw_
goto exit; goto exit;
/* save HT capabilities in the sta object */ /* save HT capabilities in the sta object */
_rtw_memset(&sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); memset(&sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap)) { if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap)) {
sta->flags |= WLAN_STA_HT; sta->flags |= WLAN_STA_HT;
sta->flags |= WLAN_STA_WME; sta->flags |= WLAN_STA_WME;
@ -5454,7 +5449,7 @@ void rtw_ap_parse_sta_vht_ie(_adapter *adapter, struct sta_info *sta, struct rtw
if (mlme->vhtpriv.vht_option == _FALSE) if (mlme->vhtpriv.vht_option == _FALSE)
goto exit; goto exit;
_rtw_memset(&sta->vhtpriv, 0, sizeof(struct vht_priv)); memset(&sta->vhtpriv, 0, sizeof(struct vht_priv));
if (elems->vht_capabilities && elems->vht_capabilities_len == VHT_CAP_IE_LEN) { if (elems->vht_capabilities && elems->vht_capabilities_len == VHT_CAP_IE_LEN) {
sta->flags |= WLAN_STA_VHT; sta->flags |= WLAN_STA_VHT;
_rtw_memcpy(sta->vhtpriv.vht_cap, elems->vht_capabilities, VHT_CAP_IE_LEN); _rtw_memcpy(sta->vhtpriv.vht_cap, elems->vht_capabilities, VHT_CAP_IE_LEN);

View File

@ -213,7 +213,7 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw)
attrib->rate = (u8)txrate; attrib->rate = (u8)txrate;
attrib->bf_pkt_type = 0; attrib->bf_pkt_type = 0;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -308,7 +308,7 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_
attrib->rate = (u8)txrate; attrib->rate = (u8)txrate;
attrib->bf_pkt_type = 0; attrib->bf_pkt_type = 0;
_rtw_memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET);
pframe = pmgntframe->buf_addr + TXDESC_OFFSET; pframe = pmgntframe->buf_addr + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -425,7 +425,7 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw)
else else
attrib->bf_pkt_type = 0; attrib->bf_pkt_type = 0;
_rtw_memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET);
pframe = pmgntframe->buf_addr + TXDESC_OFFSET; pframe = pmgntframe->buf_addr + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -517,7 +517,7 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll)
else else
attrib->bf_pkt_type = 2; attrib->bf_pkt_type = 2;
_rtw_memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET);
pframe = pmgntframe->buf_addr + TXDESC_OFFSET; pframe = pmgntframe->buf_addr + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -581,8 +581,8 @@ static void _sounding_update_min_period(PADAPTER adapter, u16 period, u8 leave)
static void _sounding_init(struct sounding_info *sounding) static void _sounding_init(struct sounding_info *sounding)
{ {
_rtw_memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU); memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU);
_rtw_memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU); memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU);
sounding->state = SOUNDING_STATE_NONE; sounding->state = SOUNDING_STATE_NONE;
sounding->su_bfee_curidx = 0xFF; sounding->su_bfee_curidx = 0xFF;
sounding->candidate_mu_bfee_cnt = 0; sounding->candidate_mu_bfee_cnt = 0;
@ -600,8 +600,8 @@ static void _sounding_reset_vars(PADAPTER adapter)
info = GET_BEAMFORM_INFO(adapter); info = GET_BEAMFORM_INFO(adapter);
sounding = &info->sounding_info; sounding = &info->sounding_info;
_rtw_memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU); memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU);
_rtw_memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU); memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU);
sounding->su_bfee_curidx = 0xFF; sounding->su_bfee_curidx = 0xFF;
sounding->candidate_mu_bfee_cnt = 0; sounding->candidate_mu_bfee_cnt = 0;
@ -1054,8 +1054,8 @@ static void _bfer_remove_entry(PADAPTER adapter, struct beamformer_entry *entry)
if (TEST_FLAG(entry->cap, BEAMFORMER_CAP_VHT_MU)) { if (TEST_FLAG(entry->cap, BEAMFORMER_CAP_VHT_MU)) {
info->beamformer_mu_cnt -= 1; info->beamformer_mu_cnt -= 1;
_rtw_memset(entry->gid_valid, 0, 8); memset(entry->gid_valid, 0, 8);
_rtw_memset(entry->user_position, 0, 16); memset(entry->user_position, 0, 16);
} else if (TEST_FLAG(entry->cap, BEAMFORMER_CAP_VHT_SU|BEAMFORMER_CAP_HT_EXPLICIT)) { } else if (TEST_FLAG(entry->cap, BEAMFORMER_CAP_VHT_SU|BEAMFORMER_CAP_HT_EXPLICIT)) {
info->beamformer_su_cnt -= 1; info->beamformer_su_cnt -= 1;
} }
@ -1245,7 +1245,7 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter,
RTW_ERR("%s: UNEXPECTED!! info->TargetSUBFee is NULL!", __FUNCTION__); RTW_ERR("%s: UNEXPECTED!! info->TargetSUBFee is NULL!", __FUNCTION__);
} }
info->TargetSUBFee = NULL; info->TargetSUBFee = NULL;
_rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO));
rtw_bf_cmd(adapter, BEAMFORMING_CTRL_SET_CSI_REPORT, (u8*)&info->TargetCSIInfo, sizeof(struct _RT_CSI_INFO), 0); rtw_bf_cmd(adapter, BEAMFORMING_CTRL_SET_CSI_REPORT, (u8*)&info->TargetCSIInfo, sizeof(struct _RT_CSI_INFO), 0);
} }
} }
@ -1268,7 +1268,7 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter,
/* Record the first SU BFee index. We only allow the first SU BFee to be sound */ /* Record the first SU BFee index. We only allow the first SU BFee to be sound */
if ((info->beamformee_su_cnt == 1) && (info->beamformee_mu_cnt == 0)) { if ((info->beamformee_su_cnt == 1) && (info->beamformee_mu_cnt == 0)) {
info->TargetSUBFee = bfee; info->TargetSUBFee = bfee;
_rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO));
bfee->bSuspendSUCap = _FALSE; bfee->bSuspendSUCap = _FALSE;
} else { } else {
bfee->bSuspendSUCap = _TRUE; bfee->bSuspendSUCap = _TRUE;
@ -1308,7 +1308,7 @@ static void _bfee_remove_entry(PADAPTER adapter, struct beamformee_entry *entry)
if ((info->beamformee_mu_cnt == 0) && (info->beamformee_su_cnt > 0)) { if ((info->beamformee_mu_cnt == 0) && (info->beamformee_su_cnt > 0)) {
idx = _bfee_get_first_su_entry_idx(adapter, NULL); idx = _bfee_get_first_su_entry_idx(adapter, NULL);
info->TargetSUBFee = &info->bfee_entry[idx]; info->TargetSUBFee = &info->bfee_entry[idx];
_rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO));
info->TargetSUBFee->bSuspendSUCap = _FALSE; info->TargetSUBFee->bSuspendSUCap = _FALSE;
} }
} }
@ -1320,7 +1320,7 @@ static void _bfee_remove_entry(PADAPTER adapter, struct beamformee_entry *entry)
&& (entry == info->TargetSUBFee)) { && (entry == info->TargetSUBFee)) {
entry->bSuspendSUCap = _TRUE; entry->bSuspendSUCap = _TRUE;
info->TargetSUBFee = NULL; info->TargetSUBFee = NULL;
_rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO));
rtw_bf_cmd(adapter, BEAMFORMING_CTRL_SET_CSI_REPORT, (u8*)&info->TargetCSIInfo, sizeof(struct _RT_CSI_INFO), 0); rtw_bf_cmd(adapter, BEAMFORMING_CTRL_SET_CSI_REPORT, (u8*)&info->TargetCSIInfo, sizeof(struct _RT_CSI_INFO), 0);
} }
} }
@ -1711,7 +1711,7 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi
attrib->bwmode = CHANNEL_WIDTH_20; attrib->bwmode = CHANNEL_WIDTH_20;
attrib->subtype = WIFI_ACTION; attrib->subtype = WIFI_ACTION;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)pmgntframe->buf_addr + TXDESC_OFFSET; pframe = (u8 *)pmgntframe->buf_addr + TXDESC_OFFSET;
wlanhdr = (struct rtw_ieee80211_hdr *)pframe; wlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -2205,7 +2205,7 @@ BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw,
pattrib->order = 1; pattrib->order = 1;
pattrib->subtype = WIFI_ACTION_NOACK; pattrib->subtype = WIFI_ACTION_NOACK;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -2281,7 +2281,7 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, u8
pattrib->order = 1; pattrib->order = 1;
pattrib->subtype = WIFI_ACTION_NOACK; pattrib->subtype = WIFI_ACTION_NOACK;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -2368,7 +2368,7 @@ BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel
pattrib->bwmode = bw; pattrib->bwmode = bw;
pattrib->subtype = WIFI_NDPA; pattrib->subtype = WIFI_NDPA;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -2454,7 +2454,7 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel_wi
pattrib->bwmode = bw; pattrib->bwmode = bw;
pattrib->subtype = WIFI_NDPA; pattrib->subtype = WIFI_NDPA;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;

View File

@ -1522,7 +1522,7 @@ mptbt_BtControlProcess(
/* RTW_INFO("[MPT], parameters(hex):0x%x %d\n",&pBtReq->pParamStart[0], pBtReq->paraLength); */ /* RTW_INFO("[MPT], parameters(hex):0x%x %d\n",&pBtReq->pParamStart[0], pBtReq->paraLength); */
} }
_rtw_memset((void *)pMptCtx->mptOutBuf, 0, 100); memset((void *)pMptCtx->mptOutBuf, 0, 100);
pMptCtx->mptOutLen = 4; /* length of (BT_RSP_CMD.status+BT_RSP_CMD.paraLength) */ pMptCtx->mptOutLen = 4; /* length of (BT_RSP_CMD.status+BT_RSP_CMD.paraLength) */
pBtRsp = (PBT_RSP_CMD)pMptCtx->mptOutBuf; pBtRsp = (PBT_RSP_CMD)pMptCtx->mptOutBuf;

View File

@ -624,7 +624,7 @@ u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen)
RTW_INFO("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n" RTW_INFO("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
,pcmd[4],pcmd[5],pcmd[6],pcmd[7],pcmd[8],pcmd[9],pcmd[10],pcmd[11]);*/ ,pcmd[4],pcmd[5],pcmd[6],pcmd[7],pcmd[8],pcmd[9],pcmd[10],pcmd[11]);*/
_rtw_memset(btinfo, 0, BT_INFO_LENGTH); memset(btinfo, 0, BT_INFO_LENGTH);
#if 1 #if 1
if (BT_INFO_LENGTH != btInfoLen) { if (BT_INFO_LENGTH != btInfoLen) {
@ -1322,7 +1322,7 @@ void rtw_btcoex_recvmsgbysocket(void *data)
/*important: cut the udp header from skb->data! header length is 8 byte*/ /*important: cut the udp header from skb->data! header length is 8 byte*/
recv_length = skb->len - 8; recv_length = skb->len - 8;
_rtw_memset(recv_data, 0, sizeof(recv_data)); memset(recv_data, 0, sizeof(recv_data));
_rtw_memcpy(recv_data, skb->data + 8, recv_length); _rtw_memcpy(recv_data, skb->data + 8, recv_length);
parse_res = rtw_btcoex_parse_recv_data(recv_data, recv_length); parse_res = rtw_btcoex_parse_recv_data(recv_data, recv_length);
@ -1516,12 +1516,12 @@ u8 rtw_btcoex_create_kernel_socket(_adapter *padapter)
RTW_INFO("Error during creation of socket error:%d\n", kernel_socket_err); RTW_INFO("Error during creation of socket error:%d\n", kernel_socket_err);
status = _FAIL; status = _FAIL;
} else { } else {
_rtw_memset(&(pcoex_info->wifi_sockaddr), 0, sizeof(pcoex_info->wifi_sockaddr)); memset(&(pcoex_info->wifi_sockaddr), 0, sizeof(pcoex_info->wifi_sockaddr));
pcoex_info->wifi_sockaddr.sin_family = AF_INET; pcoex_info->wifi_sockaddr.sin_family = AF_INET;
pcoex_info->wifi_sockaddr.sin_port = htons(CONNECT_PORT); pcoex_info->wifi_sockaddr.sin_port = htons(CONNECT_PORT);
pcoex_info->wifi_sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); pcoex_info->wifi_sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
_rtw_memset(&(pcoex_info->bt_sockaddr), 0, sizeof(pcoex_info->bt_sockaddr)); memset(&(pcoex_info->bt_sockaddr), 0, sizeof(pcoex_info->bt_sockaddr));
pcoex_info->bt_sockaddr.sin_family = AF_INET; pcoex_info->bt_sockaddr.sin_family = AF_INET;
pcoex_info->bt_sockaddr.sin_port = htons(CONNECT_PORT_BT); pcoex_info->bt_sockaddr.sin_port = htons(CONNECT_PORT_BT);
pcoex_info->bt_sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); pcoex_info->bt_sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
@ -1570,7 +1570,7 @@ void rtw_btcoex_init_socket(_adapter *padapter)
struct bt_coex_info *pcoex_info = &padapter->coex_info; struct bt_coex_info *pcoex_info = &padapter->coex_info;
RTW_INFO("%s\n", __func__); RTW_INFO("%s\n", __func__);
if (_FALSE == pcoex_info->is_exist) { if (_FALSE == pcoex_info->is_exist) {
_rtw_memset(pcoex_info, 0, sizeof(struct bt_coex_info)); memset(pcoex_info, 0, sizeof(struct bt_coex_info));
pcoex_info->btcoex_wq = create_workqueue("BTCOEX"); pcoex_info->btcoex_wq = create_workqueue("BTCOEX");
INIT_DELAYED_WORK(&pcoex_info->recvmsg_work, INIT_DELAYED_WORK(&pcoex_info->recvmsg_work,
(void *)rtw_btcoex_recvmsgbysocket); (void *)rtw_btcoex_recvmsgbysocket);

View File

@ -476,7 +476,7 @@ u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel
return chanset_size; return chanset_size;
} }
_rtw_memset(channel_set, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM); memset(channel_set, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM);
if (IsSupported24G(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_2G)) if (IsSupported24G(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_2G))
b2_4GBand = _TRUE; b2_4GBand = _TRUE;

View File

@ -139,7 +139,7 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv)
#endif #endif
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
ATOMIC_SET(&pevtpriv->event_seq, 0); atomic_set(&pevtpriv->event_seq, 0);
pevtpriv->evt_done_cnt = 0; pevtpriv->evt_done_cnt = 0;
#ifdef CONFIG_EVENT_THREAD_MODE #ifdef CONFIG_EVENT_THREAD_MODE
@ -205,7 +205,7 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
#ifdef CONFIG_C2H_WK #ifdef CONFIG_C2H_WK
_cancel_workitem_sync(&pevtpriv->c2h_wk); _cancel_workitem_sync(&pevtpriv->c2h_wk);
while (pevtpriv->c2h_wk_alive) while (pevtpriv->c2h_wk_alive)
rtw_msleep_os(10); msleep(10);
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) { while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
void *c2h; void *c2h;
@ -224,7 +224,6 @@ void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
{ {
if (pcmdpriv) { if (pcmdpriv) {
_rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock));
_rtw_free_sema(&(pcmdpriv->cmd_queue_sema)); _rtw_free_sema(&(pcmdpriv->cmd_queue_sema));
/* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */ /* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */
_rtw_free_sema(&(pcmdpriv->start_cmdthread_sema)); _rtw_free_sema(&(pcmdpriv->start_cmdthread_sema));
@ -424,11 +423,11 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
bAllow = _TRUE; bAllow = _TRUE;
if ((!rtw_is_hw_init_completed(pcmdpriv->padapter) && (bAllow == _FALSE)) if ((!rtw_is_hw_init_completed(pcmdpriv->padapter) && (bAllow == _FALSE))
|| ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _FALSE /* com_thread not running */ || atomic_read(&(pcmdpriv->cmdthd_running)) == _FALSE /* com_thread not running */
) { ) {
if (DBG_CMD_EXECUTE) if (DBG_CMD_EXECUTE)
RTW_INFO(ADPT_FMT" drop "CMD_FMT" hw_init_completed:%u, cmdthd_running:%u\n", ADPT_ARG(cmd_obj->padapter) RTW_INFO(ADPT_FMT" drop "CMD_FMT" hw_init_completed:%u, cmdthd_running:%u\n", ADPT_ARG(cmd_obj->padapter)
, CMD_ARG(cmd_obj), rtw_get_hw_init_completed(cmd_obj->padapter), ATOMIC_READ(&pcmdpriv->cmdthd_running)); , CMD_ARG(cmd_obj), rtw_get_hw_init_completed(cmd_obj->padapter), atomic_read(&pcmdpriv->cmdthd_running));
if (0) if (0)
rtw_warn_on(1); rtw_warn_on(1);
@ -545,7 +544,7 @@ thread_return rtw_cmd_thread(thread_context context)
pcmdbuf = pcmdpriv->cmd_buf; pcmdbuf = pcmdpriv->cmd_buf;
prspbuf = pcmdpriv->rsp_buf; prspbuf = pcmdpriv->rsp_buf;
ATOMIC_SET(&(pcmdpriv->cmdthd_running), _TRUE); atomic_set(&(pcmdpriv->cmdthd_running), _TRUE);
_rtw_up_sema(&pcmdpriv->start_cmdthread_sema); _rtw_up_sema(&pcmdpriv->start_cmdthread_sema);
@ -702,7 +701,7 @@ post_process:
#endif #endif
/* to avoid enqueue cmd after free all cmd_obj */ /* to avoid enqueue cmd after free all cmd_obj */
ATOMIC_SET(&(pcmdpriv->cmdthd_running), _FALSE); atomic_set(&(pcmdpriv->cmdthd_running), _FALSE);
/* free all cmd_obj resources */ /* free all cmd_obj resources */
do { do {
@ -852,7 +851,7 @@ void rtw_init_sitesurvey_parm(_adapter *padapter, struct sitesurvey_parm *pparm)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_rtw_memset(pparm, 0, sizeof(struct sitesurvey_parm)); memset(pparm, 0, sizeof(struct sitesurvey_parm));
pparm->scan_mode = pmlmepriv->scan_mode; pparm->scan_mode = pmlmepriv->scan_mode;
} }
@ -1439,7 +1438,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
goto exit; goto exit;
} }
_rtw_memset(psecnetwork, 0, t_len); memset(psecnetwork, 0, t_len);
_rtw_memcpy(psecnetwork, &pnetwork->network, get_WLAN_BSSID_EX_sz(&pnetwork->network)); _rtw_memcpy(psecnetwork, &pnetwork->network, get_WLAN_BSSID_EX_sz(&pnetwork->network));
@ -3243,8 +3242,8 @@ static void dynamic_update_bcn_check(_adapter *padapter)
if (count % 10 == 0) { if (count % 10 == 0) {
count = 1; count = 1;
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
if (_FALSE == ATOMIC_READ(&pmlmepriv->olbc) if (_FALSE == atomic_read(&pmlmepriv->olbc)
&& _FALSE == ATOMIC_READ(&pmlmepriv->olbc_ht)) { && _FALSE == atomic_read(&pmlmepriv->olbc_ht)) {
if (rtw_ht_operation_update(padapter) > 0) { if (rtw_ht_operation_update(padapter) > 0) {
update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE);
@ -3257,16 +3256,16 @@ static void dynamic_update_bcn_check(_adapter *padapter)
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
/* In 2s, there are any legacy AP, update HT info, and then reset count */ /* In 2s, there are any legacy AP, update HT info, and then reset count */
if (_FALSE != ATOMIC_READ(&pmlmepriv->olbc) if (_FALSE != atomic_read(&pmlmepriv->olbc)
&& _FALSE != ATOMIC_READ(&pmlmepriv->olbc_ht)) { && _FALSE != atomic_read(&pmlmepriv->olbc_ht)) {
if (rtw_ht_operation_update(padapter) > 0) { if (rtw_ht_operation_update(padapter) > 0) {
update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE);
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE);
} }
ATOMIC_SET(&pmlmepriv->olbc, _FALSE); atomic_set(&pmlmepriv->olbc, _FALSE);
ATOMIC_SET(&pmlmepriv->olbc_ht, _FALSE); atomic_set(&pmlmepriv->olbc_ht, _FALSE);
count = 0; count = 0;
} }
#endif /* CONFIG_80211N_HT */ #endif /* CONFIG_80211N_HT */
@ -4148,7 +4147,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter)
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
while (_FALSE == empty && rtw_get_passing_time_ms(start) < rtw_get_wait_hiq_empty_ms()) { while (_FALSE == empty && rtw_get_passing_time_ms(start) < rtw_get_wait_hiq_empty_ms()) {
rtw_msleep_os(100); msleep(100);
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty);
} }

View File

@ -530,7 +530,7 @@ void dump_adapters_status(void *sel, struct dvobj_priv *dvobj)
iface = dvobj->padapters[i]; iface = dvobj->padapters[i];
if (iface) { if (iface) {
#if (defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)) || defined(CONFIG_CLIENT_PORT_CFG) #if (defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)) || defined(CONFIG_CLIENT_PORT_CFG)
_rtw_memset(&str_val, '\0', sizeof(str_val)); memset(&str_val, '\0', sizeof(str_val));
#endif #endif
#if defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN) #if defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)
if (MLME_IS_AP(iface) || MLME_IS_MESH(iface)) { if (MLME_IS_AP(iface) || MLME_IS_MESH(iface)) {
@ -541,7 +541,7 @@ void dump_adapters_status(void *sel, struct dvobj_priv *dvobj)
len = snprintf(tmp_str, sizeof(tmp_str), "%s", "ap_id:"); len = snprintf(tmp_str, sizeof(tmp_str), "%s", "ap_id:");
strncpy(p, tmp_str, len); strncpy(p, tmp_str, len);
p += len; p += len;
_rtw_memset(&tmp_str, '\0', sizeof(tmp_str)); memset(&tmp_str, '\0', sizeof(tmp_str));
#ifdef DBG_HW_PORT #ifdef DBG_HW_PORT
len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->vap_id, iface->hw_port, iface->client_port); len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->vap_id, iface->hw_port, iface->client_port);
#else #else
@ -559,7 +559,7 @@ void dump_adapters_status(void *sel, struct dvobj_priv *dvobj)
len = snprintf(tmp_str, sizeof(tmp_str), "%s", "c_pid:"); len = snprintf(tmp_str, sizeof(tmp_str), "%s", "c_pid:");
strncpy(p, tmp_str, len); strncpy(p, tmp_str, len);
p += len; p += len;
_rtw_memset(&tmp_str, '\0', sizeof(tmp_str)); memset(&tmp_str, '\0', sizeof(tmp_str));
#ifdef DBG_HW_PORT #ifdef DBG_HW_PORT
len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->client_port, iface->hw_port, iface->client_port); len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->client_port, iface->hw_port, iface->client_port);
#else #else
@ -932,13 +932,13 @@ int proc_get_tx_stat(struct seq_file *m, void *v)
} else { } else {
//to avoid c2h modify counters //to avoid c2h modify counters
pstapriv_primary->gotc2h = NULL; pstapriv_primary->gotc2h = NULL;
_rtw_memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN); memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN);
pstapriv_primary->c2h_adapter_id = CONFIG_IFACE_NUMBER; pstapriv_primary->c2h_adapter_id = CONFIG_IFACE_NUMBER;
RTW_PRINT_SEL(m, "Warming : Query timeout, operation abort!!\n"); RTW_PRINT_SEL(m, "Warming : Query timeout, operation abort!!\n");
break; break;
} }
pstapriv_primary->gotc2h = NULL; pstapriv_primary->gotc2h = NULL;
_rtw_memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN); memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN);
pstapriv_primary->c2h_adapter_id = CONFIG_IFACE_NUMBER; pstapriv_primary->c2h_adapter_id = CONFIG_IFACE_NUMBER;
} }
return 0; return 0;
@ -1718,7 +1718,7 @@ int proc_get_trx_info(struct seq_file *m, void *v)
rtw_hal_get_hwreg(padapter, HW_VAR_DUMP_MAC_TXFIFO, (u8 *)m); rtw_hal_get_hwreg(padapter, HW_VAR_DUMP_MAC_TXFIFO, (u8 *)m);
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
RTW_PRINT_SEL(m, "rx_urb_pending_cn=%d\n", ATOMIC_READ(&(precvpriv->rx_pending_cnt))); RTW_PRINT_SEL(m, "rx_urb_pending_cn=%d\n", atomic_read(&(precvpriv->rx_pending_cnt)));
#endif #endif
dump_rx_bh_tk(m, &GET_PRIMARY_ADAPTER(padapter)->recvpriv); dump_rx_bh_tk(m, &GET_PRIMARY_ADAPTER(padapter)->recvpriv);
@ -2273,7 +2273,7 @@ ssize_t proc_set_ps_dbg_info(struct file *file, const char __user *buffer, size_
int num = sscanf(tmp, "%hhx", &ps_dbg_cmd_id); int num = sscanf(tmp, "%hhx", &ps_dbg_cmd_id);
if (num == 1 && ps_dbg_cmd_id == 1) /*Clean all*/ if (num == 1 && ps_dbg_cmd_id == 1) /*Clean all*/
_rtw_memset(pdbgpriv, 0, sizeof(struct debug_priv)); memset(pdbgpriv, 0, sizeof(struct debug_priv));
} }
@ -3924,9 +3924,9 @@ ssize_t proc_set_btcoex_dbg(struct file *file, const char __user *buffer, size_t
num = sscanf(tmp, "%x %x", module, module + 1); num = sscanf(tmp, "%x %x", module, module + 1);
if (1 == num) { if (1 == num) {
if (0 == module[0]) if (0 == module[0])
_rtw_memset(module, 0, sizeof(module)); memset(module, 0, sizeof(module));
else else
_rtw_memset(module, 0xFF, sizeof(module)); memset(module, 0xFF, sizeof(module));
} else if (2 != num) { } else if (2 != num) {
RTW_INFO(FUNC_ADPT_FMT ": input(\"%s\") format incorrect!\n", RTW_INFO(FUNC_ADPT_FMT ": input(\"%s\") format incorrect!\n",
FUNC_ADPT_ARG(padapter), tmp); FUNC_ADPT_ARG(padapter), tmp);
@ -4552,7 +4552,7 @@ int proc_get_pattern_info(struct seq_file *m, void *v)
p_str = str_1; p_str = str_1;
max_len = sizeof(str_1); max_len = sizeof(str_1);
for (i = 0 ; i < MAX_WKFM_PATTERN_SIZE / 8 ; i++) { for (i = 0 ; i < MAX_WKFM_PATTERN_SIZE / 8 ; i++) {
_rtw_memset(p_str, 0, max_len); memset(p_str, 0, max_len);
len = 0; len = 0;
for (j = 0 ; j < 8 ; j++) { for (j = 0 ; j < 8 ; j++) {
val8 = pwrpriv->patterns[k].content[i * 8 + j]; val8 = pwrpriv->patterns[k].content[i * 8 + j];
@ -4563,7 +4563,7 @@ int proc_get_pattern_info(struct seq_file *m, void *v)
} }
RTW_PRINT_SEL(m, "\npattern mask:\n"); RTW_PRINT_SEL(m, "\npattern mask:\n");
for (i = 0 ; i < MAX_WKFM_SIZE / 8 ; i++) { for (i = 0 ; i < MAX_WKFM_SIZE / 8 ; i++) {
_rtw_memset(p_str, 0, max_len); memset(p_str, 0, max_len);
len = 0; len = 0;
for (j = 0 ; j < 8 ; j++) { for (j = 0 ; j < 8 ; j++) {
val8 = pwrpriv->patterns[k].mask[i * 8 + j]; val8 = pwrpriv->patterns[k].mask[i * 8 + j];
@ -5132,7 +5132,7 @@ static int proc_tdls_display_tdls_function_info(struct seq_file *m)
} }
} }
RTW_PRINT_SEL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS CH SW On", (ATOMIC_READ(&ptdlsinfo->chsw_info.chsw_on) == _TRUE) ? "_TRUE" : "_FALSE"); RTW_PRINT_SEL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS CH SW On", (atomic_read(&ptdlsinfo->chsw_info.chsw_on) == _TRUE) ? "_TRUE" : "_FALSE");
RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Off-Channel Num", ptdlsinfo->chsw_info.off_ch_num); RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Off-Channel Num", ptdlsinfo->chsw_info.off_ch_num);
RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Channel Offset", ptdlsinfo->chsw_info.ch_offset); RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Channel Offset", ptdlsinfo->chsw_info.ch_offset);
RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Current Time", ptdlsinfo->chsw_info.cur_time); RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Current Time", ptdlsinfo->chsw_info.cur_time);
@ -6980,7 +6980,7 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
} }
if (p != &str_out[0]) { if (p != &str_out[0]) {
_RTW_STR_DUMP_SEL(sel, str_out); _RTW_STR_DUMP_SEL(sel, str_out);
_rtw_memset(&str_out, '\0', sizeof(str_out)); memset(&str_out, '\0', sizeof(str_out));
} }
/*dump buffer*/ /*dump buffer*/
@ -7005,7 +7005,7 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
p += len; p += len;
} }
_RTW_STR_DUMP_SEL(sel, str_out); _RTW_STR_DUMP_SEL(sel, str_out);
_rtw_memset(&str_out, '\0', sizeof(str_out)); memset(&str_out, '\0', sizeof(str_out));
} }
p = &str_out[0]; p = &str_out[0];

View File

@ -457,7 +457,7 @@ exit:
void rtw_set_supported_rate(u8 *SupportedRates, uint mode) void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
{ {
_rtw_memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX);
switch (mode) { switch (mode) {
case WIRELESS_11B: case WIRELESS_11B:
@ -789,7 +789,7 @@ int rtw_rsne_info_parse(const u8 *ie, uint ie_len, struct rsne_info *info)
const u8 *pos = ie; const u8 *pos = ie;
u16 cnt; u16 cnt;
_rtw_memset(info, 0, sizeof(struct rsne_info)); memset(info, 0, sizeof(struct rsne_info));
if (ie + ie_len < pos + 4) if (ie + ie_len < pos + 4)
goto err; goto err;
@ -1304,7 +1304,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
u8 *pos = start; u8 *pos = start;
int unknown = 0; int unknown = 0;
_rtw_memset(elems, 0, sizeof(*elems)); memset(elems, 0, sizeof(*elems));
while (left >= 2) { while (left >= 2) {
u8 id, elen; u8 id, elen;
@ -2206,7 +2206,7 @@ uint rtw_del_p2p_ie(u8 *ies, uint ies_len_ori, const char *msg)
} }
_rtw_memmove(target_ie, next_ie, remain_len); _rtw_memmove(target_ie, next_ie, remain_len);
_rtw_memset(target_ie + remain_len, 0, target_ie_len); memset(target_ie + remain_len, 0, target_ie_len);
ies_len -= target_ie_len; ies_len -= target_ie_len;
if (DBG_DEL_P2P_IE && msg) { if (DBG_DEL_P2P_IE && msg) {
@ -2247,7 +2247,7 @@ uint rtw_del_p2p_attr(u8 *ie, uint ielen_ori, u8 attr_id)
} }
_rtw_memmove(target_attr, next_attr, remain_len); _rtw_memmove(target_attr, next_attr, remain_len);
_rtw_memset(target_attr + remain_len, 0, target_attr_len); memset(target_attr + remain_len, 0, target_attr_len);
*(ie + 1) -= target_attr_len; *(ie + 1) -= target_attr_len;
ielen -= target_attr_len; ielen -= target_attr_len;
@ -2317,7 +2317,7 @@ void rtw_bss_ex_del_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
u8 *next_ie = ie + ie_len; u8 *next_ie = ie + ie_len;
_rtw_memmove(next_ie, next_ie_ori, remain_len); _rtw_memmove(next_ie, next_ie_ori, remain_len);
_rtw_memset(next_ie + remain_len, 0, ie_len_ori - ie_len); memset(next_ie + remain_len, 0, ie_len_ori - ie_len);
bss_ex->IELength -= ie_len_ori - ie_len; bss_ex->IELength -= ie_len_ori - ie_len;
ies = next_ie; ies = next_ie;
@ -2533,7 +2533,7 @@ uint rtw_del_wfd_ie(u8 *ies, uint ies_len_ori, const char *msg)
} }
_rtw_memmove(target_ie, next_ie, remain_len); _rtw_memmove(target_ie, next_ie, remain_len);
_rtw_memset(target_ie + remain_len, 0, target_ie_len); memset(target_ie + remain_len, 0, target_ie_len);
ies_len -= target_ie_len; ies_len -= target_ie_len;
if (DBG_DEL_WFD_IE && msg) { if (DBG_DEL_WFD_IE && msg) {
@ -2574,7 +2574,7 @@ uint rtw_del_wfd_attr(u8 *ie, uint ielen_ori, u8 attr_id)
} }
_rtw_memmove(target_attr, next_attr, remain_len); _rtw_memmove(target_attr, next_attr, remain_len);
_rtw_memset(target_attr + remain_len, 0, target_attr_len); memset(target_attr + remain_len, 0, target_attr_len);
*(ie + 1) -= target_attr_len; *(ie + 1) -= target_attr_len;
ielen -= target_attr_len; ielen -= target_attr_len;
@ -2643,7 +2643,7 @@ void rtw_bss_ex_del_wfd_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
u8 *next_ie = ie + ie_len; u8 *next_ie = ie + ie_len;
_rtw_memmove(next_ie, next_ie_ori, remain_len); _rtw_memmove(next_ie, next_ie_ori, remain_len);
_rtw_memset(next_ie + remain_len, 0, ie_len_ori - ie_len); memset(next_ie + remain_len, 0, ie_len_ori - ie_len);
bss_ex->IELength -= ie_len_ori - ie_len; bss_ex->IELength -= ie_len_ori - ie_len;
ies = next_ie; ies = next_ie;

View File

@ -469,7 +469,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
int ret = _FALSE; int ret = _FALSE;
int value; int value;
value = ATOMIC_INC_RETURN(&dvobj->continual_io_error); value = atomic_inc_return(&dvobj->continual_io_error);
if (value > MAX_CONTINUAL_IO_ERR) { if (value > MAX_CONTINUAL_IO_ERR) {
RTW_INFO("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR); RTW_INFO("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR);
ret = _TRUE; ret = _TRUE;
@ -484,7 +484,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
*/ */
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj) void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
{ {
ATOMIC_SET(&dvobj->continual_io_error, 0); atomic_set(&dvobj->continual_io_error, 0);
} }
#ifdef DBG_IO #ifdef DBG_IO

View File

@ -77,7 +77,7 @@ u8 query_802_11_association_information(_adapter *padapter, PNDIS_802_11_ASSOCIA
unsigned char i, *auth_ie, *supp_ie; unsigned char i, *auth_ie, *supp_ie;
/* NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); */ /* NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); */
_rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
/* pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); */ /* pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); */
/* ------------------------------------------------------ */ /* ------------------------------------------------------ */

View File

@ -145,7 +145,7 @@ u8 rtw_do_join(_adapter *padapter)
pibss = padapter->registrypriv.dev_network.MacAddress; pibss = padapter->registrypriv.dev_network.MacAddress;
_rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
rtw_update_registrypriv_dev_network(padapter); rtw_update_registrypriv_dev_network(padapter);
@ -327,7 +327,7 @@ handle_tkip_countermeasure:
goto release_mlme_lock; goto release_mlme_lock;
} }
_rtw_memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); _rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
pmlmepriv->assoc_by_bssid = _TRUE; pmlmepriv->assoc_by_bssid = _TRUE;
@ -488,7 +488,7 @@ handle_tkip_countermeasure:
if (ssid && ssid_valid) if (ssid && ssid_valid)
_rtw_memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(NDIS_802_11_SSID));
else else
_rtw_memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID));
if (bssid && bssid_valid) { if (bssid && bssid_valid) {
_rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); _rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);

View File

@ -189,7 +189,7 @@ void rtw_mi_status_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp, struct mi_state
_adapter *iface; _adapter *iface;
int i; int i;
_rtw_memset(mstate, 0, sizeof(struct mi_state)); memset(mstate, 0, sizeof(struct mi_state));
for (i = 0; i < dvobj->iface_nums; i++) { for (i = 0; i < dvobj->iface_nums; i++) {
iface = dvobj->padapters[i]; iface = dvobj->padapters[i];
@ -949,25 +949,25 @@ static void rtw_dbg_dump_fwstate(_adapter *padapter, sint state)
u8 buf[32] = {0}; u8 buf[32] = {0};
if (state & WIFI_FW_NULL_STATE) { if (state & WIFI_FW_NULL_STATE) {
_rtw_memset(buf, 0, 32); memset(buf, 0, 32);
sprintf(buf, "WIFI_FW_NULL_STATE"); sprintf(buf, "WIFI_FW_NULL_STATE");
RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf);
} }
if (state & _FW_LINKED) { if (state & _FW_LINKED) {
_rtw_memset(buf, 0, 32); memset(buf, 0, 32);
sprintf(buf, "_FW_LINKED"); sprintf(buf, "_FW_LINKED");
RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf);
} }
if (state & _FW_UNDER_LINKING) { if (state & _FW_UNDER_LINKING) {
_rtw_memset(buf, 0, 32); memset(buf, 0, 32);
sprintf(buf, "_FW_UNDER_LINKING"); sprintf(buf, "_FW_UNDER_LINKING");
RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf);
} }
if (state & _FW_UNDER_SURVEY) { if (state & _FW_UNDER_SURVEY) {
_rtw_memset(buf, 0, 32); memset(buf, 0, 32);
sprintf(buf, "_FW_UNDER_SURVEY"); sprintf(buf, "_FW_UNDER_SURVEY");
RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf);
} }

View File

@ -48,7 +48,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter)
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* _rtw_memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */ /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */
/*qos_priv*/ /*qos_priv*/
@ -72,7 +72,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter)
set_scanned_network_val(pmlmepriv, 0); set_scanned_network_val(pmlmepriv, 0);
_rtw_memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID));
if (padapter->registrypriv.max_bss_cnt != 0) if (padapter->registrypriv.max_bss_cnt != 0)
pmlmepriv->max_bss_cnt = padapter->registrypriv.max_bss_cnt; pmlmepriv->max_bss_cnt = padapter->registrypriv.max_bss_cnt;
@ -152,9 +152,6 @@ exit:
void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv); void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv);
void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv) void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv)
{ {
_rtw_spinlock_free(&pmlmepriv->lock);
_rtw_spinlock_free(&(pmlmepriv->free_bss_pool.lock));
_rtw_spinlock_free(&(pmlmepriv->scanned_queue.lock));
} }
static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen)
@ -307,8 +304,7 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
if (pmlmepriv) { if (pmlmepriv) {
rtw_mfree_mlme_priv_lock(pmlmepriv); rtw_mfree_mlme_priv_lock(pmlmepriv);
if (pmlmepriv->free_bss_buf) vfree(pmlmepriv->free_bss_buf);
rtw_vmfree(pmlmepriv->free_bss_buf, pmlmepriv->max_bss_cnt * sizeof(struct wlan_network));
} }
exit: exit:
return; return;
@ -1350,7 +1346,7 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
_rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
rtw_update_registrypriv_dev_network(adapter); rtw_update_registrypriv_dev_network(adapter);
@ -1392,7 +1388,7 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
rtw_set_to_roam(adapter, 0); rtw_set_to_roam(adapter, 0);
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0); intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n"); RTW_INFO("change to widi listen\n");
} }
@ -1758,7 +1754,7 @@ void rtw_indicate_connect(_adapter *padapter)
rtw_set_to_roam(padapter, 0); rtw_set_to_roam(padapter, 0);
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n"); RTW_INFO("change to widi listen\n");
} }
@ -1892,7 +1888,7 @@ static u32 _rtw_wait_scan_done(_adapter *adapter, u8 abort, u32 timeout_ms)
break; break;
RTW_INFO(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev)); RTW_INFO(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev));
rtw_msleep_os(20); msleep(20);
} }
if (_TRUE == abort) { if (_TRUE == abort) {
@ -1966,7 +1962,7 @@ static u32 _rtw_wait_join_done(_adapter *adapter, u8 abort, u32 timeout_ms)
break; break;
RTW_INFO(FUNC_ADPT_FMT" linking...\n", FUNC_ADPT_ARG(adapter)); RTW_INFO(FUNC_ADPT_FMT" linking...\n", FUNC_ADPT_ARG(adapter));
rtw_msleep_os(20); msleep(20);
} }
if (abort) { if (abort) {
@ -2052,9 +2048,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl
psta->ieee8021x_blocked = _TRUE; psta->ieee8021x_blocked = _TRUE;
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
_rtw_memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
_rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype)); memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype));
_rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype)); memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype));
} }
/* Commented by Albert 2012/07/21 */ /* Commented by Albert 2012/07/21 */
@ -2629,7 +2625,7 @@ void rtw_sta_timeout_event_callback(_adapter *adapter, u8 *pbuf)
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
void rtw_ft_info_init(struct ft_roam_info *pft) void rtw_ft_info_init(struct ft_roam_info *pft)
{ {
_rtw_memset(pft, 0, sizeof(struct ft_roam_info)); memset(pft, 0, sizeof(struct ft_roam_info));
pft->ft_flags = 0 pft->ft_flags = 0
| RTW_FT_EN | RTW_FT_EN
| RTW_FT_OTD_EN | RTW_FT_OTD_EN
@ -2684,9 +2680,9 @@ void rtw_ft_update_stainfo(_adapter *padapter, WLAN_BSSID_EX *pnetwork)
psta->ieee8021x_blocked = _TRUE; psta->ieee8021x_blocked = _TRUE;
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
_rtw_memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
_rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype)); memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype));
_rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype)); memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype));
} }
} }
@ -2702,7 +2698,7 @@ void rtw_ft_reassoc_event_callback(_adapter *padapter, u8 *pbuf)
struct cfg80211_ft_event_params ft_evt_parms; struct cfg80211_ft_event_params ft_evt_parms;
_irqL irqL; _irqL irqL;
_rtw_memset(&ft_evt_parms, 0, sizeof(ft_evt_parms)); memset(&ft_evt_parms, 0, sizeof(ft_evt_parms));
rtw_ft_update_stainfo(padapter, pnetwork); rtw_ft_update_stainfo(padapter, pnetwork);
ft_evt_parms.ies_len = pft_roam->ft_event.ies_len; ft_evt_parms.ies_len = pft_roam->ft_event.ies_len;
ft_evt_parms.ies = rtw_zmalloc(ft_evt_parms.ies_len); ft_evt_parms.ies = rtw_zmalloc(ft_evt_parms.ies_len);
@ -2737,9 +2733,9 @@ void rtw_roam_nb_info_init(_adapter *padapter)
{ {
struct roam_nb_info *pnb = &(padapter->mlmepriv.nb_info); struct roam_nb_info *pnb = &(padapter->mlmepriv.nb_info);
_rtw_memset(&pnb->nb_rpt, 0, sizeof(pnb->nb_rpt)); memset(&pnb->nb_rpt, 0, sizeof(pnb->nb_rpt));
_rtw_memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list));
_rtw_memset(&pnb->roam_target_addr, 0, ETH_ALEN); memset(&pnb->roam_target_addr, 0, ETH_ALEN);
pnb->nb_rpt_valid = _FALSE; pnb->nb_rpt_valid = _FALSE;
pnb->nb_rpt_ch_list_num = 0; pnb->nb_rpt_ch_list_num = 0;
pnb->preference_en = _FALSE; pnb->preference_en = _FALSE;
@ -2972,7 +2968,7 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
_rtw_memcpy(pdev_network, &tgt_network->network, get_WLAN_BSSID_EX_sz(&tgt_network->network)); _rtw_memcpy(pdev_network, &tgt_network->network, get_WLAN_BSSID_EX_sz(&tgt_network->network));
_rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
rtw_update_registrypriv_dev_network(adapter); rtw_update_registrypriv_dev_network(adapter);
@ -3067,7 +3063,7 @@ void rtw_join_timeout_handler(void *ctx)
} else { } else {
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0); intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n"); RTW_INFO("change to widi listen\n");
} }
@ -3447,7 +3443,7 @@ static void collect_traffic_statistics(_adapter *padapter)
{ {
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
/*_rtw_memset(&pdvobjpriv->traffic_stat, 0, sizeof(struct rtw_traffic_statistics));*/ /*memset(&pdvobjpriv->traffic_stat, 0, sizeof(struct rtw_traffic_statistics));*/
/* Tx bytes reset*/ /* Tx bytes reset*/
pdvobjpriv->traffic_stat.tx_bytes = 0; pdvobjpriv->traffic_stat.tx_bytes = 0;
@ -3527,13 +3523,13 @@ exit:
inline bool rtw_is_scan_deny(_adapter *adapter) inline bool rtw_is_scan_deny(_adapter *adapter)
{ {
struct mlme_priv *mlmepriv = &adapter->mlmepriv; struct mlme_priv *mlmepriv = &adapter->mlmepriv;
return (ATOMIC_READ(&mlmepriv->set_scan_deny) != 0) ? _TRUE : _FALSE; return (atomic_read(&mlmepriv->set_scan_deny) != 0) ? _TRUE : _FALSE;
} }
inline void rtw_clear_scan_deny(_adapter *adapter) inline void rtw_clear_scan_deny(_adapter *adapter)
{ {
struct mlme_priv *mlmepriv = &adapter->mlmepriv; struct mlme_priv *mlmepriv = &adapter->mlmepriv;
ATOMIC_SET(&mlmepriv->set_scan_deny, 0); atomic_set(&mlmepriv->set_scan_deny, 0);
if (0) if (0)
RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
} }
@ -3549,7 +3545,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms)
struct mlme_priv *mlmepriv = &adapter->mlmepriv; struct mlme_priv *mlmepriv = &adapter->mlmepriv;
if (0) if (0)
RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
ATOMIC_SET(&mlmepriv->set_scan_deny, 1); atomic_set(&mlmepriv->set_scan_deny, 1);
_set_timer(&mlmepriv->set_scan_deny_timer, ms); _set_timer(&mlmepriv->set_scan_deny_timer, ms);
} }
#endif #endif
@ -3721,7 +3717,7 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
mlme->roam_network = candidate; mlme->roam_network = candidate;
if (_rtw_memcmp(candidate->network.MacAddress, mlme->roam_tgt_addr, ETH_ALEN) == _TRUE) if (_rtw_memcmp(candidate->network.MacAddress, mlme->roam_tgt_addr, ETH_ALEN) == _TRUE)
_rtw_memset(mlme->roam_tgt_addr, 0, ETH_ALEN); memset(mlme->roam_tgt_addr, 0, ETH_ALEN);
} }
ret = _SUCCESS; ret = _SUCCESS;
@ -3959,7 +3955,7 @@ sint rtw_set_auth(_adapter *adapter, struct security_priv *psecuritypriv)
goto exit; goto exit;
} }
_rtw_memset(psetauthparm, 0, sizeof(struct setauth_parm)); memset(psetauthparm, 0, sizeof(struct setauth_parm));
psetauthparm->mode = (unsigned char)psecuritypriv->dot11AuthAlgrthm; psetauthparm->mode = (unsigned char)psecuritypriv->dot11AuthAlgrthm;
pcmd->cmdcode = _SetAuth_CMD_; pcmd->cmdcode = _SetAuth_CMD_;
@ -3996,7 +3992,7 @@ sint rtw_set_key(_adapter *adapter, struct security_priv *psecuritypriv, sint ke
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
_rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm)); memset(psetkeyparm, 0, sizeof(struct setkey_parm));
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
psetkeyparm->algorithm = (unsigned char)psecuritypriv->dot118021XGrpPrivacy; psetkeyparm->algorithm = (unsigned char)psecuritypriv->dot118021XGrpPrivacy;
@ -4641,7 +4637,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
out_len = *pout_len; out_len = *pout_len;
_rtw_memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap));
ht_capie.cap_info = IEEE80211_HT_CAP_DSSSCCK40; ht_capie.cap_info = IEEE80211_HT_CAP_DSSSCCK40;

File diff suppressed because it is too large Load Diff

View File

@ -114,7 +114,7 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)
{ {
WLAN_BSSID_EX *pnetwork; WLAN_BSSID_EX *pnetwork;
_rtw_memset(pmp_priv, 0, sizeof(struct mp_priv)); memset(pmp_priv, 0, sizeof(struct mp_priv));
pmp_priv->mode = MP_OFF; pmp_priv->mode = MP_OFF;
@ -275,15 +275,15 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter)
/* init xmitframe attribute */ /* init xmitframe attribute */
pattrib = &pmptx->attrib; pattrib = &pmptx->attrib;
_rtw_memset(pattrib, 0, sizeof(struct pkt_attrib)); memset(pattrib, 0, sizeof(struct pkt_attrib));
_rtw_memset(pmptx->desc, 0, TXDESC_SIZE); memset(pmptx->desc, 0, TXDESC_SIZE);
pattrib->ether_type = 0x8712; pattrib->ether_type = 0x8712;
#if 0 #if 0
_rtw_memcpy(pattrib->src, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pattrib->src, adapter_mac_addr(padapter), ETH_ALEN);
_rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
#endif #endif
_rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); memset(pattrib->dst, 0xFF, ETH_ALEN);
/* pattrib->dhcp_pkt = 0; /* pattrib->dhcp_pkt = 0;
* pattrib->pktlen = 0; */ * pattrib->pktlen = 0; */
@ -831,7 +831,7 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart)
{ {
struct txpwrtrack_cfg c; struct txpwrtrack_cfg c;
u1Byte chnl = 0 ; u1Byte chnl = 0 ;
_rtw_memset(&c, 0, sizeof(struct txpwrtrack_cfg)); memset(&c, 0, sizeof(struct txpwrtrack_cfg));
configure_txpower_track(pDM_Odm, &c); configure_txpower_track(pDM_Odm, &c);
odm_clear_txpowertracking_state(pDM_Odm); odm_clear_txpowertracking_state(pDM_Odm);
if (*c.odm_tx_pwr_track_set_pwr) { if (*c.odm_tx_pwr_track_set_pwr) {
@ -870,7 +870,7 @@ u32 mp_join(PADAPTER padapter, u8 mode)
WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)(&(pmlmeinfo->network)); WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)(&(pmlmeinfo->network));
/* 1. initialize a new WLAN_BSSID_EX */ /* 1. initialize a new WLAN_BSSID_EX */
_rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); memset(&bssid, 0, sizeof(WLAN_BSSID_EX));
RTW_INFO("%s ,pmppriv->network_macaddr=%x %x %x %x %x %x\n", __func__, RTW_INFO("%s ,pmppriv->network_macaddr=%x %x %x %x %x %x\n", __func__,
pmppriv->network_macaddr[0], pmppriv->network_macaddr[1], pmppriv->network_macaddr[2], pmppriv->network_macaddr[3], pmppriv->network_macaddr[4], pmppriv->network_macaddr[0], pmppriv->network_macaddr[1], pmppriv->network_macaddr[2], pmppriv->network_macaddr[3], pmppriv->network_macaddr[4],
pmppriv->network_macaddr[5]); pmppriv->network_macaddr[5]);
@ -1084,7 +1084,7 @@ void mp_stop_test(PADAPTER padapter)
init_fwstate(pmlmepriv, pmppriv->prev_fw_state); init_fwstate(pmlmepriv, pmppriv->prev_fw_state);
/* flush the cur_network */ /* flush the cur_network */
_rtw_memset(tgt_network, 0, sizeof(struct wlan_network)); memset(tgt_network, 0, sizeof(struct wlan_network));
_clr_fwstate_(pmlmepriv, WIFI_MP_STATE); _clr_fwstate_(pmlmepriv, WIFI_MP_STATE);
@ -1975,7 +1975,7 @@ void SetPacketTx(PADAPTER padapter)
pmp_priv->tx.buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pmp_priv->tx.pallocated_buf), XMITBUF_ALIGN_SZ); pmp_priv->tx.buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pmp_priv->tx.pallocated_buf), XMITBUF_ALIGN_SZ);
ptr = pmp_priv->tx.buf; ptr = pmp_priv->tx.buf;
_rtw_memset(pmp_priv->tx.desc, 0, TXDESC_SIZE); memset(pmp_priv->tx.desc, 0, TXDESC_SIZE);
pkt_start = ptr; pkt_start = ptr;
pkt_end = pkt_start + pkt_size; pkt_end = pkt_start + pkt_size;
@ -2082,7 +2082,7 @@ void SetPacketTx(PADAPTER padapter)
/* startPlace = (u32)(rtw_random32() % 3450); */ /* startPlace = (u32)(rtw_random32() % 3450); */
_rtw_memcpy(ptr, pmp_priv->TXradomBuffer, pkt_end - ptr); _rtw_memcpy(ptr, pmp_priv->TXradomBuffer, pkt_end - ptr);
/* _rtw_memset(ptr, payload, pkt_end - ptr); */ /* memset(ptr, payload, pkt_end - ptr); */
rtw_mfree(pmp_priv->TXradomBuffer, 4096); rtw_mfree(pmp_priv->TXradomBuffer, 4096);
/* 3 6. start thread */ /* 3 6. start thread */
@ -2455,7 +2455,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
} }
#ifdef CONFIG_LONG_DELAY_ISSUE #ifdef CONFIG_LONG_DELAY_ISSUE
rtw_msleep_os(100); msleep(100);
#else #else
rtw_mdelay_os(100); rtw_mdelay_os(100);
#endif #endif
@ -2492,8 +2492,7 @@ void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv)
pxmitbuf++; pxmitbuf++;
} }
if (pxmitpriv->pallocated_xmit_extbuf) vfree(pxmitpriv->pallocated_xmit_extbuf);
rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
if (padapter->registrypriv.mp_mode == 0) { if (padapter->registrypriv.mp_mode == 0) {
max_xmit_extbuf_size = 6000; max_xmit_extbuf_size = 6000;
@ -3221,7 +3220,7 @@ void CCK_generator(
CRC16_generator(crc16_out, crc16_in, 32); CRC16_generator(crc16_out, crc16_in, 32);
_rtw_memset(pPMacTxInfo->CRC16, 0, 2); memset(pPMacTxInfo->CRC16, 0, 2);
ByteToBit(pPMacTxInfo->CRC16, crc16_out, 2); ByteToBit(pPMacTxInfo->CRC16, crc16_out, 2);
} }
@ -3641,7 +3640,7 @@ void L_SIG_generator(
sig_bi[i] = 0; sig_bi[i] = 0;
/* dump_buf(sig_bi,24);*/ /* dump_buf(sig_bi,24);*/
_rtw_memset(pPMacTxInfo->LSIG, 0, 3); memset(pPMacTxInfo->LSIG, 0, 3);
ByteToBit(pPMacTxInfo->LSIG, (bool *)sig_bi, 3); ByteToBit(pPMacTxInfo->LSIG, (bool *)sig_bi, 3);
} }
@ -3731,7 +3730,7 @@ void HT_SIG_generator(
for (i = 42; i < 48; i++) for (i = 42; i < 48; i++)
sig_bi[i] = 0; sig_bi[i] = 0;
_rtw_memset(pPMacTxInfo->HT_SIG, 0, 6); memset(pPMacTxInfo->HT_SIG, 0, 6);
ByteToBit(pPMacTxInfo->HT_SIG, sig_bi, 6); ByteToBit(pPMacTxInfo->HT_SIG, sig_bi, 6);
} }
@ -3751,8 +3750,8 @@ void VHT_SIG_A_generator(
UINT i; UINT i;
bool sig_bi[48], crc8[8]; bool sig_bi[48], crc8[8];
_rtw_memset(sig_bi, 0, 48); memset(sig_bi, 0, 48);
_rtw_memset(crc8, 0, 8); memset(crc8, 0, 8);
/* BW Setting*/ /* BW Setting*/
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
@ -3799,7 +3798,7 @@ void VHT_SIG_A_generator(
for (i = 42; i < 48; i++) for (i = 42; i < 48; i++)
sig_bi[i] = 0; sig_bi[i] = 0;
_rtw_memset(pPMacTxInfo->VHT_SIG_A, 0, 6); memset(pPMacTxInfo->VHT_SIG_A, 0, 6);
ByteToBit(pPMacTxInfo->VHT_SIG_A, sig_bi, 6); ByteToBit(pPMacTxInfo->VHT_SIG_A, sig_bi, 6);
} }
@ -3815,8 +3814,8 @@ void VHT_SIG_B_generator(
UINT i, len, res, tail = 6, total_len, crc8_in_len; UINT i, len, res, tail = 6, total_len, crc8_in_len;
UINT sigb_len; UINT sigb_len;
_rtw_memset(sig_bi, 0, 32); memset(sig_bi, 0, 32);
_rtw_memset(crc8_bi, 0, 8); memset(crc8_bi, 0, 8);
/*Sounding Packet*/ /*Sounding Packet*/
if (pPMacTxInfo->NDP_sound == 1) { if (pPMacTxInfo->NDP_sound == 1) {
@ -3868,7 +3867,7 @@ void VHT_SIG_B_generator(
sig_bi[len + res + i] = 0; sig_bi[len + res + i] = 0;
} }
_rtw_memset(pPMacTxInfo->VHT_SIG_B, 0, 4); memset(pPMacTxInfo->VHT_SIG_B, 0, 4);
ByteToBit(pPMacTxInfo->VHT_SIG_B, sig_bi, 4); ByteToBit(pPMacTxInfo->VHT_SIG_B, sig_bi, 4);
pPMacTxInfo->VHT_SIG_B_CRC = 0; pPMacTxInfo->VHT_SIG_B_CRC = 0;
@ -3903,7 +3902,7 @@ void VHT_Delimiter_generator(
for (j = 24; j < 32; j++) /* Delimiter[31:24]: Signature ('4E' in Hex, 78 in Dec)*/ for (j = 24; j < 32; j++) /* Delimiter[31:24]: Signature ('4E' in Hex, 78 in Dec)*/
sig_bi[j] = (78 >> (j - 24)) % 2; sig_bi[j] = (78 >> (j - 24)) % 2;
_rtw_memset(pPMacTxInfo->VHT_Delimiter, 0, 4); memset(pPMacTxInfo->VHT_Delimiter, 0, 4);
ByteToBit(pPMacTxInfo->VHT_Delimiter, sig_bi, 4); ByteToBit(pPMacTxInfo->VHT_Delimiter, sig_bi, 4);
} }

View File

@ -628,7 +628,7 @@ NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv)
if (pmp_priv->tx.stop == 0) { if (pmp_priv->tx.stop == 0) {
pmp_priv->tx.stop = 1; pmp_priv->tx.stop = 1;
RTW_INFO("%s: pkt tx is running...\n", __func__); RTW_INFO("%s: pkt tx is running...\n", __func__);
rtw_msleep_os(5); msleep(5);
} }
pmp_priv->tx.stop = 0; pmp_priv->tx.stop = 0;
pmp_priv->tx.count = 1; pmp_priv->tx.count = 1;
@ -663,7 +663,7 @@ NDIS_STATUS oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_p
if (pmp_priv->tx.stop == 0) { if (pmp_priv->tx.stop == 0) {
pmp_priv->tx.stop = 1; pmp_priv->tx.stop = 1;
RTW_INFO("%s: pkt tx is running...\n", __func__); RTW_INFO("%s: pkt tx is running...\n", __func__);
rtw_msleep_os(5); msleep(5);
} }
pmp_priv->tx.stop = 0; pmp_priv->tx.stop = 0;
pmp_priv->tx.count = 1; pmp_priv->tx.count = 1;
@ -698,7 +698,7 @@ NDIS_STATUS oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_
if (pmp_priv->tx.stop == 0) { if (pmp_priv->tx.stop == 0) {
pmp_priv->tx.stop = 1; pmp_priv->tx.stop = 1;
RTW_INFO("%s: pkt tx is running...\n", __func__); RTW_INFO("%s: pkt tx is running...\n", __func__);
rtw_msleep_os(5); msleep(5);
} }
pmp_priv->tx.stop = 0; pmp_priv->tx.stop = 0;
pmp_priv->tx.count = 1; pmp_priv->tx.count = 1;

View File

@ -163,7 +163,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da)
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -223,7 +223,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -300,7 +300,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr,
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -404,7 +404,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -601,7 +601,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -713,7 +713,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -856,7 +856,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1010,7 +1010,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1109,7 +1109,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1208,7 +1208,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1307,7 +1307,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1407,7 +1407,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1507,7 +1507,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1620,7 +1620,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1733,7 +1733,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -1833,7 +1833,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
wfdielen += ETH_ALEN; wfdielen += ETH_ALEN;
@ -2701,7 +2701,7 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
attr_contentlen = 0; attr_contentlen = 0;
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) {
if (attr_contentlen != ETH_ALEN) if (attr_contentlen != ETH_ALEN)
_rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN);
} }
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, ch_content, &ch_cnt)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, ch_content, &ch_cnt)) {
@ -2844,7 +2844,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
attr_contentlen = 0; attr_contentlen = 0;
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) {
if (attr_contentlen != ETH_ALEN) if (attr_contentlen != ETH_ALEN)
_rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN);
} }
/* Try to get the peer's intent and tie breaker value. */ /* Try to get the peer's intent and tie breaker value. */
@ -2949,7 +2949,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
/* Try to get the group id information if peer is GO */ /* Try to get the group id information if peer is GO */
attr_contentlen = 0; attr_contentlen = 0;
_rtw_memset(groupid, 0x00, 38); memset(groupid, 0x00, 38);
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) {
_rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN); _rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN);
_rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN); _rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN);
@ -3030,7 +3030,7 @@ u8 process_p2p_group_negotation_confirm(struct wifidirect_info *pwdinfo, u8 *pfr
/* Try to get the group id information */ /* Try to get the group id information */
attr_contentlen = 0; attr_contentlen = 0;
_rtw_memset(groupid, 0x00, 38); memset(groupid, 0x00, 38);
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) {
RTW_INFO("[%s] Ssid = %s, ssidlen = %zu\n", __FUNCTION__, &groupid[ETH_ALEN], strlen(&groupid[ETH_ALEN])); RTW_INFO("[%s] Ssid = %s, ssidlen = %zu\n", __FUNCTION__, &groupid[ETH_ALEN], strlen(&groupid[ETH_ALEN]));
_rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN); _rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN);
@ -3363,14 +3363,14 @@ static int ro_ch_handler(_adapter *adapter, u8 *buf)
if ((remain_ch != rtw_mi_get_union_chan(adapter)) && !check_fwstate(&adapter->mlmepriv, _FW_LINKED)) { if ((remain_ch != rtw_mi_get_union_chan(adapter)) && !check_fwstate(&adapter->mlmepriv, _FW_LINKED)) {
if (remain_ch != pmlmeext->cur_channel if (remain_ch != pmlmeext->cur_channel
#ifdef RTW_ROCH_BACK_OP #ifdef RTW_ROCH_BACK_OP
|| ATOMIC_READ(&pwdev_priv->switch_ch_to) == 1 || atomic_read(&pwdev_priv->switch_ch_to) == 1
#endif #endif
) { ) {
rtw_leave_opch(adapter); rtw_leave_opch(adapter);
#ifdef RTW_ROCH_BACK_OP #ifdef RTW_ROCH_BACK_OP
RTW_INFO("%s, set switch ch timer, duration=%d\n", __func__, duration - pwdinfo->ext_listen_interval); RTW_INFO("%s, set switch ch timer, duration=%d\n", __func__, duration - pwdinfo->ext_listen_interval);
ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); atomic_set(&pwdev_priv->switch_ch_to, 0);
_set_timer(&pwdinfo->ap_p2p_switch_timer, duration - pwdinfo->ext_listen_interval); _set_timer(&pwdinfo->ap_p2p_switch_timer, duration - pwdinfo->ext_listen_interval);
#endif #endif
} }
@ -3442,7 +3442,7 @@ static int cancel_ro_ch_handler(_adapter *padapter, u8 *buf)
#if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_CONCURRENT_MODE) #if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_CONCURRENT_MODE)
_cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer);
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); atomic_set(&pwdev_priv->switch_ch_to, 1);
#endif #endif
if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) {
@ -3903,7 +3903,7 @@ u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
attr_contentlen -= 3; attr_contentlen -= 3;
_rtw_memset(ch_list, 0, 40); memset(ch_list, 0, 40);
while (attr_contentlen > 0) { while (attr_contentlen > 0) {
num_of_ch = *(pattr_temp + 1); num_of_ch = *(pattr_temp + 1);
@ -4343,7 +4343,7 @@ void rtw_init_cfg80211_wifidirect_info(_adapter *padapter)
{ {
struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo; struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo;
_rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info)); memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info));
rtw_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter, ro_ch_timer_process, padapter); rtw_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter, ro_ch_timer_process, padapter);
} }
@ -4779,7 +4779,7 @@ void ap_p2p_switch_timer_process(void *FunctionContext)
return; return;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); atomic_set(&pwdev_priv->switch_ch_to, 1);
#endif #endif
p2p_protocol_wk_cmd(adapter, P2P_AP_P2P_CH_SWITCH_PROCESS_WK); p2p_protocol_wk_cmd(adapter, P2P_AP_P2P_CH_SWITCH_PROCESS_WK);
@ -4821,8 +4821,8 @@ int rtw_init_wifi_display_info(_adapter *padapter)
pwfd_info->wfd_pc = _FALSE; pwfd_info->wfd_pc = _FALSE;
/* Used in TDLS */ /* Used in TDLS */
_rtw_memset(pwfd_info->ip_address, 0x00, 4); memset(pwfd_info->ip_address, 0x00, 4);
_rtw_memset(pwfd_info->peer_ip_address, 0x00, 4); memset(pwfd_info->peer_ip_address, 0x00, 4);
return res; return res;
} }
@ -5109,32 +5109,32 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role)
_rtw_memcpy((void *) pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7); _rtw_memcpy((void *) pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7);
_rtw_memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN); memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN);
pwdinfo->device_name_len = 0; pwdinfo->device_name_len = 0;
_rtw_memset(&pwdinfo->invitereq_info, 0x00, sizeof(struct tx_invite_req_info)); memset(&pwdinfo->invitereq_info, 0x00, sizeof(struct tx_invite_req_info));
pwdinfo->invitereq_info.token = 3; /* Token used for P2P invitation request frame. */ pwdinfo->invitereq_info.token = 3; /* Token used for P2P invitation request frame. */
_rtw_memset(&pwdinfo->inviteresp_info, 0x00, sizeof(struct tx_invite_resp_info)); memset(&pwdinfo->inviteresp_info, 0x00, sizeof(struct tx_invite_resp_info));
pwdinfo->inviteresp_info.token = 0; pwdinfo->inviteresp_info.token = 0;
pwdinfo->profileindex = 0; pwdinfo->profileindex = 0;
_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);
rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE);
pwdinfo->listen_dwell = (u8)((rtw_get_current_time() % 3) + 1); pwdinfo->listen_dwell = (u8)((rtw_get_current_time() % 3) + 1);
/* RTW_INFO( "[%s] listen_dwell time is %d00ms\n", __FUNCTION__, pwdinfo->listen_dwell ); */ /* RTW_INFO( "[%s] listen_dwell time is %d00ms\n", __FUNCTION__, pwdinfo->listen_dwell ); */
_rtw_memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info)); memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info));
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE; pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE;
_rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info));
pwdinfo->device_password_id_for_nego = WPS_DPID_PBC; pwdinfo->device_password_id_for_nego = WPS_DPID_PBC;
pwdinfo->negotiation_dialog_token = 1; pwdinfo->negotiation_dialog_token = 1;
_rtw_memset(pwdinfo->nego_ssid, 0x00, WLAN_SSID_MAXLEN); memset(pwdinfo->nego_ssid, 0x00, WLAN_SSID_MAXLEN);
pwdinfo->nego_ssidlen = 0; pwdinfo->nego_ssidlen = 0;
pwdinfo->ui_got_wps_info = P2P_NO_WPSINFO; pwdinfo->ui_got_wps_info = P2P_NO_WPSINFO;
@ -5145,11 +5145,11 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role)
pwdinfo->supported_wps_cm = WPS_CONFIG_METHOD_DISPLAY | WPS_CONFIG_METHOD_PBC | WPS_CONFIG_METHOD_KEYPAD; pwdinfo->supported_wps_cm = WPS_CONFIG_METHOD_DISPLAY | WPS_CONFIG_METHOD_PBC | WPS_CONFIG_METHOD_KEYPAD;
#endif /* CONFIG_WFD */ #endif /* CONFIG_WFD */
pwdinfo->channel_list_attr_len = 0; pwdinfo->channel_list_attr_len = 0;
_rtw_memset(pwdinfo->channel_list_attr, 0x00, 100); memset(pwdinfo->channel_list_attr, 0x00, 100);
_rtw_memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, 0x00, 4); memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, 0x00, 4);
_rtw_memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3); memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3);
_rtw_memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
pwdinfo->ext_listen_interval = 1000; /* The interval to be available with legacy AP during p2p0-find/scan */ pwdinfo->ext_listen_interval = 1000; /* The interval to be available with legacy AP during p2p0-find/scan */
@ -5171,8 +5171,8 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role)
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
pwdinfo->wfd_tdls_enable = 0; pwdinfo->wfd_tdls_enable = 0;
_rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN);
_rtw_memset(pwdinfo->p2p_peer_device_addr, 0x00, ETH_ALEN); memset(pwdinfo->p2p_peer_device_addr, 0x00, ETH_ALEN);
pwdinfo->rx_invitereq_info.operation_ch[0] = 0; pwdinfo->rx_invitereq_info.operation_ch[0] = 0;
pwdinfo->rx_invitereq_info.operation_ch[1] = 0; /* Used to indicate the scan end in site survey function */ pwdinfo->rx_invitereq_info.operation_ch[1] = 0; /* Used to indicate the scan end in site survey function */
@ -5415,10 +5415,10 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE); rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE);
rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE); rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE);
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE); rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE);
_rtw_memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info)); memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info));
/* Remove profiles in wifidirect_info structure. */ /* Remove profiles in 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; pwdinfo->profileindex = 0;
} }

View File

@ -540,7 +540,7 @@ u8 rtw_cpwm_polling(_adapter *adapter, u8 rpwm, u8 cpwm_orig)
do { do {
start_time = rtw_get_current_time(); start_time = rtw_get_current_time();
do { do {
rtw_msleep_os(1); msleep(1);
rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now); rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now);
if ((cpwm_orig ^ cpwm_now) & 0x80) { if ((cpwm_orig ^ cpwm_now) & 0x80) {
@ -1435,7 +1435,7 @@ void LPS_Leave_check(
bReady = _FALSE; bReady = _FALSE;
start_time = rtw_get_current_time(); start_time = rtw_get_current_time();
rtw_yield_os(); yield();
while (1) { while (1) {
_enter_pwrlock(&pwrpriv->lock); _enter_pwrlock(&pwrpriv->lock);
@ -1458,7 +1458,7 @@ void LPS_Leave_check(
RTW_ERR("Wait for cpwm event than 100 ms!!!\n"); RTW_ERR("Wait for cpwm event than 100 ms!!!\n");
break; break;
} }
rtw_msleep_os(1); msleep(1);
} }
} }
@ -2268,7 +2268,7 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter)
#endif #endif
/* _rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */ /* memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */
#ifdef CONFIG_RESUME_IN_WORKQUEUE #ifdef CONFIG_RESUME_IN_WORKQUEUE
@ -2512,7 +2512,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
if (pwrpriv->ps_processing) { if (pwrpriv->ps_processing) {
RTW_INFO("%s wait ps_processing...\n", __func__); RTW_INFO("%s wait ps_processing...\n", __func__);
while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000) while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000)
rtw_msleep_os(10); msleep(10);
if (pwrpriv->ps_processing) if (pwrpriv->ps_processing)
RTW_INFO("%s wait ps_processing timeout\n", __func__); RTW_INFO("%s wait ps_processing timeout\n", __func__);
else else
@ -2523,7 +2523,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
if (rtw_hal_sreset_inprogress(padapter)) { if (rtw_hal_sreset_inprogress(padapter)) {
RTW_INFO("%s wait sreset_inprogress...\n", __func__); RTW_INFO("%s wait sreset_inprogress...\n", __func__);
while (rtw_hal_sreset_inprogress(padapter) && rtw_get_passing_time_ms(start) <= 4000) while (rtw_hal_sreset_inprogress(padapter) && rtw_get_passing_time_ms(start) <= 4000)
rtw_msleep_os(10); msleep(10);
if (rtw_hal_sreset_inprogress(padapter)) if (rtw_hal_sreset_inprogress(padapter))
RTW_INFO("%s wait sreset_inprogress timeout\n", __func__); RTW_INFO("%s wait sreset_inprogress timeout\n", __func__);
else else
@ -2541,7 +2541,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
&& ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv)) && ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv))
|| (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv))) || (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv)))
) )
rtw_msleep_os(10); msleep(10);
if (pwrpriv->bInSuspend) if (pwrpriv->bInSuspend)
RTW_INFO("%s wait bInSuspend timeout\n", __func__); RTW_INFO("%s wait bInSuspend timeout\n", __func__);
else else

View File

@ -60,7 +60,7 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
_rtw_memset((u8 *)psta_recvpriv, 0, sizeof(struct sta_recv_priv)); memset((u8 *)psta_recvpriv, 0, sizeof(struct sta_recv_priv));
_rtw_spinlock_init(&psta_recvpriv->lock); _rtw_spinlock_init(&psta_recvpriv->lock);
@ -81,7 +81,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* _rtw_memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */ /* memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */
_rtw_spinlock_init(&precvpriv->lock); _rtw_spinlock_init(&precvpriv->lock);
@ -116,7 +116,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
/* _rtw_memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); */ /* memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); */
precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ); precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ);
/* precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - */ /* precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - */
@ -141,7 +141,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
#ifdef CONFIG_USB_HCI #ifdef CONFIG_USB_HCI
ATOMIC_SET(&(precvpriv->rx_pending_cnt), 1); atomic_set(&(precvpriv->rx_pending_cnt), 1);
_rtw_init_sema(&precvpriv->allrxreturnevt, 0); _rtw_init_sema(&precvpriv->allrxreturnevt, 0);
@ -168,19 +168,9 @@ exit:
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv); void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv);
void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv)
{ {
_rtw_spinlock_free(&precvpriv->lock);
#ifdef CONFIG_RECV_THREAD_MODE #ifdef CONFIG_RECV_THREAD_MODE
_rtw_free_sema(&precvpriv->recv_sema); _rtw_free_sema(&precvpriv->recv_sema);
#endif #endif
_rtw_spinlock_free(&precvpriv->free_recv_queue.lock);
_rtw_spinlock_free(&precvpriv->recv_pending_queue.lock);
_rtw_spinlock_free(&precvpriv->free_recv_buf_queue.lock);
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
_rtw_spinlock_free(&precvpriv->recv_buf_pending_queue.lock);
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */
} }
void _rtw_free_recv_priv(struct recv_priv *precvpriv) void _rtw_free_recv_priv(struct recv_priv *precvpriv)
@ -190,12 +180,9 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv)
rtw_free_uc_swdec_pending_queue(padapter); rtw_free_uc_swdec_pending_queue(padapter);
rtw_mfree_recv_priv_lock(precvpriv);
rtw_os_recv_resource_free(precvpriv); rtw_os_recv_resource_free(precvpriv);
if (precvpriv->pallocated_frame_buf) vfree(precvpriv->pallocated_frame_buf);
rtw_vmfree(precvpriv->pallocated_frame_buf, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
rtw_hal_free_recv_priv(padapter); rtw_hal_free_recv_priv(padapter);
@ -1254,7 +1241,7 @@ sint sta2sta_data_frame(
} }
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) { if (atomic_read(&pchsw_info->chsw_on) == _TRUE) {
if (adapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(adapter)) { if (adapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(adapter)) {
pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE; pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE;
if (!(pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE)) if (!(pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE))
@ -4905,7 +4892,7 @@ int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index)
{ {
int ret = _FALSE; int ret = _FALSE;
int value = ATOMIC_INC_RETURN(&sta->continual_no_rx_packet[tid_index]); int value = atomic_inc_return(&sta->continual_no_rx_packet[tid_index]);
if (value >= MAX_CONTINUAL_NORXPACKET_COUNT) if (value >= MAX_CONTINUAL_NORXPACKET_COUNT)
ret = _TRUE; ret = _TRUE;
@ -4918,7 +4905,7 @@ int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index)
*/ */
void rtw_reset_continual_no_rx_packet(struct sta_info *sta, int tid_index) void rtw_reset_continual_no_rx_packet(struct sta_info *sta, int tid_index)
{ {
ATOMIC_SET(&sta->continual_no_rx_packet[tid_index], 0); atomic_set(&sta->continual_no_rx_packet[tid_index], 0);
} }
u8 adapter_allow_bmc_data_rx(_adapter *adapter) u8 adapter_allow_bmc_data_rx(_adapter *adapter)
@ -5020,7 +5007,7 @@ thread_return rtw_recv_thread(thread_context context)
if (err == RTW_RFRAME_UNAVAIL if (err == RTW_RFRAME_UNAVAIL
|| err == RTW_RFRAME_PKT_UNAVAIL || err == RTW_RFRAME_PKT_UNAVAIL
) { ) {
rtw_msleep_os(1); msleep(1);
_rtw_up_sema(&recvpriv->recv_sema); _rtw_up_sema(&recvpriv->recv_sema);
} }

View File

@ -1178,7 +1178,7 @@ void rtw_txpwr_lmt_list_free(struct rf_ctl_t *rfctl)
if (ent->regd_name == rfctl->regd_name) if (ent->regd_name == rfctl->regd_name)
rfctl->regd_name = regd_str(TXPWR_LMT_NONE); rfctl->regd_name = regd_str(TXPWR_LMT_NONE);
rtw_list_delete(&ent->list); rtw_list_delete(&ent->list);
rtw_vmfree((u8 *)ent, sizeof(struct txpwr_lmt_ent) + strlen(ent->regd_name) + 1); vfree(ent);
} }
rfctl->txpwr_regd_num = 0; rfctl->txpwr_regd_num = 0;

View File

@ -328,7 +328,7 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe,
pattr = &pmgntframe->attrib; pattr = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattr); update_mgntframe_attrib(padapter, pattr);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -455,7 +455,7 @@ int rm_sitesurvey(struct rm_obj *prm)
pch_set = &prm->q.ch_set[0]; pch_set = &prm->q.ch_set[0];
_rtw_memset(pch_set, 0, memset(pch_set, 0,
sizeof(struct rtw_ieee80211_channel) * MAX_OP_CHANNEL_SET_NUM); sizeof(struct rtw_ieee80211_channel) * MAX_OP_CHANNEL_SET_NUM);
if (prm->q.ch_num == 0) { if (prm->q.ch_num == 0) {
@ -474,7 +474,7 @@ int rm_sitesurvey(struct rm_obj *prm)
meas_ch_num = rm_get_ch_set(pch_set, op_class, ch_num); meas_ch_num = rm_get_ch_set(pch_set, op_class, ch_num);
prm->q.ch_set_ch_amount = meas_ch_num; prm->q.ch_set_ch_amount = meas_ch_num;
_rtw_memset(&parm, 0, sizeof(struct sitesurvey_parm)); memset(&parm, 0, sizeof(struct sitesurvey_parm));
_rtw_memcpy(parm.ch, pch_set, _rtw_memcpy(parm.ch, pch_set,
sizeof(struct rtw_ieee80211_channel) * MAX_OP_CHANNEL_SET_NUM); sizeof(struct rtw_ieee80211_channel) * MAX_OP_CHANNEL_SET_NUM);
@ -1488,7 +1488,7 @@ static int retrieve_scan_result(struct rm_obj *prm)
MAC_ARG(pbss->MacAddress)); MAC_ARG(pbss->MacAddress));
len = 0; len = 0;
_rtw_memset(tmp_buf, 0, MAX_XMIT_EXTBUF_SZ); memset(tmp_buf, 0, MAX_XMIT_EXTBUF_SZ);
rm_gen_bcn_rep_ie(prm, tmp_buf, pnetwork, &len); rm_gen_bcn_rep_ie(prm, tmp_buf, pnetwork, &len);
new_packet: new_packet:
if (my_len == 0) { if (my_len == 0) {
@ -2374,7 +2374,7 @@ static void rm_dbg_show_meas(struct rm_obj *prm, char *s)
psta->cmn.aid, MAC_ARG(psta->cmn.mac_addr)); psta->cmn.aid, MAC_ARG(psta->cmn.mac_addr));
sprintf(pstr(s), "clock=%d, state=%s, rpt=%u/%u\n", sprintf(pstr(s), "clock=%d, state=%s, rpt=%u/%u\n",
(int)ATOMIC_READ(&prm->pclock->counter), (int)atomic_read(&prm->pclock->counter),
rm_state_name(prm->state), prm->p.rpt, prm->q.rpt); rm_state_name(prm->state), prm->p.rpt, prm->q.rpt);
} }

View File

@ -42,12 +42,12 @@ void rm_timer_callback(void *data)
for (i=0;i<RM_TIMER_NUM;i++) { for (i=0;i<RM_TIMER_NUM;i++) {
pclock = &prmpriv->clock[i]; pclock = &prmpriv->clock[i];
if (pclock->prm == NULL if (pclock->prm == NULL
||(ATOMIC_READ(&(pclock->counter)) == 0)) ||(atomic_read(&(pclock->counter)) == 0))
continue; continue;
ATOMIC_DEC(&(pclock->counter)); atomic_dec(&(pclock->counter));
if (ATOMIC_READ(&(pclock->counter)) == 0) if (atomic_read(&(pclock->counter)) == 0)
rm_post_event(pclock->prm->psta->padapter, rm_post_event(pclock->prm->psta->padapter,
pclock->prm->rmid, prmpriv->clock[i].evid); pclock->prm->rmid, prmpriv->clock[i].evid);
} }
@ -176,7 +176,7 @@ static int rm_enqueue_ev(_queue *queue, struct rm_event *obj, bool to_head)
static void rm_set_clock(struct rm_obj *prm, u32 ms, enum RM_EV_ID evid) static void rm_set_clock(struct rm_obj *prm, u32 ms, enum RM_EV_ID evid)
{ {
ATOMIC_SET(&(prm->pclock->counter), (ms/CLOCK_UNIT)); atomic_set(&(prm->pclock->counter), (ms/CLOCK_UNIT));
prm->pclock->evid = evid; prm->pclock->evid = evid;
} }
@ -192,7 +192,7 @@ static struct rm_clock *rm_alloc_clock(_adapter *padapter, struct rm_obj *prm)
if (pclock->prm == NULL) { if (pclock->prm == NULL) {
pclock->prm = prm; pclock->prm = prm;
ATOMIC_SET(&(pclock->counter), 0); atomic_set(&(pclock->counter), 0);
pclock->evid = RM_EV_max; pclock->evid = RM_EV_max;
break; break;
} }
@ -202,14 +202,14 @@ static struct rm_clock *rm_alloc_clock(_adapter *padapter, struct rm_obj *prm)
static void rm_cancel_clock(struct rm_obj *prm) static void rm_cancel_clock(struct rm_obj *prm)
{ {
ATOMIC_SET(&(prm->pclock->counter), 0); atomic_set(&(prm->pclock->counter), 0);
prm->pclock->evid = RM_EV_max; prm->pclock->evid = RM_EV_max;
} }
static void rm_free_clock(struct rm_clock *pclock) static void rm_free_clock(struct rm_clock *pclock)
{ {
pclock->prm = NULL; pclock->prm = NULL;
ATOMIC_SET(&(pclock->counter), 0); atomic_set(&(pclock->counter), 0);
pclock->evid = RM_EV_max; pclock->evid = RM_EV_max;
} }
@ -245,7 +245,7 @@ struct rm_obj *rm_alloc_rmobj(_adapter *padapter)
if (prm == NULL) if (prm == NULL)
return NULL; return NULL;
_rtw_memset(prm, 0, sizeof(struct rm_obj)); memset(prm, 0, sizeof(struct rm_obj));
/* alloc timer */ /* alloc timer */
if ((prm->pclock = rm_alloc_clock(padapter, prm)) == NULL) { if ((prm->pclock = rm_alloc_clock(padapter, prm)) == NULL) {

View File

@ -77,7 +77,7 @@ void init_rtw_rson_data(struct dvobj_priv *dvobj)
dvobj->rson_data.connectible = RTW_RSON_DENYCONNECT; dvobj->rson_data.connectible = RTW_RSON_DENYCONNECT;
#endif #endif
dvobj->rson_data.loading = 0; dvobj->rson_data.loading = 0;
_rtw_memset(dvobj->rson_data.res, 0xAA, sizeof(dvobj->rson_data.res)); memset(dvobj->rson_data.res, 0xAA, sizeof(dvobj->rson_data.res));
} }
void rtw_rson_get_property_str(_adapter *padapter, char *rson_data_str) void rtw_rson_get_property_str(_adapter *padapter, char *rson_data_str)
@ -396,7 +396,7 @@ void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead)
if (!pnetwork) if (!pnetwork)
break; break;
_rtw_memset(&rson_data, 0, sizeof(rson_data)); memset(&rson_data, 0, sizeof(rson_data));
rson_score = 0; rson_score = 0;
if (rtw_get_rson_struct(&(pnetwork->network), &rson_data) == _TRUE) if (rtw_get_rson_struct(&(pnetwork->network), &rson_data) == _TRUE)
rson_score = rtw_cal_rson_score(&rson_data, pnetwork->network.Rssi); rson_score = rtw_cal_rson_score(&rson_data, pnetwork->network.Rssi);
@ -432,7 +432,7 @@ u8 rtw_rson_ap_check_sta(_adapter *padapter, u8 *pframe, uint pkt_len, unsigned
u8 *p; u8 *p;
#ifndef CONFIG_RTW_REPEATER_SON_ROOT #ifndef CONFIG_RTW_REPEATER_SON_ROOT
_rtw_memset(&rson_target, 0, sizeof(rson_target)); memset(&rson_target, 0, sizeof(rson_target));
for (p = pframe + WLAN_HDR_A3_LEN + ie_offset; ; p += (len + 2)) { for (p = pframe + WLAN_HDR_A3_LEN + ie_offset; ; p += (len + 2)) {
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
@ -550,7 +550,7 @@ void rtw_rson_scan_cmd_hdl(_adapter *padapter, int op)
rtw_set_to_roam(padapter, 0); rtw_set_to_roam(padapter, 0);
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n"); RTW_INFO("change to widi listen\n");
} }

View File

@ -60,7 +60,7 @@ static u8 sdio_io(struct dvobj_priv *d, u32 addr, void *buf, size_t len, u8 writ
if (retry) { if (retry) {
RTW_INFO("%s: Retry %s OK! addr=0x%05x %zu bytes, retry=%u,%u\n", RTW_INFO("%s: Retry %s OK! addr=0x%05x %zu bytes, retry=%u,%u\n",
__FUNCTION__, write?"write":"read", __FUNCTION__, write?"write":"read",
addr, len, retry, ATOMIC_READ(&d->continual_io_error)); addr, len, retry, atomic_read(&d->continual_io_error));
RTW_INFO_DUMP("Data: ", buf, len); RTW_INFO_DUMP("Data: ", buf, len);
} }
rtw_reset_continual_io_error(d); rtw_reset_continual_io_error(d);
@ -68,14 +68,14 @@ static u8 sdio_io(struct dvobj_priv *d, u32 addr, void *buf, size_t len, u8 writ
} }
RTW_ERR("%s: %s FAIL! error(%d) addr=0x%05x %zu bytes, retry=%u,%u\n", RTW_ERR("%s: %s FAIL! error(%d) addr=0x%05x %zu bytes, retry=%u,%u\n",
__FUNCTION__, write?"write":"read", err, addr, len, __FUNCTION__, write?"write":"read", err, addr, len,
retry, ATOMIC_READ(&d->continual_io_error)); retry, atomic_read(&d->continual_io_error));
retry++; retry++;
stop_retry = rtw_inc_and_chk_continual_io_error(d); stop_retry = rtw_inc_and_chk_continual_io_error(d);
if ((err == -1) || (stop_retry == _TRUE) || (retry > SD_IO_TRY_CNT)) { if ((err == -1) || (stop_retry == _TRUE) || (retry > SD_IO_TRY_CNT)) {
/* critical error, unrecoverable */ /* critical error, unrecoverable */
RTW_ERR("%s: Fatal error! Set surprise remove flag ON! (retry=%u,%u)\n", RTW_ERR("%s: Fatal error! Set surprise remove flag ON! (retry=%u,%u)\n",
__FUNCTION__, retry, ATOMIC_READ(&d->continual_io_error)); __FUNCTION__, retry, atomic_read(&d->continual_io_error));
rtw_set_surprise_removed(dvobj_get_primary_adapter(d)); rtw_set_surprise_removed(dvobj_get_primary_adapter(d));
return _FAIL; return _FAIL;
} }
@ -84,7 +84,7 @@ static u8 sdio_io(struct dvobj_priv *d, u32 addr, void *buf, size_t len, u8 writ
if ((addr & 0x10000) || !(addr & 0xE000)) { if ((addr & 0x10000) || !(addr & 0xE000)) {
RTW_WARN("%s: Retry %s addr=0x%05x %zu bytes, retry=%u,%u\n", RTW_WARN("%s: Retry %s addr=0x%05x %zu bytes, retry=%u,%u\n",
__FUNCTION__, write?"write":"read", addr, len, __FUNCTION__, write?"write":"read", addr, len,
retry, ATOMIC_READ(&d->continual_io_error)); retry, atomic_read(&d->continual_io_error));
continue; continue;
} }
return _FAIL; return _FAIL;

View File

@ -1369,13 +1369,13 @@ static sint aes_cipher(u8 *key, uint hdrlen,
frsubtype = frsubtype >> 4; frsubtype = frsubtype >> 4;
_rtw_memset((void *)mic_iv, 0, 16); memset((void *)mic_iv, 0, 16);
_rtw_memset((void *)mic_header1, 0, 16); memset((void *)mic_header1, 0, 16);
_rtw_memset((void *)mic_header2, 0, 16); memset((void *)mic_header2, 0, 16);
_rtw_memset((void *)ctr_preload, 0, 16); memset((void *)ctr_preload, 0, 16);
_rtw_memset((void *)chain_buffer, 0, 16); memset((void *)chain_buffer, 0, 16);
_rtw_memset((void *)aes_out, 0, 16); memset((void *)aes_out, 0, 16);
_rtw_memset((void *)padded_buffer, 0, 16); memset((void *)padded_buffer, 0, 16);
if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN)) if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN))
a4_exists = 0; a4_exists = 0;
@ -1675,13 +1675,13 @@ static sint aes_decipher(u8 *key, uint hdrlen,
frsubtype = frsubtype >> 4; frsubtype = frsubtype >> 4;
_rtw_memset((void *)mic_iv, 0, 16); memset((void *)mic_iv, 0, 16);
_rtw_memset((void *)mic_header1, 0, 16); memset((void *)mic_header1, 0, 16);
_rtw_memset((void *)mic_header2, 0, 16); memset((void *)mic_header2, 0, 16);
_rtw_memset((void *)ctr_preload, 0, 16); memset((void *)ctr_preload, 0, 16);
_rtw_memset((void *)chain_buffer, 0, 16); memset((void *)chain_buffer, 0, 16);
_rtw_memset((void *)aes_out, 0, 16); memset((void *)aes_out, 0, 16);
_rtw_memset((void *)padded_buffer, 0, 16); memset((void *)padded_buffer, 0, 16);
/* start to decrypt the payload */ /* start to decrypt the payload */
@ -2082,7 +2082,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen
mme = BIP_AAD + ori_len - 18; mme = BIP_AAD + ori_len - 18;
/* clear the MIC field of MME to zero */ /* clear the MIC field of MME to zero */
_rtw_memset(mme + 10, 0, 8); memset(mme + 10, 0, 8);
/* conscruct AAD, copy frame control field */ /* conscruct AAD, copy frame control field */
_rtw_memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2); _rtw_memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2);
@ -2377,7 +2377,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
* and text is the data being protected */ * and text is the data being protected */
/* start out by storing key in ipad */ /* start out by storing key in ipad */
_rtw_memset(k_pad, 0, sizeof(k_pad)); memset(k_pad, 0, sizeof(k_pad));
_rtw_memcpy(k_pad, key, key_len); _rtw_memcpy(k_pad, key, key_len);
/* XOR key with ipad values */ /* XOR key with ipad values */
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
@ -2392,7 +2392,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
} }
sha256_vector(1 + num_elem, _addr, _len, mac); sha256_vector(1 + num_elem, _addr, _len, mac);
_rtw_memset(k_pad, 0, sizeof(k_pad)); memset(k_pad, 0, sizeof(k_pad));
_rtw_memcpy(k_pad, key, key_len); _rtw_memcpy(k_pad, key, key_len);
/* XOR key with opad values */ /* XOR key with opad values */
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
@ -2760,7 +2760,7 @@ static void gf_mulx(u8 *pad)
static void aes_encrypt_deinit(void *ctx) static void aes_encrypt_deinit(void *ctx)
{ {
_rtw_memset(ctx, 0, AES_PRIV_SIZE); memset(ctx, 0, AES_PRIV_SIZE);
rtw_mfree(ctx, AES_PRIV_SIZE); rtw_mfree(ctx, AES_PRIV_SIZE);
} }
@ -2789,7 +2789,7 @@ static int omac1_aes_128_vector(const u8 *key, size_t num_elem,
ctx = aes_encrypt_init(key, 16); ctx = aes_encrypt_init(key, 16);
if (ctx == NULL) if (ctx == NULL)
return -1; return -1;
_rtw_memset(cbc, 0, AES_BLOCK_SIZE); memset(cbc, 0, AES_BLOCK_SIZE);
total_len = 0; total_len = 0;
for (e = 0; e < num_elem; e++) for (e = 0; e < num_elem; e++)
@ -2814,7 +2814,7 @@ static int omac1_aes_128_vector(const u8 *key, size_t num_elem,
left -= AES_BLOCK_SIZE; left -= AES_BLOCK_SIZE;
} }
_rtw_memset(pad, 0, AES_BLOCK_SIZE); memset(pad, 0, AES_BLOCK_SIZE);
aes_128_encrypt(ctx, pad, pad); aes_128_encrypt(ctx, pad, pad);
gf_mulx(pad); gf_mulx(pad);
@ -2859,7 +2859,7 @@ int omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, u8 *mac)
#ifdef CONFIG_RTW_MESH_AEK #ifdef CONFIG_RTW_MESH_AEK
/* for AES-SIV */ /* for AES-SIV */
#define os_memset _rtw_memset #define os_memset memset
#define os_memcpy _rtw_memcpy #define os_memcpy _rtw_memcpy
#define os_malloc rtw_malloc #define os_malloc rtw_malloc
#define bin_clear_free(bin, len) \ #define bin_clear_free(bin, len) \
@ -3181,7 +3181,7 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq,
/* 7) FTIE, with the MIC field of the FTIE set to 0 */ /* 7) FTIE, with the MIC field of the FTIE set to 0 */
_rtw_memcpy(pos, ftie, 2 + ftie[1]); _rtw_memcpy(pos, ftie, 2 + ftie[1]);
_ftie = (struct wpa_tdls_ftie *) pos; _ftie = (struct wpa_tdls_ftie *) pos;
_rtw_memset(_ftie->mic, 0, TDLS_MIC_LEN); memset(_ftie->mic, 0, TDLS_MIC_LEN);
pos += 2 + ftie[1]; pos += 2 + ftie[1];
ret = omac1_aes_128(kck, buf, pos - buf, mic); ret = omac1_aes_128(kck, buf, pos - buf, mic);
@ -3230,7 +3230,7 @@ int wpa_tdls_teardown_ftie_mic(u8 *kck, u8 *lnkid, u16 reason,
/* 5) FTIE, with the MIC field of the FTIE set to 0 */ /* 5) FTIE, with the MIC field of the FTIE set to 0 */
_rtw_memcpy(pos, ftie, 2 + ftie[1]); _rtw_memcpy(pos, ftie, 2 + ftie[1]);
_ftie = (struct wpa_tdls_ftie *) pos; _ftie = (struct wpa_tdls_ftie *) pos;
_rtw_memset(_ftie->mic, 0, TDLS_MIC_LEN); memset(_ftie->mic, 0, TDLS_MIC_LEN);
pos += 2 + ftie[1]; pos += 2 + ftie[1];
ret = omac1_aes_128(kck, buf, pos - buf, mic); ret = omac1_aes_128(kck, buf, pos - buf, mic);
@ -3280,7 +3280,7 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
_rtw_memcpy(pos, ftie, 2 + *(ftie + 1)); _rtw_memcpy(pos, ftie, 2 + *(ftie + 1));
pos += 2; pos += 2;
tmp_ftie = (u8 *)(pos + 2); tmp_ftie = (u8 *)(pos + 2);
_rtw_memset(tmp_ftie, 0, 16); memset(tmp_ftie, 0, 16);
pos += *(ftie + 1); pos += *(ftie + 1);
ret = omac1_aes_128(kck, buf, pos - buf, mic); ret = omac1_aes_128(kck, buf, pos - buf, mic);

View File

@ -37,7 +37,7 @@ struct st_register test_st_reg = {
inline void rtw_st_ctl_init(struct st_ctl_t *st_ctl) inline void rtw_st_ctl_init(struct st_ctl_t *st_ctl)
{ {
_rtw_memset(st_ctl->reg, 0 , sizeof(struct st_register) * SESSION_TRACKER_REG_ID_NUM); memset(st_ctl->reg, 0 , sizeof(struct st_register) * SESSION_TRACKER_REG_ID_NUM);
_rtw_init_queue(&st_ctl->tracker_q); _rtw_init_queue(&st_ctl->tracker_q);
} }
@ -200,7 +200,7 @@ void dump_st_ctl(void *sel, struct st_ctl_t *st_ctl)
void _rtw_init_stainfo(struct sta_info *psta); void _rtw_init_stainfo(struct sta_info *psta);
void _rtw_init_stainfo(struct sta_info *psta) void _rtw_init_stainfo(struct sta_info *psta)
{ {
_rtw_memset((u8 *)psta, 0, sizeof(struct sta_info)); memset((u8 *)psta, 0, sizeof(struct sta_info));
_rtw_spinlock_init(&psta->lock); _rtw_spinlock_init(&psta->lock);
_rtw_init_listhead(&psta->list); _rtw_init_listhead(&psta->list);
@ -300,7 +300,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
pstapriv->expire_to = 60;/* 60*2 = 120 sec = 2 min, expire after no any traffic. */ pstapriv->expire_to = 60;/* 60*2 = 120 sec = 2 min, expire after no any traffic. */
#endif #endif
#ifdef CONFIG_ATMEL_RC_PATCH #ifdef CONFIG_ATMEL_RC_PATCH
_rtw_memset(pstapriv->atmel_rc_pattern, 0, ETH_ALEN); memset(pstapriv->atmel_rc_pattern, 0, ETH_ALEN);
#endif #endif
pstapriv->max_num_sta = NUM_STA; pstapriv->max_num_sta = NUM_STA;
@ -320,7 +320,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
exit: exit:
if (ret != _SUCCESS) { if (ret != _SUCCESS) {
if (pstapriv->pallocated_stainfo_buf) if (pstapriv->pallocated_stainfo_buf)
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info) * NUM_STA + 4); vfree(pstapriv->pallocated_stainfo_buf);
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (pstapriv->sta_aid) if (pstapriv->sta_aid)
rtw_mfree(pstapriv->sta_aid, pstapriv->max_aid * sizeof(struct sta_info *)); rtw_mfree(pstapriv->sta_aid, pstapriv->max_aid * sizeof(struct sta_info *));
@ -350,40 +350,6 @@ inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int
return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info)); return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
} }
void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv);
void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv)
{
_rtw_spinlock_free(&psta_xmitpriv->lock);
_rtw_spinlock_free(&(psta_xmitpriv->be_q.sta_pending.lock));
_rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock));
_rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock));
_rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock));
}
static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv)
{
_rtw_spinlock_free(&psta_recvpriv->lock);
_rtw_spinlock_free(&(psta_recvpriv->defrag_q.lock));
}
void rtw_mfree_stainfo(struct sta_info *psta);
void rtw_mfree_stainfo(struct sta_info *psta)
{
if (&psta->lock != NULL)
_rtw_spinlock_free(&psta->lock);
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
}
/* this function is used to free the memory of lock || sema for all stainfos */ /* this function is used to free the memory of lock || sema for all stainfos */
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv); void rtw_mfree_all_stainfo(struct sta_priv *pstapriv);
@ -402,8 +368,6 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
psta = LIST_CONTAINOR(plist, struct sta_info , list); psta = LIST_CONTAINOR(plist, struct sta_info , list);
plist = get_next(plist); plist = get_next(plist);
rtw_mfree_stainfo(psta);
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
@ -416,17 +380,6 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
{ {
rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */
_rtw_spinlock_free(&pstapriv->free_sta_queue.lock);
_rtw_spinlock_free(&pstapriv->sta_hash_lock);
_rtw_spinlock_free(&pstapriv->wakeup_q.lock);
_rtw_spinlock_free(&pstapriv->sleep_q.lock);
#ifdef CONFIG_AP_MODE
_rtw_spinlock_free(&pstapriv->asoc_list_lock);
_rtw_spinlock_free(&pstapriv->auth_list_lock);
#endif
} }
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
@ -471,7 +424,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
#endif #endif
if (pstapriv->pallocated_stainfo_buf) if (pstapriv->pallocated_stainfo_buf)
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info) * NUM_STA + 4); vfree(pstapriv->pallocated_stainfo_buf);
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (pstapriv->sta_aid) if (pstapriv->sta_aid)
rtw_mfree(pstapriv->sta_aid, pstapriv->max_aid * sizeof(struct sta_info *)); rtw_mfree(pstapriv->sta_aid, pstapriv->max_aid * sizeof(struct sta_info *));
@ -553,7 +506,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
_rtw_memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2); _rtw_memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);
_rtw_memcpy(&psta->sta_recvpriv.bmc_tid_rxseq[i], &wRxSeqInitialValue, 2); _rtw_memcpy(&psta->sta_recvpriv.bmc_tid_rxseq[i], &wRxSeqInitialValue, 2);
_rtw_memset(&psta->sta_recvpriv.rxcache.iv[i], 0, sizeof(psta->sta_recvpriv.rxcache.iv[i])); memset(&psta->sta_recvpriv.rxcache.iv[i], 0, sizeof(psta->sta_recvpriv.rxcache.iv[i]));
} }
rtw_init_timer(&psta->addba_retry_timer, psta->padapter, addba_timer_hdl, psta); rtw_init_timer(&psta->addba_retry_timer, psta->padapter, addba_timer_hdl, psta);
@ -595,7 +548,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
#endif #endif
/* init for the sequence number of received management frame */ /* init for the sequence number of received management frame */
psta->RxMgmtFrameSeqNum = 0xffff; psta->RxMgmtFrameSeqNum = 0xffff;
_rtw_memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats)); memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats));
rtw_alloc_macid(pstapriv->padapter, psta); rtw_alloc_macid(pstapriv->padapter, psta);
@ -822,7 +775,6 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
rtw_st_ctl_deinit(&psta->st_ctl); rtw_st_ctl_deinit(&psta->st_ctl);
if (is_pre_link_sta == _FALSE) { if (is_pre_link_sta == _FALSE) {
_rtw_spinlock_free(&psta->lock);
/* _enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); */ /* _enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); */
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL0);
@ -1269,7 +1221,7 @@ void rtw_pre_link_sta_ctl_reset(struct sta_priv *stapriv)
u8 addrs[RTW_PRE_LINK_STA_NUM][ETH_ALEN]; u8 addrs[RTW_PRE_LINK_STA_NUM][ETH_ALEN];
_rtw_memset(addrs, 0, RTW_PRE_LINK_STA_NUM * ETH_ALEN); memset(addrs, 0, RTW_PRE_LINK_STA_NUM * ETH_ALEN);
_enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL); _enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL);
for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) { for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) {
@ -1310,7 +1262,6 @@ void rtw_pre_link_sta_ctl_deinit(struct sta_priv *stapriv)
rtw_pre_link_sta_ctl_reset(stapriv); rtw_pre_link_sta_ctl_reset(stapriv);
_rtw_spinlock_free(&pre_link_sta_ctl->lock);
} }
void dump_pre_link_sta_ctl(void *sel, struct sta_priv *stapriv) void dump_pre_link_sta_ctl(void *sel, struct sta_priv *stapriv)

View File

@ -47,7 +47,7 @@ void rtw_reset_tdls_info(_adapter *padapter)
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
ptdlsinfo->chsw_info.ch_sw_state = TDLS_STATE_NONE; ptdlsinfo->chsw_info.ch_sw_state = TDLS_STATE_NONE;
ATOMIC_SET(&ptdlsinfo->chsw_info.chsw_on, _FALSE); atomic_set(&ptdlsinfo->chsw_info.chsw_on, _FALSE);
ptdlsinfo->chsw_info.off_ch_num = 0; ptdlsinfo->chsw_info.off_ch_num = 0;
ptdlsinfo->chsw_info.ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; ptdlsinfo->chsw_info.ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
ptdlsinfo->chsw_info.cur_time = 0; ptdlsinfo->chsw_info.cur_time = 0;
@ -88,10 +88,8 @@ int rtw_init_tdls_info(_adapter *padapter)
void rtw_free_tdls_info(struct tdls_info *ptdlsinfo) void rtw_free_tdls_info(struct tdls_info *ptdlsinfo)
{ {
_rtw_spinlock_free(&ptdlsinfo->cmd_lock);
_rtw_spinlock_free(&ptdlsinfo->hdl_lock);
_rtw_memset(ptdlsinfo, 0, sizeof(struct tdls_info)); memset(ptdlsinfo, 0, sizeof(struct tdls_info));
} }
@ -106,7 +104,7 @@ void rtw_free_all_tdls_sta(_adapter *padapter, u8 enqueue_cmd)
struct sta_info *ptdls_sta[NUM_STA]; struct sta_info *ptdls_sta[NUM_STA];
u8 empty_hwaddr[ETH_ALEN] = { 0x00 }; u8 empty_hwaddr[ETH_ALEN] = { 0x00 };
_rtw_memset(ptdls_sta, 0x00, sizeof(ptdls_sta)); memset(ptdls_sta, 0x00, sizeof(ptdls_sta));
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for (index = 0; index < NUM_STA; index++) { for (index = 0; index < NUM_STA; index++) {
@ -304,7 +302,7 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi
pattrib->mdata = 0; pattrib->mdata = 0;
pattrib->retry_ctrl = _FALSE; pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -384,7 +382,7 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig
break; break;
if (i < try_cnt && wait_ms > 0 && ret == _FAIL) if (i < try_cnt && wait_ms > 0 && ret == _FAIL)
rtw_msleep_os(wait_ms); msleep(wait_ms);
} while ((i < try_cnt) && (ret == _FAIL || wait_ms == 0)); } while ((i < try_cnt) && (ret == _FAIL || wait_ms == 0));
@ -427,7 +425,7 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8
u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, cur_beamform_cap = 0; u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, cur_beamform_cap = 0;
/* Save HT capabilities in the sta object */ /* Save HT capabilities in the sta object */
_rtw_memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap));
if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap)) { if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap)) {
ptdls_sta->flags |= WLAN_STA_HT; ptdls_sta->flags |= WLAN_STA_HT;
ptdls_sta->flags |= WLAN_STA_WME; ptdls_sta->flags |= WLAN_STA_WME;
@ -539,7 +537,7 @@ void rtw_tdls_process_vht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8
u16 cur_beamform_cap = 0; u16 cur_beamform_cap = 0;
u8 *pcap_mcs; u8 *pcap_mcs;
_rtw_memset(&ptdls_sta->vhtpriv, 0, sizeof(struct vht_priv)); memset(&ptdls_sta->vhtpriv, 0, sizeof(struct vht_priv));
if (data && Length == 12) { if (data && Length == 12) {
ptdls_sta->flags |= WLAN_STA_VHT; ptdls_sta->flags |= WLAN_STA_VHT;
@ -945,8 +943,8 @@ void rtw_tdls_set_ch_sw_oper_control(_adapter *padapter, u8 enable)
else else
pHalData->ch_switch_offload = _FALSE; pHalData->ch_switch_offload = _FALSE;
if (ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on) != enable) if (atomic_read(&padapter->tdlsinfo.chsw_info.chsw_on) != enable)
ATOMIC_SET(&padapter->tdlsinfo.chsw_info.chsw_on, enable); atomic_set(&padapter->tdlsinfo.chsw_info.chsw_on, enable);
rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_BCN_EARLY_C2H_RPT, &enable); rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_BCN_EARLY_C2H_RPT, &enable);
RTW_INFO("[TDLS] %s Bcn Early C2H Report\n", (enable == _TRUE) ? "Start" : "Stop"); RTW_INFO("[TDLS] %s Bcn Early C2H Report\n", (enable == _TRUE) ? "Start" : "Stop");
@ -959,7 +957,7 @@ void rtw_tdls_ch_sw_back_to_base_chnl(_adapter *padapter)
pmlmepriv = &padapter->mlmepriv; pmlmepriv = &padapter->mlmepriv;
if ((ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) && if ((atomic_read(&pchsw_info->chsw_on) == _TRUE) &&
(padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter))) (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter)))
rtw_tdls_cmd(padapter, pchsw_info->addr, TDLS_CH_SW_TO_BASE_CHNL_UNSOLICITED); rtw_tdls_cmd(padapter, pchsw_info->addr, TDLS_CH_SW_TO_BASE_CHNL_UNSOLICITED);
} }
@ -1053,7 +1051,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty
wait_time = 0; wait_time = 0;
if (wait_time > 0) if (wait_time > 0)
rtw_msleep_os(wait_time); msleep(wait_time);
} }
} }
@ -1130,7 +1128,7 @@ int issue_tunneled_probe_req(_adapter *padapter)
RTW_INFO("[%s]\n", __FUNCTION__); RTW_INFO("[%s]\n", __FUNCTION__);
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
txmgmt.action_code = TUNNELED_PROBE_REQ; txmgmt.action_code = TUNNELED_PROBE_REQ;
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@ -1172,7 +1170,7 @@ int issue_tunneled_probe_rsp(_adapter *padapter, union recv_frame *precv_frame)
RTW_INFO("[%s]\n", __FUNCTION__); RTW_INFO("[%s]\n", __FUNCTION__);
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
txmgmt.action_code = TUNNELED_PROBE_RSP; txmgmt.action_code = TUNNELED_PROBE_RSP;
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@ -1522,7 +1520,7 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -1611,7 +1609,7 @@ int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdl
RTW_INFO("[TDLS] %s\n", __FUNCTION__); RTW_INFO("[TDLS] %s\n", __FUNCTION__);
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
txmgmt.action_code = TDLS_PEER_TRAFFIC_INDICATION; txmgmt.action_code = TDLS_PEER_TRAFFIC_INDICATION;
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@ -1664,7 +1662,7 @@ int issue_tdls_ch_switch_req(_adapter *padapter, struct sta_info *ptdls_sta)
goto exit; goto exit;
} }
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
txmgmt.action_code = TDLS_CHANNEL_SWITCH_REQUEST; txmgmt.action_code = TDLS_CHANNEL_SWITCH_REQUEST;
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@ -1769,7 +1767,7 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame)
if (psta) if (psta)
rssi = psta->cmn.rssi_stat.rssi; rssi = psta->cmn.rssi_stat.rssi;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
/* WFDTDLS: for sigma test, not to setup direct link automatically */ /* WFDTDLS: for sigma test, not to setup direct link automatically */
ptdlsinfo->dev_discovered = _TRUE; ptdlsinfo->dev_discovered = _TRUE;
@ -1849,7 +1847,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct
if (rtw_tdls_is_setup_allowed(padapter) == _FALSE) if (rtw_tdls_is_setup_allowed(padapter) == _FALSE)
goto exit; goto exit;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
psa = get_sa(ptr); psa = get_sa(ptr);
if (ptdlsinfo->sta_maximum == _TRUE) { if (ptdlsinfo->sta_maximum == _TRUE) {
@ -2065,7 +2063,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct
int ret = _SUCCESS; int ret = _SUCCESS;
u32 timeout_interval = TDLS_TPK_RESEND_COUNT; u32 timeout_interval = TDLS_TPK_RESEND_COUNT;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
psa = get_sa(ptr); psa = get_sa(ptr);
ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
@ -2354,7 +2352,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame)
if (rtw_tdls_is_driver_setup(padapter) == _FALSE) if (rtw_tdls_is_driver_setup(padapter) == _FALSE)
goto exit; goto exit;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
txmgmt.dialog_token = *(ptr + 2); txmgmt.dialog_token = *(ptr + 2);
_rtw_memcpy(&txmgmt.peer, precv_frame->u.hdr.attrib.src, ETH_ALEN); _rtw_memcpy(&txmgmt.peer, precv_frame->u.hdr.attrib.src, ETH_ALEN);
@ -2439,7 +2437,7 @@ int On_TDLS_Peer_Traffic_Indication(_adapter *padapter, union recv_frame *precv_
struct tdls_txmgmt txmgmt; struct tdls_txmgmt txmgmt;
ptr += pattrib->hdrlen + pattrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; ptr += pattrib->hdrlen + pattrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
txmgmt.dialog_token = *(ptr + 2); txmgmt.dialog_token = *(ptr + 2);
issue_tdls_peer_traffic_rsp(padapter, ptdls_sta, &txmgmt); issue_tdls_peer_traffic_rsp(padapter, ptdls_sta, &txmgmt);
@ -2614,7 +2612,7 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame, st
if (_rtw_memcmp(pchsw_info->addr, zaddr, ETH_ALEN) == _TRUE) if (_rtw_memcmp(pchsw_info->addr, zaddr, ETH_ALEN) == _TRUE)
_rtw_memcpy(pchsw_info->addr, ptdls_sta->cmn.mac_addr, ETH_ALEN); _rtw_memcpy(pchsw_info->addr, ptdls_sta->cmn.mac_addr, ETH_ALEN);
if (ATOMIC_READ(&pchsw_info->chsw_on) == _FALSE) if (atomic_read(&pchsw_info->chsw_on) == _FALSE)
rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_START); rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_START);
rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_RESP); rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_RESP);
@ -2642,7 +2640,7 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame, st
/* If we receive Unsolicited TDLS Channel Switch Response when channel switch is running, */ /* If we receive Unsolicited TDLS Channel Switch Response when channel switch is running, */
/* we will go back to base channel and terminate this channel switch procedure */ /* we will go back to base channel and terminate this channel switch procedure */
if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) { if (atomic_read(&pchsw_info->chsw_on) == _TRUE) {
if (pmlmeext->cur_channel != rtw_get_oper_ch(padapter)) { if (pmlmeext->cur_channel != rtw_get_oper_ch(padapter)) {
RTW_INFO("[TDLS] Rx unsolicited channel switch response\n"); RTW_INFO("[TDLS] Rx unsolicited channel switch response\n");
rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_TO_BASE_CHNL); rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_TO_BASE_CHNL);
@ -2694,7 +2692,7 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame, st
if ((pmlmeext->cur_channel == rtw_get_oper_ch(padapter)) && if ((pmlmeext->cur_channel == rtw_get_oper_ch(padapter)) &&
(pchsw_info->ch_sw_state & TDLS_WAIT_CH_RSP_STATE)) { (pchsw_info->ch_sw_state & TDLS_WAIT_CH_RSP_STATE)) {
if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) if (atomic_read(&pchsw_info->chsw_on) == _TRUE)
rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_TO_OFF_CHNL); rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_TO_OFF_CHNL);
} }
@ -2773,7 +2771,7 @@ void wfd_ie_tdls(_adapter *padapter, u8 *pframe, u32 *pktlen)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
_rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
/* Local IP Address ATTR */ /* Local IP Address ATTR */
wfdie[wfdielen++] = WFD_ATTR_LOCAL_IP_ADDR; wfdie[wfdielen++] = WFD_ATTR_LOCAL_IP_ADDR;
@ -3291,7 +3289,7 @@ void _tdls_tpk_timer_hdl(void *FunctionContext)
struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext;
struct tdls_txmgmt txmgmt; struct tdls_txmgmt txmgmt;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
ptdls_sta->TPK_count++; ptdls_sta->TPK_count++;
/* TPK_timer expired in a second */ /* TPK_timer expired in a second */
/* Retry timer should set at least 301 sec. */ /* Retry timer should set at least 301 sec. */
@ -3357,7 +3355,7 @@ void _tdls_handshake_timer_hdl(void *FunctionContext)
_adapter *padapter = NULL; _adapter *padapter = NULL;
struct tdls_txmgmt txmgmt; struct tdls_txmgmt txmgmt;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
_rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN);
txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_;
@ -3378,7 +3376,7 @@ void _tdls_pti_timer_hdl(void *FunctionContext)
_adapter *padapter = NULL; _adapter *padapter = NULL;
struct tdls_txmgmt txmgmt; struct tdls_txmgmt txmgmt;
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
_rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN);
txmgmt.status_code = _RSON_TDLS_TEAR_TOOFAR_; txmgmt.status_code = _RSON_TDLS_TEAR_TOOFAR_;
@ -3435,7 +3433,7 @@ void rtw_tdls_teardown_pre_hdl(_adapter *padapter, struct sta_info *psta)
if (ptdlsinfo->sta_cnt < MAX_ALLOWED_TDLS_STA_NUM) { if (ptdlsinfo->sta_cnt < MAX_ALLOWED_TDLS_STA_NUM) {
ptdlsinfo->sta_maximum = _FALSE; ptdlsinfo->sta_maximum = _FALSE;
_rtw_memset(&ptdlsinfo->ss_record, 0x00, sizeof(struct tdls_ss_record)); memset(&ptdlsinfo->ss_record, 0x00, sizeof(struct tdls_ss_record));
} }
if (ptdlsinfo->sta_cnt == 0) if (ptdlsinfo->sta_cnt == 0)

View File

@ -741,7 +741,7 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
u32 len = 0; u32 len = 0;
u8 operation[5]; u8 operation[5];
_rtw_memset(operation, 0, 5); memset(operation, 0, 5);
bw_mode = REGSTY_BW_5G(pregistrypriv); /* TODO: control op bw with other info */ bw_mode = REGSTY_BW_5G(pregistrypriv); /* TODO: control op bw with other info */
@ -805,7 +805,7 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
pcap = pvhtpriv->vht_cap; pcap = pvhtpriv->vht_cap;
_rtw_memset(pcap, 0, 32); memset(pcap, 0, 32);
/* B0 B1 Maximum MPDU Length */ /* B0 B1 Maximum MPDU Length */
rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset); rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset);

View File

@ -201,7 +201,7 @@ u8 WapiGetEntryForCamClear(_adapter *padapter, u8 *pPeerMac, u8 keyid, u8 IsMsk)
&& pWapiInfo->wapiCamEntry[i].type == IsMsk) { && pWapiInfo->wapiCamEntry[i].type == IsMsk) {
pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].IsUsed = 0;
pWapiInfo->wapiCamEntry[i].keyidx = 2; pWapiInfo->wapiCamEntry[i].keyidx = 2;
_rtw_memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN);
WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__);
return pWapiInfo->wapiCamEntry[i].entry_idx; return pWapiInfo->wapiCamEntry[i].entry_idx;
@ -244,7 +244,7 @@ WapiResetAllCamEntry(_adapter *padapter)
pWapiInfo = &padapter->wapiInfo; pWapiInfo = &padapter->wapiInfo;
for (i = 0; i < WAPI_CAM_ENTRY_NUM; i++) { for (i = 0; i < WAPI_CAM_ENTRY_NUM; i++) {
_rtw_memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN);
pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].IsUsed = 0;
pWapiInfo->wapiCamEntry[i].keyidx = 2; /* invalid */ pWapiInfo->wapiCamEntry[i].keyidx = 2; /* invalid */
pWapiInfo->wapiCamEntry[i].entry_idx = 4 + i * 2; pWapiInfo->wapiCamEntry[i].entry_idx = 4 + i * 2;
@ -687,7 +687,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
while (!list_empty(&(pWapiInfo->wapiBKIDStoreList))) { while (!list_empty(&(pWapiInfo->wapiBKIDStoreList))) {
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list); pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list);
list_del_init(&pWapiBkid->list); list_del_init(&pWapiBkid->list);
_rtw_memset(pWapiBkid->bkid, 0, 16); memset(pWapiBkid->bkid, 0, 16);
list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDIdleList); list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDIdleList);
} }
} }
@ -732,7 +732,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
if (_rtw_memcmp(pWapiStaInfo->PeerMacAddr, MacAddr, ETH_ALEN) == _TRUE) { if (_rtw_memcmp(pWapiStaInfo->PeerMacAddr, MacAddr, ETH_ALEN) == _TRUE) {
pWapiStaInfo->bAuthenticateInProgress = false; pWapiStaInfo->bAuthenticateInProgress = false;
pWapiStaInfo->bSetkeyOk = false; pWapiStaInfo->bSetkeyOk = false;
_rtw_memset(pWapiStaInfo->PeerMacAddr, 0, ETH_ALEN); memset(pWapiStaInfo->PeerMacAddr, 0, ETH_ALEN);
list_del_init(&pWapiStaInfo->list); list_del_init(&pWapiStaInfo->list);
list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList); list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList);
break; break;
@ -1163,7 +1163,7 @@ void rtw_wapi_get_iv(_adapter *padapter, u8 *pRA, u8 *IV)
} else { } else {
if (list_empty(&pWapiInfo->wapiSTAUsedList)) { if (list_empty(&pWapiInfo->wapiSTAUsedList)) {
WAPI_TRACE(WAPI_RX, "rtw_wapi_get_iv: list is empty\n"); WAPI_TRACE(WAPI_RX, "rtw_wapi_get_iv: list is empty\n");
_rtw_memset(IV, 10, 18); memset(IV, 10, 18);
return; return;
} else { } else {
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {

View File

@ -336,7 +336,7 @@ void get_rate_set(_adapter *padapter, unsigned char *pbssrate, int *bssrate_len)
{ {
unsigned char supportedrates[NumRates]; unsigned char supportedrates[NumRates];
_rtw_memset(supportedrates, 0, NumRates); memset(supportedrates, 0, NumRates);
*bssrate_len = ratetbl2rateset(padapter, supportedrates); *bssrate_len = ratetbl2rateset(padapter, supportedrates);
_rtw_memcpy(pbssrate, supportedrates, *bssrate_len); _rtw_memcpy(pbssrate, supportedrates, *bssrate_len);
} }
@ -757,7 +757,7 @@ void invalidate_cam_all(_adapter *padapter)
_enter_critical_bh(&cam_ctl->lock, &irqL); _enter_critical_bh(&cam_ctl->lock, &irqL);
rtw_sec_cam_map_clr_all(&cam_ctl->used); rtw_sec_cam_map_clr_all(&cam_ctl->used);
_rtw_memset(dvobj->cam_cache, 0, sizeof(struct sec_cam_ent) * SEC_CAM_ENT_NUM_SW_LIMIT); memset(dvobj->cam_cache, 0, sizeof(struct sec_cam_ent) * SEC_CAM_ENT_NUM_SW_LIMIT);
_exit_critical_bh(&cam_ctl->lock, &irqL); _exit_critical_bh(&cam_ctl->lock, &irqL);
} }
@ -821,7 +821,7 @@ void clear_cam_cache(_adapter *adapter, u8 id)
_enter_critical_bh(&cam_ctl->lock, &irqL); _enter_critical_bh(&cam_ctl->lock, &irqL);
_rtw_memset(&(dvobj->cam_cache[id]), 0, sizeof(struct sec_cam_ent)); memset(&(dvobj->cam_cache[id]), 0, sizeof(struct sec_cam_ent));
_exit_critical_bh(&cam_ctl->lock, &irqL); _exit_critical_bh(&cam_ctl->lock, &irqL);
} }
@ -2428,7 +2428,7 @@ void rtw_debug_rx_bcn(_adapter *adapter, u8 *pframe, u32 packet_len)
update_TSF(pmlmeext, pframe, packet_len); update_TSF(pmlmeext, pframe, packet_len);
tsf = pmlmeext->TSFValue; tsf = pmlmeext->TSFValue;
tsf_offset = rtw_modular64(pmlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)); tsf_offset = do_div(pmlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024));
/*get TIM IE*/ /*get TIM IE*/
/*DTIM Count*/ /*DTIM Count*/
@ -2462,7 +2462,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len,
unsigned char *pos; unsigned char *pos;
struct rtw_ieee802_11_elems elems; struct rtw_ieee802_11_elems elems;
_rtw_memset(recv_beacon, 0, sizeof(*recv_beacon)); memset(recv_beacon, 0, sizeof(*recv_beacon));
/* checking capabilities */ /* checking capabilities */
capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10)); capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10));
@ -3068,7 +3068,7 @@ void update_tx_basic_rate(_adapter *padapter, u8 wirelessmode)
return; return;
#endif /* CONFIG_INTEL_WIDI */ #endif /* CONFIG_INTEL_WIDI */
_rtw_memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX); memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX);
/* clear B mod if current channel is in 5G band, avoid tx cck rate in 5G band. */ /* clear B mod if current channel is in 5G band, avoid tx cck rate in 5G band. */
if (pmlmeext->cur_channel > 14) if (pmlmeext->cur_channel > 14)
@ -4091,11 +4091,6 @@ inline void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl)
_rtw_spinlock_init(&macid_ctl->lock); _rtw_spinlock_init(&macid_ctl->lock);
} }
inline void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl)
{
_rtw_spinlock_free(&macid_ctl->lock);
}
inline bool rtw_bmp_is_set(const u8 *bmp, u8 bmp_len, u8 id) inline bool rtw_bmp_is_set(const u8 *bmp, u8 bmp_len, u8 id)
{ {
if (id / 8 >= bmp_len) if (id / 8 >= bmp_len)
@ -4192,7 +4187,7 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame)
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
_rtw_memset(beacon_frame, 0, 256); memset(beacon_frame, 0, 256);
pframe = beacon_frame + TXDESC_SIZE; pframe = beacon_frame + TXDESC_SIZE;
@ -4413,8 +4408,8 @@ void rtw_wow_pattern_sw_reset(_adapter *adapter)
pwrctrlpriv->wowlan_pattern_idx = 0; pwrctrlpriv->wowlan_pattern_idx = 0;
for (i = 0 ; i < MAX_WKFM_CAM_NUM; i++) { for (i = 0 ; i < MAX_WKFM_CAM_NUM; i++) {
_rtw_memset(pwrctrlpriv->patterns[i].content, '\0', sizeof(pwrctrlpriv->patterns[i].content)); memset(pwrctrlpriv->patterns[i].content, '\0', sizeof(pwrctrlpriv->patterns[i].content));
_rtw_memset(pwrctrlpriv->patterns[i].mask, '\0', sizeof(pwrctrlpriv->patterns[i].mask)); memset(pwrctrlpriv->patterns[i].mask, '\0', sizeof(pwrctrlpriv->patterns[i].mask));
pwrctrlpriv->patterns[i].len = 0; pwrctrlpriv->patterns[i].len = 0;
} }
} }
@ -4441,9 +4436,9 @@ u8 rtw_set_default_pattern(_adapter *adapter)
return 0; return 0;
for (index = 0 ; index < DEFAULT_PATTERN_NUM ; index++) { for (index = 0 ; index < DEFAULT_PATTERN_NUM ; index++) {
_rtw_memset(pwrpriv->patterns[index].content, 0, memset(pwrpriv->patterns[index].content, 0,
sizeof(pwrpriv->patterns[index].content)); sizeof(pwrpriv->patterns[index].content));
_rtw_memset(pwrpriv->patterns[index].mask, 0, memset(pwrpriv->patterns[index].mask, 0,
sizeof(pwrpriv->patterns[index].mask)); sizeof(pwrpriv->patterns[index].mask));
pwrpriv->patterns[index].len = 0; pwrpriv->patterns[index].len = 0;
} }
@ -4462,7 +4457,7 @@ u8 rtw_set_default_pattern(_adapter *adapter)
/* TCP */ /* TCP */
target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET); target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET);
_rtw_memset(target, 0x06, 1); memset(target, 0x06, 1);
target += (IP_OFFSET - PROTOCOL_OFFSET); target += (IP_OFFSET - PROTOCOL_OFFSET);
@ -4485,7 +4480,7 @@ u8 rtw_set_default_pattern(_adapter *adapter)
/* ICMP */ /* ICMP */
target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET); target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET);
_rtw_memset(target, 0x01, 1); memset(target, 0x01, 1);
target += (IP_OFFSET - PROTOCOL_OFFSET); target += (IP_OFFSET - PROTOCOL_OFFSET);
_rtw_memcpy(target, pmlmeinfo->ip_addr, _rtw_memcpy(target, pmlmeinfo->ip_addr,
@ -4509,7 +4504,7 @@ u8 rtw_set_default_pattern(_adapter *adapter)
/* ICMPv6 */ /* ICMPv6 */
target += (IPv6_PROTOCOL_OFFSET - target += (IPv6_PROTOCOL_OFFSET -
ETH_TYPE_OFFSET); ETH_TYPE_OFFSET);
_rtw_memset(target, 0x3a, 1); memset(target, 0x3a, 1);
target += (IPv6_OFFSET - IPv6_PROTOCOL_OFFSET); target += (IPv6_OFFSET - IPv6_PROTOCOL_OFFSET);
_rtw_memcpy(target, pmlmeinfo->ip6_addr, _rtw_memcpy(target, pmlmeinfo->ip6_addr,
@ -4532,7 +4527,7 @@ u8 rtw_set_default_pattern(_adapter *adapter)
/* UDP */ /* UDP */
target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET); target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET);
_rtw_memset(target, 0x11, 1); memset(target, 0x11, 1);
target += (IP_OFFSET - PROTOCOL_OFFSET); target += (IP_OFFSET - PROTOCOL_OFFSET);
_rtw_memcpy(target, &multicast_ip, _rtw_memcpy(target, &multicast_ip,
@ -4565,7 +4560,7 @@ void rtw_dump_priv_pattern(_adapter *adapter, u8 idx)
p_str = str_1; p_str = str_1;
max_len = sizeof(str_1); max_len = sizeof(str_1);
for (i = 0 ; i < MAX_WKFM_PATTERN_SIZE / 8 ; i++) { for (i = 0 ; i < MAX_WKFM_PATTERN_SIZE / 8 ; i++) {
_rtw_memset(p_str, 0, max_len); memset(p_str, 0, max_len);
len = 0; len = 0;
for (j = 0 ; j < 8 ; j++) { for (j = 0 ; j < 8 ; j++) {
val8 = pwrctl->patterns[idx].content[i * 8 + j]; val8 = pwrctl->patterns[idx].content[i * 8 + j];
@ -4577,7 +4572,7 @@ void rtw_dump_priv_pattern(_adapter *adapter, u8 idx)
RTW_INFO(">>>priv_pattern_mask:\n"); RTW_INFO(">>>priv_pattern_mask:\n");
for (i = 0 ; i < MAX_WKFM_SIZE / 8 ; i++) { for (i = 0 ; i < MAX_WKFM_SIZE / 8 ; i++) {
_rtw_memset(p_str, 0, max_len); memset(p_str, 0, max_len);
len = 0; len = 0;
for (j = 0 ; j < 8 ; j++) { for (j = 0 ; j < 8 ; j++) {
val8 = pwrctl->patterns[idx].mask[i * 8 + j]; val8 = pwrctl->patterns[idx].mask[i * 8 + j];
@ -4605,7 +4600,7 @@ void rtw_get_sec_iv(PADAPTER padapter, u8 *pcur_dot11txpn, u8 *StaAddr)
struct sta_info *psta; struct sta_info *psta;
struct security_priv *psecpriv = &padapter->securitypriv; struct security_priv *psecpriv = &padapter->securitypriv;
_rtw_memset(pcur_dot11txpn, 0, 8); memset(pcur_dot11txpn, 0, 8);
if (NULL == StaAddr) if (NULL == StaAddr)
return; return;
psta = rtw_get_stainfo(&padapter->stapriv, StaAddr); psta = rtw_get_stainfo(&padapter->stapriv, StaAddr);

View File

@ -37,7 +37,7 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv)
{ {
_rtw_memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv)); memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv));
_rtw_spinlock_init(&psta_xmitpriv->lock); _rtw_spinlock_init(&psta_xmitpriv->lock);
@ -62,12 +62,6 @@ void rtw_init_xmit_block(_adapter *padapter)
dvobj->xmit_block = XMIT_BLOCK_NONE; dvobj->xmit_block = XMIT_BLOCK_NONE;
} }
void rtw_free_xmit_block(_adapter *padapter)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
_rtw_spinlock_free(&dvobj->xmit_block_lock);
}
s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
{ {
@ -78,7 +72,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* _rtw_memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */ /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */
_rtw_spinlock_init(&pxmitpriv->lock); _rtw_spinlock_init(&pxmitpriv->lock);
_rtw_spinlock_init(&pxmitpriv->lock_sctx); _rtw_spinlock_init(&pxmitpriv->lock_sctx);
@ -171,7 +165,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter)
/* Tx buf allocation may fail sometimes, so sleep and retry. */ /* Tx buf allocation may fail sometimes, so sleep and retry. */
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), _TRUE); res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), _TRUE);
if (res == _FAIL) { if (res == _FAIL) {
rtw_msleep_os(10); msleep(10);
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), _TRUE); res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), _TRUE);
if (res == _FAIL) if (res == _FAIL)
goto exit; goto exit;
@ -360,21 +354,7 @@ exit:
void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv); void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv);
void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv) void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv)
{ {
_rtw_spinlock_free(&pxmitpriv->lock);
_rtw_free_sema(&pxmitpriv->xmit_sema); _rtw_free_sema(&pxmitpriv->xmit_sema);
_rtw_spinlock_free(&pxmitpriv->be_pending.lock);
_rtw_spinlock_free(&pxmitpriv->bk_pending.lock);
_rtw_spinlock_free(&pxmitpriv->vi_pending.lock);
_rtw_spinlock_free(&pxmitpriv->vo_pending.lock);
_rtw_spinlock_free(&pxmitpriv->bm_pending.lock);
/* _rtw_spinlock_free(&pxmitpriv->legacy_dz_queue.lock); */
/* _rtw_spinlock_free(&pxmitpriv->apsd_queue.lock); */
_rtw_spinlock_free(&pxmitpriv->free_xmit_queue.lock);
_rtw_spinlock_free(&pxmitpriv->free_xmitbuf_queue.lock);
_rtw_spinlock_free(&pxmitpriv->pending_xmitbuf_queue.lock);
} }
@ -405,12 +385,10 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
pxmitbuf++; pxmitbuf++;
} }
if (pxmitpriv->pallocated_frame_buf) vfree(pxmitpriv->pallocated_frame_buf);
rtw_vmfree(pxmitpriv->pallocated_frame_buf, NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
if (pxmitpriv->pallocated_xmitbuf) vfree(pxmitpriv->pallocated_xmitbuf);
rtw_vmfree(pxmitpriv->pallocated_xmitbuf, NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
/* free xframe_ext queue, the same count as extbuf */ /* free xframe_ext queue, the same count as extbuf */
if ((pxmitframe = (struct xmit_frame *)pxmitpriv->xframe_ext)) { if ((pxmitframe = (struct xmit_frame *)pxmitpriv->xframe_ext)) {
@ -419,12 +397,8 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
pxmitframe++; pxmitframe++;
} }
} }
if (pxmitpriv->xframe_ext_alloc_addr)
rtw_vmfree(pxmitpriv->xframe_ext_alloc_addr, NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4);
_rtw_spinlock_free(&pxmitpriv->free_xframe_ext_queue.lock);
/* free xmit extension buff */ vfree(pxmitpriv->xframe_ext_alloc_addr);
_rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock);
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
for (i = 0; i < NR_XMIT_EXTBUFF; i++) { for (i = 0; i < NR_XMIT_EXTBUFF; i++) {
@ -433,8 +407,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
pxmitbuf++; pxmitbuf++;
} }
if (pxmitpriv->pallocated_xmit_extbuf) vfree(pxmitpriv->pallocated_xmit_extbuf);
rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);
for (i = 0; i < CMDBUF_MAX; i++) { for (i = 0; i < CMDBUF_MAX; i++) {
pxmitbuf = &pxmitpriv->pcmd_xmitbuf[i]; pxmitbuf = &pxmitpriv->pcmd_xmitbuf[i];
@ -447,7 +420,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv)
#ifdef CONFIG_XMIT_ACK #ifdef CONFIG_XMIT_ACK
_rtw_mutex_free(&pxmitpriv->ack_tx_mutex); _rtw_mutex_free(&pxmitpriv->ack_tx_mutex);
#endif #endif
rtw_free_xmit_block(padapter);
out: out:
return; return;
} }
@ -997,8 +969,8 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
struct security_priv *psecuritypriv = &padapter->securitypriv; struct security_priv *psecuritypriv = &padapter->securitypriv;
sint bmcast = IS_MCAST(pattrib->ra); sint bmcast = IS_MCAST(pattrib->ra);
_rtw_memset(pattrib->dot118021x_UncstKey.skey, 0, 16); memset(pattrib->dot118021x_UncstKey.skey, 0, 16);
_rtw_memset(pattrib->dot11tkiptxmickey.skey, 0, 16); memset(pattrib->dot11tkiptxmickey.skey, 0, 16);
pattrib->mac_id = psta->cmn.mac_id; pattrib->mac_id = psta->cmn.mac_id;
if (psta->ieee8021x_blocked == _TRUE) { if (psta->ieee8021x_blocked == _TRUE) {
@ -1650,7 +1622,7 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe)
if (bmcst) { if (bmcst) {
if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16) == _TRUE) { if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16) == _TRUE) {
/* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */
/* rtw_msleep_os(10); */ /* msleep(10); */
return _FAIL; return _FAIL;
} }
/* start to calculate the mic code */ /* start to calculate the mic code */
@ -1658,7 +1630,7 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe)
} else { } else {
if (_rtw_memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16) == _TRUE) { if (_rtw_memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16) == _TRUE) {
/* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */
/* rtw_msleep_os(10); */ /* msleep(10); */
return _FAIL; return _FAIL;
} }
/* start to calculate the mic code */ /* start to calculate the mic code */
@ -1794,7 +1766,7 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
} }
*/ */
_rtw_memset(hdr, 0, WLANHDR_OFFSET); memset(hdr, 0, WLANHDR_OFFSET);
set_frame_sub_type(fctrl, pattrib->subtype); set_frame_sub_type(fctrl, pattrib->subtype);
@ -2109,7 +2081,7 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr
u16 *fctrl = &pwlanhdr->frame_ctl; u16 *fctrl = &pwlanhdr->frame_ctl;
_rtw_memset(hdr, 0, WLANHDR_OFFSET); memset(hdr, 0, WLANHDR_OFFSET);
set_frame_sub_type(fctrl, pattrib->subtype); set_frame_sub_type(fctrl, pattrib->subtype);
@ -2502,7 +2474,7 @@ s32 rtw_xmitframe_coalesce_amsdu(_adapter *padapter, struct xmit_frame *pxmitfra
if(padding == 4) if(padding == 4)
padding = 0; padding = 0;
//_rtw_memset(pframe,0xaa, padding); //memset(pframe,0xaa, padding);
pframe += padding; pframe += padding;
pattrib->last_txcmdsz += ETH_HLEN + XATTRIB_GET_MCTRL_LEN(pattrib_queue) + llc_sz + mem_sz + padding ; pattrib->last_txcmdsz += ETH_HLEN + XATTRIB_GET_MCTRL_LEN(pattrib_queue) + llc_sz + mem_sz + padding ;
@ -2917,7 +2889,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame
} }
#endif #endif
_rtw_memset(MME, 0, _MME_IE_LENGTH_); memset(MME, 0, _MME_IE_LENGTH_);
MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += pattrib->pktlen; pframe += pattrib->pktlen;
@ -3285,7 +3257,7 @@ struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv,
pcmdframe->buf_addr = pxmitbuf->pbuf; pcmdframe->buf_addr = pxmitbuf->pbuf;
/* initial memory to zero */ /* initial memory to zero */
_rtw_memset(pcmdframe->buf_addr, 0, MAX_CMDBUF_SZ); memset(pcmdframe->buf_addr, 0, MAX_CMDBUF_SZ);
pxmitbuf->priv_data = pcmdframe; pxmitbuf->priv_data = pcmdframe;
@ -3486,7 +3458,7 @@ void rtw_init_xmitframe(struct xmit_frame *pxframe)
pxframe->buf_addr = NULL; pxframe->buf_addr = NULL;
pxframe->pxmitbuf = NULL; pxframe->pxmitbuf = NULL;
_rtw_memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib));
/* pxframe->attrib.psta = NULL; */ /* pxframe->attrib.psta = NULL; */
pxframe->frame_tag = DATA_FRAMETAG; pxframe->frame_tag = DATA_FRAMETAG;
@ -4450,7 +4422,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
goto fail; goto fail;
} }
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
// _rtw_memcpy(pframe, (void *)checking, len); // _rtw_memcpy(pframe, (void *)checking, len);
_rtw_pktfile_read(&pktfile, pframe, len); _rtw_pktfile_read(&pktfile, pframe, len);
@ -5777,7 +5749,7 @@ void rtw_tx_desc_backup_reset(void)
for (i = 0; i < HW_QUEUE_ENTRY; i++) { for (i = 0; i < HW_QUEUE_ENTRY; i++) {
for (j = 0; j < TX_BAK_FRMAE_CNT; j++) for (j = 0; j < TX_BAK_FRMAE_CNT; j++)
_rtw_memset(&tx_backup[i][j], 0, sizeof(struct rtw_tx_desc_backup)); memset(&tx_backup[i][j], 0, sizeof(struct rtw_tx_desc_backup));
backup_idx[i] = 0; backup_idx[i] = 0;
} }

View File

@ -220,7 +220,7 @@ static void DBG_BT_INFO_INIT(PBTCDBGINFO pinfo, u8 *pbuf, u32 size)
if (NULL == pinfo) if (NULL == pinfo)
return; return;
_rtw_memset(pinfo, 0, sizeof(BTCDBGINFO)); memset(pinfo, 0, sizeof(BTCDBGINFO));
if (pbuf && size) { if (pbuf && size) {
pinfo->info = pbuf; pinfo->info = pbuf;
@ -413,7 +413,7 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist)
if (utime > timeout) if (utime > timeout)
break; break;
rtw_msleep_os(1); msleep(1);
} while (1); } while (1);
GLBtcBtCoexAliveRegistered = _TRUE; GLBtcBtCoexAliveRegistered = _TRUE;
@ -2842,7 +2842,7 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter)
_rtw_init_sema(&GLBtcBtMpRptSema, 0); _rtw_init_sema(&GLBtcBtMpRptSema, 0);
GLBtcBtMpRptSeq = 0; GLBtcBtMpRptSeq = 0;
GLBtcBtMpRptStatus = 0; GLBtcBtMpRptStatus = 0;
_rtw_memset(GLBtcBtMpRptRsp, 0, C2H_MAX_SIZE); memset(GLBtcBtMpRptRsp, 0, C2H_MAX_SIZE);
GLBtcBtMpRptRspSize = 0; GLBtcBtMpRptRspSize = 0;
GLBtcBtMpRptWait = _FALSE; GLBtcBtMpRptWait = _FALSE;
GLBtcBtMpRptWiFiOK = _FALSE; GLBtcBtMpRptWiFiOK = _FALSE;
@ -4985,7 +4985,7 @@ u8 hal_btcoex_Initialize(PADAPTER padapter)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
u8 ret; u8 ret;
_rtw_memset(&GLBtCoexist, 0, sizeof(GLBtCoexist)); memset(&GLBtCoexist, 0, sizeof(GLBtCoexist));
ret = EXhalbtcoutsrc_InitlizeVariables((void *)padapter); ret = EXhalbtcoutsrc_InitlizeVariables((void *)padapter);
@ -5566,7 +5566,7 @@ hal_btcoex_ParseAntIsolationConfigFile(
RTW_INFO("Fail to parse parameters , format error!\n"); RTW_INFO("Fail to parse parameters , format error!\n");
break; break;
} }
_rtw_memset((PVOID)param_value_string , 0 , 10); memset((PVOID)param_value_string , 0 , 10);
if (!ParseQualifiedString(szLine , &i , param_value_string , '"' , '"')) { if (!ParseQualifiedString(szLine , &i , param_value_string , '"' , '"')) {
RTW_INFO("Fail to parse parameters\n"); RTW_INFO("Fail to parse parameters\n");
return _FAIL; return _FAIL;
@ -5616,7 +5616,7 @@ hal_btcoex_AntIsolationConfig_ParaFile(
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
int rlen = 0 , rtStatus = _FAIL; int rlen = 0 , rtStatus = _FAIL;
_rtw_memset(pHalData->para_file_buf , 0 , MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf , 0 , MAX_PARA_FILE_BUF_LEN);
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE) { if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE) {

View File

@ -191,7 +191,7 @@ void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter)
struct wifi_only_haldata *pwifionly_haldata = &pwifionlycfg->haldata_info; struct wifi_only_haldata *pwifionly_haldata = &pwifionlycfg->haldata_info;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
_rtw_memset(&GLBtCoexistWifiOnly, 0, sizeof(GLBtCoexistWifiOnly)); memset(&GLBtCoexistWifiOnly, 0, sizeof(GLBtCoexistWifiOnly));
pwifionlycfg->Adapter = padapter; pwifionlycfg->Adapter = padapter;

File diff suppressed because it is too large Load Diff

View File

@ -542,7 +542,7 @@ static inline void hal_init_pg_txpwr_info_2g(_adapter *adapter, TxPowerInfo24G *
if (pwr_info == NULL) if (pwr_info == NULL)
return; return;
_rtw_memset(pwr_info, 0, sizeof(TxPowerInfo24G)); memset(pwr_info, 0, sizeof(TxPowerInfo24G));
/* init with invalid value */ /* init with invalid value */
for (path = 0; path < MAX_RF_PATH; path++) { for (path = 0; path < MAX_RF_PATH; path++) {
@ -580,7 +580,7 @@ static inline void hal_init_pg_txpwr_info_5g(_adapter *adapter, TxPowerInfo5G *p
if (pwr_info == NULL) if (pwr_info == NULL)
return; return;
_rtw_memset(pwr_info, 0, sizeof(TxPowerInfo5G)); memset(pwr_info, 0, sizeof(TxPowerInfo5G));
/* init with invalid value */ /* init with invalid value */
for (path = 0; path < MAX_RF_PATH; path++) { for (path = 0; path < MAX_RF_PATH; path++) {
@ -3417,7 +3417,7 @@ void phy_txpwr_limit_bandwidth_chk(_adapter *adapter)
break; break;
} }
_rtw_memset(cch_by_bw, 0, 3); memset(cch_by_bw, 0, 3);
cch_by_bw[bw] = cch; cch_by_bw[bw] = cch;
offset_by_bw = 0x01; offset_by_bw = 0x01;
@ -4084,7 +4084,7 @@ phy_ConfigMACWithParaFile(
if (!(Adapter->registrypriv.load_phy_file & LOAD_MAC_PARA_FILE)) if (!(Adapter->registrypriv.load_phy_file & LOAD_MAC_PARA_FILE))
return rtStatus; return rtStatus;
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL)) { if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL)) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -4163,7 +4163,7 @@ phy_ConfigBBWithParaFile(
break; break;
} }
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -4207,7 +4207,7 @@ phy_ConfigBBWithParaFile(
break; break;
} else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) { } else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) {
#ifdef CONFIG_LONG_DELAY_ISSUE #ifdef CONFIG_LONG_DELAY_ISSUE
rtw_msleep_os(50); msleep(50);
#else #else
rtw_mdelay_os(50); rtw_mdelay_os(50);
#endif #endif
@ -4469,7 +4469,7 @@ phy_ConfigBBWithPgParaFile(
if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_PG_PARA_FILE)) if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_PG_PARA_FILE))
return rtStatus; return rtStatus;
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if (pHalData->bb_phy_reg_pg == NULL) { if (pHalData->bb_phy_reg_pg == NULL) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -4518,7 +4518,7 @@ phy_ConfigBBWithMpParaFile(
if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_MP_PARA_FILE)) if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_MP_PARA_FILE))
return rtStatus; return rtStatus;
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL)) { if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL)) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -4555,7 +4555,7 @@ phy_ConfigBBWithMpParaFile(
break; break;
} else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) { } else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) {
#ifdef CONFIG_LONG_DELAY_ISSUE #ifdef CONFIG_LONG_DELAY_ISSUE
rtw_msleep_os(50); msleep(50);
#else #else
rtw_mdelay_os(50); rtw_mdelay_os(50);
#endif #endif
@ -4622,7 +4622,7 @@ PHY_ConfigRFWithParaFile(
break; break;
} }
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -4669,7 +4669,7 @@ PHY_ConfigRFWithParaFile(
if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) { if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) {
/* Deay specific ms. Only RF configuration require delay. */ /* Deay specific ms. Only RF configuration require delay. */
#ifdef CONFIG_LONG_DELAY_ISSUE #ifdef CONFIG_LONG_DELAY_ISSUE
rtw_msleep_os(50); msleep(50);
#else #else
rtw_mdelay_os(50); rtw_mdelay_os(50);
#endif #endif
@ -4821,7 +4821,7 @@ PHY_ConfigRFWithTxPwrTrackParaFile(
if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_TRACK_PARA_FILE)) if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_TRACK_PARA_FILE))
return rtStatus; return rtStatus;
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL)) { if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL)) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -5076,10 +5076,10 @@ phy_ParsePowerLimitTableFile(
szLine[--i] = ' '; /* return the space in front of the regulation info */ szLine[--i] = ' '; /* return the space in front of the regulation info */
/* Parse the label of the table */ /* Parse the label of the table */
_rtw_memset((PVOID) band, 0, 10); memset((PVOID) band, 0, 10);
_rtw_memset((PVOID) bandwidth, 0, 10); memset((PVOID) bandwidth, 0, 10);
_rtw_memset((PVOID) ntx, 0, 10); memset((PVOID) ntx, 0, 10);
_rtw_memset((PVOID) rateSection, 0, 10); memset((PVOID) rateSection, 0, 10);
if (!ParseQualifiedString(szLine, &i, band, ' ', ',')) { if (!ParseQualifiedString(szLine, &i, band, ' ', ',')) {
RTW_ERR("Fail to parse band!\n"); RTW_ERR("Fail to parse band!\n");
goto exit; goto exit;
@ -5124,7 +5124,7 @@ phy_ParsePowerLimitTableFile(
while (szLine[i] == ' ' || szLine[i] == '\t') while (szLine[i] == ' ' || szLine[i] == '\t')
++i; ++i;
_rtw_memset((PVOID) colNumBuf, 0, 10); memset((PVOID) colNumBuf, 0, 10);
if (!ParseQualifiedString(szLine, &i, colNumBuf, '#', '#')) { if (!ParseQualifiedString(szLine, &i, colNumBuf, '#', '#')) {
RTW_ERR("Fail to parse column number!\n"); RTW_ERR("Fail to parse column number!\n");
goto exit; goto exit;
@ -5229,7 +5229,7 @@ phy_ParsePowerLimitTableFile(
++i; ++i;
/* load the power limit value */ /* load the power limit value */
_rtw_memset((PVOID) powerLimit, 0, 10); memset((PVOID) powerLimit, 0, 10);
if (szLine[i] == 'W' && szLine[i + 1] == 'W') { if (szLine[i] == 'W' && szLine[i + 1] == 'W') {
/* /*
@ -5320,7 +5320,7 @@ PHY_ConfigRFWithPowerLimitTableParaFile(
if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_LMT_PARA_FILE)) if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_LMT_PARA_FILE))
return rtStatus; return rtStatus;
_rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN);
if (pHalData->rf_tx_pwr_lmt == NULL) { if (pHalData->rf_tx_pwr_lmt == NULL) {
rtw_get_phy_file_path(Adapter, pFileName); rtw_get_phy_file_path(Adapter, pFileName);
@ -5359,43 +5359,43 @@ void phy_free_filebuf_mask(_adapter *padapter, u8 mask)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if (pHalData->mac_reg && (mask & LOAD_MAC_PARA_FILE)) { if (pHalData->mac_reg && (mask & LOAD_MAC_PARA_FILE)) {
rtw_vmfree(pHalData->mac_reg, pHalData->mac_reg_len); vfree(pHalData->mac_reg);
pHalData->mac_reg = NULL; pHalData->mac_reg = NULL;
} }
if (mask & LOAD_BB_PARA_FILE) { if (mask & LOAD_BB_PARA_FILE) {
if (pHalData->bb_phy_reg) { if (pHalData->bb_phy_reg) {
rtw_vmfree(pHalData->bb_phy_reg, pHalData->bb_phy_reg_len); vfree(pHalData->bb_phy_reg);
pHalData->bb_phy_reg = NULL; pHalData->bb_phy_reg = NULL;
} }
if (pHalData->bb_agc_tab) { if (pHalData->bb_agc_tab) {
rtw_vmfree(pHalData->bb_agc_tab, pHalData->bb_agc_tab_len); vfree(pHalData->bb_agc_tab);
pHalData->bb_agc_tab = NULL; pHalData->bb_agc_tab = NULL;
} }
} }
if (pHalData->bb_phy_reg_pg && (mask & LOAD_BB_PG_PARA_FILE)) { if (pHalData->bb_phy_reg_pg && (mask & LOAD_BB_PG_PARA_FILE)) {
rtw_vmfree(pHalData->bb_phy_reg_pg, pHalData->bb_phy_reg_pg_len); vfree(pHalData->bb_phy_reg_pg);
pHalData->bb_phy_reg_pg = NULL; pHalData->bb_phy_reg_pg = NULL;
} }
if (pHalData->bb_phy_reg_mp && (mask & LOAD_BB_MP_PARA_FILE)) { if (pHalData->bb_phy_reg_mp && (mask & LOAD_BB_MP_PARA_FILE)) {
rtw_vmfree(pHalData->bb_phy_reg_mp, pHalData->bb_phy_reg_mp_len); vfree(pHalData->bb_phy_reg_mp);
pHalData->bb_phy_reg_mp = NULL; pHalData->bb_phy_reg_mp = NULL;
} }
if (mask & LOAD_RF_PARA_FILE) { if (mask & LOAD_RF_PARA_FILE) {
if (pHalData->rf_radio_a) { if (pHalData->rf_radio_a) {
rtw_vmfree(pHalData->rf_radio_a, pHalData->rf_radio_a_len); vfree(pHalData->rf_radio_a);
pHalData->rf_radio_a = NULL; pHalData->rf_radio_a = NULL;
} }
if (pHalData->rf_radio_b) { if (pHalData->rf_radio_b) {
rtw_vmfree(pHalData->rf_radio_b, pHalData->rf_radio_b_len); vfree(pHalData->rf_radio_b);
pHalData->rf_radio_b = NULL; pHalData->rf_radio_b = NULL;
} }
} }
if (pHalData->rf_tx_pwr_track && (mask & LOAD_RF_TXPWR_TRACK_PARA_FILE)) { if (pHalData->rf_tx_pwr_track && (mask & LOAD_RF_TXPWR_TRACK_PARA_FILE)) {
rtw_vmfree(pHalData->rf_tx_pwr_track, pHalData->rf_tx_pwr_track_len); vfree(pHalData->rf_tx_pwr_track);
pHalData->rf_tx_pwr_track = NULL; pHalData->rf_tx_pwr_track = NULL;
} }
if (pHalData->rf_tx_pwr_lmt && (mask & LOAD_RF_TXPWR_LMT_PARA_FILE)) { if (pHalData->rf_tx_pwr_lmt && (mask & LOAD_RF_TXPWR_LMT_PARA_FILE)) {
rtw_vmfree(pHalData->rf_tx_pwr_lmt, pHalData->rf_tx_pwr_lmt_len); vfree(pHalData->rf_tx_pwr_lmt);
pHalData->rf_tx_pwr_lmt = NULL; pHalData->rf_tx_pwr_lmt = NULL;
} }
} }

View File

@ -32,7 +32,7 @@ static void _rtw_bss_nums_count(_adapter *adapter, u8 *pbss_nums)
RTW_ERR("%s pbss_nums is null pointer\n", __func__); RTW_ERR("%s pbss_nums is null pointer\n", __func__);
return; return;
} }
_rtw_memset(pbss_nums, 0, MAX_CHANNEL_NUM); memset(pbss_nums, 0, MAX_CHANNEL_NUM);
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
phead = get_list_head(queue); phead = get_list_head(queue);
@ -94,7 +94,7 @@ void rtw_acs_reset(_adapter *adapter)
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
struct auto_chan_sel *pacs = &hal_data->acs; struct auto_chan_sel *pacs = &hal_data->acs;
_rtw_memset(pacs, 0, sizeof(struct auto_chan_sel)); memset(pacs, 0, sizeof(struct auto_chan_sel));
#ifdef CONFIG_RTW_ACS_DBG #ifdef CONFIG_RTW_ACS_DBG
rtw_acs_adv_reset(adapter); rtw_acs_adv_reset(adapter);
#endif /*CONFIG_RTW_ACS_DBG*/ #endif /*CONFIG_RTW_ACS_DBG*/

View File

@ -60,8 +60,8 @@ void rtw_acs_version_dump(void *sel, _adapter *adapter);
extern void phydm_ccx_monitor_trigger(void *p_dm_void, u16 monitor_time); extern void phydm_ccx_monitor_trigger(void *p_dm_void, u16 monitor_time);
extern void phydm_ccx_monitor_result(void *p_dm_void); extern void phydm_ccx_monitor_result(void *p_dm_void);
#define GET_ACS_STATE(padapter) (ATOMIC_READ(&GET_HAL_DATA(padapter)->acs.state)) #define GET_ACS_STATE(padapter) (atomic_read(&GET_HAL_DATA(padapter)->acs.state))
#define SET_ACS_STATE(padapter, set_state) (ATOMIC_SET(&GET_HAL_DATA(padapter)->acs.state, set_state)) #define SET_ACS_STATE(padapter, set_state) (atomic_set(&GET_HAL_DATA(padapter)->acs.state, set_state))
#define IS_ACS_ENABLE(padapter) ((GET_ACS_STATE(padapter) == ACS_ENABLE) ? _TRUE : _FALSE) #define IS_ACS_ENABLE(padapter) ((GET_ACS_STATE(padapter) == ACS_ENABLE) ? _TRUE : _FALSE)
enum ACS_STATE { enum ACS_STATE {
@ -75,7 +75,7 @@ enum ACS_STATE {
#define ACS_BW_160M BIT(3) #define ACS_BW_160M BIT(3)
struct auto_chan_sel { struct auto_chan_sel {
ATOMIC_T state; atomic_t state;
u8 trigger_ch; u8 trigger_ch;
bool triggered; bool triggered;
u8 clm_ratio[MAX_CHANNEL_NUM]; u8 clm_ratio[MAX_CHANNEL_NUM];
@ -142,8 +142,8 @@ void rtw_acs_stop(_adapter *adapter);
#ifdef CONFIG_BACKGROUND_NOISE_MONITOR #ifdef CONFIG_BACKGROUND_NOISE_MONITOR
#define RTK_NOISE_MONITOR_VERSION 3 #define RTK_NOISE_MONITOR_VERSION 3
#define GET_NM_STATE(padapter) (ATOMIC_READ(&GET_HAL_DATA(padapter)->nm.state)) #define GET_NM_STATE(padapter) (atomic_read(&GET_HAL_DATA(padapter)->nm.state))
#define SET_NM_STATE(padapter, set_state) (ATOMIC_SET(&GET_HAL_DATA(padapter)->nm.state, set_state)) #define SET_NM_STATE(padapter, set_state) (atomic_set(&GET_HAL_DATA(padapter)->nm.state, set_state))
#define IS_NM_ENABLE(padapter) ((GET_NM_STATE(padapter) == NM_ENABLE) ? _TRUE : _FALSE) #define IS_NM_ENABLE(padapter) ((GET_NM_STATE(padapter) == NM_ENABLE) ? _TRUE : _FALSE)
enum NM_STATE { enum NM_STATE {
@ -152,7 +152,7 @@ enum NM_STATE {
}; };
struct noise_monitor { struct noise_monitor {
ATOMIC_T state; atomic_t state;
s16 noise[MAX_CHANNEL_NUM]; s16 noise[MAX_CHANNEL_NUM];
u8 bss_nums[MAX_CHANNEL_NUM]; u8 bss_nums[MAX_CHANNEL_NUM];
}; };

View File

@ -402,7 +402,7 @@ static u8 _halmac_memcpy(void *p, void *dest, void *src, u32 size)
static u8 _halmac_memset(void *p, void *addr, u8 value, u32 size) static u8 _halmac_memset(void *p, void *addr, u8 value, u32 size)
{ {
_rtw_memset(addr, value, size); memset(addr, value, size);
return RTW_HALMAC_SUCCESS; return RTW_HALMAC_SUCCESS;
} }
@ -414,7 +414,7 @@ static void _halmac_udelay(void *p, u32 us)
else if (us <= 1000) else if (us <= 1000)
rtw_usleep_os(us); rtw_usleep_os(us);
else else
rtw_msleep_os(RTW_DIV_ROUND_UP(us, 1000)); msleep(RTW_DIV_ROUND_UP(us, 1000));
} }
static u8 _halmac_mutex_init(void *p, HALMAC_MUTEX *pMutex) static u8 _halmac_mutex_init(void *p, HALMAC_MUTEX *pMutex)
@ -1064,7 +1064,7 @@ static int init_write_rsvd_page_size(struct dvobj_priv *d)
mac = dvobj_to_halmac(d); mac = dvobj_to_halmac(d);
api = HALMAC_GET_API(mac); api = HALMAC_GET_API(mac);
_rtw_memset(&ofld_info, 0, sizeof(ofld_info)); memset(&ofld_info, 0, sizeof(ofld_info));
ofld_info.halmac_malloc_max_sz = 0xFFFFFFFF; ofld_info.halmac_malloc_max_sz = 0xFFFFFFFF;
ofld_info.rsvd_pg_drv_buf_max_sz = size; ofld_info.rsvd_pg_drv_buf_max_sz = size;
status = api->halmac_ofld_func_cfg(mac, &ofld_info); status = api->halmac_ofld_func_cfg(mac, &ofld_info);
@ -1218,7 +1218,7 @@ int rtw_halmac_init_adapter(struct dvobj_priv *d, struct halmac_platform_api *pf
init_write_rsvd_page_size(d); init_write_rsvd_page_size(d);
#ifdef CONFIG_SDIO_HCI #ifdef CONFIG_SDIO_HCI
_rtw_memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
info.spec_ver = _sdio_ver_drv2halmac(d); info.spec_ver = _sdio_ver_drv2halmac(d);
/* Convert clock speed unit to MHz from Hz */ /* Convert clock speed unit to MHz from Hz */
info.clock_speed = RTW_DIV_ROUND_UP(rtw_sdio_get_clock(d), 1000000); info.clock_speed = RTW_DIV_ROUND_UP(rtw_sdio_get_clock(d), 1000000);
@ -1794,7 +1794,7 @@ int rtw_halmac_get_mac_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *a
halmac = dvobj_to_halmac(d); halmac = dvobj_to_halmac(d);
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
port = _hw_port_drv2halmac(hwport); port = _hw_port_drv2halmac(hwport);
_rtw_memset(&hwa, 0, sizeof(hwa)); memset(&hwa, 0, sizeof(hwa));
status = api->halmac_get_mac_addr(halmac, port, &hwa); status = api->halmac_get_mac_addr(halmac, port, &hwa);
if (status != HALMAC_RET_SUCCESS) if (status != HALMAC_RET_SUCCESS)
@ -1916,7 +1916,7 @@ int rtw_halmac_get_bcn_ctrl(struct dvobj_priv *d, enum _hw_port hwport,
halmac = dvobj_to_halmac(d); halmac = dvobj_to_halmac(d);
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
port = _hw_port_drv2halmac(hwport); port = _hw_port_drv2halmac(hwport);
_rtw_memset(&ctrl, 0, sizeof(ctrl)); memset(&ctrl, 0, sizeof(ctrl));
status = api->halmac_rw_bcn_ctrl(halmac, port, 0, &ctrl); status = api->halmac_rw_bcn_ctrl(halmac, port, 0, &ctrl);
if (status != HALMAC_RET_SUCCESS) if (status != HALMAC_RET_SUCCESS)
@ -2019,7 +2019,7 @@ int rtw_halmac_set_mac_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *a
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
port = _hw_port_drv2halmac(hwport); port = _hw_port_drv2halmac(hwport);
_rtw_memset(&hwa, 0, sizeof(hwa)); memset(&hwa, 0, sizeof(hwa));
_rtw_memcpy(hwa.addr, addr, 6); _rtw_memcpy(hwa.addr, addr, 6);
status = api->halmac_cfg_mac_addr(halmac, port, &hwa); status = api->halmac_cfg_mac_addr(halmac, port, &hwa);
@ -2055,7 +2055,7 @@ int rtw_halmac_set_bssid(struct dvobj_priv *d, enum _hw_port hwport, u8 *addr)
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
port = _hw_port_drv2halmac(hwport); port = _hw_port_drv2halmac(hwport);
_rtw_memset(&hwa, 0, sizeof(hwa)); memset(&hwa, 0, sizeof(hwa));
_rtw_memcpy(hwa.addr, addr, 6); _rtw_memcpy(hwa.addr, addr, 6);
status = api->halmac_cfg_bssid(halmac, port, &hwa); status = api->halmac_cfg_bssid(halmac, port, &hwa);
if (status != HALMAC_RET_SUCCESS) if (status != HALMAC_RET_SUCCESS)
@ -2089,7 +2089,7 @@ int rtw_halmac_set_tx_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *ad
halmac = dvobj_to_halmac(d); halmac = dvobj_to_halmac(d);
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
port = _hw_port_drv2halmac(hwport); port = _hw_port_drv2halmac(hwport);
_rtw_memset(&hwa, 0, sizeof(hwa)); memset(&hwa, 0, sizeof(hwa));
_rtw_memcpy(hwa.addr, addr, 6); _rtw_memcpy(hwa.addr, addr, 6);
status = api->halmac_cfg_transmitter_addr(halmac, port, &hwa); status = api->halmac_cfg_transmitter_addr(halmac, port, &hwa);
@ -2224,7 +2224,7 @@ int rtw_halmac_set_bcn_ctrl(struct dvobj_priv *d, enum _hw_port hwport,
halmac = dvobj_to_halmac(d); halmac = dvobj_to_halmac(d);
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
port = _hw_port_drv2halmac(hwport); port = _hw_port_drv2halmac(hwport);
_rtw_memset(&ctrl, 0, sizeof(ctrl)); memset(&ctrl, 0, sizeof(ctrl));
_beacon_ctrl_drv2halmac(bcn_ctrl, &ctrl); _beacon_ctrl_drv2halmac(bcn_ctrl, &ctrl);
status = api->halmac_rw_bcn_ctrl(halmac, port, 1, &ctrl); status = api->halmac_rw_bcn_ctrl(halmac, port, 1, &ctrl);
@ -2947,7 +2947,7 @@ static int _send_general_info(struct dvobj_priv *d)
return -1; return -1;
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
_rtw_memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
info.rfe_type = (u8)hal->rfe_type; info.rfe_type = (u8)hal->rfe_type;
rtw_hal_get_rf_path(d, &rf, &txpath, &rxpath); rtw_hal_get_rf_path(d, &rf, &txpath, &rxpath);
info.rf_type = _rf_type_drv2halmac(rf); info.rf_type = _rf_type_drv2halmac(rf);
@ -3088,7 +3088,7 @@ static void _debug_dlfw_fail(struct dvobj_priv *d)
} }
/* read 0x80 after 10 secs */ /* read 0x80 after 10 secs */
rtw_msleep_os(10000); msleep(10000);
addr = 0x80; addr = 0x80;
v32 = rtw_read16(a, addr); v32 = rtw_read16(a, addr);
RTW_PRINT("%s: 0x%X = 0x%04x (after 10 secs)\n", RTW_PRINT("%s: 0x%X = 0x%04x (after 10 secs)\n",
@ -3178,7 +3178,7 @@ static int _cpu_sleep(struct dvobj_priv *d, u32 timeout)
break; break;
} }
rtw_msleep_os(1); msleep(1);
} while (1); } while (1);
exit: exit:
@ -3668,7 +3668,7 @@ int rtw_halmac_txfifo_wait_empty(struct dvobj_priv *d, u32 timeout)
break; break;
} }
rtw_msleep_os(2); msleep(2);
} while (1); } while (1);
if (empty == _FALSE) { if (empty == _FALSE) {
@ -3919,7 +3919,7 @@ static u8 _is_fw_read_cmd_down(PADAPTER adapter, u8 msgbox_num)
if (0 == valid) if (0 == valid)
read_down = _TRUE; read_down = _TRUE;
else else
rtw_msleep_os(1); msleep(1);
} while ((!read_down) && (retry_cnts--)); } while ((!read_down) && (retry_cnts--));
if (_FALSE == read_down) if (_FALSE == read_down)
@ -4414,7 +4414,7 @@ int rtw_halmac_dump_fifo(struct dvobj_priv *d, u8 fifo_sel, u32 addr, u32 size,
_exit: _exit:
if ((mem_created == _TRUE) && pfifo_map) if ((mem_created == _TRUE) && pfifo_map)
rtw_vmfree(pfifo_map, fifo_size); vfree(pfifo_map);
return ret; return ret;
} }
@ -4455,7 +4455,7 @@ int rtw_halmac_rx_agg_switch(struct dvobj_priv *d, u8 enable)
hal = GET_HAL_DATA(adapter); hal = GET_HAL_DATA(adapter);
halmac = dvobj_to_halmac(d); halmac = dvobj_to_halmac(d);
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
_rtw_memset((void *)&rxaggcfg, 0, sizeof(rxaggcfg)); memset((void *)&rxaggcfg, 0, sizeof(rxaggcfg));
rxaggcfg.mode = HALMAC_RX_AGG_MODE_NONE; rxaggcfg.mode = HALMAC_RX_AGG_MODE_NONE;
/* /*
* Always enable size limit to avoid rx size exceed * Always enable size limit to avoid rx size exceed
@ -4631,7 +4631,7 @@ int rtw_halmac_iqk(struct dvobj_priv *d, u8 clear, u8 segment)
if (!retry) if (!retry)
break; break;
retry--; retry--;
rtw_msleep_os(delay); msleep(delay);
} while (1); } while (1);
if (status != HALMAC_RET_SUCCESS) { if (status != HALMAC_RET_SUCCESS) {
free_halmac_event(d, id); free_halmac_event(d, id);
@ -4658,7 +4658,7 @@ static int _phy_parameter_drv2halmac(struct rtw_phy_parameter *para, struct halm
if (!para || !info) if (!para || !info)
return -1; return -1;
_rtw_memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
switch (para->cmd) { switch (para->cmd) {
case 0: case 0:
@ -5012,9 +5012,9 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
nlo?"PNO/NLO":"Normal"); nlo?"PNO/NLO":"Normal");
if (enable) { if (enable) {
_rtw_memset(probereq, 0, sizeof(probereq)); memset(probereq, 0, sizeof(probereq));
_rtw_memset(&pnossid, 0, sizeof(pnossid)); memset(&pnossid, 0, sizeof(pnossid));
if (ssid) { if (ssid) {
if (ssid_len > sizeof(pnossid.SSID)) { if (ssid_len > sizeof(pnossid.SSID)) {
RTW_ERR("%s: SSID length(%d) is too long(>%d)!!\n", RTW_ERR("%s: SSID length(%d) is too long(>%d)!!\n",
@ -5054,7 +5054,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
api->halmac_clear_ch_info(mac); api->halmac_clear_ch_info(mac);
for (i = 0; i < rfctl->max_chan_nums && ch_set[i].ChannelNum != 0; i++) { for (i = 0; i < rfctl->max_chan_nums && ch_set[i].ChannelNum != 0; i++) {
_rtw_memset(&ch_info, 0, sizeof(ch_info)); memset(&ch_info, 0, sizeof(ch_info));
ch_info.extra_info = 0; ch_info.extra_info = 0;
ch_info.channel = ch_set[i].ChannelNum; ch_info.channel = ch_set[i].ChannelNum;
ch_info.bw = HALMAC_BW_20; ch_info.bw = HALMAC_BW_20;
@ -5070,7 +5070,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
} }
/* set channel switch option */ /* set channel switch option */
_rtw_memset(&cs_option, 0, sizeof(cs_option)); memset(&cs_option, 0, sizeof(cs_option));
cs_option.dest_bw = HALMAC_BW_20; cs_option.dest_bw = HALMAC_BW_20;
cs_option.periodic_option = HALMAC_CS_PERIODIC_2_PHASE; cs_option.periodic_option = HALMAC_CS_PERIODIC_2_PHASE;
cs_option.dest_pri_ch_idx = HALMAC_CH_IDX_UNDEFINE; cs_option.dest_pri_ch_idx = HALMAC_CH_IDX_UNDEFINE;
@ -5114,7 +5114,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
} else { } else {
api->halmac_clear_ch_info(mac); api->halmac_clear_ch_info(mac);
_rtw_memset(&cs_option, 0, sizeof(cs_option)); memset(&cs_option, 0, sizeof(cs_option));
cs_option.switch_en = 0; cs_option.switch_en = 0;
if (!nlo) { if (!nlo) {
@ -5189,8 +5189,8 @@ int rtw_halmac_query_tx_page_num(struct dvobj_priv *d)
hmpriv = &d->hmpriv; hmpriv = &d->hmpriv;
halmac = dvobj_to_halmac(d); halmac = dvobj_to_halmac(d);
api = HALMAC_GET_API(halmac); api = HALMAC_GET_API(halmac);
_rtw_memset((void *)&rqpn, 0, sizeof(rqpn)); memset((void *)&rqpn, 0, sizeof(rqpn));
_rtw_memset((void *)&fifosize, 0, sizeof(fifosize)); memset((void *)&fifosize, 0, sizeof(fifosize));
status = api->halmac_get_hw_value(halmac, HALMAC_HW_RQPN_MAPPING, &rqpn); status = api->halmac_get_hw_value(halmac, HALMAC_HW_RQPN_MAPPING, &rqpn);
if (status != HALMAC_RET_SUCCESS) if (status != HALMAC_RET_SUCCESS)
@ -5428,7 +5428,7 @@ int rtw_halmac_bf_add_mu_bfer(struct dvobj_priv *d, u16 paid, u16 csi_para,
mac = dvobj_to_halmac(d); mac = dvobj_to_halmac(d);
api = HALMAC_GET_API(mac); api = HALMAC_GET_API(mac);
_rtw_memset(&param, 0, sizeof(param)); memset(&param, 0, sizeof(param));
param.paid = paid; param.paid = paid;
param.csi_para = csi_para; param.csi_para = csi_para;
param.my_aid = my_aid; param.my_aid = my_aid;
@ -5529,7 +5529,7 @@ int rtw_halmac_bf_cfg_mu_mimo(struct dvobj_priv *d, enum halmac_snd_role role,
mac = dvobj_to_halmac(d); mac = dvobj_to_halmac(d);
api = HALMAC_GET_API(mac); api = HALMAC_GET_API(mac);
_rtw_memset(&param, 0, sizeof(param)); memset(&param, 0, sizeof(param));
param.role = role; param.role = role;
param.grouping_bitmap = grouping_bitmap; param.grouping_bitmap = grouping_bitmap;

View File

@ -533,7 +533,7 @@ int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
void usb_set_intf_ops(_adapter *padapter, struct _io_ops *pops) void usb_set_intf_ops(_adapter *padapter, struct _io_ops *pops)
{ {
_rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops)); memset((u8 *)pops, 0, sizeof(struct _io_ops));
pops->_read8 = &usb_read8; pops->_read8 = &usb_read8;
pops->_read16 = &usb_read16; pops->_read16 = &usb_read16;

View File

@ -164,7 +164,7 @@ void rtw_hal_data_deinit(_adapter *padapter)
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
phy_free_filebuf(padapter); phy_free_filebuf(padapter);
#endif #endif
rtw_vmfree(padapter->HalData, padapter->hal_data_sz); vfree(padapter->HalData);
padapter->HalData = NULL; padapter->HalData = NULL;
padapter->hal_data_sz = 0; padapter->hal_data_sz = 0;
} }
@ -195,7 +195,6 @@ void rtw_hal_dm_deinit(_adapter *padapter)
padapter->hal_func.dm_deinit(padapter); padapter->hal_func.dm_deinit(padapter);
_rtw_spinlock_free(&pHalData->IQKSpinLock);
} }
} }
@ -250,7 +249,7 @@ void rtw_hal_power_off(_adapter *padapter)
{ {
struct macid_ctl_t *macid_ctl = &padapter->dvobj->macid_ctl; struct macid_ctl_t *macid_ctl = &padapter->dvobj->macid_ctl;
_rtw_memset(macid_ctl->h2c_msr, 0, MACID_NUM_SW_LIMIT); memset(macid_ctl->h2c_msr, 0, MACID_NUM_SW_LIMIT);
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
rtw_btcoex_PowerOffSetting(padapter); rtw_btcoex_PowerOffSetting(padapter);

View File

@ -753,11 +753,11 @@ static u8 rtw_hal_mcc_update_timing_parameters(PADAPTER padapter, u8 force_updat
/* selecet policy table according TSF diff */ /* selecet policy table according TSF diff */
tsf0 = tsf[0]; tsf0 = tsf[0];
beaconperiod_0 = pmccobjpriv->iface[0]->mlmepriv.cur_network.network.Configuration.BeaconPeriod; beaconperiod_0 = pmccobjpriv->iface[0]->mlmepriv.cur_network.network.Configuration.BeaconPeriod;
tsf0 = rtw_modular64(tsf0, (beaconperiod_0 * TU)); tsf0 = do_div(tsf0, (beaconperiod_0 * TU));
tsf1 = tsf[1]; tsf1 = tsf[1];
beaconperiod_1 = pmccobjpriv->iface[1]->mlmepriv.cur_network.network.Configuration.BeaconPeriod; beaconperiod_1 = pmccobjpriv->iface[1]->mlmepriv.cur_network.network.Configuration.BeaconPeriod;
tsf1 = rtw_modular64(tsf1, (beaconperiod_1 * TU)); tsf1 = do_div(tsf1, (beaconperiod_1 * TU));
if (tsf0 > tsf1) if (tsf0 > tsf1)
tsfdiff = tsf0- tsf1; tsfdiff = tsf0- tsf1;
@ -1174,7 +1174,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
rtw_hal_mcc_upadate_chnl_bw(iface, ch, bw_offset, bw, _TRUE); rtw_hal_mcc_upadate_chnl_bw(iface, ch, bw_offset, bw, _TRUE);
start = &pframe[*index - tx_desc]; start = &pframe[*index - tx_desc];
_rtw_memset(start, 0, page_size); memset(start, 0, page_size);
pmccobjpriv->mcc_pwr_idx_rsvd_page[i] = *total_page_num; pmccobjpriv->mcc_pwr_idx_rsvd_page[i] = *total_page_num;
RTW_INFO(ADPT_FMT" order:%d, pwr_idx_rsvd_page location[%d]: %d\n", RTW_INFO(ADPT_FMT" order:%d, pwr_idx_rsvd_page location[%d]: %d\n",
ADPT_ARG(iface), mccadapriv->order, ADPT_ARG(iface), mccadapriv->order,
@ -1609,7 +1609,7 @@ static void rtw_hal_set_mcc_IQK_offload_cmd(PADAPTER padapter)
for (rf_path_idx = 0; rf_path_idx < total_rf_path; rf_path_idx ++) { for (rf_path_idx = 0; rf_path_idx < total_rf_path; rf_path_idx ++) {
_rtw_memset(cmd, 0, H2C_MCC_IQK_PARAM_LEN); memset(cmd, 0, H2C_MCC_IQK_PARAM_LEN);
TX_X = pmccadapriv->mcc_iqk_arr[rf_path_idx].TX_X & 0x7ff;/* [10:0] */ TX_X = pmccadapriv->mcc_iqk_arr[rf_path_idx].TX_X & 0x7ff;/* [10:0] */
TX_Y = pmccadapriv->mcc_iqk_arr[rf_path_idx].TX_Y & 0x7ff;/* [10:0] */ TX_Y = pmccadapriv->mcc_iqk_arr[rf_path_idx].TX_Y & 0x7ff;/* [10:0] */
RX_X = pmccadapriv->mcc_iqk_arr[rf_path_idx].RX_X & 0x3ff;/* [9:0] */ RX_X = pmccadapriv->mcc_iqk_arr[rf_path_idx].RX_X & 0x3ff;/* [9:0] */

View File

@ -1631,12 +1631,12 @@ void hal_mpt_GetThermalMeter(PADAPTER pAdapter, u8 *value)
{ {
#if 0 #if 0
fw_cmd(pAdapter, IOCMD_GET_THERMAL_METER); fw_cmd(pAdapter, IOCMD_GET_THERMAL_METER);
rtw_msleep_os(1000); msleep(1000);
fw_cmd_data(pAdapter, value, 1); fw_cmd_data(pAdapter, value, 1);
*value &= 0xFF; *value &= 0xFF;
#else #else
hal_mpt_TriggerRFThermalMeter(pAdapter); hal_mpt_TriggerRFThermalMeter(pAdapter);
rtw_msleep_os(1000); msleep(1000);
*value = hal_mpt_ReadRFThermalMeter(pAdapter); *value = hal_mpt_ReadRFThermalMeter(pAdapter);
#endif #endif
@ -1680,7 +1680,7 @@ void hal_mpt_SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart)
#endif /* CONFIG_RTL8812A || CONFIG_RTL8821A || CONFIG_RTL8814A || CONFIG_RTL8822B || CONFIG_RTL8821C */ #endif /* CONFIG_RTL8812A || CONFIG_RTL8821A || CONFIG_RTL8814A || CONFIG_RTL8822B || CONFIG_RTL8821C */
phy_set_bb_reg(pAdapter, rOFDM1_LSTF, BIT30 | BIT29 | BIT28, OFDM_ALL_OFF); phy_set_bb_reg(pAdapter, rOFDM1_LSTF, BIT30 | BIT29 | BIT28, OFDM_ALL_OFF);
rtw_msleep_os(10); msleep(10);
/*/BB Reset*/ /*/BB Reset*/
phy_set_bb_reg(pAdapter, rPMAC_Reset, bBBResetB, 0x0); phy_set_bb_reg(pAdapter, rPMAC_Reset, bBBResetB, 0x0);
phy_set_bb_reg(pAdapter, rPMAC_Reset, bBBResetB, 0x1); phy_set_bb_reg(pAdapter, rPMAC_Reset, bBBResetB, 0x1);

View File

@ -389,12 +389,12 @@ void odm_free_memory(struct dm_struct *dm, void *ptr, u32 length)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
kfree(ptr); kfree(ptr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_vmfree(ptr, length); vfree(ptr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
/* struct void* adapter = dm->adapter; */ /* struct void* adapter = dm->adapter; */
PlatformFreeMemory(ptr, length); PlatformFreeMemory(ptr, length);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
rtw_vmfree(ptr, length); vfree(ptr);
#endif #endif
} }
@ -424,7 +424,7 @@ void odm_memory_set(struct dm_struct *dm, void *pbuf, s8 value, u32 length)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
memset(pbuf, value, length); memset(pbuf, value, length);
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
_rtw_memset(pbuf, value, length); memset(pbuf, value, length);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
PlatformFillMemory(pbuf, length, value); PlatformFillMemory(pbuf, length, value);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
@ -632,11 +632,11 @@ void ODM_sleep_ms(u32 ms)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2)
msleep(ms); msleep(ms);
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_msleep_os(ms); msleep(ms);
#elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN)
delay_ms(ms); delay_ms(ms);
#elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT)
rtw_msleep_os(ms); msleep(ms);
#endif #endif
} }

View File

@ -1044,7 +1044,7 @@ send_fw_ht_ndpa_packet(
pattrib->order = 1; pattrib->order = 1;
pattrib->subtype = WIFI_ACTION_NOACK; pattrib->subtype = WIFI_ACTION_NOACK;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -1130,7 +1130,7 @@ send_sw_ht_ndpa_packet(
pattrib->order = 1; pattrib->order = 1;
pattrib->subtype = WIFI_ACTION_NOACK; pattrib->subtype = WIFI_ACTION_NOACK;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -1220,7 +1220,7 @@ send_fw_vht_ndpa_packet(
pattrib->bwmode = BW; pattrib->bwmode = BW;
pattrib->subtype = WIFI_NDPA; pattrib->subtype = WIFI_NDPA;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -1321,7 +1321,7 @@ send_sw_vht_ndpa_packet(
pattrib->bwmode = BW; pattrib->bwmode = BW;
pattrib->subtype = WIFI_NDPA; pattrib->subtype = WIFI_NDPA;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;

View File

@ -40,7 +40,7 @@ static u8 _is_fw_read_cmd_down(_adapter *padapter, u8 msgbox_num)
if (0 == valid) if (0 == valid)
read_down = _TRUE; read_down = _TRUE;
else else
rtw_msleep_os(1); msleep(1);
} while ((!read_down) && (retry_cnts--)); } while ((!read_down) && (retry_cnts--));
return read_down; return read_down;
@ -353,7 +353,7 @@ void rtl8192e_download_rsvd_page(PADAPTER padapter, u8 mstatus)
rtw_hal_set_fw_rsvd_page(padapter, _FALSE); rtw_hal_set_fw_rsvd_page(padapter, _FALSE);
DLBcnCount++; DLBcnCount++;
do { do {
rtw_yield_os(); yield();
/* rtw_mdelay_os(10); */ /* rtw_mdelay_os(10); */
/* check rsvd page download OK. */ /* check rsvd page download OK. */
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bcn_valid)); rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bcn_valid));
@ -441,7 +441,7 @@ void rtl8192e_set_p2p_ps_offload_cmd(_adapter *padapter, u8 p2p_ps_state)
switch (p2p_ps_state) { switch (p2p_ps_state) {
case P2P_PS_DISABLE: case P2P_PS_DISABLE:
RTW_INFO("P2P_PS_DISABLE\n"); RTW_INFO("P2P_PS_DISABLE\n");
_rtw_memset(p2p_ps_offload, 0, 1); memset(p2p_ps_offload, 0, 1);
break; break;
case P2P_PS_ENABLE: case P2P_PS_ENABLE:
RTW_INFO("P2P_PS_ENABLE\n"); RTW_INFO("P2P_PS_ENABLE\n");

View File

@ -326,6 +326,5 @@ void rtl8192e_deinit_dm_priv(IN PADAPTER Adapter)
{ {
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
struct dm_struct *podmpriv = &pHalData->odmpriv; struct dm_struct *podmpriv = &pHalData->odmpriv;
/* _rtw_spinlock_free(&pHalData->odm_stainfo_lock); */
odm_cancel_all_timers(podmpriv); odm_cancel_all_timers(podmpriv);
} }

View File

@ -395,7 +395,7 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms)
value32 = rtw_read32(adapter, REG_MCUFWDL); value32 = rtw_read32(adapter, REG_MCUFWDL);
if (value32 & FWDL_ChkSum_rpt || RTW_CANNOT_IO(adapter)) if (value32 & FWDL_ChkSum_rpt || RTW_CANNOT_IO(adapter))
break; break;
rtw_yield_os(); yield();
} while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt); } while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt);
if (!(value32 & FWDL_ChkSum_rpt)) if (!(value32 & FWDL_ChkSum_rpt))
@ -433,7 +433,7 @@ static s32 _FWFreeToGo8192E(_adapter *adapter, u32 min_cnt, u32 timeout_ms)
value32 = rtw_read32(adapter, REG_MCUFWDL); value32 = rtw_read32(adapter, REG_MCUFWDL);
if (value32 & WINTINI_RDY || RTW_CANNOT_IO(adapter)) if (value32 & WINTINI_RDY || RTW_CANNOT_IO(adapter))
break; break;
rtw_yield_os(); yield();
} while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt); } while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt);
if (!(value32 & WINTINI_RDY)) if (!(value32 & WINTINI_RDY))
@ -1178,7 +1178,7 @@ Hal_EfusePowerSwitch8192E(
if (bWrite == _TRUE) { if (bWrite == _TRUE) {
/* Enable LDO 2.5V before read/write action */ /* Enable LDO 2.5V before read/write action */
tempval = rtw_read8(pAdapter, EFUSE_TEST + 3); tempval = rtw_read8(pAdapter, EFUSE_TEST + 3);
tempval &= 0x07; /* 0x34[30:27] = 4¡¦1110 => LDOE25 voltage select to 2.25V Suggested by SD1 Jackie & DD -Tm_lin */ tempval &= 0x07; /* 0x34[30:27] = 4<EFBFBD><EFBFBD>1110 => LDOE25 voltage select to 2.25V Suggested by SD1 Jackie & DD -Tm_lin */
/* tempval |= (VOLTAGE_V25 << 4); */ /* tempval |= (VOLTAGE_V25 << 4); */
tempval |= 0x70; tempval |= 0x70;
rtw_write8(pAdapter, EFUSE_TEST + 3, (tempval | 0x80)); rtw_write8(pAdapter, EFUSE_TEST + 3, (tempval | 0x80));
@ -1219,7 +1219,7 @@ static bool efuse_read_phymap(
/* */ /* */
/* Refresh efuse init map as all 0xFF. */ /* Refresh efuse init map as all 0xFF. */
/* */ /* */
_rtw_memset(pbuf, 0xFF, limit); memset(pbuf, 0xFF, limit);
/* */ /* */
@ -1429,8 +1429,7 @@ exit:
if (efuseTbl) if (efuseTbl)
rtw_mfree(efuseTbl, EFUSE_MAP_LEN_8192E); rtw_mfree(efuseTbl, EFUSE_MAP_LEN_8192E);
if (eFuseWord) kfree(eFuseWord);
rtw_mfree2d((void *)eFuseWord, EFUSE_MAX_SECTION_8192E, EFUSE_MAX_WORD_UNIT, sizeof(u16));
} }
static VOID static VOID
@ -1639,7 +1638,7 @@ Hal_EfuseWordEnableDataWrite8192E(IN PADAPTER pAdapter,
u8 badworden = 0x0F; u8 badworden = 0x0F;
u8 tmpdata[8]; u8 tmpdata[8];
_rtw_memset((PVOID)tmpdata, 0xff, PGPKT_DATA_SIZE); memset((PVOID)tmpdata, 0xff, PGPKT_DATA_SIZE);
if (!(word_en & BIT0)) { if (!(word_en & BIT0)) {
tmpaddr = start_addr; tmpaddr = start_addr;
@ -1802,8 +1801,8 @@ hal_EfusePgPacketRead_8192E(
if (offset > EFUSE_MAX_SECTION_8192E) if (offset > EFUSE_MAX_SECTION_8192E)
return _FALSE; return _FALSE;
_rtw_memset((PVOID)data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE); memset((PVOID)data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
_rtw_memset((PVOID)tmpdata, 0xff, sizeof(u8) * PGPKT_DATA_SIZE); memset((PVOID)tmpdata, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
/* */ /* */
@ -1937,7 +1936,7 @@ hal_EfusePgPacketWrite_8192E(IN PADAPTER pAdapter,
/* RTW_INFO("hal_EfusePgPacketWrite_8812A target offset 0x%x word_en 0x%x\n", target_pkt.offset, target_pkt.word_en); */ /* RTW_INFO("hal_EfusePgPacketWrite_8812A target offset 0x%x word_en 0x%x\n", target_pkt.offset, target_pkt.word_en); */
_rtw_memset((PVOID)target_pkt.data, 0xFF, sizeof(u8) * 8); memset((PVOID)target_pkt.data, 0xFF, sizeof(u8) * 8);
efuse_WordEnableDataRead(word_en, data, target_pkt.data); efuse_WordEnableDataRead(word_en, data, target_pkt.data);
target_word_cnts = Efuse_CalculateWordCnts(target_pkt.word_en); target_word_cnts = Efuse_CalculateWordCnts(target_pkt.word_en);
@ -2180,7 +2179,7 @@ hal_EfusePgPacketWrite_8192E(IN PADAPTER pAdapter,
} }
/* ************ s1-2-A :cover the exist data ******************* */ /* ************ s1-2-A :cover the exist data ******************* */
_rtw_memset(originaldata, 0xff, sizeof(u8) * 8); memset(originaldata, 0xff, sizeof(u8) * 8);
if (Efuse_PgPacketRead(pAdapter, tmp_pkt.offset, originaldata, bPseudoTest)) { if (Efuse_PgPacketRead(pAdapter, tmp_pkt.offset, originaldata, bPseudoTest)) {
/* check if data exist */ /* check if data exist */
@ -2282,7 +2281,7 @@ efuse_PgPacketConstruct(
IN OUT PPGPKT_STRUCT pTargetPkt IN OUT PPGPKT_STRUCT pTargetPkt
) )
{ {
_rtw_memset((PVOID)pTargetPkt->data, 0xFF, sizeof(u8) * 8); memset((PVOID)pTargetPkt->data, 0xFF, sizeof(u8) * 8);
pTargetPkt->offset = offset; pTargetPkt->offset = offset;
pTargetPkt->word_en = word_en; pTargetPkt->word_en = word_en;
efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data); efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data);
@ -2586,7 +2585,7 @@ hal_EfuseFixHeaderProcess(
u16 efuse_addr = *pAddr; u16 efuse_addr = *pAddr;
u32 PgWriteSuccess = 0; u32 PgWriteSuccess = 0;
_rtw_memset((PVOID)originaldata, 0xff, 8); memset((PVOID)originaldata, 0xff, 8);
if (Efuse_PgPacketRead(pAdapter, pFixPkt->offset, originaldata, bPseudoTest)) { if (Efuse_PgPacketRead(pAdapter, pFixPkt->offset, originaldata, bPseudoTest)) {
/* check if data exist */ /* check if data exist */
@ -4048,7 +4047,7 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val)
i++; i++;
/* wait MAC to flush out reserve pages */ /* wait MAC to flush out reserve pages */
rtw_msleep_os(10); msleep(10);
} }
pass_ms = rtw_get_passing_time_ms(start); pass_ms = rtw_get_passing_time_ms(start);
@ -4424,7 +4423,7 @@ void hal_ra_info_dump(_adapter *padapter , void *sel)
_RTW_PRINT_SEL(sel , "============ RA status check Mac_id:%d ===================\n", mac_id); _RTW_PRINT_SEL(sel , "============ RA status check Mac_id:%d ===================\n", mac_id);
cmd = 0x40000100 | mac_id; cmd = 0x40000100 | mac_id;
rtw_write32(padapter, REG_HMEBOX_E2_E3_8192E, cmd); rtw_write32(padapter, REG_HMEBOX_E2_E3_8192E, cmd);
rtw_msleep_os(10); msleep(10);
ra_info1 = rtw_read32(padapter, REG_RSVD5_8192E); ra_info1 = rtw_read32(padapter, REG_RSVD5_8192E);
curr_tx_sgi = rtw_get_current_tx_sgi(padapter, macid_ctl->sta[mac_id]); curr_tx_sgi = rtw_get_current_tx_sgi(padapter, macid_ctl->sta[mac_id]);
curr_tx_rate = rtw_get_current_tx_rate(padapter, macid_ctl->sta[mac_id]); curr_tx_rate = rtw_get_current_tx_rate(padapter, macid_ctl->sta[mac_id]);
@ -4434,7 +4433,7 @@ void hal_ra_info_dump(_adapter *padapter , void *sel)
cmd = 0x40000400 | mac_id; cmd = 0x40000400 | mac_id;
rtw_write32(padapter, REG_HMEBOX_E2_E3_8192E, cmd); rtw_write32(padapter, REG_HMEBOX_E2_E3_8192E, cmd);
rtw_msleep_os(10); msleep(10);
ra_info1 = rtw_read32(padapter, REG_RSVD5_8192E); ra_info1 = rtw_read32(padapter, REG_RSVD5_8192E);
ra_info2 = rtw_read32(padapter, REG_RSVD6_8192E); ra_info2 = rtw_read32(padapter, REG_RSVD6_8192E);
rate_mask1 = rtw_read32(padapter, REG_RSVD7_8192E); rate_mask1 = rtw_read32(padapter, REG_RSVD7_8192E);
@ -4762,9 +4761,9 @@ void rtl8192e_init_default_value(_adapter *padapter)
#endif #endif
pHalData->EfuseHal.fakeEfuseBank = 0; pHalData->EfuseHal.fakeEfuseBank = 0;
pHalData->EfuseHal.fakeEfuseUsedBytes = 0; pHalData->EfuseHal.fakeEfuseUsedBytes = 0;
_rtw_memset(pHalData->EfuseHal.fakeEfuseContent, 0xFF, EFUSE_MAX_HW_SIZE); memset(pHalData->EfuseHal.fakeEfuseContent, 0xFF, EFUSE_MAX_HW_SIZE);
_rtw_memset(pHalData->EfuseHal.fakeEfuseInitMap, 0xFF, EFUSE_MAX_MAP_LEN); memset(pHalData->EfuseHal.fakeEfuseInitMap, 0xFF, EFUSE_MAX_MAP_LEN);
_rtw_memset(pHalData->EfuseHal.fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN); memset(pHalData->EfuseHal.fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN);
} }
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST

View File

@ -930,7 +930,7 @@ phy_SpurCalibration_8192E(
phy_set_bb_reg(Adapter, rFPGA0_TxInfo, bMaskByte0, 0x3); phy_set_bb_reg(Adapter, rFPGA0_TxInfo, bMaskByte0, 0x3);
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd);
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd);
/* rtw_msleep_os(30); */ /* msleep(30); */
rtw_mdelay_os(30); rtw_mdelay_os(30);
PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord); PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord);
/* RTW_INFO(" Path A== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */ /* RTW_INFO(" Path A== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */
@ -945,7 +945,7 @@ phy_SpurCalibration_8192E(
phy_set_bb_reg(Adapter, rFPGA0_TxInfo, bMaskByte0, 0x13); phy_set_bb_reg(Adapter, rFPGA0_TxInfo, bMaskByte0, 0x13);
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd);
phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd);
/* rtw_msleep_os(30); */ /* msleep(30); */
rtw_mdelay_os(30); rtw_mdelay_os(30);
PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord); PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord);
/* RTW_INFO(" Path B== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */ /* RTW_INFO(" Path B== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */
@ -1114,7 +1114,7 @@ phy_SwChnlAndSetBwMode8192E(
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
/* It takes too much time of setting tx power, influence channel switch */ /* It takes too much time of setting tx power, influence channel switch */
if ((ATOMIC_READ(&Adapter->tdlsinfo.chsw_info.chsw_on) == _FALSE)) if ((atomic_read(&Adapter->tdlsinfo.chsw_info.chsw_on) == _FALSE))
#endif #endif
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
PHY_SetTxPowerLevel8192E(Adapter, pHalData->current_channel); PHY_SetTxPowerLevel8192E(Adapter, pHalData->current_channel);

View File

@ -21,7 +21,7 @@ void rtl8192e_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc)
{ {
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib)); memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
/* Offset 0 */ /* Offset 0 */
pattrib->pkt_len = (u16)GET_RX_STATUS_DESC_PKT_LEN_92E(pdesc);/* (le32_to_cpu(pdesc->rxdw0)&0x00003fff) */ pattrib->pkt_len = (u16)GET_RX_STATUS_DESC_PKT_LEN_92E(pdesc);/* (le32_to_cpu(pdesc->rxdw0)&0x00003fff) */

View File

@ -104,7 +104,7 @@ InsertEMContent_8192E(
u4Byte dwtmp = 0; u4Byte dwtmp = 0;
#endif #endif
_rtw_memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE); memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE);
if (pEMInfo->EMPktNum == 0) if (pEMInfo->EMPktNum == 0)
return; return;
@ -210,7 +210,7 @@ void UpdateEarlyModeInfo8192E(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmi
offset = pxmitpriv->agg_pkt[index].offset; offset = pxmitpriv->agg_pkt[index].offset;
pktlen = pxmitpriv->agg_pkt[index].pkt_len; pktlen = pxmitpriv->agg_pkt[index].pkt_len;
_rtw_memset(&eminfo, 0, sizeof(struct EMInfo)); memset(&eminfo, 0, sizeof(struct EMInfo));
if (pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) { if (pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) {
if (node_num_0 > EARLY_MODE_MAX_PKT_NUM) { if (node_num_0 > EARLY_MODE_MAX_PKT_NUM) {
eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM; eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM;
@ -243,7 +243,7 @@ void UpdateEarlyModeInfo8192E(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmi
} }
_rtw_memset(pxmitpriv->agg_pkt, 0, sizeof(struct agg_pkt_info) * MAX_AGG_PKT_NUM); memset(pxmitpriv->agg_pkt, 0, sizeof(struct agg_pkt_info) * MAX_AGG_PKT_NUM);
} }
#endif #endif
@ -476,7 +476,7 @@ void rtl8192e_fill_fake_txdesc(
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
/* Clear all status */ /* Clear all status */
_rtw_memset(pDesc, 0, TXDESC_SIZE); memset(pDesc, 0, TXDESC_SIZE);
SET_TX_DESC_OFFSET_92E(pDesc, (TXDESC_SIZE + OFFSET_SZ)); SET_TX_DESC_OFFSET_92E(pDesc, (TXDESC_SIZE + OFFSET_SZ));

View File

@ -71,7 +71,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba
} }
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_TX */ #endif /* CONFIG_USE_USB_BUFFER_ALLOC_TX */
_rtw_memset(ptxdesc, 0, TXDESC_SIZE); memset(ptxdesc, 0, TXDESC_SIZE);
/* 4 offset 0 */ /* 4 offset 0 */
@ -955,7 +955,7 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
/* ----- fill tx desc ----- */ /* ----- fill tx desc ----- */
ptxdesc = (struct tx_desc *)pxmitbuf; ptxdesc = (struct tx_desc *)pxmitbuf;
_rtw_memset(ptxdesc, 0, sizeof(*ptxdesc)); memset(ptxdesc, 0, sizeof(*ptxdesc));
/* offset 0 */ /* offset 0 */
ptxdesc->txdw0 |= cpu_to_le32(len & 0x0000ffff); ptxdesc->txdw0 |= cpu_to_le32(len & 0x0000ffff);

View File

@ -52,7 +52,7 @@ void interrupt_handler_8192eu(_adapter *padapter, u16 pkt_len, u8 *pbuf)
struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info;
u32 last_time = pchsw_info->cur_time; u32 last_time = pchsw_info->cur_time;
pchsw_info->cur_time = rtw_systime_to_ms(rtw_get_current_time()); pchsw_info->cur_time = rtw_systime_to_ms(rtw_get_current_time());
if ((ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) && if ((atomic_read(&pchsw_info->chsw_on) == _TRUE) &&
/* Sometimes we receive multiple interrupts in very little time period, use the follow condition test to filter */ /* Sometimes we receive multiple interrupts in very little time period, use the follow condition test to filter */
(pchsw_info->cur_time - last_time > padapter->mlmeextpriv.mlmext_info.bcn_interval - 5) && (pchsw_info->cur_time - last_time > padapter->mlmeextpriv.mlmext_info.bcn_interval - 5) &&
(padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter))) { (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter))) {

View File

@ -42,19 +42,6 @@
#include <drv_types_ce.h> #include <drv_types_ce.h>
#endif #endif
#ifdef PLATFORM_LINUX
#include <drv_types_linux.h>
#endif
enum _NIC_VERSION {
RTL8711_NIC,
RTL8712_NIC,
RTL8713_NIC,
RTL8716_NIC
};
typedef struct _ADAPTER _adapter, ADAPTER, *PADAPTER; typedef struct _ADAPTER _adapter, ADAPTER, *PADAPTER;
#include <rtw_debug.h> #include <rtw_debug.h>
@ -955,7 +942,7 @@ struct rf_ctl_t {
struct mbid_cam_ctl_t { struct mbid_cam_ctl_t {
_lock lock; _lock lock;
u8 bitmap; u8 bitmap;
ATOMIC_T mbid_entry_num; atomic_t mbid_entry_num;
}; };
struct mbid_cam_cache { struct mbid_cam_cache {
u8 iface_id; u8 iface_id;
@ -1008,8 +995,8 @@ struct dvobj_priv {
u8 HardwareType; u8 HardwareType;
u8 interface_type;/*USB,SDIO,SPI,PCI*/ u8 interface_type;/*USB,SDIO,SPI,PCI*/
ATOMIC_T bSurpriseRemoved; atomic_t bSurpriseRemoved;
ATOMIC_T bDriverStopped; atomic_t bDriverStopped;
s32 processing_dev_remove; s32 processing_dev_remove;
@ -1089,9 +1076,9 @@ struct dvobj_priv {
u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */ u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
u8 irq_alloc; u8 irq_alloc;
ATOMIC_T continual_io_error; atomic_t continual_io_error;
ATOMIC_T disable_func; atomic_t disable_func;
u8 xmit_block; u8 xmit_block;
_lock xmit_block_lock; _lock xmit_block_lock;
@ -1261,7 +1248,6 @@ struct dvobj_priv {
#endif #endif
/* also for RTK T/P Testing Mode */ /* also for RTK T/P Testing Mode */
u8 scan_deny; u8 scan_deny;
}; };
#define DEV_STA_NUM(_dvobj) MSTATE_STA_NUM(&((_dvobj)->iface_state)) #define DEV_STA_NUM(_dvobj) MSTATE_STA_NUM(&((_dvobj)->iface_state))
@ -1299,22 +1285,22 @@ struct dvobj_priv {
static inline void dev_set_surprise_removed(struct dvobj_priv *dvobj) static inline void dev_set_surprise_removed(struct dvobj_priv *dvobj)
{ {
ATOMIC_SET(&dvobj->bSurpriseRemoved, _TRUE); atomic_set(&dvobj->bSurpriseRemoved, _TRUE);
} }
static inline void dev_clr_surprise_removed(struct dvobj_priv *dvobj) static inline void dev_clr_surprise_removed(struct dvobj_priv *dvobj)
{ {
ATOMIC_SET(&dvobj->bSurpriseRemoved, _FALSE); atomic_set(&dvobj->bSurpriseRemoved, _FALSE);
} }
static inline void dev_set_drv_stopped(struct dvobj_priv *dvobj) static inline void dev_set_drv_stopped(struct dvobj_priv *dvobj)
{ {
ATOMIC_SET(&dvobj->bDriverStopped, _TRUE); atomic_set(&dvobj->bDriverStopped, _TRUE);
} }
static inline void dev_clr_drv_stopped(struct dvobj_priv *dvobj) static inline void dev_clr_drv_stopped(struct dvobj_priv *dvobj)
{ {
ATOMIC_SET(&dvobj->bDriverStopped, _FALSE); atomic_set(&dvobj->bDriverStopped, _FALSE);
} }
#define dev_is_surprise_removed(dvobj) (ATOMIC_READ(&dvobj->bSurpriseRemoved) == _TRUE) #define dev_is_surprise_removed(dvobj) (atomic_read(&dvobj->bSurpriseRemoved) == _TRUE)
#define dev_is_drv_stopped(dvobj) (ATOMIC_READ(&dvobj->bDriverStopped) == _TRUE) #define dev_is_drv_stopped(dvobj) (atomic_read(&dvobj->bDriverStopped) == _TRUE)
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj) static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
@ -1461,7 +1447,7 @@ struct _ADAPTER {
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
u32 setband; u32 setband;
ATOMIC_T bandskip; atomic_t bandskip;
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
struct wifidirect_info wdinfo; struct wifidirect_info wdinfo;
@ -1754,27 +1740,27 @@ static inline void rtw_clr_drv_stopped(_adapter *padapter)
#define DF_RX_BIT BIT1 /*read_port_cancel*/ #define DF_RX_BIT BIT1 /*read_port_cancel*/
#define DF_IO_BIT BIT2 #define DF_IO_BIT BIT2
/* #define RTW_DISABLE_FUNC(padapter, func) (ATOMIC_ADD(&adapter_to_dvobj(padapter)->disable_func, (func))) */ /* #define RTW_DISABLE_FUNC(padapter, func) (atomic_add(&adapter_to_dvobj(padapter)->disable_func, (func))) */
/* #define RTW_ENABLE_FUNC(padapter, func) (ATOMIC_SUB(&adapter_to_dvobj(padapter)->disable_func, (func))) */ /* #define RTW_ENABLE_FUNC(padapter, func) (atomic_sub(&adapter_to_dvobj(padapter)->disable_func, (func))) */
__inline static void RTW_DISABLE_FUNC(_adapter *padapter, int func_bit) __inline static void RTW_DISABLE_FUNC(_adapter *padapter, int func_bit)
{ {
int df = ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func); int df = atomic_read(&adapter_to_dvobj(padapter)->disable_func);
df |= func_bit; df |= func_bit;
ATOMIC_SET(&adapter_to_dvobj(padapter)->disable_func, df); atomic_set(&adapter_to_dvobj(padapter)->disable_func, df);
} }
__inline static void RTW_ENABLE_FUNC(_adapter *padapter, int func_bit) __inline static void RTW_ENABLE_FUNC(_adapter *padapter, int func_bit)
{ {
int df = ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func); int df = atomic_read(&adapter_to_dvobj(padapter)->disable_func);
df &= ~(func_bit); df &= ~(func_bit);
ATOMIC_SET(&adapter_to_dvobj(padapter)->disable_func, df); atomic_set(&adapter_to_dvobj(padapter)->disable_func, df);
} }
#define RTW_CANNOT_RUN(padapter) \ #define RTW_CANNOT_RUN(padapter) \
(rtw_is_surprise_removed(padapter) || \ (rtw_is_surprise_removed(padapter) || \
rtw_is_drv_stopped(padapter)) rtw_is_drv_stopped(padapter))
#define RTW_IS_FUNC_DISABLED(padapter, func_bit) (ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func) & (func_bit)) #define RTW_IS_FUNC_DISABLED(padapter, func_bit) (atomic_read(&adapter_to_dvobj(padapter)->disable_func) & (func_bit))
#define RTW_CANNOT_IO(padapter) \ #define RTW_CANNOT_IO(padapter) \
(rtw_is_surprise_removed(padapter) || \ (rtw_is_surprise_removed(padapter) || \

View File

@ -1,19 +0,0 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#ifndef __DRV_TYPES_LINUX_H__
#define __DRV_TYPES_LINUX_H__
#endif

View File

@ -1,41 +0,0 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#ifndef __NIC_SPEC_H__
#define __NIC_SPEC_H__
#include <drv_conf.h>
#define RTL8711_MCTRL_ (0x20000)
#define RTL8711_UART_ (0x30000)
#define RTL8711_TIMER_ (0x40000)
#define RTL8711_FINT_ (0x50000)
#define RTL8711_HINT_ (0x50000)
#define RTL8711_GPIO_ (0x60000)
#define RTL8711_WLANCTRL_ (0x200000)
#define RTL8711_WLANFF_ (0xe00000)
#define RTL8711_HCICTRL_ (0x600000)
#define RTL8711_SYSCFG_ (0x620000)
#define RTL8711_SYSCTRL_ (0x620000)
#define RTL8711_MCCTRL_ (0x020000)
#include <rtl8711_regdef.h>
#include <rtl8711_bitdef.h>
#endif /* __RTL8711_SPEC_H__ */

View File

@ -170,14 +170,12 @@ void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dm
#ifdef CONFIG_USE_VMALLOC #ifdef CONFIG_USE_VMALLOC
#define rtw_vmalloc(sz) dbg_rtw_vmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_vmalloc(sz) dbg_rtw_vmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
#define rtw_zvmalloc(sz) dbg_rtw_zvmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_zvmalloc(sz) dbg_rtw_zvmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
#define rtw_vmfree(pbuf, sz) dbg_rtw_vmfree((pbuf), (sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
#define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_vmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_vmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
#define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zvmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zvmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
#define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_vmfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_vmfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__)
#else /* CONFIG_USE_VMALLOC */ #else /* CONFIG_USE_VMALLOC */
#define rtw_vmalloc(sz) dbg_rtw_malloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_vmalloc(sz) dbg_rtw_malloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
#define rtw_zvmalloc(sz) dbg_rtw_zmalloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_zvmalloc(sz) dbg_rtw_zmalloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
#define rtw_vmfree(pbuf, sz) dbg_rtw_mfree((pbuf), (sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
#define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_malloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_malloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
#define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
#define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_mfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_mfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__)
@ -218,7 +216,6 @@ void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dm
#define match_mstat_sniff_rules(flags, size) _FALSE #define match_mstat_sniff_rules(flags, size) _FALSE
void *_rtw_vmalloc(u32 sz); void *_rtw_vmalloc(u32 sz);
void *_rtw_zvmalloc(u32 sz); void *_rtw_zvmalloc(u32 sz);
void _rtw_vmfree(void *pbuf, u32 sz);
void *_rtw_zmalloc(u32 sz); void *_rtw_zmalloc(u32 sz);
void *_rtw_malloc(u32 sz); void *_rtw_malloc(u32 sz);
void _rtw_mfree(void *pbuf, u32 sz); void _rtw_mfree(void *pbuf, u32 sz);
@ -244,14 +241,12 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a
#ifdef CONFIG_USE_VMALLOC #ifdef CONFIG_USE_VMALLOC
#define rtw_vmalloc(sz) _rtw_vmalloc((sz)) #define rtw_vmalloc(sz) _rtw_vmalloc((sz))
#define rtw_zvmalloc(sz) _rtw_zvmalloc((sz)) #define rtw_zvmalloc(sz) _rtw_zvmalloc((sz))
#define rtw_vmfree(pbuf, sz) _rtw_vmfree((pbuf), (sz))
#define rtw_vmalloc_f(sz, mstat_f) _rtw_vmalloc((sz)) #define rtw_vmalloc_f(sz, mstat_f) _rtw_vmalloc((sz))
#define rtw_zvmalloc_f(sz, mstat_f) _rtw_zvmalloc((sz)) #define rtw_zvmalloc_f(sz, mstat_f) _rtw_zvmalloc((sz))
#define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_vmfree((pbuf), (sz)) #define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_vmfree((pbuf), (sz))
#else /* CONFIG_USE_VMALLOC */ #else /* CONFIG_USE_VMALLOC */
#define rtw_vmalloc(sz) _rtw_malloc((sz)) #define rtw_vmalloc(sz) _rtw_malloc((sz))
#define rtw_zvmalloc(sz) _rtw_zmalloc((sz)) #define rtw_zvmalloc(sz) _rtw_zmalloc((sz))
#define rtw_vmfree(pbuf, sz) _rtw_mfree((pbuf), (sz))
#define rtw_vmalloc_f(sz, mstat_f) _rtw_malloc((sz)) #define rtw_vmalloc_f(sz, mstat_f) _rtw_malloc((sz))
#define rtw_zvmalloc_f(sz, mstat_f) _rtw_zmalloc((sz)) #define rtw_zvmalloc_f(sz, mstat_f) _rtw_zmalloc((sz))
#define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_mfree((pbuf), (sz)) #define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_mfree((pbuf), (sz))
@ -288,7 +283,6 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a
#endif /* DBG_MEM_ALLOC */ #endif /* DBG_MEM_ALLOC */
extern void *rtw_malloc2d(int h, int w, size_t size); extern void *rtw_malloc2d(int h, int w, size_t size);
extern void rtw_mfree2d(void *pbuf, int h, int w, int size);
void rtw_os_pkt_free(_pkt *pkt); void rtw_os_pkt_free(_pkt *pkt);
_pkt *rtw_os_pkt_copy(_pkt *pkt); _pkt *rtw_os_pkt_copy(_pkt *pkt);
@ -327,7 +321,6 @@ extern void _rtw_mutex_free(_mutex *pmutex);
#ifndef PLATFORM_FREEBSD #ifndef PLATFORM_FREEBSD
extern void _rtw_spinlock_init(_lock *plock); extern void _rtw_spinlock_init(_lock *plock);
#endif /* PLATFORM_FREEBSD */ #endif /* PLATFORM_FREEBSD */
extern void _rtw_spinlock_free(_lock *plock);
extern void _rtw_spinlock(_lock *plock); extern void _rtw_spinlock(_lock *plock);
extern void _rtw_spinunlock(_lock *plock); extern void _rtw_spinunlock(_lock *plock);
extern void _rtw_spinlock_ex(_lock *plock); extern void _rtw_spinlock_ex(_lock *plock);
@ -371,7 +364,6 @@ extern bool _rtw_time_after(systime a, systime b);
extern void rtw_sleep_schedulable(int ms); extern void rtw_sleep_schedulable(int ms);
extern void rtw_msleep_os(int ms);
extern void rtw_usleep_os(int us); extern void rtw_usleep_os(int us);
extern u32 rtw_atoi(u8 *s); extern u32 rtw_atoi(u8 *s);
@ -386,9 +378,6 @@ extern void rtw_mdelay_os(int ms);
extern void rtw_udelay_os(int us); extern void rtw_udelay_os(int us);
#endif #endif
extern void rtw_yield_os(void);
extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx); extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx);
@ -426,7 +415,7 @@ static inline void rtw_thread_wait_stop(void)
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
#if 0 #if 0
while (!kthread_should_stop()) while (!kthread_should_stop())
rtw_msleep_os(10); msleep(10);
#else #else
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
@ -611,18 +600,6 @@ extern void rtw_set_bit(int nr, unsigned long *addr);
extern void rtw_clear_bit(int nr, unsigned long *addr); extern void rtw_clear_bit(int nr, unsigned long *addr);
extern int rtw_test_and_clear_bit(int nr, unsigned long *addr); extern int rtw_test_and_clear_bit(int nr, unsigned long *addr);
extern void ATOMIC_SET(ATOMIC_T *v, int i);
extern int ATOMIC_READ(ATOMIC_T *v);
extern void ATOMIC_ADD(ATOMIC_T *v, int i);
extern void ATOMIC_SUB(ATOMIC_T *v, int i);
extern void ATOMIC_INC(ATOMIC_T *v);
extern void ATOMIC_DEC(ATOMIC_T *v);
extern int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i);
extern int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i);
extern int ATOMIC_INC_RETURN(ATOMIC_T *v);
extern int ATOMIC_DEC_RETURN(ATOMIC_T *v);
extern bool ATOMIC_INC_UNLESS(ATOMIC_T *v, int u);
/* File operation APIs, just for linux now */ /* File operation APIs, just for linux now */
extern int rtw_is_file_readable(const char *path); extern int rtw_is_file_readable(const char *path);
extern int rtw_is_file_readable_with_size(const char *path, u32 *sz); extern int rtw_is_file_readable_with_size(const char *path, u32 *sz);
@ -635,7 +612,6 @@ extern void rtw_free_netdev(struct net_device *netdev);
#endif /* PLATFORM_FREEBSD */ #endif /* PLATFORM_FREEBSD */
extern u64 rtw_modular64(u64 x, u64 y);
extern u64 rtw_division64(u64 x, u64 y); extern u64 rtw_division64(u64 x, u64 y);
extern u32 rtw_random32(void); extern u32 rtw_random32(void);

View File

@ -545,8 +545,6 @@ void rtw_usb_set_intfdata(struct usb_interface *intf, void *data);
void rtw_usb_fill_bulk_urb(struct urb *urb, struct usb_device *udev, void rtw_usb_fill_bulk_urb(struct urb *urb, struct usb_device *udev,
struct usb_host_endpoint *uhe, void *buf, struct usb_host_endpoint *uhe, void *buf,
int length, usb_complete_t callback, void *arg); int length, usb_complete_t callback, void *arg);
int rtw_usb_bulk_msg(struct usb_device *udev, struct usb_host_endpoint *uhe,
void *data, int len, uint16_t *pactlen, usb_timeout_t timeout);
void *usb_get_intfdata(struct usb_interface *intf); void *usb_get_intfdata(struct usb_interface *intf);
int usb_linux_init_endpoints(struct usb_device *udev); int usb_linux_init_endpoints(struct usb_device *udev);
@ -734,9 +732,6 @@ __inline static void _set_workitem(_workitem *pwork)
static __inline void thread_enter(char *name); static __inline void thread_enter(char *name);
//Atomic integer operations
typedef uint32_t ATOMIC_T ;
#define rtw_netdev_priv(netdev) (((struct ifnet *)netdev)->if_softc) #define rtw_netdev_priv(netdev) (((struct ifnet *)netdev)->if_softc)
#define rtw_free_netdev(netdev) if_free((netdev)) #define rtw_free_netdev(netdev) if_free((netdev))

View File

@ -182,7 +182,7 @@ __inline static void _set_workitem(_workitem *pwork)
#define PATH_LENGTH_MAX MAX_PATH #define PATH_LENGTH_MAX MAX_PATH
//Atomic integer operations //Atomic integer operations
#define ATOMIC_T LONG #define atomic_t LONG
#define NDEV_FMT "%s" #define NDEV_FMT "%s"
#define NDEV_ARG(ndev) "" #define NDEV_ARG(ndev) ""

View File

@ -513,7 +513,7 @@ static inline int rtw_merge_string(char *dst, int dst_len, const char *src1, con
#define PATH_LENGTH_MAX PATH_MAX #define PATH_LENGTH_MAX PATH_MAX
/* Atomic integer operations */ /* Atomic integer operations */
#define ATOMIC_T atomic_t #define atomic_t atomic_t
#define rtw_netdev_priv(netdev) (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv) #define rtw_netdev_priv(netdev) (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv)

View File

@ -192,7 +192,7 @@ __inline static void _set_workitem(_workitem *pwork)
#define PATH_LENGTH_MAX MAX_PATH #define PATH_LENGTH_MAX MAX_PATH
//Atomic integer operations //Atomic integer operations
#define ATOMIC_T LONG #define atomic_t LONG
#define NDEV_FMT "%s" #define NDEV_FMT "%s"

View File

@ -66,7 +66,7 @@ struct cmd_priv {
u32 cmd_issued_cnt; u32 cmd_issued_cnt;
u32 cmd_done_cnt; u32 cmd_done_cnt;
u32 rsp_cnt; u32 rsp_cnt;
ATOMIC_T cmdthd_running; atomic_t cmdthd_running;
/* u8 cmdthd_running; */ /* u8 cmdthd_running; */
_adapter *padapter; _adapter *padapter;
@ -107,7 +107,7 @@ struct evt_priv {
u8 lbkevt_num; u8 lbkevt_num;
u8 *cmdevt_parm; u8 *cmdevt_parm;
#endif #endif
ATOMIC_T event_seq; atomic_t event_seq;
u8 *evt_buf; /* shall be non-paged, and 4 bytes aligned */ u8 *evt_buf; /* shall be non-paged, and 4 bytes aligned */
u8 *evt_allocated_buf; u8 *evt_allocated_buf;
u32 evt_done_cnt; u32 evt_done_cnt;

View File

@ -359,7 +359,7 @@ struct cfg80211_wifidirect_info {
u8 restore_channel; u8 restore_channel;
struct ieee80211_channel remain_on_ch_channel; struct ieee80211_channel remain_on_ch_channel;
enum nl80211_channel_type remain_on_ch_type; enum nl80211_channel_type remain_on_ch_type;
ATOMIC_T ro_ch_cookie_gen; atomic_t ro_ch_cookie_gen;
u64 remain_on_ch_cookie; u64 remain_on_ch_cookie;
bool is_ro_ch; bool is_ro_ch;
struct wireless_dev *ro_ch_wdev; struct wireless_dev *ro_ch_wdev;
@ -504,7 +504,7 @@ struct tdls_temp_mgmt {
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
struct tdls_ch_switch { struct tdls_ch_switch {
u32 ch_sw_state; u32 ch_sw_state;
ATOMIC_T chsw_on; atomic_t chsw_on;
u8 addr[ETH_ALEN]; u8 addr[ETH_ALEN];
u8 off_ch_num; u8 off_ch_num;
u8 ch_offset; u8 ch_offset;
@ -731,7 +731,7 @@ struct nb_rpt_hdr {
u8 phy_type; u8 phy_type;
}; };
/*IEEE Std 80211v, Figure 7-95e2¡XBSS Termination Duration subelement field format */ /*IEEE Std 80211v, Figure 7-95e2<EFBFBD>XBSS Termination Duration subelement field format */
struct btm_term_duration { struct btm_term_duration {
u8 id; u8 id;
u8 len; u8 len;
@ -739,7 +739,7 @@ struct btm_term_duration {
u16 duration; u16 duration;
}; };
/*IEEE Std 80211v, Figure 7-101n8¡XBSS Transition Management Request frame body format */ /*IEEE Std 80211v, Figure 7-101n8<EFBFBD>XBSS Transition Management Request frame body format */
struct btm_req_hdr { struct btm_req_hdr {
u8 req_mode; u8 req_mode;
u16 disassoc_timer; u16 disassoc_timer;
@ -843,7 +843,7 @@ struct mlme_priv {
#ifdef CONFIG_SET_SCAN_DENY_TIMER #ifdef CONFIG_SET_SCAN_DENY_TIMER
_timer set_scan_deny_timer; _timer set_scan_deny_timer;
ATOMIC_T set_scan_deny; /* 0: allowed, 1: deny */ atomic_t set_scan_deny; /* 0: allowed, 1: deny */
#endif #endif
u8 wpa_phase;/*wpa_phase after wps finished*/ u8 wpa_phase;/*wpa_phase after wps finished*/
@ -914,7 +914,7 @@ struct mlme_priv {
/* Number of associated stations that do not support Short Preamble */ /* Number of associated stations that do not support Short Preamble */
int num_sta_no_short_preamble; int num_sta_no_short_preamble;
ATOMIC_T olbc; /* Overlapping Legacy BSS Condition (Legacy b/g)*/ atomic_t olbc; /* Overlapping Legacy BSS Condition (Legacy b/g)*/
/* Number of HT associated stations that do not support greenfield */ /* Number of HT associated stations that do not support greenfield */
int num_sta_ht_no_gf; int num_sta_ht_no_gf;
@ -929,7 +929,7 @@ struct mlme_priv {
int num_sta_40mhz_intolerant; int num_sta_40mhz_intolerant;
/* Overlapping BSS information */ /* Overlapping BSS information */
ATOMIC_T olbc_ht; atomic_t olbc_ht;
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
int ht_20mhz_width_req; int ht_20mhz_width_req;
@ -1019,7 +1019,7 @@ struct mlme_priv {
int widi_state; int widi_state;
int listen_state; int listen_state;
_timer listen_timer; _timer listen_timer;
ATOMIC_T rx_probe_rsp; /* 1:receive probe respone from RDS source. */ atomic_t rx_probe_rsp; /* 1:receive probe respone from RDS source. */
u8 *l2sdTaBuffer; u8 *l2sdTaBuffer;
u8 channel_idx; u8 channel_idx;
u8 group_cnt; /* In WiDi 3.5, they specified another scan algo. for WFD/RDS co-existed */ u8 group_cnt; /* In WiDi 3.5, they specified another scan algo. for WFD/RDS co-existed */

View File

@ -482,7 +482,7 @@ struct p2p_oper_class_map {
struct mlme_ext_priv { struct mlme_ext_priv {
_adapter *padapter; _adapter *padapter;
u8 mlmeext_init; u8 mlmeext_init;
ATOMIC_T event_seq; atomic_t event_seq;
u16 mgnt_seq; u16 mgnt_seq;
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
u16 sa_query_seq; u16 sa_query_seq;
@ -838,7 +838,6 @@ void rtw_macid_ctl_set_rate_bmp0(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp);
void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp); void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp);
void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3); void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3);
void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl); void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl);
void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl);
u8 rtw_iface_bcmc_id_get(_adapter *padapter); u8 rtw_iface_bcmc_id_get(_adapter *padapter);
void rtw_iface_bcmc_id_set(_adapter *padapter, u8 mac_id); void rtw_iface_bcmc_id_set(_adapter *padapter, u8 mac_id);
#if defined(DBG_CONFIG_ERROR_RESET) && defined(CONFIG_CONCURRENT_MODE) #if defined(DBG_CONFIG_ERROR_RESET) && defined(CONFIG_CONCURRENT_MODE)

View File

@ -291,9 +291,9 @@ typedef struct lps_poff_info {
u32 tx_bndy_dynamic; u32 tx_bndy_dynamic;
u16 ConfLenForPTK; u16 ConfLenForPTK;
u16 ConfLenForGTK; u16 ConfLenForGTK;
ATOMIC_T bEnterPOFF; atomic_t bEnterPOFF;
ATOMIC_T bTxBoundInProgress; atomic_t bTxBoundInProgress;
ATOMIC_T bSetPOFFParm; atomic_t bSetPOFFParm;
} lps_poff_info_t; } lps_poff_info_t;
#endif /*CONFIG_LPS_POFF*/ #endif /*CONFIG_LPS_POFF*/

View File

@ -387,7 +387,7 @@ struct recv_priv {
/* u8 *pallocated_urb_buf; */ /* u8 *pallocated_urb_buf; */
_sema allrxreturnevt; _sema allrxreturnevt;
uint ff_hwaddr; uint ff_hwaddr;
ATOMIC_T rx_pending_cnt; atomic_t rx_pending_cnt;
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE #ifdef CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX

View File

@ -53,7 +53,7 @@ struct rm_event {
struct rm_clock { struct rm_clock {
struct rm_obj *prm; struct rm_obj *prm;
ATOMIC_T counter; atomic_t counter;
enum RM_EV_ID evid; enum RM_EV_ID evid;
}; };

View File

@ -413,24 +413,6 @@ static inline u32 rotr(u32 val, int bits)
(a)[7] = (u8) (((u64) (val)) & 0xff); \ (a)[7] = (u8) (((u64) (val)) & 0xff); \
} while (0) } while (0)
/* the K array */
static const unsigned long K[64] = {
0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL,
0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL,
0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL,
0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL,
0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL,
0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL,
0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL,
0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL,
0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL,
0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
};
/* Various logical functions */ /* Various logical functions */
#define RORc(x, y) \ #define RORc(x, y) \
(((((unsigned long) (x) & 0xFFFFFFFFUL) >> (unsigned long) ((y) & 31)) | \ (((((unsigned long) (x) & 0xFFFFFFFFUL) >> (unsigned long) ((y) & 31)) | \

View File

@ -357,7 +357,7 @@ struct sta_info {
/* for A-MPDU Rx reordering buffer control */ /* for A-MPDU Rx reordering buffer control */
struct recv_reorder_ctrl recvreorder_ctrl[TID_NUM]; struct recv_reorder_ctrl recvreorder_ctrl[TID_NUM];
ATOMIC_T continual_no_rx_packet[TID_NUM]; atomic_t continual_no_rx_packet[TID_NUM];
/* for A-MPDU Tx */ /* for A-MPDU Tx */
/* unsigned char ampdu_txen_bitmap; */ /* unsigned char ampdu_txen_bitmap; */
u16 BA_starting_seqctrl[16]; u16 BA_starting_seqctrl[16];

View File

@ -44,21 +44,6 @@
#define usb_read_interrupt_complete(purb, regs) usb_read_interrupt_complete(purb) #define usb_read_interrupt_complete(purb, regs) usb_read_interrupt_complete(purb)
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12))
#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \
usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), (timeout_ms))
#define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \
usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), (timeout_ms))
#else
#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \
usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), \
((timeout_ms) == 0) || ((timeout_ms) * HZ / 1000 > 0) ? ((timeout_ms) * HZ / 1000) : 1)
#define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \
usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), \
((timeout_ms) == 0) || ((timeout_ms) * HZ / 1000 > 0) ? ((timeout_ms) * HZ / 1000) : 1)
#endif
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ #ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val); int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val); int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val);

View File

@ -1721,10 +1721,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
if (param == NULL) if (param == NULL)
return -1; return -1;
_rtw_memset(param, 0, param_len); memset(param, 0, param_len);
param->cmd = IEEE_CMD_SET_ENCRYPTION; param->cmd = IEEE_CMD_SET_ENCRYPTION;
_rtw_memset(param->sta_addr, 0xff, ETH_ALEN); memset(param->sta_addr, 0xff, ETH_ALEN);
switch (params->cipher) { switch (params->cipher) {
case IW_AUTH_CIPHER_NONE: case IW_AUTH_CIPHER_NONE:
@ -1978,7 +1978,7 @@ exit:
RTW_INFO(FUNC_NDEV_FMT " seq:0x%llx\n", FUNC_NDEV_ARG(ndev), *pn); RTW_INFO(FUNC_NDEV_FMT " seq:0x%llx\n", FUNC_NDEV_ARG(ndev), *pn);
if (ret == 0) { if (ret == 0) {
_rtw_memset(&params, 0, sizeof(params)); memset(&params, 0, sizeof(params));
params.cipher = cipher; params.cipher = cipher;
params.key = key->skey; params.key = key->skey;
@ -2539,7 +2539,7 @@ u32 rtw_cfg80211_wait_scan_req_empty(_adapter *adapter, u32 timeout_ms)
break; break;
} }
rtw_msleep_os(10); msleep(10);
} }
pass_ms = rtw_get_passing_time_ms(start); pass_ms = rtw_get_passing_time_ms(start);
@ -3697,7 +3697,7 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
#endif /*CONFIG_CONCURRENT_MODE*/ #endif /*CONFIG_CONCURRENT_MODE*/
_rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID));
ndis_ssid.SsidLength = params->ssid_len; ndis_ssid.SsidLength = params->ssid_len;
_rtw_memcpy(ndis_ssid.Ssid, (u8 *)params->ssid, params->ssid_len); _rtw_memcpy(ndis_ssid.Ssid, (u8 *)params->ssid, params->ssid_len);
@ -3928,7 +3928,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
} }
#endif #endif
_rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID));
ndis_ssid.SsidLength = sme->ssid_len; ndis_ssid.SsidLength = sme->ssid_len;
_rtw_memcpy(ndis_ssid.Ssid, (u8 *)sme->ssid, sme->ssid_len); _rtw_memcpy(ndis_ssid.Ssid, (u8 *)sme->ssid, sme->ssid_len);
@ -4010,7 +4010,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
goto cancel_ps_deny; goto cancel_ps_deny;
} }
_rtw_memset(pwep, 0, wep_total_len); memset(pwep, 0, wep_total_len);
pwep->KeyLength = wep_key_len; pwep->KeyLength = wep_key_len;
pwep->Length = wep_total_len; pwep->Length = wep_total_len;
@ -4295,8 +4295,8 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy,
for (index = 0 ; index < NUM_PMKID_CACHE; index++) { for (index = 0 ; index < NUM_PMKID_CACHE; index++) {
if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) == _TRUE) { if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) == _TRUE) {
/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
_rtw_memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN); memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN);
_rtw_memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN); memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN);
psecuritypriv->PMKIDList[index].bUsed = _FALSE; psecuritypriv->PMKIDList[index].bUsed = _FALSE;
bMatched = _TRUE; bMatched = _TRUE;
RTW_INFO(FUNC_NDEV_FMT" clear id:%hhu\n", FUNC_NDEV_ARG(ndev), index); RTW_INFO(FUNC_NDEV_FMT" clear id:%hhu\n", FUNC_NDEV_ARG(ndev), index);
@ -4321,7 +4321,7 @@ static int cfg80211_rtw_flush_pmksa(struct wiphy *wiphy,
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
_rtw_memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE);
psecuritypriv->PMKIDIndex = 0; psecuritypriv->PMKIDIndex = 0;
return 0; return 0;
@ -4578,7 +4578,7 @@ dump:
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
pattrib->retry_ctrl = _FALSE; pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -5453,7 +5453,7 @@ release_plink_ctl:
#endif #endif
/* indicate new sta */ /* indicate new sta */
_rtw_memset(&sinfo, 0, sizeof(sinfo)); memset(&sinfo, 0, sizeof(sinfo));
cfg80211_new_sta(ndev, mac, &sinfo, GFP_ATOMIC); cfg80211_new_sta(ndev, mac, &sinfo, GFP_ATOMIC);
} }
goto exit; goto exit;
@ -6373,8 +6373,8 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
/* start to build provision_request frame */ /* start to build provision_request frame */
_rtw_memset(wpsie, 0, sizeof(wpsie)); memset(wpsie, 0, sizeof(wpsie));
_rtw_memset(p2p_ie, 0, sizeof(p2p_ie)); memset(p2p_ie, 0, sizeof(p2p_ie));
p2p_ielen = 0; p2p_ielen = 0;
pmgntframe = alloc_mgtxmitframe(pxmitpriv); pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@ -6386,7 +6386,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
pattrib = &pmgntframe->attrib; pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib); update_mgntframe_attrib(padapter, pattrib);
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -6511,7 +6511,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf,
#if 0 #if 0
if(wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC) { if(wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC) {
RTW_INFO("waiting for p2p peer key-in PIN CODE\n"); RTW_INFO("waiting for p2p peer key-in PIN CODE\n");
rtw_msleep_os(15000); /* 15 sec for key in PIN CODE, workaround for GS2 before issuing Nego Req. */ msleep(15000); /* 15 sec for key in PIN CODE, workaround for GS2 before issuing Nego Req. */
} }
#endif #endif
@ -6687,7 +6687,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
is_p2p_find = (duration < (pwdinfo->ext_listen_interval)) ? _TRUE : _FALSE; is_p2p_find = (duration < (pwdinfo->ext_listen_interval)) ? _TRUE : _FALSE;
#endif #endif
*cookie = ATOMIC_INC_RETURN(&pcfg80211_wdinfo->ro_ch_cookie_gen); *cookie = atomic_inc_return(&pcfg80211_wdinfo->ro_ch_cookie_gen);
RTW_INFO(FUNC_ADPT_FMT"%s ch:%u duration:%d, cookie:0x%llx\n" RTW_INFO(FUNC_ADPT_FMT"%s ch:%u duration:%d, cookie:0x%llx\n"
, FUNC_ADPT_ARG(padapter), wdev == wiphy_to_pd_wdev(wiphy) ? " PD" : "" , FUNC_ADPT_ARG(padapter), wdev == wiphy_to_pd_wdev(wiphy) ? " PD" : ""
@ -7079,7 +7079,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const
#if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE) #if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE)
if (rtw_cfg80211_get_is_roch(padapter) if (rtw_cfg80211_get_is_roch(padapter)
&& ATOMIC_READ(&pwdev_priv->switch_ch_to) == 1 && atomic_read(&pwdev_priv->switch_ch_to) == 1
) { ) {
u16 ext_listen_period; u16 ext_listen_period;
@ -7087,7 +7087,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const
ext_listen_period = 500; ext_listen_period = 500;
else else
ext_listen_period = pwdinfo->ext_listen_period; ext_listen_period = pwdinfo->ext_listen_period;
ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); atomic_set(&pwdev_priv->switch_ch_to, 0);
_set_timer(&pwdinfo->ap_p2p_switch_timer, ext_listen_period); _set_timer(&pwdinfo->ap_p2p_switch_timer, ext_listen_period);
RTW_INFO("%s, set switch ch timer, period=%d\n", __func__, ext_listen_period); RTW_INFO("%s, set switch ch timer, period=%d\n", __func__, ext_listen_period);
} }
@ -7118,7 +7118,7 @@ issue_mgmt_frame:
pattrib->retry_ctrl = _FALSE; pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
@ -7149,7 +7149,7 @@ issue_mgmt_frame:
#ifdef CONFIG_XMIT_ACK #ifdef CONFIG_XMIT_ACK
if (!MLME_IS_MESH(padapter)) /* TODO: remove this sleep for all mode */ if (!MLME_IS_MESH(padapter)) /* TODO: remove this sleep for all mode */
rtw_msleep_os(50); msleep(50);
#endif #endif
#ifdef CONFIG_DEBUG_CFG80211 #ifdef CONFIG_DEBUG_CFG80211
RTW_INFO("%s, ack=%d, ok!\n", __func__, ack); RTW_INFO("%s, ack=%d, ok!\n", __func__, ack);
@ -7426,7 +7426,7 @@ dump:
break; break;
if (sleep_ms > 0) if (sleep_ms > 0)
rtw_msleep_os(sleep_ms); msleep(sleep_ms);
} }
if (tx_ret != _SUCCESS || dump_cnt > 1) { if (tx_ret != _SUCCESS || dump_cnt > 1) {
@ -7611,7 +7611,7 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
goto discard; goto discard;
} }
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
_rtw_memcpy(txmgmt.peer, peer, ETH_ALEN); _rtw_memcpy(txmgmt.peer, peer, ETH_ALEN);
txmgmt.action_code = action_code; txmgmt.action_code = action_code;
txmgmt.dialog_token = dialog_token; txmgmt.dialog_token = dialog_token;
@ -7697,7 +7697,7 @@ static int cfg80211_rtw_tdls_oper(struct wiphy *wiphy,
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 0); rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 0);
#endif /* CONFIG_LPS */ #endif /* CONFIG_LPS */
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
if (peer) if (peer)
_rtw_memcpy(txmgmt.peer, peer, ETH_ALEN); _rtw_memcpy(txmgmt.peer, peer, ETH_ALEN);
@ -8224,8 +8224,8 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte
u8 ht_cap[HT_CAP_IE_LEN]; u8 ht_cap[HT_CAP_IE_LEN];
u8 ht_op[HT_OP_IE_LEN]; u8 ht_op[HT_OP_IE_LEN];
_rtw_memset(ht_cap, 0, HT_CAP_IE_LEN); memset(ht_cap, 0, HT_CAP_IE_LEN);
_rtw_memset(ht_op, 0, HT_OP_IE_LEN); memset(ht_op, 0, HT_OP_IE_LEN);
/* WLAN_EID_HT_CAP */ /* WLAN_EID_HT_CAP */
RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap); RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap);
@ -8263,7 +8263,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte
u8 vht_op[VHT_OP_IE_LEN]; u8 vht_op[VHT_OP_IE_LEN];
u8 cch = rtw_get_center_ch(ch, bw, offset); u8 cch = rtw_get_center_ch(ch, bw, offset);
_rtw_memset(vht_op, 0, VHT_OP_IE_LEN); memset(vht_op, 0, VHT_OP_IE_LEN);
/* WLAN_EID_VHT_CAPABILITY */ /* WLAN_EID_VHT_CAPABILITY */
_rtw_memcpy(vht_cap, &sta_vht_cap->cap, 4); _rtw_memcpy(vht_cap, &sta_vht_cap->cap, 4);
@ -8599,9 +8599,9 @@ static void rtw_cfg80211_mpath_set_pinfo(struct rtw_mesh_path *mpath, u8 *next_h
if (next_hop_sta) if (next_hop_sta)
_rtw_memcpy(next_hop, next_hop_sta->cmn.mac_addr, ETH_ALEN); _rtw_memcpy(next_hop, next_hop_sta->cmn.mac_addr, ETH_ALEN);
else else
_rtw_memset(next_hop, 0, ETH_ALEN); memset(next_hop, 0, ETH_ALEN);
_rtw_memset(pinfo, 0, sizeof(*pinfo)); memset(pinfo, 0, sizeof(*pinfo));
pinfo->generation = mpath->adapter->mesh_info.mesh_paths_generation; pinfo->generation = mpath->adapter->mesh_info.mesh_paths_generation;
@ -8684,7 +8684,7 @@ static void rtw_cfg80211_mpp_set_pinfo(struct rtw_mesh_path *mpath, u8 *mpp, str
{ {
_rtw_memcpy(mpp, mpath->mpp, ETH_ALEN); _rtw_memcpy(mpp, mpath->mpp, ETH_ALEN);
_rtw_memset(pinfo, 0, sizeof(*pinfo)); memset(pinfo, 0, sizeof(*pinfo));
pinfo->generation = mpath->adapter->mesh_info.mpp_paths_generation; pinfo->generation = mpath->adapter->mesh_info.mpp_paths_generation;
} }
@ -8855,7 +8855,7 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) {
for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) { for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) {
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE) if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE)
break; break;
rtw_msleep_os(1000); msleep(1000);
} }
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
@ -9362,7 +9362,7 @@ void rtw_cfg80211_init_wdev_data(_adapter *padapter)
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter); struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter);
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); atomic_set(&pwdev_priv->switch_ch_to, 1);
#endif #endif
} }
@ -9734,7 +9734,7 @@ int rtw_hostapd_acs_dump_survey(struct wiphy *wiphy, struct net_device *netdev,
return -EINVAL; return -EINVAL;
} }
_rtw_memset(info, 0, sizeof(struct survey_info)); memset(info, 0, sizeof(struct survey_info));
if (padapter->bup == _FALSE) { if (padapter->bup == _FALSE) {
RTW_INFO("%s: net device is down.\n", __func__); RTW_INFO("%s: net device is down.\n", __func__);
return -EIO; return -EIO;
@ -10103,7 +10103,7 @@ int rtw_wdev_alloc(_adapter *padapter, struct wiphy *wiphy)
_rtw_mutex_init(&pwdev_priv->roch_mutex); _rtw_mutex_init(&pwdev_priv->roch_mutex);
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); atomic_set(&pwdev_priv->switch_ch_to, 1);
#endif #endif
#ifdef CONFIG_RTW_CFGVEDNOR_RSSIMONITOR #ifdef CONFIG_RTW_CFGVEDNOR_RSSIMONITOR
@ -10129,12 +10129,9 @@ void rtw_wdev_free(struct wireless_dev *wdev)
struct rtw_wdev_priv *wdev_priv = adapter_wdev_data(adapter); struct rtw_wdev_priv *wdev_priv = adapter_wdev_data(adapter);
_irqL irqL; _irqL irqL;
_rtw_spinlock_free(&wdev_priv->scan_req_lock);
_enter_critical_bh(&wdev_priv->connect_req_lock, &irqL); _enter_critical_bh(&wdev_priv->connect_req_lock, &irqL);
rtw_wdev_free_connect_req(wdev_priv); rtw_wdev_free_connect_req(wdev_priv);
_exit_critical_bh(&wdev_priv->connect_req_lock, &irqL); _exit_critical_bh(&wdev_priv->connect_req_lock, &irqL);
_rtw_spinlock_free(&wdev_priv->connect_req_lock);
_rtw_mutex_free(&wdev_priv->roch_mutex); _rtw_mutex_free(&wdev_priv->roch_mutex);
} }

View File

@ -94,8 +94,8 @@ struct rtw_wdev_invit_info {
#define rtw_wdev_invit_info_init(invit_info) \ #define rtw_wdev_invit_info_init(invit_info) \
do { \ do { \
(invit_info)->state = 0xff; \ (invit_info)->state = 0xff; \
_rtw_memset((invit_info)->peer_mac, 0, ETH_ALEN); \ memset((invit_info)->peer_mac, 0, ETH_ALEN); \
_rtw_memset((invit_info)->group_bssid, 0, ETH_ALEN); \ memset((invit_info)->group_bssid, 0, ETH_ALEN); \
(invit_info)->active = 0xff; \ (invit_info)->active = 0xff; \
(invit_info)->token = 0; \ (invit_info)->token = 0; \
(invit_info)->flags = 0x00; \ (invit_info)->flags = 0x00; \
@ -123,9 +123,9 @@ struct rtw_wdev_nego_info {
#define rtw_wdev_nego_info_init(nego_info) \ #define rtw_wdev_nego_info_init(nego_info) \
do { \ do { \
(nego_info)->state = 0xff; \ (nego_info)->state = 0xff; \
_rtw_memset((nego_info)->iface_addr, 0, ETH_ALEN); \ memset((nego_info)->iface_addr, 0, ETH_ALEN); \
_rtw_memset((nego_info)->peer_mac, 0, ETH_ALEN); \ memset((nego_info)->peer_mac, 0, ETH_ALEN); \
_rtw_memset((nego_info)->peer_iface_addr, 0, ETH_ALEN); \ memset((nego_info)->peer_iface_addr, 0, ETH_ALEN); \
(nego_info)->active = 0xff; \ (nego_info)->active = 0xff; \
(nego_info)->token = 0; \ (nego_info)->token = 0; \
(nego_info)->status = 0xff; \ (nego_info)->status = 0xff; \
@ -177,7 +177,7 @@ struct rtw_wdev_priv {
_mutex roch_mutex; _mutex roch_mutex;
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
ATOMIC_T switch_ch_to; atomic_t switch_ch_to;
#endif #endif
#ifdef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI #ifdef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI

File diff suppressed because it is too large Load Diff

View File

@ -60,14 +60,14 @@ int rtw_mp_write_reg(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
input[wrqu->length] = '\0'; input[wrqu->length] = '\0';
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
pch = input; pch = input;
@ -83,7 +83,7 @@ int rtw_mp_write_reg(struct net_device *dev,
return -EINVAL; return -EINVAL;
*pnext = 0; *pnext = 0;
/*addr = simple_strtoul(pch, &ptmp, 16); /*addr = simple_strtoul(pch, &ptmp, 16);
_rtw_memset(buf, '\0', sizeof(buf)); memset(buf, '\0', sizeof(buf));
_rtw_memcpy(buf, pch, pnext-pch); _rtw_memcpy(buf, pch, pnext-pch);
ret = kstrtoul(buf, 16, &addr);*/ ret = kstrtoul(buf, 16, &addr);*/
ret = sscanf(pch, "%x", &addr); ret = sscanf(pch, "%x", &addr);
@ -160,14 +160,14 @@ int rtw_mp_read_reg(struct net_device *dev,
if (wrqu->length > 128) if (wrqu->length > 128)
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
input[wrqu->length] = '\0'; input[wrqu->length] = '\0';
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
_rtw_memset(data, '\0', sizeof(data)); memset(data, '\0', sizeof(data));
_rtw_memset(tmp, '\0', sizeof(tmp)); memset(tmp, '\0', sizeof(tmp));
pch = input; pch = input;
pnext = strpbrk(pch, " ,.-"); pnext = strpbrk(pch, " ,.-");
if (pnext == NULL) if (pnext == NULL)
@ -286,7 +286,7 @@ int rtw_mp_write_rf(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, wrqu->length); memset(input, 0, wrqu->length);
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
@ -302,7 +302,7 @@ int rtw_mp_write_rf(struct net_device *dev,
if (data > 0xFFFFF) if (data > 0xFFFFF)
return -EINVAL; return -EINVAL;
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
write_rfreg(padapter, path, addr, data); write_rfreg(padapter, path, addr, data);
@ -338,7 +338,7 @@ int rtw_mp_read_rf(struct net_device *dev,
if (wrqu->length > 128) if (wrqu->length > 128)
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, wrqu->length); memset(input, 0, wrqu->length);
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
@ -351,7 +351,7 @@ int rtw_mp_read_rf(struct net_device *dev,
if (addr > 0xFF) if (addr > 0xFF)
return -EINVAL; return -EINVAL;
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(data, "%08x", read_rfreg(padapter, path, addr)); sprintf(data, "%08x", read_rfreg(padapter, path, addr));
/*add read data format blank*/ /*add read data format blank*/
@ -401,7 +401,7 @@ int rtw_mp_start(struct net_device *dev,
if (rtw_mp_cmd(padapter, MP_START, RTW_CMDF_WAIT_ACK) != _SUCCESS) if (rtw_mp_cmd(padapter, MP_START, RTW_CMDF_WAIT_ACK) != _SUCCESS)
ret = -EPERM; ret = -EPERM;
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "mp_start %s\n", ret == 0 ? "ok" : "fail"); sprintf(extra, "mp_start %s\n", ret == 0 ? "ok" : "fail");
wrqu->length = strlen(extra); wrqu->length = strlen(extra);
@ -420,7 +420,7 @@ int rtw_mp_stop(struct net_device *dev,
if (rtw_mp_cmd(padapter, MP_STOP, RTW_CMDF_WAIT_ACK) != _SUCCESS) if (rtw_mp_cmd(padapter, MP_STOP, RTW_CMDF_WAIT_ACK) != _SUCCESS)
ret = -EPERM; ret = -EPERM;
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "mp_stop %s\n", ret == 0 ? "ok" : "fail"); sprintf(extra, "mp_stop %s\n", ret == 0 ? "ok" : "fail");
wrqu->length = strlen(extra); wrqu->length = strlen(extra);
@ -440,7 +440,7 @@ int rtw_mp_rate(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
@ -463,7 +463,7 @@ int rtw_mp_rate(struct net_device *dev,
rate =(rate - MPT_RATE_VHT1SS_MCS0); rate =(rate - MPT_RATE_VHT1SS_MCS0);
*/ */
} }
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "Set data rate to %s index %d" , input, padapter->mppriv.rateidx); sprintf(extra, "Set data rate to %s index %d" , input, padapter->mppriv.rateidx);
RTW_INFO("%s: %s rate index=%d\n", __func__, input, padapter->mppriv.rateidx); RTW_INFO("%s: %s rate index=%d\n", __func__, input, padapter->mppriv.rateidx);
@ -492,14 +492,14 @@ int rtw_mp_channel(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
input[wrqu->length] = '\0'; input[wrqu->length] = '\0';
channel = rtw_atoi(input); channel = rtw_atoi(input);
/*RTW_INFO("%s: channel=%d\n", __func__, channel);*/ /*RTW_INFO("%s: channel=%d\n", __func__, channel);*/
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel); sprintf(extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel);
padapter->mppriv.channel = channel; padapter->mppriv.channel = channel;
SetChannel(padapter); SetChannel(padapter);
@ -522,14 +522,14 @@ int rtw_mp_ch_offset(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
input[wrqu->length] = '\0'; input[wrqu->length] = '\0';
ch_offset = rtw_atoi(input); ch_offset = rtw_atoi(input);
/*RTW_INFO("%s: channel=%d\n", __func__, channel);*/ /*RTW_INFO("%s: channel=%d\n", __func__, channel);*/
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "Change prime channel offset %d to %d", padapter->mppriv.prime_channel_offset , ch_offset); sprintf(extra, "Change prime channel offset %d to %d", padapter->mppriv.prime_channel_offset , ch_offset);
padapter->mppriv.prime_channel_offset = ch_offset; padapter->mppriv.prime_channel_offset = ch_offset;
SetChannel(padapter); SetChannel(padapter);
@ -564,7 +564,7 @@ int rtw_mp_bandwidth(struct net_device *dev,
padapter->mppriv.bandwidth = (u8)bandwidth; padapter->mppriv.bandwidth = (u8)bandwidth;
padapter->mppriv.preamble = sg; padapter->mppriv.preamble = sg;
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "Change BW %d to BW %d\n", pHalData->current_channel_bw , bandwidth); sprintf(extra, "Change BW %d to BW %d\n", pHalData->current_channel_bw , bandwidth);
SetBandwidth(padapter); SetBandwidth(padapter);
@ -592,7 +592,7 @@ int rtw_mp_txpower_index(struct net_device *dev,
if (wrqu->length > 128) if (wrqu->length > 128)
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
@ -681,7 +681,7 @@ int rtw_mp_ant_tx(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
@ -731,13 +731,13 @@ int rtw_mp_ant_rx(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
input[wrqu->length] = '\0'; input[wrqu->length] = '\0';
/*RTW_INFO("%s: input=%s\n", __func__, input);*/ /*RTW_INFO("%s: input=%s\n", __func__, input);*/
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "switch Rx antenna to %s", input); sprintf(extra, "switch Rx antenna to %s", input);
@ -848,7 +848,7 @@ int rtw_mp_ctx(struct net_device *dev,
} }
/*RTW_INFO("%s: count=%d countPkTx=%d cotuTx=%d CarrSprTx=%d scTx=%d sgleTx=%d pkTx=%d stop=%d\n", __func__, count, countPkTx, cotuTx, CarrSprTx, pkTx, sgleTx, scTx, stop);*/ /*RTW_INFO("%s: count=%d countPkTx=%d cotuTx=%d CarrSprTx=%d scTx=%d sgleTx=%d pkTx=%d stop=%d\n", __func__, count, countPkTx, cotuTx, CarrSprTx, pkTx, sgleTx, scTx, stop);*/
_rtw_memset(extra, '\0', strlen(extra)); memset(extra, '\0', strlen(extra));
if (pktinterval != 0) { if (pktinterval != 0) {
sprintf(extra, "Pkt Interval = %d", pktinterval); sprintf(extra, "Pkt Interval = %d", pktinterval);
@ -913,7 +913,7 @@ int rtw_mp_disable_bt_coexist(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->data.length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->data.length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
return -EFAULT; return -EFAULT;
@ -1044,7 +1044,7 @@ int rtw_mp_arx(struct net_device *dev,
pmppriv->bSetRxBssid = _FALSE; pmppriv->bSetRxBssid = _FALSE;
sprintf(extra, "Received packet OK:%d CRC error:%d ,Filter out:%d", padapter->mppriv.rx_pktcount, padapter->mppriv.rx_crcerrpktcount, padapter->mppriv.rx_pktcount_filter_out); sprintf(extra, "Received packet OK:%d CRC error:%d ,Filter out:%d", padapter->mppriv.rx_pktcount, padapter->mppriv.rx_crcerrpktcount, padapter->mppriv.rx_pktcount_filter_out);
} else if (bQueryPhy) { } else if (bQueryPhy) {
_rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); memset(&rx_counter, 0, sizeof(struct dbg_rx_counter));
rtw_dump_phy_rx_counters(padapter, &rx_counter); rtw_dump_phy_rx_counters(padapter, &rx_counter);
RTW_INFO("%s: OFDM_FA =%d\n", __func__, rx_counter.rx_ofdm_fa); RTW_INFO("%s: OFDM_FA =%d\n", __func__, rx_counter.rx_ofdm_fa);
@ -1053,7 +1053,7 @@ int rtw_mp_arx(struct net_device *dev,
} else if (bQueryMac) { } else if (bQueryMac) {
_rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); memset(&rx_counter, 0, sizeof(struct dbg_rx_counter));
rtw_dump_mac_rx_counters(padapter, &rx_counter); rtw_dump_mac_rx_counters(padapter, &rx_counter);
sprintf(extra, "Mac Received packet OK: %d , CRC error: %d , Drop Packets: %d\n", sprintf(extra, "Mac Received packet OK: %d , CRC error: %d , Drop Packets: %d\n",
rx_counter.rx_pkt_ok, rx_counter.rx_pkt_crc_error, rx_counter.rx_pkt_drop); rx_counter.rx_pkt_ok, rx_counter.rx_pkt_crc_error, rx_counter.rx_pkt_drop);
@ -1118,7 +1118,7 @@ int rtw_mp_trx_query(struct net_device *dev,
rxfail = padapter->mppriv.rx_crcerrpktcount; rxfail = padapter->mppriv.rx_crcerrpktcount;
rxfilterout = padapter->mppriv.rx_pktcount_filter_out; rxfilterout = padapter->mppriv.rx_pktcount_filter_out;
_rtw_memset(extra, '\0', 128); memset(extra, '\0', 128);
sprintf(extra, "Tx OK:%d, Tx Fail:%d, Rx OK:%d, CRC error:%d ,Rx Filter out:%d\n", txok, txfail, rxok, rxfail, rxfilterout); sprintf(extra, "Tx OK:%d, Tx Fail:%d, Rx OK:%d, CRC error:%d ,Rx Filter out:%d\n", txok, txfail, rxok, rxfail, rxfilterout);
@ -1144,7 +1144,7 @@ int rtw_mp_pwrtrk(struct net_device *dev,
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
enable = 1; enable = 1;
if (wrqu->length > 1) { if (wrqu->length > 1) {
@ -1182,7 +1182,7 @@ int rtw_mp_psd(struct net_device *dev,
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
return -EFAULT; return -EFAULT;
_rtw_memset(input, 0, sizeof(input)); memset(input, 0, sizeof(input));
if (copy_from_user(input, wrqu->pointer, wrqu->length)) if (copy_from_user(input, wrqu->pointer, wrqu->length))
return -EFAULT; return -EFAULT;
@ -1288,7 +1288,7 @@ int rtw_mp_reset_stats(struct net_device *dev,
rtw_reset_phy_rx_counters(padapter); rtw_reset_phy_rx_counters(padapter);
rtw_reset_mac_rx_counters(padapter); rtw_reset_mac_rx_counters(padapter);
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
sprintf(extra, "mp_reset_stats ok\n"); sprintf(extra, "mp_reset_stats ok\n");
wrqu->length = strlen(extra); wrqu->length = strlen(extra);
@ -1375,7 +1375,7 @@ int rtw_mp_SetRFPath(struct net_device *dev,
bMain = strncmp(input, "1", 2); /* strncmp TRUE is 0*/ bMain = strncmp(input, "1", 2); /* strncmp TRUE is 0*/
bTurnoff = strncmp(input, "0", 3); /* strncmp TRUE is 0*/ bTurnoff = strncmp(input, "0", 3); /* strncmp TRUE is 0*/
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
#ifdef CONFIG_ANTENNA_DIVERSITY #ifdef CONFIG_ANTENNA_DIVERSITY
if (bMain == 0) if (bMain == 0)
ret = rtw_mp_set_antdiv(padapter, _TRUE); ret = rtw_mp_set_antdiv(padapter, _TRUE);
@ -1431,7 +1431,7 @@ int rtw_mp_switch_rf_path(struct net_device *dev,
btg = strncmp(input, "BTG", 3); /* strncmp TRUE is 0*/ btg = strncmp(input, "BTG", 3); /* strncmp TRUE is 0*/
bbt = strncmp(input, "BT", 3); /* strncmp TRUE is 0*/ bbt = strncmp(input, "BT", 3); /* strncmp TRUE is 0*/
_rtw_memset(extra, 0, wrqu->length); memset(extra, 0, wrqu->length);
#ifdef CONFIG_RTL8821C /* only support for 8821c wlg/wla/btg/bt RF switch path */ #ifdef CONFIG_RTL8821C /* only support for 8821c wlg/wla/btg/bt RF switch path */
if (bwlg == 0) { if (bwlg == 0) {
pmp_priv->rf_path_cfg = SWITCH_TO_WLG; pmp_priv->rf_path_cfg = SWITCH_TO_WLG;
@ -1667,7 +1667,7 @@ int rtw_mp_pretx_proc(PADAPTER padapter, u8 bStartTest, char *extra)
if (pmp_priv->tx.stop == 0) { if (pmp_priv->tx.stop == 0) {
pmp_priv->tx.stop = 1; pmp_priv->tx.stop = 1;
rtw_msleep_os(5); msleep(5);
} }
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
if(padapter->registrypriv.ht_enable && if(padapter->registrypriv.ht_enable &&
@ -1734,7 +1734,7 @@ int rtw_mp_tx(struct net_device *dev,
pmp_priv->tx.count = count; pmp_priv->tx.count = count;
return 0; return 0;
} else if (strncmp(extra, "setting", 7) == 0) { } else if (strncmp(extra, "setting", 7) == 0) {
_rtw_memset(extra, 0, wrqu->data.length); memset(extra, 0, wrqu->data.length);
pextra += sprintf(pextra, "Current Setting :\n Channel:%d", pmp_priv->channel); pextra += sprintf(pextra, "Current Setting :\n Channel:%d", pmp_priv->channel);
pextra += sprintf(pextra, "\n Bandwidth:%d", pmp_priv->bandwidth); pextra += sprintf(pextra, "\n Bandwidth:%d", pmp_priv->bandwidth);
pextra += sprintf(pextra, "\n Rate index:%d", pmp_priv->rateidx); pextra += sprintf(pextra, "\n Rate index:%d", pmp_priv->rateidx);
@ -1747,7 +1747,7 @@ int rtw_mp_tx(struct net_device *dev,
#ifdef CONFIG_MP_VHT_HW_TX_MODE #ifdef CONFIG_MP_VHT_HW_TX_MODE
} else if (strncmp(extra, "pmact", 5) == 0) { } else if (strncmp(extra, "pmact", 5) == 0) {
if (strncmp(extra, "pmact=", 6) == 0) { if (strncmp(extra, "pmact=", 6) == 0) {
_rtw_memset(&pMptCtx->PMacTxInfo, 0, sizeof(pMptCtx->PMacTxInfo)); memset(&pMptCtx->PMacTxInfo, 0, sizeof(pMptCtx->PMacTxInfo));
if (strncmp(extra, "pmact=start", 11) == 0) { if (strncmp(extra, "pmact=start", 11) == 0) {
pMptCtx->PMacTxInfo.bEnPMacTx = _TRUE; pMptCtx->PMacTxInfo.bEnPMacTx = _TRUE;
sprintf(extra, "Set PMac Tx Mode start\n"); sprintf(extra, "Set PMac Tx Mode start\n");
@ -1792,7 +1792,7 @@ int rtw_mp_tx(struct net_device *dev,
pMptCtx->PMacTxInfo.Ntx++; pMptCtx->PMacTxInfo.Ntx++;
} }
_rtw_memset(pMptCtx->PMacTxInfo.MacAddress, 0xFF, ETH_ALEN); memset(pMptCtx->PMacTxInfo.MacAddress, 0xFF, ETH_ALEN);
PMAC_Get_Pkt_Param(&pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo); PMAC_Get_Pkt_Param(&pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo);
@ -1878,7 +1878,7 @@ int rtw_mp_tx(struct net_device *dev,
if (sscanf(extra, "ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d", &channel, &bandwidth, &rate, &txpower, &ant, &txmode) < 6) { if (sscanf(extra, "ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d", &channel, &bandwidth, &rate, &txpower, &ant, &txmode) < 6) {
RTW_INFO("Invalid format [ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d]\n", channel, bandwidth, rate, txpower, ant, txmode); RTW_INFO("Invalid format [ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d]\n", channel, bandwidth, rate, txpower, ant, txmode);
_rtw_memset(extra, 0, wrqu->data.length); memset(extra, 0, wrqu->data.length);
pextra += sprintf(pextra, "\n Please input correct format as bleow:\n"); pextra += sprintf(pextra, "\n Please input correct format as bleow:\n");
pextra += sprintf(pextra, "\t ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d\n", channel, bandwidth, rate, txpower, ant, txmode); pextra += sprintf(pextra, "\t ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d\n", channel, bandwidth, rate, txpower, ant, txmode);
pextra += sprintf(pextra, "\n [ ch : BGN = <1~14> , A or AC = <36~165> ]"); pextra += sprintf(pextra, "\n [ ch : BGN = <1~14> , A or AC = <36~165> ]");
@ -1897,7 +1897,7 @@ int rtw_mp_tx(struct net_device *dev,
} else { } else {
char *pextra = extra; char *pextra = extra;
RTW_INFO("Got format [ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d]\n", channel, bandwidth, rate, txpower, ant, txmode); RTW_INFO("Got format [ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d]\n", channel, bandwidth, rate, txpower, ant, txmode);
_rtw_memset(extra, 0, wrqu->data.length); memset(extra, 0, wrqu->data.length);
sprintf(extra, "Change Current channel %d to channel %d", padapter->mppriv.channel , channel); sprintf(extra, "Change Current channel %d to channel %d", padapter->mppriv.channel , channel);
padapter->mppriv.channel = channel; padapter->mppriv.channel = channel;
SetChannel(padapter); SetChannel(padapter);
@ -2041,7 +2041,7 @@ int rtw_mp_rx(struct net_device *dev,
#endif #endif
if (strncmp(extra, "stop", 4) == 0) { if (strncmp(extra, "stop", 4) == 0) {
_rtw_memset(extra, 0, wrqu->data.length); memset(extra, 0, wrqu->data.length);
SetPacketRx(padapter, bStartRx, _FALSE); SetPacketRx(padapter, bStartRx, _FALSE);
pmp_priv->bmac_filter = _FALSE; pmp_priv->bmac_filter = _FALSE;
sprintf(extra, "Received packet OK:%d CRC error:%d ,Filter out:%d", padapter->mppriv.rx_pktcount, padapter->mppriv.rx_crcerrpktcount, padapter->mppriv.rx_pktcount_filter_out); sprintf(extra, "Received packet OK:%d CRC error:%d ,Filter out:%d", padapter->mppriv.rx_pktcount, padapter->mppriv.rx_crcerrpktcount, padapter->mppriv.rx_pktcount_filter_out);
@ -2050,7 +2050,7 @@ int rtw_mp_rx(struct net_device *dev,
} else if (sscanf(extra, "ch=%d,bw=%d,ant=%d", &channel, &bandwidth, &ant) < 3) { } else if (sscanf(extra, "ch=%d,bw=%d,ant=%d", &channel, &bandwidth, &ant) < 3) {
RTW_INFO("Invalid format [ch=%d,bw=%d,ant=%d]\n", channel, bandwidth, ant); RTW_INFO("Invalid format [ch=%d,bw=%d,ant=%d]\n", channel, bandwidth, ant);
_rtw_memset(extra, 0, wrqu->data.length); memset(extra, 0, wrqu->data.length);
pextra += sprintf(pextra, "\n Please input correct format as bleow:\n"); pextra += sprintf(pextra, "\n Please input correct format as bleow:\n");
pextra += sprintf(pextra, "\t ch=%d,bw=%d,ant=%d\n", channel, bandwidth, ant); pextra += sprintf(pextra, "\t ch=%d,bw=%d,ant=%d\n", channel, bandwidth, ant);
pextra += sprintf(pextra, "\n [ ch : BGN = <1~14> , A or AC = <36~165> ]"); pextra += sprintf(pextra, "\n [ ch : BGN = <1~14> , A or AC = <36~165> ]");
@ -2063,7 +2063,7 @@ int rtw_mp_rx(struct net_device *dev,
char *pextra = extra; char *pextra = extra;
bStartRx = 1; bStartRx = 1;
RTW_INFO("Got format [ch=%d,bw=%d,ant=%d]\n", channel, bandwidth, ant); RTW_INFO("Got format [ch=%d,bw=%d,ant=%d]\n", channel, bandwidth, ant);
_rtw_memset(extra, 0, wrqu->data.length); memset(extra, 0, wrqu->data.length);
sprintf(extra, "Change Current channel %d to channel %d", padapter->mppriv.channel , channel); sprintf(extra, "Change Current channel %d to channel %d", padapter->mppriv.channel , channel);
padapter->mppriv.channel = channel; padapter->mppriv.channel = channel;
SetChannel(padapter); SetChannel(padapter);
@ -2153,9 +2153,9 @@ int rtw_mp_hwtx(struct net_device *dev,
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length))
return -EFAULT; return -EFAULT;
_rtw_memset(&pMptCtx->PMacTxInfo, 0, sizeof(RT_PMAC_TX_INFO)); memset(&pMptCtx->PMacTxInfo, 0, sizeof(RT_PMAC_TX_INFO));
_rtw_memcpy((void *)&pMptCtx->PMacTxInfo, (void *)input, sizeof(RT_PMAC_TX_INFO)); _rtw_memcpy((void *)&pMptCtx->PMacTxInfo, (void *)input, sizeof(RT_PMAC_TX_INFO));
_rtw_memset(wrqu->data.pointer, 0, wrqu->data.length); memset(wrqu->data.pointer, 0, wrqu->data.length);
if (pMptCtx->PMacTxInfo.bEnPMacTx == 1 && pmp_priv->mode != MP_ON) { if (pMptCtx->PMacTxInfo.bEnPMacTx == 1 && pmp_priv->mode != MP_ON) {
sprintf(extra, "MP Tx Running, Please Set PMac Tx Mode Stop\n"); sprintf(extra, "MP Tx Running, Please Set PMac Tx Mode Stop\n");
@ -2236,7 +2236,7 @@ int rtw_efuse_mask_file(struct net_device *dev,
u8 Status; u8 Status;
PADAPTER padapter = rtw_netdev_priv(dev); PADAPTER padapter = rtw_netdev_priv(dev);
_rtw_memset(maskfileBuffer, 0x00, sizeof(maskfileBuffer)); memset(maskfileBuffer, 0x00, sizeof(maskfileBuffer));
if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length))
return -EFAULT; return -EFAULT;
@ -2334,7 +2334,7 @@ int rtw_efuse_file_map(struct net_device *dev,
rtw_efuse_file_map_path = extra; rtw_efuse_file_map_path = extra;
_rtw_memset(pEfuseHal->fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN); memset(pEfuseHal->fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN);
if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) { if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) {
RTW_INFO("%s do rtw_efuse_mask_file_read = %s!\n", __func__, rtw_efuse_file_map_path); RTW_INFO("%s do rtw_efuse_mask_file_read = %s!\n", __func__, rtw_efuse_file_map_path);
@ -2371,7 +2371,7 @@ int rtw_bt_efuse_file_map(struct net_device *dev,
rtw_efuse_file_map_path = extra; rtw_efuse_file_map_path = extra;
_rtw_memset(pEfuseHal->fakeBTEfuseModifiedMap, 0xFF, EFUSE_BT_MAX_MAP_LEN); memset(pEfuseHal->fakeBTEfuseModifiedMap, 0xFF, EFUSE_BT_MAX_MAP_LEN);
if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) { if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) {
RTW_INFO("%s do rtw_efuse_mask_file_read = %s!\n", __func__, rtw_efuse_file_map_path); RTW_INFO("%s do rtw_efuse_mask_file_read = %s!\n", __func__, rtw_efuse_file_map_path);
@ -2460,10 +2460,10 @@ int rtw_mp_SetBT(struct net_device *dev,
MPT_PwrCtlDM(padapter, 0); MPT_PwrCtlDM(padapter, 0);
rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004));
rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF));
rtw_msleep_os(600); msleep(600);
rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010));
rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB));
rtw_msleep_os(1200); msleep(1200);
pBTFirmware = (PRT_MP_FIRMWARE)rtw_zmalloc(sizeof(RT_MP_FIRMWARE)); pBTFirmware = (PRT_MP_FIRMWARE)rtw_zmalloc(sizeof(RT_MP_FIRMWARE));
if (pBTFirmware == NULL) if (pBTFirmware == NULL)
goto exit; goto exit;
@ -2473,13 +2473,13 @@ int rtw_mp_SetBT(struct net_device *dev,
rtw_mfree((u8 *)pBTFirmware, sizeof(RT_MP_FIRMWARE)); rtw_mfree((u8 *)pBTFirmware, sizeof(RT_MP_FIRMWARE));
RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n"); RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n");
rtw_msleep_os(2000); msleep(2000);
_rtw_memset(extra, '\0', wrqu->data.length); memset(extra, '\0', wrqu->data.length);
BtReq.opCodeVer = 1; BtReq.opCodeVer = 1;
BtReq.OpCode = 0; BtReq.OpCode = 0;
BtReq.paraLength = 0; BtReq.paraLength = 0;
mptbt_BtControlProcess(padapter, &BtReq); mptbt_BtControlProcess(padapter, &BtReq);
rtw_msleep_os(100); msleep(100);
RTW_INFO("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4], pMptCtx->mptOutBuf[5]); RTW_INFO("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4], pMptCtx->mptOutBuf[5]);
if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) { if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) {
@ -2522,10 +2522,10 @@ int rtw_mp_SetBT(struct net_device *dev,
MPT_PwrCtlDM(padapter, 0); MPT_PwrCtlDM(padapter, 0);
rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004));
rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF));
rtw_msleep_os(600); msleep(600);
rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010));
rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB));
rtw_msleep_os(1200); msleep(1200);
#if defined(CONFIG_PLATFORM_SPRD) && (MP_DRIVER == 1) #if defined(CONFIG_PLATFORM_SPRD) && (MP_DRIVER == 1)
/* Pull up BT reset pin.*/ /* Pull up BT reset pin.*/
@ -2538,19 +2538,19 @@ int rtw_mp_SetBT(struct net_device *dev,
status = rtl8723b_FirmwareDownload(padapter, _FALSE); status = rtl8723b_FirmwareDownload(padapter, _FALSE);
#endif #endif
RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n"); RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n");
rtw_msleep_os(1000); msleep(1000);
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
rtw_btcoex_HaltNotify(padapter); rtw_btcoex_HaltNotify(padapter);
RTW_INFO("SetBT btcoex HaltNotify !\n"); RTW_INFO("SetBT btcoex HaltNotify !\n");
/*hal_btcoex1ant_SetAntPath(padapter);*/ /*hal_btcoex1ant_SetAntPath(padapter);*/
rtw_btcoex_SetManualControl(padapter, _TRUE); rtw_btcoex_SetManualControl(padapter, _TRUE);
#endif #endif
_rtw_memset(extra, '\0', wrqu->data.length); memset(extra, '\0', wrqu->data.length);
BtReq.opCodeVer = 1; BtReq.opCodeVer = 1;
BtReq.OpCode = 0; BtReq.OpCode = 0;
BtReq.paraLength = 0; BtReq.paraLength = 0;
mptbt_BtControlProcess(padapter, &BtReq); mptbt_BtControlProcess(padapter, &BtReq);
rtw_msleep_os(200); msleep(200);
RTW_INFO("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4], pMptCtx->mptOutBuf[5]); RTW_INFO("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4], pMptCtx->mptOutBuf[5]);
if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) { if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) {
@ -2562,7 +2562,7 @@ int rtw_mp_SetBT(struct net_device *dev,
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
rtw_btcoex_SwitchBtTRxMask(padapter); rtw_btcoex_SwitchBtTRxMask(padapter);
#endif #endif
rtw_msleep_os(200); msleep(200);
sprintf(extra, "download FW OK.\n"); sprintf(extra, "download FW OK.\n");
goto exit; goto exit;
} }
@ -2583,23 +2583,23 @@ int rtw_mp_SetBT(struct net_device *dev,
MPT_PwrCtlDM(padapter, 0); MPT_PwrCtlDM(padapter, 0);
rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004));
rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF));
rtw_msleep_os(600); msleep(600);
/*rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)& 0xFFFFFFFE));*/ /*rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)& 0xFFFFFFFE));*/
rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010));
rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB));
rtw_msleep_os(1200); msleep(1200);
goto exit; goto exit;
} }
if (strncmp(extra, "disable", 7) == 0) { if (strncmp(extra, "disable", 7) == 0) {
RTW_INFO("SetBT disable !\n"); RTW_INFO("SetBT disable !\n");
rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a) & 0xFFFFFFFB)); rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a) & 0xFFFFFFFB));
rtw_msleep_os(500); msleep(500);
goto exit; goto exit;
} }
if (strncmp(extra, "enable", 6) == 0) { if (strncmp(extra, "enable", 6) == 0) {
RTW_INFO("SetBT enable !\n"); RTW_INFO("SetBT enable !\n");
rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a) | 0x00000004)); rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a) | 0x00000004));
rtw_msleep_os(500); msleep(500);
goto exit; goto exit;
} }
if (strncmp(extra, "h2c", 3) == 0) { if (strncmp(extra, "h2c", 3) == 0) {
@ -2703,7 +2703,7 @@ int rtw_mp_SetBT(struct net_device *dev,
} }
todo: todo:
_rtw_memset(extra, '\0', wrqu->data.length); memset(extra, '\0', wrqu->data.length);
if (pHalData->bBTFWReady == _FALSE) { if (pHalData->bBTFWReady == _FALSE) {
sprintf(extra, "BTFWReady = FALSE.\n"); sprintf(extra, "BTFWReady = FALSE.\n");

View File

@ -112,13 +112,13 @@ void rtw_reset_securitypriv(_adapter *adapter)
/* Backup the btkip_countermeasure information. */ /* Backup the btkip_countermeasure information. */
/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */ /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
_rtw_memset(&backupPMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); memset(&backupPMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE);
_rtw_memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); _rtw_memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE);
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex; backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure; backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time; backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
_rtw_memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv)); memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
/* Added by Albert 2009/02/18 */ /* Added by Albert 2009/02/18 */
/* Restore the PMK information to securitypriv structure for the following connection. */ /* Restore the PMK information to securitypriv structure for the following connection. */
@ -207,7 +207,7 @@ void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie)
p += sprintf(p, ")"); p += sprintf(p, ")");
_rtw_memset(&wrqu, 0, sizeof(wrqu)); memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.length = p - buff; wrqu.data.length = p - buff;

View File

@ -1009,7 +1009,7 @@ uint loadparam(_adapter *padapter)
) { ) {
if (rtw_country_code != rtw_country_unspecified) if (rtw_country_code != rtw_country_unspecified)
RTW_ERR("%s discard rtw_country_code not in alpha2\n", __func__); RTW_ERR("%s discard rtw_country_code not in alpha2\n", __func__);
_rtw_memset(registry_par->alpha2, 0xFF, 2); memset(registry_par->alpha2, 0xFF, 2);
} else } else
_rtw_memcpy(registry_par->alpha2, rtw_country_code, 2); _rtw_memcpy(registry_par->alpha2, rtw_country_code, 2);
@ -2129,12 +2129,12 @@ struct dvobj_priv *devobj_init(void)
#endif #endif
#ifdef CONFIG_RTW_CUSTOMER_STR #ifdef CONFIG_RTW_CUSTOMER_STR
_rtw_mutex_init(&pdvobj->customer_str_mutex); _rtw_mutex_init(&pdvobj->customer_str_mutex);
_rtw_memset(pdvobj->customer_str, 0xFF, RTW_CUSTOMER_STR_LEN); memset(pdvobj->customer_str, 0xFF, RTW_CUSTOMER_STR_LEN);
#endif #endif
pdvobj->processing_dev_remove = _FALSE; pdvobj->processing_dev_remove = _FALSE;
ATOMIC_SET(&pdvobj->disable_func, 0); atomic_set(&pdvobj->disable_func, 0);
rtw_macid_ctl_init(&pdvobj->macid_ctl); rtw_macid_ctl_init(&pdvobj->macid_ctl);
#ifdef CONFIG_CLIENT_PORT_CFG #ifdef CONFIG_CLIENT_PORT_CFG
@ -2199,7 +2199,6 @@ void devobj_deinit(struct dvobj_priv *pdvobj)
#ifdef CONFIG_MCC_MODE #ifdef CONFIG_MCC_MODE
_rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_mutex)); _rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_mutex));
_rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_tsf_req_mutex)); _rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_tsf_req_mutex));
_rtw_spinlock_free(&pdvobj->mcc_objpriv.mcc_lock);
#endif /* CONFIG_MCC_MODE */ #endif /* CONFIG_MCC_MODE */
_rtw_mutex_free(&pdvobj->hw_init_mutex); _rtw_mutex_free(&pdvobj->hw_init_mutex);
@ -2219,22 +2218,10 @@ void devobj_deinit(struct dvobj_priv *pdvobj)
_rtw_mutex_free(&pdvobj->syson_indirect_access_mutex); _rtw_mutex_free(&pdvobj->syson_indirect_access_mutex);
#endif #endif
rtw_macid_ctl_deinit(&pdvobj->macid_ctl);
#ifdef CONFIG_CLIENT_PORT_CFG
rtw_clt_port_deinit(&pdvobj->clt_port);
#endif
_rtw_spinlock_free(&pdvobj->cam_ctl.lock);
_rtw_mutex_free(&pdvobj->cam_ctl.sec_cam_access_mutex); _rtw_mutex_free(&pdvobj->cam_ctl.sec_cam_access_mutex);
#if defined(RTK_129X_PLATFORM) && defined(CONFIG_PCI_HCI)
_rtw_spinlock_free(&pdvobj->io_reg_lock);
#endif
#ifdef CONFIG_MBSSID_CAM #ifdef CONFIG_MBSSID_CAM
rtw_mbid_cam_deinit(pdvobj); rtw_mbid_cam_deinit(pdvobj);
#endif
#ifdef CONFIG_SUPPORT_MULTI_BCN
_rtw_spinlock_free(&(pdvobj->ap_if_q.lock));
#endif #endif
rtw_mfree((u8 *)pdvobj, sizeof(*pdvobj)); rtw_mfree((u8 *)pdvobj, sizeof(*pdvobj));
} }
@ -2410,7 +2397,7 @@ u8 rtw_init_drv_sw(_adapter *padapter)
_rtw_spinlock_init(&padapter->security_key_mutex); _rtw_spinlock_init(&padapter->security_key_mutex);
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */
/* _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */ /* memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */
if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) { if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
RTW_INFO("Can't _rtw_init_sta_priv\n"); RTW_INFO("Can't _rtw_init_sta_priv\n");
@ -2437,7 +2424,7 @@ u8 rtw_init_drv_sw(_adapter *padapter)
rtw_init_pwrctrl_priv(padapter); rtw_init_pwrctrl_priv(padapter);
/* _rtw_memset((u8 *)&padapter->qospriv, 0, sizeof (struct qos_priv)); */ /* move to mlme_priv */ /* memset((u8 *)&padapter->qospriv, 0, sizeof (struct qos_priv)); */ /* move to mlme_priv */
#ifdef CONFIG_MP_INCLUDED #ifdef CONFIG_MP_INCLUDED
if (init_mp_priv(padapter) == _FAIL) if (init_mp_priv(padapter) == _FAIL)
@ -2580,11 +2567,6 @@ u8 rtw_free_drv_sw(_adapter *padapter)
} }
#endif #endif
/* add for CONFIG_IEEE80211W, none 11w also can use */ /* add for CONFIG_IEEE80211W, none 11w also can use */
_rtw_spinlock_free(&padapter->security_key_mutex);
#ifdef CONFIG_BR_EXT
_rtw_spinlock_free(&padapter->br_ext_lock);
#endif /* CONFIG_BR_EXT */
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
rtw_free_intel_widi(padapter); rtw_free_intel_widi(padapter);
@ -2898,7 +2880,7 @@ free_drv_sw:
rtw_free_drv_sw(padapter); rtw_free_drv_sw(padapter);
free_adapter: free_adapter:
if (res != _SUCCESS && padapter) { if (res != _SUCCESS && padapter) {
rtw_vmfree((u8 *)padapter, sizeof(*padapter)); vfree((u8 *)padapter);
padapter = NULL; padapter = NULL;
} }
exit: exit:
@ -2958,7 +2940,7 @@ void rtw_drv_free_vir_if(_adapter *padapter)
/* TODO: use rtw_os_ndevs_deinit instead at the first stage of driver's dev deinit function */ /* TODO: use rtw_os_ndevs_deinit instead at the first stage of driver's dev deinit function */
rtw_os_ndev_free(padapter); rtw_os_ndev_free(padapter);
rtw_vmfree((u8 *)padapter, sizeof(_adapter)); vfree(padapter);
} }
@ -3015,7 +2997,7 @@ static int rtw_inetaddr_notifier_call(struct notifier_block *nb,
ifa->ifa_label, pmlmeinfo->ip_addr); ifa->ifa_label, pmlmeinfo->ip_addr);
break; break;
case NETDEV_DOWN: case NETDEV_DOWN:
_rtw_memset(pmlmeinfo->ip_addr, 0, RTW_IP_ADDR_LEN); memset(pmlmeinfo->ip_addr, 0, RTW_IP_ADDR_LEN);
RTW_DBG("%s[%s]: down IP: %pI4\n", __func__, RTW_DBG("%s[%s]: down IP: %pI4\n", __func__,
ifa->ifa_label, pmlmeinfo->ip_addr); ifa->ifa_label, pmlmeinfo->ip_addr);
break; break;
@ -3071,7 +3053,7 @@ static int rtw_inet6addr_notifier_call(struct notifier_block *nb,
#ifdef CONFIG_WOWLAN #ifdef CONFIG_WOWLAN
pwrctl->wowlan_ns_offload_en = _FALSE; pwrctl->wowlan_ns_offload_en = _FALSE;
#endif #endif
_rtw_memset(pmlmeinfo->ip6_addr, 0, RTW_IPv6_ADDR_LEN); memset(pmlmeinfo->ip6_addr, 0, RTW_IPv6_ADDR_LEN);
RTW_DBG("%s: down IPv6 addrs: %pI6\n", __func__, RTW_DBG("%s: down IPv6 addrs: %pI6\n", __func__,
pmlmeinfo->ip6_addr); pmlmeinfo->ip6_addr);
break; break;
@ -3900,7 +3882,7 @@ static int netdev_close(struct net_device *pnetdev)
RTW_INFO("netdev_close, bips_processing=%d\n", pwrctl->bips_processing); RTW_INFO("netdev_close, bips_processing=%d\n", pwrctl->bips_processing);
while (pwrctl->bips_processing == _TRUE) /* waiting for ips_processing done before call rtw_dev_unload() */ while (pwrctl->bips_processing == _TRUE) /* waiting for ips_processing done before call rtw_dev_unload() */
rtw_msleep_os(1); msleep(1);
rtw_dev_unload(padapter); rtw_dev_unload(padapter);
rtw_sdio_set_power(0); rtw_sdio_set_power(0);
@ -4273,7 +4255,7 @@ void rtw_dev_unload(PADAPTER padapter)
{ {
rtw_stop_drv_threads(padapter); rtw_stop_drv_threads(padapter);
if (ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _TRUE) { if (atomic_read(&(pcmdpriv->cmdthd_running)) == _TRUE) {
RTW_ERR("cmd_thread not stop !!\n"); RTW_ERR("cmd_thread not stop !!\n");
rtw_warn_on(1); rtw_warn_on(1);
} }
@ -4664,7 +4646,7 @@ int rtw_suspend_common(_adapter *padapter)
pwrpriv->bInSuspend = _TRUE; pwrpriv->bInSuspend = _TRUE;
while (pwrpriv->bips_processing == _TRUE) while (pwrpriv->bips_processing == _TRUE)
rtw_msleep_os(1); msleep(1);
#ifdef CONFIG_IOL_READ_EFUSE_MAP #ifdef CONFIG_IOL_READ_EFUSE_MAP
if (!padapter->bup) { if (!padapter->bup) {

View File

@ -583,7 +583,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup
cfg80211_michael_mic_failure(padapter->pnetdev, sta->cmn.mac_addr, key_type, -1, NULL, GFP_ATOMIC); cfg80211_michael_mic_failure(padapter->pnetdev, sta->cmn.mac_addr, key_type, -1, NULL, GFP_ATOMIC);
#endif #endif
_rtw_memset(&ev, 0x00, sizeof(ev)); memset(&ev, 0x00, sizeof(ev));
if (bgroup) if (bgroup)
ev.flags |= IW_MICFAILURE_GROUP; ev.flags |= IW_MICFAILURE_GROUP;
else else
@ -592,7 +592,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup
ev.src_addr.sa_family = ARPHRD_ETHER; ev.src_addr.sa_family = ARPHRD_ETHER;
_rtw_memcpy(ev.src_addr.sa_data, sta->cmn.mac_addr, ETH_ALEN); _rtw_memcpy(ev.src_addr.sa_data, sta->cmn.mac_addr, ETH_ALEN);
_rtw_memset(&wrqu, 0x00, sizeof(wrqu)); memset(&wrqu, 0x00, sizeof(wrqu));
wrqu.data.length = sizeof(ev); wrqu.data.length = sizeof(ev);
#ifndef CONFIG_IOCTL_CFG80211 #ifndef CONFIG_IOCTL_CFG80211
@ -632,7 +632,7 @@ void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
/* skb_pull(skb, 24); */ /* skb_pull(skb, 24); */
_rtw_memset(skb->cb, 0, sizeof(skb->cb)); memset(skb->cb, 0, sizeof(skb->cb));
rtw_netif_rx(pmgnt_netdev, skb); rtw_netif_rx(pmgnt_netdev, skb);

View File

@ -1354,7 +1354,7 @@ void rtw_cfgvendor_rssi_monitor_evt(_adapter *padapter) {
goto exit; goto exit;
} }
_rtw_memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
data.version = RSSI_MONITOR_EVT_VERSION; data.version = RSSI_MONITOR_EVT_VERSION;
data.cur_rssi = rssi; data.cur_rssi = rssi;

View File

@ -2477,7 +2477,7 @@ ssize_t proc_set_btinfo_evt(struct file *file, const char __user *buffer, size_t
if (buffer && !copy_from_user(tmp, buffer, count)) { if (buffer && !copy_from_user(tmp, buffer, count)) {
int num = 0; int num = 0;
_rtw_memset(btinfo, 0, 8); memset(btinfo, 0, 8);
num = sscanf(tmp, "%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx" num = sscanf(tmp, "%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx"
, &btinfo[0], &btinfo[1], &btinfo[2], &btinfo[3] , &btinfo[0], &btinfo[1], &btinfo[2], &btinfo[3]
@ -4298,7 +4298,7 @@ ssize_t proc_set_phydm_cmd(struct file *file, const char __user *buffer, size_t
if (NULL == phydm_msg) if (NULL == phydm_msg)
return -ENOMEM; return -ENOMEM;
} else } else
_rtw_memset(phydm_msg, 0, PHYDM_MSG_LEN); memset(phydm_msg, 0, PHYDM_MSG_LEN);
phydm_cmd(phydm, tmp, count, 1, phydm_msg, PHYDM_MSG_LEN); phydm_cmd(phydm, tmp, count, 1, phydm_msg, PHYDM_MSG_LEN);

View File

@ -79,7 +79,7 @@ static void rtw_dev_shutdown(struct device *dev)
} }
} }
} }
ATOMIC_SET(&dvobj->continual_io_error, MAX_CONTINUAL_IO_ERR + 1); atomic_set(&dvobj->continual_io_error, MAX_CONTINUAL_IO_ERR + 1);
} }
} }
} }
@ -686,7 +686,7 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf)
devobj_deinit(dvobj); devobj_deinit(dvobj);
} }
/* RTW_INFO("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount)); */ /* RTW_INFO("%s %d\n", __func__, atomic_read(&usb_intf->dev.kobj.kref.refcount)); */
usb_put_dev(interface_to_usbdev(usb_intf)); usb_put_dev(interface_to_usbdev(usb_intf));
} }
@ -1399,7 +1399,7 @@ free_adapter:
#ifdef RTW_HALMAC #ifdef RTW_HALMAC
rtw_halmac_deinit_adapter(dvobj); rtw_halmac_deinit_adapter(dvobj);
#endif #endif
rtw_vmfree((u8 *)padapter, sizeof(*padapter)); vfree((u8 *)padapter);
padapter = NULL; padapter = NULL;
} }
exit: exit:
@ -1459,7 +1459,7 @@ static void rtw_usb_primary_adapter_deinit(_adapter *padapter)
rtw_halmac_deinit_adapter(adapter_to_dvobj(padapter)); rtw_halmac_deinit_adapter(adapter_to_dvobj(padapter));
#endif /* RTW_HALMAC */ #endif /* RTW_HALMAC */
rtw_vmfree((u8 *)padapter, sizeof(_adapter)); vfree(padapter);
#ifdef CONFIG_PLATFORM_RTD2880B #ifdef CONFIG_PLATFORM_RTD2880B
RTW_INFO("wlan link down\n"); RTW_INFO("wlan link down\n");

View File

@ -95,7 +95,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
} }
while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) { while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) {
_rtw_memset(pIo_buf, 0, len); memset(pIo_buf, 0, len);
if (requesttype == 0x01) { if (requesttype == 0x01) {
pipe = usb_rcvctrlpipe(udev, 0);/* read_in */ pipe = usb_rcvctrlpipe(udev, 0);/* read_in */
@ -106,7 +106,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
_rtw_memcpy(pIo_buf, pdata, len); _rtw_memcpy(pIo_buf, pdata, len);
} }
status = rtw_usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT); status = usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
if (status == len) { /* Success this control transfer. */ if (status == len) { /* Success this control transfer. */
rtw_reset_continual_io_error(pdvobjpriv); rtw_reset_continual_io_error(pdvobjpriv);
@ -173,7 +173,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
t_reg = 0x4e0; t_reg = 0x4e0;
status = rtw_usb_control_msg(udev, t_pipe, t_req, t_reqtype, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT); status = usb_control_msg(udev, t_pipe, t_req, t_reqtype, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT);
if (status == t_len) if (status == t_len)
rtw_reset_continual_io_error(pdvobjpriv); rtw_reset_continual_io_error(pdvobjpriv);
@ -753,7 +753,7 @@ void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
_adapter *padapter = (_adapter *)precvbuf->adapter; _adapter *padapter = (_adapter *)precvbuf->adapter;
struct recv_priv *precvpriv = &padapter->recvpriv; struct recv_priv *precvpriv = &padapter->recvpriv;
ATOMIC_DEC(&(precvpriv->rx_pending_cnt)); atomic_dec(&(precvpriv->rx_pending_cnt));
if (RTW_CANNOT_RX(padapter)) { if (RTW_CANNOT_RX(padapter)) {
RTW_INFO("%s() RX Warning! bDriverStopped(%s) OR bSurpriseRemoved(%s)\n" RTW_INFO("%s() RX Warning! bDriverStopped(%s) OR bSurpriseRemoved(%s)\n"
@ -837,7 +837,7 @@ u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
usb_init_recvbuf(adapter, precvbuf); usb_init_recvbuf(adapter, precvbuf);
if (precvbuf->pbuf) { if (precvbuf->pbuf) {
ATOMIC_INC(&(precvpriv->rx_pending_cnt)); atomic_inc(&(precvpriv->rx_pending_cnt));
purb = precvbuf->purb; purb = precvbuf->purb;
/* translate DMA FIFO addr to pipehandle */ /* translate DMA FIFO addr to pipehandle */
@ -906,7 +906,7 @@ void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
_adapter *padapter = (_adapter *)precvbuf->adapter; _adapter *padapter = (_adapter *)precvbuf->adapter;
struct recv_priv *precvpriv = &padapter->recvpriv; struct recv_priv *precvpriv = &padapter->recvpriv;
ATOMIC_DEC(&(precvpriv->rx_pending_cnt)); atomic_dec(&(precvpriv->rx_pending_cnt));
if (RTW_CANNOT_RX(padapter)) { if (RTW_CANNOT_RX(padapter)) {
RTW_INFO("%s() RX Warning! bDriverStopped(%s) OR bSurpriseRemoved(%s)\n" RTW_INFO("%s() RX Warning! bDriverStopped(%s) OR bSurpriseRemoved(%s)\n"
@ -1046,7 +1046,7 @@ recv_buf_hook:
goto exit; goto exit;
} }
ATOMIC_INC(&(precvpriv->rx_pending_cnt)); atomic_inc(&(precvpriv->rx_pending_cnt));
ret = _SUCCESS; ret = _SUCCESS;
exit: exit:

View File

@ -20,14 +20,6 @@
#define RT_TAG '1178' #define RT_TAG '1178'
#ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
atomic_t _malloc_cnt = ATOMIC_INIT(0);
atomic_t _malloc_size = ATOMIC_INIT(0);
#endif
#endif /* DBG_MEMORY_LEAK */
#if defined(PLATFORM_LINUX) #if defined(PLATFORM_LINUX)
/* /*
* Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE
@ -119,26 +111,6 @@ inline void *_rtw_zvmalloc(u32 sz)
return pbuf; return pbuf;
} }
inline void _rtw_vmfree(void *pbuf, u32 sz)
{
#ifdef PLATFORM_LINUX
vfree(pbuf);
#endif
#ifdef PLATFORM_FREEBSD
free(pbuf, M_DEVBUF);
#endif
#ifdef PLATFORM_WINDOWS
NdisFreeMemory(pbuf, sz, 0);
#endif
#ifdef DBG_MEMORY_LEAK
#ifdef PLATFORM_LINUX
atomic_dec(&_malloc_cnt);
atomic_sub(sz, &_malloc_size);
#endif
#endif /* DBG_MEMORY_LEAK */
}
void *_rtw_malloc(u32 sz) void *_rtw_malloc(u32 sz)
{ {
void *pbuf = NULL; void *pbuf = NULL;
@ -407,10 +379,10 @@ inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr
#if defined(DBG_MEM_ALLOC) #if defined(DBG_MEM_ALLOC)
struct rtw_mem_stat { struct rtw_mem_stat {
ATOMIC_T alloc; /* the memory bytes we allocate currently */ atomic_t alloc; /* the memory bytes we allocate currently */
ATOMIC_T peak; /* the peak memory bytes we allocate */ atomic_t peak; /* the peak memory bytes we allocate */
ATOMIC_T alloc_cnt; /* the alloc count for alloc currently */ atomic_t alloc_cnt; /* the alloc count for alloc currently */
ATOMIC_T alloc_err_cnt; /* the error times we fail to allocate memory */ atomic_t alloc_err_cnt; /* the error times we fail to allocate memory */
}; };
struct rtw_mem_stat rtw_mem_type_stat[mstat_tf_idx(MSTAT_TYPE_MAX)]; struct rtw_mem_stat rtw_mem_type_stat[mstat_tf_idx(MSTAT_TYPE_MAX)];
@ -448,18 +420,18 @@ void rtw_mstat_dump(void *sel)
int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err; int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err;
for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) { for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) {
value_t[0][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc)); value_t[0][i] = atomic_read(&(rtw_mem_type_stat[i].alloc));
value_t[1][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].peak)); value_t[1][i] = atomic_read(&(rtw_mem_type_stat[i].peak));
value_t[2][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc_cnt)); value_t[2][i] = atomic_read(&(rtw_mem_type_stat[i].alloc_cnt));
value_t[3][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc_err_cnt)); value_t[3][i] = atomic_read(&(rtw_mem_type_stat[i].alloc_err_cnt));
} }
#ifdef RTW_MEM_FUNC_STAT #ifdef RTW_MEM_FUNC_STAT
for (i = 0; i < mstat_ff_idx(MSTAT_FUNC_MAX); i++) { for (i = 0; i < mstat_ff_idx(MSTAT_FUNC_MAX); i++) {
value_f[0][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].alloc)); value_f[0][i] = atomic_read(&(rtw_mem_func_stat[i].alloc));
value_f[1][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].peak)); value_f[1][i] = atomic_read(&(rtw_mem_func_stat[i].peak));
value_f[2][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].alloc_cnt)); value_f[2][i] = atomic_read(&(rtw_mem_func_stat[i].alloc_cnt));
value_f[3][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].alloc_err_cnt)); value_f[3][i] = atomic_read(&(rtw_mem_func_stat[i].alloc_err_cnt));
} }
#endif #endif
@ -484,51 +456,51 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s
/* initialization */ /* initialization */
if (!update_time) { if (!update_time) {
for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) { for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) {
ATOMIC_SET(&(rtw_mem_type_stat[i].alloc), 0); atomic_set(&(rtw_mem_type_stat[i].alloc), 0);
ATOMIC_SET(&(rtw_mem_type_stat[i].peak), 0); atomic_set(&(rtw_mem_type_stat[i].peak), 0);
ATOMIC_SET(&(rtw_mem_type_stat[i].alloc_cnt), 0); atomic_set(&(rtw_mem_type_stat[i].alloc_cnt), 0);
ATOMIC_SET(&(rtw_mem_type_stat[i].alloc_err_cnt), 0); atomic_set(&(rtw_mem_type_stat[i].alloc_err_cnt), 0);
} }
#ifdef RTW_MEM_FUNC_STAT #ifdef RTW_MEM_FUNC_STAT
for (i = 0; i < mstat_ff_idx(MSTAT_FUNC_MAX); i++) { for (i = 0; i < mstat_ff_idx(MSTAT_FUNC_MAX); i++) {
ATOMIC_SET(&(rtw_mem_func_stat[i].alloc), 0); atomic_set(&(rtw_mem_func_stat[i].alloc), 0);
ATOMIC_SET(&(rtw_mem_func_stat[i].peak), 0); atomic_set(&(rtw_mem_func_stat[i].peak), 0);
ATOMIC_SET(&(rtw_mem_func_stat[i].alloc_cnt), 0); atomic_set(&(rtw_mem_func_stat[i].alloc_cnt), 0);
ATOMIC_SET(&(rtw_mem_func_stat[i].alloc_err_cnt), 0); atomic_set(&(rtw_mem_func_stat[i].alloc_err_cnt), 0);
} }
#endif #endif
} }
switch (status) { switch (status) {
case MSTAT_ALLOC_SUCCESS: case MSTAT_ALLOC_SUCCESS:
ATOMIC_INC(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt)); atomic_inc(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt));
alloc = ATOMIC_ADD_RETURN(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz); alloc = atomic_add_RETURN(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz);
peak = ATOMIC_READ(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak)); peak = atomic_read(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak));
if (peak < alloc) if (peak < alloc)
ATOMIC_SET(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak), alloc); atomic_set(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak), alloc);
#ifdef RTW_MEM_FUNC_STAT #ifdef RTW_MEM_FUNC_STAT
ATOMIC_INC(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt)); atomic_inc(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt));
alloc = ATOMIC_ADD_RETURN(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz); alloc = atomic_add_RETURN(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz);
peak = ATOMIC_READ(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak)); peak = atomic_read(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak));
if (peak < alloc) if (peak < alloc)
ATOMIC_SET(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak), alloc); atomic_set(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak), alloc);
#endif #endif
break; break;
case MSTAT_ALLOC_FAIL: case MSTAT_ALLOC_FAIL:
ATOMIC_INC(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_err_cnt)); atomic_inc(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_err_cnt));
#ifdef RTW_MEM_FUNC_STAT #ifdef RTW_MEM_FUNC_STAT
ATOMIC_INC(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_err_cnt)); atomic_inc(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_err_cnt));
#endif #endif
break; break;
case MSTAT_FREE: case MSTAT_FREE:
ATOMIC_DEC(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt)); atomic_dec(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt));
ATOMIC_SUB(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz); atomic_sub(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz);
#ifdef RTW_MEM_FUNC_STAT #ifdef RTW_MEM_FUNC_STAT
ATOMIC_DEC(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt)); atomic_dec(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt));
ATOMIC_SUB(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz); atomic_sub(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz);
#endif #endif
break; break;
}; };
@ -610,7 +582,7 @@ inline void dbg_rtw_vmfree(void *pbuf, u32 sz, const enum mstat_f flags, const c
if (match_mstat_sniff_rules(flags, sz)) if (match_mstat_sniff_rules(flags, sz))
RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
_rtw_vmfree((pbuf), (sz)); vfree((pbuf));
rtw_mstat_update( rtw_mstat_update(
flags flags
@ -873,11 +845,6 @@ void *rtw_malloc2d(int h, int w, size_t size)
return a; return a;
} }
void rtw_mfree2d(void *pbuf, int h, int w, int size)
{
rtw_mfree((u8 *)pbuf, h * sizeof(void *) + w * h * size);
}
inline void rtw_os_pkt_free(_pkt *pkt) inline void rtw_os_pkt_free(_pkt *pkt)
{ {
#if defined(PLATFORM_LINUX) #if defined(PLATFORM_LINUX)
@ -973,27 +940,6 @@ int _rtw_memcmp(const void *dst, const void *src, u32 sz)
}
void _rtw_memset(void *pbuf, int c, u32 sz)
{
#if defined(PLATFORM_LINUX) || defined (PLATFORM_FREEBSD)
memset(pbuf, c, sz);
#endif
#ifdef PLATFORM_WINDOWS
#if 0
NdisZeroMemory(pbuf, sz);
if (c != 0)
memset(pbuf, c, sz);
#else
NdisFillMemory(pbuf, sz, c);
#endif
#endif
} }
#ifdef PLATFORM_FREEBSD #ifdef PLATFORM_FREEBSD
@ -1398,19 +1344,6 @@ void _rtw_spinlock_init(_lock *plock)
} }
void _rtw_spinlock_free(_lock *plock)
{
#ifdef PLATFORM_FREEBSD
mtx_destroy(plock);
#endif
#ifdef PLATFORM_WINDOWS
NdisFreeSpinLock(plock);
#endif
}
#ifdef PLATFORM_FREEBSD #ifdef PLATFORM_FREEBSD
extern PADAPTER prtw_lock; extern PADAPTER prtw_lock;
@ -1517,7 +1450,6 @@ void _rtw_init_queue(_queue *pqueue)
void _rtw_deinit_queue(_queue *pqueue) void _rtw_deinit_queue(_queue *pqueue)
{ {
_rtw_spinlock_free(&(pqueue->lock));
} }
u32 _rtw_queue_empty(_queue *pqueue) u32 _rtw_queue_empty(_queue *pqueue)
@ -1644,32 +1576,6 @@ void rtw_sleep_schedulable(int ms)
} }
void rtw_msleep_os(int ms)
{
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36))
if (ms < 20) {
unsigned long us = ms * 1000UL;
usleep_range(us, us + 1000UL);
} else
#endif
msleep((unsigned int)ms);
#endif
#ifdef PLATFORM_FREEBSD
/* Delay for delay microseconds */
DELAY(ms * 1000);
return ;
#endif
#ifdef PLATFORM_WINDOWS
NdisMSleep(ms * 1000); /* (us)*1000=(ms) */
#endif
}
void rtw_usleep_os(int us) void rtw_usleep_os(int us)
{ {
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
@ -1707,7 +1613,7 @@ void _rtw_mdelay_os(int ms, const char *func, const int line)
#if 0 #if 0
if (ms > 10) if (ms > 10)
RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms); RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
rtw_msleep_os(ms); msleep(ms);
return; return;
#endif #endif
@ -1795,19 +1701,6 @@ void rtw_udelay_os(int us)
} }
#endif #endif
void rtw_yield_os(void)
{
#ifdef PLATFORM_LINUX
yield();
#endif
#ifdef PLATFORM_FREEBSD
yield();
#endif
#ifdef PLATFORM_WINDOWS
SwitchToThread();
#endif
}
bool rtw_macaddr_is_larger(const u8 *a, const u8 *b) bool rtw_macaddr_is_larger(const u8 *a, const u8 *b)
{ {
u32 va, vb; u32 va, vb;
@ -1966,137 +1859,6 @@ inline int rtw_test_and_clear_bit(int nr, unsigned long *addr)
#endif #endif
} }
inline void ATOMIC_SET(ATOMIC_T *v, int i)
{
#ifdef PLATFORM_LINUX
atomic_set(v, i);
#elif defined(PLATFORM_WINDOWS)
*v = i; /* other choice???? */
#elif defined(PLATFORM_FREEBSD)
atomic_set_int(v, i);
#endif
}
inline int ATOMIC_READ(ATOMIC_T *v)
{
#ifdef PLATFORM_LINUX
return atomic_read(v);
#elif defined(PLATFORM_WINDOWS)
return *v; /* other choice???? */
#elif defined(PLATFORM_FREEBSD)
return atomic_load_acq_32(v);
#endif
}
inline void ATOMIC_ADD(ATOMIC_T *v, int i)
{
#ifdef PLATFORM_LINUX
atomic_add(i, v);
#elif defined(PLATFORM_WINDOWS)
InterlockedAdd(v, i);
#elif defined(PLATFORM_FREEBSD)
atomic_add_int(v, i);
#endif
}
inline void ATOMIC_SUB(ATOMIC_T *v, int i)
{
#ifdef PLATFORM_LINUX
atomic_sub(i, v);
#elif defined(PLATFORM_WINDOWS)
InterlockedAdd(v, -i);
#elif defined(PLATFORM_FREEBSD)
atomic_subtract_int(v, i);
#endif
}
inline void ATOMIC_INC(ATOMIC_T *v)
{
#ifdef PLATFORM_LINUX
atomic_inc(v);
#elif defined(PLATFORM_WINDOWS)
InterlockedIncrement(v);
#elif defined(PLATFORM_FREEBSD)
atomic_add_int(v, 1);
#endif
}
inline void ATOMIC_DEC(ATOMIC_T *v)
{
#ifdef PLATFORM_LINUX
atomic_dec(v);
#elif defined(PLATFORM_WINDOWS)
InterlockedDecrement(v);
#elif defined(PLATFORM_FREEBSD)
atomic_subtract_int(v, 1);
#endif
}
inline int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i)
{
#ifdef PLATFORM_LINUX
return atomic_add_return(i, v);
#elif defined(PLATFORM_WINDOWS)
return InterlockedAdd(v, i);
#elif defined(PLATFORM_FREEBSD)
atomic_add_int(v, i);
return atomic_load_acq_32(v);
#endif
}
inline int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i)
{
#ifdef PLATFORM_LINUX
return atomic_sub_return(i, v);
#elif defined(PLATFORM_WINDOWS)
return InterlockedAdd(v, -i);
#elif defined(PLATFORM_FREEBSD)
atomic_subtract_int(v, i);
return atomic_load_acq_32(v);
#endif
}
inline int ATOMIC_INC_RETURN(ATOMIC_T *v)
{
#ifdef PLATFORM_LINUX
return atomic_inc_return(v);
#elif defined(PLATFORM_WINDOWS)
return InterlockedIncrement(v);
#elif defined(PLATFORM_FREEBSD)
atomic_add_int(v, 1);
return atomic_load_acq_32(v);
#endif
}
inline int ATOMIC_DEC_RETURN(ATOMIC_T *v)
{
#ifdef PLATFORM_LINUX
return atomic_dec_return(v);
#elif defined(PLATFORM_WINDOWS)
return InterlockedDecrement(v);
#elif defined(PLATFORM_FREEBSD)
atomic_subtract_int(v, 1);
return atomic_load_acq_32(v);
#endif
}
inline bool ATOMIC_INC_UNLESS(ATOMIC_T *v, int u)
{
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15))
return atomic_add_unless(v, 1, u);
#else
/* only make sure not exceed after this function */
if (ATOMIC_INC_RETURN(v) > u) {
ATOMIC_DEC(v);
return 0;
}
return 1;
#endif
#else
#error "TBD\n"
#endif
}
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
/* /*
* Open a file with the specific @param path, @param flag, @param mode * Open a file with the specific @param path, @param flag, @param mode
@ -2577,25 +2339,6 @@ void module_init_exit_wrapper(void *arg)
} }
#endif /* PLATFORM_FREEBSD */ #endif /* PLATFORM_FREEBSD */
#ifdef CONFIG_PLATFORM_SPRD
#ifdef do_div
#undef do_div
#endif
#include <asm-generic/div64.h>
#endif
u64 rtw_modular64(u64 x, u64 y)
{
#ifdef PLATFORM_LINUX
return do_div(x, y);
#elif defined(PLATFORM_WINDOWS)
return x % y;
#elif defined(PLATFORM_FREEBSD)
return x % y;
#endif
}
u64 rtw_division64(u64 x, u64 y) u64 rtw_division64(u64 x, u64 y)
{ {
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
@ -2796,7 +2539,7 @@ int map_readN(const struct map_t *map, u16 offset, u16 len, u8 *buf)
goto exit; goto exit;
} }
_rtw_memset(buf, map->init_value, len); memset(buf, map->init_value, len);
for (i = 0; i < map->seg_num; i++) { for (i = 0; i < map->seg_num; i++) {
u8 *c_dst, *c_src; u8 *c_dst, *c_src;