linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
@ 2018-03-24  4:10 Quytelda Kahja
  2018-03-24  4:10 ` [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks Quytelda Kahja
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-24  4:10 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, linux-kernel, Quytelda Kahja

It is neater and more consistent with the rest of the document to use the
BIT() macro from 'linux/bitops.h' to define the WLAN_CAPABILITY_*
bitmasks.  In the case of WLAN_CAPABILITY_DMG_TYPE_{IBSS, PBSS, AP},
bitshifting integers by 0 does nothing, so there is no reason to do it in
the code; replace these values with plain integers.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 include/linux/ieee80211.h | 56 +++++++++++++++++++++++------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ee6657a0ed69..58069176b432 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1588,8 +1588,8 @@ struct ieee80211_vht_operation {
 
 #define WLAN_AUTH_CHALLENGE_LEN 128
 
-#define WLAN_CAPABILITY_ESS		(1<<0)
-#define WLAN_CAPABILITY_IBSS		(1<<1)
+#define WLAN_CAPABILITY_ESS		BIT(0)
+#define WLAN_CAPABILITY_IBSS		BIT(1)
 
 /*
  * A mesh STA sets the ESS and IBSS capability bits to zero.
@@ -1599,37 +1599,37 @@ struct ieee80211_vht_operation {
 #define WLAN_CAPABILITY_IS_STA_BSS(cap)	\
 	(!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)))
 
-#define WLAN_CAPABILITY_CF_POLLABLE	(1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST	(1<<3)
-#define WLAN_CAPABILITY_PRIVACY		(1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE	(1<<5)
-#define WLAN_CAPABILITY_PBCC		(1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY	(1<<7)
+#define WLAN_CAPABILITY_CF_POLLABLE	BIT(2)
+#define WLAN_CAPABILITY_CF_POLL_REQUEST	BIT(3)
+#define WLAN_CAPABILITY_PRIVACY		BIT(4)
+#define WLAN_CAPABILITY_SHORT_PREAMBLE	BIT(5)
+#define WLAN_CAPABILITY_PBCC		BIT(6)
+#define WLAN_CAPABILITY_CHANNEL_AGILITY	BIT(7)
 
 /* 802.11h */
-#define WLAN_CAPABILITY_SPECTRUM_MGMT	(1<<8)
-#define WLAN_CAPABILITY_QOS		(1<<9)
-#define WLAN_CAPABILITY_SHORT_SLOT_TIME	(1<<10)
-#define WLAN_CAPABILITY_APSD		(1<<11)
-#define WLAN_CAPABILITY_RADIO_MEASURE	(1<<12)
-#define WLAN_CAPABILITY_DSSS_OFDM	(1<<13)
-#define WLAN_CAPABILITY_DEL_BACK	(1<<14)
-#define WLAN_CAPABILITY_IMM_BACK	(1<<15)
+#define WLAN_CAPABILITY_SPECTRUM_MGMT	BIT(8)
+#define WLAN_CAPABILITY_QOS		BIT(9)
+#define WLAN_CAPABILITY_SHORT_SLOT_TIME	BIT(10)
+#define WLAN_CAPABILITY_APSD		BIT(11)
+#define WLAN_CAPABILITY_RADIO_MEASURE	BIT(12)
+#define WLAN_CAPABILITY_DSSS_OFDM	BIT(13)
+#define WLAN_CAPABILITY_DEL_BACK	BIT(14)
+#define WLAN_CAPABILITY_IMM_BACK	BIT(15)
 
 /* DMG (60gHz) 802.11ad */
 /* type - bits 0..1 */
-#define WLAN_CAPABILITY_DMG_TYPE_MASK		(3<<0)
-#define WLAN_CAPABILITY_DMG_TYPE_IBSS		(1<<0) /* Tx by: STA */
-#define WLAN_CAPABILITY_DMG_TYPE_PBSS		(2<<0) /* Tx by: PCP */
-#define WLAN_CAPABILITY_DMG_TYPE_AP		(3<<0) /* Tx by: AP */
-
-#define WLAN_CAPABILITY_DMG_CBAP_ONLY		(1<<2)
-#define WLAN_CAPABILITY_DMG_CBAP_SOURCE		(1<<3)
-#define WLAN_CAPABILITY_DMG_PRIVACY		(1<<4)
-#define WLAN_CAPABILITY_DMG_ECPAC		(1<<5)
-
-#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT	(1<<8)
-#define WLAN_CAPABILITY_DMG_RADIO_MEASURE	(1<<12)
+#define WLAN_CAPABILITY_DMG_TYPE_MASK   (BIT(0) | BIT(1))
+#define WLAN_CAPABILITY_DMG_TYPE_IBSS   1 /* Tx by: STA */
+#define WLAN_CAPABILITY_DMG_TYPE_PBSS   2 /* Tx by: PCP */
+#define WLAN_CAPABILITY_DMG_TYPE_AP     3 /* Tx by: AP */
+
+#define WLAN_CAPABILITY_DMG_CBAP_ONLY		BIT(2)
+#define WLAN_CAPABILITY_DMG_CBAP_SOURCE		BIT(3)
+#define WLAN_CAPABILITY_DMG_PRIVACY		BIT(4)
+#define WLAN_CAPABILITY_DMG_ECPAC		BIT(5)
+
+#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT	BIT(8)
+#define WLAN_CAPABILITY_DMG_RADIO_MEASURE	BIT(12)
 
 /* measurement */
 #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE	(1<<0)
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks.
  2018-03-24  4:10 [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Quytelda Kahja
@ 2018-03-24  4:10 ` Quytelda Kahja
  2018-03-24  4:10 ` [PATCH 3/3] ieee80211: Replace bit shifts with the BIT() macro for 802.11g ERP IEs Quytelda Kahja
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-24  4:10 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, linux-kernel, Quytelda Kahja

It is neater and more consistent with the rest of the document to use the
BIT() macro from 'linux/bitops.h' to define the
IEEE80211_SPCT_MSR_RPRT_MODE_* bitmasks.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 include/linux/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 58069176b432..dc361ed2fb7e 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1632,9 +1632,9 @@ struct ieee80211_vht_operation {
 #define WLAN_CAPABILITY_DMG_RADIO_MEASURE	BIT(12)
 
 /* measurement */
-#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE	(1<<0)
-#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE	(1<<1)
-#define IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED	(1<<2)
+#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE	BIT(0)
+#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE	BIT(1)
+#define IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED	BIT(2)
 
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC	0
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA	1
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 3/3] ieee80211: Replace bit shifts with the BIT() macro for 802.11g ERP IEs.
  2018-03-24  4:10 [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Quytelda Kahja
  2018-03-24  4:10 ` [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks Quytelda Kahja
@ 2018-03-24  4:10 ` Quytelda Kahja
  2018-03-24 21:23 ` [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Larry Finger
  2018-03-25 14:05 ` kbuild test robot
  3 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-24  4:10 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, linux-kernel, Quytelda Kahja

It is neater and more consistent with the rest of the document to use the
BIT() macro from 'linux/bitops.h' to define the WLAN_ERP_* bitmasks.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 include/linux/ieee80211.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index dc361ed2fb7e..bc68d542f082 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1641,9 +1641,9 @@ struct ieee80211_vht_operation {
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI	2
 
 /* 802.11g ERP information element */
-#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
-#define WLAN_ERP_USE_PROTECTION (1<<1)
-#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
+#define WLAN_ERP_NON_ERP_PRESENT BIT(0)
+#define WLAN_ERP_USE_PROTECTION  BIT(1)
+#define WLAN_ERP_BARKER_PREAMBLE BIT(2)
 
 /* WLAN_ERP_BARKER_PREAMBLE values */
 enum {
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
  2018-03-24  4:10 [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Quytelda Kahja
  2018-03-24  4:10 ` [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks Quytelda Kahja
  2018-03-24  4:10 ` [PATCH 3/3] ieee80211: Replace bit shifts with the BIT() macro for 802.11g ERP IEs Quytelda Kahja
@ 2018-03-24 21:23 ` Larry Finger
  2018-03-24 23:02   ` Quytelda Kahja
  2018-03-25 14:05 ` kbuild test robot
  3 siblings, 1 reply; 32+ messages in thread
From: Larry Finger @ 2018-03-24 21:23 UTC (permalink / raw)
  To: Quytelda Kahja, johannes; +Cc: linux-wireless, linux-kernel

On 03/23/2018 11:10 PM, Quytelda Kahja wrote:
> It is neater and more consistent with the rest of the document to use the
> BIT() macro from 'linux/bitops.h' to define the WLAN_CAPABILITY_*
> bitmasks.  In the case of WLAN_CAPABILITY_DMG_TYPE_{IBSS, PBSS, AP},
> bitshifting integers by 0 does nothing, so there is no reason to do it in
> the code; replace these values with plain integers.
> 
> Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>

In the commit message for all of these, what is the "document" to which you refer?

I'm not quite sure why you split these changes into 3 parts, but I guess that is OK.

Larry

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
  2018-03-24 21:23 ` [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Larry Finger
@ 2018-03-24 23:02   ` Quytelda Kahja
  2018-03-27 13:16     ` Johannes Berg
  0 siblings, 1 reply; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-24 23:02 UTC (permalink / raw)
  To: Larry Finger; +Cc: johannes, linux-wireless, linux-kernel

The "document" refers to the file in which the changes were made
('include/linux/ieee80211.h').

I tend to try to split my commits into the smallest logically related
changes possible, hence the three patch series.  This particular case
may be a little on the extreme side, but if the maintainer desires,
they can always squash them together or ask me to resubmit as one
patch.

On 3/24/18, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> On 03/23/2018 11:10 PM, Quytelda Kahja wrote:
>> It is neater and more consistent with the rest of the document to use the
>> BIT() macro from 'linux/bitops.h' to define the WLAN_CAPABILITY_*
>> bitmasks.  In the case of WLAN_CAPABILITY_DMG_TYPE_{IBSS, PBSS, AP},
>> bitshifting integers by 0 does nothing, so there is no reason to do it in
>> the code; replace these values with plain integers.
>>
>> Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
>
> In the commit message for all of these, what is the "document" to which you
> refer?
>
> I'm not quite sure why you split these changes into 3 parts, but I guess
> that is OK.
>
> Larry
>
-- 
Thank you,
Quytelda Kahja

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
  2018-03-24  4:10 [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Quytelda Kahja
                   ` (2 preceding siblings ...)
  2018-03-24 21:23 ` [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Larry Finger
@ 2018-03-25 14:05 ` kbuild test robot
  2018-03-26  9:15   ` Quytelda Kahja
  3 siblings, 1 reply; 32+ messages in thread
From: kbuild test robot @ 2018-03-25 14:05 UTC (permalink / raw)
  To: Quytelda Kahja
  Cc: kbuild-all, johannes, linux-wireless, linux-kernel, Quytelda Kahja

[-- Attachment #1: Type: text/plain, Size: 7752 bytes --]

Hi Quytelda,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on mac80211-next/master]
[also build test WARNING on v4.16-rc6 next-20180323]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Quytelda-Kahja/ieee80211-Replace-bit-shifts-with-the-BIT-macro-for-WLAN_CAPABILITY_/20180325-211645
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: i386-randconfig-s1-03251817 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:444:0: warning: "WLAN_CAPABILITY_IBSS" redefined
    #define WLAN_CAPABILITY_IBSS (1<<1)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1593:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_IBSS  BIT(1)
    
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:445:0: warning: "WLAN_CAPABILITY_CF_POLLABLE" redefined
    #define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1603:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
    
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:446:0: warning: "WLAN_CAPABILITY_CF_POLL_REQUEST" redefined
    #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1604:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
    
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:447:0: warning: "WLAN_CAPABILITY_PRIVACY" redefined
    #define WLAN_CAPABILITY_PRIVACY (1<<4)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1605:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_PRIVACY  BIT(4)
    
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:448:0: warning: "WLAN_CAPABILITY_SHORT_PREAMBLE" redefined
    #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1606:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
    
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:449:0: warning: "WLAN_CAPABILITY_PBCC" redefined
    #define WLAN_CAPABILITY_PBCC (1<<6)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1607:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_PBCC  BIT(6)
    
   In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>> drivers/staging/rtl8723bs/include/ieee80211.h:450:0: warning: "WLAN_CAPABILITY_CHANNEL_AGILITY" redefined
    #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
    
   In file included from include/net/cfg80211.h:23:0,
                    from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
                    from drivers/staging/rtl8723bs/include/osdep_service.h:23,
                    from drivers/staging/rtl8723bs/include/drv_types.h:29,
                    from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
   include/linux/ieee80211.h:1608:0: note: this is the location of the previous definition
    #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
    

vim +/WLAN_CAPABILITY_IBSS +444 drivers/staging/rtl8723bs/include/ieee80211.h

554c0a3a Hans de Goede 2017-03-29  442  
554c0a3a Hans de Goede 2017-03-29  443  #define WLAN_CAPABILITY_BSS (1<<0)
554c0a3a Hans de Goede 2017-03-29 @444  #define WLAN_CAPABILITY_IBSS (1<<1)
554c0a3a Hans de Goede 2017-03-29 @445  #define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
554c0a3a Hans de Goede 2017-03-29 @446  #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
554c0a3a Hans de Goede 2017-03-29 @447  #define WLAN_CAPABILITY_PRIVACY (1<<4)
554c0a3a Hans de Goede 2017-03-29 @448  #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
554c0a3a Hans de Goede 2017-03-29 @449  #define WLAN_CAPABILITY_PBCC (1<<6)
554c0a3a Hans de Goede 2017-03-29 @450  #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
554c0a3a Hans de Goede 2017-03-29  451  #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
554c0a3a Hans de Goede 2017-03-29  452  

:::::: The code at line 444 was first introduced by commit
:::::: 554c0a3abf216c991c5ebddcdb2c08689ecd290b staging: Add rtl8723bs sdio wifi driver

:::::: TO: Hans de Goede <hdegoede@redhat.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26075 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
  2018-03-25 14:05 ` kbuild test robot
@ 2018-03-26  9:15   ` Quytelda Kahja
  2018-03-26  9:18     ` [PATCH] staging: rtl8723bs: Remove duplicate #defines Quytelda Kahja
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
  0 siblings, 2 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-26  9:15 UTC (permalink / raw)
  To: kbuild test robot, Greg KH
  Cc: kbuild-all, Johannes Berg, linux-wireless, linux-kernel

This is a problem with the rtl8723bs driver in staging; it's source
tree has a custom IEEE80211 header which imports 'linux/ieee80211.h',
but redefines many of the #define's from the original header.
Functionally, they are the same, but I will submit a patch in reply to
this email which removes the duplicate #defines from
drivers/staging/rtl8723bs/include/ieee80211.h.  It looks like there's
also some #defines there that shadow enum members in
'linux/ieee80211.h', but I will address that in separate patch(es)
when I have a chance.

Thank you,
Quytelda Kahja

On Sun, Mar 25, 2018 at 7:05 AM, kbuild test robot <lkp@intel.com> wrote:
> Hi Quytelda,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on mac80211-next/master]
> [also build test WARNING on v4.16-rc6 next-20180323]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Quytelda-Kahja/ieee80211-Replace-bit-shifts-with-the-BIT-macro-for-WLAN_CAPABILITY_/20180325-211645
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
> config: i386-randconfig-s1-03251817 (attached as .config)
> compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386
>
> All warnings (new ones prefixed by >>):
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:444:0: warning: "WLAN_CAPABILITY_IBSS" redefined
>     #define WLAN_CAPABILITY_IBSS (1<<1)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1593:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_IBSS  BIT(1)
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:445:0: warning: "WLAN_CAPABILITY_CF_POLLABLE" redefined
>     #define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1603:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:446:0: warning: "WLAN_CAPABILITY_CF_POLL_REQUEST" redefined
>     #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1604:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:447:0: warning: "WLAN_CAPABILITY_PRIVACY" redefined
>     #define WLAN_CAPABILITY_PRIVACY (1<<4)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1605:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_PRIVACY  BIT(4)
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:448:0: warning: "WLAN_CAPABILITY_SHORT_PREAMBLE" redefined
>     #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1606:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:449:0: warning: "WLAN_CAPABILITY_PBCC" redefined
>     #define WLAN_CAPABILITY_PBCC (1<<6)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1607:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_PBCC  BIT(6)
>
>    In file included from drivers/staging/rtl8723bs/include/drv_types.h:33:0,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>>> drivers/staging/rtl8723bs/include/ieee80211.h:450:0: warning: "WLAN_CAPABILITY_CHANNEL_AGILITY" redefined
>     #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
>
>    In file included from include/net/cfg80211.h:23:0,
>                     from drivers/staging/rtl8723bs/include/osdep_service_linux.h:50,
>                     from drivers/staging/rtl8723bs/include/osdep_service.h:23,
>                     from drivers/staging/rtl8723bs/include/drv_types.h:29,
>                     from drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:20:
>    include/linux/ieee80211.h:1608:0: note: this is the location of the previous definition
>     #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
>
>
> vim +/WLAN_CAPABILITY_IBSS +444 drivers/staging/rtl8723bs/include/ieee80211.h
>
> 554c0a3a Hans de Goede 2017-03-29  442
> 554c0a3a Hans de Goede 2017-03-29  443  #define WLAN_CAPABILITY_BSS (1<<0)
> 554c0a3a Hans de Goede 2017-03-29 @444  #define WLAN_CAPABILITY_IBSS (1<<1)
> 554c0a3a Hans de Goede 2017-03-29 @445  #define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
> 554c0a3a Hans de Goede 2017-03-29 @446  #define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
> 554c0a3a Hans de Goede 2017-03-29 @447  #define WLAN_CAPABILITY_PRIVACY (1<<4)
> 554c0a3a Hans de Goede 2017-03-29 @448  #define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
> 554c0a3a Hans de Goede 2017-03-29 @449  #define WLAN_CAPABILITY_PBCC (1<<6)
> 554c0a3a Hans de Goede 2017-03-29 @450  #define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
> 554c0a3a Hans de Goede 2017-03-29  451  #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
> 554c0a3a Hans de Goede 2017-03-29  452
>
> :::::: The code at line 444 was first introduced by commit
> :::::: 554c0a3abf216c991c5ebddcdb2c08689ecd290b staging: Add rtl8723bs sdio wifi driver
>
> :::::: TO: Hans de Goede <hdegoede@redhat.com>
> :::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH] staging: rtl8723bs: Remove duplicate #defines.
  2018-03-26  9:15   ` Quytelda Kahja
@ 2018-03-26  9:18     ` Quytelda Kahja
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
  1 sibling, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-26  9:18 UTC (permalink / raw)
  To: lkp, gregkh
  Cc: kbuild-all, johannes, linux-wireless, linux-kernel, Quytelda Kahja

The modified file includes 'linux/ieee80211.h', but redefines many
constants that already exist in the header.  This will create a conflict
if the values are ever changed in the kernel.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/include/ieee80211.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 73ce63770c3c..a2402495f447 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -435,19 +435,7 @@ struct ieee80211_snap_hdr {
 #define WLAN_GET_SEQ_SEQ(seq)  ((seq) & RTW_IEEE80211_SCTL_SEQ)
 
 /* Authentication algorithms */
-#define WLAN_AUTH_OPEN 0
-#define WLAN_AUTH_SHARED_KEY 1
-
-#define WLAN_AUTH_CHALLENGE_LEN 128
-
 #define WLAN_CAPABILITY_BSS (1<<0)
-#define WLAN_CAPABILITY_IBSS (1<<1)
-#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
-#define WLAN_CAPABILITY_PRIVACY (1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
-#define WLAN_CAPABILITY_PBCC (1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
 #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
 
 /* Status codes */
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 01/23] staging: rtl8723bs: Remove duplicate #defines.
  2018-03-26  9:15   ` Quytelda Kahja
  2018-03-26  9:18     ` [PATCH] staging: rtl8723bs: Remove duplicate #defines Quytelda Kahja
@ 2018-03-27  8:40     ` Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 02/23] staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h' Quytelda Kahja
                         ` (21 more replies)
  1 sibling, 22 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

The modified file includes 'linux/ieee80211.h', but redefines many
constants that already exist in the header.  This will create a conflict
if the values are ever changed in the kernel.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/include/ieee80211.h | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 73ce63770c3c..a2402495f447 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -435,19 +435,7 @@ struct ieee80211_snap_hdr {
 #define WLAN_GET_SEQ_SEQ(seq)  ((seq) & RTW_IEEE80211_SCTL_SEQ)
 
 /* Authentication algorithms */
-#define WLAN_AUTH_OPEN 0
-#define WLAN_AUTH_SHARED_KEY 1
-
-#define WLAN_AUTH_CHALLENGE_LEN 128
-
 #define WLAN_CAPABILITY_BSS (1<<0)
-#define WLAN_CAPABILITY_IBSS (1<<1)
-#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
-#define WLAN_CAPABILITY_PRIVACY (1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
-#define WLAN_CAPABILITY_PBCC (1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
 #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
 
 /* Status codes */
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 02/23] staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h'
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
@ 2018-03-27  8:40       ` Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 03/23] staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_* Quytelda Kahja
                         ` (20 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

The modified file includes 'linux/ieee80211.h', but #define's many
constants that shadow enum members in the header.  This will create a
conflict if the values are ever changed in the kernel.  Remove these

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/include/ieee80211.h | 56 ---------------------------
 1 file changed, 56 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index a2402495f447..c76466567ecb 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -438,76 +438,20 @@ struct ieee80211_snap_hdr {
 #define WLAN_CAPABILITY_BSS (1<<0)
 #define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
 
-/* Status codes */
-#define WLAN_STATUS_SUCCESS 0
-#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
-#define WLAN_STATUS_CAPS_UNSUPPORTED 10
-#define WLAN_STATUS_REASSOC_NO_ASSOC 11
-#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
-#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
-#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
-#define WLAN_STATUS_CHALLENGE_FAIL 15
-#define WLAN_STATUS_AUTH_TIMEOUT 16
-#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
-#define WLAN_STATUS_ASSOC_DENIED_RATES 18
 /* 802.11b */
 #define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
-#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
-#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
 
 /* Reason codes */
-#define WLAN_REASON_UNSPECIFIED 1
-#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
-#define WLAN_REASON_DEAUTH_LEAVING 3
-#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
-#define WLAN_REASON_DISASSOC_AP_BUSY 5
-#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
-#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
-#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
-#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
 #define WLAN_REASON_ACTIVE_ROAM 65533
 #define WLAN_REASON_JOIN_WRONG_CHANNEL       65534
 #define WLAN_REASON_EXPIRATION_CHK 65535
 
-/* Information Element IDs */
-#define WLAN_EID_SSID 0
-#define WLAN_EID_SUPP_RATES 1
-#define WLAN_EID_FH_PARAMS 2
-#define WLAN_EID_DS_PARAMS 3
-#define WLAN_EID_CF_PARAMS 4
-#define WLAN_EID_TIM 5
-#define WLAN_EID_IBSS_PARAMS 6
-#define WLAN_EID_CHALLENGE 16
-/* EIDs defined by IEEE 802.11h - START */
-#define WLAN_EID_PWR_CONSTRAINT 32
-#define WLAN_EID_PWR_CAPABILITY 33
-#define WLAN_EID_TPC_REQUEST 34
-#define WLAN_EID_TPC_REPORT 35
-#define WLAN_EID_SUPPORTED_CHANNELS 36
-#define WLAN_EID_CHANNEL_SWITCH 37
-#define WLAN_EID_MEASURE_REQUEST 38
-#define WLAN_EID_MEASURE_REPORT 39
-#define WLAN_EID_QUITE 40
-#define WLAN_EID_IBSS_DFS 41
 /* EIDs defined by IEEE 802.11h - END */
-#define WLAN_EID_ERP_INFO 42
 #define WLAN_EID_HT_CAP 45
-#define WLAN_EID_RSN 48
-#define WLAN_EID_EXT_SUPP_RATES 50
-#define WLAN_EID_MOBILITY_DOMAIN 54
-#define WLAN_EID_FAST_BSS_TRANSITION 55
-#define WLAN_EID_TIMEOUT_INTERVAL 56
-#define WLAN_EID_RIC_DATA 57
-#define WLAN_EID_HT_OPERATION 61
-#define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
 #define WLAN_EID_20_40_BSS_COEXISTENCE 72
 #define WLAN_EID_20_40_BSS_INTOLERANT 73
 #define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
-#define WLAN_EID_MMIE 76
-#define WLAN_EID_VENDOR_SPECIFIC 221
 #define WLAN_EID_GENERIC (WLAN_EID_VENDOR_SPECIFIC)
-#define WLAN_EID_VHT_CAPABILITY 191
-#define WLAN_EID_VHT_OPERATION 192
 #define WLAN_EID_VHT_OP_MODE_NOTIFY 199
 
 #define IEEE80211_MGMT_HDR_LEN 24
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 03/23] staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_*.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 02/23] staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h' Quytelda Kahja
@ 2018-03-27  8:40       ` Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 04/23] staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_* Quytelda Kahja
                         ` (19 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

This driver defines the constants RTW_IEEE80211_FCTL_* for frame
control constants, but all these values are already defined in
'linux/ieee80211.h' as IEEE80211_FCTL_*.  Remove the locally defined
constants, and substitute the kernel constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c    |  2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h     | 18 ++----------------
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  6 +++---
 3 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 9167900b5f7d..22c219e8a75f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1380,7 +1380,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
 
 	fc = le16_to_cpu(((struct ieee80211_hdr_3addr *)frame)->frame_control);
 
-	if ((fc & (RTW_IEEE80211_FCTL_FTYPE|RTW_IEEE80211_FCTL_STYPE))
+	if ((fc & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
 		!= (RTW_IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
 	) {
 		return false;
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index c76466567ecb..746ac7cf3ccd 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -324,20 +324,6 @@ enum eap_type {
 #define MIN_FRAG_THRESHOLD     256U
 #define	MAX_FRAG_THRESHOLD     2346U
 
-/* Frame control field constants */
-#define RTW_IEEE80211_FCTL_VERS		0x0003
-#define RTW_IEEE80211_FCTL_FTYPE		0x000c
-#define RTW_IEEE80211_FCTL_STYPE		0x00f0
-#define RTW_IEEE80211_FCTL_TODS		0x0100
-#define RTW_IEEE80211_FCTL_FROMDS	0x0200
-#define RTW_IEEE80211_FCTL_MOREFRAGS	0x0400
-#define RTW_IEEE80211_FCTL_RETRY		0x0800
-#define RTW_IEEE80211_FCTL_PM		0x1000
-#define RTW_IEEE80211_FCTL_MOREDATA	0x2000
-#define RTW_IEEE80211_FCTL_PROTECTED	0x4000
-#define RTW_IEEE80211_FCTL_ORDER		0x8000
-#define RTW_IEEE80211_FCTL_CTL_EXT	0x0f00
-
 #define RTW_IEEE80211_FTYPE_MGMT		0x0000
 #define RTW_IEEE80211_FTYPE_CTL		0x0004
 #define RTW_IEEE80211_FTYPE_DATA		0x0008
@@ -426,8 +412,8 @@ struct ieee80211_snap_hdr {
 
 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
 
-#define WLAN_FC_GET_TYPE(fc) ((fc) & RTW_IEEE80211_FCTL_FTYPE)
-#define WLAN_FC_GET_STYPE(fc) ((fc) & RTW_IEEE80211_FCTL_STYPE)
+#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
+#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
 
 #define WLAN_QC_GET_TID(qc) ((qc) & 0x0f)
 
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 75a4b230ae6e..a955b94614d0 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2517,7 +2517,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
 	dot11_hdr = (struct ieee80211_hdr *)skb->data;
 	frame_control = le16_to_cpu(dot11_hdr->frame_control);
 	/* Check if the QoS bit is set */
-	if ((frame_control & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
+	if ((frame_control & IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
 		/* Check if this ia a Wireless Distribution System (WDS) frame
 		 * which has 4 MAC addresses
 		 */
@@ -2545,7 +2545,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
 		return ret;
 
 	}
-	else if ((frame_control & (RTW_IEEE80211_FCTL_FTYPE|RTW_IEEE80211_FCTL_STYPE))
+	else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
 		== (RTW_IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
 	)
 	{
@@ -2607,7 +2607,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
 	}
 	else
 	{
-		DBG_8192C("frame_control = 0x%x\n", frame_control & (RTW_IEEE80211_FCTL_FTYPE|RTW_IEEE80211_FCTL_STYPE));
+		DBG_8192C("frame_control = 0x%x\n", frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE));
 	}
 
 
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 04/23] staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_*.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 02/23] staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h' Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 03/23] staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_* Quytelda Kahja
@ 2018-03-27  8:40       ` Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 05/23] staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_* Quytelda Kahja
                         ` (18 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

This driver defines the constants RTW_IEEE80211_FTYPE_*, but all these
values are already defined in 'linux/ieee80211.h' as IEEE80211_FTYPE_*.
Remove the locally defined constants, and substitute the kernel constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c    | 2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h     | 5 -----
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 ++--
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 22c219e8a75f..e31e06fd6e9f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1381,7 +1381,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
 	fc = le16_to_cpu(((struct ieee80211_hdr_3addr *)frame)->frame_control);
 
 	if ((fc & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
-		!= (RTW_IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
+		!= (IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
 	) {
 		return false;
 	}
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 746ac7cf3ccd..c33b9c4ccd56 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -324,11 +324,6 @@ enum eap_type {
 #define MIN_FRAG_THRESHOLD     256U
 #define	MAX_FRAG_THRESHOLD     2346U
 
-#define RTW_IEEE80211_FTYPE_MGMT		0x0000
-#define RTW_IEEE80211_FTYPE_CTL		0x0004
-#define RTW_IEEE80211_FTYPE_DATA		0x0008
-#define RTW_IEEE80211_FTYPE_EXT		0x000c
-
 /* management */
 #define RTW_IEEE80211_STYPE_ASSOC_REQ	0x0000
 #define RTW_IEEE80211_STYPE_ASSOC_RESP	0x0010
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index a955b94614d0..4b84965ec5c5 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2517,7 +2517,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
 	dot11_hdr = (struct ieee80211_hdr *)skb->data;
 	frame_control = le16_to_cpu(dot11_hdr->frame_control);
 	/* Check if the QoS bit is set */
-	if ((frame_control & IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
+	if ((frame_control & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) {
 		/* Check if this ia a Wireless Distribution System (WDS) frame
 		 * which has 4 MAC addresses
 		 */
@@ -2546,7 +2546,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
 
 	}
 	else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
-		== (RTW_IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
+		== (IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
 	)
 	{
 		/* only for action frames */
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 05/23] staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_*.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (2 preceding siblings ...)
  2018-03-27  8:40       ` [PATCH 04/23] staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_* Quytelda Kahja
@ 2018-03-27  8:40       ` Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 06/23] staging: rtl8723bs: Fix newlines in rtw_wx_set_auth() Quytelda Kahja
                         ` (17 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

This driver defines the constants RTW_IEEE80211_STYPE_*, but all these
values are already defined in 'linux/ieee80211.h' as IEEE80211_STYPE_*.
Remove the locally defined constants, and substitute the kernel constants.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c    |  2 +-
 drivers/staging/rtl8723bs/include/ieee80211.h     | 43 -----------------------
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  2 +-
 3 files changed, 2 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index e31e06fd6e9f..74750dbce379 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1381,7 +1381,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
 	fc = le16_to_cpu(((struct ieee80211_hdr_3addr *)frame)->frame_control);
 
 	if ((fc & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
-		!= (IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
+		!= (IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ACTION)
 	) {
 		return false;
 	}
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index c33b9c4ccd56..2c7597ad0470 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -324,49 +324,6 @@ enum eap_type {
 #define MIN_FRAG_THRESHOLD     256U
 #define	MAX_FRAG_THRESHOLD     2346U
 
-/* management */
-#define RTW_IEEE80211_STYPE_ASSOC_REQ	0x0000
-#define RTW_IEEE80211_STYPE_ASSOC_RESP	0x0010
-#define RTW_IEEE80211_STYPE_REASSOC_REQ	0x0020
-#define RTW_IEEE80211_STYPE_REASSOC_RESP	0x0030
-#define RTW_IEEE80211_STYPE_PROBE_REQ	0x0040
-#define RTW_IEEE80211_STYPE_PROBE_RESP	0x0050
-#define RTW_IEEE80211_STYPE_BEACON		0x0080
-#define RTW_IEEE80211_STYPE_ATIM		0x0090
-#define RTW_IEEE80211_STYPE_DISASSOC	0x00A0
-#define RTW_IEEE80211_STYPE_AUTH		0x00B0
-#define RTW_IEEE80211_STYPE_DEAUTH		0x00C0
-#define RTW_IEEE80211_STYPE_ACTION		0x00D0
-
-/* control */
-#define RTW_IEEE80211_STYPE_CTL_EXT		0x0060
-#define RTW_IEEE80211_STYPE_BACK_REQ		0x0080
-#define RTW_IEEE80211_STYPE_BACK		0x0090
-#define RTW_IEEE80211_STYPE_PSPOLL		0x00A0
-#define RTW_IEEE80211_STYPE_RTS		0x00B0
-#define RTW_IEEE80211_STYPE_CTS		0x00C0
-#define RTW_IEEE80211_STYPE_ACK		0x00D0
-#define RTW_IEEE80211_STYPE_CFEND		0x00E0
-#define RTW_IEEE80211_STYPE_CFENDACK		0x00F0
-
-/* data */
-#define RTW_IEEE80211_STYPE_DATA		0x0000
-#define RTW_IEEE80211_STYPE_DATA_CFACK	0x0010
-#define RTW_IEEE80211_STYPE_DATA_CFPOLL	0x0020
-#define RTW_IEEE80211_STYPE_DATA_CFACKPOLL	0x0030
-#define RTW_IEEE80211_STYPE_NULLFUNC	0x0040
-#define RTW_IEEE80211_STYPE_CFACK		0x0050
-#define RTW_IEEE80211_STYPE_CFPOLL		0x0060
-#define RTW_IEEE80211_STYPE_CFACKPOLL	0x0070
-#define RTW_IEEE80211_STYPE_QOS_DATA		0x0080
-#define RTW_IEEE80211_STYPE_QOS_DATA_CFACK		0x0090
-#define RTW_IEEE80211_STYPE_QOS_DATA_CFPOLL		0x00A0
-#define RTW_IEEE80211_STYPE_QOS_DATA_CFACKPOLL	0x00B0
-#define RTW_IEEE80211_STYPE_QOS_NULLFUNC	0x00C0
-#define RTW_IEEE80211_STYPE_QOS_CFACK		0x00D0
-#define RTW_IEEE80211_STYPE_QOS_CFPOLL		0x00E0
-#define RTW_IEEE80211_STYPE_QOS_CFACKPOLL	0x00F0
-
 /* sequence control field */
 #define RTW_IEEE80211_SCTL_FRAG	0x000F
 #define RTW_IEEE80211_SCTL_SEQ	0xFFF0
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 4b84965ec5c5..46bc2e512557 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2546,7 +2546,7 @@ static int rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struct net_de
 
 	}
 	else if ((frame_control & (IEEE80211_FCTL_FTYPE|IEEE80211_FCTL_STYPE))
-		== (IEEE80211_FTYPE_MGMT|RTW_IEEE80211_STYPE_ACTION)
+		== (IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ACTION)
 	)
 	{
 		/* only for action frames */
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 06/23] staging: rtl8723bs: Fix newlines in rtw_wx_set_auth().
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (3 preceding siblings ...)
  2018-03-27  8:40       ` [PATCH 05/23] staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_* Quytelda Kahja
@ 2018-03-27  8:40       ` Quytelda Kahja
  2018-03-27  8:40       ` [PATCH 07/23] staging: rtl8723bs: Remove unecessary braces from switch statement Quytelda Kahja
                         ` (16 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

There are a lot of extra newlines in this function that waste space.
Remove those newlines, but add one newline before the return statement.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index bf437c825733..1b458074b7f9 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2139,21 +2139,17 @@ static int rtw_wx_set_auth(struct net_device *dev,
 	int ret = 0;
 
 	switch (param->flags & IW_AUTH_INDEX) {
-
 	case IW_AUTH_WPA_VERSION:
 		break;
 	case IW_AUTH_CIPHER_PAIRWISE:
-
 		break;
 	case IW_AUTH_CIPHER_GROUP:
-
 		break;
 	case IW_AUTH_KEY_MGMT:
 		/*
 		 *  ??? does not use these parameters
 		 */
 		break;
-
 	case IW_AUTH_TKIP_COUNTERMEASURES:
         {
 		if (param->value) {
@@ -2194,9 +2190,7 @@ static int rtw_wx_set_auth(struct net_device *dev,
 
 			break;
 		}
-
 	case IW_AUTH_80211_AUTH_ALG:
-
 		/*
 		 *  It's the starting point of a link layer connection using wpa_supplicant
 		*/
@@ -2208,11 +2202,8 @@ static int rtw_wx_set_auth(struct net_device *dev,
 			rtw_free_assoc_resources(padapter, 1);
 		}
 
-
 		ret = wpa_set_auth_algs(dev, (u32)param->value);
-
 		break;
-
 	case IW_AUTH_WPA_ENABLED:
 		break;
 	case IW_AUTH_RX_UNENCRYPTED_EAPOL:
@@ -2222,6 +2213,7 @@ static int rtw_wx_set_auth(struct net_device *dev,
 	default:
 		return -EOPNOTSUPP;
 	}
+
 	return ret;
 }
 
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 07/23] staging: rtl8723bs: Remove unecessary braces from switch statement.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (4 preceding siblings ...)
  2018-03-27  8:40       ` [PATCH 06/23] staging: rtl8723bs: Fix newlines in rtw_wx_set_auth() Quytelda Kahja
@ 2018-03-27  8:40       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 08/23] staging: rtl8723bs: Remove braces from single statement conditionals Quytelda Kahja
                         ` (15 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:40 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

The switch statement in rtw_wx_set_auth() wraps individual cases in
braces for no reason.  Remove those braces and unindent the code.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 50 ++++++++++++--------------
 1 file changed, 23 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 1b458074b7f9..3e78fc28a8eb 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2151,7 +2151,6 @@ static int rtw_wx_set_auth(struct net_device *dev,
 		 */
 		break;
 	case IW_AUTH_TKIP_COUNTERMEASURES:
-        {
 		if (param->value) {
 			/*  wpa_supplicant is enabling the tkip countermeasure. */
 			padapter->securitypriv.btkip_countermeasure = true;
@@ -2160,36 +2159,33 @@ static int rtw_wx_set_auth(struct net_device *dev,
 			padapter->securitypriv.btkip_countermeasure = false;
 		}
 		break;
-        }
 	case IW_AUTH_DROP_UNENCRYPTED:
-		{
-			/* HACK:
-			 *
-			 * wpa_supplicant calls set_wpa_enabled when the driver
-			 * is loaded and unloaded, regardless of if WPA is being
-			 * used.  No other calls are made which can be used to
-			 * determine if encryption will be used or not prior to
-			 * association being expected.  If encryption is not being
-			 * used, drop_unencrypted is set to false, else true -- we
-			 * can use this to determine if the CAP_PRIVACY_ON bit should
-			 * be set.
-			 */
-
-			if (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption1Enabled) {
-				break;/* it means init value, or using wep, ndisencryptstatus = Ndis802_11Encryption1Enabled, */
-						/*  then it needn't reset it; */
-			}
+		/* HACK:
+		 *
+		 * wpa_supplicant calls set_wpa_enabled when the driver
+		 * is loaded and unloaded, regardless of if WPA is being
+		 * used.  No other calls are made which can be used to
+		 * determine if encryption will be used or not prior to
+		 * association being expected.  If encryption is not being
+		 * used, drop_unencrypted is set to false, else true -- we
+		 * can use this to determine if the CAP_PRIVACY_ON bit should
+		 * be set.
+		 */
 
-			if (param->value) {
-				padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
-				padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
-				padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_;
-				padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
-				padapter->securitypriv.ndisauthtype =Ndis802_11AuthModeOpen;
-			}
+		if (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption1Enabled) {
+			break;/* it means init value, or using wep, ndisencryptstatus = Ndis802_11Encryption1Enabled, */
+			/*  then it needn't reset it; */
+		}
 
-			break;
+		if (param->value) {
+			padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
+			padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
+			padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_;
+			padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
+			padapter->securitypriv.ndisauthtype =Ndis802_11AuthModeOpen;
 		}
+
+		break;
 	case IW_AUTH_80211_AUTH_ALG:
 		/*
 		 *  It's the starting point of a link layer connection using wpa_supplicant
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 08/23] staging: rtl8723bs: Remove braces from single statement conditionals.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (5 preceding siblings ...)
  2018-03-27  8:40       ` [PATCH 07/23] staging: rtl8723bs: Remove unecessary braces from switch statement Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 09/23] staging: rtl8723bs: Fix alignment in rtw_wx_set_auth() Quytelda Kahja
                         ` (14 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Several conditionals in rtw_wx_set_auth() contain a comment then a
single statement.  Move the comments to the top of the conditionals
so that braces can be removed from the statements, which saves space
and makes the code more readable.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 3e78fc28a8eb..1cacd7fff052 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2151,13 +2151,11 @@ static int rtw_wx_set_auth(struct net_device *dev,
 		 */
 		break;
 	case IW_AUTH_TKIP_COUNTERMEASURES:
-		if (param->value) {
-			/*  wpa_supplicant is enabling the tkip countermeasure. */
+		/* wpa_supplicant is setting the tkip countermeasure. */
+		if (param->value) /* enabling */
 			padapter->securitypriv.btkip_countermeasure = true;
-		} else {
-			/*  wpa_supplicant is disabling the tkip countermeasure. */
+		else /* disabling */
 			padapter->securitypriv.btkip_countermeasure = false;
-		}
 		break;
 	case IW_AUTH_DROP_UNENCRYPTED:
 		/* HACK:
@@ -2172,10 +2170,12 @@ static int rtw_wx_set_auth(struct net_device *dev,
 		 * be set.
 		 */
 
-		if (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption1Enabled) {
-			break;/* it means init value, or using wep, ndisencryptstatus = Ndis802_11Encryption1Enabled, */
-			/*  then it needn't reset it; */
-		}
+		/*
+		 * This means init value, or using wep, ndisencryptstatus =
+		 * Ndis802_11Encryption1Enabled, then it needn't reset it;
+		 */
+		if (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption1Enabled)
+			break;
 
 		if (param->value) {
 			padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 09/23] staging: rtl8723bs: Fix alignment in rtw_wx_set_auth().
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (6 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 08/23] staging: rtl8723bs: Remove braces from single statement conditionals Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 10/23] staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants Quytelda Kahja
                         ` (13 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Realign the function parameters and comment blocks to match the kernel
coding style.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 1cacd7fff052..32dcee9a1451 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -2131,8 +2131,8 @@ static int rtw_wx_set_gen_ie(struct net_device *dev,
 }
 
 static int rtw_wx_set_auth(struct net_device *dev,
-			     struct iw_request_info *info,
-			     union iwreq_data *wrqu, char *extra)
+			   struct iw_request_info *info,
+			   union iwreq_data *wrqu, char *extra)
 {
 	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
 	struct iw_param *param = (struct iw_param*)&(wrqu->param);
@@ -2189,7 +2189,7 @@ static int rtw_wx_set_auth(struct net_device *dev,
 	case IW_AUTH_80211_AUTH_ALG:
 		/*
 		 *  It's the starting point of a link layer connection using wpa_supplicant
-		*/
+		 */
 		if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
 			LeaveAllPowerSaveMode(padapter);
 			rtw_disassoc_cmd(padapter, 500, false);
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 10/23] staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (7 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 09/23] staging: rtl8723bs: Fix alignment in rtw_wx_set_auth() Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 11/23] staging: rtl8723bs: Remove unnecessary length #define's Quytelda Kahja
                         ` (12 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

This driver's local ieee80211 include file defines the constants
AUTH_ALG_* to represent authenication algorithm options.  However,
these constants are defined in 'linux/ieee80211.h' as WLAN_AUTH_*,
and have the correct values.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/include/ieee80211.h  |  4 ----
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 16 ++++++++--------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 2c7597ad0470..a353dc9b883a 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -84,10 +84,6 @@ enum {
 #define IEEE_PARAM_IEEE_802_1X				6
 #define IEEE_PARAM_WPAX_SELECT				7
 
-#define AUTH_ALG_OPEN_SYSTEM			0x1
-#define AUTH_ALG_SHARED_KEY			0x2
-#define AUTH_ALG_LEAP				0x00000004
-
 #define IEEE_MLME_STA_DEAUTH				1
 #define IEEE_MLME_STA_DISASSOC			2
 
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 32dcee9a1451..b26533983864 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -476,26 +476,26 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value)
 	struct adapter *padapter = (struct adapter *) rtw_netdev_priv(dev);
 	int ret = 0;
 
-	if ((value & AUTH_ALG_SHARED_KEY) && (value & AUTH_ALG_OPEN_SYSTEM)) {
-		DBG_871X("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY and  AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value);
+	if ((value & WLAN_AUTH_SHARED_KEY) && (value & WLAN_AUTH_OPEN)) {
+		DBG_871X("wpa_set_auth_algs, WLAN_AUTH_SHARED_KEY and WLAN_AUTH_OPEN [value:0x%x]\n", value);
 		padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
 		padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch;
 		padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
-	} else if (value & AUTH_ALG_SHARED_KEY)	{
-		DBG_871X("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY  [value:0x%x]\n", value);
+	} else if (value & WLAN_AUTH_SHARED_KEY)	{
+		DBG_871X("wpa_set_auth_algs, WLAN_AUTH_SHARED_KEY  [value:0x%x]\n", value);
 		padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
 
 		padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared;
 		padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
-	} else if (value & AUTH_ALG_OPEN_SYSTEM) {
-		DBG_871X("wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM\n");
+	} else if (value & WLAN_AUTH_OPEN) {
+		DBG_871X("wpa_set_auth_algs, WLAN_AUTH_OPEN\n");
 		/* padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; */
 		if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) {
 			padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
 			padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
 		}
-	} else if (value & AUTH_ALG_LEAP) {
-		DBG_871X("wpa_set_auth_algs, AUTH_ALG_LEAP\n");
+	} else if (value & WLAN_AUTH_LEAP) {
+		DBG_871X("wpa_set_auth_algs, WLAN_AUTH_LEAP\n");
 	} else {
 		DBG_871X("wpa_set_auth_algs, error!\n");
 		ret = -EINVAL;
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 11/23] staging: rtl8723bs: Remove unnecessary length #define's.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (8 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 10/23] staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 12/23] staging: rtl8723bs: Fix lines with trailing open parentheses Quytelda Kahja
                         ` (11 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

This driver statically defines constants representing the size of
certain structs using literal integers as values.  Replace those
constants with the sizeof() macro.  Other length constants are already
defined in 'linux/ieee80211.h'; remove those #define's.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c |  6 +++---
 drivers/staging/rtl8723bs/include/ieee80211.h | 16 ----------------
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 7d7756e40bcb..2816c68b8254 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1219,7 +1219,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 	}
 
 
-	if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) {
+	if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset) {
 		DBG_871X("handle_assoc(reassoc =%d) - too short payload (len =%lu)"
 		       "\n", reassoc, (unsigned long)pkt_len);
 		return _FAIL;
@@ -1236,8 +1236,8 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 	/* listen_interval = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN+2)); */
 	listen_interval = RTW_GET_LE16(pframe + WLAN_HDR_A3_LEN+2);
 
-	left = pkt_len - (IEEE80211_3ADDR_LEN + ie_offset);
-	pos = pframe + (IEEE80211_3ADDR_LEN + ie_offset);
+	left = pkt_len - (sizeof(struct ieee80211_hdr_3addr) + ie_offset);
+	pos = pframe + (sizeof(struct ieee80211_hdr_3addr) + ie_offset);
 
 
 	DBG_871X("%s\n", __func__);
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index a353dc9b883a..c8e5251c2760 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -272,20 +272,6 @@ struct sta_data{
 	u64	tx_drops;
 };
 
-#define IEEE80211_DATA_LEN		2304
-/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
-   6.2.1.1.2.
-
-   The figure in section 7.1.2 suggests a body size of up to 2312
-   bytes is allowed, which is a bit confusing, I suspect this
-   represents the 2304 bytes of real data, plus a possible 8 bytes of
-   WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
-
-
-#define IEEE80211_HLEN			30
-#define IEEE80211_FRAME_LEN		(IEEE80211_DATA_LEN + IEEE80211_HLEN)
-
-
 /* this is stolen from ipw2200 driver */
 #define IEEE_IBSS_MAC_HASH_SIZE 31
 
@@ -313,8 +299,6 @@ enum eap_type {
 	EAPOL_ENCAP_ASF_ALERT
 };
 
-#define IEEE80211_3ADDR_LEN 24
-#define IEEE80211_4ADDR_LEN 30
 #define IEEE80211_FCS_LEN    4
 
 #define MIN_FRAG_THRESHOLD     256U
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 12/23] staging: rtl8723bs: Fix lines with trailing open parentheses.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (9 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 11/23] staging: rtl8723bs: Remove unnecessary length #define's Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 13/23] staging: rtl8723bs: Add spaces around ternary operators Quytelda Kahja
                         ` (10 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Realign the arguments for update_recvframe_attrib() and
update_recvframe_phyinfo() so there is no trailing open parenthesis.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index d9a4567ca721..0e30e984dc1f 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -29,9 +29,9 @@ static s32 initrecvbuf(struct recv_buf *precvbuf, struct adapter *padapter)
 	return _SUCCESS;
 }
 
-static void update_recvframe_attrib(
-	struct adapter *padapter, union recv_frame *precvframe, struct recv_stat *prxstat
-)
+static void update_recvframe_attrib(struct adapter *padapter,
+				    union recv_frame *precvframe,
+				    struct recv_stat *prxstat)
 {
 	struct rx_pkt_attrib *pattrib;
 	struct recv_stat report;
@@ -84,9 +84,8 @@ static void update_recvframe_attrib(
  *Before calling this function,
  *precvframe->u.hdr.rx_data should be ready!
  */
-static void update_recvframe_phyinfo(
-	union recv_frame *precvframe, struct phy_stat *pphy_status
-)
+static void update_recvframe_phyinfo(union recv_frame *precvframe,
+				     struct phy_stat *pphy_status)
 {
 	struct adapter *padapter = precvframe->u.hdr.adapter;
 	struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 13/23] staging: rtl8723bs: Add spaces around ternary operators.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (10 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 12/23] staging: rtl8723bs: Fix lines with trailing open parentheses Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 14/23] staging: rtl8723bs: Add missing braces in else statement Quytelda Kahja
                         ` (9 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

The Linux kernel coding style calls for spaces around binary and
ternary operators.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 0e30e984dc1f..9c2d6dd0130f 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -48,7 +48,7 @@ static void update_recvframe_attrib(struct adapter *padapter,
 	memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
 
 	/*  update rx report to recv_frame attribute */
-	pattrib->pkt_rpt_type = prxreport->c2h_ind?C2H_PACKET:NORMAL_RX;
+	pattrib->pkt_rpt_type = prxreport->c2h_ind ? C2H_PACKET : NORMAL_RX;
 /* 	DBG_871X("%s: pkt_rpt_type =%d\n", __func__, pattrib->pkt_rpt_type); */
 
 	if (pattrib->pkt_rpt_type == NORMAL_RX) {
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 14/23] staging: rtl8723bs: Add missing braces in else statement.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (11 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 13/23] staging: rtl8723bs: Add spaces around ternary operators Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 15/23] staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c' Quytelda Kahja
                         ` (8 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

The style rule to leave out braces in single line conditional statements
doesn't apply when one branch is multiple lines.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 9c2d6dd0130f..4ba315f1daaf 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -75,8 +75,9 @@ static void update_recvframe_attrib(struct adapter *padapter,
 		pattrib->mdata = (u8)prxreport->md;
 
 		pattrib->data_rate = (u8)prxreport->rx_rate;
-	} else
+	} else {
 		pattrib->pkt_len = (u16)prxreport->pktlen;
+	}
 }
 
 /*
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 15/23] staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c'.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (12 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 14/23] staging: rtl8723bs: Add missing braces in else statement Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 16/23] staging: rtl8723bs: Remove unnecessary blank lines " Quytelda Kahja
                         ` (7 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Linux kernel coding style dictates the use of snake case for variable
naming.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 32 +++++++++++++-------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 4ba315f1daaf..8afac615a42b 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -90,8 +90,8 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 {
 	struct adapter *padapter = precvframe->u.hdr.adapter;
 	struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
-	struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
-	PODM_PHY_INFO_T pPHYInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info);
+	struct hal_com_data *p_hal_data = GET_HAL_DATA(padapter);
+	PODM_PHY_INFO_T p_phy_info = (PODM_PHY_INFO_T)(&pattrib->phy_info);
 
 	u8 *wlanhdr;
 	ODM_PACKET_INFO_T pkt_info;
@@ -128,11 +128,11 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	pkt_info.DataRate = pattrib->data_rate;
 
 	/* rtl8723b_query_rx_phy_status(precvframe, pphy_status); */
-	/* spin_lock_bh(&pHalData->odm_stainfo_lock); */
-	ODM_PhyStatusQuery(&pHalData->odmpriv, pPHYInfo, (u8 *)pphy_status, &(pkt_info));
+	/* spin_lock_bh(&p_hal_data->odm_stainfo_lock); */
+	ODM_PhyStatusQuery(&p_hal_data->odmpriv, p_phy_info, (u8 *)pphy_status, &(pkt_info));
 	if (psta)
 		psta->rssi = pattrib->phy_info.RecvSignalPower;
-	/* spin_unlock_bh(&pHalData->odm_stainfo_lock); */
+	/* spin_unlock_bh(&p_hal_data->odm_stainfo_lock); */
 	precvframe->u.hdr.psta = NULL;
 	if (
 		pkt_info.bPacketMatchBSSID &&
@@ -152,7 +152,7 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 
 static void rtl8723bs_c2h_packet_handler(struct adapter *padapter, u8 *pbuf, u16 length)
 {
-	u8 *tmpBuf = NULL;
+	u8 *tmp = NULL;
 	u8 res = false;
 
 	if (length == 0)
@@ -160,16 +160,16 @@ static void rtl8723bs_c2h_packet_handler(struct adapter *padapter, u8 *pbuf, u16
 
 	/* DBG_871X("+%s() length =%d\n", __func__, length); */
 
-	tmpBuf = rtw_zmalloc(length);
-	if (tmpBuf == NULL)
+	tmp = rtw_zmalloc(length);
+	if (tmp == NULL)
 		return;
 
-	memcpy(tmpBuf, pbuf, length);
+	memcpy(tmp, pbuf, length);
 
-	res = rtw_c2h_packet_wk_cmd(padapter, tmpBuf, length);
+	res = rtw_c2h_packet_wk_cmd(padapter, tmp, length);
 
 	if (res == false)
-		kfree(tmpBuf);
+		kfree(tmp);
 
 	/* DBG_871X("-%s res(%d)\n", __func__, res); */
 
@@ -179,7 +179,7 @@ static void rtl8723bs_c2h_packet_handler(struct adapter *padapter, u8 *pbuf, u16
 static void rtl8723bs_recv_tasklet(void *priv)
 {
 	struct adapter *padapter;
-	struct hal_com_data *pHalData;
+	struct hal_com_data *p_hal_data;
 	struct recv_priv *precvpriv;
 	struct recv_buf *precvbuf;
 	union recv_frame *precvframe;
@@ -191,7 +191,7 @@ static void rtl8723bs_recv_tasklet(void *priv)
 
 
 	padapter = priv;
-	pHalData = GET_HAL_DATA(padapter);
+	p_hal_data = GET_HAL_DATA(padapter);
 	precvpriv = &padapter->recvpriv;
 
 	do {
@@ -219,7 +219,7 @@ static void rtl8723bs_recv_tasklet(void *priv)
 			pattrib = &precvframe->u.hdr.attrib;
 
 			/*  fix Hardware RX data error, drop whole recv_buffer */
-			if ((!(pHalData->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err) {
+			if ((!(p_hal_data->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err) {
 				DBG_8192C("%s()-%d: RX Warning! rx CRC ERROR !!\n", __func__, __LINE__);
 				rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
 				break;
@@ -300,14 +300,14 @@ static void rtl8723bs_recv_tasklet(void *priv)
 				recvframe_put(precvframe, skb_len);
 				/* recvframe_pull(precvframe, drvinfo_sz + RXDESC_SIZE); */
 
-				if (pHalData->ReceiveConfig & RCR_APPFCS)
+				if (p_hal_data->ReceiveConfig & RCR_APPFCS)
 					recvframe_pull_tail(precvframe, IEEE80211_FCS_LEN);
 
 				/*  move to drv info position */
 				ptr += RXDESC_SIZE;
 
 				/*  update drv info */
-				if (pHalData->ReceiveConfig & RCR_APP_BA_SSN) {
+				if (p_hal_data->ReceiveConfig & RCR_APP_BA_SSN) {
 					/* rtl8723s_update_bassn(padapter, pdrvinfo); */
 					ptr += 4;
 				}
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 16/23] staging: rtl8723bs: Remove unnecessary blank lines in 'rtl8723bs_recv.c'.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (13 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 15/23] staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c' Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 17/23] staging: rtl8723bs: Fix lines too long in update_recvframe_attrib() Quytelda Kahja
                         ` (6 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Condense multiple blank lines to one, and remove blank lines before
braces.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 8afac615a42b..3a2c14f53a1f 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -18,7 +18,6 @@
 #include <rtw_debug.h>
 #include <rtl8723b_hal.h>
 
-
 static s32 initrecvbuf(struct recv_buf *precvbuf, struct adapter *padapter)
 {
 	INIT_LIST_HEAD(&precvbuf->list);
@@ -104,7 +103,6 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	pkt_info.bPacketToSelf = false;
 	pkt_info.bPacketBeacon = false;
 
-
 	wlanhdr = get_recvframe_data(precvframe);
 
 	pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
@@ -189,7 +187,6 @@ static void rtl8723bs_recv_tasklet(void *priv)
 	_pkt *pkt_copy = NULL;
 	u8 shift_sz = 0, rx_report_sz = 0;
 
-
 	padapter = priv;
 	p_hal_data = GET_HAL_DATA(padapter);
 	precvpriv = &padapter->recvpriv;
@@ -337,7 +334,6 @@ static void rtl8723bs_recv_tasklet(void *priv)
 						rtl8723bs_c2h_packet_handler(padapter, precvframe->u.hdr.rx_data, pattrib->pkt_len);
 
 					rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
-
 				}
 			}
 
@@ -350,7 +346,6 @@ static void rtl8723bs_recv_tasklet(void *priv)
 
 		rtw_enqueue_recvbuf(precvbuf, &precvpriv->free_recv_buf_queue);
 	} while (1);
-
 }
 
 /*
@@ -366,7 +361,6 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
 	struct recv_priv *precvpriv;
 	struct recv_buf *precvbuf;
 
-
 	res = _SUCCESS;
 	precvpriv = &padapter->recvpriv;
 
@@ -463,7 +457,6 @@ void rtl8723bs_free_recv_priv(struct adapter *padapter)
 	struct recv_priv *precvpriv;
 	struct recv_buf *precvbuf;
 
-
 	precvpriv = &padapter->recvpriv;
 
 	/* 3 1. kill tasklet */
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 17/23] staging: rtl8723bs: Fix lines too long in update_recvframe_attrib().
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (14 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 16/23] staging: rtl8723bs: Remove unnecessary blank lines " Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 18/23] staging: rtl8723bs: Fix function signature that goes over 80 characters Quytelda Kahja
                         ` (5 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Fix lines over the 80 character limit in update_recvframe_attrib().

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 30 +++++++++++++++++++-------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 3a2c14f53a1f..a00d4e7ed70c 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -93,6 +93,11 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	PODM_PHY_INFO_T p_phy_info = (PODM_PHY_INFO_T)(&pattrib->phy_info);
 
 	u8 *wlanhdr;
+	u8 *my_bssid;
+	u8 *rx_bssid;
+	u8 *rx_ra;
+	u8 *my_hwaddr;
+
 	ODM_PACKET_INFO_T pkt_info;
 	u8 *sa = NULL;
 	/* _irqL		irqL; */
@@ -104,14 +109,20 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	pkt_info.bPacketBeacon = false;
 
 	wlanhdr = get_recvframe_data(precvframe);
-
+	my_bssid = get_bssid(&padapter->mlmepriv);
+	rx_bssid = get_hdr_bssid(wlanhdr);
 	pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
-		!pattrib->icv_err && !pattrib->crc_err &&
-		!memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN));
+				      !pattrib->icv_err && !pattrib->crc_err &&
+				      !ether_addr_equal(rx_bssid, my_bssid));
+
+	rx_ra = get_ra(wlanhdr);
+	my_hwaddr = myid(&padapter->eeprompriv);
+	pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
+		!ether_addr_equal(rx_ra, my_hwaddr);
 
-	pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && (!memcmp(get_ra(wlanhdr), myid(&padapter->eeprompriv), ETH_ALEN));
 
-	pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && (GetFrameSubType(wlanhdr) == WIFI_BEACON);
+	pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&
+		(GetFrameSubType(wlanhdr) == WIFI_BEACON);
 
 	sa = get_ta(wlanhdr);
 
@@ -121,13 +132,15 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	psta = rtw_get_stainfo(pstapriv, sa);
 	if (psta) {
 		pkt_info.StationID = psta->mac_id;
-		/* DBG_8192C("%s ==> StationID(%d)\n", __func__, pkt_info.StationID); */
+		/* DBG_8192C("%s ==> StationID(%d)\n",
+		 * 	  __func__, pkt_info.StationID); */
 	}
 	pkt_info.DataRate = pattrib->data_rate;
 
 	/* rtl8723b_query_rx_phy_status(precvframe, pphy_status); */
 	/* spin_lock_bh(&p_hal_data->odm_stainfo_lock); */
-	ODM_PhyStatusQuery(&p_hal_data->odmpriv, p_phy_info, (u8 *)pphy_status, &(pkt_info));
+	ODM_PhyStatusQuery(&p_hal_data->odmpriv, p_phy_info,
+			   (u8 *)pphy_status, &(pkt_info));
 	if (psta)
 		psta->rssi = pattrib->phy_info.RecvSignalPower;
 	/* spin_unlock_bh(&p_hal_data->odm_stainfo_lock); */
@@ -141,7 +154,8 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 			rtl8723b_process_phy_info(padapter, precvframe);
 		}
 	} else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon) {
-		if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == true)
+		u32 adhoc_state = WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE;
+		if (check_fwstate(&padapter->mlmepriv, adhoc_state))
 			if (psta)
 				precvframe->u.hdr.psta = psta;
 		rtl8723b_process_phy_info(padapter, precvframe);
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 18/23] staging: rtl8723bs: Fix function signature that goes over 80 characters.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (15 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 17/23] staging: rtl8723bs: Fix lines too long in update_recvframe_attrib() Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 19/23] staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections Quytelda Kahja
                         ` (4 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Wrap the function parameters for rtl8723bs_c2h_packet_handler() so
the function signature doesn't exceed 80 characters.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index a00d4e7ed70c..c4851a825fbb 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -162,7 +162,8 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	}
 }
 
-static void rtl8723bs_c2h_packet_handler(struct adapter *padapter, u8 *pbuf, u16 length)
+static void rtl8723bs_c2h_packet_handler(struct adapter *padapter,
+					 u8 *pbuf, u16 length)
 {
 	u8 *tmp = NULL;
 	u8 res = false;
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 19/23] staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (16 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 18/23] staging: rtl8723bs: Fix function signature that goes over 80 characters Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 20/23] staging: rtl8723bs: Replace NULL pointer comparison with '!' Quytelda Kahja
                         ` (3 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Factor out code from rtl8723bs_recv_tasklet() into helper methods
to unindent lines over 80 characters.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 95 +++++++++++++++++++-------
 1 file changed, 69 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index c4851a825fbb..038481655858 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -189,6 +189,55 @@ static void rtl8723bs_c2h_packet_handler(struct adapter *padapter,
 	return;
 }
 
+static inline union recv_frame *try_alloc_recvframe(struct recv_priv *precvpriv,
+						    struct recv_buf *precvbuf)
+{
+	union recv_frame *precvframe;
+
+	precvframe = rtw_alloc_recvframe(&precvpriv->free_recv_queue);
+	if (!precvframe) {
+		DBG_8192C("%s: no enough recv frame!\n", __func__);
+		rtw_enqueue_recvbuf_to_head(precvbuf,
+					    &precvpriv->recv_buf_pending_queue);
+
+		/*  The case of can't allocte recvframe should be temporary, */
+		/*  schedule again and hope recvframe is available next time. */
+		tasklet_schedule(&precvpriv->recv_tasklet);
+	}
+
+	return precvframe;
+}
+
+static inline bool rx_crc_err(struct recv_priv *precvpriv,
+			      struct hal_com_data *p_hal_data,
+			      struct rx_pkt_attrib *pattrib,
+			      union recv_frame *precvframe)
+{
+	/*  fix Hardware RX data error, drop whole recv_buffer */
+	if ((!(p_hal_data->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err) {
+		DBG_8192C("%s()-%d: RX Warning! rx CRC ERROR !!\n",
+			  __func__, __LINE__);
+		rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
+		return true;
+	}
+
+	return false;
+}
+
+static inline bool pkt_exceeds_tail(struct recv_priv *precvpriv,
+				    u8 *end, u8 *tail,
+				    union recv_frame *precvframe)
+{
+	if (end > tail) {
+		DBG_8192C("%s()-%d: : next pkt len(%p,%d) exceed ptail(%p)!\n",
+			  __func__, __LINE__, ptr, pkt_offset, precvbuf->ptail);
+		rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
+		return true;
+	}
+
+	return false;
+}
+
 static void rtl8723bs_recv_tasklet(void *priv)
 {
 	struct adapter *padapter;
@@ -197,6 +246,7 @@ static void rtl8723bs_recv_tasklet(void *priv)
 	struct recv_buf *precvbuf;
 	union recv_frame *precvframe;
 	struct rx_pkt_attrib *pattrib;
+	struct __queue *recv_buf_queue;
 	u8 *ptr;
 	u32 pkt_offset, skb_len, alloc_sz;
 	_pkt *pkt_copy = NULL;
@@ -205,52 +255,45 @@ static void rtl8723bs_recv_tasklet(void *priv)
 	padapter = priv;
 	p_hal_data = GET_HAL_DATA(padapter);
 	precvpriv = &padapter->recvpriv;
+	recv_buf_queue = &precvpriv->recv_buf_pending_queue;
 
 	do {
-		precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue);
+		precvbuf = rtw_dequeue_recvbuf(recv_buf_queue);
 		if (NULL == precvbuf)
 			break;
 
 		ptr = precvbuf->pdata;
 
 		while (ptr < precvbuf->ptail) {
-			precvframe = rtw_alloc_recvframe(&precvpriv->free_recv_queue);
-			if (precvframe == NULL) {
-				DBG_8192C("%s: no enough recv frame!\n", __func__);
-				rtw_enqueue_recvbuf_to_head(precvbuf, &precvpriv->recv_buf_pending_queue);
-
-				/*  The case of can't allocte recvframe should be temporary, */
-				/*  schedule again and hope recvframe is available next time. */
-				tasklet_schedule(&precvpriv->recv_tasklet);
+			precvframe = try_alloc_recvframe(precvpriv, precvbuf);
+			if(!precvframe)
 				return;
-			}
 
 			/* rx desc parsing */
-			update_recvframe_attrib(padapter, precvframe, (struct recv_stat *)ptr);
+			update_recvframe_attrib(padapter, precvframe,
+						(struct recv_stat *)ptr);
 
 			pattrib = &precvframe->u.hdr.attrib;
 
-			/*  fix Hardware RX data error, drop whole recv_buffer */
-			if ((!(p_hal_data->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err) {
-				DBG_8192C("%s()-%d: RX Warning! rx CRC ERROR !!\n", __func__, __LINE__);
-				rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
+			if(rx_crc_err(precvpriv, p_hal_data,
+				      pattrib, precvframe))
 				break;
-			}
 
 			rx_report_sz = RXDESC_SIZE + pattrib->drvinfo_sz;
-			pkt_offset = rx_report_sz + pattrib->shift_sz + pattrib->pkt_len;
+			pkt_offset = rx_report_sz +
+				pattrib->shift_sz +
+				pattrib->pkt_len;
 
-			if ((ptr + pkt_offset) > precvbuf->ptail) {
-				DBG_8192C("%s()-%d: : next pkt len(%p,%d) exceed ptail(%p)!\n", __func__, __LINE__, ptr, pkt_offset, precvbuf->ptail);
-				rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
+			if(pkt_exceeds_tail(precvpriv, ptr + pkt_offset,
+					    precvbuf->ptail, precvframe))
 				break;
-			}
 
 			if ((pattrib->crc_err) || (pattrib->icv_err)) {
-				{
-					DBG_8192C("%s: crc_err =%d icv_err =%d, skip!\n", __func__, pattrib->crc_err, pattrib->icv_err);
-				}
-				rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
+				DBG_8192C("%s: crc_err =%d icv_err =%d, skip!\n",
+					  __func__, pattrib->crc_err,
+					  pattrib->icv_err);
+				rtw_free_recvframe(precvframe,
+						   &precvpriv->free_recv_queue);
 			} else {
 				/* 	Modified by Albert 20101213 */
 				/* 	For 8 bytes IP header alignment. */
@@ -301,7 +344,7 @@ static void rtl8723bs_recv_tasklet(void *priv)
 						skb_reset_tail_pointer(pkt_clone);
 						precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail
 							= pkt_clone->data;
-						precvframe->u.hdr.rx_end =	pkt_clone->data + skb_len;
+						precvframe->u.hdr.rx_end = pkt_clone->data + skb_len;
 					} else {
 						DBG_8192C("%s: rtw_skb_clone fail\n", __func__);
 						rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 20/23] staging: rtl8723bs: Replace NULL pointer comparison with '!'.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (17 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 19/23] staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 21/23] staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style Quytelda Kahja
                         ` (2 subsequent siblings)
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Replace the comparison of 'precvbuf' to 'NULL' with '!precvbuf'.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 038481655858..7a294102b63b 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -259,7 +259,7 @@ static void rtl8723bs_recv_tasklet(void *priv)
 
 	do {
 		precvbuf = rtw_dequeue_recvbuf(recv_buf_queue);
-		if (NULL == precvbuf)
+		if (!precvbuf)
 			break;
 
 		ptr = precvbuf->pdata;
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 21/23] staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (18 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 20/23] staging: rtl8723bs: Replace NULL pointer comparison with '!' Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 22/23] staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' " Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 23/23] staging: rtl8723bs: Remove unecessary newlines from 'odm.h' Quytelda Kahja
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Change the typedef'd 'struct _ODM_Per_Pkt_Info_' into
'struct odm_packet_info' and change the members to snake case in
order to meet the coding style guidelines.
Members:
* u8 DataRate            -> data_rate
* u8 StationID           -> station_id
* bool bPacketMatchBSSID -> bssid_match
* bool bPacketToSelf     -> to_self
* bool bPacketBeacon     -> is_beacon
* bool bToSelf           -> (removed because it isn't used)

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/odm.h             | 16 +++++------
 drivers/staging/rtl8723bs/hal/odm_CfoTracking.c |  4 +--
 drivers/staging/rtl8723bs/hal/odm_HWConfig.c    | 26 ++++++++---------
 drivers/staging/rtl8723bs/hal/odm_HWConfig.h    |  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c  | 37 +++++++++++++------------
 5 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index 87a76bafecb3..7c13a9314a22 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -262,15 +262,13 @@ typedef struct _ODM_Phy_Status_Info_ {
 } ODM_PHY_INFO_T, *PODM_PHY_INFO_T;
 
 
-typedef struct _ODM_Per_Pkt_Info_ {
-	/* u8 Rate; */
-	u8 DataRate;
-	u8 StationID;
-	bool bPacketMatchBSSID;
-	bool bPacketToSelf;
-	bool bPacketBeacon;
-	bool bToSelf;
-} ODM_PACKET_INFO_T, *PODM_PACKET_INFO_T;
+struct odm_packet_info {
+	u8 data_rate;
+	u8 station_id;
+	bool bssid_match;
+	bool to_self;
+	bool is_beacon;
+};
 
 
 typedef struct _ODM_Phy_Dbg_Info_ {
diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
index 71853e6f7106..178aaab3f76c 100644
--- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
+++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
@@ -316,14 +316,14 @@ void ODM_CfoTracking(void *pDM_VOID)
 void ODM_ParsingCFO(void *pDM_VOID, void *pPktinfo_VOID, s8 *pcfotail)
 {
 	PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
-	PODM_PACKET_INFO_T pPktinfo = (PODM_PACKET_INFO_T)pPktinfo_VOID;
+	struct odm_packet_info *pPktinfo = (struct odm_packet_info *)pPktinfo_VOID;
 	PCFO_TRACKING pCfoTrack = &pDM_Odm->DM_CfoTrack;
 	u8 i;
 
 	if (!(pDM_Odm->SupportAbility & ODM_BB_CFO_TRACKING))
 		return;
 
-	if (pPktinfo->StationID != 0) {
+	if (pPktinfo->station_id != 0) {
 		/* 3 Update CFO report for path-A & path-B */
 		/*  Only paht-A and path-B have CFO tail and short CFO */
 		for (i = ODM_RF_PATH_A; i <= ODM_RF_PATH_B; i++)
diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
index 8dd6da8a4e26..b3f4c237e903 100644
--- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
@@ -93,7 +93,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 	PDM_ODM_T pDM_Odm,
 	PODM_PHY_INFO_T pPhyInfo,
 	u8 *pPhyStatus,
-	PODM_PACKET_INFO_T pPktinfo
+	struct odm_packet_info *pPktinfo
 )
 {
 	u8 i, Max_spatial_stream;
@@ -106,7 +106,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 	u8 LNA_idx, VGA_idx;
 	PPHY_STATUS_RPT_8192CD_T pPhyStaRpt = (PPHY_STATUS_RPT_8192CD_T)pPhyStatus;
 
-	isCCKrate = pPktinfo->DataRate <= DESC_RATE11M;
+	isCCKrate = pPktinfo->data_rate <= DESC_RATE11M;
 	pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1;
 	pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
 
@@ -215,7 +215,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 			/*  */
 			/*  (3)EVM of HT rate */
 			/*  */
-			if (pPktinfo->DataRate >= DESC_RATEMCS8 && pPktinfo->DataRate <= DESC_RATEMCS15)
+			if (pPktinfo->data_rate >= DESC_RATEMCS8 && pPktinfo->data_rate <= DESC_RATEMCS15)
 				Max_spatial_stream = 2; /* both spatial stream make sense */
 			else
 				Max_spatial_stream = 1; /* only spatial stream 1 makes sense */
@@ -267,7 +267,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 }
 
 static void odm_Process_RSSIForDM(
-	PDM_ODM_T pDM_Odm, PODM_PHY_INFO_T pPhyInfo, PODM_PACKET_INFO_T pPktinfo
+	PDM_ODM_T pDM_Odm, PODM_PHY_INFO_T pPhyInfo, struct odm_packet_info *pPktinfo
 )
 {
 
@@ -279,22 +279,22 @@ static void odm_Process_RSSIForDM(
 	PSTA_INFO_T pEntry;
 
 
-	if (pPktinfo->StationID == 0xFF)
+	if (pPktinfo->station_id == 0xFF)
 		return;
 
-	pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->StationID];
+	pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->station_id];
 
 	if (!IS_STA_VALID(pEntry))
 		return;
 
-	if ((!pPktinfo->bPacketMatchBSSID))
+	if ((!pPktinfo->bssid_match))
 		return;
 
-	if (pPktinfo->bPacketBeacon)
+	if (pPktinfo->is_beacon)
 		pDM_Odm->PhyDbgInfo.NumQryBeaconPkt++;
 
-	isCCKrate = ((pPktinfo->DataRate <= DESC_RATE11M)) ? true : false;
-	pDM_Odm->RxRate = pPktinfo->DataRate;
+	isCCKrate = ((pPktinfo->data_rate <= DESC_RATE11M)) ? true : false;
+	pDM_Odm->RxRate = pPktinfo->data_rate;
 
 	/* Statistic for antenna/path diversity------------------ */
 	if (pDM_Odm->SupportAbility & ODM_BB_ANT_DIV) {
@@ -307,7 +307,7 @@ static void odm_Process_RSSIForDM(
 	UndecoratedSmoothedOFDM = pEntry->rssi_stat.UndecoratedSmoothedOFDM;
 	UndecoratedSmoothedPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB;
 
-	if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) {
+	if (pPktinfo->to_self || pPktinfo->is_beacon) {
 
 		if (!isCCKrate) { /* ofdm rate */
 			if (pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B] == 0) {
@@ -424,7 +424,7 @@ static void ODM_PhyStatusQuery_92CSeries(
 	PDM_ODM_T pDM_Odm,
 	PODM_PHY_INFO_T pPhyInfo,
 	u8 *pPhyStatus,
-	PODM_PACKET_INFO_T pPktinfo
+	struct odm_packet_info *pPktinfo
 )
 {
 
@@ -438,7 +438,7 @@ void ODM_PhyStatusQuery(
 	PDM_ODM_T pDM_Odm,
 	PODM_PHY_INFO_T pPhyInfo,
 	u8 *pPhyStatus,
-	PODM_PACKET_INFO_T pPktinfo
+	struct odm_packet_info *pPktinfo
 )
 {
 
diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.h b/drivers/staging/rtl8723bs/hal/odm_HWConfig.h
index f029922d12f0..ff0373eba495 100644
--- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.h
+++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.h
@@ -133,7 +133,7 @@ void ODM_PhyStatusQuery(
 	PDM_ODM_T pDM_Odm,
 	PODM_PHY_INFO_T pPhyInfo,
 	u8 *pPhyStatus,
-	PODM_PACKET_INFO_T pPktinfo
+	struct odm_packet_info *pPktinfo
 );
 
 HAL_STATUS ODM_ConfigRFWithTxPwrTrackHeaderFile(PDM_ODM_T pDM_Odm);
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 7a294102b63b..6280a2e21dc2 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -97,45 +97,48 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	u8 *rx_bssid;
 	u8 *rx_ra;
 	u8 *my_hwaddr;
-
-	ODM_PACKET_INFO_T pkt_info;
 	u8 *sa = NULL;
+
+	struct odm_packet_info pkt_info = {
+		.data_rate   = 0x00,
+		.station_id  = 0x00,
+		.bssid_match = false,
+		.to_self     = false,
+		.is_beacon   = false,
+	};
+
 	/* _irqL		irqL; */
 	struct sta_priv *pstapriv;
 	struct sta_info *psta;
 
-	pkt_info.bPacketMatchBSSID = false;
-	pkt_info.bPacketToSelf = false;
-	pkt_info.bPacketBeacon = false;
-
 	wlanhdr = get_recvframe_data(precvframe);
 	my_bssid = get_bssid(&padapter->mlmepriv);
 	rx_bssid = get_hdr_bssid(wlanhdr);
-	pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
-				      !pattrib->icv_err && !pattrib->crc_err &&
-				      !ether_addr_equal(rx_bssid, my_bssid));
+	pkt_info.bssid_match = ((!IsFrameTypeCtrl(wlanhdr)) &&
+				!pattrib->icv_err && !pattrib->crc_err &&
+				!ether_addr_equal(rx_bssid, my_bssid));
 
 	rx_ra = get_ra(wlanhdr);
 	my_hwaddr = myid(&padapter->eeprompriv);
-	pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
+	pkt_info.to_self = pkt_info.bssid_match &&
 		!ether_addr_equal(rx_ra, my_hwaddr);
 
 
-	pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID &&
+	pkt_info.is_beacon = pkt_info.bssid_match &&
 		(GetFrameSubType(wlanhdr) == WIFI_BEACON);
 
 	sa = get_ta(wlanhdr);
 
-	pkt_info.StationID = 0xFF;
+	pkt_info.station_id = 0xFF;
 
 	pstapriv = &padapter->stapriv;
 	psta = rtw_get_stainfo(pstapriv, sa);
 	if (psta) {
-		pkt_info.StationID = psta->mac_id;
+		pkt_info.station_id = psta->mac_id;
 		/* DBG_8192C("%s ==> StationID(%d)\n",
-		 * 	  __func__, pkt_info.StationID); */
+		 * 	  __func__, pkt_info.station_id); */
 	}
-	pkt_info.DataRate = pattrib->data_rate;
+	pkt_info.data_rate = pattrib->data_rate;
 
 	/* rtl8723b_query_rx_phy_status(precvframe, pphy_status); */
 	/* spin_lock_bh(&p_hal_data->odm_stainfo_lock); */
@@ -146,14 +149,14 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	/* spin_unlock_bh(&p_hal_data->odm_stainfo_lock); */
 	precvframe->u.hdr.psta = NULL;
 	if (
-		pkt_info.bPacketMatchBSSID &&
+		pkt_info.bssid_match &&
 		(check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)
 	) {
 		if (psta) {
 			precvframe->u.hdr.psta = psta;
 			rtl8723b_process_phy_info(padapter, precvframe);
 		}
-	} else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon) {
+	} else if (pkt_info.to_self || pkt_info.is_beacon) {
 		u32 adhoc_state = WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE;
 		if (check_fwstate(&padapter->mlmepriv, adhoc_state))
 			if (psta)
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 22/23] staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' coding style.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (19 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 21/23] staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  2018-03-27  8:41       ` [PATCH 23/23] staging: rtl8723bs: Remove unecessary newlines from 'odm.h' Quytelda Kahja
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Change the typedef'd 'struct _ODM_Phy_Status_Info_' into
'struct odm_phy_info' and change the members to snake case in
order to meet the coding style guidelines.
Members:
* u8 RxPWDBAll            -> rx_pwd_ba11
* u8 SignalQuality        -> signal_quality
* s8 RxMIMOSignalQuality  -> rx_mimo_signal_quality
* u8 RxMIMOEVMdbm         -> rx_mimo_evm_dbm
* u8 RxMIMOSignalStrength -> rx_mimo_signal_strength
* u16 Cfo_short           -> cfo_short
* u16 Cfo_tail            -> cfo_tail
* s8 RxPower              -> rx_power
* s8 RecvSignalPower      -> recv_signal_power
* u8 BTRxRSSIPercentage   -> bt_rx_rssi_percentage
* u8 SignalStrength       -> signal_strength
* s8 RxPwr                -> rx_pwr
* u8 RxSNR                -> rx_snr
* u8 BandWidth            => band_width
* u8 btCoexPwrAdjust      -> bt_coex_pwr_adjust

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/hal_com.c        | 10 +--
 drivers/staging/rtl8723bs/hal/odm.h            | 49 +++++++------
 drivers/staging/rtl8723bs/hal/odm_HWConfig.c   | 98 +++++++++++++-------------
 drivers/staging/rtl8723bs/hal/odm_HWConfig.h   |  2 +-
 drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c |  3 +-
 drivers/staging/rtl8723bs/include/rtw_mlme.h   |  2 +-
 drivers/staging/rtl8723bs/include/rtw_recv.h   | 10 +--
 7 files changed, 90 insertions(+), 84 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index dec887a5b338..1cef1d77977c 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -1680,18 +1680,18 @@ void rtw_store_phy_info(struct adapter *padapter, union recv_frame *prframe)
 	struct hal_com_data *pHalData =  GET_HAL_DATA(padapter);
 	struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
 
-	PODM_PHY_INFO_T pPhyInfo  = (PODM_PHY_INFO_T)(&pattrib->phy_info);
+	struct odm_phy_info *pPhyInfo  = (PODM_PHY_INFO_T)(&pattrib->phy_info);
 	struct rx_raw_rssi *psample_pkt_rssi = &padapter->recvpriv.raw_rssi_info;
 
 	psample_pkt_rssi->data_rate = pattrib->data_rate;
 	isCCKrate = pattrib->data_rate <= DESC_RATE11M;
 
-	psample_pkt_rssi->pwdball = pPhyInfo->RxPWDBAll;
-	psample_pkt_rssi->pwr_all = pPhyInfo->RecvSignalPower;
+	psample_pkt_rssi->pwdball = pPhyInfo->rx_pwd_ba11;
+	psample_pkt_rssi->pwr_all = pPhyInfo->recv_signal_power;
 
 	for (rf_path = 0; rf_path < pHalData->NumTotalRFPath; rf_path++) {
-		psample_pkt_rssi->mimo_singal_strength[rf_path] = pPhyInfo->RxMIMOSignalStrength[rf_path];
-		psample_pkt_rssi->mimo_singal_quality[rf_path] = pPhyInfo->RxMIMOSignalQuality[rf_path];
+		psample_pkt_rssi->mimo_singal_strength[rf_path] = pPhyInfo->rx_mimo_signal_strength[rf_path];
+		psample_pkt_rssi->mimo_singal_quality[rf_path] = pPhyInfo->rx_mimo_signal_quality[rf_path];
 		if (!isCCKrate) {
 			psample_pkt_rssi->ofdm_pwr[rf_path] = pPhyInfo->RxPwr[rf_path];
 			psample_pkt_rssi->ofdm_snr[rf_path] = pPhyInfo->RxSNR[rf_path];
diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index 7c13a9314a22..175c77b11bf9 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -233,33 +233,38 @@ typedef struct _ODM_RATE_ADAPTIVE {
 #define IQK_THRESHOLD			8
 #define DPK_THRESHOLD			4
 
-typedef struct _ODM_Phy_Status_Info_ {
-	/*  */
-	/*  Be care, if you want to add any element please insert between */
-	/*  RxPWDBAll & SignalStrength. */
-	/*  */
-	u8 RxPWDBAll;
+struct odm_phy_info {
+	/*
+	 *  Be care, if you want to add any element, please insert it between
+	 *  rx_pwd_ball and signal_strength.
+	 */
+	u8 rx_pwd_ba11;
 
-	u8 SignalQuality;			/*  in 0-100 index. */
-	s8 RxMIMOSignalQuality[4];	/* per-path's EVM */
-	u8 RxMIMOEVMdbm[4];		/* per-path's EVM dbm */
+	u8 signal_quality;             /* in 0-100 index. */
+	s8 rx_mimo_signal_quality[4];  /* per-path's EVM */
+	u8 rx_mimo_evm_dbm[4];         /* per-path's EVM dbm */
 
-	u8 RxMIMOSignalStrength[4];/*  in 0~100 index */
+	u8 rx_mimo_signal_strength[4]; /* in 0~100 index */
 
-	u16 Cfo_short[4];			/*  per-path's Cfo_short */
-	u16 Cfo_tail[4];			/*  per-path's Cfo_tail */
+	u16 cfo_short[4];              /* per-path's Cfo_short */
+	u16 cfo_tail[4];               /* per-path's Cfo_tail */
 
-	s8 RxPower;				/*  in dBm Translate from PWdB */
-	s8 RecvSignalPower;		/*  Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
-	u8 BTRxRSSIPercentage;
-	u8 SignalStrength;			/*  in 0-100 index. */
+	s8 rx_power;                   /* in dBm Translate from PWdB */
 
-	s8 RxPwr[4];				/* per-path's pwdb */
+	/*
+	 * Real power in dBm for this packet, no beautification and
+	 * aggregation. Keep this raw info to be used for the other procedures.
+	 */
+	s8 recv_signal_power;
+	u8 bt_rx_rssi_percentage;
+	u8 signal_strength;	       /* in 0-100 index. */
 
-	u8 RxSNR[4];				/* per-path's SNR */
-	u8 BandWidth;
-	u8 btCoexPwrAdjust;
-} ODM_PHY_INFO_T, *PODM_PHY_INFO_T;
+	s8 rx_pwr[4];                  /* per-path's pwdb */
+
+	u8 rx_snr[4];                  /* per-path's SNR */
+	u8 band_width;
+	u8 bt_coex_pwr_adjust;
+};
 
 
 struct odm_packet_info {
@@ -1415,7 +1420,7 @@ bool ODM_RAStateCheck(
 void ODM_SwAntDivChkPerPktRssi(
 	PDM_ODM_T pDM_Odm,
 	u8 StationID,
-	PODM_PHY_INFO_T pPhyInfo
+	struct odm_phy_info *pPhyInfo
 );
 
 u32 ODM_Get_Rate_Bitmap(
diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
index b3f4c237e903..9e161f080c57 100644
--- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c
@@ -91,7 +91,7 @@ static u8 odm_EVMdbToPercentage(s8 Value)
 
 static void odm_RxPhyStatus92CSeries_Parsing(
 	PDM_ODM_T pDM_Odm,
-	PODM_PHY_INFO_T pPhyInfo,
+	struct odm_phy_info *pPhyInfo,
 	u8 *pPhyStatus,
 	struct odm_packet_info *pPktinfo
 )
@@ -107,8 +107,8 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 	PPHY_STATUS_RPT_8192CD_T pPhyStaRpt = (PPHY_STATUS_RPT_8192CD_T)pPhyStatus;
 
 	isCCKrate = pPktinfo->data_rate <= DESC_RATE11M;
-	pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = -1;
-	pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
+	pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_A] = -1;
+	pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_B] = -1;
 
 
 	if (isCCKrate) {
@@ -137,9 +137,9 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 		if (PWDB_ALL > 100)
 			PWDB_ALL = 100;
 
-		pPhyInfo->RxPWDBAll = PWDB_ALL;
-		pPhyInfo->BTRxRSSIPercentage = PWDB_ALL;
-		pPhyInfo->RecvSignalPower = rx_pwr_all;
+		pPhyInfo->rx_pwd_ba11 = PWDB_ALL;
+		pPhyInfo->bt_rx_rssi_percentage = PWDB_ALL;
+		pPhyInfo->recv_signal_power = rx_pwr_all;
 		/*  */
 		/*  (3) Get Signal Quality (EVM) */
 		/*  */
@@ -147,7 +147,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 		{
 			u8 SQ, SQ_rpt;
 
-			if (pPhyInfo->RxPWDBAll > 40 && !pDM_Odm->bInHctTest)
+			if (pPhyInfo->rx_pwd_ba11 > 40 && !pDM_Odm->bInHctTest)
 				SQ = 100;
 			else {
 				SQ_rpt = pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all;
@@ -162,9 +162,9 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 			}
 
 			/* DbgPrint("cck SQ = %d\n", SQ); */
-			pPhyInfo->SignalQuality = SQ;
-			pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_A] = SQ;
-			pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
+			pPhyInfo->signal_quality = SQ;
+			pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_A] = SQ;
+			pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_B] = -1;
 		}
 	} else { /* is OFDM rate */
 		pDM_Odm->PhyDbgInfo.NumQryPhyStatusOFDM++;
@@ -183,17 +183,17 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 			rx_pwr[i] = ((pPhyStaRpt->path_agc[i].gain&0x3F)*2) - 110;
 
 
-			pPhyInfo->RxPwr[i] = rx_pwr[i];
+			pPhyInfo->rx_pwr[i] = rx_pwr[i];
 
 			/* Translate DBM to percentage. */
 			RSSI = odm_QueryRxPwrPercentage(rx_pwr[i]);
 			total_rssi += RSSI;
 			/* RT_DISP(FRX, RX_PHY_SS, ("RF-%d RXPWR =%x RSSI =%d\n", i, rx_pwr[i], RSSI)); */
 
-			pPhyInfo->RxMIMOSignalStrength[i] = (u8) RSSI;
+			pPhyInfo->rx_mimo_signal_strength[i] = (u8) RSSI;
 
 			/* Get Rx snr value in DB */
-			pPhyInfo->RxSNR[i] = pDM_Odm->PhyDbgInfo.RxSNRdB[i] = (s32)(pPhyStaRpt->path_rxsnr[i]/2);
+			pPhyInfo->rx_snr[i] = pDM_Odm->PhyDbgInfo.RxSNRdB[i] = (s32)(pPhyStaRpt->path_rxsnr[i]/2);
 		}
 
 
@@ -205,11 +205,11 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 		PWDB_ALL_BT = PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
 		/* RT_DISP(FRX, RX_PHY_SS, ("PWDB_ALL =%d\n", PWDB_ALL)); */
 
-		pPhyInfo->RxPWDBAll = PWDB_ALL;
-		/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("ODM OFDM RSSI =%d\n", pPhyInfo->RxPWDBAll)); */
-		pPhyInfo->BTRxRSSIPercentage = PWDB_ALL_BT;
-		pPhyInfo->RxPower = rx_pwr_all;
-		pPhyInfo->RecvSignalPower = rx_pwr_all;
+		pPhyInfo->rx_pwd_ba11 = PWDB_ALL;
+		/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("ODM OFDM RSSI =%d\n", pPhyInfo->rx_pwd_ba11)); */
+		pPhyInfo->bt_rx_rssi_percentage = PWDB_ALL_BT;
+		pPhyInfo->rx_power = rx_pwr_all;
+		pPhyInfo->recv_signal_power = rx_pwr_all;
 
 		{/* pMgntInfo->CustomerID != RT_CID_819x_Lenovo */
 			/*  */
@@ -232,9 +232,9 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 				/* if (pPktinfo->bPacketMatchBSSID) */
 				{
 					if (i == ODM_RF_PATH_A) /*  Fill value in RFD, Get the first spatial stream only */
-						pPhyInfo->SignalQuality = (u8)(EVM & 0xff);
+						pPhyInfo->signal_quality = (u8)(EVM & 0xff);
 
-					pPhyInfo->RxMIMOSignalQuality[i] = (u8)(EVM & 0xff);
+					pPhyInfo->rx_mimo_signal_quality[i] = (u8)(EVM & 0xff);
 				}
 			}
 		}
@@ -249,25 +249,25 @@ static void odm_RxPhyStatus92CSeries_Parsing(
 #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING
 		pPhyInfo->SignalStrength = (u8)PWDB_ALL;
 #else
-		pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(pDM_Odm, PWDB_ALL));/* PWDB_ALL; */
+		pPhyInfo->signal_strength = (u8)(odm_SignalScaleMapping(pDM_Odm, PWDB_ALL));/* PWDB_ALL; */
 #endif
 	} else {
 		if (rf_rx_num != 0) {
 #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING
 			total_rssi /= rf_rx_num;
-			pPhyInfo->SignalStrength = (u8)total_rssi;
+			pPhyInfo->signal_strength = (u8)total_rssi;
 #else
-			pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(pDM_Odm, total_rssi /= rf_rx_num));
+			pPhyInfo->signal_strength = (u8)(odm_SignalScaleMapping(pDM_Odm, total_rssi /= rf_rx_num));
 #endif
 		}
 	}
 
-	/* DbgPrint("isCCKrate = %d, pPhyInfo->RxPWDBAll = %d, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a = 0x%x\n", */
-		/* isCCKrate, pPhyInfo->RxPWDBAll, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a); */
+	/* DbgPrint("isCCKrate = %d, pPhyInfo->rx_pwd_ba11 = %d, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a = 0x%x\n", */
+		/* isCCKrate, pPhyInfo->rx_pwd_ba11, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a); */
 }
 
 static void odm_Process_RSSIForDM(
-	PDM_ODM_T pDM_Odm, PODM_PHY_INFO_T pPhyInfo, struct odm_packet_info *pPktinfo
+	PDM_ODM_T pDM_Odm, struct odm_phy_info *pPhyInfo, struct odm_packet_info *pPktinfo
 )
 {
 
@@ -310,25 +310,25 @@ static void odm_Process_RSSIForDM(
 	if (pPktinfo->to_self || pPktinfo->is_beacon) {
 
 		if (!isCCKrate) { /* ofdm rate */
-			if (pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B] == 0) {
-				RSSI_Ave = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
-				pDM_Odm->RSSI_A = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
+			if (pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B] == 0) {
+				RSSI_Ave = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A];
+				pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A];
 				pDM_Odm->RSSI_B = 0;
 			} else {
-				/* DbgPrint("pRfd->Status.RxMIMOSignalStrength[0] = %d, pRfd->Status.RxMIMOSignalStrength[1] = %d\n", */
-					/* pRfd->Status.RxMIMOSignalStrength[0], pRfd->Status.RxMIMOSignalStrength[1]); */
-				pDM_Odm->RSSI_A =  pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
-				pDM_Odm->RSSI_B = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B];
+				/* DbgPrint("pRfd->Status.rx_mimo_signal_strength[0] = %d, pRfd->Status.rx_mimo_signal_strength[1] = %d\n", */
+					/* pRfd->Status.rx_mimo_signal_strength[0], pRfd->Status.rx_mimo_signal_strength[1]); */
+				pDM_Odm->RSSI_A =  pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A];
+				pDM_Odm->RSSI_B = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B];
 
 				if (
-					pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A] >
-					pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B]
+					pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A] >
+					pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B]
 				) {
-					RSSI_max = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
-					RSSI_min = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B];
+					RSSI_max = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A];
+					RSSI_min = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B];
 				} else {
-					RSSI_max = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B];
-					RSSI_min = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
+					RSSI_max = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B];
+					RSSI_min = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A];
 				}
 
 				if ((RSSI_max-RSSI_min) < 3)
@@ -343,9 +343,9 @@ static void odm_Process_RSSIForDM(
 
 			/* 1 Process OFDM RSSI */
 			if (UndecoratedSmoothedOFDM <= 0)	/*  initialize */
-				UndecoratedSmoothedOFDM = pPhyInfo->RxPWDBAll;
+				UndecoratedSmoothedOFDM = pPhyInfo->rx_pwd_ba11;
 			else {
-				if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedOFDM) {
+				if (pPhyInfo->rx_pwd_ba11 > (u32)UndecoratedSmoothedOFDM) {
 					UndecoratedSmoothedOFDM =
 							((UndecoratedSmoothedOFDM*(Rx_Smooth_Factor-1)) +
 							RSSI_Ave)/Rx_Smooth_Factor;
@@ -360,23 +360,23 @@ static void odm_Process_RSSIForDM(
 			pEntry->rssi_stat.PacketMap = (pEntry->rssi_stat.PacketMap<<1) | BIT0;
 
 		} else {
-			RSSI_Ave = pPhyInfo->RxPWDBAll;
-			pDM_Odm->RSSI_A = (u8) pPhyInfo->RxPWDBAll;
+			RSSI_Ave = pPhyInfo->rx_pwd_ba11;
+			pDM_Odm->RSSI_A = (u8) pPhyInfo->rx_pwd_ba11;
 			pDM_Odm->RSSI_B = 0;
 
 			/* 1 Process CCK RSSI */
 			if (UndecoratedSmoothedCCK <= 0)	/*  initialize */
-				UndecoratedSmoothedCCK = pPhyInfo->RxPWDBAll;
+				UndecoratedSmoothedCCK = pPhyInfo->rx_pwd_ba11;
 			else {
-				if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedCCK) {
+				if (pPhyInfo->rx_pwd_ba11 > (u32)UndecoratedSmoothedCCK) {
 					UndecoratedSmoothedCCK =
 							((UndecoratedSmoothedCCK*(Rx_Smooth_Factor-1)) +
-							pPhyInfo->RxPWDBAll)/Rx_Smooth_Factor;
+							pPhyInfo->rx_pwd_ba11)/Rx_Smooth_Factor;
 					UndecoratedSmoothedCCK = UndecoratedSmoothedCCK + 1;
 				} else {
 					UndecoratedSmoothedCCK =
 							((UndecoratedSmoothedCCK*(Rx_Smooth_Factor-1)) +
-							pPhyInfo->RxPWDBAll)/Rx_Smooth_Factor;
+							pPhyInfo->rx_pwd_ba11)/Rx_Smooth_Factor;
 				}
 			}
 			pEntry->rssi_stat.PacketMap = pEntry->rssi_stat.PacketMap<<1;
@@ -422,7 +422,7 @@ static void odm_Process_RSSIForDM(
 /*  */
 static void ODM_PhyStatusQuery_92CSeries(
 	PDM_ODM_T pDM_Odm,
-	PODM_PHY_INFO_T pPhyInfo,
+	struct odm_phy_info *pPhyInfo,
 	u8 *pPhyStatus,
 	struct odm_packet_info *pPktinfo
 )
@@ -436,7 +436,7 @@ static void ODM_PhyStatusQuery_92CSeries(
 
 void ODM_PhyStatusQuery(
 	PDM_ODM_T pDM_Odm,
-	PODM_PHY_INFO_T pPhyInfo,
+	struct odm_phy_info *pPhyInfo,
 	u8 *pPhyStatus,
 	struct odm_packet_info *pPktinfo
 )
diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.h b/drivers/staging/rtl8723bs/hal/odm_HWConfig.h
index ff0373eba495..fdb4f8579ff9 100644
--- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.h
+++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.h
@@ -131,7 +131,7 @@ typedef struct _Phy_Status_Rpt_8812 {
 
 void ODM_PhyStatusQuery(
 	PDM_ODM_T pDM_Odm,
-	PODM_PHY_INFO_T pPhyInfo,
+	struct odm_phy_info *pPhyInfo,
 	u8 *pPhyStatus,
 	struct odm_packet_info *pPktinfo
 );
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 6280a2e21dc2..5d5cd4d01156 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -90,7 +90,8 @@ static void update_recvframe_phyinfo(union recv_frame *precvframe,
 	struct adapter *padapter = precvframe->u.hdr.adapter;
 	struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
 	struct hal_com_data *p_hal_data = GET_HAL_DATA(padapter);
-	PODM_PHY_INFO_T p_phy_info = (PODM_PHY_INFO_T)(&pattrib->phy_info);
+	struct odm_phy_info *p_phy_info =
+		(struct odm_phy_info *)(&pattrib->phy_info);
 
 	u8 *wlanhdr;
 	u8 *my_bssid;
diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme.h b/drivers/staging/rtl8723bs/include/rtw_mlme.h
index 00b3d92c9f51..2e4f12b54929 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme.h
@@ -299,7 +299,7 @@ struct wifidirect_info{
 
 struct tdls_ss_record{	/* signal strength record */
 	u8 macaddr[ETH_ALEN];
-	u8 RxPWDBAll;
+	u8 rx_pwd_ba11;
 	u8 is_tdls_sta;	/*  true: direct link sta, false: else */
 };
 
diff --git a/drivers/staging/rtl8723bs/include/rtw_recv.h b/drivers/staging/rtl8723bs/include/rtw_recv.h
index 71039ca79e4b..d4986f5685c5 100644
--- a/drivers/staging/rtl8723bs/include/rtw_recv.h
+++ b/drivers/staging/rtl8723bs/include/rtw_recv.h
@@ -99,20 +99,20 @@ struct signal_stat {
 };
 
 struct phy_info {
-	u8 RxPWDBAll;
+	u8 rx_pwd_ba11;
 
 	u8 SignalQuality;	 /*  in 0-100 index. */
-	s8		RxMIMOSignalQuality[4];	/* per-path's EVM */
+	s8		rx_mimo_signal_quality[4];	/* per-path's EVM */
 	u8 RxMIMOEVMdbm[4];		/* per-path's EVM dbm */
 
-	u8 RxMIMOSignalStrength[4];/*  in 0~100 index */
+	u8 rx_mimo_signal_strength[4];/*  in 0~100 index */
 
 	u16 	Cfo_short[4];			/*  per-path's Cfo_short */
 	u16 	Cfo_tail[4];			/*  per-path's Cfo_tail */
 
 	s8		RxPower; /*  in dBm Translate from PWdB */
 	s8		RecvSignalPower;/*  Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
-	u8 BTRxRSSIPercentage;
+	u8 bt_rx_rssi_percentage;
 	u8 SignalStrength; /*  in 0-100 index. */
 
 	s8		RxPwr[4];				/* per-path's pwdb */
@@ -187,7 +187,7 @@ struct rx_pkt_attrib	{
 	u8 signal_qual;
 	s8	rx_mimo_signal_qual[2];
 	u8 signal_strength;
-	u32 RxPWDBAll;
+	u32 rx_pwd_ba11;
 	s32	RecvSignalPower;
 */
 	struct phy_info phy_info;
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 23/23] staging: rtl8723bs: Remove unecessary newlines from 'odm.h'.
  2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
                         ` (20 preceding siblings ...)
  2018-03-27  8:41       ` [PATCH 22/23] staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' " Quytelda Kahja
@ 2018-03-27  8:41       ` Quytelda Kahja
  21 siblings, 0 replies; 32+ messages in thread
From: Quytelda Kahja @ 2018-03-27  8:41 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Quytelda Kahja

Remove duplicate newlines and newlines before closing braces.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
 drivers/staging/rtl8723bs/hal/odm.h | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index 175c77b11bf9..1037b88e8f08 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -17,7 +17,6 @@
 #ifndef	__HALDMOUTSRC_H__
 #define __HALDMOUTSRC_H__
 
-
 #include "odm_EdcaTurboCheck.h"
 #include "odm_DIG.h"
 #include "odm_PathDiv.h"
@@ -32,7 +31,6 @@
 #define	TRAFFIC_HIGH	1
 #define	NONE			0
 
-
 /* 3 Tx Power Tracking */
 /* 3 ============================================================ */
 #define		DPK_DELTA_MAPPING_NUM	13
@@ -81,7 +79,6 @@
 #define		AUX_ANT		2		/* AntB or Ant Aux */
 #define		MAX_ANT		3		/*  3 for AP using */
 
-
 /* Antenna Diversity Type */
 #define	SW_ANTDIV	0
 #define	HW_ANTDIV	1
@@ -200,7 +197,6 @@ typedef struct _ODM_RATE_ADAPTIVE {
 
 } ODM_RATE_ADAPTIVE, *PODM_RATE_ADAPTIVE;
 
-
 #define IQK_MAC_REG_NUM		4
 #define IQK_ADDA_REG_NUM		16
 #define IQK_BB_REG_NUM_MAX	10
@@ -229,7 +225,6 @@ typedef struct _ODM_RATE_ADAPTIVE {
 #define MAX_PATH_NUM_8814A		4
 #define MAX_PATH_NUM_8822B		2
 
-
 #define IQK_THRESHOLD			8
 #define DPK_THRESHOLD			4
 
@@ -266,7 +261,6 @@ struct odm_phy_info {
 	u8 bt_coex_pwr_adjust;
 };
 
-
 struct odm_packet_info {
 	u8 data_rate;
 	u8 station_id;
@@ -275,7 +269,6 @@ struct odm_packet_info {
 	bool is_beacon;
 };
 
-
 typedef struct _ODM_Phy_Dbg_Info_ {
 	/* ODM Write, debug info */
 	s8 RxSNRdB[4];
@@ -288,12 +281,10 @@ typedef struct _ODM_Phy_Dbg_Info_ {
 
 } ODM_PHY_DBG_INFO_T;
 
-
 typedef struct _ODM_Mac_Status_Info_ {
 	u8 test;
 } ODM_MAC_INFO;
 
-
 typedef enum tag_Dynamic_ODM_Support_Ability_Type {
 	/*  BB Team */
 	ODM_DIG				= 0x00000001,
@@ -372,7 +363,6 @@ typedef enum _ODM_Common_Info_Definition {
 	ODM_CMNINFO_SMART_CONCURRENT,
 	/* HOOK BEFORE REG INIT----------- */
 
-
 	/*  Dynamic value: */
 /*  POINTER REFERENCE----------- */
 	ODM_CMNINFO_MAC_PHY_MODE,	/*  ODM_MAC_PHY_MODE_E */
@@ -430,8 +420,6 @@ typedef enum _ODM_Common_Info_Definition {
 	ODM_CMNINFO_MAC_STATUS,
 
 	ODM_CMNINFO_MAX,
-
-
 } ODM_CMNINFO_E;
 
 /*  2011/10/20 MH Define ODM support ability.  ODM_CMNINFO_ABILITY */
@@ -512,7 +500,6 @@ typedef enum tag_ODM_RF_Path_Bit_Definition {
 	ODM_RF_RX_D	=	BIT7,
 } ODM_RF_PATH_E;
 
-
 typedef enum tag_ODM_RF_Type_Definition {
 	ODM_1T1R	=	0,
 	ODM_1T2R	=	1,
@@ -524,7 +511,6 @@ typedef enum tag_ODM_RF_Type_Definition {
 	ODM_4T4R	=	7,
 } ODM_RF_TYPE_E;
 
-
 /*  */
 /*  ODM Dynamic common info value definition */
 /*  */
@@ -541,7 +527,6 @@ typedef enum tag_ODM_MAC_PHY_Mode_Definition {
 	ODM_DMDP	= 2,
 } ODM_MAC_PHY_MODE_E;
 
-
 typedef enum tag_BT_Coexist_Definition {
 	ODM_BT_BUSY		= 1,
 	ODM_BT_ON		= 2,
@@ -610,7 +595,6 @@ typedef enum tag_Bandwidth_Definition {
 	ODM_BW10M		= 4,
 } ODM_BW_E;
 
-
 /*  ODM_CMNINFO_BOARD_TYPE */
 /*  For non-AC-series IC , ODM_BOARD_5G_EXT_PA and ODM_BOARD_5G_EXT_LNA are ignored */
 /*  For AC-series IC, external PA & LNA can be indivisuallly added on 2.4G and/or 5G */
@@ -664,7 +648,6 @@ typedef enum tag_CCA_Path {
 	ODM_CCA_1R_B		= 2,
 } ODM_CCA_PATH_E;
 
-
 typedef struct _ODM_RA_Info_ {
 	u8 RateID;
 	u32 RateMask;
@@ -703,7 +686,6 @@ typedef struct _IQK_MATRIX_REGS_SETTING {
 	bool bBWIqkResultSaved[3];
 } IQK_MATRIX_REGS_SETTING, *PIQK_MATRIX_REGS_SETTING;
 
-
 /* Remove PATHDIV_PARA struct to odm_PathDiv.h */
 
 typedef struct ODM_RF_Calibration_Structure {
@@ -739,7 +721,6 @@ typedef struct ODM_RF_Calibration_Structure {
 	u8 bRfPiEnable;
 	u32 TXPowerTrackingCallbackCnt; /* cosa add for debug */
 
-
 	/*  Tx power Tracking ------------------------- */
 	u8 bCCKinCH14;
 	u8 CCK_index;
@@ -794,7 +775,6 @@ typedef struct ODM_RF_Calibration_Structure {
 	u32 TxIQC_8723B[2][3][2]; /*  { {S1: 0xc94, 0xc80, 0xc4c} , {S0: 0xc9c, 0xc88, 0xc4c}} */
 	u32 RxIQC_8723B[2][2][2]; /*  { {S1: 0xc14, 0xca0} ,           {S0: 0xc14, 0xca0}} */
 
-
 	/* for APK */
 	u32 APKoutput[2][2]; /* path A/B; output1_1a/output1_2a */
 	u8 bAPKdone;
@@ -842,7 +822,6 @@ typedef struct _FAST_ANTENNA_TRAINNING_ {
 	u32 OFDM_counter_main;
 	u32 OFDM_counter_aux;
 
-
 	u32 CCK_CtrlFrame_Cnt_main;
 	u32 CCK_CtrlFrame_Cnt_aux;
 	u32 OFDM_CtrlFrame_Cnt_main;
@@ -878,13 +857,11 @@ typedef struct _ODM_PATH_DIVERSITY_ {
 	u32 PathB_Cnt[ODM_ASSOCIATE_ENTRY_NUM];
 } PATHDIV_T, *pPATHDIV_T;
 
-
 typedef enum _BASEBAND_CONFIG_PHY_REG_PG_VALUE_TYPE{
 	PHY_REG_PG_RELATIVE_VALUE = 0,
 	PHY_REG_PG_EXACT_VALUE = 1
 } PHY_REG_PG_TYPE;
 
-
 /*  */
 /*  Antenna detection information from single tone mechanism, added by Roger, 2012.11.27. */
 /*  */
@@ -936,7 +913,6 @@ typedef  struct DM_Out_Source_Dynamic_Mechanism_Structure {
 	/* bool			bSlaveOfDMSP; */
 /* REMOVED COMMON INFO---------- */
 
-
 /* 1  COMMON INFORMATION */
 
 	/*  */
@@ -1108,7 +1084,6 @@ typedef  struct DM_Out_Source_Dynamic_Mechanism_Structure {
 	u8 Adaptivity_IGI_upper;
 	u8 NHM_cnt_0;
 
-
 	ODM_NOISE_MONITOR noise_level;/* ODM_MAX_CHANNEL_NUM]; */
 	/*  */
 	/* 2 Define STA info. */
@@ -1370,7 +1345,6 @@ typedef enum tag_SW_Antenna_Switch_Definition {
 	Antenna_MAX = 3,
 } DM_SWAS_E;
 
-
 /*  Maximal number of antenna detection mechanism needs to perform, added by Roger, 2011.12.28. */
 #define	MAX_ANTENNA_DETECTION_CNT	10
 
@@ -1403,7 +1377,6 @@ extern  u32 TxScalingTable_Jaguar[TXSCALE_TABLE_SIZE];
 
 void ODM_SetAntenna(PDM_ODM_T pDM_Odm, u8 Antenna);
 
-
 /* Remove BB power saving by Yuchen */
 
 #define dm_CheckTXPowerTracking ODM_TXPowerTrackingCheck
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_*.
  2018-03-24 23:02   ` Quytelda Kahja
@ 2018-03-27 13:16     ` Johannes Berg
  0 siblings, 0 replies; 32+ messages in thread
From: Johannes Berg @ 2018-03-27 13:16 UTC (permalink / raw)
  To: Quytelda Kahja, Larry Finger; +Cc: linux-wireless, linux-kernel

On Sat, 2018-03-24 at 16:02 -0700, Quytelda Kahja wrote:
> The "document" refers to the file in which the changes were made
> ('include/linux/ieee80211.h').

You're the first person ever to do that, to my knowledge :)

Either way, I don't really want to merge this since it would break
staging, and I don't want to merge a staging fix either... so you'd have
to get that sorted out first.

johannes

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2018-03-27 13:23 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-24  4:10 [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Quytelda Kahja
2018-03-24  4:10 ` [PATCH 2/3] ieee80211: Replace bit shifts with the BIT() macro for measurement masks Quytelda Kahja
2018-03-24  4:10 ` [PATCH 3/3] ieee80211: Replace bit shifts with the BIT() macro for 802.11g ERP IEs Quytelda Kahja
2018-03-24 21:23 ` [PATCH 1/3] ieee80211: Replace bit shifts with the BIT() macro for WLAN_CAPABILITY_* Larry Finger
2018-03-24 23:02   ` Quytelda Kahja
2018-03-27 13:16     ` Johannes Berg
2018-03-25 14:05 ` kbuild test robot
2018-03-26  9:15   ` Quytelda Kahja
2018-03-26  9:18     ` [PATCH] staging: rtl8723bs: Remove duplicate #defines Quytelda Kahja
2018-03-27  8:40     ` [PATCH 01/23] " Quytelda Kahja
2018-03-27  8:40       ` [PATCH 02/23] staging: rtl8723bs: Remove #defines shadowing enums in 'linux/ieee80211.h' Quytelda Kahja
2018-03-27  8:40       ` [PATCH 03/23] staging: rtl8723bs: Replace RTW_IEEE80211_FCTL_* with IEEE80211_FCTL_* Quytelda Kahja
2018-03-27  8:40       ` [PATCH 04/23] staging: rtl8723bs: Replace RTW_IEEE80211_FTYPE_* with IEEE80211_FTYPE_* Quytelda Kahja
2018-03-27  8:40       ` [PATCH 05/23] staging: rtl8723bs: Replace RTW_IEEE80211_STYPE_* with IEEE80211_STYPE_* Quytelda Kahja
2018-03-27  8:40       ` [PATCH 06/23] staging: rtl8723bs: Fix newlines in rtw_wx_set_auth() Quytelda Kahja
2018-03-27  8:40       ` [PATCH 07/23] staging: rtl8723bs: Remove unecessary braces from switch statement Quytelda Kahja
2018-03-27  8:41       ` [PATCH 08/23] staging: rtl8723bs: Remove braces from single statement conditionals Quytelda Kahja
2018-03-27  8:41       ` [PATCH 09/23] staging: rtl8723bs: Fix alignment in rtw_wx_set_auth() Quytelda Kahja
2018-03-27  8:41       ` [PATCH 10/23] staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants Quytelda Kahja
2018-03-27  8:41       ` [PATCH 11/23] staging: rtl8723bs: Remove unnecessary length #define's Quytelda Kahja
2018-03-27  8:41       ` [PATCH 12/23] staging: rtl8723bs: Fix lines with trailing open parentheses Quytelda Kahja
2018-03-27  8:41       ` [PATCH 13/23] staging: rtl8723bs: Add spaces around ternary operators Quytelda Kahja
2018-03-27  8:41       ` [PATCH 14/23] staging: rtl8723bs: Add missing braces in else statement Quytelda Kahja
2018-03-27  8:41       ` [PATCH 15/23] staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c' Quytelda Kahja
2018-03-27  8:41       ` [PATCH 16/23] staging: rtl8723bs: Remove unnecessary blank lines " Quytelda Kahja
2018-03-27  8:41       ` [PATCH 17/23] staging: rtl8723bs: Fix lines too long in update_recvframe_attrib() Quytelda Kahja
2018-03-27  8:41       ` [PATCH 18/23] staging: rtl8723bs: Fix function signature that goes over 80 characters Quytelda Kahja
2018-03-27  8:41       ` [PATCH 19/23] staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections Quytelda Kahja
2018-03-27  8:41       ` [PATCH 20/23] staging: rtl8723bs: Replace NULL pointer comparison with '!' Quytelda Kahja
2018-03-27  8:41       ` [PATCH 21/23] staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style Quytelda Kahja
2018-03-27  8:41       ` [PATCH 22/23] staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' " Quytelda Kahja
2018-03-27  8:41       ` [PATCH 23/23] staging: rtl8723bs: Remove unecessary newlines from 'odm.h' Quytelda Kahja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).