2018-08-29 20:37:34

by John Whitmore

[permalink] [raw]
Subject: [PATCH 00/21] staging:rtl8192u: Refactor ht_capability_ele - Style

This series of patchs is a coding style clean up of the structure
ht_capability_ele. The changes are all simply changes of the member
names, to remove the CamelCase naming.

A number of the member have been renamed with the prefix 'not_used...'
to emphasise the fact that member is not used in code. At a future
time the structure might be stripped of these member variables, but
for the moment they have been left, as I'm not sure that the size
of the structure is not significant, and possibly mapped to Hardware.

John Whitmore (21):
staging:rtl8192u: Rename AdvCoding - Style
staging:rtl8192u: Rename ChlWidth - Style
staging:rtl8192u: Rename MimoPwrSave - Style
staging:rtl8192u: Rename GreenField - Style
staging:rtl8192u: Rename ShortGI20Mhz - Style
staging:rtl8192u: Rename ShortGI40Mhz - Style
staging:rtl8192u: Rename TxSTBC - Style
staging:rtl8192u: Rename RxSTBC - Style
staging:rtl8192u: Rename DelayBA - Style
staging:rtl8192u: Rename MaxAMSDUSize - Style
staging:rtl8192u: Rename DssCCk - Style
staging:rtl8192u: Rename PSMP - Style
staging:rtl8192u: Rename Rsvd1 - Style
staging:rtl8192u: Rename LSigTxopProtect - Style
staging:rtl8192u: Rename MaxRxAMPDUFactor - Style
staging:rtl8192u: Rename MPDUDensity - Style
staging:rtl8192u: Rename Rsvd2 - Style
staging:rtl8192u: Rename MCS - Style
staging:rtl8192u: Rename ExtHTCapInfo - Style
staging:rtl8192u: Rename TxBFCap - Style
staging:rtl8192u: Rename ASCap - Style

.../staging/rtl8192u/ieee80211/ieee80211_wx.c | 10 +-
.../staging/rtl8192u/ieee80211/rtl819x_HT.h | 42 +++----
.../rtl8192u/ieee80211/rtl819x_HTProc.c | 115 ++++++++----------
3 files changed, 75 insertions(+), 92 deletions(-)

--
2.18.0



2018-08-29 20:37:35

by John Whitmore

[permalink] [raw]
Subject: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

Rename the bit field element AdvCoding, as it causes a checkpatch issue
with CamelCase naming. As the element is not actually used in code it
has been renamed to 'not_used_adv_coding'.

The single line of code which initialises the bit has been removed,
as the field is unused.

