diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-22 12:02:05 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-10-07 18:51:36 -0400 |
commit | facd982e8246ed25a049d270a71513fb11b901ec (patch) | |
tree | 98f5a4da059171153b7c5ab5aaab6f66c0f77202 | |
parent | 635b85b42796a6ab4e6a31cde78f1d9660c9c4a0 (diff) |
iwlwifi: move iwl_toggle_rx_ant to agn
The iwl_toggle_tx_ant function is only used
by agn code, so it can be moved into the
agn module instead of being exported from
the core.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 2 |
4 files changed, 19 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index 3eeab0a99def..9f1c93bbb01c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -2205,3 +2205,20 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
2205 | WARN_ON(active_rx_cnt == 0 || idle_rx_cnt == 0 || | 2205 | WARN_ON(active_rx_cnt == 0 || idle_rx_cnt == 0 || |
2206 | active_rx_cnt < idle_rx_cnt); | 2206 | active_rx_cnt < idle_rx_cnt); |
2207 | } | 2207 | } |
2208 | |||
2209 | u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant, u8 valid) | ||
2210 | { | ||
2211 | int i; | ||
2212 | u8 ind = ant; | ||
2213 | |||
2214 | if (priv->band == IEEE80211_BAND_2GHZ && | ||
2215 | priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH) | ||
2216 | return 0; | ||
2217 | |||
2218 | for (i = 0; i < RATE_ANT_NUM - 1; i++) { | ||
2219 | ind = (ind + 1) < RATE_ANT_NUM ? ind + 1 : 0; | ||
2220 | if (valid & BIT(ind)) | ||
2221 | return ind; | ||
2222 | } | ||
2223 | return ant; | ||
2224 | } | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index d6645ec9ec5b..cc7a3b56cfe5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -216,6 +216,8 @@ static inline bool iwl_is_tx_success(u32 status) | |||
216 | (status == TX_STATUS_DIRECT_DONE); | 216 | (status == TX_STATUS_DIRECT_DONE); |
217 | } | 217 | } |
218 | 218 | ||
219 | u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant_idx, u8 valid); | ||
220 | |||
219 | /* rx */ | 221 | /* rx */ |
220 | void iwl_rx_missed_beacon_notif(struct iwl_priv *priv, | 222 | void iwl_rx_missed_beacon_notif(struct iwl_priv *priv, |
221 | struct iwl_rx_mem_buffer *rxb); | 223 | struct iwl_rx_mem_buffer *rxb); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 295038450a01..88c1ed5b7dd7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -72,24 +72,6 @@ MODULE_PARM_DESC(bt_coex_active, "enable wifi/bluetooth co-exist"); | |||
72 | u32 iwl_debug_level; | 72 | u32 iwl_debug_level; |
73 | EXPORT_SYMBOL(iwl_debug_level); | 73 | EXPORT_SYMBOL(iwl_debug_level); |
74 | 74 | ||
75 | u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant, u8 valid) | ||
76 | { | ||
77 | int i; | ||
78 | u8 ind = ant; | ||
79 | |||
80 | if (priv->band == IEEE80211_BAND_2GHZ && | ||
81 | priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH) | ||
82 | return 0; | ||
83 | |||
84 | for (i = 0; i < RATE_ANT_NUM - 1; i++) { | ||
85 | ind = (ind + 1) < RATE_ANT_NUM ? ind + 1 : 0; | ||
86 | if (valid & BIT(ind)) | ||
87 | return ind; | ||
88 | } | ||
89 | return ant; | ||
90 | } | ||
91 | EXPORT_SYMBOL(iwl_toggle_tx_ant); | ||
92 | |||
93 | const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | 75 | const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
94 | EXPORT_SYMBOL(iwl_bcast_addr); | 76 | EXPORT_SYMBOL(iwl_bcast_addr); |
95 | 77 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 56251de85100..0bc7b7a28a30 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -550,8 +550,6 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force); | |||
550 | u8 iwl_rate_get_lowest_plcp(struct iwl_priv *priv, | 550 | u8 iwl_rate_get_lowest_plcp(struct iwl_priv *priv, |
551 | struct iwl_rxon_context *ctx); | 551 | struct iwl_rxon_context *ctx); |
552 | 552 | ||
553 | u8 iwl_toggle_tx_ant(struct iwl_priv *priv, u8 ant_idx, u8 valid); | ||
554 | |||
555 | static inline u32 iwl_ant_idx_to_flags(u8 ant_idx) | 553 | static inline u32 iwl_ant_idx_to_flags(u8 ant_idx) |
556 | { | 554 | { |
557 | return BIT(ant_idx) << RATE_MCS_ANT_POS; | 555 | return BIT(ant_idx) << RATE_MCS_ANT_POS; |