All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	Pavel Skripkin <paskripkin@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 01/12] staging: r8188eu: remove unnecessary category check
Date: Sat, 21 May 2022 17:38:13 +0200	[thread overview]
Message-ID: <20220521153824.218196-2-martin@kaiser.cx> (raw)
In-Reply-To: <20220521153824.218196-1-martin@kaiser.cx>

Remove the unnecessary category check in issue_action_BA. category is
initialised to 3 (WLAN_CATEGORY_BACK) and never updated.

The rtw_set_fixed_ie call gets a pointer to category but it doesn't update
the value.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c | 94 ++++++++++-----------
 1 file changed, 46 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index faf23fc950c5..f47cf3e7316c 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -5415,60 +5415,58 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
 	pframe = rtw_set_fixed_ie(pframe, 1, &(category), &pattrib->pktlen);
 	pframe = rtw_set_fixed_ie(pframe, 1, &(action), &pattrib->pktlen);
 
-	if (category == 3) {
-		switch (action) {
-		case 0: /* ADDBA req */
-			do {
-				pmlmeinfo->dialogToken++;
-			} while (pmlmeinfo->dialogToken == 0);
-			pframe = rtw_set_fixed_ie(pframe, 1, &pmlmeinfo->dialogToken, &pattrib->pktlen);
+	switch (action) {
+	case 0: /* ADDBA req */
+		do {
+			pmlmeinfo->dialogToken++;
+		} while (pmlmeinfo->dialogToken == 0);
+		pframe = rtw_set_fixed_ie(pframe, 1, &pmlmeinfo->dialogToken, &pattrib->pktlen);
 
-			BA_para_set = (0x1002 | ((status & 0xf) << 2)); /* immediate ack & 64 buffer size */
-			le_tmp = cpu_to_le16(BA_para_set);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
+		BA_para_set = (0x1002 | ((status & 0xf) << 2)); /* immediate ack & 64 buffer size */
+		le_tmp = cpu_to_le16(BA_para_set);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
 
-			BA_timeout_value = 5000;/*  5ms */
-			le_tmp = cpu_to_le16(BA_timeout_value);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
+		BA_timeout_value = 5000;/*  5ms */
+		le_tmp = cpu_to_le16(BA_timeout_value);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
 
-			psta = rtw_get_stainfo(pstapriv, raddr);
-			if (psta) {
-				start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07] & 0xfff) + 1;
+		psta = rtw_get_stainfo(pstapriv, raddr);
+		if (psta) {
+			start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07] & 0xfff) + 1;
 
-				psta->BA_starting_seqctrl[status & 0x07] = start_seq;
+			psta->BA_starting_seqctrl[status & 0x07] = start_seq;
 
-				BA_starting_seqctrl = start_seq << 4;
-			}
-			le_tmp = cpu_to_le16(BA_starting_seqctrl);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
-			break;
-		case 1: /* ADDBA rsp */
-			pframe = rtw_set_fixed_ie(pframe, 1, &pmlmeinfo->ADDBA_req.dialog_token, &pattrib->pktlen);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&status, &pattrib->pktlen);
-			BA_para_set = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f;
-			BA_para_set |= 0x1000; /* 64 buffer size */
-
-			if (pregpriv->ampdu_amsdu == 0)/* disabled */
-				BA_para_set = BA_para_set & ~BIT(0);
-			else if (pregpriv->ampdu_amsdu == 1)/* enabled */
-				BA_para_set = BA_para_set | BIT(0);
-			le_tmp = cpu_to_le16(BA_para_set);
-
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&pmlmeinfo->ADDBA_req.BA_timeout_value, &pattrib->pktlen);
-			break;
-		case 2:/* DELBA */
-			BA_para_set = (status & 0x1F) << 3;
-			le_tmp = cpu_to_le16(BA_para_set);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
-
-			reason_code = 37;/* Requested from peer STA as it does not want to use the mechanism */
-			le_tmp = cpu_to_le16(reason_code);
-			pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
-			break;
-		default:
-			break;
+			BA_starting_seqctrl = start_seq << 4;
 		}
