Subject: [PATCH 2/32] rt2x00: use enumerations

From: Ivo van Doorn <[email-masked]>
Date: Fri, 28 Apr 2006 00:02:50 +0200

From: Ivo van Doorn <[email-masked]>

The led_mode defines are equal in all drivers,
and should be placed in the common rt2x00.h header.
Make the led_mode, tx_status and dev_state defines
into enumerations.

Signed-off-by: Ivo van Doorn <[email-masked]>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.h	2006-04-27 00:52:56.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.h	2006-04-27 21:25:33.000000000 +0200
@@ -936,11 +936,6 @@ struct rt2x00_pci{
 	 * Led status
 	 */
 	u8					led_mode;
-#define LED_MODE_DEFAULT			0
-#define LED_MODE_TXRX_ACTIVITY 			1
-#define LED_MODE_SINGLE				2
-#define LED_MODE_ASUS				3
-#define LED_MODE_ALPHA				4
 
 	/*
 	 * EEPROM BBP data.
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-04-27 00:52:56.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-04-27 21:25:33.000000000 +0200
@@ -1192,11 +1192,6 @@ struct rt2x00_pci{
 	 * Led status
 	 */
 	u8					led_mode;
-#define LED_MODE_DEFAULT			0
-#define LED_MODE_TXRX_ACTIVITY 			1
-#define LED_MODE_SINGLE				2
-#define LED_MODE_ASUS				3
-#define LED_MODE_ALPHA				4
 
 	/*
 	 * EEPROM BBP data.
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.h	2006-04-27 00:52:56.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.h	2006-04-27 21:25:33.000000000 +0200
@@ -691,11 +691,6 @@ struct rt2x00_usb{
 	 * Led status
 	 */
 	u8					led_mode;
-#define LED_MODE_DEFAULT			0
-#define LED_MODE_TXRX_ACTIVITY 			1
-#define LED_MODE_SINGLE				2
-#define LED_MODE_ASUS				3
-#define LED_MODE_ALPHA				4
 
 	/*
 	 * EEPROM BBP data.
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00.h	2006-04-27 21:23:26.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00.h	2006-04-27 21:25:33.000000000 +0200
@@ -96,11 +96,34 @@ static int rt2x00_debug_level = 0;
 /*
  * TX result flags.
  */
-#define TX_SUCCESS			0
-#define TX_SUCCESS_RETRY		1
-#define TX_FAIL_RETRY			2
-#define TX_FAIL_INVALID			3
-#define TX_FAIL_OTHER			4
+enum TX_STATUS {
+	TX_SUCCESS			= 0,
+	TX_SUCCESS_RETRY		= 1,
+	TX_FAIL_RETRY			= 2,
+	TX_FAIL_INVALID			= 3,
+	TX_FAIL_OTHER			= 4,
+};
+
+/*
+ * Led mode values.
+ */
+enum led_mode {
+	LED_MODE_DEFAULT		= 0,
+	LED_MODE_TXRX_ACTIVITY 		= 1,
+	LED_MODE_SIGNAL_STRENGTH	= 2,
+	LED_MODE_ASUS			= 3,
+	LED_MODE_ALPHA			= 4,
+};
+
+/*
+ * Device states
+ */
+enum dev_state {
+	STATE_DEEP_SLEEP		= 0,
+	STATE_SLEEP			= 1,
+	STATE_STANDBY			= 2,
+	STATE_AWAKE			= 3,
+};
 
 /*
  * Macros for determining which is the lowest or highest bit