mirror of https://lore.kernel.org/lkml/
 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 04/11] staging: r8188eu: use ieee80211 to set addba resp capabilities
Date: Thu,  2 Jun 2022 21:37:19 +0200	[thread overview]
Message-ID: <20220602193726.280922-5-martin@kaiser.cx> (raw)
In-Reply-To: <20220602193726.280922-1-martin@kaiser.cx>

Use the mgmt structure and defines from ieee80211.h to set the
capabilities field of an addba response.

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

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index de2a1e8b1a65..b391273969af 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -5446,16 +5446,11 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
 		pattrib->pktlen++;
 		mgmt->u.action.u.addba_resp.status = cpu_to_le16(status);
 		pattrib->pktlen += 2;
-		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);
+		capab = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f;
+		capab |= u16_encode_bits(64, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK);
+		capab |= u16_encode_bits(pregpriv->ampdu_amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK);
+		mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab);
+		pattrib->pktlen += 2;
 		mgmt->u.action.u.addba_resp.timeout = pmlmeinfo->ADDBA_req.BA_timeout_value;
 		pattrib->pktlen += 2;
 		break;
-- 
2.30.2


  parent reply	other threads:[~2022-06-02 19:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 19:37 [PATCH 00/11] staging: r8188eu: continue the cleanup of issue_action_BA Martin Kaiser
2022-06-02 19:37 ` [PATCH 01/11] staging: r8188eu: use mgmt to set resp dialog token Martin Kaiser
2022-06-02 19:37 ` [PATCH 02/11] staging: r8188eu: use mgmt to set the addba resp status Martin Kaiser
2022-06-02 19:37 ` [PATCH 03/11] staging: r8188eu: use mgmt to set the addba resp timeout Martin Kaiser
2022-06-02 19:37 ` Martin Kaiser [this message]
2022-06-02 19:37 ` [PATCH 05/11] staging: r8188eu: calculate the addba response length Martin Kaiser
2022-06-02 19:37 ` [PATCH 06/11] staging: r8188eu: use mgmt to set the delba reason code Martin Kaiser
2022-06-02 19:37 ` [PATCH 07/11] staging: r8188eu: use mgmt to set delba params Martin Kaiser
2022-06-02 19:37 ` [PATCH 08/11] staging: r8188eu: clarify the contents of the " Martin Kaiser
2022-06-02 19:37 ` [PATCH 09/11] staging: r8188eu: calculate the delba length Martin Kaiser
2022-06-02 19:37 ` [PATCH 10/11] staging: r8188eu: remove the pframe variable Martin Kaiser
2022-06-02 19:37 ` [PATCH 11/11] staging: r8188eu: use u8, u16 in issue_action_BA prototype Martin Kaiser
2022-06-05 16:03 ` [PATCH 00/11] staging: r8188eu: continue the cleanup of issue_action_BA Pavel Skripkin

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=20220602193726.280922-5-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®