This is a purely coding style change which should have no impact
on runtime code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 64d5359cf7e2..66a0274077d3 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -39,7 +39,7 @@ enum ht_extension_chan_offset {

struct ht_capability_ele {
//HT capability info
- u8 AdvCoding:1;
+ u8 not_used_adv_coding:1;
u8 ChlWidth:1;
u8 MimoPwrSave:2;
u8 GreenField:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 9bf52cebe4cd..d7f73a5831da 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -550,7 +550,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
}

//HT capability info
- pCapELE->AdvCoding = 0; // This feature is not supported now!!
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
pCapELE->ChlWidth = 0;
else
--
2.18.0


2018-08-29 20:37:40

by John Whitmore

[permalink] [raw]
Subject: [PATCH 03/21] staging:rtl8192u: Rename MimoPwrSave - Style

Rename the bitfield name MimoPwrSave, to clear the checkpatch issue
with CamelCase naming, to 'mimo_power_save'.

This is a coding style change which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index d79126853cd3..069f93e77c46 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -41,7 +41,7 @@ struct ht_capability_ele {
//HT capability info
u8 not_used_adv_coding:1;
u8 chl_width:1;
- u8 MimoPwrSave:2;
+ u8 mimo_power_save:2;
u8 GreenField:1;
u8 ShortGI20Mhz:1;
u8 ShortGI40Mhz:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index d9c2a2df8d0e..7cb18c2f6d93 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -556,7 +556,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->chl_width = (pHT->bRegBW40MHz ? 1 : 0);

// pCapELE->chl_width = (pHT->bRegBW40MHz?1:0);
- pCapELE->MimoPwrSave = pHT->SelfMimoPs;
+ pCapELE->mimo_power_save = pHT->SelfMimoPs;
pCapELE->GreenField = 0; // This feature is not supported now!!
pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!!
pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!!
@@ -1052,7 +1052,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
/*
* Config MIMO Power Save setting
*/
- pHTInfo->PeerMimoPs = pPeerHTCap->MimoPwrSave;
+ pHTInfo->PeerMimoPs = pPeerHTCap->mimo_power_save;
if (pHTInfo->PeerMimoPs == MIMO_PS_STATIC)
pMcsFilter = MCS_FILTER_1SS;
else
--
2.18.0


2018-08-29 20:37:48

by John Whitmore

[permalink] [raw]
Subject: [PATCH 08/21] staging:rtl8192u: Rename RxSTBC - Style

Rename the bitfield member RxSTBC, since its use of CamelCase naming
causes a checkpatch issue. Because the member is not actually used
in code the variable has been renamed to 'not_used_rx_stbc'. The
single line of code which initialised the member has been removed.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index ab61c9e81c2c..994ff0f30a07 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -46,7 +46,7 @@ struct ht_capability_ele {
u8 short_gi20_mhz:1;
u8 short_gi40_mhz:1;
u8 not_used_tx_stbc:1;
- u8 RxSTBC:2;
+ u8 not_used_rx_stbc:2;
u8 DelayBA:1;
u8 MaxAMSDUSize:1;
u8 DssCCk:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 65c377094278..c0789ddfd024 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -560,7 +560,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->short_gi40_mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
- pCapELE->RxSTBC = 0;
pCapELE->DelayBA = 0; // Do not support now!!
pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
--
2.18.0


2018-08-29 20:37:49

by John Whitmore

[permalink] [raw]
Subject: [PATCH 12/21] staging:rtl8192u: Rename PSMP - Style

Rename the bitfield member variable 'PSMP', since its uppercase name
conflicts the coding standard on naming. Because the variable is not
actually used in code it has been renamed to 'not_used_psmp'. The one
line of initialisation code has been removed.

This is a coding style change which should not impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index fd04461bcaf8..7f11257e2675 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -50,7 +50,7 @@ struct ht_capability_ele {
u8 not_used_delay_ba:1;
u8 max_amsdu_size:1;
u8 dss_cck:1;
- u8 PSMP:1;
+ u8 not_used_psmp:1;
u8 Rsvd1:1;
u8 LSigTxopProtect:1;

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 299d486fad0d..2ea9fa3b6e0a 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -562,7 +562,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
pCapELE->max_amsdu_size = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
pCapELE->dss_cck = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
- pCapELE->PSMP = 0; // Do not support now!!
pCapELE->LSigTxopProtect = 0; // Do not support now!!

/*
--
2.18.0


2018-08-29 20:37:53

by John Whitmore

[permalink] [raw]
Subject: [PATCH 14/21] staging:rtl8192u: Rename LSigTxopProtect - Style

Rename the bitfield member 'LSigTxopProtect', since it currently
causes a checkpatch issue due to its use of CamelCase naming.
Since the member is not actually used in code it has been renamed
to 'not_used_l_sig_txop_protect', and the singe initialisation line
of code has been removed.

This is purely a coding style change which should have no impact
on runtime code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 132a6da3bf51..040660a46bca 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -52,7 +52,7 @@ struct ht_capability_ele {
u8 dss_cck:1;
u8 not_used_psmp:1;
u8 not_used_rsvd1:1;
- u8 LSigTxopProtect:1;
+ u8 not_used_l_sig_txop_protect:1;

//MAC HT parameters info
u8 MaxRxAMPDUFactor:2;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 2ea9fa3b6e0a..ec96e14a2bed 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -562,7 +562,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
pCapELE->max_amsdu_size = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
pCapELE->dss_cck = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
- pCapELE->LSigTxopProtect = 0; // Do not support now!!

/*
* MAC HT parameters info
--
2.18.0


2018-08-29 20:37:55

by John Whitmore

[permalink] [raw]
Subject: [PATCH 15/21] staging:rtl8192u: Rename MaxRxAMPDUFactor - Style

Rename the bitfield member 'MaxRxAMPDUFactor' to
'max_rx_ampdu_factor', this clears the checkpatch issue with CamelCase
naming.

The change is a coding style change which should not impact runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
.../staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 040660a46bca..12db4ac9703b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -55,7 +55,7 @@ struct ht_capability_ele {
u8 not_used_l_sig_txop_protect:1;

//MAC HT parameters info
- u8 MaxRxAMPDUFactor:2;
+ u8 max_rx_ampdu_factor:2;
u8 MPDUDensity:3;
u8 Rsvd2:3;

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index ec96e14a2bed..4fc919ebd10b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -147,7 +147,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->short_gi40_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->max_amsdu_size) ? "3839" : "7935");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->dss_cck) ? "YES" : "NO");
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor);
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->max_rx_ampdu_factor);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->MPDUDensity);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
pCapELE->MCS[1], pCapELE->MCS[2], pCapELE->MCS[3], pCapELE->MCS[4]);
@@ -571,9 +571,9 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u

if (IsEncrypt) {
pCapELE->MPDUDensity = 7; // 8us
- pCapELE->MaxRxAMPDUFactor = 2; // 2 is for 32 K and 3 is 64K
+ pCapELE->max_rx_ampdu_factor = 2; // 2 is for 32 K and 3 is 64K
} else {
- pCapELE->MaxRxAMPDUFactor = 3; // 2 is for 32 K and 3 is 64K
+ pCapELE->max_rx_ampdu_factor = 3; // 2 is for 32 K and 3 is 64K
pCapELE->MPDUDensity = 0; // no density
}

@@ -978,8 +978,8 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
*/
if (!pHTInfo->bRegRT2RTAggregation) {
// Decide AMPDU Factor according to protocol handshake
- if (pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor)
- pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor;
+ if (pHTInfo->AMPDU_Factor > pPeerHTCap->max_rx_ampdu_factor)
+ pHTInfo->CurrentAMPDUFactor = pPeerHTCap->max_rx_ampdu_factor;
else
pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
} else {
@@ -990,12 +990,12 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
if (ieee->current_network.bssht.bdRT2RTAggregation) {
if (ieee->pairwise_key_type != KEY_TYPE_NA)
// Realtek may set 32k in security mode and 64k for others
- pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor;
+ pHTInfo->CurrentAMPDUFactor = pPeerHTCap->max_rx_ampdu_factor;
else
pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_64K;
} else {
- if (pPeerHTCap->MaxRxAMPDUFactor < HT_AGG_SIZE_32K)
- pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor;
+ if (pPeerHTCap->max_rx_ampdu_factor < HT_AGG_SIZE_32K)
+ pHTInfo->CurrentAMPDUFactor = pPeerHTCap->max_rx_ampdu_factor;
else
pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_32K;
}
--
2.18.0


2018-08-29 20:38:02

by John Whitmore

[permalink] [raw]
Subject: [PATCH 17/21] staging:rtl8192u: Rename Rsvd2 - Style

Rename the bitfield member 'Rsvd2', since it causes a checkpatch
issue due to it's use of CamelCase naming. The member has been
renamed to 'not_used_rsvd2', since it is not actually used in the
code.

This is a coding style change which should not impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 9066f309bac9..2b73279b45d8 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -57,7 +57,7 @@ struct ht_capability_ele {
//MAC HT parameters info
u8 max_rx_ampdu_factor:2;
u8 mpdu_density:3;
- u8 Rsvd2:3;
+ u8 not_used_rsvd2:3;

//Supported MCS set
u8 MCS[16];
--
2.18.0


2018-08-29 20:38:06

by John Whitmore

[permalink] [raw]
Subject: [PATCH 19/21] staging:rtl8192u: Rename ExtHTCapInfo - Style

Rename the member variable 'ExtHTCapInfo', since it causes a
checkpatch issue, due to its use of CamelCase naming. The name has
been changed to 'not_used_ext_ht_cap_info' since the member
variable is not actually used, apart from an initialisation which
has been removed.

This is a coding style change which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index edd0c00307bf..b4a412d8f61c 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -63,7 +63,7 @@ struct ht_capability_ele {
u8 cap_mcs[16];

//Extended HT Capability Info
- u16 ExtHTCapInfo;
+ u16 not_used_ext_ht_cap_info;

//TXBF Capabilities
u8 TxBFCap[4];
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 625d117e5a8f..fe7682d8e258 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -599,9 +599,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->cap_mcs[i] = 0;
}

- //Extended HT Capability Info
- memset(&pCapELE->ExtHTCapInfo, 0, 2);
-
//TXBF Capabilities
memset(pCapELE->TxBFCap, 0, 4);

--
2.18.0


2018-08-29 20:38:06

by John Whitmore

[permalink] [raw]
Subject: [PATCH 21/21] staging:rtl8192u: Rename ASCap - Style

Rename the member variable ASCap, as it causes a checkpatch issue
with CamelCase naming. The member has been renamed to
'not_used_as_cap', since it is not actually used in code, apart from
initialisation, which has been removed.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index fa4c0ab43703..f46d7f3ed7e4 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -69,7 +69,7 @@ struct ht_capability_ele {
u8 not_used_tx_bf_cap[4];

//Antenna Selection Capabilities
- u8 ASCap;
+ u8 not_used_as_cap;

} __packed;

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 3e2172b6008b..a1fb971f737c 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -599,8 +599,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->cap_mcs[i] = 0;
}

- //Antenna Selection Capabilities
- pCapELE->ASCap = 0;
//add 2 to give space for element ID and len when construct frames
if (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)
*len = 30 + 2;
--
2.18.0


2018-08-29 20:38:09

by John Whitmore

[permalink] [raw]
Subject: [PATCH 20/21] staging:rtl8192u: Rename TxBFCap - Style

Rename the member variable 'TxBFCap', since it causes a checkpatch
issue with CamelCase naming. The variable has been renamed to
'not_used_tx_bf_cap', since the member is not actually used, apart
from initialisation, which has been removed.

This is a coding style change which should not have an impact on
runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index b4a412d8f61c..fa4c0ab43703 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -66,7 +66,7 @@ struct ht_capability_ele {
u16 not_used_ext_ht_cap_info;

//TXBF Capabilities
- u8 TxBFCap[4];
+ u8 not_used_tx_bf_cap[4];

//Antenna Selection Capabilities
u8 ASCap;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index fe7682d8e258..3e2172b6008b 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -599,9 +599,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->cap_mcs[i] = 0;
}

- //TXBF Capabilities
- memset(pCapELE->TxBFCap, 0, 4);
-
//Antenna Selection Capabilities
pCapELE->ASCap = 0;
//add 2 to give space for element ID and len when construct frames
--
2.18.0


2018-08-29 20:38:19

by John Whitmore

[permalink] [raw]
Subject: [PATCH 18/21] staging:rtl8192u: Rename MCS - Style

Rename the member 'MCS' to 'cap_mcs', since the uppercase name
conflicts with the coding standard. The 'cap' has been prepended
to make the variable easier to find in the code.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
.../staging/rtl8192u/ieee80211/ieee80211_wx.c | 2 +-
.../staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
.../rtl8192u/ieee80211/rtl819x_HTProc.c | 20 +++++++++----------
3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index a6fe975902bb..a96cc5c01b10 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -159,7 +159,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
((ht_cap->short_gi40_mhz)?1:0):
((ht_cap->short_gi20_mhz)?1:0);

- max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL);
+ max_mcs = HTGetHighestMCSRate(ieee, ht_cap->cap_mcs, MCS_FILTER_ALL);
rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs&0x7f];
if (rate > max_rate)
max_rate = rate;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 2b73279b45d8..edd0c00307bf 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -60,7 +60,7 @@ struct ht_capability_ele {
u8 not_used_rsvd2:3;

//Supported MCS set
- u8 MCS[16];
+ u8 cap_mcs[16];

//Extended HT Capability Info
u16 ExtHTCapInfo;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 19c4903b572f..625d117e5a8f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -149,8 +149,8 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->dss_cck) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->max_rx_ampdu_factor);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->mpdu_density);
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
- pCapELE->MCS[1], pCapELE->MCS[2], pCapELE->MCS[3], pCapELE->MCS[4]);
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->cap_mcs[0],\
+ pCapELE->cap_mcs[1], pCapELE->cap_mcs[2], pCapELE->cap_mcs[3], pCapELE->cap_mcs[4]);
}

