2021-03-02 17:45:13

by William Durand

[permalink] [raw]
Subject: [PATCH 0/9] rx_ts_record struct cleanups

This patchset fixes the checkpatch issues related to the `rx_ts_record`
struct defined in `rtl8192e/rtl819x_TS.h` (avoid camelcase). The last
patch reformats the struct a bit to be more consistent with structures
defined in other header files.

William Durand (9):
staging: rtl8192e: rename TsCommonInfo to ts_common_info in rx_ts_record struct
staging: rtl8192e: rename RxIndicateSeq to rx_indicate_seq in rx_ts_record struct
staging: rtl8192e: rename RxTimeoutIndicateSeq to rx_timeout_indicate_seq in rx_ts_record struct
staging: rtl8192e: rename RxPendingPktList to rx_pending_pkt_list in rx_ts_record struct
staging: rtl8192e: rename RxPktPendingTimer to rx_pkt_pending_timer in rx_ts_record struct
staging: rtl8192e: rename RxAdmittedBARecord to rx_admitted_ba_record in rx_ts_record struct
staging: rtl8192e: rename RxLastSeqNum to rx_last_seq_num in rx_ts_record struct
staging: rtl8192e: rename RxLastFragNum to rx_last_frag_num in rx_ts_record struct
staging: rtl8192e: reformat rx_ts_record struct

drivers/staging/rtl8192e/rtl819x_BAProc.c | 12 ++--
drivers/staging/rtl8192e/rtl819x_TS.h | 18 +++---
drivers/staging/rtl8192e/rtl819x_TSProc.c | 58 +++++++++---------
drivers/staging/rtl8192e/rtllib_rx.c | 74 +++++++++++------------
4 files changed, 81 insertions(+), 81 deletions(-)

--
2.30.1


2021-03-02 17:45:13

by William Durand

[permalink] [raw]
Subject: [PATCH 5/9] staging: rtl8192e: rename RxPktPendingTimer to rx_pkt_pending_timer in rx_ts_record struct

Rename RxPktPendingTimer to rx_pkt_pending_timer to silence a checkpatch
warning about CamelCase.

Signed-off-by: William Durand <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 10 +++++-----
drivers/staging/rtl8192e/rtllib_rx.c | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index 3fc89906b309..0e936c82617b 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -46,7 +46,7 @@ struct rx_ts_record {
u16 rx_indicate_seq;
u16 rx_timeout_indicate_seq;
struct list_head rx_pending_pkt_list;
- struct timer_list RxPktPendingTimer;
+ struct timer_list rx_pkt_pending_timer;
struct ba_record RxAdmittedBARecord;
u16 RxLastSeqNum;
u8 RxLastFragNum;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 0195c75ec59c..ae53303775da 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -19,7 +19,7 @@ static void TsInactTimeout(struct timer_list *unused)
static void RxPktPendingTimeout(struct timer_list *t)
{
struct rx_ts_record *pRxTs = from_timer(pRxTs, t,
- RxPktPendingTimer);
+ rx_pkt_pending_timer);
struct rtllib_device *ieee = container_of(pRxTs, struct rtllib_device,
RxTsRecord[pRxTs->num]);

@@ -82,7 +82,7 @@ static void RxPktPendingTimeout(struct timer_list *t)

if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) {
pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq;
- mod_timer(&pRxTs->RxPktPendingTimer, jiffies +
+ mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies +
msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime)
);
}
@@ -178,7 +178,7 @@ void TSInitialize(struct rtllib_device *ieee)
timer_setup(&pRxTS->RxAdmittedBARecord.timer,
RxBaInactTimeout, 0);

- timer_setup(&pRxTS->RxPktPendingTimer, RxPktPendingTimeout, 0);
+ timer_setup(&pRxTS->rx_pkt_pending_timer, RxPktPendingTimeout, 0);

