Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: rtl8192e: fix some codingstyle issues

dot11d.h needed a good refactoring - I've dropped some of the //
comments or transformed them to match the kernel documentation.
r8180_93cx6.h - fixed a little bit the copyright section.

Signed-off-by: Radu Voicilas <rvoicilas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Radu Voicilas and committed by
Greg Kroah-Hartman
789d9dbd f70615a8

+75 -80
+58 -64
drivers/staging/rtl8192e/dot11d.h
··· 1 - #ifndef __INC_DOT11D_H 2 - #define __INC_DOT11D_H 1 + #ifndef INC_DOT11D_H 2 + #define INC_DOT11D_H 3 3 4 4 #ifdef ENABLE_DOT11D 5 5 #include "ieee80211.h" 6 - 7 - //#define ENABLE_DOT11D 8 - 9 - //#define DOT11D_MAX_CHNL_NUM 83 10 6 11 7 typedef struct _CHNL_TXPOWER_TRIPLE { 12 8 u8 FirstChnl; 13 9 u8 NumChnls; 14 10 u8 MaxTxPowerInDbm; 15 - }CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; 11 + } CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE; 16 12 17 13 typedef enum _DOT11D_STATE { 18 14 DOT11D_STATE_NONE = 0, 19 15 DOT11D_STATE_LEARNED, 20 16 DOT11D_STATE_DONE, 21 - }DOT11D_STATE; 17 + } DOT11D_STATE; 18 + 19 + /** 20 + * struct _RT_DOT11D_INFO 21 + * @CountryIeLen: value greater than 0 if @CountryIeBuf contains 22 + * valid country information element. 23 + * @chanell_map: holds channel values 24 + * 0 - invalid, 25 + * 1 - valid (active scan), 26 + * 2 - valid (passive scan) 27 + * @CountryIeSrcAddr - Source AP of the country IE 28 + */ 22 29 23 30 typedef struct _RT_DOT11D_INFO { 24 - //DECLARE_RT_OBJECT(RT_DOT11D_INFO); 31 + bool bEnabled; 25 32 26 - bool bEnabled; // dot11MultiDomainCapabilityEnabled 33 + u16 CountryIeLen; 34 + u8 CountryIeBuf[MAX_IE_LEN]; 35 + u8 CountryIeSrcAddr[6]; 36 + u8 CountryIeWatchdog; 27 37 28 - u16 CountryIeLen; // > 0 if CountryIeBuf[] contains valid country information element. 29 - u8 CountryIeBuf[MAX_IE_LEN]; 30 - u8 CountryIeSrcAddr[6]; // Source AP of the country IE. 31 - u8 CountryIeWatchdog; 32 - 33 - u8 channel_map[MAX_CHANNEL_NUMBER+1]; //!!!Value 0: Invalid, 1: Valid (active scan), 2: Valid (passive scan) 34 - //u8 ChnlListLen; // #Bytes valid in ChnlList[]. 35 - //u8 ChnlList[DOT11D_MAX_CHNL_NUM]; 36 - u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; 38 + u8 channel_map[MAX_CHANNEL_NUMBER+1]; 39 + u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER+1]; 37 40 38 41 DOT11D_STATE State; 39 - }RT_DOT11D_INFO, *PRT_DOT11D_INFO; 40 - #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 ) 41 - #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]) 42 - #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO)((__pIeeeDev)->pDot11dInfo)) 42 + } RT_DOT11D_INFO, *PRT_DOT11D_INFO; 43 + 44 + #define eqMacAddr(a, b) (((a)[0] == (b)[0] && (a)[1] == (b)[1] && (a)[2] == \ 45 + (b)[2] && (a)[3] == (b)[3] && (a)[4] == (b)[4] && \ 46 + (a)[5] == (b)[5]) ? 1 : 0) 47 + 48 + #define cpMacAddr(des, src) ((des)[0] = (src)[0], (des)[1] = (src)[1], \ 49 + (des)[2] = (src)[2], (des)[3] = (src)[3], \ 50 + (des)[4] = (src)[4], (des)[5] = (src)[5]) 51 + 52 + #define GET_DOT11D_INFO(__pIeeeDev) ((PRT_DOT11D_INFO) \ 53 + ((__pIeeeDev)->pDot11dInfo)) 43 54 44 55 #define IS_DOT11D_ENABLE(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->bEnabled 45 - #define IS_COUNTRY_IE_VALID(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) 56 + #define IS_COUNTRY_IE_VALID(__pIeeeDev) \ 57 + (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0) 46 58 47 - #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) 48 - #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) 59 + #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \ 60 + eqMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) 61 + 62 + #define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \ 63 + cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa) 49 64 50 65 #define IS_COUNTRY_IE_CHANGED(__pIeeeDev, __Ie) \ 51 - (((__Ie).Length == 0 || (__Ie).Length != GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? \ 52 - FALSE : \ 53 - (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, (__Ie).Octet, (__Ie).Length))) 66 + (((__Ie).Length == 0 || (__Ie).Length != \ 67 + GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen) ? FALSE : \ 68 + (!memcmp(GET_DOT11D_INFO(__pIeeeDev)->CountryIeBuf, \ 69 + (__Ie).Octet, (__Ie).Length))) 54 70 55 71 #define CIE_WATCHDOG_TH 1 56 72 #define GET_CIE_WATCHDOG(__pIeeeDev) GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog 57 73 #define RESET_CIE_WATCHDOG(__pIeeeDev) GET_CIE_WATCHDOG(__pIeeeDev) = 0 58 74 #define UPDATE_CIE_WATCHDOG(__pIeeeDev) ++GET_CIE_WATCHDOG(__pIeeeDev) 59 75 60 - #define IS_DOT11D_STATE_DONE(__pIeeeDev) (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) 76 + #define IS_DOT11D_STATE_DONE(__pIeeeDev) \ 77 + (GET_DOT11D_INFO(__pIeeeDev)->State == DOT11D_STATE_DONE) 61 78 62 79 63 - void 64 - Dot11d_Init( 65 - struct ieee80211_device *dev 66 - ); 80 + void Dot11d_Init(struct ieee80211_device *dev); 67 81 68 - void 69 - Dot11d_Reset( 70 - struct ieee80211_device *dev 71 - ); 82 + void Dot11d_Reset(struct ieee80211_device *dev); 72 83 73 - void 74 - Dot11d_UpdateCountryIe( 75 - struct ieee80211_device *dev, 76 - u8 * pTaddr, 77 - u16 CoutryIeLen, 78 - u8 * pCoutryIe 79 - ); 84 + void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr, 85 + u16 CoutryIeLen, u8 *pCoutryIe); 80 86 81 - u8 82 - DOT11D_GetMaxTxPwrInDbm( 83 - struct ieee80211_device *dev, 84 - u8 Channel 85 - ); 87 + u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 channel); 86 88 87 - void 88 - DOT11D_ScanComplete( 89 - struct ieee80211_device * dev 90 - ); 89 + void DOT11D_ScanComplete(struct ieee80211_device *dev); 91 90 92 - int IsLegalChannel( 93 - struct ieee80211_device * dev, 94 - u8 channel 95 - ); 91 + int IsLegalChannel(struct ieee80211_device *dev, u8 channel); 96 92 97 - int ToLegalChannel( 98 - struct ieee80211_device * dev, 99 - u8 channel 100 - ); 101 - #endif //ENABLE_DOT11D 102 - #endif // #ifndef __INC_DOT11D_H 93 + int ToLegalChannel(struct ieee80211_device *dev, u8 channel); 94 + 95 + #endif /* ENABLE_DOT11D */ 96 + #endif /* INC_DOT11D_H */
+17 -16
drivers/staging/rtl8192e/r8180_93cx6.h
··· 1 - /* 2 - This is part of rtl8187 OpenSource driver 3 - Copyright (C) Andrea Merello 2004-2005 <andreamrl@tiscali.it> 4 - Released under the terms of GPL (General Public Licence) 5 - 6 - Parts of this driver are based on the GPL part of the official realtek driver 7 - Parts of this driver are based on the rtl8180 driver skeleton from Patric Schenke & Andres Salomon 8 - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver 9 - 10 - We want to tanks the Authors of such projects and the Ndiswrapper project Authors. 11 - */ 12 - 13 - /*This files contains card eeprom (93c46 or 93c56) programming routines*/ 14 - /*memory is addressed by WORDS*/ 1 + /* r8180_93cx6.h - 93c46 or 93c56 eeprom card programming routines 2 + * 3 + * This is part of rtl8187 OpenSource driver 4 + * Copyright (C) Andrea Merello 2004-2005 <andreamrl@tiscali.it> 5 + * Released under the terms of GPL (General Public Licence) 6 + * Parts of this driver are based on the GPL part of the official realtek driver 7 + * 8 + * Parts of this driver are based on the rtl8180 driver skeleton from 9 + * Patric Schenke & Andres Salomon. 10 + * 11 + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver 12 + * 13 + * We want to thank the authors of the above mentioned projects and to 14 + * the authors of the Ndiswrapper project. 15 + */ 15 16 16 17 #include "r8192E.h" 17 18 #include "r8192E_hw.h" ··· 37 36 #define EPROM_TXPW2 0x1b 38 37 #define EPROM_TXPW1 0x3d 39 38 40 - 41 - u32 eprom_read(struct net_device *dev,u32 addr); //reads a 16 bits word 39 + /* Reads a 16 bits word. */ 40 + u32 eprom_read(struct net_device *dev, u32 addr);