rtlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.
authorLarry Finger <Larry.Finger@lwfinger.net>
Mon, 19 Sep 2011 19:34:10 +0000 (14:34 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 20 Sep 2011 18:43:50 +0000 (14:43 -0400)
Three drivers, rtl8192ce, rtl8192cu and rtl8192de, use the same macro
to check if a particular rate is in the CCK set. This common code is
relocated to a common header file. A distinct macro used by rtl8192se
with the same name is renamed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
drivers/net/wireless/rtlwifi/rtl8192de/trx.h
drivers/net/wireless/rtlwifi/rtl8192se/def.h
drivers/net/wireless/rtlwifi/rtl8192se/trx.c
drivers/net/wireless/rtlwifi/wifi.h

index 81ae64234f80a102a317b78cb3e3a79a263d49a7..c8977a50ca36de7b2d52f3abe8f55d4abd004e07 100644 (file)
@@ -537,12 +537,6 @@ do {                                                       \
                memset(__pdesc, 0, _size);      \
 } while (0);
 
-#define RX_HAL_IS_CCK_RATE(_pdesc)\
-       (_pdesc->rxmcs == DESC92_RATE1M ||              \
-        _pdesc->rxmcs == DESC92_RATE2M ||              \
-        _pdesc->rxmcs == DESC92_RATE5_5M ||            \
-        _pdesc->rxmcs == DESC92_RATE11M)
-
 struct rx_fwinfo_92c {
        u8 gain_trsw[4];
        u8 pwdb_all;
index 35529f701fc04b1f469cd911ccfd1aa4f5b8cb61..626d88e88e26b70c598d902c01747d8341a18965 100644 (file)
@@ -87,12 +87,6 @@ void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);
 
 u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
 
-#define RX_HAL_IS_CCK_RATE(_pdesc)\
-       (GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||\
-        GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||\
-        GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
-        GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE11M)
-
 struct rx_fwinfo_92c {
        u8 gain_trsw[4];
        u8 pwdb_all;
index 6c2236868c9aea260fd4099d007eeec48edf1731..4d55d0b6816dca21b1b4322b46be14f1e87cf7b7 100644 (file)
@@ -537,12 +537,6 @@ do {                                                       \
                memset((void *)__pdesc, 0, _size);      \
 } while (0);
 
-#define RX_HAL_IS_CCK_RATE(_pdesc)\
-       (_pdesc->rxmcs == DESC92_RATE1M ||              \
-        _pdesc->rxmcs == DESC92_RATE2M ||              \
-        _pdesc->rxmcs == DESC92_RATE5_5M ||            \
-        _pdesc->rxmcs == DESC92_RATE11M)
-
 /* For 92D early mode */
 #define SET_EARLYMODE_PKTNUM(__paddr, __value)         \
        SET_BITS_OFFSET_LE(__paddr, 0, 3, __value)
index 68204ea175ddf594898cf1a8f60cd327025caa40..c6c044816d39e585a4cf9e0625675aaf1a1d7574 100644 (file)
@@ -459,7 +459,7 @@ do {                                                                \
 #define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val)  \
        SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)
 
-#define RX_HAL_IS_CCK_RATE(_pdesc)\
+#define SE_RX_HAL_IS_CCK_RATE(_pdesc)\
        (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||  \
         GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||  \
         GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
index d9aeae7f8bdbed1e4ec68f7ab8138a2969c22802..ba137da082b5a223e86e073f93e8cc1cff319243 100644 (file)
@@ -126,7 +126,7 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
        bool in_powersavemode = false;
        bool is_cck_rate;
 
-       is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc);
+       is_cck_rate = SE_RX_HAL_IS_CCK_RATE(pdesc);
        pstats->packet_matchbssid = packet_match_bssid;
        pstats->packet_toself = packet_toself;
        pstats->is_cck = is_cck_rate;
index 8a9091968f316f449a5c7380e9ea7a738db3c76f..615f6b4463e6977b50e345f43778b4737c8a0bfe 100644 (file)
@@ -165,6 +165,12 @@ enum hardware_type {
 #define IS_HARDWARE_TYPE_8723U(rtlhal)                 \
        (rtlhal->hw_type == HARDWARE_TYPE_RTL8723U)
 
+#define RX_HAL_IS_CCK_RATE(_pdesc)\
+       (_pdesc->rxmcs == DESC92_RATE1M ||              \
+        _pdesc->rxmcs == DESC92_RATE2M ||              \
+        _pdesc->rxmcs == DESC92_RATE5_5M ||            \
+        _pdesc->rxmcs == DESC92_RATE11M)
+
 enum scan_operation_backup_opt {
        SCAN_OPT_BACKUP = 0,
        SCAN_OPT_RESTORE,