ResetRxTsEntry(pRxTS);
list_add_tail(&pRxTS->ts_common_info.List,
@@ -405,8 +405,8 @@ static void RemoveTsEntry(struct rtllib_device *ieee,
struct rx_reorder_entry *pRxReorderEntry;
struct rx_ts_record *pRxTS = (struct rx_ts_record *)pTs;

- if (timer_pending(&pRxTS->RxPktPendingTimer))
- del_timer_sync(&pRxTS->RxPktPendingTimer);
+ if (timer_pending(&pRxTS->rx_pkt_pending_timer))
+ del_timer_sync(&pRxTS->rx_pkt_pending_timer);

while (!list_empty(&pRxTS->rx_pending_pkt_list)) {
pRxReorderEntry = (struct rx_reorder_entry *)
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index cbf314cbfebf..50c30993f68d 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -536,7 +536,7 @@ void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee,
struct rx_reorder_entry *pRxReorderEntry;
u8 RfdCnt = 0;

- del_timer_sync(&pTS->RxPktPendingTimer);
+ del_timer_sync(&pTS->rx_pkt_pending_timer);
while (!list_empty(&pTS->rx_pending_pkt_list)) {
if (RfdCnt >= REORDER_WIN_SIZE) {
netdev_info(ieee->dev,
@@ -735,8 +735,8 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
* Rx buffering.
*/
if (index > 0) {
- if (timer_pending(&pTS->RxPktPendingTimer))
- del_timer_sync(&pTS->RxPktPendingTimer);
+ if (timer_pending(&pTS->rx_pkt_pending_timer))
+ del_timer_sync(&pTS->rx_pkt_pending_timer);
pTS->rx_timeout_indicate_seq = 0xffff;

if (index > REORDER_WIN_SIZE) {
@@ -754,7 +754,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
if (bPktInBuf && pTS->rx_timeout_indicate_seq == 0xffff) {
netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__);
pTS->rx_timeout_indicate_seq = pTS->rx_indicate_seq;
- mod_timer(&pTS->RxPktPendingTimer, jiffies +
+ mod_timer(&pTS->rx_pkt_pending_timer, jiffies +
msecs_to_jiffies(pHTInfo->RxReorderPendingTime));
}
spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
--
2.30.1

2021-03-02 17:55:30

by William Durand

[permalink] [raw]
Subject: [PATCH 2/9] staging: rtl8192e: rename RxIndicateSeq to rx_indicate_seq in rx_ts_record struct

Rename RxIndicateSeq to rx_indicate_seq to silence a checkpatch warning
about CamelCase.

Signed-off-by: William Durand <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 16 ++++-----
drivers/staging/rtl8192e/rtllib_rx.c | 42 +++++++++++------------
3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index 58879fbba9ef..11335df748b5 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -43,7 +43,7 @@ struct tx_ts_record {

struct rx_ts_record {
struct ts_common_info ts_common_info;
- u16 RxIndicateSeq;
+ u16 rx_indicate_seq;
u16 RxTimeoutIndicateSeq;
struct list_head RxPendingPktList;
struct timer_list RxPktPendingTimer;
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index f8e7beb7909f..e885eff0ea79 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -36,18 +36,18 @@ static void RxPktPendingTimeout(struct timer_list *t)
list_entry(pRxTs->RxPendingPktList.prev,
struct rx_reorder_entry, List);
if (index == 0)
- pRxTs->RxIndicateSeq = pReorderEntry->SeqNum;
+ pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;

if (SN_LESS(pReorderEntry->SeqNum,
- pRxTs->RxIndicateSeq) ||
+ pRxTs->rx_indicate_seq) ||
SN_EQUAL(pReorderEntry->SeqNum,
- pRxTs->RxIndicateSeq)) {
+ pRxTs->rx_indicate_seq)) {
list_del_init(&pReorderEntry->List);

if (SN_EQUAL(pReorderEntry->SeqNum,
- pRxTs->RxIndicateSeq))
- pRxTs->RxIndicateSeq =
- (pRxTs->RxIndicateSeq + 1) % 4096;
+ pRxTs->rx_indicate_seq))
+ pRxTs->rx_indicate_seq =
+ (pRxTs->rx_indicate_seq + 1) % 4096;

netdev_dbg(ieee->dev,
"%s(): Indicate SeqNum: %d\n",
@@ -81,7 +81,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
}

if (bPktInBuf && (pRxTs->RxTimeoutIndicateSeq == 0xffff)) {
- pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq;
+ pRxTs->RxTimeoutIndicateSeq = pRxTs->rx_indicate_seq;
mod_timer(&pRxTs->RxPktPendingTimer, jiffies +
msecs_to_jiffies(ieee->pHTInfo->RxReorderPendingTime)
);
@@ -124,7 +124,7 @@ static void ResetTxTsEntry(struct tx_ts_record *pTS)
static void ResetRxTsEntry(struct rx_ts_record *pTS)
{
ResetTsCommonInfo(&pTS->ts_common_info);
- pTS->RxIndicateSeq = 0xffff;
+ pTS->rx_indicate_seq = 0xffff;
pTS->RxTimeoutIndicateSeq = 0xffff;
ResetBaEntry(&pTS->RxAdmittedBARecord);
}
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index b8ab34250e6a..c8fa4cf8eab0 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -560,7 +560,7 @@ void rtllib_FlushRxTsPendingPkts(struct rtllib_device *ieee,
}
rtllib_indicate_packets(ieee, ieee->RfdArray, RfdCnt);

- pTS->RxIndicateSeq = 0xffff;
+ pTS->rx_indicate_seq = 0xffff;
}

static void RxReorderIndicatePacket(struct rtllib_device *ieee,
@@ -576,21 +576,21 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
unsigned long flags;

netdev_dbg(ieee->dev,
- "%s(): Seq is %d, pTS->RxIndicateSeq is %d, WinSize is %d\n",
- __func__, SeqNum, pTS->RxIndicateSeq, WinSize);
+ "%s(): Seq is %d, pTS->rx_indicate_seq is %d, WinSize is %d\n",
+ __func__, SeqNum, pTS->rx_indicate_seq, WinSize);

spin_lock_irqsave(&(ieee->reorder_spinlock), flags);

- WinEnd = (pTS->RxIndicateSeq + WinSize - 1) % 4096;
+ WinEnd = (pTS->rx_indicate_seq + WinSize - 1) % 4096;
/* Rx Reorder initialize condition.*/
- if (pTS->RxIndicateSeq == 0xffff)
- pTS->RxIndicateSeq = SeqNum;
+ if (pTS->rx_indicate_seq == 0xffff)
+ pTS->rx_indicate_seq = SeqNum;

/* Drop out the packet which SeqNum is smaller than WinStart */
- if (SN_LESS(SeqNum, pTS->RxIndicateSeq)) {
+ if (SN_LESS(SeqNum, pTS->rx_indicate_seq)) {
netdev_dbg(ieee->dev,
"Packet Drop! IndicateSeq: %d, NewSeq: %d\n",
- pTS->RxIndicateSeq, SeqNum);
+ pTS->rx_indicate_seq, SeqNum);
pHTInfo->RxReorderDropCounter++;
{
int i;
@@ -608,18 +608,18 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
* 1. Incoming SeqNum is equal to WinStart =>Window shift 1
* 2. Incoming SeqNum is larger than the WinEnd => Window shift N
*/
- if (SN_EQUAL(SeqNum, pTS->RxIndicateSeq)) {
- pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) % 4096;
+ if (SN_EQUAL(SeqNum, pTS->rx_indicate_seq)) {
+ pTS->rx_indicate_seq = (pTS->rx_indicate_seq + 1) % 4096;
bMatchWinStart = true;
} else if (SN_LESS(WinEnd, SeqNum)) {
if (SeqNum >= (WinSize - 1))
- pTS->RxIndicateSeq = SeqNum + 1 - WinSize;
+ pTS->rx_indicate_seq = SeqNum + 1 - WinSize;
else
- pTS->RxIndicateSeq = 4095 -
+ pTS->rx_indicate_seq = 4095 -
(WinSize - (SeqNum + 1)) + 1;
netdev_dbg(ieee->dev,
"Window Shift! IndicateSeq: %d, NewSeq: %d\n",
- pTS->RxIndicateSeq, SeqNum);
+ pTS->rx_indicate_seq, SeqNum);
}

/* Indication process.
@@ -636,7 +636,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
/* Current packet is going to be indicated.*/
netdev_dbg(ieee->dev,
"Packets indication! IndicateSeq: %d, NewSeq: %d\n",
- pTS->RxIndicateSeq, SeqNum);
+ pTS->rx_indicate_seq, SeqNum);
ieee->prxbIndicateArray[0] = prxb;
index = 1;
} else {
@@ -658,7 +658,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,

netdev_dbg(ieee->dev,
"%s(): Duplicate packet is dropped. IndicateSeq: %d, NewSeq: %d\n",
- __func__, pTS->RxIndicateSeq,
+ __func__, pTS->rx_indicate_seq,
SeqNum);
list_add_tail(&pReorderEntry->List,
&ieee->RxReorder_Unused_List);
@@ -670,7 +670,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
} else {
netdev_dbg(ieee->dev,
"Pkt insert into struct buffer. IndicateSeq: %d, NewSeq: %d\n",
- pTS->RxIndicateSeq, SeqNum);
+ pTS->rx_indicate_seq, SeqNum);
}
} else {
/* Packets are dropped if there are not enough reorder
@@ -701,8 +701,8 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
list_entry(pTS->RxPendingPktList.prev,
struct rx_reorder_entry,
List);
- if (SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) ||
- SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) {
+ if (SN_LESS(pReorderEntry->SeqNum, pTS->rx_indicate_seq) ||
+ SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq)) {
/* This protect struct buffer from overflow. */
if (index >= REORDER_WIN_SIZE) {
netdev_err(ieee->dev,
@@ -714,8 +714,8 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,

list_del_init(&pReorderEntry->List);

- if (SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq))
- pTS->RxIndicateSeq = (pTS->RxIndicateSeq + 1) %
+ if (SN_EQUAL(pReorderEntry->SeqNum, pTS->rx_indicate_seq))
+ pTS->rx_indicate_seq = (pTS->rx_indicate_seq + 1) %
4096;

ieee->prxbIndicateArray[index] = pReorderEntry->prxb;
@@ -753,7 +753,7 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,

if (bPktInBuf && pTS->RxTimeoutIndicateSeq == 0xffff) {
netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__);
- pTS->RxTimeoutIndicateSeq = pTS->RxIndicateSeq;
+ pTS->RxTimeoutIndicateSeq = pTS->rx_indicate_seq;
mod_timer(&pTS->RxPktPendingTimer, jiffies +
msecs_to_jiffies(pHTInfo->RxReorderPendingTime));
}
--
2.30.1

2021-03-04 05:26:10

by William Durand

[permalink] [raw]
Subject: [PATCH 7/9] staging: rtl8192e: rename RxLastSeqNum to rx_last_seq_num in rx_ts_record struct

Rename RxLastSeqNum to rx_last_seq_num to silence a checkpatch warning
about CamelCase.

Signed-off-by: William Durand <[email protected]>
---
drivers/staging/rtl8192e/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192e/rtllib_rx.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h b/drivers/staging/rtl8192e/rtl819x_TS.h
index 333bf6b4f164..af1e658f2028 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -48,7 +48,7 @@ struct rx_ts_record {
struct list_head rx_pending_pkt_list;
struct timer_list rx_pkt_pending_timer;
struct ba_record rx_admitted_ba_record;
- u16 RxLastSeqNum;
+ u16 rx_last_seq_num;
u8 RxLastFragNum;
u8 num;
};
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 50c30993f68d..f1571e91aa08 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -939,10 +939,10 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
if (GetTs(ieee, (struct ts_common_info **) &pRxTS, hdr->addr2,
(u8)Frame_QoSTID((u8 *)(skb->data)), RX_DIR, true)) {
if ((fc & (1<<11)) && (frag == pRxTS->RxLastFragNum) &&
- (WLAN_GET_SEQ_SEQ(sc) == pRxTS->RxLastSeqNum))
+ (WLAN_GET_SEQ_SEQ(sc) == pRxTS->rx_last_seq_num))
return -1;
pRxTS->RxLastFragNum = frag;
- pRxTS->RxLastSeqNum = WLAN_GET_SEQ_SEQ(sc);
+ pRxTS->rx_last_seq_num = WLAN_GET_SEQ_SEQ(sc);
} else {
netdev_warn(ieee->dev, "%s(): No TS! Skip the check!\n",
__func__);
--
2.30.1