fix: Waddress (#298)

* fix: Waddress
This commit is contained in:
Konstantin Lebedev 2022-11-30 15:38:53 +05:00 committed by GitHub
parent f49a6c8ada
commit a4a3f52912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 79 deletions

View File

@ -4429,7 +4429,7 @@ static u8 rtw_ap_update_chbw_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp
int i; int i;
for (i = 0; i < dvobj->iface_nums; i++) { for (i = 0; i < dvobj->iface_nums; i++) {
if (!(ifbmp & BIT(i)) || !dvobj->padapters) if (!(ifbmp & BIT(i)) || !dvobj->padapters[i])
continue; continue;
iface = dvobj->padapters[i]; iface = dvobj->padapters[i];
@ -4449,7 +4449,7 @@ static u8 rtw_ap_update_chbw_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp
} }
for (i = 0; i < dvobj->iface_nums; i++) { for (i = 0; i < dvobj->iface_nums; i++) {
if (!(ifbmp & BIT(i)) || !dvobj->padapters) if (!(ifbmp & BIT(i)) || !dvobj->padapters[i])
continue; continue;
iface = dvobj->padapters[i]; iface = dvobj->padapters[i];
@ -4617,7 +4617,7 @@ u8 rtw_ap_chbw_decision(_adapter *adapter, u8 ifbmp, u8 excl_ifbmp
#ifdef CONFIG_RTW_MESH #ifdef CONFIG_RTW_MESH
for (i = 0; i < dvobj->iface_nums; i++) for (i = 0; i < dvobj->iface_nums; i++)
if ((ifbmp & BIT(i)) && dvobj->padapters) if ((ifbmp & BIT(i)) && dvobj->padapters[i])
if (!MLME_IS_MESH(dvobj->padapters[i])) if (!MLME_IS_MESH(dvobj->padapters[i]))
break; break;
ifbmp_all_mesh = i >= dvobj->iface_nums ? 1 : 0; ifbmp_all_mesh = i >= dvobj->iface_nums ? 1 : 0;

View File

@ -116,7 +116,7 @@ static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
/* have a room for new tag */ /* have a room for new tag */
memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length)); memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length));
ph->length = htons(ntohs(ph->length) + data_len); ph->length = htons(ntohs(ph->length) + data_len);
memcpy((unsigned char *)ph->tag, tag, data_len); memcpy((unsigned char *)ph->tag, tag, tag->tag_len);
return data_len; return data_len;
} }

View File

@ -923,7 +923,6 @@ void halrf_support_ability_debug(void *dm_void, char input[][16], u32 *_used,
u8 i; u8 i;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
if (input[i + 1])
PHYDM_SSCANF(input[i + 2], DCMD_DECIMAL, &dm_value[i]); PHYDM_SSCANF(input[i + 2], DCMD_DECIMAL, &dm_value[i]);
if (dm_value[0] == 100) { if (dm_value[0] == 100) {

View File

@ -77,7 +77,6 @@ void halrf_debug_trace(void *dm_void, char input[][16], u32 *_used,
u8 i; u8 i;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
if (input[i + 1])
PHYDM_SSCANF(input[i + 2], DCMD_DECIMAL, &rf_var[i]); PHYDM_SSCANF(input[i + 2], DCMD_DECIMAL, &rf_var[i]);
if (rf_var[0] == 100) { if (rf_var[0] == 100) {
@ -214,12 +213,10 @@ void halrf_cmd_parser(void *dm_void, char input[][16], u32 *_used, char *output,
case HALRF_IQK_DEBUG: case HALRF_IQK_DEBUG:
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 2], DCMD_HEX, PHYDM_SSCANF(input[i + 2], DCMD_HEX,
&rf_var[i]); &rf_var[i]);
input_idx++; input_idx++;
} }
}
if (input_idx >= 1) { if (input_idx >= 1) {
#if (RTL8822B_SUPPORT == 1 || RTL8821C_SUPPORT == 1) #if (RTL8822B_SUPPORT == 1 || RTL8821C_SUPPORT == 1)

View File

@ -1544,7 +1544,6 @@ void phydm_supportability_en(void *dm_void, char input[][16], u32 *_used,
u8 i; u8 i;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &dm_value[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &dm_value[i]);
} }
@ -1912,7 +1911,6 @@ void phydm_pause_func_console(void *dm_void, char input[][16], u32 *_used,
} }
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]); PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
} }

