Fix update_beacon calls

Error introduced at 3555bdb258
Also clean up validate_recv_ctrl_frame
Link: 797afdf248
Link aaa0bc19fa
This commit is contained in:
Carlos Garcés 2022-10-30 18:39:00 +00:00
parent 563780d2eb
commit 8051c5f3b3
5 changed files with 27 additions and 33 deletions

View File

@ -102,7 +102,7 @@ static void update_BCNTIM(_adapter *padapter)
u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL;
uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen; uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen;
p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, WLAN_EID_DS_PARAMS, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_); p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, WLAN_EID_TIM, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_);
if (p != NULL && tim_ielen > 0) { if (p != NULL && tim_ielen > 0) {
tim_ielen += 2; tim_ielen += 2;
@ -599,7 +599,7 @@ void expire_timeout_chk(_adapter *padapter)
/* to update bcn with tim_bitmap for this station */ /* to update bcn with tim_bitmap for this station */
rtw_tim_map_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid); rtw_tim_map_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid);
update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE);
if (!pmlmeext->active_keep_alive_check) if (!pmlmeext->active_keep_alive_check)
continue; continue;
@ -1817,7 +1817,7 @@ update_beacon:
} }
#endif #endif
update_beacon(pdvobj->padapters[i], WLAN_EID_DS_PARAMS, NULL, _FALSE); update_beacon(pdvobj->padapters[i], WLAN_EID_TIM, NULL, _FALSE);
} }
if (mlme_act != MLME_OPCH_SWITCH if (mlme_act != MLME_OPCH_SWITCH
@ -2875,7 +2875,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
if ((rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, 0)) && (psta_bmc->sleepq_len > 0)) { if ((rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, 0)) && (psta_bmc->sleepq_len > 0)) {
int tx_counts = 0; int tx_counts = 0;
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE, "update TIM with TIB=1"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _FALSE, "update TIM with TIB=1");
RTW_INFO("sleepq_len of bmc_sta = %d\n", psta_bmc->sleepq_len); RTW_INFO("sleepq_len of bmc_sta = %d\n", psta_bmc->sleepq_len);
@ -2925,7 +2925,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
if (update_tim == _TRUE) { if (update_tim == _TRUE) {
RTW_INFO("clear TIB\n"); RTW_INFO("clear TIB\n");
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "bmc sleepq and HIQ empty"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "bmc sleepq and HIQ empty");
} }
} }
} }
@ -3261,7 +3261,7 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta
_enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
switch (ie_id) { switch (ie_id) {
case WLAN_EID_DS_PARAMS: case WLAN_EID_TIM:
update_BCNTIM(padapter); update_BCNTIM(padapter);
break; break;
@ -3738,7 +3738,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta)
if (rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid)) { if (rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid)) {
rtw_tim_map_clear(padapter, pstapriv->tim_bitmap, psta->cmn.aid); rtw_tim_map_clear(padapter, pstapriv->tim_bitmap, psta->cmn.aid);
beacon_updated = _TRUE; beacon_updated = _TRUE;
update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE); update_beacon(padapter, WLAN_EID_TIM, NULL, _FALSE);
} }
if (psta->no_short_preamble_set) { if (psta->no_short_preamble_set) {
@ -5101,7 +5101,7 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj)
if (!check_fwstate(&padapter->mlmepriv, WIFI_OP_CH_SWITCHING) if (!check_fwstate(&padapter->mlmepriv, WIFI_OP_CH_SWITCHING)
&& !IS_CH_WAITING(adapter_to_rfctl(padapter)) && !IS_CH_WAITING(adapter_to_rfctl(padapter))
) { ) {
/*update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE);*/ /*update_beacon(padapter, WLAN_EID_TIM, NULL, _FALSE);*/
/*issue_beacon(padapter, 0);*/ /*issue_beacon(padapter, 0);*/
send_beacon(padapter); send_beacon(padapter);
} }

View File

@ -4147,7 +4147,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter)
rtw_tim_map_clear(padapter, pstapriv->sta_dz_bitmap, 0); rtw_tim_map_clear(padapter, pstapriv->sta_dz_bitmap, 0);
if (update_tim == _TRUE) if (update_tim == _TRUE)
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "bmc sleepq and HIQ empty"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "bmc sleepq and HIQ empty");
} else /* re check again */ } else /* re check again */
rtw_chk_hi_queue_cmd(padapter); rtw_chk_hi_queue_cmd(padapter);

View File

