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

Staging: winbond: wb35reg_s.h Coding styls fixes.

I fixed all problems reported by checkpatch.pl except
some long lines. I also removed commented away code and
revision comments.
Checked for regressions with Dan Carpenters
strip_whitespace.pl and diff.

Signed-off-by: Lars Lindley <lindley@coyote.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Lars Lindley and committed by
Greg Kroah-Hartman
25e47dfc d4279a9f

+104 -105
+104 -105
drivers/staging/winbond/wb35reg_s.h
··· 5 5 #include <linux/types.h> 6 6 #include <asm/atomic.h> 7 7 8 - //======================================================================================= 9 - /* 10 - HAL setting function 8 + /* ========================================================================= 9 + * 10 + * HAL setting function 11 + * 12 + * ======================================== 13 + * |Uxx| |Dxx| |Mxx| |BB| |RF| 14 + * ======================================== 15 + * | | 16 + * Wb35Reg_Read Wb35Reg_Write 17 + * 18 + * ---------------------------------------- 19 + * WbUsb_CallUSBDASync supplied By WbUsb module 20 + * ========================================================================== 21 + */ 22 + #define GetBit(dwData, i) (dwData & (0x00000001 << i)) 23 + #define SetBit(dwData, i) (dwData | (0x00000001 << i)) 24 + #define ClearBit(dwData, i) (dwData & ~(0x00000001 << i)) 11 25 12 - ======================================== 13 - |Uxx| |Dxx| |Mxx| |BB| |RF| 14 - ======================================== 15 - | | 16 - Wb35Reg_Read Wb35Reg_Write 26 + #define IGNORE_INCREMENT 0 27 + #define AUTO_INCREMENT 0 28 + #define NO_INCREMENT 1 29 + #define REG_DIRECTION(_x, _y) ((_y)->DIRECT == 0 ? usb_rcvctrlpipe(_x, 0) : usb_sndctrlpipe(_x, 0)) 30 + #define REG_BUF_SIZE(_x) ((_x)->bRequest == 0x04 ? cpu_to_le16((_x)->wLength) : 4) 17 31 18 - ---------------------------------------- 19 - WbUsb_CallUSBDASync supplied By WbUsb module 20 - */ 21 - //======================================================================================= 22 - 23 - #define GetBit( dwData, i) ( dwData & (0x00000001 << i)) 24 - #define SetBit( dwData, i) ( dwData | (0x00000001 << i)) 25 - #define ClearBit( dwData, i) ( dwData & ~(0x00000001 << i)) 26 - 27 - #define IGNORE_INCREMENT 0 28 - #define AUTO_INCREMENT 0 29 - #define NO_INCREMENT 1 30 - #define REG_DIRECTION(_x,_y) ((_y)->DIRECT ==0 ? usb_rcvctrlpipe(_x,0) : usb_sndctrlpipe(_x,0)) 31 - #define REG_BUF_SIZE(_x) ((_x)->bRequest== 0x04 ? cpu_to_le16((_x)->wLength) : 4) 32 - 33 - // 20060613.2 Add the follow definition 34 32 #define BB48_DEFAULT_AL2230_11B 0x0033447c 35 33 #define BB4C_DEFAULT_AL2230_11B 0x0A00FEFF 36 34 #define BB48_DEFAULT_AL2230_11G 0x00332C1B 37 35 #define BB4C_DEFAULT_AL2230_11G 0x0A00FEFF 38 36 39 37 40 - #define BB48_DEFAULT_WB242_11B 0x00292315 //backoff 2dB 41 - #define BB4C_DEFAULT_WB242_11B 0x0800FEFF //backoff 2dB 42 - //#define BB48_DEFAULT_WB242_11B 0x00201B11 //backoff 4dB 43 - //#define BB4C_DEFAULT_WB242_11B 0x0600FF00 //backoff 4dB 38 + #define BB48_DEFAULT_WB242_11B 0x00292315 /* backoff 2dB */ 39 + #define BB4C_DEFAULT_WB242_11B 0x0800FEFF /* backoff 2dB */ 44 40 #define BB48_DEFAULT_WB242_11G 0x00453B24 45 41 #define BB4C_DEFAULT_WB242_11G 0x0E00FEFF 46 42 47 - //==================================== 48 - // Default setting for Mxx 49 - //==================================== 50 - #define DEFAULT_CWMIN 31 //(M2C) CWmin. Its value is in the range 0-31. 51 - #define DEFAULT_CWMAX 1023 //(M2C) CWmax. Its value is in the range 0-1023. 52 - #define DEFAULT_AID 1 //(M34) AID. Its value is in the range 1-2007. 43 + /* 44 + * ==================================== 45 + * Default setting for Mxx 46 + * ==================================== 47 + */ 48 + #define DEFAULT_CWMIN 31 /* (M2C) CWmin. Its value is in the range 0-31. */ 49 + #define DEFAULT_CWMAX 1023 /* (M2C) CWmax. Its value is in the range 0-1023. */ 50 + #define DEFAULT_AID 1 /* (M34) AID. Its value is in the range 1-2007. */ 53 51 54 52 #ifdef _USE_FALLBACK_RATE_ 55 - #define DEFAULT_RATE_RETRY_LIMIT 2 //(M38) as named 53 + #define DEFAULT_RATE_RETRY_LIMIT 2 /* (M38) as named */ 56 54 #else 57 - #define DEFAULT_RATE_RETRY_LIMIT 7 //(M38) as named 55 + #define DEFAULT_RATE_RETRY_LIMIT 7 /* (M38) as named */ 58 56 #endif 59 57 60 - #define DEFAULT_LONG_RETRY_LIMIT 7 //(M38) LongRetryLimit. Its value is in the range 0-15. 61 - #define DEFAULT_SHORT_RETRY_LIMIT 7 //(M38) ShortRetryLimit. Its value is in the range 0-15. 62 - #define DEFAULT_PIFST 25 //(M3C) PIFS Time. Its value is in the range 0-65535. 63 - #define DEFAULT_EIFST 354 //(M3C) EIFS Time. Its value is in the range 0-1048575. 64 - #define DEFAULT_DIFST 45 //(M3C) DIFS Time. Its value is in the range 0-65535. 65 - #define DEFAULT_SIFST 5 //(M3C) SIFS Time. Its value is in the range 0-65535. 66 - #define DEFAULT_OSIFST 10 //(M3C) Original SIFS Time. Its value is in the range 0-15. 67 - #define DEFAULT_ATIMWD 0 //(M40) ATIM Window. Its value is in the range 0-65535. 68 - #define DEFAULT_SLOT_TIME 20 //(M40) ($) SlotTime. Its value is in the range 0-255. 69 - #define DEFAULT_MAX_TX_MSDU_LIFE_TIME 512 //(M44) MaxTxMSDULifeTime. Its value is in the range 0-4294967295. 70 - #define DEFAULT_BEACON_INTERVAL 500 //(M48) Beacon Interval. Its value is in the range 0-65535. 71 - #define DEFAULT_PROBE_DELAY_TIME 200 //(M48) Probe Delay Time. Its value is in the range 0-65535. 72 - #define DEFAULT_PROTOCOL_VERSION 0 //(M4C) 73 - #define DEFAULT_MAC_POWER_STATE 2 //(M4C) 2: MAC at power active 74 - #define DEFAULT_DTIM_ALERT_TIME 0 58 + #define DEFAULT_LONG_RETRY_LIMIT 7 /* (M38) LongRetryLimit. Its value is in the range 0-15. */ 59 + #define DEFAULT_SHORT_RETRY_LIMIT 7 /* (M38) ShortRetryLimit. Its value is in the range 0-15. */ 60 + #define DEFAULT_PIFST 25 /* (M3C) PIFS Time. Its value is in the range 0-65535. */ 61 + #define DEFAULT_EIFST 354 /* (M3C) EIFS Time. Its value is in the range 0-1048575. */ 62 + #define DEFAULT_DIFST 45 /* (M3C) DIFS Time. Its value is in the range 0-65535. */ 63 + #define DEFAULT_SIFST 5 /* (M3C) SIFS Time. Its value is in the range 0-65535. */ 64 + #define DEFAULT_OSIFST 10 /* (M3C) Original SIFS Time. Its value is in the range 0-15. */ 65 + #define DEFAULT_ATIMWD 0 /* (M40) ATIM Window. Its value is in the range 0-65535. */ 66 + #define DEFAULT_SLOT_TIME 20 /* (M40) ($) SlotTime. Its value is in the range 0-255. */ 67 + #define DEFAULT_MAX_TX_MSDU_LIFE_TIME 512 /* (M44) MaxTxMSDULifeTime. Its value is in the range 0-4294967295. */ 68 + #define DEFAULT_BEACON_INTERVAL 500 /* (M48) Beacon Interval. Its value is in the range 0-65535. */ 69 + #define DEFAULT_PROBE_DELAY_TIME 200 /* (M48) Probe Delay Time. Its value is in the range 0-65535. */ 70 + #define DEFAULT_PROTOCOL_VERSION 0 /* (M4C) */ 71 + #define DEFAULT_MAC_POWER_STATE 2 /* (M4C) 2: MAC at power active */ 72 + #define DEFAULT_DTIM_ALERT_TIME 0 75 73 76 74 77 75 struct wb35_reg_queue { 78 - struct urb *urb; 76 + struct urb *urb; 79 77 void *pUsbReq; 80 78 void *Next; 81 79 union { 82 80 u32 VALUE; 83 81 u32 *pBuffer; 84 82 }; 85 - u8 RESERVED[4]; // space reserved for communication 86 - u16 INDEX; // For storing the register index 87 - u8 RESERVED_VALID; // Indicate whether the RESERVED space is valid at this command. 88 - u8 DIRECT; // 0:In 1:Out 83 + u8 RESERVED[4]; /* space reserved for communication */ 84 + u16 INDEX; /* For storing the register index */ 85 + u8 RESERVED_VALID; /* Indicate whether the RESERVED space is valid at this command. */ 86 + u8 DIRECT; /* 0:In 1:Out */ 89 87 }; 90 88 91 - //==================================== 92 - // Internal variable for module 93 - //==================================== 89 + /* 90 + * ==================================== 91 + * Internal variable for module 92 + * ==================================== 93 + */ 94 94 #define MAX_SQ3_FILTER_SIZE 5 95 95 struct wb35_reg { 96 - //============================ 97 - // Register Bank backup 98 - //============================ 99 - u32 U1B0; //bit16 record the h/w radio on/off status 96 + /* 97 + * ============================ 98 + * Register Bank backup 99 + * ============================ 100 + */ 101 + u32 U1B0; /* bit16 record the h/w radio on/off status */ 100 102 u32 U1BC_LEDConfigure; 101 103 u32 D00_DmaControl; 102 104 u32 M00_MacControl; ··· 107 105 u32 M04_MulticastAddress1; 108 106 u32 M08_MulticastAddress2; 109 107 }; 110 - u8 Multicast[8]; // contents of card multicast registers 108 + u8 Multicast[8]; /* contents of card multicast registers */ 111 109 }; 112 110 113 111 u32 M24_MacControl; 114 112 u32 M28_MacControl; 115 113 u32 M2C_MacControl; 116 114 u32 M38_MacControl; 117 - u32 M3C_MacControl; // 20060214 backup only 115 + u32 M3C_MacControl; 118 116 u32 M40_MacControl; 119 - u32 M44_MacControl; // 20060214 backup only 120 - u32 M48_MacControl; // 20060214 backup only 117 + u32 M44_MacControl; 118 + u32 M48_MacControl; 121 119 u32 M4C_MacStatus; 122 - u32 M60_MacControl; // 20060214 backup only 123 - u32 M68_MacControl; // 20060214 backup only 124 - u32 M70_MacControl; // 20060214 backup only 125 - u32 M74_MacControl; // 20060214 backup only 126 - u32 M78_ERPInformation;//930206.2.b 127 - u32 M7C_MacControl; // 20060214 backup only 128 - u32 M80_MacControl; // 20060214 backup only 129 - u32 M84_MacControl; // 20060214 backup only 130 - u32 M88_MacControl; // 20060214 backup only 131 - u32 M98_MacControl; // 20060214 backup only 120 + u32 M60_MacControl; 121 + u32 M68_MacControl; 122 + u32 M70_MacControl; 123 + u32 M74_MacControl; 124 + u32 M78_ERPInformation; 125 + u32 M7C_MacControl; 126 + u32 M80_MacControl; 127 + u32 M84_MacControl; 128 + u32 M88_MacControl; 129 + u32 M98_MacControl; 132 130 133 - //[20040722 WK] 134 - //Baseband register 135 - u32 BB0C; // Used for LNA calculation 136 - u32 BB2C; // 137 - u32 BB30; //11b acquisition control register 131 + /* Baseband register */ 132 + u32 BB0C; /* Used for LNA calculation */ 133 + u32 BB2C; 134 + u32 BB30; /* 11b acquisition control register */ 138 135 u32 BB3C; 139 - u32 BB48; // 20051221.1.a 20060613.1 Fix OBW issue of 11b/11g rate 140 - u32 BB4C; // 20060613.1 Fix OBW issue of 11b/11g rate 141 - u32 BB50; //mode control register 136 + u32 BB48; 137 + u32 BB4C; 138 + u32 BB50; /* mode control register */ 142 139 u32 BB54; 143 - u32 BB58; //IQ_ALPHA 144 - u32 BB5C; // For test 145 - u32 BB60; // for WTO read value 140 + u32 BB58; /* IQ_ALPHA */ 141 + u32 BB5C; /* For test */ 142 + u32 BB60; /* for WTO read value */ 146 143 147 - //------------------- 148 - // VM 149 - //------------------- 150 - spinlock_t EP0VM_spin_lock; // 4B 151 - u32 EP0VM_status;//$$ 144 + /* VM */ 145 + spinlock_t EP0VM_spin_lock; /* 4B */ 146 + u32 EP0VM_status; /* $$ */ 152 147 struct wb35_reg_queue *reg_first; 153 148 struct wb35_reg_queue *reg_last; 154 - atomic_t RegFireCount; 149 + atomic_t RegFireCount; 155 150 156 - // Hardware status 151 + /* Hardware status */ 157 152 u8 EP0vm_state; 158 153 u8 mac_power_save; 159 - u8 EEPROMPhyType; // 0 ~ 15 for Maxim (0 ĄV MAX2825, 1 ĄV MAX2827, 2 ĄV MAX2828, 3 ĄV MAX2829), 160 - // 16 ~ 31 for Airoha (16 ĄV AL2230, 11 - AL7230) 161 - // 32 ~ Reserved 162 - // 33 ~ 47 For WB242 ( 33 - WB242, 34 - WB242 with new Txvga 0.5 db step) 163 - // 48 ~ 255 ARE RESERVED. 164 - u8 EEPROMRegion; //Region setting in EEPROM 154 + u8 EEPROMPhyType; /* 155 + * 0 ~ 15 for Maxim (0 ĄV MAX2825, 1 ĄV MAX2827, 2 ĄV MAX2828, 3 ĄV MAX2829), 156 + * 16 ~ 31 for Airoha (16 ĄV AL2230, 11 - AL7230) 157 + * 32 ~ Reserved 158 + * 33 ~ 47 For WB242 ( 33 - WB242, 34 - WB242 with new Txvga 0.5 db step) 159 + * 48 ~ 255 ARE RESERVED. 160 + */ 161 + u8 EEPROMRegion; /* Region setting in EEPROM */ 165 162 166 - u32 SyncIoPause; // If user use the Sync Io to access Hw, then pause the async access 163 + u32 SyncIoPause; /* If user use the Sync Io to access Hw, then pause the async access */ 167 164 168 - u8 LNAValue[4]; //Table for speed up running 165 + u8 LNAValue[4]; /* Table for speed up running */ 169 166 u32 SQ3_filter[MAX_SQ3_FILTER_SIZE]; 170 167 u32 SQ3_index; 171 - 172 168 }; 173 - 174 169 #endif