2018-07-13 20:16:54

by John Whitmore

[permalink] [raw]
Subject: staging:rtl8192u: [0/10] Coding style changes.

All coding style changes, but the second [2/10] is a bit more hairy then
most. The original code combined two typedef declarations into one with both
the structure and a pointer to the structure defined. I've totally removed the
pointer to the structure type since it uses Hungarian notation, which the
coding standard isn't keen on.

As a result of this there are changes in code from the type:
PStructType *ppname;
to:
struct StructType **ppname;

To keep the diff simple I've kept the current nameing of "ppname", which again
is Hungarian notation. I'll leave that for a future patch.

jwhitmore




2018-07-13 20:14:31

by John Whitmore

[permalink] [raw]
Subject: [PATCH 05/10] staging:rtl8192u: Rename InactTimer > inact_timer - Style

Rename the struct TS_COMMON_INFO member InactTimer to inact_timer.
This change clears the checkpatch issue with CamelCase naming. The change
should not have any impact on runtime execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 4601e5fd3e9c..9c0998db220f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -18,7 +18,7 @@ enum TR_SELECT {
struct TS_COMMON_INFO {
struct list_head list;
struct timer_list setup_timer;
- struct timer_list InactTimer;
+ struct timer_list inact_timer;
u8 Addr[6];
TSPEC_BODY TSpec;
QOS_TCLAS TClass[TCLAS_NUM];
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index cda20ee023b2..04cc101f680e 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -148,7 +148,7 @@ void TSInitialize(struct ieee80211_device *ieee)
// DLS related timer will be add here in the future!!
timer_setup(&pTxTS->TsCommonInfo.setup_timer, TsSetupTimeOut,
0);
- timer_setup(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout,
+ timer_setup(&pTxTS->TsCommonInfo.inact_timer, TsInactTimeout,
0);
timer_setup(&pTxTS->TsAddBaTimer, TsAddBaProcess, 0);
timer_setup(&pTxTS->TxPendingBARecord.Timer, BaSetupTimeOut,
@@ -169,7 +169,7 @@ void TSInitialize(struct ieee80211_device *ieee)
INIT_LIST_HEAD(&pRxTS->RxPendingPktList);
timer_setup(&pRxTS->TsCommonInfo.setup_timer, TsSetupTimeOut,
0);
- timer_setup(&pRxTS->TsCommonInfo.InactTimer, TsInactTimeout,
+ timer_setup(&pRxTS->TsCommonInfo.inact_timer, TsInactTimeout,
0);
timer_setup(&pRxTS->RxAdmittedBARecord.Timer,
RxBaInactTimeout, 0);
@@ -194,10 +194,10 @@ static void AdmitTS(struct ieee80211_device *ieee,
struct TS_COMMON_INFO *pTsCommonInfo, u32 InactTime)
{
del_timer_sync(&pTsCommonInfo->setup_timer);
- del_timer_sync(&pTsCommonInfo->InactTimer);
+ del_timer_sync(&pTsCommonInfo->inact_timer);

if(InactTime!=0)
- mod_timer(&pTsCommonInfo->InactTimer,
+ mod_timer(&pTsCommonInfo->inact_timer,
jiffies + msecs_to_jiffies(InactTime));
}

@@ -413,7 +413,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct TS_COMMON_INFO *
//u32 flags = 0;
unsigned long flags = 0;
del_timer_sync(&pTs->setup_timer);
- del_timer_sync(&pTs->InactTimer);
+ del_timer_sync(&pTs->inact_timer);
TsInitDelBA(ieee, pTs, TxRxSelect);

if(TxRxSelect == RX_DIR) {
--
2.18.0


2018-07-13 20:14:32

by John Whitmore

[permalink] [raw]
Subject: [PATCH 07/10] staging:rtl8192u: Rename TSpec > t_spec - Style

Rename the TS_COMMON_INFO structure's member TSpec to t_spec. This change
clears the checkpatch issue with CamelCase naming of variables. There should
be no impact on runtime execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index f9716db4509e..03a22ef59dfb 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -626,7 +626,7 @@ TsInitAddBA(
pBA->DialogToken++; // DialogToken: Only keep the latest dialog token
pBA->BaParamSet.field.AMSDU_Support = 0; // Do not support A-MSDU with A-MPDU now!!
pBA->BaParamSet.field.BAPolicy = Policy; // Policy: Delayed or Immediate
- pBA->BaParamSet.field.TID = pTS->TsCommonInfo.TSpec.f.TSInfo.field.ucTSID; // TID
+ pBA->BaParamSet.field.TID = pTS->TsCommonInfo.t_spec.f.TSInfo.field.ucTSID; // TID
// BufferSize: This need to be set according to A-MPDU vector
pBA->BaParamSet.field.BufferSize = 32; // BufferSize: This need to be set according to A-MPDU vector
pBA->BaTimeoutValue = 0; // Timeout value: Set 0 to disable Timer
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 4ad152920be4..d84092d17441 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -20,7 +20,7 @@ struct TS_COMMON_INFO {
struct timer_list setup_timer;
struct timer_list inact_timer;
u8 addr[6];
- TSPEC_BODY TSpec;
+ TSPEC_BODY t_spec;
QOS_TCLAS TClass[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 80e03dc73bae..8df665f4028d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -104,7 +104,7 @@ static void TsAddBaProcess(struct timer_list *t)
static void ResetTsCommonInfo(struct TS_COMMON_INFO *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
- memset(&pTsCommonInfo->TSpec, 0, sizeof(TSPEC_BODY));
+ memset(&pTsCommonInfo->t_spec, 0, sizeof(TSPEC_BODY));
memset(&pTsCommonInfo->TClass, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0;
@@ -248,8 +248,8 @@ static struct TS_COMMON_INFO *SearchAdmitTRStream(struct ieee80211_device *ieee,
list_for_each_entry(pRet, psearch_list, list){
// IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection);
if (memcmp(pRet->addr, Addr, 6) == 0)
- if (pRet->TSpec.f.TSInfo.field.ucTSID == TID)
- if(pRet->TSpec.f.TSInfo.field.ucDirection == dir) {
+ if (pRet->t_spec.f.TSInfo.field.ucTSID == TID)
+ if(pRet->t_spec.f.TSInfo.field.ucDirection == dir) {
// printk("Bingo! got it\n");
break;
}
@@ -276,7 +276,7 @@ static void MakeTSEntry(struct TS_COMMON_INFO *pTsCommonInfo, u8 *Addr,
memcpy(pTsCommonInfo->addr, Addr, 6);

if(pTSPEC != NULL)
- memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC, sizeof(TSPEC_BODY));
+ memcpy((u8 *)(&(pTsCommonInfo->t_spec)), (u8 *)pTSPEC, sizeof(TSPEC_BODY));

for(count = 0; count < TCLAS_Num; count++)
memcpy((u8 *)(&(pTsCommonInfo->TClass[count])), (u8 *)pTCLAS, sizeof(QOS_TCLAS));
--
2.18.0


2018-07-13 20:14:34

by John Whitmore

[permalink] [raw]
Subject: [PATCH 10/10] staging:rtl8192u: Rename TClasNum > t_clas_num - Style

Rename the struct TS_COMMON_INFO member variable TClasNum to t_clas_num. This
change clears the checkpatch issue with CamelCase naming. There should be no
impact on runtime execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index ffa2983b8f8f..79f129312ee9 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -23,7 +23,7 @@ struct TS_COMMON_INFO {
TSPEC_BODY t_spec;
QOS_TCLAS t_class[TCLAS_NUM];
u8 t_clas_proc;
- u8 TClasNum;
+ u8 t_clas_num;
};

typedef struct _TX_TS_RECORD {
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 1a6a0b938b63..96842e9a28fd 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -107,7 +107,7 @@ static void ResetTsCommonInfo(struct TS_COMMON_INFO *pTsCommonInfo)
memset(&pTsCommonInfo->t_spec, 0, sizeof(TSPEC_BODY));
memset(&pTsCommonInfo->t_class, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
pTsCommonInfo->t_clas_proc = 0;
- pTsCommonInfo->TClasNum = 0;
+ pTsCommonInfo->t_clas_num = 0;
}

static void ResetTxTsEntry(PTX_TS_RECORD pTS)
@@ -282,7 +282,7 @@ static void MakeTSEntry(struct TS_COMMON_INFO *pTsCommonInfo, u8 *Addr,
memcpy((u8 *)(&(pTsCommonInfo->t_class[count])), (u8 *)pTCLAS, sizeof(QOS_TCLAS));

pTsCommonInfo->t_clas_proc = TCLAS_Proc;
- pTsCommonInfo->TClasNum = TCLAS_Num;
+ pTsCommonInfo->t_clas_num = TCLAS_Num;
}


--
2.18.0


2018-07-13 20:14:41

by John Whitmore

[permalink] [raw]
Subject: [PATCH 09/10] staging:trl8192u: Rename TClasProc > t_clas_proc - Style

Rename the struct TS_COMMON_INFO member variable TClasProc to
t_clas_proc. This change clears the checkpatch issue with CamelCase variable
names. There should be no impact on runtime execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 4fee83f2589b..ffa2983b8f8f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -22,7 +22,7 @@ struct TS_COMMON_INFO {
u8 addr[6];
TSPEC_BODY t_spec;
QOS_TCLAS t_class[TCLAS_NUM];
- u8 TClasProc;
+ u8 t_clas_proc;
u8 TClasNum;
};

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index bf4f60e6aacf..1a6a0b938b63 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -106,7 +106,7 @@ static void ResetTsCommonInfo(struct TS_COMMON_INFO *pTsCommonInfo)
eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->t_spec, 0, sizeof(TSPEC_BODY));
memset(&pTsCommonInfo->t_class, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
- pTsCommonInfo->TClasProc = 0;
+ pTsCommonInfo->t_clas_proc = 0;
pTsCommonInfo->TClasNum = 0;
}

@@ -281,7 +281,7 @@ static void MakeTSEntry(struct TS_COMMON_INFO *pTsCommonInfo, u8 *Addr,
for(count = 0; count < TCLAS_Num; count++)
memcpy((u8 *)(&(pTsCommonInfo->t_class[count])), (u8 *)pTCLAS, sizeof(QOS_TCLAS));

- pTsCommonInfo->TClasProc = TCLAS_Proc;
+ pTsCommonInfo->t_clas_proc = TCLAS_Proc;
pTsCommonInfo->TClasNum = TCLAS_Num;
}

--
2.18.0


2018-07-13 20:14:50

by John Whitmore

[permalink] [raw]
Subject: [PATCH 08/10] staging:rtl8192u: Rename TClass > t_class - Style

Rename the struct TS_COMMON_INFO member variable from TClass to t_class. This
change clears the checkpatch issue with CamelCase Variable names. There should
be no impact on runtime execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index d84092d17441..4fee83f2589b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -21,7 +21,7 @@ struct TS_COMMON_INFO {
struct timer_list inact_timer;
u8 addr[6];
TSPEC_BODY t_spec;
- QOS_TCLAS TClass[TCLAS_NUM];
+ QOS_TCLAS t_class[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
};
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 8df665f4028d..bf4f60e6aacf 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -105,7 +105,7 @@ static void ResetTsCommonInfo(struct TS_COMMON_INFO *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->t_spec, 0, sizeof(TSPEC_BODY));
- memset(&pTsCommonInfo->TClass, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
+ memset(&pTsCommonInfo->t_class, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
pTsCommonInfo->TClasNum = 0;
}
@@ -279,7 +279,7 @@ static void MakeTSEntry(struct TS_COMMON_INFO *pTsCommonInfo, u8 *Addr,
memcpy((u8 *)(&(pTsCommonInfo->t_spec)), (u8 *)pTSPEC, sizeof(TSPEC_BODY));

for(count = 0; count < TCLAS_Num; count++)
- memcpy((u8 *)(&(pTsCommonInfo->TClass[count])), (u8 *)pTCLAS, sizeof(QOS_TCLAS));
+ memcpy((u8 *)(&(pTsCommonInfo->t_class[count])), (u8 *)pTCLAS, sizeof(QOS_TCLAS));

pTsCommonInfo->TClasProc = TCLAS_Proc;
pTsCommonInfo->TClasNum = TCLAS_Num;
--
2.18.0


2018-07-13 20:15:02

by John Whitmore

[permalink] [raw]
Subject: [PATCH 06/10] staging:rtl8192u: Rename Addr > addr - Style

Rename the TX_COMMON_INFO structure's member Addr to addr. This change
clears the checkpatch issue with CamelCase naming. This is a coding style
change only and should not impact runtime execution.

Signed-off-by: John Whitmore <[email protected]>
---
.../staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 10 +++++-----
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
.../staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 14 +++++++-------
3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index 6434ba47e5cb..f9716db4509e 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -634,7 +634,7 @@ TsInitAddBA(

ActivateBAEntry(ieee, pBA, BA_SETUP_TIMEOUT);

- ieee80211_send_ADDBAReq(ieee, pTS->TsCommonInfo.Addr, pBA);
+ ieee80211_send_ADDBAReq(ieee, pTS->TsCommonInfo.addr, pBA);
}

void
@@ -646,7 +646,7 @@ TsInitDelBA(struct ieee80211_device *ieee, struct TS_COMMON_INFO *pTsCommonInfo,
if (TxTsDeleteBA(ieee, pTxTs))
ieee80211_send_DELBA(
ieee,
- pTsCommonInfo->Addr,
+ pTsCommonInfo->addr,
(pTxTs->TxAdmittedBARecord.bValid)?(&pTxTs->TxAdmittedBARecord):(&pTxTs->TxPendingBARecord),
TxRxSelect,
DELBA_REASON_END_BA);
@@ -655,7 +655,7 @@ TsInitDelBA(struct ieee80211_device *ieee, struct TS_COMMON_INFO *pTsCommonInfo,
if (RxTsDeleteBA(ieee, pRxTs))
ieee80211_send_DELBA(
ieee,
- pTsCommonInfo->Addr,
+ pTsCommonInfo->addr,
&pRxTs->RxAdmittedBARecord,
TxRxSelect,
DELBA_REASON_END_BA);
@@ -683,7 +683,7 @@ void TxBaInactTimeout(struct timer_list *t)
TxTsDeleteBA(ieee, pTxTs);
ieee80211_send_DELBA(
ieee,
- pTxTs->TsCommonInfo.Addr,
+ pTxTs->TsCommonInfo.addr,
&pTxTs->TxAdmittedBARecord,
TX_DIR,
DELBA_REASON_TIMEOUT);
@@ -697,7 +697,7 @@ void RxBaInactTimeout(struct timer_list *t)
RxTsDeleteBA(ieee, pRxTs);
ieee80211_send_DELBA(
ieee,
- pRxTs->TsCommonInfo.Addr,
+ pRxTs->TsCommonInfo.addr,
&pRxTs->RxAdmittedBARecord,
RX_DIR,
DELBA_REASON_TIMEOUT);
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 9c0998db220f..4ad152920be4 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -19,7 +19,7 @@ struct TS_COMMON_INFO {
struct list_head list;
struct timer_list setup_timer;
struct timer_list inact_timer;
- u8 Addr[6];
+ u8 addr[6];
TSPEC_BODY TSpec;
QOS_TCLAS TClass[TCLAS_NUM];
u8 TClasProc;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 04cc101f680e..80e03dc73bae 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -103,7 +103,7 @@ static void TsAddBaProcess(struct timer_list *t)

static void ResetTsCommonInfo(struct TS_COMMON_INFO *pTsCommonInfo)
{
- eth_zero_addr(pTsCommonInfo->Addr);
+ eth_zero_addr(pTsCommonInfo->addr);
memset(&pTsCommonInfo->TSpec, 0, sizeof(TSPEC_BODY));
memset(&pTsCommonInfo->TClass, 0, sizeof(QOS_TCLAS)*TCLAS_NUM);
pTsCommonInfo->TClasProc = 0;
@@ -247,7 +247,7 @@ static struct TS_COMMON_INFO *SearchAdmitTRStream(struct ieee80211_device *ieee,
continue;
list_for_each_entry(pRet, psearch_list, list){
// IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection);
- if (memcmp(pRet->Addr, Addr, 6) == 0)
+ if (memcmp(pRet->addr, Addr, 6) == 0)
if (pRet->TSpec.f.TSInfo.field.ucTSID == TID)
if(pRet->TSpec.f.TSInfo.field.ucDirection == dir) {
// printk("Bingo! got it\n");
@@ -273,7 +273,7 @@ static void MakeTSEntry(struct TS_COMMON_INFO *pTsCommonInfo, u8 *Addr,
if(pTsCommonInfo == NULL)
return;

- memcpy(pTsCommonInfo->Addr, Addr, 6);
+ memcpy(pTsCommonInfo->addr, Addr, 6);

if(pTSPEC != NULL)
memcpy((u8 *)(&(pTsCommonInfo->TSpec)), (u8 *)pTSPEC, sizeof(TSPEC_BODY));
@@ -458,7 +458,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)

printk("===========>RemovePeerTS,%pM\n", Addr);
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, list) {
- if (memcmp(pTS->Addr, Addr, 6) == 0) {
+ if (memcmp(pTS->addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, TX_DIR);
list_del_init(&pTS->list);
list_add_tail(&pTS->list, &ieee->Tx_TS_Unused_List);
@@ -466,7 +466,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)
}

list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, list) {
- if (memcmp(pTS->Addr, Addr, 6) == 0) {
+ if (memcmp(pTS->addr, Addr, 6) == 0) {
printk("====>remove Tx_TS_admin_list\n");
RemoveTsEntry(ieee, pTS, TX_DIR);
list_del_init(&pTS->list);
@@ -475,7 +475,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)
}

list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, list) {
- if (memcmp(pTS->Addr, Addr, 6) == 0) {
+ if (memcmp(pTS->addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, RX_DIR);
list_del_init(&pTS->list);
list_add_tail(&pTS->list, &ieee->Rx_TS_Unused_List);
@@ -483,7 +483,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)
}

list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, list) {
- if (memcmp(pTS->Addr, Addr, 6) == 0) {
+ if (memcmp(pTS->addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, RX_DIR);
list_del_init(&pTS->list);
list_add_tail(&pTS->list, &ieee->Rx_TS_Unused_List);
--
2.18.0


2018-07-13 20:15:02

by John Whitmore

[permalink] [raw]
Subject: [PATCH 02/10] staging:rtl8192u: remove typedef of struct TS_COMMON_INFO - Style

To clear a checkpatch issue removed the typedef of the structure
TS_COMMON_INFO.

This change removes the previous declaration, which defined two types, both
TS_COMMON_INFO and a pointer type PTS_COMMON_INFO:

typedef struct _TS_COMMON_INFO {
...
} TS_COMMON_INFO, *PTS_COMMON_INFO;

The pointer type has been completely removed from the code, as:
"(so-called Hungarian notation) is brain damaged" according to the coding
standard.

Signed-off-by: John Whitmore <[email protected]>
---
.../staging/rtl8192u/ieee80211/ieee80211.h | 4 ++--
.../staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
.../staging/rtl8192u/ieee80211/ieee80211_tx.c | 4 ++--
.../rtl8192u/ieee80211/rtl819x_BAProc.c | 10 ++++----
.../staging/rtl8192u/ieee80211/rtl819x_TS.h | 8 +++----
.../rtl8192u/ieee80211/rtl819x_TSProc.c | 24 +++++++++----------
6 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 0fa55af7060a..f4e1c9655fa0 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -2391,7 +2391,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb);
void TsInitAddBA(struct ieee80211_device *ieee, PTX_TS_RECORD pTS,
u8 Policy, u8 bOverwritePending);
void TsInitDelBA(struct ieee80211_device *ieee,
- PTS_COMMON_INFO pTsCommonInfo, enum TR_SELECT TxRxSelect);
+ struct TS_COMMON_INFO *pTsCommonInfo, enum TR_SELECT TxRxSelect);
void BaSetupTimeOut(struct timer_list *t);
void TxBaInactTimeout(struct timer_list *t);
void RxBaInactTimeout(struct timer_list *t);
@@ -2399,7 +2399,7 @@ void ResetBaEntry(PBA_RECORD pBA);
//function in TS.c
bool GetTs(
struct ieee80211_device *ieee,
- PTS_COMMON_INFO *ppTS,
+ struct TS_COMMON_INFO **ppTS,
u8 *Addr,
u8 TID,
enum TR_SELECT TxRxSelect, //Rx:1, Tx:0
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 172165f4461a..55563d0a7ae0 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -1021,7 +1021,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
//IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__func__, tid);
if(GetTs(
ieee,
- (PTS_COMMON_INFO *) &pRxTS,
+ (struct TS_COMMON_INFO **) &pRxTS,
hdr->addr2,
Frame_QoSTID((u8 *)(skb->data)),
RX_DIR,
@@ -1266,7 +1266,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
{
TID = Frame_QoSTID(skb->data);
SeqNum = WLAN_GET_SEQ_SEQ(sc);
- GetTs(ieee,(PTS_COMMON_INFO *) &pTS,hdr->addr2,TID,RX_DIR,true);
+ GetTs(ieee,(struct TS_COMMON_INFO **) &pTS,hdr->addr2,TID,RX_DIR,true);
if (TID !=0 && TID !=3)
{
ieee->bis_any_nonbepkts = true;
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 9a1a84548bc6..d7a6ab5742a7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -330,7 +330,7 @@ static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee,
}
if(pHTInfo->bCurrentAMPDUEnable)
{
- if (!GetTs(ieee, (PTS_COMMON_INFO *)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true))
+ if (!GetTs(ieee, (struct TS_COMMON_INFO **)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true))
{
printk("===>can't get TS\n");
return;
@@ -585,7 +585,7 @@ static void ieee80211_query_seqnum(struct ieee80211_device *ieee,
if (IsQoSDataFrame(skb->data)) //we deal qos data only
{
PTX_TS_RECORD pTS = NULL;
- if (!GetTs(ieee, (PTS_COMMON_INFO *)(&pTS), dst, skb->priority, TX_DIR, true))
+ if (!GetTs(ieee, (struct TS_COMMON_INFO **)(&pTS), dst, skb->priority, TX_DIR, true))
{
return;
}
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index 07d64ae12fdd..6434ba47e5cb 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -360,7 +360,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
// If there is no matched TS, reject the ADDBA request.
if (!GetTs(
ieee,
- (PTS_COMMON_INFO *)(&pTS),
+ (struct TS_COMMON_INFO **)(&pTS),
dst,
(u8)(pBaParamSet->field.TID),
RX_DIR,
@@ -459,7 +459,7 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
//
if (!GetTs(
ieee,
- (PTS_COMMON_INFO *)(&pTS),
+ (struct TS_COMMON_INFO **)(&pTS),
dst,
(u8)(pBaParamSet->field.TID),
TX_DIR,
@@ -570,7 +570,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb)

if (!GetTs(
ieee,
- (PTS_COMMON_INFO *)&pRxTs,
+ (struct TS_COMMON_INFO **)&pRxTs,
dst,
(u8)pDelBaParamSet->field.TID,
RX_DIR,
@@ -585,7 +585,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb)

if (!GetTs(
ieee,
- (PTS_COMMON_INFO *)&pTxTs,
+ (struct TS_COMMON_INFO **)&pTxTs,
dst,
(u8)pDelBaParamSet->field.TID,
TX_DIR,
@@ -638,7 +638,7 @@ TsInitAddBA(
}

void
-TsInitDelBA(struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, enum TR_SELECT TxRxSelect)
+TsInitDelBA(struct ieee80211_device *ieee, struct TS_COMMON_INFO *pTsCommonInfo, enum TR_SELECT TxRxSelect)
{
if (TxRxSelect == TX_DIR) {
PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)pTsCommonInfo;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 3a5347818718..39ce5d89883f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -15,7 +15,7 @@ enum TR_SELECT {
RX_DIR = 1,
};

-typedef struct _TS_COMMON_INFO {
+struct TS_COMMON_INFO {
struct list_head List;
struct timer_list SetupTimer;
struct timer_list InactTimer;
@@ -24,10 +24,10 @@ typedef struct _TS_COMMON_INFO {
QOS_TCLAS TClass[TCLAS_NUM];
u8 TClasProc;
u8 TClasNum;
-} TS_COMMON_INFO, *PTS_COMMON_INFO;
+};

typedef struct _TX_TS_RECORD {
- TS_COMMON_INFO TsCommonInfo;
+ struct TS_COMMON_INFO TsCommonInfo;
u16 TxCurSeq;
BA_RECORD TxPendingBARecord; /* For BA Originator */
BA_RECORD TxAdmittedBARecord; /* For BA Originator */
@@ -40,7 +40,7 @@ typedef struct _TX_TS_RECORD {
} TX_TS_RECORD, *PTX_TS_RECORD;

typedef struct _RX_TS_RECORD {
- TS_COMMON_INFO TsCommonInfo;
+ struct TS_COMMON_INFO TsCommonInfo;
u16 RxIndicateSeq;
u16 RxTimeoutIndicateSeq;
struct list_head RxPendingPktList;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 75d269a7bf09..a3bcb15037af 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -101,7 +101,7 @@ static void TsAddBaProcess(struct timer_list *t)
}


-static void ResetTsCommonInfo(PTS_COMMON_INFO pTsCommonInfo)
+static void ResetTsCommonInfo(struct TS_COMMON_INFO *pTsCommonInfo)
{
eth_zero_addr(pTsCommonInfo->Addr);
memset(&pTsCommonInfo->TSpec, 0, sizeof(TSPEC_BODY));
@@ -191,7 +191,7 @@ void TSInitialize(struct ieee80211_device *ieee)
}

static void AdmitTS(struct ieee80211_device *ieee,
- PTS_COMMON_INFO pTsCommonInfo, u32 InactTime)
+ struct TS_COMMON_INFO *pTsCommonInfo, u32 InactTime)
{
del_timer_sync(&pTsCommonInfo->SetupTimer);
del_timer_sync(&pTsCommonInfo->InactTimer);
@@ -202,15 +202,15 @@ static void AdmitTS(struct ieee80211_device *ieee,
}


-static PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee,
- u8 *Addr, u8 TID,
- enum TR_SELECT TxRxSelect)
+static struct TS_COMMON_INFO *SearchAdmitTRStream(struct ieee80211_device *ieee,
+ u8 *Addr, u8 TID,
+ enum TR_SELECT TxRxSelect)
{
//DIRECTION_VALUE dir;
u8 dir;
bool search_dir[4] = {0};
struct list_head *psearch_list; //FIXME
- PTS_COMMON_INFO pRet = NULL;
+ struct TS_COMMON_INFO *pRet = NULL;
if(ieee->iw_mode == IW_MODE_MASTER) { //ap mode
if(TxRxSelect == TX_DIR) {
search_dir[DIR_DOWN] = true;
@@ -264,7 +264,7 @@ static PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee,
return NULL;
}

-static void MakeTSEntry(PTS_COMMON_INFO pTsCommonInfo, u8 *Addr,
+static void MakeTSEntry(struct TS_COMMON_INFO *pTsCommonInfo, u8 *Addr,
PTSPEC_BODY pTSPEC, PQOS_TCLAS pTCLAS, u8 TCLAS_Num,
u8 TCLAS_Proc)
{
@@ -288,7 +288,7 @@ static void MakeTSEntry(PTS_COMMON_INFO pTsCommonInfo, u8 *Addr,

bool GetTs(
struct ieee80211_device *ieee,
- PTS_COMMON_INFO *ppTS,
+ struct TS_COMMON_INFO **ppTS,
u8 *Addr,
u8 TID,
enum TR_SELECT TxRxSelect, //Rx:1, Tx:0
@@ -371,7 +371,7 @@ bool GetTs(
((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN);
IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n");
if(!list_empty(pUnusedList)) {
- (*ppTS) = list_entry(pUnusedList->next, TS_COMMON_INFO, List);
+ (*ppTS) = list_entry(pUnusedList->next, struct TS_COMMON_INFO, List);
list_del_init(&(*ppTS)->List);
if(TxRxSelect==TX_DIR) {
PTX_TS_RECORD tmp = container_of(*ppTS, TX_TS_RECORD, TsCommonInfo);
@@ -407,7 +407,7 @@ bool GetTs(
}
}

-static void RemoveTsEntry(struct ieee80211_device *ieee, PTS_COMMON_INFO pTs,
+static void RemoveTsEntry(struct ieee80211_device *ieee, struct TS_COMMON_INFO *pTs,
enum TR_SELECT TxRxSelect)
{
//u32 flags = 0;
@@ -454,7 +454,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, PTS_COMMON_INFO pTs,

void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)
{
- PTS_COMMON_INFO pTS, pTmpTS;
+ struct TS_COMMON_INFO *pTS, *pTmpTS;

printk("===========>RemovePeerTS,%pM\n", Addr);
list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) {
@@ -493,7 +493,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)

void RemoveAllTS(struct ieee80211_device *ieee)
{
- PTS_COMMON_INFO pTS, pTmpTS;
+ struct TS_COMMON_INFO *pTS, *pTmpTS;

list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) {
RemoveTsEntry(ieee, pTS, TX_DIR);
--
2.18.0


2018-07-13 20:15:14

by John Whitmore

[permalink] [raw]
Subject: [PATCH 04/10] staging:rtl8192u: rename SetupTimer > setup_timer - Style

Rename the struct TS_COMMON_INFO member SetupTimer to setup_timer. This
clears the checkpatch issue with CamelCase variable names.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index bf1e01cde407..4601e5fd3e9c 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -17,7 +17,7 @@ enum TR_SELECT {

struct TS_COMMON_INFO {
struct list_head list;
- struct timer_list SetupTimer;
+ struct timer_list setup_timer;
struct timer_list InactTimer;
u8 Addr[6];
TSPEC_BODY TSpec;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index cc6fdcb7c5fb..cda20ee023b2 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -146,7 +146,7 @@ void TSInitialize(struct ieee80211_device *ieee)
pTxTS->num = count;
// The timers for the operation of Traffic Stream and Block Ack.
// DLS related timer will be add here in the future!!
- timer_setup(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut,
+ timer_setup(&pTxTS->TsCommonInfo.setup_timer, TsSetupTimeOut,
0);
timer_setup(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout,
0);
@@ -167,7 +167,7 @@ void TSInitialize(struct ieee80211_device *ieee)
for(count = 0; count < TOTAL_TS_NUM; count++) {
pRxTS->num = count;
INIT_LIST_HEAD(&pRxTS->RxPendingPktList);
- timer_setup(&pRxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut,
+ timer_setup(&pRxTS->TsCommonInfo.setup_timer, TsSetupTimeOut,
0);
timer_setup(&pRxTS->TsCommonInfo.InactTimer, TsInactTimeout,
0);
@@ -193,7 +193,7 @@ void TSInitialize(struct ieee80211_device *ieee)
static void AdmitTS(struct ieee80211_device *ieee,
struct TS_COMMON_INFO *pTsCommonInfo, u32 InactTime)
{
- del_timer_sync(&pTsCommonInfo->SetupTimer);
+ del_timer_sync(&pTsCommonInfo->setup_timer);
del_timer_sync(&pTsCommonInfo->InactTimer);

if(InactTime!=0)
@@ -412,7 +412,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct TS_COMMON_INFO *
{
//u32 flags = 0;
unsigned long flags = 0;
- del_timer_sync(&pTs->SetupTimer);
+ del_timer_sync(&pTs->setup_timer);
del_timer_sync(&pTs->InactTimer);
TsInitDelBA(ieee, pTs, TxRxSelect);

--
2.18.0


2018-07-13 20:15:51

by John Whitmore

[permalink] [raw]
Subject: [PATCH 01/10] staging:rtl8192u: remove typedef of enumeration TR_SELECT - Style

To clear a checkpatch issue removed the typedef of the enumeration TR_SELECT
this should not impact runtime code as it's only a coding style change.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++--
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 10 +++++-----
drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++--
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 3b7968681f77..0fa55af7060a 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -2391,7 +2391,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb);
void TsInitAddBA(struct ieee80211_device *ieee, PTX_TS_RECORD pTS,
u8 Policy, u8 bOverwritePending);
void TsInitDelBA(struct ieee80211_device *ieee,
- PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect);
+ PTS_COMMON_INFO pTsCommonInfo, enum TR_SELECT TxRxSelect);
void BaSetupTimeOut(struct timer_list *t);
void TxBaInactTimeout(struct timer_list *t);
void RxBaInactTimeout(struct timer_list *t);
@@ -2402,7 +2402,7 @@ bool GetTs(
PTS_COMMON_INFO *ppTS,
u8 *Addr,
u8 TID,
- TR_SELECT TxRxSelect, //Rx:1, Tx:0
+ enum TR_SELECT TxRxSelect, //Rx:1, Tx:0
bool bAddNewTs
);
void TSInitialize(struct ieee80211_device *ieee);
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index 2dc4d0e93948..07d64ae12fdd 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -174,7 +174,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
*function: construct DELBA frame
* input: u8* dst //DELBA frame's destination
* PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA
- * TR_SELECT TxRxSelect //TX RX direction
+ * enum TR_SELECT TxRxSelect //TX RX direction
* u16 ReasonCode //status code.
* output: none
* return: sk_buff* skb //return constructed skb to xmit
@@ -183,7 +183,7 @@ static struct sk_buff *ieee80211_DELBA(
struct ieee80211_device *ieee,
u8 *dst,
PBA_RECORD pBA,
- TR_SELECT TxRxSelect,
+ enum TR_SELECT TxRxSelect,
u16 ReasonCode
)
{
@@ -290,14 +290,14 @@ static void ieee80211_send_ADDBARsp(struct ieee80211_device *ieee, u8 *dst,
*function: send ADDBARSP frame out
* input: u8* dst //DELBA frame's destination
* PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA
- * TR_SELECT TxRxSelect //TX or RX
+ * enum TR_SELECT TxRxSelect //TX or RX
* u16 ReasonCode //DEL ReasonCode
* output: none
* notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
********************************************************************************************************************/

static void ieee80211_send_DELBA(struct ieee80211_device *ieee, u8 *dst,
- PBA_RECORD pBA, TR_SELECT TxRxSelect,
+ PBA_RECORD pBA, enum TR_SELECT TxRxSelect,
u16 ReasonCode)
{
struct sk_buff *skb;
@@ -638,7 +638,7 @@ TsInitAddBA(
}

void
-TsInitDelBA(struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect)
+TsInitDelBA(struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, enum TR_SELECT TxRxSelect)
{
if (TxRxSelect == TX_DIR) {
PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)pTsCommonInfo;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 3a0ff08c687a..3a5347818718 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -10,10 +10,10 @@
#define TCLAS_NUM 4

/* This define the Tx/Rx directions */
-typedef enum _TR_SELECT {
+enum TR_SELECT {
TX_DIR = 0,
RX_DIR = 1,
-} TR_SELECT, *PTR_SELECT;
+};

typedef struct _TS_COMMON_INFO {
struct list_head List;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index e60a26250682..75d269a7bf09 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -204,7 +204,7 @@ static void AdmitTS(struct ieee80211_device *ieee,

static PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee,
u8 *Addr, u8 TID,
- TR_SELECT TxRxSelect)
+ enum TR_SELECT TxRxSelect)
{
//DIRECTION_VALUE dir;
u8 dir;
@@ -291,7 +291,7 @@ bool GetTs(
PTS_COMMON_INFO *ppTS,
u8 *Addr,
u8 TID,
- TR_SELECT TxRxSelect, //Rx:1, Tx:0
+ enum TR_SELECT TxRxSelect, //Rx:1, Tx:0
bool bAddNewTs
)
{
@@ -408,7 +408,7 @@ bool GetTs(
}

static void RemoveTsEntry(struct ieee80211_device *ieee, PTS_COMMON_INFO pTs,
- TR_SELECT TxRxSelect)
+ enum TR_SELECT TxRxSelect)
{
//u32 flags = 0;
unsigned long flags = 0;
--
2.18.0


2018-07-13 20:16:02

by John Whitmore

[permalink] [raw]
Subject: [PATCH 03/10] staging:rtl8192u: Rename List > list - Coding style

In struct TS_COMMON_INFO rename the member List to list. This clears the
checkpatch issue concerning CamelCase naming of variables.

Signed-off-by: John Whitmore <[email protected]>
---
.../staging/rtl8192u/ieee80211/rtl819x_TS.h | 2 +-
.../rtl8192u/ieee80211/rtl819x_TSProc.c | 64 +++++++++----------
2 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
index 39ce5d89883f..bf1e01cde407 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h
@@ -16,7 +16,7 @@ enum TR_SELECT {
};

struct TS_COMMON_INFO {
- struct list_head List;
+ struct list_head list;
struct timer_list SetupTimer;
struct timer_list InactTimer;
u8 Addr[6];
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index a3bcb15037af..cc6fdcb7c5fb 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -156,7 +156,7 @@ void TSInitialize(struct ieee80211_device *ieee)
timer_setup(&pTxTS->TxAdmittedBARecord.Timer,
TxBaInactTimeout, 0);
ResetTxTsEntry(pTxTS);
- list_add_tail(&pTxTS->TsCommonInfo.List, &ieee->Tx_TS_Unused_List);
+ list_add_tail(&pTxTS->TsCommonInfo.list, &ieee->Tx_TS_Unused_List);
pTxTS++;
}

@@ -175,7 +175,7 @@ void TSInitialize(struct ieee80211_device *ieee)
RxBaInactTimeout, 0);
timer_setup(&pRxTS->RxPktPendingTimer, RxPktPendingTimeout, 0);
ResetRxTsEntry(pRxTS);
- list_add_tail(&pRxTS->TsCommonInfo.List, &ieee->Rx_TS_Unused_List);
+ list_add_tail(&pRxTS->TsCommonInfo.list, &ieee->Rx_TS_Unused_List);
pRxTS++;
}
// Initialize unused Rx Reorder List.
@@ -245,7 +245,7 @@ static struct TS_COMMON_INFO *SearchAdmitTRStream(struct ieee80211_device *ieee,
for(dir = 0; dir <= DIR_BI_DIR; dir++) {
if (!search_dir[dir])
continue;
- list_for_each_entry(pRet, psearch_list, List){
+ list_for_each_entry(pRet, psearch_list, list){
// IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.f.TSInfo.field.ucTSID, pRet->TSpec.f.TSInfo.field.ucDirection);
if (memcmp(pRet->Addr, Addr, 6) == 0)
if (pRet->TSpec.f.TSInfo.field.ucTSID == TID)
@@ -254,11 +254,11 @@ static struct TS_COMMON_INFO *SearchAdmitTRStream(struct ieee80211_device *ieee,
break;
}
}
- if(&pRet->List != psearch_list)
+ if(&pRet->list != psearch_list)
break;
}

- if(&pRet->List != psearch_list)
+ if(&pRet->list != psearch_list)
return pRet ;
else
return NULL;
@@ -371,8 +371,8 @@ bool GetTs(
((TxRxSelect==TX_DIR)?DIR_UP:DIR_DOWN);
IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n");
if(!list_empty(pUnusedList)) {
- (*ppTS) = list_entry(pUnusedList->next, struct TS_COMMON_INFO, List);
- list_del_init(&(*ppTS)->List);
+ (*ppTS) = list_entry(pUnusedList->next, struct TS_COMMON_INFO, list);
+ list_del_init(&(*ppTS)->list);
if(TxRxSelect==TX_DIR) {
PTX_TS_RECORD tmp = container_of(*ppTS, TX_TS_RECORD, TsCommonInfo);
ResetTxTsEntry(tmp);
@@ -395,7 +395,7 @@ bool GetTs(

MakeTSEntry(*ppTS, Addr, &TSpec, NULL, 0, 0);
AdmitTS(ieee, *ppTS, 0);
- list_add_tail(&((*ppTS)->List), pAddmitList);
+ list_add_tail(&((*ppTS)->list), pAddmitList);
// if there is DirectLink, we need to do additional operation here!!

return true;
@@ -457,36 +457,36 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr)
struct TS_COMMON_INFO *pTS, *pTmpTS;

printk("===========>RemovePeerTS,%pM\n", Addr);
- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, list) {
if (memcmp(pTS->Addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, TX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Tx_TS_Unused_List);
}
}

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, list) {
if (memcmp(pTS->Addr, Addr, 6) == 0) {
printk("====>remove Tx_TS_admin_list\n");
RemoveTsEntry(ieee, pTS, TX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Tx_TS_Unused_List);
}
}

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, list) {
if (memcmp(pTS->Addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, RX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Rx_TS_Unused_List);
}
}

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, list) {
if (memcmp(pTS->Addr, Addr, 6) == 0) {
RemoveTsEntry(ieee, pTS, RX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Rx_TS_Unused_List);
}
}
}
@@ -495,28 +495,28 @@ void RemoveAllTS(struct ieee80211_device *ieee)
{
struct TS_COMMON_INFO *pTS, *pTmpTS;

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, list) {
RemoveTsEntry(ieee, pTS, TX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Tx_TS_Unused_List);
}

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Admit_List, list) {
RemoveTsEntry(ieee, pTS, TX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Tx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Tx_TS_Unused_List);
}

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Pending_List, list) {
RemoveTsEntry(ieee, pTS, RX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Rx_TS_Unused_List);
}

- list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, List) {
+ list_for_each_entry_safe(pTS, pTmpTS, &ieee->Rx_TS_Admit_List, list) {
RemoveTsEntry(ieee, pTS, RX_DIR);
- list_del_init(&pTS->List);
- list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List);
+ list_del_init(&pTS->list);
+ list_add_tail(&pTS->list, &ieee->Rx_TS_Unused_List);
}
}

--
2.18.0


2018-07-16 08:41:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: staging:rtl8192u: [0/10] Coding style changes.

On Fri, Jul 13, 2018 at 09:12:37PM +0100, John Whitmore wrote:
> All coding style changes, but the second [2/10] is a bit more hairy then
> most. The original code combined two typedef declarations into one with both
> the structure and a pointer to the structure defined. I've totally removed the
> pointer to the structure type since it uses Hungarian notation, which the
> coding standard isn't keen on.
>
> As a result of this there are changes in code from the type:
> PStructType *ppname;
> to:
> struct StructType **ppname;
>
> To keep the diff simple I've kept the current nameing of "ppname", which again
> is Hungarian notation. I'll leave that for a future patch.

Nit, your subject should look like:

Subject: [PATCH 00/10] staging:rtl8192u: Coding style changes.

What are you using to generate this email? git format-patch
--cover-letter should generate it with a correct subject line prefix,
right?

thanks,

greg k-h

2018-07-16 08:42:35

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 01/10] staging:rtl8192u: remove typedef of enumeration TR_SELECT - Style

On Fri, Jul 13, 2018 at 09:12:38PM +0100, John Whitmore wrote:
> To clear a checkpatch issue removed the typedef of the enumeration TR_SELECT
> this should not impact runtime code as it's only a coding style change.
>
> Signed-off-by: John Whitmore <[email protected]>
> ---
> drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++--
> drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 10 +++++-----
> drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++--
> drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 6 +++---
> 4 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> index 3b7968681f77..0fa55af7060a 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> @@ -2391,7 +2391,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb);
> void TsInitAddBA(struct ieee80211_device *ieee, PTX_TS_RECORD pTS,
> u8 Policy, u8 bOverwritePending);
> void TsInitDelBA(struct ieee80211_device *ieee,
> - PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect);
> + PTS_COMMON_INFO pTsCommonInfo, enum TR_SELECT TxRxSelect);
> void BaSetupTimeOut(struct timer_list *t);
> void TxBaInactTimeout(struct timer_list *t);
> void RxBaInactTimeout(struct timer_list *t);
> @@ -2402,7 +2402,7 @@ bool GetTs(
> PTS_COMMON_INFO *ppTS,
> u8 *Addr,
> u8 TID,
> - TR_SELECT TxRxSelect, //Rx:1, Tx:0
> + enum TR_SELECT TxRxSelect, //Rx:1, Tx:0

This really should be "enum tr_select", right? No ALL CAPS variable
types please.

thanks,

greg k-h

2018-07-16 08:44:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 02/10] staging:rtl8192u: remove typedef of struct TS_COMMON_INFO - Style

On Fri, Jul 13, 2018 at 09:12:39PM +0100, John Whitmore wrote:
> To clear a checkpatch issue removed the typedef of the structure
> TS_COMMON_INFO.
>
> This change removes the previous declaration, which defined two types, both
> TS_COMMON_INFO and a pointer type PTS_COMMON_INFO:
>
> typedef struct _TS_COMMON_INFO {
> ...
> } TS_COMMON_INFO, *PTS_COMMON_INFO;
>

Same here, this should be "struct ts_common_info", not TS_COMMON_INFO.

Can you fix both of these issues up and resend the series?

thanks,

greg k-h

2018-07-16 11:31:37

by John Whitmore

[permalink] [raw]
Subject: Re: [PATCH 01/10] staging:rtl8192u: remove typedef of enumeration TR_SELECT - Style

On Mon, Jul 16, 2018 at 10:41:38AM +0200, Greg KH wrote:
> On Fri, Jul 13, 2018 at 09:12:38PM +0100, John Whitmore wrote:
> > To clear a checkpatch issue removed the typedef of the enumeration TR_SELECT
> > this should not impact runtime code as it's only a coding style change.
> >
> > Signed-off-by: John Whitmore <[email protected]>
> > ---
> > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 ++--
> > drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 10 +++++-----
> > drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h | 4 ++--
> > drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 6 +++---
> > 4 files changed, 12 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> > index 3b7968681f77..0fa55af7060a 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
> > @@ -2391,7 +2391,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb);
> > void TsInitAddBA(struct ieee80211_device *ieee, PTX_TS_RECORD pTS,
> > u8 Policy, u8 bOverwritePending);
> > void TsInitDelBA(struct ieee80211_device *ieee,
> > - PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect);
> > + PTS_COMMON_INFO pTsCommonInfo, enum TR_SELECT TxRxSelect);
> > void BaSetupTimeOut(struct timer_list *t);
> > void TxBaInactTimeout(struct timer_list *t);
> > void RxBaInactTimeout(struct timer_list *t);
> > @@ -2402,7 +2402,7 @@ bool GetTs(
> > PTS_COMMON_INFO *ppTS,
> > u8 *Addr,
> > u8 TID,
> > - TR_SELECT TxRxSelect, //Rx:1, Tx:0
> > + enum TR_SELECT TxRxSelect, //Rx:1, Tx:0
>
> This really should be "enum tr_select", right? No ALL CAPS variable
> types please.
>

Absolutely, I was trying to make small changes, not doing too much in a single
patch. I know there's a happy medium somewhere. I'll fix that up and resend
series again.

Cheers

John

2018-07-16 11:36:07

by John Whitmore

[permalink] [raw]
Subject: Re: staging:rtl8192u: [0/10] Coding style changes.

On Mon, Jul 16, 2018 at 10:40:20AM +0200, Greg KH wrote:
> On Fri, Jul 13, 2018 at 09:12:37PM +0100, John Whitmore wrote:
> > All coding style changes, but the second [2/10] is a bit more hairy then
> > most. The original code combined two typedef declarations into one with both
> > the structure and a pointer to the structure defined. I've totally removed the
> > pointer to the structure type since it uses Hungarian notation, which the
> > coding standard isn't keen on.
> >
> > As a result of this there are changes in code from the type:
> > PStructType *ppname;
> > to:
> > struct StructType **ppname;
> >
> > To keep the diff simple I've kept the current nameing of "ppname", which again
> > is Hungarian notation. I'll leave that for a future patch.
>
> Nit, your subject should look like:
>
> Subject: [PATCH 00/10] staging:rtl8192u: Coding style changes.
>
> What are you using to generate this email? git format-patch
> --cover-letter should generate it with a correct subject line prefix,
> right?
>

Oops! I was using "git send-email --compose" didn't realise that option was
included in format-patch. I'll use that format-patch option in future.

John

2018-07-16 11:37:52

by John Whitmore

[permalink] [raw]
Subject: Re: [PATCH 02/10] staging:rtl8192u: remove typedef of struct TS_COMMON_INFO - Style

On Mon, Jul 16, 2018 at 10:42:05AM +0200, Greg KH wrote:
> On Fri, Jul 13, 2018 at 09:12:39PM +0100, John Whitmore wrote:
> > To clear a checkpatch issue removed the typedef of the structure
> > TS_COMMON_INFO.
> >
> > This change removes the previous declaration, which defined two types, both
> > TS_COMMON_INFO and a pointer type PTS_COMMON_INFO:
> >
> > typedef struct _TS_COMMON_INFO {
> > ...
> > } TS_COMMON_INFO, *PTS_COMMON_INFO;
> >
>
> Same here, this should be "struct ts_common_info", not TS_COMMON_INFO.
>
> Can you fix both of these issues up and resend the series?
>

No problem, I'll fix up the series and resend.

John