/*
@@ -578,15 +578,15 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
}

//Supported MCS set
- memcpy(pCapELE->MCS, ieee->Regdot11HTOperationalRateSet, 16);
+ memcpy(pCapELE->cap_mcs, ieee->Regdot11HTOperationalRateSet, 16);
if (pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS15)
- pCapELE->MCS[1] &= 0x7f;
+ pCapELE->cap_mcs[1] &= 0x7f;

if (pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS14)
- pCapELE->MCS[1] &= 0xbf;
+ pCapELE->cap_mcs[1] &= 0xbf;

if (pHT->IOTAction & HT_IOT_ACT_DISABLE_ALL_2SS)
- pCapELE->MCS[1] &= 0x00;
+ pCapELE->cap_mcs[1] &= 0x00;

/*
* 2008.06.12
@@ -596,7 +596,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
int i;

for (i = 1; i < 16; i++)
- pCapELE->MCS[i] = 0;
+ pCapELE->cap_mcs[i] = 0;
}

//Extended HT Capability Info
@@ -1037,10 +1037,10 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
* Handle Ralink AP bad MCS rate set condition. Joseph.
* This fix the bug of Ralink AP. This may be removed in the future.
*/
- if (pPeerHTCap->MCS[0] == 0)
- pPeerHTCap->MCS[0] = 0xff;
+ if (pPeerHTCap->cap_mcs[0] == 0)
+ pPeerHTCap->cap_mcs[0] = 0xff;

- HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet);
+ HTFilterMCSRate(ieee, pPeerHTCap->cap_mcs, ieee->dot11HTOperationalRateSet);

/*
* Config MIMO Power Save setting
--
2.18.0


2018-08-29 20:38:49

by John Whitmore

[permalink] [raw]
Subject: [PATCH 13/21] staging:rtl8192u: Rename Rsvd1 - Style

Rename the bitfield member 'Rsvd1', since its name causes a checkpatch
issue due to the use of CamelCase naming. The name has been changed
to 'not_used_rsvd1' since the variable is not actually used in code.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 7f11257e2675..132a6da3bf51 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -51,7 +51,7 @@ struct ht_capability_ele {
u8 max_amsdu_size:1;
u8 dss_cck:1;
u8 not_used_psmp:1;
- u8 Rsvd1:1;
+ u8 not_used_rsvd1:1;
u8 LSigTxopProtect:1;

//MAC HT parameters info
--
2.18.0


2018-08-29 20:39:04

by John Whitmore

[permalink] [raw]
Subject: [PATCH 11/21] staging:rtl8192u: Rename DssCCk - Style

Rename the bitfield member 'DssCCk' to 'dss_cck', this clears the
checkpatch issue with CamelCase naming.

This is a coding style change which should not impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index e4693832e1d6..fd04461bcaf8 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -49,7 +49,7 @@ struct ht_capability_ele {
u8 not_used_rx_stbc:2;
u8 not_used_delay_ba:1;
u8 max_amsdu_size:1;
- u8 DssCCk:1;
+ u8 dss_cck:1;
u8 PSMP:1;
u8 Rsvd1:1;
u8 LSigTxopProtect:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 7fb31638f60d..299d486fad0d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -146,7 +146,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->short_gi20_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->short_gi40_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->max_amsdu_size) ? "3839" : "7935");
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO");
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->dss_cck) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->MPDUDensity);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
@@ -561,7 +561,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
pCapELE->max_amsdu_size = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
- pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
+ pCapELE->dss_cck = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
pCapELE->PSMP = 0; // Do not support now!!
pCapELE->LSigTxopProtect = 0; // Do not support now!!

@@ -569,7 +569,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
* MAC HT parameters info
* TODO: Nedd to take care of this part
*/
- IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d max_amsdu_size:%d DssCCk:%d\n", pCapELE->chl_width, pCapELE->max_amsdu_size, pCapELE->DssCCk);
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d max_amsdu_size:%d dss_cck:%d\n", pCapELE->chl_width, pCapELE->max_amsdu_size, pCapELE->dss_cck);