+		le_tmp = cpu_to_le16(BA_starting_seqctrl);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
+		break;
+	case 1: /* ADDBA rsp */
+		pframe = rtw_set_fixed_ie(pframe, 1, &pmlmeinfo->ADDBA_req.dialog_token, &pattrib->pktlen);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&status, &pattrib->pktlen);
+		BA_para_set = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f;
+		BA_para_set |= 0x1000; /* 64 buffer size */
+
+		if (pregpriv->ampdu_amsdu == 0)/* disabled */
+			BA_para_set = BA_para_set & ~BIT(0);
+		else if (pregpriv->ampdu_amsdu == 1)/* enabled */
+			BA_para_set = BA_para_set | BIT(0);
+		le_tmp = cpu_to_le16(BA_para_set);
+
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&pmlmeinfo->ADDBA_req.BA_timeout_value, &pattrib->pktlen);
+		break;
+	case 2:/* DELBA */
+		BA_para_set = (status & 0x1F) << 3;
+		le_tmp = cpu_to_le16(BA_para_set);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
+
+		reason_code = 37;/* Requested from peer STA as it does not want to use the mechanism */
+		le_tmp = cpu_to_le16(reason_code);
+		pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)&le_tmp, &pattrib->pktlen);
+		break;
+	default:
+		break;
 	}
 
 	pattrib->last_txcmdsz = pattrib->pktlen;
-- 
2.30.2


  reply	other threads:[~2022-05-21 15:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 15:38 [PATCH 00/12] staging: r8188eu: start cleaning up issue_action_BA Martin Kaiser
2022-05-21 15:38 ` Martin Kaiser [this message]
2022-05-21 15:38 ` [PATCH 02/12] staging: r8188eu: use defines for the block action codes Martin Kaiser
2022-05-21 15:38 ` [PATCH 03/12] staging: r8188eu: use ieee80211_mgmt in issue_action_BA Martin Kaiser
2022-05-21 15:38 ` [PATCH 04/12] staging: r8188eu: use mgmt to set the addresses Martin Kaiser
2022-05-21 15:38 ` [PATCH 05/12] staging: r8188eu: use mgmt to set the sequence number Martin Kaiser
2022-05-21 20:44   ` kernel test robot
2022-05-21 15:38 ` [PATCH 06/12] staging: r8188eu: use mgmt to set the category Martin Kaiser
2022-05-21 15:38 ` [PATCH 07/12] staging: r8188eu: use mgmt to set the action codes Martin Kaiser
2022-05-21 15:38 ` [PATCH 08/12] staging: r8188eu: use mgmt to set the dialog token Martin Kaiser
2022-05-21 15:38 ` [PATCH 09/12] staging: r8188eu: use mgmt to set the timeout Martin Kaiser
2022-05-21 15:38 ` [PATCH 10/12] staging: r8188eu: use ieee80211 to set addba capabilities Martin Kaiser
2022-05-21 15:38 ` [PATCH 11/12] staging: r8188eu: use mgmt to set start sequence number Martin Kaiser
2022-05-21 15:38 ` [PATCH 12/12] staging: r8188eu: calculate the addba request length Martin Kaiser
2022-05-24  9:00 ` [PATCH v2 00/12] staging: r8188eu: start cleaning up issue_action_BA Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 01/12] staging: r8188eu: remove unnecessary category check Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 02/12] staging: r8188eu: use defines for the block action codes Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 03/12] staging: r8188eu: use ieee80211_mgmt in issue_action_BA Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 04/12] staging: r8188eu: use mgmt to set the addresses Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 05/12] staging: r8188eu: use mgmt to set the sequence number Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 06/12] staging: r8188eu: use mgmt to set the category Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 07/12] staging: r8188eu: use mgmt to set the action codes Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 08/12] staging: r8188eu: use mgmt to set the dialog token Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 09/12] staging: r8188eu: use mgmt to set the timeout Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 10/12] staging: r8188eu: use ieee80211 to set addba capabilities Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 11/12] staging: r8188eu: use mgmt to set start sequence number Martin Kaiser
2022-05-24  9:00   ` [PATCH v2 12/12] staging: r8188eu: calculate the addba request length Martin Kaiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220521153824.218196-2-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.