@ -1550,8 +1550,7 @@ exit:
} }
sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame); void validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
{ {
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -1562,15 +1561,15 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
/* RTW_INFO("+validate_recv_ctrl_frame\n"); */ /* RTW_INFO("+validate_recv_ctrl_frame\n"); */
if (GetFrameType(pframe) != IEEE80211_FTYPE_CTL) if (GetFrameType(pframe) != IEEE80211_FTYPE_CTL)
return _FAIL; return;
/* receive the frames that ra(a1) is my address */ /* receive the frames that ra(a1) is my address */
if (!_rtw_memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN)) if (!_rtw_memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN))
return _FAIL; return;
psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe)); psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe));
if (psta == NULL) if (psta == NULL)
return _FAIL; return;
/* for rx pkt statistics */ /* for rx pkt statistics */
psta->sta_stats.last_rx_time = jiffies; psta->sta_stats.last_rx_time = jiffies;
@ -1584,7 +1583,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
aid = GetAid(pframe); aid = GetAid(pframe);
if (psta->cmn.aid != aid) if (psta->cmn.aid != aid)
return _FAIL; return;
switch (pattrib->priority) { switch (pattrib->priority) {
case 1: case 1:
@ -1607,7 +1606,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
} }
if (wmmps_ac) if (wmmps_ac)
return _FAIL; return;
if (psta->state & WIFI_STA_ALIVE_CHK_STATE) { if (psta->state & WIFI_STA_ALIVE_CHK_STATE) {
RTW_INFO("%s alive check-rx ps-poll\n", __func__); RTW_INFO("%s alive check-rx ps-poll\n", __func__);
@ -1662,7 +1661,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
/* upate BCN for TIM IE */ /* upate BCN for TIM IE */
/* update_BCNTIM(padapter); */ /* update_BCNTIM(padapter); */
update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE);
} }
/* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */
@ -1688,7 +1687,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
/* upate BCN for TIM IE */ /* upate BCN for TIM IE */
/* update_BCNTIM(padapter); */ /* update_BCNTIM(padapter); */
update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE);
} }
} }
} }
@ -1700,9 +1699,6 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
} else if (get_frame_sub_type(pframe) == IEEE80211_STYPE_BACK_REQ) { } else if (get_frame_sub_type(pframe) == IEEE80211_STYPE_BACK_REQ) {
rtw_process_bar_frame(padapter, precv_frame); rtw_process_bar_frame(padapter, precv_frame);
} }
return _FAIL;
} }
#if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH) #if defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH)
@ -2307,10 +2303,8 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
break; break;
case IEEE80211_FTYPE_CTL: /* ctrl */ case IEEE80211_FTYPE_CTL: /* ctrl */
DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl); DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl);
retval = validate_recv_ctrl_frame(adapter, precv_frame); validate_recv_ctrl_frame(adapter, precv_frame);
if (retval == _FAIL) {
DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl_err); DBG_COUNTER(adapter->rx_logs.core_rx_pre_ctrl_err);
}
retval = _FAIL; /* only data frame return _SUCCESS */ retval = _FAIL; /* only data frame return _SUCCESS */
break; break;
case IEEE80211_FTYPE_DATA: /* data */ case IEEE80211_FTYPE_DATA: /* data */

View File

@ -4816,9 +4816,9 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
/* RTW_INFO_DUMP("enqueue, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ /* RTW_INFO_DUMP("enqueue, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */
if (update_tim == _TRUE) { if (update_tim == _TRUE) {
if (is_broadcast_mac_addr(pattrib->ra)) if (is_broadcast_mac_addr(pattrib->ra))
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer BC"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "buffer BC");
else else
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer MC"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "buffer MC");
} else } else
chk_bmc_sleepq_cmd(padapter); chk_bmc_sleepq_cmd(padapter);
@ -4885,7 +4885,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
if (update_tim == _TRUE) { if (update_tim == _TRUE) {
/* RTW_INFO("sleepq_len==1, update BCNTIM\n"); */ /* RTW_INFO("sleepq_len==1, update BCNTIM\n"); */
/* upate BCN for TIM IE */ /* upate BCN for TIM IE */
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer UC"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "buffer UC");
} }
} }
@ -5170,11 +5170,11 @@ _exit:
if (update_mask) { if (update_mask) {
/* update_BCNTIM(padapter); */ /* update_BCNTIM(padapter); */
if ((update_mask & (BIT(0) | BIT(1))) == (BIT(0) | BIT(1))) if ((update_mask & (BIT(0) | BIT(1))) == (BIT(0) | BIT(1)))
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear UC&BMC"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "clear UC&BMC");
else if ((update_mask & BIT(1)) == BIT(1)) else if ((update_mask & BIT(1)) == BIT(1))
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear BMC"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "clear BMC");
else else
_update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear UC"); _update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE, "clear UC");
} }
} }
@ -5252,7 +5252,7 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta)
/* RTW_INFO_DUMP("update_BCNTIM, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ /* RTW_INFO_DUMP("update_BCNTIM, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */
/* upate BCN for TIM IE */ /* upate BCN for TIM IE */
/* update_BCNTIM(padapter); */ /* update_BCNTIM(padapter); */
update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); update_beacon(padapter, WLAN_EID_TIM, NULL, _TRUE);
/* update_mask = BIT(0); */ /* update_mask = BIT(0); */
} }

View File

@ -8211,7 +8211,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte
*c = WLAN_EID_TIM; *c = WLAN_EID_TIM;
*(c + 1) = 4; *(c + 1) = 4;
c += 6; c += 6;
//c = rtw_set_ie(c, WLAN_EID_DS_PARAMS, 4, NULL, NULL); //c = rtw_set_ie(c, WLAN_EID_TIM, 4, NULL, NULL);
/* Extended Supported Rates */ /* Extended Supported Rates */
if (n_bitrates > 8) if (n_bitrates > 8)