staging: rtl8192e: Remove action block acknowledgment
cover staging: rtl8192e: Remove action block acknowledgment
AP are learning very quickly that rtl8192e driver is handling block acknowledgment (BA) not as expected.
The log of the driver is showing the following output:
rtl819xE 0000:03:00.0 wlan0: received DELBA while QOS or HT is not supported(0, 1) Then AP are giving up.
Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s) Transferred this patch over wlan connection of rtl8192e.
Philipp Hortmann (6):
staging: rtl8192e: Remove action block acknowledgment
staging: rtl8192e: Remove unused function rtllib_rx_ADDBAReq()
staging: rtl8192e: Remove unused function rtllib_send_ADDBARsp()
staging: rtl8192e: Remove unused function
rtllib_FlushRxTsPendingPkts()
staging: rtl8192e: Remove unused function rtllib_rx_ADDBARsp()
staging: rtl8192e: Remove unused function rtllib_rx_DELBA()
drivers/staging/rtl8192e/rtl819x_BAProc.c | 262 ---------------------- drivers/staging/rtl8192e/rtllib.h | 6 +- drivers/staging/rtl8192e/rtllib_rx.c | 33 --- drivers/staging/rtl8192e/rtllib_softmac.c | 30 --- 4 files changed, 1 insertion(+), 330 deletions(-)
Signature · 1 line
2.42.0
PATCH 1/6 staging: rtl8192e: Remove action block acknowledgment
Driver does not handle block acknowledgment correctly. Tests with AP have shown that the AP is giving up after some tries. Remove function rtllib_process_action().
--- drivers/staging/rtl8192e/rtllib_softmac.c | 30 ----------------------- 1 file changed, 30 deletions(-)
drivers/staging/rtl8192e/rtllib_softmac.c +0 -30
@@ -1556,33 +1556,6 @@ void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success) }EXPORT_SYMBOL (rtllib_ps_tx_ack); -static void rtllib_process_action (struct rtllib_device *ieee, -struct sk_buff *skb) -{ -u8 *act = skb->data +RTLLIB_3ADDR_LEN ; -u8 category =0 ; - - category = *act; - act++; -switch (category) { -case ACT_CAT_BA : -switch (*act) { -case ACT_ADDBAREQ : -rtllib_rx_ADDBAReq (ieee, skb); -break ; -case ACT_ADDBARSP : -rtllib_rx_ADDBARsp (ieee, skb); -break ; -case ACT_DELBA : -rtllib_rx_DELBA (ieee, skb); -break ; - } -break ; -default : -break ; - } -} -static inline int rtllib_rx_assoc_resp (struct rtllib_device *ieee,struct sk_buff *skb,struct rtllib_rx_stats *rx_stats)
@@ -1789,9 +1762,6 @@ inline int rtllib_rx_frame_softmac(struct rtllib_device *ieee,case IEEE80211_STYPE_DEAUTH :rtllib_rx_deauth (ieee, skb);break ; -case IEEE80211_STYPE_ACTION : -rtllib_process_action (ieee, skb); -break ;default :return -1 ; }
Signature · 1 line
2.42.0
PATCH 2/6 staging: rtl8192e: Remove unused function rtllib_rx_ADDBAReq()
In reply to Philipp HortmannRemove unused function rtllib_rx_ADDBAReq().
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 89 ----------------------- drivers/staging/rtl8192e/rtllib.h | 1 - 2 files changed, 90 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -89
@@ -211,95 +211,6 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst,netdev_dbg (ieee->dev,"Failed to generate DELBA packet.\n" ); } -int rtllib_rx_ADDBAReq (struct rtllib_device *ieee,struct sk_buff *skb) -{ -struct ieee80211_hdr_3addr *req =NULL ; -u16 rc =0 ; -u8 *dst =NULL , *dialog_token =NULL , *tag =NULL ; -struct ba_record *ba =NULL ; -union ba_param_set *ba_param_set =NULL ; -u16 *ba_timeout_value =NULL ; -union sequence_control *pBaStartSeqCtrl =NULL ; -struct rx_ts_record *ts =NULL ; - -if (skb->len <sizeof (struct ieee80211_hdr_3addr ) +9 ) { -netdev_warn (ieee->dev,"Invalid skb len in BAREQ(%d / %d)\n" , - (int )skb->len, - (int )(sizeof (struct ieee80211_hdr_3addr ) +9 )); -return -1 ; - } - -#ifdef VERBOSE_DEBUG -print_hex_dump_bytes ("%s: " ,DUMP_PREFIX_NONE , __func__, - skb->data, skb->len); -#endif - - req = (struct ieee80211_hdr_3addr *)skb->data; - tag = (u8 *)req; - dst = (u8 *)(&req->addr2[0 ]); - tag +=sizeof (struct ieee80211_hdr_3addr ); - dialog_token = tag +2 ; - ba_param_set = (union ba_param_set *)(tag +3 ); - ba_timeout_value = (u16 *)(tag +5 ); - pBaStartSeqCtrl = (union sequence_control *)(req +7 ); - -if (!ieee->current_network.qos_data.active || - !ieee->ht_info->current_ht_support || - (ieee->ht_info->iot_action &HT_IOT_ACT_REJECT_ADDBA_REQ )) { - rc =ADDBA_STATUS_REFUSED ; -netdev_warn (ieee->dev, -"Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n" , - ieee->current_network.qos_data.active, - ieee->ht_info->current_ht_support); - goto OnADDBAReq_Fail; - } -if (!rtllib_get_ts (ieee, (struct ts_common_info **)&ts, dst, - (u8)(ba_param_set->field.tid),RX_DIR , true)) { - rc =ADDBA_STATUS_REFUSED ; -netdev_warn (ieee->dev,"%s(): can't get TS\n" , __func__); - goto OnADDBAReq_Fail; - } - ba = &ts->rx_admitted_ba_record; - -if (ba_param_set->field.ba_policy ==BA_POLICY_DELAYED ) { - rc =ADDBA_STATUS_INVALID_PARAM ; -netdev_warn (ieee->dev,"%s(): BA Policy is not correct\n" , - __func__); - goto OnADDBAReq_Fail; - } - -rtllib_FlushRxTsPendingPkts (ieee, ts); - -deactivate_ba_entry (ieee, ba); - ba->dialog_token = *dialog_token; - ba->ba_param_set = *ba_param_set; - ba->ba_timeout_value = *ba_timeout_value; - ba->ba_start_seq_ctrl = *pBaStartSeqCtrl; - -if (ieee->GetHalfNmodeSupportByAPsHandler (ieee->dev) || - (ieee->ht_info->iot_action &HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT )) - ba->ba_param_set.field.buffer_size =1 ; -else - ba->ba_param_set.field.buffer_size =32 ; - -activate_ba_entry (ba,0 ); -rtllib_send_ADDBARsp (ieee, dst, ba,ADDBA_STATUS_SUCCESS ); - -return 0 ; - -OnADDBAReq_Fail: - { -struct ba_record BA ; - -BA .ba_param_set = *ba_param_set; -BA .ba_timeout_value = *ba_timeout_value; -BA .dialog_token = *dialog_token; -BA .ba_param_set.field.ba_policy =BA_POLICY_IMMEDIATE ; -rtllib_send_ADDBARsp (ieee, dst, &BA , rc); -return 0 ; - } -} -int rtllib_rx_ADDBARsp (struct rtllib_device *ieee,struct sk_buff *skb) {struct ieee80211_hdr_3addr *rsp =NULL ;
drivers/staging/rtl8192e/rtllib.h +0 -1
@@ -1776,7 +1776,6 @@ u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);void HTResetIOTSetting (struct rt_hi_throughput *ht_info);bool is_ht_half_nmode_aps (struct rtllib_device *ieee);u16 tx_count_to_data_rate (struct rtllib_device *ieee,u8 nDataRate); -int rtllib_rx_ADDBAReq (struct rtllib_device *ieee,struct sk_buff *skb);int rtllib_rx_ADDBARsp (struct rtllib_device *ieee,struct sk_buff *skb);int rtllib_rx_DELBA (struct rtllib_device *ieee,struct sk_buff *skb); void rtllib_ts_init_add_ba(struct rtllib_device *ieee, struct tx_ts_record *ts,
Signature · 1 line
2.42.0
PATCH 3/6 staging: rtl8192e: Remove unused function rtllib_send_ADDBARsp()
In reply to Philipp HortmannRemove unused function rtllib_send_ADDBARsp().
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -12
@@ -186,18 +186,6 @@ static void rtllib_send_ADDBAReq(struct rtllib_device *ieee, u8 *dst,netdev_dbg (ieee->dev,"Failed to generate ADDBAReq packet.\n" ); } -static void rtllib_send_ADDBARsp (struct rtllib_device *ieee,u8 *dst, -struct ba_record *ba,u16 status_code) -{ -struct sk_buff *skb; - - skb =rtllib_ADDBA (ieee, dst, ba, status_code,ACT_ADDBARSP ); -if (skb) -softmac_mgmt_xmit (skb, ieee); -else -netdev_dbg (ieee->dev,"Failed to generate ADDBARsp packet.\n" ); -} -static void rtllib_send_DELBA (struct rtllib_device *ieee,u8 *dst,struct ba_record *ba,enum tr_select TxRxSelect,u16 reason_code)
Signature · 1 line
2.42.0
PATCH 4/6 staging: rtl8192e: Remove unused function rtllib_FlushRxTsPendingPkts()
In reply to Philipp HortmannRemove unused function rtllib_FlushRxTsPendingPkts().
--- drivers/staging/rtl8192e/rtllib.h | 3 +-- drivers/staging/rtl8192e/rtllib_rx.c | 33 ---------------------------- 2 files changed, 1 insertion(+), 35 deletions(-)
drivers/staging/rtl8192e/rtllib.h +1 -2
@@ -1814,8 +1814,7 @@ bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn);/* For the function is more related to hardware setting, it's better to use the * ieee handler to refer to it. */ -void rtllib_FlushRxTsPendingPkts (struct rtllib_device *ieee, -struct rx_ts_record *ts); + int rtllib_parse_info_param(struct rtllib_device *ieee, struct rtllib_info_element *info_element, u16 length,
drivers/staging/rtl8192e/rtllib_rx.c +0 -33
@@ -488,39 +488,6 @@ void rtllib_indicate_packets(struct rtllib_device *ieee, } } -void rtllib_FlushRxTsPendingPkts (struct rtllib_device *ieee, -struct rx_ts_record *ts) -{ -struct rx_reorder_entry *pRxReorderEntry; -u8 RfdCnt =0 ; - -del_timer_sync (&ts->rx_pkt_pending_timer); -while (!list_empty (&ts->rx_pending_pkt_list)) { -if (RfdCnt >=REORDER_WIN_SIZE ) { -netdev_info (ieee->dev, -"-------------->%s() error! RfdCnt >= REORDER_WIN_SIZE\n" , - __func__); -break ; - } - - pRxReorderEntry = (struct rx_reorder_entry *) -list_entry (ts->rx_pending_pkt_list.prev, - struct rx_reorder_entry, List); -netdev_dbg (ieee->dev,"%s(): Indicate SeqNum %d!\n" , __func__, - pRxReorderEntry->SeqNum); -list_del_init (&pRxReorderEntry->List); - - ieee->RfdArray[RfdCnt] = pRxReorderEntry->prxb; - - RfdCnt = RfdCnt +1 ; -list_add_tail (&pRxReorderEntry->List, - &ieee->RxReorder_Unused_List); - } -rtllib_indicate_packets (ieee, ieee->RfdArray, RfdCnt); - - ts->rx_indicate_seq =0xffff ; -} -static void RxReorderIndicatePacket (struct rtllib_device *ieee,struct rtllib_rxb *prxb,struct rx_ts_record *ts,u16 SeqNum)
Signature · 1 line
2.42.0
PATCH 5/6 staging: rtl8192e: Remove unused function rtllib_rx_ADDBARsp()
In reply to Philipp HortmannRemove unused function rtllib_rx_ADDBARsp().
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 99 ----------------------- drivers/staging/rtl8192e/rtllib.h | 1 - 2 files changed, 100 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -99
@@ -199,105 +199,6 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst,netdev_dbg (ieee->dev,"Failed to generate DELBA packet.\n" ); } -int rtllib_rx_ADDBARsp (struct rtllib_device *ieee,struct sk_buff *skb) -{ -struct ieee80211_hdr_3addr *rsp =NULL ; -struct ba_record *pending_ba, *admitted_ba; -struct tx_ts_record *ts =NULL ; -u8 *dst =NULL , *dialog_token =NULL , *tag =NULL ; -u16 *status_code =NULL , *ba_timeout_value =NULL ; -union ba_param_set *ba_param_set =NULL ; -u16 reason_code; - -if (skb->len <sizeof (struct ieee80211_hdr_3addr ) +9 ) { -netdev_warn (ieee->dev,"Invalid skb len in BARSP(%d / %d)\n" , - (int )skb->len, - (int )(sizeof (struct ieee80211_hdr_3addr ) +9 )); -return -1 ; - } - rsp = (struct ieee80211_hdr_3addr *)skb->data; - tag = (u8 *)rsp; - dst = (u8 *)(&rsp->addr2[0 ]); - tag +=sizeof (struct ieee80211_hdr_3addr ); - dialog_token = tag +2 ; - status_code = (u16 *)(tag +3 ); - ba_param_set = (union ba_param_set *)(tag +5 ); - ba_timeout_value = (u16 *)(tag +7 ); - -if (!ieee->current_network.qos_data.active || - !ieee->ht_info->current_ht_support || - !ieee->ht_info->current_ampdu_enable) { -netdev_warn (ieee->dev, -"reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n" , - ieee->current_network.qos_data.active, - ieee->ht_info->current_ht_support, - ieee->ht_info->current_ampdu_enable); - reason_code =DELBA_REASON_UNKNOWN_BA ; - goto OnADDBARsp_Reject; - } - -if (!rtllib_get_ts (ieee, (struct ts_common_info **)&ts, dst, - (u8)(ba_param_set->field.tid),TX_DIR , false)) { -netdev_warn (ieee->dev,"%s(): can't get TS\n" , __func__); - reason_code =DELBA_REASON_UNKNOWN_BA ; - goto OnADDBARsp_Reject; - } - - ts->add_ba_req_in_progress = false; - pending_ba = &ts->tx_pending_ba_record; - admitted_ba = &ts->tx_admitted_ba_record; - -if (admitted_ba->b_valid) { -netdev_dbg (ieee->dev,"%s(): ADDBA response already admitted\n" , - __func__); -return -1 ; - }else if (!pending_ba->b_valid || - (*dialog_token != pending_ba->dialog_token)) { -netdev_warn (ieee->dev, -"%s(): ADDBA Rsp. BA invalid, DELBA!\n" , - __func__); - reason_code =DELBA_REASON_UNKNOWN_BA ; - goto OnADDBARsp_Reject; - }else { -netdev_dbg (ieee->dev, -"%s(): Recv ADDBA Rsp. BA is admitted! Status code:%X\n" , - __func__, *status_code); -deactivate_ba_entry (ieee, pending_ba); - } - -if (*status_code ==ADDBA_STATUS_SUCCESS ) { -if (ba_param_set->field.ba_policy ==BA_POLICY_DELAYED ) { - ts->add_ba_req_delayed = true; -deactivate_ba_entry (ieee, admitted_ba); - reason_code =DELBA_REASON_END_BA ; - goto OnADDBARsp_Reject; - } - - admitted_ba->dialog_token = *dialog_token; - admitted_ba->ba_timeout_value = *ba_timeout_value; - admitted_ba->ba_start_seq_ctrl = pending_ba->ba_start_seq_ctrl; - admitted_ba->ba_param_set = *ba_param_set; -deactivate_ba_entry (ieee, admitted_ba); -activate_ba_entry (admitted_ba, *ba_timeout_value); - }else { - ts->add_ba_req_delayed = true; - ts->disable_add_ba = true; - reason_code =DELBA_REASON_END_BA ; - goto OnADDBARsp_Reject; - } - -return 0 ; - -OnADDBARsp_Reject: - { -struct ba_record BA ; - -BA .ba_param_set = *ba_param_set; -rtllib_send_DELBA (ieee, dst, &BA ,TX_DIR , reason_code); -return 0 ; - } -} -int rtllib_rx_DELBA (struct rtllib_device *ieee,struct sk_buff *skb) {struct ieee80211_hdr_3addr *delba =NULL ;
drivers/staging/rtl8192e/rtllib.h +0 -1
@@ -1776,7 +1776,6 @@ u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);void HTResetIOTSetting (struct rt_hi_throughput *ht_info);bool is_ht_half_nmode_aps (struct rtllib_device *ieee);u16 tx_count_to_data_rate (struct rtllib_device *ieee,u8 nDataRate); -int rtllib_rx_ADDBARsp (struct rtllib_device *ieee,struct sk_buff *skb);int rtllib_rx_DELBA (struct rtllib_device *ieee,struct sk_buff *skb);void rtllib_ts_init_add_ba (struct rtllib_device *ieee,struct tx_ts_record *ts,u8 policy,u8 overwrite_pending);
Signature · 1 line
2.42.0
PATCH 6/6 staging: rtl8192e: Remove unused function rtllib_rx_DELBA()
In reply to Philipp HortmannRemove unused function rtllib_rx_DELBA().
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 62 ----------------------- drivers/staging/rtl8192e/rtllib.h | 1 - 2 files changed, 63 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -62
@@ -199,68 +199,6 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst,netdev_dbg (ieee->dev,"Failed to generate DELBA packet.\n" ); } -int rtllib_rx_DELBA (struct rtllib_device *ieee,struct sk_buff *skb) -{ -struct ieee80211_hdr_3addr *delba =NULL ; -union delba_param_set *pDelBaParamSet =NULL ; -u8 *dst =NULL ; - -if (skb->len <sizeof (struct ieee80211_hdr_3addr ) +6 ) { -netdev_warn (ieee->dev,"Invalid skb len in DELBA(%d / %d)\n" , - (int )skb->len, - (int )(sizeof (struct ieee80211_hdr_3addr ) +6 )); -return -1 ; - } - -if (!ieee->current_network.qos_data.active || - !ieee->ht_info->current_ht_support) { -netdev_warn (ieee->dev, -"received DELBA while QOS or HT is not supported(%d, %d)\n" , - ieee->current_network. qos_data.active, - ieee->ht_info->current_ht_support); -return -1 ; - } - -#ifdef VERBOSE_DEBUG -print_hex_dump_bytes ("%s: " ,DUMP_PREFIX_NONE , skb->data, - __func__, skb->len); -#endif - delba = (struct ieee80211_hdr_3addr *)skb->data; - dst = (u8 *)(&delba->addr2[0 ]); - pDelBaParamSet = (union delba_param_set *)&delba->seq_ctrl +2 ; - -if (pDelBaParamSet->field.initiator ==1 ) { -struct rx_ts_record *ts; - -if (!rtllib_get_ts (ieee, (struct ts_common_info **)&ts, dst, - (u8 )pDelBaParamSet->field.tid,RX_DIR , false)) { -netdev_warn (ieee->dev, -"%s(): can't get TS for RXTS. dst:%pM TID:%d\n" , - __func__, dst, - (u8 )pDelBaParamSet->field.tid); -return -1 ; - } - -rx_ts_delete_ba (ieee, ts); - }else { -struct tx_ts_record *ts; - -if (!rtllib_get_ts (ieee, (struct ts_common_info **)&ts, dst, - (u8 )pDelBaParamSet->field.tid,TX_DIR , false)) { -netdev_warn (ieee->dev,"%s(): can't get TS for TXTS\n" , - __func__); -return -1 ; - } - - ts->using_ba = false; - ts->add_ba_req_in_progress = false; - ts->add_ba_req_delayed = false; -del_timer_sync (&ts->ts_add_ba_timer); -tx_ts_delete_ba (ieee, ts); - } -return 0 ; -} -void rtllib_ts_init_add_ba (struct rtllib_device *ieee,struct tx_ts_record *ts,u8 policy,u8 overwrite_pending) {
drivers/staging/rtl8192e/rtllib.h +0 -1
@@ -1776,7 +1776,6 @@ u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame);void HTResetIOTSetting (struct rt_hi_throughput *ht_info);bool is_ht_half_nmode_aps (struct rtllib_device *ieee);u16 tx_count_to_data_rate (struct rtllib_device *ieee,u8 nDataRate); -int rtllib_rx_DELBA (struct rtllib_device *ieee,struct sk_buff *skb);void rtllib_ts_init_add_ba (struct rtllib_device *ieee,struct tx_ts_record *ts,u8 policy,u8 overwrite_pending); void rtllib_ts_init_del_ba(struct rtllib_device *ieee,
Signature · 1 line
2.42.0
Quoted 18 lines · Philipp Hortmann
AP are learning very quickly that rtl8192e driver is handling block acknowledgment (BA) not as expected.
The log of the driver is showing the following output:
rtl819xE 0000:03:00.0 wlan0: received DELBA while QOS or HT is notsupported(0, 1)Then AP are giving up.Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s) Transferred this patch over wlan connection of rtl8192e.
Philipp Hortmann (6):
staging: rtl8192e: Remove action block acknowledgment
staging: rtl8192e: Remove unused functionrtllib_rx_ADDBAReq()
staging: rtl8192e: Remove unused functionrtllib_send_ADDBARsp()
staging: rtl8192e: Remove unused function
rtllib_FlushRxTsPendingPkts()
staging: rtl8192e: Remove unused functionrtllib_rx_ADDBARsp()
staging: rtl8192e: Remove unused functionrtllib_rx_DELBA()
Quoted 6 lines
drivers/staging/rtl8192e/rtl819x_BAProc.c | 262 ---------------------- drivers/staging/rtl8192e/rtllib.h | 6 +- drivers/staging/rtl8192e/rtllib_rx.c | 33 --- drivers/staging/rtl8192e/rtllib_softmac.c | 30 --- 4 files changed, 1 insertion(+), 330 deletions(-)
Hi Greg,
please ignore this patch series. It creates a performance issue....
Sorry for the noise in the mailing list.
Bye Philipp