if (IsEncrypt) {
pCapELE->MPDUDensity = 7; // 8us
@@ -956,7 +956,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
* TODO:
*/
pHTInfo->bCurSuppCCK = pHTInfo->bRegSuppCCK &&
- (pPeerHTCap->DssCCk == 1);
+ (pPeerHTCap->dss_cck == 1);

/*
* Config and configure A-MSDU setting
--
2.18.0


2018-08-29 20:39:05

by John Whitmore

[permalink] [raw]
Subject: [PATCH 10/21] staging:rtl8192u: Rename MaxAMSDUSize - Style

Rename the bitfield member variable 'MaxAMSDUSize' to
'max_amsdu_size', this clears the checkpatch issue with CamelCase
naming.

This is a coding style change which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 864bb9db2433..e4693832e1d6 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -48,7 +48,7 @@ struct ht_capability_ele {
u8 not_used_tx_stbc:1;
u8 not_used_rx_stbc:2;
u8 not_used_delay_ba:1;
- u8 MaxAMSDUSize:1;
+ u8 max_amsdu_size:1;
u8 DssCCk:1;
u8 PSMP:1;
u8 Rsvd1:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index bc1d8e9221aa..7fb31638f60d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -145,7 +145,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->chl_width) ? "20MHz" : "20/40MHz");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->short_gi20_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->short_gi40_mhz) ? "YES" : "NO");
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize) ? "3839" : "7935");
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->max_amsdu_size) ? "3839" : "7935");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->MPDUDensity);
@@ -560,7 +560,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->short_gi40_mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
- pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
+ pCapELE->max_amsdu_size = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
pCapELE->PSMP = 0; // Do not support now!!
pCapELE->LSigTxopProtect = 0; // Do not support now!!
@@ -569,7 +569,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
* MAC HT parameters info
* TODO: Nedd to take care of this part
*/
- IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->chl_width, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d max_amsdu_size:%d DssCCk:%d\n", pCapELE->chl_width, pCapELE->max_amsdu_size, pCapELE->DssCCk);

if (IsEncrypt) {
pCapELE->MPDUDensity = 7; // 8us
@@ -963,7 +963,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
*/
pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support;

- nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935;
+ nMaxAMSDUSize = (pPeerHTCap->max_amsdu_size == 0) ? 3839 : 7935;

if (pHTInfo->nAMSDU_MaxSize > nMaxAMSDUSize)
pHTInfo->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize;
@@ -1169,7 +1169,6 @@ void HTInitializeBssDesc(PBSS_HT pBssHT)
void HTResetSelfAndSavePeerSetting(struct ieee80211_device *ieee, struct ieee80211_network *pNetwork)
{
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
-// u16 nMaxAMSDUSize;
// struct ht_capability_ele *pPeerHTCap = (struct ht_capability_ele *)pNetwork->bssht.bdHTCapBuf;
// PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFORMATION_ELE)pNetwork->bssht.bdHTInfoBuf;
// u8* pMcsFilter;
--
2.18.0


2018-08-29 20:39:06

by John Whitmore

[permalink] [raw]
Subject: [PATCH 09/21] staging:rtl8192u: Rename DelayBA - Style

Rename the bitfield member DelayBA, since its use of CamelCase naming
causes a checkpatch issue. Since the member is not actually used in
code the name has been changed to 'not_used_delay_ba'. The one line
of initialisation code has been removed.

This is a coding style change which should not impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 994ff0f30a07..864bb9db2433 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -47,7 +47,7 @@ struct ht_capability_ele {
u8 short_gi40_mhz:1;
u8 not_used_tx_stbc:1;
u8 not_used_rx_stbc:2;
- u8 DelayBA:1;
+ u8 not_used_delay_ba:1;
u8 MaxAMSDUSize:1;
u8 DssCCk:1;
u8 PSMP:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index c0789ddfd024..bc1d8e9221aa 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -560,7 +560,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->short_gi40_mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
- pCapELE->DelayBA = 0; // Do not support now!!
pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
pCapELE->DssCCk = ((pHT->bRegBW40MHz) ? (pHT->bRegSuppCCK ? 1 : 0) : 0);
pCapELE->PSMP = 0; // Do not support now!!
--
2.18.0


2018-08-29 20:39:19

by John Whitmore

[permalink] [raw]
Subject: [PATCH 07/21] staging:rtl8192u: Rename TxSTBC - Style

Rename the bitfield member TxSTBC. As it stands the name causes a
checkpatch issue due to its use of CamelCase naming style. Because
the member is not actually used in the code the name has been changed
to 'not_used_tx_stbc'. The two lines of code, one for initialisation
and one for debug logging have been removed.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 23f8ee39e32d..ab61c9e81c2c 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -45,7 +45,7 @@ struct ht_capability_ele {
u8 not_used_green_field:1;
u8 short_gi20_mhz:1;
u8 short_gi40_mhz:1;
- u8 TxSTBC:1;
+ u8 not_used_tx_stbc:1;
u8 RxSTBC:2;
u8 DelayBA:1;
u8 MaxAMSDUSize:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 54c56cec612f..65c377094278 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -145,7 +145,6 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->chl_width) ? "20MHz" : "20/40MHz");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->short_gi20_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->short_gi40_mhz) ? "YES" : "NO");
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize) ? "3839" : "7935");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor);
@@ -561,7 +560,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
pCapELE->short_gi40_mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
//pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
- pCapELE->TxSTBC = 1;
pCapELE->RxSTBC = 0;
pCapELE->DelayBA = 0; // Do not support now!!
pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE >= 7935) ? 1 : 0;
--
2.18.0


2018-08-29 20:39:26

by John Whitmore

[permalink] [raw]
Subject: [PATCH 04/21] staging:rtl8192u: Rename GreenField - Style

Rename the bit field member GreenField, this change clears the
checkpatch issue with CamelCase naming. As the member is no longer
used the name has been changed to 'not_used_green_field', and the
redundant line of initialisation code has been removed.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <[email protected]>
---
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 069f93e77c46..705d811cbe01 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -42,7 +42,7 @@ struct ht_capability_ele {
u8 not_used_adv_coding:1;
u8 chl_width:1;
u8 mimo_power_save:2;
- u8 GreenField:1;
+ u8 not_used_green_field:1;
u8 ShortGI20Mhz:1;
u8 ShortGI40Mhz:1;
u8 TxSTBC:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 7cb18c2f6d93..73745d8406aa 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -557,7 +557,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u

// pCapELE->chl_width = (pHT->bRegBW40MHz?1:0);
pCapELE->mimo_power_save = pHT->SelfMimoPs;
- pCapELE->GreenField = 0; // This feature is not supported now!!
pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!!
pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
--
2.18.0


2018-08-29 20:39:37

by John Whitmore

[permalink] [raw]
Subject: [PATCH 02/21] staging:rtl8192u: Rename ChlWidth - Style

Rename 'ChlWidth', member variable of the structure ht_capability_ele.
This change is to clear the checkpatch issue with CamelCase naming.
The bitfield's name has been changed to 'chl_width'.

This is a coding style change which should have no impact on runtime
code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index fa59c712c74b..514445dc542e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -154,8 +154,8 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[4];
else
ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0];
- is40M = (ht_cap->ChlWidth)?1:0;
- isShortGI = (ht_cap->ChlWidth)?
+ is40M = (ht_cap->chl_width)?1:0;
+ isShortGI = (ht_cap->chl_width)?
((ht_cap->ShortGI40Mhz)?1:0):
((ht_cap->ShortGI20Mhz)?1:0);

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 66a0274077d3..d79126853cd3 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -40,7 +40,7 @@ enum ht_extension_chan_offset {
struct ht_capability_ele {
//HT capability info
u8 not_used_adv_coding:1;
- u8 ChlWidth:1;
+ u8 chl_width:1;
u8 MimoPwrSave:2;
u8 GreenField:1;
u8 ShortGI20Mhz:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index d7f73a5831da..d9c2a2df8d0e 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -142,7 +142,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
}
IEEE80211_DEBUG(IEEE80211_DL_HT, "<Log HT Capability>. Called by %s\n", TitleString);

- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->ChlWidth) ? "20MHz" : "20/40MHz");
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->chl_width) ? "20MHz" : "20/40MHz");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->ShortGI20Mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC) ? "YES" : "NO");
@@ -230,7 +230,7 @@ static bool IsHTHalfNmode40Bandwidth(struct ieee80211_device *ieee)
retValue = false;
else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode
retValue = false;
- else if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw
+ else if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->chl_width) // ap support 40 bw
retValue = true;
else
retValue = false;
@@ -551,17 +551,17 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u

