iwlwifi: fix check for a single rx antenna
authorEyal Shapira <eyal@wizery.com>
Thu, 7 Nov 2013 17:38:04 +0000 (19:38 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 9 Dec 2013 20:29:05 +0000 (22:29 +0200)
valid_rx_ant is a bitmask of available antennas and not the number
of Rx antennas. Use num_of_ant and remove duplicate definitions
in both dvm and mvm.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/dvm/rs.h
drivers/net/wireless/iwlwifi/iwl-config.h
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
drivers/net/wireless/iwlwifi/mvm/rs.h

index 26fc550cd68c58ae24342232bda51be2dfd690a5..41988f4b8a5add9ec1c2f87617f8cc64913cd8dc 100644 (file)
@@ -389,13 +389,6 @@ struct iwl_lq_sta {
        u8 last_bt_traffic;
 };
 
-static inline u8 num_of_ant(u8 mask)
-{
-       return  !!((mask) & ANT_A) +
-               !!((mask) & ANT_B) +
-               !!((mask) & ANT_C);
-}
-
 static inline u8 first_antenna(u8 mask)
 {
        if (mask & ANT_A)
index 03fd9aa8bfda93b67122b1fea0688c60aad1f95c..0b916249669ed25139db177649e5adcd98f74b7b 100644 (file)
@@ -129,6 +129,12 @@ enum iwl_led_mode {
 #define ANT_BC         (ANT_B | ANT_C)
 #define ANT_ABC                (ANT_A | ANT_B | ANT_C)
 
+static inline u8 num_of_ant(u8 mask)
+{
+       return  !!((mask) & ANT_A) +
+               !!((mask) & ANT_B) +
+               !!((mask) & ANT_C);
+}
 
 /*
  * @max_ll_items: max number of OTP blocks
index 2fab203d30275c658a5e4e6a8c296d9595a4ce73..94aef22df73a9f772429f536aa11e71ca98d51d2 100644 (file)
@@ -283,7 +283,8 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg,
                            IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 |
                            IEEE80211_VHT_MCS_NOT_SUPPORTED << 14);
 
-       if (data->valid_rx_ant == 1 || cfg->rx_with_siso_diversity) {
+       if (num_of_ant(data->valid_rx_ant) == 1 ||
+           cfg->rx_with_siso_diversity) {
                vht_cap->cap |= IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN |
                                IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN;
                /* this works because NOT_SUPPORTED == 3 */
index 8d5dc78086ea0244f8c048ae0c526119a4306e0d..b41686b767216d325d2fc3a920c2fac8bca919c8 100644 (file)
@@ -343,14 +343,6 @@ enum iwl_bt_coex_profile_traffic_load {
  */
 };
 
-
-static inline u8 num_of_ant(u8 mask)
-{
-       return  !!((mask) & ANT_A) +
-               !!((mask) & ANT_B) +
-               !!((mask) & ANT_C);
-}
-
 /* Initialize station's rate scaling information after adding station */
 void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
                          enum ieee80211_band band, bool init);