Skip to content

Commit

Permalink
staging: rtl8187se: Convert _WIRELESS_MODE into a enum.
Browse files Browse the repository at this point in the history
The Documentation/CodingStyle doesn't recommend the use of typedef,
convert this to enum.

While at it, I have also renamed the variable names that were used in
this typedef not to use Hungarian notation.

Signed-off-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
  • Loading branch information
Ana Rey authored and Peter P Waskiewicz Jr committed Mar 13, 2014
1 parent 4379cad commit 066ad08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/rtl8187se/r8180.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
/* +by amy 080312. */
#define RATE_ADAPTIVE_TIMER_PERIOD 300

typedef enum _WIRELESS_MODE {
enum wireless_mode {
WIRELESS_MODE_UNKNOWN = 0x00,
WIRELESS_MODE_A = 0x01,
WIRELESS_MODE_B = 0x02,
WIRELESS_MODE_G = 0x04,
WIRELESS_MODE_AUTO = 0x08,
} WIRELESS_MODE;
};

struct chnl_access_setting {
u16 sifs_timer;
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/rtl8187se/r8180_rtl8225z2.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ void rtl8225z2_rf_close(struct net_device *dev)
* Map dBm into Tx power index according to current HW model, for example,
* RF and PA, and current wireless mode.
*/
static s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode,
s32 PowerInDbm)
static s8 DbmToTxPwrIdx(struct r8180_priv *priv,
enum wireless_mode mode, s32 PowerInDbm)
{
bool bUseDefault = true;
s8 TxPwrIdx = 0;
Expand All @@ -291,7 +291,7 @@ static s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode,
*/
s32 tmp = 0;

if (WirelessMode == WIRELESS_MODE_G) {
if (mode == WIRELESS_MODE_G) {
bUseDefault = false;
tmp = (2 * PowerInDbm);

Expand All @@ -301,7 +301,7 @@ static s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode,
TxPwrIdx = 40;
else
TxPwrIdx = (s8)tmp;
} else if (WirelessMode == WIRELESS_MODE_B) {
} else if (mode == WIRELESS_MODE_B) {
bUseDefault = false;
tmp = (4 * PowerInDbm) - 52;

Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/rtl8187se/r8185b_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ static u8 GetSupportedWirelessMode8185(struct net_device *dev)

static void
ActUpdateChannelAccessSetting(struct net_device *dev,
WIRELESS_MODE WirelessMode,
enum wireless_mode mode,
struct chnl_access_setting *chnl_access_setting)
{
AC_CODING eACI;
Expand Down Expand Up @@ -959,7 +959,7 @@ static void ActSetWirelessMode8185(struct net_device *dev, u8 btWirelessMode)
* wireless mode if we switch to specified band successfully.
*/

ieee->mode = (WIRELESS_MODE)btWirelessMode;
ieee->mode = (enum wireless_mode)btWirelessMode;

/* 3. Change related setting. */
if (ieee->mode == WIRELESS_MODE_A)
Expand Down Expand Up @@ -1385,7 +1385,7 @@ void rtl8185b_adapter_start(struct net_device *dev)

/* Initialize RegWirelessMode if it is not a valid one. */
if (bInvalidWirelessMode)
ieee->mode = (WIRELESS_MODE)InitWirelessMode;
ieee->mode = (enum wireless_mode)InitWirelessMode;

} else {
/* One of B, G, A. */
Expand Down

0 comments on commit 066ad08

Please sign in to comment.