diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-09-16 02:01:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-24 16:17:59 -0400 |
commit | 9e5e6c327defcef19dabad64335ee68bb55b2355 (patch) | |
tree | ccc72604996600edc1c64f9253d552e64499c490 | |
parent | 9ccacb86b5c613b25f41ca4227c3fb17bcd77de0 (diff) |
iwlwifi: make PS use named constants
This patch adds named constants for configuring MIMO power save
chain settings.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index d80184ee911c..8203887ca00c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -697,8 +697,12 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info) | |||
697 | } | 697 | } |
698 | EXPORT_SYMBOL(iwl_set_rxon_ht); | 698 | EXPORT_SYMBOL(iwl_set_rxon_ht); |
699 | 699 | ||
700 | /* | 700 | #define IWL_NUM_RX_CHAINS_MULTIPLE 3 |
701 | * Determine how many receiver/antenna chains to use. | 701 | #define IWL_NUM_RX_CHAINS_SINGLE 2 |
702 | #define IWL_NUM_IDLE_CHAINS_DUAL 2 | ||
703 | #define IWL_NUM_IDLE_CHAINS_SINGLE 1 | ||
704 | |||
705 | /* Determine how many receiver/antenna chains to use. | ||
702 | * More provides better reception via diversity. Fewer saves power. | 706 | * More provides better reception via diversity. Fewer saves power. |
703 | * MIMO (dual stream) requires at least 2, but works better with 3. | 707 | * MIMO (dual stream) requires at least 2, but works better with 3. |
704 | * This does not determine *which* chains to use, just how many. | 708 | * This does not determine *which* chains to use, just how many. |
@@ -711,9 +715,9 @@ static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) | |||
711 | /* # of Rx chains to use when expecting MIMO. */ | 715 | /* # of Rx chains to use when expecting MIMO. */ |
712 | if (is_single || (!is_cam && (priv->current_ht_config.sm_ps == | 716 | if (is_single || (!is_cam && (priv->current_ht_config.sm_ps == |
713 | WLAN_HT_CAP_SM_PS_STATIC))) | 717 | WLAN_HT_CAP_SM_PS_STATIC))) |
714 | return 2; | 718 | return IWL_NUM_RX_CHAINS_SINGLE; |
715 | else | 719 | else |
716 | return 3; | 720 | return IWL_NUM_RX_CHAINS_MULTIPLE; |
717 | } | 721 | } |
718 | 722 | ||
719 | static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) | 723 | static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) |
@@ -724,10 +728,11 @@ static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) | |||
724 | switch (priv->current_ht_config.sm_ps) { | 728 | switch (priv->current_ht_config.sm_ps) { |
725 | case WLAN_HT_CAP_SM_PS_STATIC: | 729 | case WLAN_HT_CAP_SM_PS_STATIC: |
726 | case WLAN_HT_CAP_SM_PS_DYNAMIC: | 730 | case WLAN_HT_CAP_SM_PS_DYNAMIC: |
727 | idle_cnt = (is_cam) ? 2 : 1; | 731 | idle_cnt = (is_cam) ? IWL_NUM_IDLE_CHAINS_DUAL : |
732 | IWL_NUM_IDLE_CHAINS_SINGLE; | ||
728 | break; | 733 | break; |
729 | case WLAN_HT_CAP_SM_PS_DISABLED: | 734 | case WLAN_HT_CAP_SM_PS_DISABLED: |
730 | idle_cnt = (is_cam) ? active_cnt : 1; | 735 | idle_cnt = (is_cam) ? active_cnt : IWL_NUM_IDLE_CHAINS_SINGLE; |
731 | break; | 736 | break; |
732 | case WLAN_HT_CAP_SM_PS_INVALID: | 737 | case WLAN_HT_CAP_SM_PS_INVALID: |
733 | default: | 738 | default: |
@@ -796,7 +801,7 @@ void iwl_set_rxon_chain(struct iwl_priv *priv) | |||
796 | 801 | ||
797 | priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain); | 802 | priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain); |
798 | 803 | ||
799 | if (!is_single && (active_rx_cnt >= 2) && is_cam) | 804 | if (!is_single && (active_rx_cnt >= IWL_NUM_RX_CHAINS_SINGLE) && is_cam) |
800 | priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; | 805 | priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; |
801 | else | 806 | else |
802 | priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; | 807 | priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; |