View File

@ -362,11 +362,9 @@ void phydm_adaptivity_debug(void *dm_void, char input[][16], u32 *_used,
s8 h2l_diff = 0; s8 h2l_diff = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &dm_value[i]); PHYDM_SSCANF(input[i + 1], DCMD_HEX, &dm_value[i]);
input_idx++; input_idx++;
} }
}
if (strcmp(input[1], help) == 0) { if (strcmp(input[1], help) == 0) {
PDM_SNPF(out_len, used, output + used, out_len - used, PDM_SNPF(out_len, used, output + used, out_len - used,
"Show adaptivity message: {0}\n"); "Show adaptivity message: {0}\n");

View File

@ -557,11 +557,9 @@ void phydm_config_trx_path_v1(void *dm_void, char input[][16], u32 *_used,
return; return;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &val[i]); PHYDM_SSCANF(input[i + 1], DCMD_HEX, &val[i]);
input_idx++; input_idx++;
} }
}
if (input_idx == 0) if (input_idx == 0)
return; return;
@ -1850,11 +1848,9 @@ void phydm_nbi_debug(void *dm_void, char input[][16], u32 *_used, char *output,
else else
idx_lmt = 5; idx_lmt = 5;
for (i = 0; i < idx_lmt; i++) { for (i = 0; i < idx_lmt; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]);
input_idx++; input_idx++;
} }
}
if (input_idx == 0) if (input_idx == 0)
return; return;
@ -1942,11 +1938,9 @@ void phydm_csi_debug(void *dm_void, char input[][16], u32 *_used, char *output,
idx_lmt = 5; idx_lmt = 5;
for (i = 0; i < idx_lmt; i++) { for (i = 0; i < idx_lmt; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]);
input_idx++; input_idx++;
} }
}
if (input_idx == 0) if (input_idx == 0)
return; return;

View File

@ -292,7 +292,6 @@ void phydm_fahm_dbg(void *dm_void, char input[][16], u32 *_used, char *output,
u32 i; u32 i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
} }
@ -1012,11 +1011,9 @@ void phydm_nhm_dbg(void *dm_void, char input[][16], u32 *_used, char *output,
ccx->nhm_manual_ctrl = 1; ccx->nhm_manual_ctrl = 1;
for (i = 1; i < 7; i++) { for (i = 1; i < 7; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL,
&var1[i]); &var1[i]);
} }
}
if (var1[0] == 1) { if (var1[0] == 1) {
nhm_para.incld_txon = NHM_EXCLUDE_TXON; nhm_para.incld_txon = NHM_EXCLUDE_TXON;
@ -1468,7 +1465,6 @@ void phydm_clm_dbg(void *dm_void, char input[][16], u32 *_used, char *output,
u32 i; u32 i;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
} }

View File

@ -2864,11 +2864,9 @@ void phydm_set_txagc_dbg(void *dm_void, char input[][16], u32 *_used,
u8 i = 0, input_idx = 0; u8 i = 0, input_idx = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]); PHYDM_SSCANF(input[i + 1], DCMD_HEX, &var1[i]);
input_idx++; input_idx++;
} }
}
if ((strcmp(input[1], help) == 0)) { if ((strcmp(input[1], help) == 0)) {
PDM_SNPF(out_len, used, output + used, out_len - used, PDM_SNPF(out_len, used, output + used, out_len - used,
@ -2906,7 +2904,6 @@ void phydm_debug_trace(void *dm_void, char input[][16], u32 *_used,
u8 i; u8 i;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]);
} }
comp = dm->debug_components; comp = dm->debug_components;
@ -3063,11 +3060,9 @@ void phydm_fw_debug_trace(void *dm_void, char input[][16], u32 *_used,
u32 comp = 0; u32 comp = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]);
input_idx++; input_idx++;
} }
}
if (input_idx == 0) if (input_idx == 0)
return; return;
@ -3379,7 +3374,6 @@ void phydm_dump_reg(void *dm_void, char input[][16], u32 *_used, char *output,
u32 out_len = *_out_len; u32 out_len = *_out_len;
u32 addr = 0; u32 addr = 0;
if (input[1])
PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]); PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]);
if ((strcmp(input[1], help) == 0)) { if ((strcmp(input[1], help) == 0)) {
@ -3563,7 +3557,6 @@ void phydm_per_tone_evm(void *dm_void, char input[][16], u32 *_used,
} }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var1[i]);
} }
@ -3817,11 +3810,9 @@ void phydm_ext_rf_element_ctrl(void *dm_void, char input[][16], u32 *_used,
u8 i = 0, input_idx = 0; u8 i = 0, input_idx = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &val[i]);
input_idx++; input_idx++;
} }
}
if (input_idx == 0) if (input_idx == 0)
return; return;
@ -4243,7 +4234,6 @@ void phydm_cmd_parser(struct dm_struct *dm, char input[][MAX_ARGV],
break; break;
case PHYDM_DIS_HTSTF_CONTROL: { case PHYDM_DIS_HTSTF_CONTROL: {
if (input[1])
PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]); PHYDM_SSCANF(input[1], DCMD_DECIMAL, &var1[0]);
if (var1[0] == 1) { if (var1[0] == 1) {

View File

@ -411,7 +411,6 @@ void phydm_psd_debug(void *dm_void, char input[][16], u32 *_used,
if (var1[0] == 0) { if (var1[0] == 0) {
for (i = 1; i < 10; i++) { for (i = 1; i < 10; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL,
&var1[i]); &var1[i]);
} }

View File

@ -125,11 +125,9 @@ void phydm_h2C_debug(void *dm_void, char input[][16], u32 *_used,
u8 phydm_h2c_id = 0; u8 phydm_h2c_id = 0;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
if (input[i + 1]) {
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &dm_value[i]); PHYDM_SSCANF(input[i + 1], DCMD_HEX, &dm_value[i]);
input_idx++; input_idx++;
} }
}
if (input_idx == 0) if (input_idx == 0)
return; return;
@ -193,7 +191,6 @@ void phydm_ra_debug(void *dm_void, char input[][16], u32 *_used, char *output,
u8 i = 0; u8 i = 0;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &var[i]);
} }

