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 18/23] staging: r8188eu: use lists for hwxmits
Date: Mon, 23 Jan 2023 21:53:37 +0100 [thread overview]
Message-ID: <20230123205342.229589-19-martin@kaiser.cx> (raw)
In-Reply-To: <20230123205342.229589-1-martin@kaiser.cx>
struct hw_xmit's sta_list points to one of vo, vi, be or bk_pending in
struct xmit_priv. All of these are defined as struct __queue, which is a
list plus a spinlock.
For these components, the spinlock is unused, we need only the list.
This patch converts sta_list and vo, vi, be and bk_pending to struct
list_head.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 32 ++++++++++------------
drivers/staging/r8188eu/include/rtw_xmit.h | 10 +++----
2 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index cb0d8346ac10..ef6d3a9bffea 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -76,10 +76,10 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->adapter = padapter;
- rtw_init_queue(&pxmitpriv->be_pending);
- rtw_init_queue(&pxmitpriv->bk_pending);
- rtw_init_queue(&pxmitpriv->vi_pending);
- rtw_init_queue(&pxmitpriv->vo_pending);
+ INIT_LIST_HEAD(&pxmitpriv->be_pending);
+ INIT_LIST_HEAD(&pxmitpriv->bk_pending);
+ INIT_LIST_HEAD(&pxmitpriv->vi_pending);
+ INIT_LIST_HEAD(&pxmitpriv->vo_pending);
rtw_init_queue(&pxmitpriv->free_xmit_queue);
@@ -881,10 +881,10 @@ s32 rtw_txframes_pending(struct adapter *padapter)
{
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
- return (!list_empty(&pxmitpriv->be_pending.queue) ||
- !list_empty(&pxmitpriv->bk_pending.queue) ||
- !list_empty(&pxmitpriv->vi_pending.queue) ||
- !list_empty(&pxmitpriv->vo_pending.queue));
+ return (!list_empty(&pxmitpriv->be_pending) ||
+ !list_empty(&pxmitpriv->bk_pending) ||
+ !list_empty(&pxmitpriv->vi_pending) ||
+ !list_empty(&pxmitpriv->vo_pending));
}
s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pattrib)
@@ -1357,7 +1357,6 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram
struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i)
{
- struct list_head *sta_phead;
struct hw_xmit *phwxmit;
struct tx_servq *ptxservq, *tmp_txservq;
struct list_head *xframe_list;
@@ -1375,10 +1374,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
for (i = 0; i < HWXMIT_ENTRY; i++) {
phwxmit = phwxmit_i + inx[i];
-
- sta_phead = get_list_head(phwxmit->sta_queue);
-
- list_for_each_entry_safe(ptxservq, tmp_txservq, sta_phead, tx_pending) {
+ list_for_each_entry_safe(ptxservq, tmp_txservq, phwxmit->sta_list, tx_pending) {
xframe_list = get_list_head(&ptxservq->sta_pending);
if (list_empty(xframe_list))
continue;
@@ -1460,7 +1456,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index));
if (list_empty(&ptxservq->tx_pending))
- list_add_tail(&ptxservq->tx_pending, get_list_head(phwxmits[ac_index].sta_queue));
+ list_add_tail(&ptxservq->tx_pending, phwxmits[ac_index].sta_list);
list_add_tail(&pxmitframe->list, get_list_head(&ptxservq->sta_pending));
ptxservq->qcnt++;
@@ -1481,10 +1477,10 @@ int rtw_alloc_hwxmits(struct adapter *padapter)
hwxmits = pxmitpriv->hwxmits;
- hwxmits[0].sta_queue = &pxmitpriv->vo_pending;
- hwxmits[1].sta_queue = &pxmitpriv->vi_pending;
- hwxmits[2].sta_queue = &pxmitpriv->be_pending;
- hwxmits[3].sta_queue = &pxmitpriv->bk_pending;
+ hwxmits[0].sta_list = &pxmitpriv->vo_pending;
+ hwxmits[1].sta_list = &pxmitpriv->vi_pending;
+ hwxmits[2].sta_list = &pxmitpriv->be_pending;
+ hwxmits[3].sta_list = &pxmitpriv->bk_pending;
return 0;
}
diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h
index cc32167fb4dc..30f8000120b2 100644
--- a/drivers/staging/r8188eu/include/rtw_xmit.h
+++ b/drivers/staging/r8188eu/include/rtw_xmit.h
@@ -97,7 +97,7 @@ union txdesc {
};
struct hw_xmit {
- struct __queue *sta_queue;
+ struct list_head *sta_list;
int accnt;
};
@@ -257,10 +257,10 @@ struct agg_pkt_info {
struct xmit_priv {
spinlock_t lock;
- struct __queue be_pending;
- struct __queue bk_pending;
- struct __queue vi_pending;
- struct __queue vo_pending;
+ struct list_head be_pending;
+ struct list_head bk_pending;
+ struct list_head vi_pending;
+ struct list_head vo_pending;
u8 *pallocated_frame_buf;
u8 *pxmit_frame_buf;
uint free_xmitframe_cnt;
--
2.30.2
next prev parent reply other threads:[~2023-01-23 20:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 20:53 [PATCH 00/23] staging: r8188eu: some more xmit cleanups Martin Kaiser
2023-01-23 20:53 ` [PATCH 01/23] staging: r8188eu: we use a constant number of hw_xmit entries Martin Kaiser
2023-01-23 20:53 ` [PATCH 02/23] staging: r8188eu: pass struct adapter to usb_write Martin Kaiser
2023-01-23 20:53 ` [PATCH 03/23] staging: r8188eu: remove struct intf_hdl Martin Kaiser
2023-01-23 20:53 ` [PATCH 04/23] staging: r8188eu: remove struct intf_priv Martin Kaiser
2023-01-23 20:53 ` [PATCH 05/23] staging: r8188eu: simplify the sta loop in rtw_dequeue_xframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 06/23] staging: r8188eu: simplify the code to initialise inx Martin Kaiser
2023-01-23 20:53 ` [PATCH 07/23] staging: r8188eu: remove an obsolete comment Martin Kaiser
2023-01-23 20:53 ` [PATCH 08/23] staging: r8188eu: remove unused function parameter Martin Kaiser
2023-01-23 20:53 ` [PATCH 09/23] staging: r8188eu: remove dead assignment Martin Kaiser
2023-01-23 20:53 ` [PATCH 10/23] staging: r8188eu: use list_empty Martin Kaiser
2023-01-23 20:53 ` [PATCH 11/23] staging: r8188eu: simplify dequeue_one_xmitframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 12/23] staging: r8188eu: remove redundant parameter Martin Kaiser
2023-01-23 20:53 ` [PATCH 13/23] staging: r8188eu: make rtw_chk_hi_queue_cmd a void function Martin Kaiser
2023-01-23 20:53 ` [PATCH 14/23] staging: r8188eu: decrement qcnt in rtw_dequeue_xframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 15/23] staging: r8188eu: simplify dequeue_one_xmitframe Martin Kaiser
2023-01-23 20:53 ` [PATCH 16/23] staging: r8188eu: use list_head for xmitframe list Martin Kaiser
2023-01-23 20:53 ` [PATCH 17/23] staging: r8188eu: merge dequeue_one_xmitframe into its caller Martin Kaiser
2023-01-23 20:53 ` Martin Kaiser [this message]
2023-01-23 20:53 ` [PATCH 19/23] staging: r8188eu: fix rtw_xmitframe_enqueue error handling Martin Kaiser
2023-01-23 20:53 ` [PATCH 20/23] staging: r8188eu: remove rtw_xmitframe_enqueue Martin Kaiser
2023-01-23 20:53 ` [PATCH 21/23] staging: r8188eu: struct agg_pkt_info is unused Martin Kaiser
2023-01-23 20:53 ` [PATCH 22/23] staging: r8188eu: apsd_setting " Martin Kaiser
2023-01-23 20:53 ` [PATCH 23/23] staging: r8188eu: merge rtw_free_hwxmits into its only caller Martin Kaiser
2023-01-24 19:01 ` [PATCH 00/23] staging: r8188eu: some more xmit cleanups Philipp Hortmann
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=20230123205342.229589-19-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®