//HT capability info
if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
- pCapELE->ChlWidth = 0;
+ pCapELE->chl_width = 0;
else
- pCapELE->ChlWidth = (pHT->bRegBW40MHz ? 1 : 0);
+ pCapELE->chl_width = (pHT->bRegBW40MHz ? 1 : 0);

-// pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0);
+// pCapELE->chl_width = (pHT->bRegBW40MHz?1:0);
pCapELE->MimoPwrSave = pHT->SelfMimoPs;
pCapELE->GreenField = 0; // This feature is not supported now!!
pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!!
pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
- //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz);
+ //pCapELE->chl_width, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz);
pCapELE->TxSTBC = 1;
pCapELE->RxSTBC = 0;
pCapELE->DelayBA = 0; // Do not support now!!
@@ -574,7 +574,7 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
* MAC HT parameters info
* TODO: Nedd to take care of this part
*/
- IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->chl_width, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);

if (IsEncrypt) {
pCapELE->MPDUDensity = 7; // 8us
@@ -935,7 +935,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTInfo, sizeof(HT_INFORMATION_ELE));
// Config Supported Channel Width setting
//
- HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), (enum ht_extension_chan_offset)(pPeerHTInfo->ExtChlOffset));
+ HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->chl_width), (enum ht_extension_chan_offset)(pPeerHTInfo->ExtChlOffset));

pHTInfo->bCurTxBW40MHz = (pPeerHTInfo->RecommemdedTxWidth == 1);

--
2.18.0


2018-08-29 20:39:41

by John Whitmore

[permalink] [raw]
Subject: [PATCH 16/21] staging:rtl8192u: Rename MPDUDensity - Style

Rename the bitfield member 'MPDUDensity' to 'mpdu_density', this
clears the checkpatch issue with CamelCase naming.

This is a coding style change which should not have an impact on
runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 12db4ac9703b..9066f309bac9 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -56,7 +56,7 @@ struct ht_capability_ele {

//MAC HT parameters info
u8 max_rx_ampdu_factor:2;
- u8 MPDUDensity:3;
+ u8 mpdu_density:3;
u8 Rsvd2:3;

//Supported MCS set
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 4fc919ebd10b..19c4903b572f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -99,9 +99,9 @@ void HTUpdateDefaultSetting(struct ieee80211_device *ieee)
#endif
/*
* 8190 only, Realtek proprietary aggregation mode
- * Set MPDUDensity=2, 1: Set MPDUDensity=2(32k) for Realtek AP and set MPDUDensity=0(8k) for others
+ * Set mpdu_density=2, 1: Set mpdu_density=2(32k) for Realtek AP and set mpdu_density=0(8k) for others
*/
- pHTInfo->bRegRT2RTAggregation = 1;//0: Set MPDUDensity=2, 1: Set MPDUDensity=2(32k) for Realtek AP and set MPDUDensity=0(8k) for others
+ pHTInfo->bRegRT2RTAggregation = 1;//0: Set mpdu_density=2, 1: Set mpdu_density=2(32k) for Realtek AP and set mpdu_density=0(8k) for others

// For Rx Reorder Control
pHTInfo->bRegRxReorderEnable = 1;
@@ -148,7 +148,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->max_amsdu_size) ? "3839" : "7935");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->dss_cck) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->max_rx_ampdu_factor);
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->MPDUDensity);
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->mpdu_density);
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
pCapELE->MCS[1], pCapELE->MCS[2], pCapELE->MCS[3], pCapELE->MCS[4]);
}
@@ -570,11 +570,11 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d max_amsdu_size:%d dss_cck:%d\n", pCapELE->chl_width, pCapELE->max_amsdu_size, pCapELE->dss_cck);

if (IsEncrypt) {
- pCapELE->MPDUDensity = 7; // 8us
+ pCapELE->mpdu_density = 7; // 8us
pCapELE->max_rx_ampdu_factor = 2; // 2 is for 32 K and 3 is 64K
} else {
pCapELE->max_rx_ampdu_factor = 3; // 2 is for 32 K and 3 is 64K
- pCapELE->MPDUDensity = 0; // no density
+ pCapELE->mpdu_density = 0; // no density
}

//Supported MCS set
@@ -1005,10 +1005,10 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
* <2> Set AMPDU Minimum MPDU Start Spacing
* 802.11n 3.0 section 9.7d.3
*/
- if (pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
+ if (pHTInfo->MPDU_Density > pPeerHTCap->mpdu_density)
pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
else
- pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity;
+ pHTInfo->CurrentMPDUDensity = pPeerHTCap->mpdu_density;
if (ieee->pairwise_key_type != KEY_TYPE_NA)
pHTInfo->CurrentMPDUDensity = 7; // 8us
// Force TX AMSDU
--
2.18.0


2018-08-29 20:39:55

by John Whitmore

[permalink] [raw]
Subject: [PATCH 06/21] staging:rtl8192u: Rename ShortGI40Mhz - Style

Rename the bitfield member 'ShortGI40Mhz' to 'short_gi40_mhz', this
clears the checkpatch issue with CamelCase naming.

This change is a simple coding style change, which should have no
impact on runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index a0e91763e7f3..a6fe975902bb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -156,7 +156,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0];
is40M = (ht_cap->chl_width)?1:0;
isShortGI = (ht_cap->chl_width)?
- ((ht_cap->ShortGI40Mhz)?1:0):
+ ((ht_cap->short_gi40_mhz)?1:0):
((ht_cap->short_gi20_mhz)?1:0);

max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL);
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 64fd6a4f3bcd..23f8ee39e32d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -44,7 +44,7 @@ struct ht_capability_ele {
u8 mimo_power_save:2;
u8 not_used_green_field:1;
u8 short_gi20_mhz:1;
- u8 ShortGI40Mhz:1;
+ u8 short_gi40_mhz:1;
u8 TxSTBC:1;
u8 RxSTBC:2;
u8 DelayBA:1;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index fe8d75d8bd96..54c56cec612f 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -144,7 +144,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)

IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->chl_width) ? "20MHz" : "20/40MHz");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->short_gi20_mhz) ? "YES" : "NO");
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz) ? "YES" : "NO");
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->short_gi40_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize) ? "3839" : "7935");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO");
@@ -248,7 +248,7 @@ static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, bool is40MHz)
else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode
retValue = false;
else if (is40MHz) { // ap support 40 bw
- if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI
+ if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->short_gi40_mhz) // ap support 40 bw short GI
retValue = true;
else
retValue = false;
@@ -558,9 +558,9 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
// pCapELE->chl_width = (pHT->bRegBW40MHz?1:0);
pCapELE->mimo_power_save = pHT->SelfMimoPs;
pCapELE->short_gi20_mhz = 1; // We can receive Short GI!!
- pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!!
+ pCapELE->short_gi40_mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
- //pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->ShortGI40Mhz);
+ //pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->short_gi40_mhz);
pCapELE->TxSTBC = 1;
pCapELE->RxSTBC = 0;
pCapELE->DelayBA = 0; // Do not support now!!
@@ -946,7 +946,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
pHTInfo->bCurShortGI20MHz = pHTInfo->bRegShortGI20MHz &&
(pPeerHTCap->short_gi20_mhz == 1);
pHTInfo->bCurShortGI40MHz = pHTInfo->bRegShortGI40MHz &&
- (pPeerHTCap->ShortGI40Mhz == 1);
+ (pPeerHTCap->short_gi40_mhz == 1);

