staging:rtl8192u: Coding style
v2 cover staging:rtl8192u: Coding style
In this second version of the series I've replaced the macros eqMacAddr and cpMacAddr with functions suggested by Joe Perches <[email protected]>
One issue with this change is that both of the functions now used, defined in etherdevice.h, rely on the parameters being u16 aligned. To achieve this I've re-ordered member variables in two structures. This strikes me as being a bit shaky as any change to a structure might upset that alignment.
Apart from that my only concern is renaming functions which are exported symbols. As far as I can see they are exported using EXPORT_SYMBOL but are not used anywhere.
John Whitmore (15):
staging:rtl8192u: Remove macro eqMacAddr - Style staging:rtl8192u: Remove macro cpMacAddr - Style staging:rtl8192u: Replace magic number 6 with ETH_ALEN - Style staging:rtl8192u: Rename macro parameter __pIeeeDev - Style staging:rtl8192u: Rename __pTa - Style
staging:rtl8192u: Lines should not end with a '(' - Style staging:rtl8192u: Rename Dot11d_Init - Style staging:rtl8192u: Rename Dot11d_Reset - Style staging:rtl8192u: Rename Dot11d_UpdateCountryIe - Style staging:rtl8192u: Rename dot11d_update_country_ie() parameters - Style staging:rtl8192u: Rename DOT11D_GetMaxTxPwrInDbm - Style staging:rtl8192u: Rename Channel - Style
staging:rtl8192u: Rename DOT11D_ScanComplete - Style staging:rtl8192u: Rename IsLegalChannel - Style staging:rtl8192u: Rename ToLegalChannel - Style
drivers/staging/rtl8192u/ieee80211/dot11d.c | 42 +++++----- drivers/staging/rtl8192u/ieee80211/dot11d.h | 77 ++++++------------- .../staging/rtl8192u/ieee80211/ieee80211.h | 11 +-- .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 10 +-- .../rtl8192u/ieee80211/ieee80211_softmac.c | 6 +- drivers/staging/rtl8192u/r8192U_core.c | 10 +-- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- 7 files changed, 63 insertions(+), 95 deletions(-)
Signature · 1 line
2.18.0
PATCH v2 1/15 staging:rtl8192u: Remove macro eqMacAddr - Style
The macro eqMacAddr implements the same functionality as the ether_addr_equal function defined in etherdevice.h, as a result the macro has been removed from the code, and its use replaced with the function call.
Note that to use the ether_addr_equal function the data array containing the MAC Address has to be u16 aligned. Because of this the struct rt_dot11d_info has had it's member variables re-ordered.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 12 +++++------- drivers/staging/rtl8192u/r8192U_core.c | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +5 -7
@@ -17,22 +17,20 @@ enum dot11d_state { };struct rt_dot11d_info { -bool enabled;/* dot11MultiDomainCapabilityEnabled */ -u16 country_ie_len;/* > 0 if country_ie_buf[] contains valid country information element. */ -u8 country_ie_buf[MAX_IE_LEN ]; + +/* country_ie_src_addr u16 aligned for comparison and copy */ u8 country_ie_src_addr[6 ];/* Source AP of the country IE. */ +u8 country_ie_buf[MAX_IE_LEN ];u8 country_ie_watchdog;u8 channel_map[MAX_CHANNEL_NUMBER +1 ];/* !Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) */ u8 max_tx_pwr_dbm_list[MAX_CHANNEL_NUMBER +1 ];enum dot11d_state state; +bool enabled;/* dot11MultiDomainCapabilityEnabled */ }; -#define eqMacAddr (a, b) (((a)[0] == (b)[0] && \ - (a)[1] == (b)[1] && (a)[2] == (b)[2] && (a)[3] == (b)[3] && \ - (a)[4] == (b)[4] && (a)[5] == (b)[5]) ? 1 : 0)#define cpMacAddr (des, src) ((des)[0] = (src)[0], \ (des)[1] = (src)[1], (des)[2] = (src)[2], \ (des)[3] = (src)[3], (des)[4] = (src)[4], \
@@ -42,7 +40,7 @@ struct rt_dot11d_info {#define IS_DOT11D_ENABLE (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)#define IS_COUNTRY_IE_VALID (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0) -#define IS_EQUAL_CIE_SRC (__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) +#define IS_EQUAL_CIE_SRC (__pIeeeDev, __pTa) ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)#define UPDATE_CIE_SRC (__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)#define GET_CIE_WATCHDOG (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)
drivers/staging/rtl8192u/r8192U_core.c +3 -3
@@ -4460,15 +4460,15 @@ static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,/* Check if the received packet is acceptable. */ bpacket_match_bssid = (type !=IEEE80211_FTYPE_CTL ) && - (eqMacAddr (priv->ieee80211->current_network.bssid, (fc &IEEE80211_FCTL_TODS ) ? hdr->addr1 : (fc &IEEE80211_FCTL_FROMDS ) ? hdr->addr2 : hdr->addr3)) + (ether_addr_equal (priv->ieee80211->current_network.bssid, (fc &IEEE80211_FCTL_TODS ) ? hdr->addr1 : (fc &IEEE80211_FCTL_FROMDS ) ? hdr->addr2 : hdr->addr3)) && (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV); bpacket_toself = bpacket_match_bssid & - (eqMacAddr (praddr, priv->ieee80211->dev->dev_addr)); + (ether_addr_equal (praddr, priv->ieee80211->dev->dev_addr));if (WLAN_FC_GET_FRAMETYPE (fc) ==IEEE80211_STYPE_BEACON ) bPacketBeacon = true;if (WLAN_FC_GET_FRAMETYPE (fc) ==IEEE80211_STYPE_BLOCKACK ) { -if ((eqMacAddr (praddr, dev->dev_addr))) +if ((ether_addr_equal (praddr, dev->dev_addr))) bToSelfBA = true; }
Signature · 1 line
2.18.0
Re: [PATCH v2 01/15] staging:rtl8192u: Remove macro eqMacAddr - Style
Quoted 4 lines · John Whitmore
The macro eqMacAddr implements the same functionality as the
ether_addr_equalfunction defined inetherdevice.h, as a result the macro has been removed from the code, and its use replaced with the function call.
[]
drivers/staging/rtl8192u/r8192U_core.c
Quoted 1 line
drivers/staging/rtl8192u/r8192U_core.c +0
-0
[]
drivers/staging/rtl8192u/r8192U_core.c static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb, · line 4466
Quoted 10 lines
drivers/staging/rtl8192u/r8192U_core.c +2
-2@@ -4460,15 +4460,15 @@ static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,/* Check if the received packet is acceptable. */ bpacket_match_bssid = (type !=IEEE80211_FTYPE_CTL ) && - (eqMacAddr (priv->ieee80211->current_network.bssid, (fc &IEEE80211_FCTL_TODS ) ? hdr->addr1 : (fc &IEEE80211_FCTL_FROMDS ) ? hdr->addr2 : hdr->addr3)) + (ether_addr_equal (priv->ieee80211->current_network.bssid, (fc &IEEE80211_FCTL_TODS ) ? hdr->addr1 : (fc &IEEE80211_FCTL_FROMDS ) ? hdr->addr2 : hdr->addr3)) && (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV); bpacket_toself = bpacket_match_bssid & - (eqMacAddr (praddr, priv->ieee80211->dev->dev_addr)); + (ether_addr_equal (praddr, priv->ieee80211->dev->dev_addr));
Likely this should be
bpacket_match_bssid = bpacket_match_bss &&
as boolean use with a bitwise & is odd.
Re: [PATCH v2 01/15] staging:rtl8192u: Remove macro eqMacAddr - Style
Quoted 21 lines · Joe Perches
Quoted 4 lines · John Whitmore
The macro eqMacAddr implements the same functionality as the
ether_addr_equalfunction defined inetherdevice.h, as a result the macro has been removed from the code, and its use replaced with the function call.[]
drivers/staging/rtl8192u/r8192U_core.c
Quoted 1 line
drivers/staging/rtl8192u/r8192U_core.c +0
-0[]
drivers/staging/rtl8192u/r8192U_core.c static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb, · line 4466
Quoted 10 lines
drivers/staging/rtl8192u/r8192U_core.c +2
-2@@ -4460,15 +4460,15 @@ static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,/* Check if the received packet is acceptable. */ bpacket_match_bssid = (type !=IEEE80211_FTYPE_CTL ) && - (eqMacAddr (priv->ieee80211->current_network.bssid, (fc &IEEE80211_FCTL_TODS ) ? hdr->addr1 : (fc &IEEE80211_FCTL_FROMDS ) ? hdr->addr2 : hdr->addr3)) + (ether_addr_equal (priv->ieee80211->current_network.bssid, (fc &IEEE80211_FCTL_TODS ) ? hdr->addr1 : (fc &IEEE80211_FCTL_FROMDS ) ? hdr->addr2 : hdr->addr3)) && (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV); bpacket_toself = bpacket_match_bssid & - (eqMacAddr (praddr, priv->ieee80211->dev->dev_addr)); + (ether_addr_equal (praddr, priv->ieee80211->dev->dev_addr));Likely this should be
Quoted 4 lines
bpacket_match_bssid = bpacket_match_bss &&as boolean use with a bitwise & is odd.
Yes have to agree odd. Somebody famous in Computer Science said that debugging was twice as difficult as writing code, so why would you write the cleverest code you possibly could, or something like that. That's what I thought when I now looked at that line of code.
I've been going through this driver cleaning up header files first. Once those are sorted I was going to turn to the C and try get my head around the logic. I'll have to look at the functionality of that bpacket_toself variable but a bitwise operation does look odd.
PATCH v2 2/15 staging:rtl8192u: Remove macro cpMacAddr - Style
In reply to John WhitmoreThe macro cpMacAddr implements the same functionality as the ether_addr_copy function defined in etherdevice.h, as a result the macro has been removed from the code, and its use replaced with the function call.
Note that the header comment of the function ether_addr_copy states that the two byte arrays passed as parameters to the function must be u16 aligned. Because of this the structure ieee80211_network has had its member variables re-ordered so that the members bssid and MBssid are aligned to a u16 boundary.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +----- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 11 ++++++----- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -5
@@ -31,17 +31,13 @@ struct rt_dot11d_info {bool enabled;/* dot11MultiDomainCapabilityEnabled */ }; -#define cpMacAddr (des, src) ((des)[0] = (src)[0], \ - (des)[1] = (src)[1], (des)[2] = (src)[2], \ - (des)[3] = (src)[3], (des)[4] = (src)[4], \ - (des)[5] = (src)[5])#define GET_DOT11D_INFO (__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))#define IS_DOT11D_ENABLE (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled)#define IS_COUNTRY_IE_VALID (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0)#define IS_EQUAL_CIE_SRC (__pIeeeDev, __pTa) ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) -#define UPDATE_CIE_SRC (__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) +#define UPDATE_CIE_SRC (__pIeeeDev, __pTa) ether_addr_copy(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa)#define GET_CIE_WATCHDOG (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog)#define RESET_CIE_WATCHDOG (__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +6 -5
@@ -1329,8 +1329,13 @@ typedef enum _erp_t {struct ieee80211_network {/* These entries are used to identify a unique network */ -u8 bssid[ETH_ALEN ]; +u8 bssid[ETH_ALEN ];/* u16 aligned! */ u8 channel; + +// CCXv4 S59, MBSSID. +bool bMBssidValid; +u8 MBssid[ETH_ALEN ];/* u16 aligned! */ +u8 MBssidMask;/* Ensure null-terminated for any debug msgs */ u8 ssid[IW_ESSID_MAX_SIZE +1 ];u8 ssid_len;
@@ -1341,10 +1346,6 @@ struct ieee80211_network {bool bCkipSupported;bool bCcxRmEnable;u16 CcxRmState[2 ]; -// CCXv4 S59, MBSSID. -bool bMBssidValid; -u8 MBssidMask; -u8 MBssid[6 ];// CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20. bool bWithCcxVerNum;u8 BssCcxVerNumber;
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
@@ -1944,7 +1944,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, { network->bMBssidValid = true; network->MBssidMask =0xff << (network->MBssidMask); -cpMacAddr (network->MBssid, network->bssid); +ether_addr_copy (network->MBssid, network->bssid); network->MBssid[5 ] &= network->MBssidMask; } else
Signature · 1 line
2.18.0
PATCH v2 3/15 staging:rtl8192u: Replace magic number 6 with ETH_ALEN - Style
In reply to John WhitmoreThe array size 6 represents the length of an Ethernet address so the magic number has been replaced with the defined constant representing that length.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -20,7 +20,7 @@ struct rt_dot11d_info {u16 country_ie_len;/* > 0 if country_ie_buf[] contains valid country information element. */ /* country_ie_src_addr u16 aligned for comparison and copy */ -u8 country_ie_src_addr[6 ];/* Source AP of the country IE. */ +u8 country_ie_src_addr[ETH_ALEN ];/* Source AP of the country IE. */ u8 country_ie_buf[MAX_IE_LEN ];u8 country_ie_watchdog;
Signature · 1 line
2.18.0
PATCH v2 4/15 staging:rtl8192u: Rename macro parameter __pIeeeDev - Style
In reply to John WhitmoreMultiple macros, defined in dot11d.h, use the variable __pIeeeDev as a parameter. This name causes a checkpatch issue due to its use of CamelCase naming. The parameter name has been changed to ieee_dev to clear this issue.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +8 -8
@@ -31,17 +31,17 @@ struct rt_dot11d_info {bool enabled;/* dot11MultiDomainCapabilityEnabled */ }; -#define GET_DOT11D_INFO (__pIeeeDev) ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo)) +#define GET_DOT11D_INFO (ieee_dev) ((struct rt_dot11d_info *)((ieee_dev)->pDot11dInfo)) -#define IS_DOT11D_ENABLE (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->enabled) -#define IS_COUNTRY_IE_VALID (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_len > 0) +#define IS_DOT11D_ENABLE (ieee_dev) (GET_DOT11D_INFO(ieee_dev)->enabled) +#define IS_COUNTRY_IE_VALID (ieee_dev) (GET_DOT11D_INFO(ieee_dev)->country_ie_len > 0) -#define IS_EQUAL_CIE_SRC (__pIeeeDev, __pTa) ether_addr_equal(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) -#define UPDATE_CIE_SRC (__pIeeeDev, __pTa) ether_addr_copy(GET_DOT11D_INFO(__pIeeeDev)->country_ie_src_addr, __pTa) +#define IS_EQUAL_CIE_SRC (ieee_dev, __pTa) ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa) +#define UPDATE_CIE_SRC (ieee_dev, __pTa) ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa) -#define GET_CIE_WATCHDOG (__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->country_ie_watchdog) -#define RESET_CIE_WATCHDOG (__pIeeeDev) (GET_CIE_WATCHDOG(__pIeeeDev) = 0) -#define UPDATE_CIE_WATCHDOG (__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev)) +#define GET_CIE_WATCHDOG (ieee_dev) (GET_DOT11D_INFO(ieee_dev)->country_ie_watchdog) +#define RESET_CIE_WATCHDOG (ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0) +#define UPDATE_CIE_WATCHDOG (ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev))void Dot11d_Init(
Signature · 1 line
2.18.0
PATCH v2 5/15 staging:rtl8192u: Rename __pTa - Style
In reply to John WhitmoreThe macro parameter __pTa causes a checkpatch issue because of its use of CamelCase naming. The parameter has this been renamed to addr.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +2 -2
@@ -36,8 +36,8 @@ struct rt_dot11d_info {#define IS_DOT11D_ENABLE (ieee_dev) (GET_DOT11D_INFO(ieee_dev)->enabled)#define IS_COUNTRY_IE_VALID (ieee_dev) (GET_DOT11D_INFO(ieee_dev)->country_ie_len > 0) -#define IS_EQUAL_CIE_SRC (ieee_dev, __pTa) ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa) -#define UPDATE_CIE_SRC (ieee_dev, __pTa) ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, __pTa) +#define IS_EQUAL_CIE_SRC (ieee_dev, addr) ether_addr_equal(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, addr) +#define UPDATE_CIE_SRC (ieee_dev, addr) ether_addr_copy(GET_DOT11D_INFO(ieee_dev)->country_ie_src_addr, addr)#define GET_CIE_WATCHDOG (ieee_dev) (GET_DOT11D_INFO(ieee_dev)->country_ie_watchdog)#define RESET_CIE_WATCHDOG (ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)
Signature · 1 line
2.18.0
PATCH v2 6/15 staging:rtl8192u: Lines should not end with a '(' - Style
In reply to John WhitmoreA number of function prototypes cause a checkpatch issue - "Lines should not end with a '(' ". This issue has been cleared by moving function prototype parameters to the same line as the function name.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 47 +++++---------------- 1 file changed, 10 insertions(+), 37 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +10 -37
@@ -43,42 +43,15 @@ struct rt_dot11d_info {#define RESET_CIE_WATCHDOG (ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)#define UPDATE_CIE_WATCHDOG (ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev)) -void -Dot11d_Init ( -struct ieee80211_device *dev - ); +void Dot11d_Init (struct ieee80211_device *dev); +void Dot11d_Reset (struct ieee80211_device *dev); +void Dot11d_UpdateCountryIe (struct ieee80211_device *dev, +u8 *pTaddr, +u16 CoutryIeLen, +u8 *pCoutryIe); +u8 DOT11D_GetMaxTxPwrInDbm (struct ieee80211_device *dev,u8 Channel); +void DOT11D_ScanComplete (struct ieee80211_device *dev); +int IsLegalChannel (struct ieee80211_device *dev,u8 channel); +int ToLegalChannel (struct ieee80211_device *dev,u8 channel); -void -Dot11d_Reset ( -struct ieee80211_device *dev - ); - -void -Dot11d_UpdateCountryIe ( -struct ieee80211_device *dev, -u8 *pTaddr, -u16 CoutryIeLen, -u8 *pCoutryIe - ); - -u8 -DOT11D_GetMaxTxPwrInDbm ( -struct ieee80211_device *dev, -u8 Channel - ); - -void -DOT11D_ScanComplete ( -struct ieee80211_device *dev - ); - -int IsLegalChannel ( -struct ieee80211_device *dev, -u8 channel -); - -int ToLegalChannel ( -struct ieee80211_device *dev, -u8 channel -);#endif /* #ifndef __INC_DOT11D_H */
Signature · 1 line
2.18.0
PATCH v2 7/15 staging:rtl8192u: Rename Dot11d_Init - Style
In reply to John WhitmoreThe function Dot11d_Init() causes a checkpatch issue due to its use of CamelCase naming. The function has been renamed to dot11d_init.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +3 -3
@@ -3,7 +3,7 @@#include "dot11d.h" -void Dot11d_Init (struct ieee80211_device *ieee) +void dot11d_init (struct ieee80211_device *ieee) {struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (ieee);
@@ -15,9 +15,9 @@ void Dot11d_Init(struct ieee80211_device *ieee)memset (pDot11dInfo->max_tx_pwr_dbm_list,0xFF ,MAX_CHANNEL_NUMBER +1 );RESET_CIE_WATCHDOG (ieee); -netdev_info (ieee->dev,"Dot11d_Init()\n" ); +netdev_info (ieee->dev,"dot11d_init()\n" ); } -EXPORT_SYMBOL (Dot11d_Init); +EXPORT_SYMBOL (dot11d_init);/* Reset to the state as we are just entering a regulatory domain. */ void Dot11d_Reset (struct ieee80211_device *ieee)
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -43,7 +43,7 @@ struct rt_dot11d_info {#define RESET_CIE_WATCHDOG (ieee_dev) (GET_CIE_WATCHDOG(ieee_dev) = 0)#define UPDATE_CIE_WATCHDOG (ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev)) -void Dot11d_Init (struct ieee80211_device *dev); +void dot11d_init (struct ieee80211_device *dev);void Dot11d_Reset (struct ieee80211_device *dev); void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -183,7 +183,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)case COUNTRY_CODE_ISRAEL :case COUNTRY_CODE_TELEC :case COUNTRY_CODE_MIC : -Dot11d_Init (ieee); +dot11d_init (ieee); ieee->bGlobalDomain = false;/* actually 8225 & 8256 rf chips only support B,G,24N mode */ if ((priv->rf_chip ==RF_8225 ) || (priv->rf_chip ==RF_8256 )) {
Signature · 1 line
2.18.0
PATCH v2 8/15 staging:rtl8192u: Rename Dot11d_Reset - Style
In reply to John WhitmoreThe function Dot11d_Reset causes a checkpatch issue due to its use of CamelCase naming, so has been renamed to dot11d_reset.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +3 -3
@@ -20,7 +20,7 @@ void dot11d_init(struct ieee80211_device *ieee)EXPORT_SYMBOL (dot11d_init);/* Reset to the state as we are just entering a regulatory domain. */ -void Dot11d_Reset (struct ieee80211_device *ieee) +void dot11d_reset (struct ieee80211_device *ieee) {u32 i;struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (ieee);
@@ -38,7 +38,7 @@ void Dot11d_Reset(struct ieee80211_device *ieee) pDot11dInfo->country_ie_len =0 ;RESET_CIE_WATCHDOG (ieee); } -EXPORT_SYMBOL (Dot11d_Reset); +EXPORT_SYMBOL (dot11d_reset);/* * Update country IE from Beacon or Probe Resopnse and configure PHY for
@@ -127,7 +127,7 @@ void DOT11D_ScanComplete(struct ieee80211_device *dev)case DOT11D_STATE_DONE :if (GET_CIE_WATCHDOG (dev) ==0 ) {/* Reset country IE if previous one is gone. */ -Dot11d_Reset (dev); +dot11d_reset (dev); }break ;case DOT11D_STATE_NONE :
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -44,7 +44,7 @@ struct rt_dot11d_info {#define UPDATE_CIE_WATCHDOG (ieee_dev) (++GET_CIE_WATCHDOG(ieee_dev))void dot11d_init (struct ieee80211_device *dev); -void Dot11d_Reset (struct ieee80211_device *dev); +void dot11d_reset (struct ieee80211_device *dev); void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr, u16 CoutryIeLen,
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +1 -1
@@ -2357,7 +2357,7 @@ void ieee80211_disassociate(struct ieee80211_device *ieee)if (ieee->data_hard_stop) ieee->data_hard_stop (ieee->dev);if (IS_DOT11D_ENABLE (ieee)) -Dot11d_Reset (ieee); +dot11d_reset (ieee); ieee->state =IEEE80211_NOLINK ; ieee->is_set_key = false; ieee->link_change (ieee->dev);
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -212,7 +212,7 @@ static void rtl819x_set_channel_map(u8 channel_plan, struct r8192_priv *priv)* otherwise, it shall follow global domain settings. */ GET_DOT11D_INFO (ieee)->enabled =0 ; -Dot11d_Reset (ieee); +dot11d_reset (ieee); ieee->bGlobalDomain = true;break ;
Signature · 1 line
2.18.0
PATCH v2 9/15 staging:rtl8192u: Rename Dot11d_UpdateCountryIe - Style
In reply to John WhitmoreThe function Dot11d_UpdateCountryIe causes a checkpatch issue due to its use of CamelCase naming, the function has been renamed to dot11d_update_country_ie.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 8 ++++---- drivers/staging/rtl8192u/ieee80211/dot11d.h | 8 ++++---- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +4 -4
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(dot11d_reset);* 1. IS_DOT11D_ENABLE() is TRUE. * 2. Input IE is an valid one. */ -void Dot11d_UpdateCountryIe (struct ieee80211_device *dev,u8 *pTaddr, +void dot11d_update_country_ie (struct ieee80211_device *dev,u8 *pTaddr,u16 CoutryIeLen,u8 *pCoutryIe) {struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (dev);
@@ -66,14 +66,14 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,/* It is not in a monotonically increasing order, so * stop processing. */ -netdev_err (dev->dev,"Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n" ); +netdev_err (dev->dev,"dot11d_update_country_ie(): Invalid country IE, skip it........1\n" );return ; }if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + pTriple->num_channels)) {/* It is not a valid set of channel id, so stop * processing. */ -netdev_err (dev->dev,"Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n" ); +netdev_err (dev->dev,"dot11d_update_country_ie(): Invalid country IE, skip it........2\n" );return ; }
@@ -97,7 +97,7 @@ void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,memcpy (pDot11dInfo->country_ie_buf, pCoutryIe, CoutryIeLen); pDot11dInfo->state =DOT11D_STATE_LEARNED ; } -EXPORT_SYMBOL (Dot11d_UpdateCountryIe); +EXPORT_SYMBOL (dot11d_update_country_ie);u8 DOT11D_GetMaxTxPwrInDbm (struct ieee80211_device *dev,u8 Channel) {
drivers/staging/rtl8192u/ieee80211/dot11d.h +4 -4
@@ -45,10 +45,10 @@ struct rt_dot11d_info {void dot11d_init (struct ieee80211_device *dev);void dot11d_reset (struct ieee80211_device *dev); -void Dot11d_UpdateCountryIe (struct ieee80211_device *dev, -u8 *pTaddr, -u16 CoutryIeLen, -u8 *pCoutryIe); +void dot11d_update_country_ie (struct ieee80211_device *dev, +u8 *pTaddr, +u16 CoutryIeLen, +u8 *pCoutryIe);u8 DOT11D_GetMaxTxPwrInDbm (struct ieee80211_device *dev,u8 Channel);void DOT11D_ScanComplete (struct ieee80211_device *dev);int IsLegalChannel (struct ieee80211_device *dev,u8 channel);
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +1 -1
@@ -1582,7 +1582,7 @@ static inline void ieee80211_extract_country_ie(if (!IS_COUNTRY_IE_VALID (ieee)) { -Dot11d_UpdateCountryIe (ieee, addr2, info_element->len, info_element->data); +dot11d_update_country_ie (ieee, addr2, info_element->len, info_element->data); } }
Signature · 1 line
2.18.0
PATCH v2 10/15 staging:rtl8192u: Rename dot11d_update_country_ie() parameters - Style
In reply to John WhitmoreThe function dot11d_update_country_ie() uses parameter names which cause a checkpatch issue due to the use of CamelCase naming.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +3 -3
@@ -46,9 +46,9 @@ struct rt_dot11d_info {void dot11d_init (struct ieee80211_device *dev);void dot11d_reset (struct ieee80211_device *dev);void dot11d_update_country_ie (struct ieee80211_device *dev, -u8 *pTaddr, -u16 CoutryIeLen, -u8 *pCoutryIe); +u8 *addr, +u16 coutry_ie_len, +u8 *coutry_ie);u8 DOT11D_GetMaxTxPwrInDbm (struct ieee80211_device *dev,u8 Channel);void DOT11D_ScanComplete (struct ieee80211_device *dev);int IsLegalChannel (struct ieee80211_device *dev,u8 channel);
Signature · 1 line
2.18.0
PATCH v2 11/15 staging:rtl8192u: Rename DOT11D_GetMaxTxPwrInDbm - Style
In reply to John WhitmoreThe function DOT11D_GetMaxTxPwrInDbm causes a checkpatch issue due to its use of CamelCase naming. The function has been renamed to dot11d_get_max_tx_pwr_in_dbm.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 6 +++--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +3 -3
@@ -99,13 +99,13 @@ void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr, }EXPORT_SYMBOL (dot11d_update_country_ie); -u8 DOT11D_GetMaxTxPwrInDbm (struct ieee80211_device *dev,u8 Channel) +u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 Channel) {struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (dev);u8 MaxTxPwrInDbm =255 ;if (Channel >MAX_CHANNEL_NUMBER ) { -netdev_err (dev->dev,"DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n" ); +netdev_err (dev->dev,"dot11d_get_max_tx_pwr_in_dbm(): Invalid Channel\n" );return MaxTxPwrInDbm; }if (pDot11dInfo->channel_map[Channel])
@@ -113,7 +113,7 @@ u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)return MaxTxPwrInDbm; } -EXPORT_SYMBOL (DOT11D_GetMaxTxPwrInDbm); +EXPORT_SYMBOL (dot11d_get_max_tx_pwr_in_dbm);void DOT11D_ScanComplete (struct ieee80211_device *dev) {
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -49,7 +49,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,u8 *addr, u16 coutry_ie_len, u8 *coutry_ie); -u8 DOT11D_GetMaxTxPwrInDbm (struct ieee80211_device *dev,u8 Channel); +u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 Channel);void DOT11D_ScanComplete (struct ieee80211_device *dev);int IsLegalChannel (struct ieee80211_device *dev,u8 channel);int ToLegalChannel (struct ieee80211_device *dev,u8 channel);
Signature · 1 line
2.18.0
PATCH v2 12/15 staging:rtl8192u: Rename Channel - Style
In reply to John WhitmoreThe function dot11d_get_max_tx_pwr_in_dbm() uses a parameter name, Channel, which causes a checkpatch issue with CamelCase naming. The parameter has been renamed to channel.
The change is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -49,7 +49,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,u8 *addr, u16 coutry_ie_len, u8 *coutry_ie); -u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 Channel); +u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 channel);void DOT11D_ScanComplete (struct ieee80211_device *dev);int IsLegalChannel (struct ieee80211_device *dev,u8 channel);int ToLegalChannel (struct ieee80211_device *dev,u8 channel);
Signature · 1 line
2.18.0
PATCH v2 13/15 staging:rtl8192u: Rename DOT11D_ScanComplete - Style
In reply to John WhitmoreThe function DOT11D_ScanComplete causes a checkpatch issue due to its use of CamelCase naming. The function has been renamed to dot11d_scan_complete.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 4 ++-- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +2 -2
@@ -115,7 +115,7 @@ u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 Channel) }EXPORT_SYMBOL (dot11d_get_max_tx_pwr_in_dbm); -void DOT11D_ScanComplete (struct ieee80211_device *dev) +void dot11d_scan_complete (struct ieee80211_device *dev) {struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (dev);
@@ -134,7 +134,7 @@ void DOT11D_ScanComplete(struct ieee80211_device *dev)break ; } } -EXPORT_SYMBOL (DOT11D_ScanComplete); +EXPORT_SYMBOL (dot11d_scan_complete);int IsLegalChannel (struct ieee80211_device *dev,u8 channel) {
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -50,7 +50,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,u16 coutry_ie_len, u8 *coutry_ie);u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 channel); -void DOT11D_ScanComplete (struct ieee80211_device *dev); +void dot11d_scan_complete (struct ieee80211_device *dev);int IsLegalChannel (struct ieee80211_device *dev,u8 channel);int ToLegalChannel (struct ieee80211_device *dev,u8 channel);
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +2 -2
@@ -464,7 +464,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee) }else { ieee->sync_scan_hurryup =0 ;if (IS_DOT11D_ENABLE (ieee)) -DOT11D_ScanComplete (ieee); +dot11d_scan_complete (ieee);mutex_unlock (&ieee->scan_mutex); } }
@@ -504,7 +504,7 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work)return ; out:if (IS_DOT11D_ENABLE (ieee)) -DOT11D_ScanComplete (ieee); +dot11d_scan_complete (ieee); ieee->actscanning = false; watchdog =0 ; ieee->scanning =0 ;
Signature · 1 line
2.18.0
PATCH v2 14/15 staging:rtl8192u: Rename IsLegalChannel - Style
In reply to John WhitmoreThe function IsLegalChannel causes a checkpatch issue due to its use of CamelCase naming. The function has been renamed to is_legal_channel.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 8 ++++---- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 6 +++--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +4 -4
@@ -136,19 +136,19 @@ void dot11d_scan_complete(struct ieee80211_device *dev) }EXPORT_SYMBOL (dot11d_scan_complete); -int IsLegalChannel (struct ieee80211_device *dev,u8 channel) +int is_legal_channel (struct ieee80211_device *dev,u8 channel) {struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (dev);if (channel >MAX_CHANNEL_NUMBER ) { -netdev_err (dev->dev,"IsLegalChannel(): Invalid Channel\n" ); +netdev_err (dev->dev,"is_legal_channel(): Invalid Channel\n" );return 0 ; }if (pDot11dInfo->channel_map[channel] >0 )return 1 ;return 0 ; } -EXPORT_SYMBOL (IsLegalChannel); +EXPORT_SYMBOL (is_legal_channel);int ToLegalChannel (struct ieee80211_device *dev,u8 channel) {
@@ -164,7 +164,7 @@ int ToLegalChannel(struct ieee80211_device *dev, u8 channel) }if (channel >MAX_CHANNEL_NUMBER ) { -netdev_err (dev->dev,"IsLegalChannel(): Invalid Channel\n" ); +netdev_err (dev->dev,"is_legal_channel(): Invalid Channel\n" );return default_chn; }
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -51,7 +51,7 @@ void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *coutry_ie);u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 channel);void dot11d_scan_complete (struct ieee80211_device *dev); -int IsLegalChannel (struct ieee80211_device *dev,u8 channel); +int is_legal_channel (struct ieee80211_device *dev,u8 channel);int ToLegalChannel (struct ieee80211_device *dev,u8 channel);#endif /* #ifndef __INC_DOT11D_H */
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +3 -3
@@ -2439,7 +2439,7 @@ static inline void ieee80211_process_probe_response(// then wireless adapter should do active scan from ch1~11 and // passive scan from ch12~14 -if (!IsLegalChannel (ieee, network->channel)) +if (!is_legal_channel (ieee, network->channel)) goto out;if (ieee->bGlobalDomain) {
@@ -2448,7 +2448,7 @@ static inline void ieee80211_process_probe_response(// Case 1: Country code if (IS_COUNTRY_IE_VALID (ieee) ) { -if (!IsLegalChannel (ieee, network->channel)) { +if (!is_legal_channel (ieee, network->channel)) {printk ("GetScanInfo(): For Country code, filter probe response at channel(%d).\n" , network->channel); goto out; }
@@ -2469,7 +2469,7 @@ static inline void ieee80211_process_probe_response(// Case 1: Country code if (IS_COUNTRY_IE_VALID (ieee) ) { -if (!IsLegalChannel (ieee, network->channel)) { +if (!is_legal_channel (ieee, network->channel)) {printk ("GetScanInfo(): For Country code, filter beacon at channel(%d).\n" ,network->channel); goto out; }
drivers/staging/rtl8192u/r819xU_phy.c +1 -1
@@ -1271,7 +1271,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,RT_TRACE (COMP_CH ,"%s() stage: %d, step: %d, channel: %d\n" , __func__, *stage, *step, channel); -if (!IsLegalChannel (priv->ieee80211, channel)) { +if (!is_legal_channel (priv->ieee80211, channel)) {RT_TRACE (COMP_ERR ,"set to illegal channel: %d\n" , channel);/* return true to tell upper caller function this channel * setting is finished! Or it will in while loop.
Signature · 1 line
2.18.0
PATCH v2 15/15 staging:rtl8192u: Rename ToLegalChannel - Style
In reply to John WhitmoreRename the function ToLegalChannel, which causes a checkpatch issue due to its use of CamelCase naming. The function has been renamed to to_legal_channel.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/ieee80211/dot11d.c | 4 ++-- drivers/staging/rtl8192u/ieee80211/dot11d.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +2 -2
@@ -150,7 +150,7 @@ int is_legal_channel(struct ieee80211_device *dev, u8 channel) }EXPORT_SYMBOL (is_legal_channel); -int ToLegalChannel (struct ieee80211_device *dev,u8 channel) +int to_legal_channel (struct ieee80211_device *dev,u8 channel) {struct rt_dot11d_info *pDot11dInfo =GET_DOT11D_INFO (dev);u8 default_chn =0 ;
@@ -173,4 +173,4 @@ int ToLegalChannel(struct ieee80211_device *dev, u8 channel)return default_chn; } -EXPORT_SYMBOL (ToLegalChannel); +EXPORT_SYMBOL (to_legal_channel);
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -52,6 +52,6 @@ void dot11d_update_country_ie(struct ieee80211_device *dev,u8 dot11d_get_max_tx_pwr_in_dbm (struct ieee80211_device *dev,u8 channel);void dot11d_scan_complete (struct ieee80211_device *dev);int is_legal_channel (struct ieee80211_device *dev,u8 channel); -int ToLegalChannel (struct ieee80211_device *dev,u8 channel); +int to_legal_channel (struct ieee80211_device *dev,u8 channel);#endif /* #ifndef __INC_DOT11D_H */
Signature · 1 line
2.18.0