View File

@ -319,7 +319,6 @@ void phydm_cumitek_smt_ant_debug(
} else if (dm_value[0] == 2) { /*@fix tx pattern*/ } else if (dm_value[0] == 2) { /*@fix tx pattern*/
for (i = 1; i < 4; i++) { for (i = 1; i < 4; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &dm_value[i]); PHYDM_SSCANF(input[i + 1], DCMD_DECIMAL, &dm_value[i]);
} }
@ -333,7 +332,6 @@ void phydm_cumitek_smt_ant_debug(
u8 table_path_b[8] = {0}; u8 table_path_b[8] = {0};
for (i = 1; i < 4; i++) { for (i = 1; i < 4; i++) {
if (input[i + 1])
PHYDM_SSCANF(input[i + 1], DCMD_HEX, &dm_value[i]); PHYDM_SSCANF(input[i + 1], DCMD_HEX, &dm_value[i]);
} }

View File

@ -2958,8 +2958,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
#endif #endif
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (pwdinfo->driver_interface == DRIVER_CFG80211) { if (pwdinfo->driver_interface == DRIVER_CFG80211) {
if (ssids->ssid != NULL if (_rtw_memcmp(ssids->ssid, "DIRECT-", 7)
&& _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL) && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
) { ) {
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -9814,10 +9813,8 @@ void rtw_cfg80211_external_auth_status(struct wiphy *wiphy, struct net_device *d
psta->state |= WIFI_FW_AUTH_SUCCESS; psta->state |= WIFI_FW_AUTH_SUCCESS;
psta->expire_to = padapter->stapriv.assoc_to; psta->expire_to = padapter->stapriv.assoc_to;
if (params->pmkid != NULL) {
/* RTW_INFO_DUMP("PMKID:", params->pmkid, PMKID_LEN); */ /* RTW_INFO_DUMP("PMKID:", params->pmkid, PMKID_LEN); */
_rtw_set_pmksa(dev, params->bssid, params->pmkid); _rtw_set_pmksa(dev, params->bssid, params->pmkid);
}
_enter_critical_bh(&psta->lock, &irqL); _enter_critical_bh(&psta->lock, &irqL);
if ((psta->auth_len != 0) && (psta->pauth_frame != NULL)) { if ((psta->auth_len != 0) && (psta->pauth_frame != NULL)) {