diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-07-12 05:29:46 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-07-18 08:08:22 -0400 |
commit | cc31a3c9aeedcb1330f34dbfccf6a979919d81f2 (patch) | |
tree | fd56e2b2bf107d697c5834daebd5f3288c6b97ce | |
parent | bf722d1defc3020e9382106045f24c2978407e55 (diff) |
wl18xx: enable MIMO rates when connected as a MIMO STA
Use this opportunity to consolidate the check for MIMO support into a
separate function.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 2b9398c02a25..69042bb9a097 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -1013,6 +1013,13 @@ static void wl18xx_set_rx_csum(struct wl1271 *wl, | |||
1013 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1013 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | static bool wl18xx_is_mimo_supported(struct wl1271 *wl) | ||
1017 | { | ||
1018 | struct wl18xx_priv *priv = wl->priv; | ||
1019 | |||
1020 | return priv->conf.phy.number_of_assembled_ant2_4 >= 2; | ||
1021 | } | ||
1022 | |||
1016 | /* | 1023 | /* |
1017 | * TODO: instead of having these two functions to get the rate mask, | 1024 | * TODO: instead of having these two functions to get the rate mask, |
1018 | * we should modify the wlvif->rate_set instead | 1025 | * we should modify the wlvif->rate_set instead |
@@ -1029,6 +1036,9 @@ static u32 wl18xx_sta_get_ap_rate_mask(struct wl1271 *wl, | |||
1029 | 1036 | ||
1030 | /* we don't support MIMO in wide-channel mode */ | 1037 | /* we don't support MIMO in wide-channel mode */ |
1031 | hw_rate_set &= ~CONF_TX_MIMO_RATES; | 1038 | hw_rate_set &= ~CONF_TX_MIMO_RATES; |
1039 | } else if (wl18xx_is_mimo_supported(wl)) { | ||
1040 | wl1271_debug(DEBUG_ACX, "using MIMO channel rate mask"); | ||
1041 | hw_rate_set |= CONF_TX_MIMO_RATES; | ||
1032 | } | 1042 | } |
1033 | 1043 | ||
1034 | return hw_rate_set; | 1044 | return hw_rate_set; |
@@ -1037,8 +1047,6 @@ static u32 wl18xx_sta_get_ap_rate_mask(struct wl1271 *wl, | |||
1037 | static u32 wl18xx_ap_get_mimo_wide_rate_mask(struct wl1271 *wl, | 1047 | static u32 wl18xx_ap_get_mimo_wide_rate_mask(struct wl1271 *wl, |
1038 | struct wl12xx_vif *wlvif) | 1048 | struct wl12xx_vif *wlvif) |
1039 | { | 1049 | { |
1040 | struct wl18xx_priv *priv = wl->priv; | ||
1041 | |||
1042 | if (wlvif->channel_type == NL80211_CHAN_HT40MINUS || | 1050 | if (wlvif->channel_type == NL80211_CHAN_HT40MINUS || |
1043 | wlvif->channel_type == NL80211_CHAN_HT40PLUS) { | 1051 | wlvif->channel_type == NL80211_CHAN_HT40PLUS) { |
1044 | wl1271_debug(DEBUG_ACX, "using wide channel rate mask"); | 1052 | wl1271_debug(DEBUG_ACX, "using wide channel rate mask"); |
@@ -1048,7 +1056,7 @@ static u32 wl18xx_ap_get_mimo_wide_rate_mask(struct wl1271 *wl, | |||
1048 | return 0; | 1056 | return 0; |
1049 | 1057 | ||
1050 | return CONF_TX_RATE_USE_WIDE_CHAN; | 1058 | return CONF_TX_RATE_USE_WIDE_CHAN; |
1051 | } else if (priv->conf.phy.number_of_assembled_ant2_4 >= 2 && | 1059 | } else if (wl18xx_is_mimo_supported(wl) && |
1052 | wlvif->band == IEEE80211_BAND_2GHZ) { | 1060 | wlvif->band == IEEE80211_BAND_2GHZ) { |
1053 | wl1271_debug(DEBUG_ACX, "using MIMO rate mask"); | 1061 | wl1271_debug(DEBUG_ACX, "using MIMO rate mask"); |
1054 | /* | 1062 | /* |
@@ -1478,7 +1486,7 @@ static int __devinit wl18xx_probe(struct platform_device *pdev) | |||
1478 | * Only support mimo with multiple antennas. Fall back to | 1486 | * Only support mimo with multiple antennas. Fall back to |
1479 | * siso20. | 1487 | * siso20. |
1480 | */ | 1488 | */ |
1481 | if (priv->conf.phy.number_of_assembled_ant2_4 >= 2) | 1489 | if (wl18xx_is_mimo_supported(wl)) |
1482 | wlcore_set_ht_cap(wl, IEEE80211_BAND_2GHZ, | 1490 | wlcore_set_ht_cap(wl, IEEE80211_BAND_2GHZ, |
1483 | &wl18xx_mimo_ht_cap_2ghz); | 1491 | &wl18xx_mimo_ht_cap_2ghz); |
1484 | else | 1492 | else |