aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2011-09-19 15:34:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-20 14:43:50 -0400
commitda3ba88a9996cd64c6768bed5727e02da81e2c8d (patch)
treead6b874767b6aa89c6c1e12df63d24026c6fa296 /drivers/net
parent87b6d09225506236c58bf407f9b750591a3b3a7b (diff)
rtlwifi: Combine instances of RTL_HAL_IS_CCK_RATE macros.
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.h6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/mac.h6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.h6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/def.h2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c2
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h6
6 files changed, 8 insertions, 20 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
index 81ae64234f80..c8977a50ca36 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
@@ -537,12 +537,6 @@ do { \
537 memset(__pdesc, 0, _size); \ 537 memset(__pdesc, 0, _size); \
538} while (0); 538} while (0);
539 539
540#define RX_HAL_IS_CCK_RATE(_pdesc)\
541 (_pdesc->rxmcs == DESC92_RATE1M || \
542 _pdesc->rxmcs == DESC92_RATE2M || \
543 _pdesc->rxmcs == DESC92_RATE5_5M || \
544 _pdesc->rxmcs == DESC92_RATE11M)
545
546struct rx_fwinfo_92c { 540struct rx_fwinfo_92c {
547 u8 gain_trsw[4]; 541 u8 gain_trsw[4];
548 u8 pwdb_all; 542 u8 pwdb_all;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
index 35529f701fc0..626d88e88e26 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
@@ -87,12 +87,6 @@ void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);
87 87
88u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw); 88u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
89 89
90#define RX_HAL_IS_CCK_RATE(_pdesc)\
91 (GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||\
92 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||\
93 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
94 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE11M)
95
96struct rx_fwinfo_92c { 90struct rx_fwinfo_92c {
97 u8 gain_trsw[4]; 91 u8 gain_trsw[4];
98 u8 pwdb_all; 92 u8 pwdb_all;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
index 6c2236868c9a..4d55d0b6816d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
@@ -537,12 +537,6 @@ do { \
537 memset((void *)__pdesc, 0, _size); \ 537 memset((void *)__pdesc, 0, _size); \
538} while (0); 538} while (0);
539 539
540#define RX_HAL_IS_CCK_RATE(_pdesc)\
541 (_pdesc->rxmcs == DESC92_RATE1M || \
542 _pdesc->rxmcs == DESC92_RATE2M || \
543 _pdesc->rxmcs == DESC92_RATE5_5M || \
544 _pdesc->rxmcs == DESC92_RATE11M)
545
546/* For 92D early mode */ 540/* For 92D early mode */
547#define SET_EARLYMODE_PKTNUM(__paddr, __value) \ 541#define SET_EARLYMODE_PKTNUM(__paddr, __value) \
548 SET_BITS_OFFSET_LE(__paddr, 0, 3, __value) 542 SET_BITS_OFFSET_LE(__paddr, 0, 3, __value)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
index 68204ea175dd..c6c044816d39 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
@@ -459,7 +459,7 @@ do { \
459#define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val) \ 459#define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val) \
460 SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val) 460 SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)
461 461
462#define RX_HAL_IS_CCK_RATE(_pdesc)\ 462#define SE_RX_HAL_IS_CCK_RATE(_pdesc)\
463 (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M || \ 463 (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M || \
464 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE2M || \ 464 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE2M || \
465 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\ 465 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index d9aeae7f8bdb..ba137da082b5 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -126,7 +126,7 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
126 bool in_powersavemode = false; 126 bool in_powersavemode = false;
127 bool is_cck_rate; 127 bool is_cck_rate;
128 128
129 is_cck_rate = RX_HAL_IS_CCK_RATE(pdesc); 129 is_cck_rate = SE_RX_HAL_IS_CCK_RATE(pdesc);
130 pstats->packet_matchbssid = packet_match_bssid; 130 pstats->packet_matchbssid = packet_match_bssid;
131 pstats->packet_toself = packet_toself; 131 pstats->packet_toself = packet_toself;
132 pstats->is_cck = is_cck_rate; 132 pstats->is_cck = is_cck_rate;
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 8a9091968f31..615f6b4463e6 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -165,6 +165,12 @@ enum hardware_type {
165#define IS_HARDWARE_TYPE_8723U(rtlhal) \ 165#define IS_HARDWARE_TYPE_8723U(rtlhal) \
166 (rtlhal->hw_type == HARDWARE_TYPE_RTL8723U) 166 (rtlhal->hw_type == HARDWARE_TYPE_RTL8723U)
167 167
168#define RX_HAL_IS_CCK_RATE(_pdesc)\
169 (_pdesc->rxmcs == DESC92_RATE1M || \
170 _pdesc->rxmcs == DESC92_RATE2M || \
171 _pdesc->rxmcs == DESC92_RATE5_5M || \
172 _pdesc->rxmcs == DESC92_RATE11M)
173
168enum scan_operation_backup_opt { 174enum scan_operation_backup_opt {
169 SCAN_OPT_BACKUP = 0, 175 SCAN_OPT_BACKUP = 0,
170 SCAN_OPT_RESTORE, 176 SCAN_OPT_RESTORE,