/*
* Config TX STBC setting
--
2.18.0


2018-08-29 20:40:36

by John Whitmore

[permalink] [raw]
Subject: [PATCH 05/21] staging:rtl8192u: Rename ShortGI20Mhz - Style

Rename the bitfield member 'ShortGI20Mhz' to 'short_gi20_mhz'. This
change clears the checkpatch issue with CamelCase naming of variables.

The change if purely a coding style change which should have no impact
on runtime code execution.

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

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 514445dc542e..a0e91763e7f3 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -157,7 +157,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
is40M = (ht_cap->chl_width)?1:0;
isShortGI = (ht_cap->chl_width)?
((ht_cap->ShortGI40Mhz)?1:0):
- ((ht_cap->ShortGI20Mhz)?1:0);
+ ((ht_cap->short_gi20_mhz)?1:0);

max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL);
rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs&0x7f];
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 705d811cbe01..64fd6a4f3bcd 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -43,7 +43,7 @@ struct ht_capability_ele {
u8 chl_width:1;
u8 mimo_power_save:2;
u8 not_used_green_field:1;
- u8 ShortGI20Mhz:1;
+ u8 short_gi20_mhz:1;
u8 ShortGI40Mhz:1;
u8 TxSTBC:1;
u8 RxSTBC:2;
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 73745d8406aa..fe8d75d8bd96 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -143,7 +143,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
IEEE80211_DEBUG(IEEE80211_DL_HT, "<Log HT Capability>. Called by %s\n", TitleString);

IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->chl_width) ? "20MHz" : "20/40MHz");
- IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->ShortGI20Mhz) ? "YES" : "NO");
+ IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->short_gi20_mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC) ? "YES" : "NO");
IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize) ? "3839" : "7935");
@@ -253,7 +253,7 @@ static bool IsHTHalfNmodeSGI(struct ieee80211_device *ieee, bool is40MHz)
else
retValue = false;
} else {
- if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI
+ if (((struct ht_capability_ele *)(pHTInfo->PeerHTCapBuf))->short_gi20_mhz) // ap support 40 bw short GI
retValue = true;
else
retValue = false;
@@ -557,10 +557,10 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u

// pCapELE->chl_width = (pHT->bRegBW40MHz?1:0);
pCapELE->mimo_power_save = pHT->SelfMimoPs;
- pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!!
+ pCapELE->short_gi20_mhz = 1; // We can receive Short GI!!
pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!!
//DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
- //pCapELE->chl_width, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz);
+ //pCapELE->chl_width, pCapELE->short_gi20_mhz, pCapELE->ShortGI40Mhz);
pCapELE->TxSTBC = 1;
pCapELE->RxSTBC = 0;
pCapELE->DelayBA = 0; // Do not support now!!
@@ -944,7 +944,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
* TODO:
*/
pHTInfo->bCurShortGI20MHz = pHTInfo->bRegShortGI20MHz &&
- (pPeerHTCap->ShortGI20Mhz == 1);
+ (pPeerHTCap->short_gi20_mhz == 1);
pHTInfo->bCurShortGI40MHz = pHTInfo->bRegShortGI40MHz &&
(pPeerHTCap->ShortGI40Mhz == 1);

--
2.18.0


2018-08-29 21:15:31

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Wed, 2018-08-29 at 21:35 +0100, John Whitmore wrote:
> Rename the bit field element AdvCoding, as it causes a checkpatch issue
> with CamelCase naming. As the element is not actually used in code it
> has been renamed to 'not_used_adv_coding'.
>
> The single line of code which initialises the bit has been removed,
> as the field is unused.
>
> This is a purely coding style change which should have no impact
> on runtime code execution.

Hi John.

Other than the somewhat useful code style cleanups, is there
a point at which you will feel comfortable doing actual code
changes to this driver?

Perhaps support for the chipset could be converted to use
mac80211 and moved into the directory with the other realtek
drivers in drivers/net/wireless/realtek/rtl8xxxu/...

Larry? What do you think?

2018-08-29 21:24:41

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On 08/29/2018 04:14 PM, Joe Perches wrote:
> On Wed, 2018-08-29 at 21:35 +0100, John Whitmore wrote:
>> Rename the bit field element AdvCoding, as it causes a checkpatch issue
>> with CamelCase naming. As the element is not actually used in code it
>> has been renamed to 'not_used_adv_coding'.
>>
>> The single line of code which initialises the bit has been removed,
>> as the field is unused.
>>
>> This is a purely coding style change which should have no impact
>> on runtime code execution.
>
> Hi John.
>
> Other than the somewhat useful code style cleanups, is there
> a point at which you will feel comfortable doing actual code
> changes to this driver?
>
> Perhaps support for the chipset could be converted to use
> mac80211 and moved into the directory with the other realtek
> drivers in drivers/net/wireless/realtek/rtl8xxxu/...
>
> Larry? What do you think?

First of all, if a variable is not used, then it should be removed, not merely
renamed to satisfy checkpatch.

All the Realtek USB devices should be added to rtl8xxxu, not merely moved into
that directory. Jes Sorensen created a well-designed driver the is structured to
permit addition of different initialization routines, etc. That said, the
conversion will not be easy. In addition, it will require having your hands on a
real device - a requirement that I cannot meet for the RTL8192U.

Larry


2018-08-29 21:56:30

by John Whitmore

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Wed, Aug 29, 2018 at 04:21:54PM -0500, Larry Finger wrote:
> On 08/29/2018 04:14 PM, Joe Perches wrote:
> > On Wed, 2018-08-29 at 21:35 +0100, John Whitmore wrote:
> > > Rename the bit field element AdvCoding, as it causes a checkpatch issue
> > > with CamelCase naming. As the element is not actually used in code it
> > > has been renamed to 'not_used_adv_coding'.
> > >
> > > The single line of code which initialises the bit has been removed,
> > > as the field is unused.
> > >
> > > This is a purely coding style change which should have no impact
> > > on runtime code execution.
> >
> > Hi John.
> >
> > Other than the somewhat useful code style cleanups, is there
> > a point at which you will feel comfortable doing actual code
> > changes to this driver?
> >
> > Perhaps support for the chipset could be converted to use
> > mac80211 and moved into the directory with the other realtek
> > drivers in drivers/net/wireless/realtek/rtl8xxxu/...
> >
> > Larry? What do you think?
>
> First of all, if a variable is not used, then it should be removed, not
> merely renamed to satisfy checkpatch.
>
> All the Realtek USB devices should be added to rtl8xxxu, not merely moved
> into that directory. Jes Sorensen created a well-designed driver the is
> structured to permit addition of different initialization routines, etc.
> That said, the conversion will not be easy. In addition, it will require
> having your hands on a real device - a requirement that I cannot meet for
> the RTL8192U.
>
> Larry
>

Oops... it probably doesn't look like it, at the moment, but 'actual code
changes to this driver' was where I'm hoping to get to. There's a lot of
stuff in the header files, including member variables, which are not used
in the code. I was hoping to strip these out incrementally to minimise
the amount of source code that has to be understood. I'm not familiar
with the overall network, or 80211, subsystem architecture, but it's hard
to see why this driver has it's own private ieee80211.h file.

I totally agree that the unused variables should be removed, and they
will be, if we can accept that they are in fact unused && size doesn't
matter. The structure in question 'struct ht_capability_ele' is used
in, what I consider to be, a strange way in the file ieee80211_wx.c.

struct ht_capability_ele *ht_cap = NULL;
...
ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[4];
...
ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0];

I have been trying to find a datasheet for this device but to date me
query strings haven't given me much joy. I must try and get my hands on the
device in question.

Thank ye for your comments, and sorry for the "somewhat useful" changes
to date, but doing these changes is letting me get the hang of this code,
which I refuse to comment on because there are probably guidelines on using
naughty language on here. ;) When I see lines like these two:

ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[4];
...
ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0];

I think that size might very well matter for the moment. The BSS_HT
structure is farther down the header file so when I clean up that struct
things might be clearer. I can only hope.

jwhitmore

2018-08-30 08:25:04

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Wed, Aug 29, 2018 at 09:35:27PM +0100, John Whitmore wrote:
> Rename the bit field element AdvCoding, as it causes a checkpatch issue
> with CamelCase naming. As the element is not actually used in code it
> has been renamed to 'not_used_adv_coding'.
>
> The single line of code which initialises the bit has been removed,
> as the field is unused.
>
> This is a purely coding style change which should have no impact
> on runtime code execution.
>
> Signed-off-by: John Whitmore <[email protected]>
> ---
> drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
> drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> index 64d5359cf7e2..66a0274077d3 100644
> --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> @@ -39,7 +39,7 @@ enum ht_extension_chan_offset {
>
> struct ht_capability_ele {
> //HT capability info
> - u8 AdvCoding:1;
> + u8 not_used_adv_coding:1;

I can't review any more of this patchset when this is the first line...

:(

regards,
dan carpenter


2018-08-30 08:28:15

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Thu, Aug 30, 2018 at 11:23:05AM +0300, Dan Carpenter wrote:
> On Wed, Aug 29, 2018 at 09:35:27PM +0100, John Whitmore wrote:
> > Rename the bit field element AdvCoding, as it causes a checkpatch issue
> > with CamelCase naming. As the element is not actually used in code it
> > has been renamed to 'not_used_adv_coding'.
> >
> > The single line of code which initialises the bit has been removed,
> > as the field is unused.
> >
> > This is a purely coding style change which should have no impact
> > on runtime code execution.
> >
> > Signed-off-by: John Whitmore <[email protected]>
> > ---
> > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
> > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
> > 2 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > index 64d5359cf7e2..66a0274077d3 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > @@ -39,7 +39,7 @@ enum ht_extension_chan_offset {
> >
> > struct ht_capability_ele {
> > //HT capability info
> > - u8 AdvCoding:1;
> > + u8 not_used_adv_coding:1;
>
> I can't review any more of this patchset when this is the first line...
>

That email wasn't very clear. If you think some of your patches are
going to be more controversial than others, put them at the very end so
we can at least apply part of the patchset.

regards,
dan carpenter


2018-08-30 21:37:15

by John Whitmore

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Thu, Aug 30, 2018 at 11:26:28AM +0300, Dan Carpenter wrote:
> On Thu, Aug 30, 2018 at 11:23:05AM +0300, Dan Carpenter wrote:
> > On Wed, Aug 29, 2018 at 09:35:27PM +0100, John Whitmore wrote:
> > > Rename the bit field element AdvCoding, as it causes a checkpatch issue
> > > with CamelCase naming. As the element is not actually used in code it
> > > has been renamed to 'not_used_adv_coding'.
> > >
> > > The single line of code which initialises the bit has been removed,
> > > as the field is unused.
> > >
> > > This is a purely coding style change which should have no impact
> > > on runtime code execution.
> > >
> > > Signed-off-by: John Whitmore <[email protected]>
> > > ---
> > > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
> > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
> > > 2 files changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > > index 64d5359cf7e2..66a0274077d3 100644
> > > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > > @@ -39,7 +39,7 @@ enum ht_extension_chan_offset {
> > >
> > > struct ht_capability_ele {
> > > //HT capability info
> > > - u8 AdvCoding:1;
> > > + u8 not_used_adv_coding:1;
> >
> > I can't review any more of this patchset when this is the first line...
> >
>
> That email wasn't very clear. If you think some of your patches are
> going to be more controversial than others, put them at the very end so
> we can at least apply part of the patchset.
>
> regards,
> dan carpenter
>

Thanks for the clarification, I needed it ;)

I'm not sure I consider any of the patches in the series as being
controversial. They are all just simple name changes of member
variables. As a number of the variables are not used in code the names
have been changed to reflect that fact. If I'd renamed them and left out
the 'not_used_' prefix would the changes not be controversial? I
don't think the fact that the members are unused is a biggy.

What might appear to be controversial is that I didn't simply remove
the members. I haven't done that because I'm not yet satisfied that
the structure's size is insignificant. As soon as I am happy that the
size of the structure is not important, to runtime code execution,
there'll be a patch which removes a number of 'not_used_...' members
from a structure.

Alternatively if the size if important there might be a patch which
renames a number of unused bitfield members to reserved_1, reserved_2,
reserved_3....

Perhaps I should have held off this patch set until I had satisfied
myself that the size either, does or does not, matter and combine all
changes into one series of patches. On the other hand I've added an
extra step which can be reviewed and clearly see the incremental
changes. I'm happy enough for the whole patch set to be rejected
for the moment, but I'd be even happier if on review somebody pointed
out that a member which I have decided is unused in the code is
actually used and a patch gets rejected on those grounds. If
everybody accepts this series, that asserts that members are unused,
the next step is easy either way.

jwhitmore


2018-08-30 22:36:08

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Wed, 2018-08-29 at 22:55 +0100, John Whitmore wrote:
> On Wed, Aug 29, 2018 at 04:21:54PM -0500, Larry Finger wrote:
> > On 08/29/2018 04:14 PM, Joe Perches wrote:
[]
> > > Perhaps support for the chipset could be converted to use
> > > mac80211 and moved into the directory with the other realtek
> > > drivers in drivers/net/wireless/realtek/rtl8xxxu/...
[]
> > All the Realtek USB devices should be added to rtl8xxxu, not merely moved
> > into that directory. Jes Sorensen created a well-designed driver the is
> > structured to permit addition of different initialization routines, etc.
> > That said, the conversion will not be easy. In addition, it will require
> > having your hands on a real device - a requirement that I cannot meet for
> > the RTL8192U.
[]
> > Oops... it probably doesn't look like it, at the moment, but 'actual code
> changes to this driver' was where I'm hoping to get to. There's a lot of
> stuff in the header files, including member variables, which are not used
> in the code. I was hoping to strip these out incrementally to minimise
> the amount of source code that has to be understood. I'm not familiar
> with the overall network, or 80211, subsystem architecture, but it's hard
> to see why this driver has it's own private ieee80211.h file.

That's true and the reason why this code should
eventually be deleted if possible and its functionality
integrated into the existing realtek/rtl8xxxxu code.

> I must try and get my hands on the device in question.

That'd be good, though likely this device is obsolete.
Good luck finding one.

> Thank ye for your comments, and sorry for the "somewhat useful" changes
> to date, but doing these changes is letting me get the hang of this code,
> which I refuse to comment on because there are probably guidelines on using
> naughty language on here. ;)

Feel free.

The one look I took at any existing multi-platform realtek
code with all the #ifdefs made me not want look at it again.

https://github.com/hadess/rtl8723bs/

I said a naughty under my breath too.

2018-08-31 07:28:13

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Thu, Aug 30, 2018 at 10:35:37PM +0100, John Whitmore wrote:
> On Thu, Aug 30, 2018 at 11:26:28AM +0300, Dan Carpenter wrote:
> > On Thu, Aug 30, 2018 at 11:23:05AM +0300, Dan Carpenter wrote:
> > > On Wed, Aug 29, 2018 at 09:35:27PM +0100, John Whitmore wrote:
> > > > Rename the bit field element AdvCoding, as it causes a checkpatch issue
> > > > with CamelCase naming. As the element is not actually used in code it
> > > > has been renamed to 'not_used_adv_coding'.
> > > >
> > > > The single line of code which initialises the bit has been removed,
> > > > as the field is unused.
> > > >
> > > > This is a purely coding style change which should have no impact
> > > > on runtime code execution.
> > > >
> > > > Signed-off-by: John Whitmore <[email protected]>
> > > > ---
> > > > drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
> > > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
> > > > 2 files changed, 1 insertion(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > > > index 64d5359cf7e2..66a0274077d3 100644
> > > > --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > > > +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> > > > @@ -39,7 +39,7 @@ enum ht_extension_chan_offset {
> > > >
> > > > struct ht_capability_ele {
> > > > //HT capability info
> > > > - u8 AdvCoding:1;
> > > > + u8 not_used_adv_coding:1;
> > >
> > > I can't review any more of this patchset when this is the first line...
> > >
> >
> > That email wasn't very clear. If you think some of your patches are
> > going to be more controversial than others, put them at the very end so
> > we can at least apply part of the patchset.
> >
> > regards,
> > dan carpenter
> >
>
> Thanks for the clarification, I needed it ;)
>
> I'm not sure I consider any of the patches in the series as being
> controversial. They are all just simple name changes of member
> variables. As a number of the variables are not used in code the names
> have been changed to reflect that fact. If I'd renamed them and left out
> the 'not_used_' prefix would the changes not be controversial? I
> don't think the fact that the members are unused is a biggy.
>

I didn't like the new name at all.

Quite often when I review these I just use a script to verify that we're
only renaming variables and not doing code changes outside of that. But
if I review it by hand I would have seen that the variable was not used
and investigated what was going on.

> What might appear to be controversial is that I didn't simply remove
> the members. I haven't done that because I'm not yet satisfied that
> the structure's size is insignificant. As soon as I am happy that the
> size of the structure is not important, to runtime code execution,
> there'll be a patch which removes a number of 'not_used_...' members
> from a structure.
>
> Alternatively if the size if important there might be a patch which
> renames a number of unused bitfield members to reserved_1, reserved_2,
> reserved_3....

That's a good question. If a struct is part of the use space API or the
network protocol or defined by the hardware then we can't change the
layout.

One thing I look for is if the struct has pointers which aren't tagged
as __user pointers then it's internal to the kernel. Unfortunately that
doesn't help here. Network protocol is all endian specific and this
struct is not. But again that doesn't help much because it could just
be a bug. If the struct is __packed then obviously the layout matters.

So I don't know. I think you're right that actually we can't change
the layout. The code is really a mess, so it's possible I have misread.

regards,
dan carpenter


2018-08-31 22:29:46

by John Whitmore

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Thu, Aug 30, 2018 at 03:34:01PM -0700, Joe Perches wrote:
> On Wed, 2018-08-29 at 22:55 +0100, John Whitmore wrote:
> > On Wed, Aug 29, 2018 at 04:21:54PM -0500, Larry Finger wrote:
> > > On 08/29/2018 04:14 PM, Joe Perches wrote:
> []
> > > > Perhaps support for the chipset could be converted to use
> > > > mac80211 and moved into the directory with the other realtek
> > > > drivers in drivers/net/wireless/realtek/rtl8xxxu/...
> []
> > > All the Realtek USB devices should be added to rtl8xxxu, not merely moved
> > > into that directory. Jes Sorensen created a well-designed driver the is
> > > structured to permit addition of different initialization routines, etc.
> > > That said, the conversion will not be easy. In addition, it will require
> > > having your hands on a real device - a requirement that I cannot meet for
> > > the RTL8192U.
> []
> > > Oops... it probably doesn't look like it, at the moment, but 'actual code
> > changes to this driver' was where I'm hoping to get to. There's a lot of
> > stuff in the header files, including member variables, which are not used
> > in the code. I was hoping to strip these out incrementally to minimise
> > the amount of source code that has to be understood. I'm not familiar
> > with the overall network, or 80211, subsystem architecture, but it's hard
> > to see why this driver has it's own private ieee80211.h file.
>
> That's true and the reason why this code should
> eventually be deleted if possible and its functionality
> integrated into the existing realtek/rtl8xxxxu code.
>
> > I must try and get my hands on the device in question.
>
> That'd be good, though likely this device is obsolete.
> Good luck finding one.
>

Maybe if the whole driver was deleted nobody would notice ;)
Thanks for your help. I'm afraid I carried on in the same vain
cleaning stuff up but I do have to look at realtek/rtl8xxxxu, thanks
for pointing out where the goalposts are, miles away ;)

> > Thank ye for your comments, and sorry for the "somewhat useful" changes
> > to date, but doing these changes is letting me get the hang of this code,
> > which I refuse to comment on because there are probably guidelines on using
> > naughty language on here. ;)
>
> Feel free.
>
> The one look I took at any existing multi-platform realtek
> code with all the #ifdefs made me not want look at it again.
>
> https://github.com/hadess/rtl8723bs/
>
> I said a naughty under my breath too.

2018-09-10 15:11:04

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 01/21] staging:rtl8192u: Rename AdvCoding - Style

On Wed, Aug 29, 2018 at 09:35:27PM +0100, John Whitmore wrote:
> Rename the bit field element AdvCoding, as it causes a checkpatch issue
> with CamelCase naming. As the element is not actually used in code it
> has been renamed to 'not_used_adv_coding'.
>
> The single line of code which initialises the bit has been removed,
> as the field is unused.
>
> This is a purely coding style change which should have no impact
> on runtime code execution.
>
> Signed-off-by: John Whitmore <[email protected]>
> ---
> drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | 2 +-
> drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 1 -
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> index 64d5359cf7e2..66a0274077d3 100644
> --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
> @@ -39,7 +39,7 @@ enum ht_extension_chan_offset {
>
> struct ht_capability_ele {
> //HT capability info
> - u8 AdvCoding:1;
> + u8 not_used_adv_coding:1;
> u8 ChlWidth:1;
> u8 MimoPwrSave:2;
> u8 GreenField:1;
> diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
> index 9bf52cebe4cd..d7f73a5831da 100644
> --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
> +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
> @@ -550,7 +550,6 @@ void HTConstructCapabilityElement(struct ieee80211_device *ieee, u8 *posHTCap, u
> }
>
> //HT capability info
> - pCapELE->AdvCoding = 0; // This feature is not supported now!!
> if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
> pCapELE->ChlWidth = 0;
> else

If a structure like this, which is not read/written to hardware
directly, has fields that are not really used at all, just delete them.
That's much easier than having to apply this patch, and a later patch
which deletes the usage.

thanks,

greg k-h