diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2014-02-25 08:48:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:33:14 -0500 |
commit | e9fb588867091b25d413d6e70b4cfb8886edec89 (patch) | |
tree | f1f16f196d3ddae55ebfa3376b9598699b0c02a6 | |
parent | b60d105242ac457dab057f676c8aaa20d1821b10 (diff) |
ath9k_htc: use ath9k_cmn_setup_ht_cap
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 752586d8c3ba..5220f4644b1d 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -404,51 +404,6 @@ static const struct ath_bus_ops ath9k_usb_bus_ops = { | |||
404 | .eeprom_read = ath_usb_eeprom_read, | 404 | .eeprom_read = ath_usb_eeprom_read, |
405 | }; | 405 | }; |
406 | 406 | ||
407 | static void setup_ht_cap(struct ath9k_htc_priv *priv, | ||
408 | struct ieee80211_sta_ht_cap *ht_info) | ||
409 | { | ||
410 | struct ath_common *common = ath9k_hw_common(priv->ah); | ||
411 | u8 tx_streams, rx_streams; | ||
412 | int i; | ||
413 | |||
414 | ht_info->ht_supported = true; | ||
415 | ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 | | ||
416 | IEEE80211_HT_CAP_SM_PS | | ||
417 | IEEE80211_HT_CAP_SGI_40 | | ||
418 | IEEE80211_HT_CAP_DSSSCCK40; | ||
419 | |||
420 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20) | ||
421 | ht_info->cap |= IEEE80211_HT_CAP_SGI_20; | ||
422 | |||
423 | ht_info->cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT); | ||
424 | |||
425 | ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; | ||
426 | ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; | ||
427 | |||
428 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); | ||
429 | |||
430 | /* ath9k_htc supports only 1 or 2 stream devices */ | ||
431 | tx_streams = ath9k_cmn_count_streams(priv->ah->txchainmask, 2); | ||
432 | rx_streams = ath9k_cmn_count_streams(priv->ah->rxchainmask, 2); | ||
433 | |||
434 | ath_dbg(common, CONFIG, "TX streams %d, RX streams: %d\n", | ||
435 | tx_streams, rx_streams); | ||
436 | |||
437 | if (tx_streams >= 2) | ||
438 | ht_info->cap |= IEEE80211_HT_CAP_TX_STBC; | ||
439 | |||
440 | if (tx_streams != rx_streams) { | ||
441 | ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF; | ||
442 | ht_info->mcs.tx_params |= ((tx_streams - 1) << | ||
443 | IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT); | ||
444 | } | ||
445 | |||
446 | for (i = 0; i < rx_streams; i++) | ||
447 | ht_info->mcs.rx_mask[i] = 0xff; | ||
448 | |||
449 | ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED; | ||
450 | } | ||
451 | |||
452 | static int ath9k_init_queues(struct ath9k_htc_priv *priv) | 407 | static int ath9k_init_queues(struct ath9k_htc_priv *priv) |
453 | { | 408 | { |
454 | struct ath_common *common = ath9k_hw_common(priv->ah); | 409 | struct ath_common *common = ath9k_hw_common(priv->ah); |
@@ -611,6 +566,7 @@ static const struct ieee80211_iface_combination if_comb = { | |||
611 | static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, | 566 | static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, |
612 | struct ieee80211_hw *hw) | 567 | struct ieee80211_hw *hw) |
613 | { | 568 | { |
569 | struct ath_hw *ah = priv->ah; | ||
614 | struct ath_common *common = ath9k_hw_common(priv->ah); | 570 | struct ath_common *common = ath9k_hw_common(priv->ah); |
615 | struct base_eep_header *pBase; | 571 | struct base_eep_header *pBase; |
616 | 572 | ||
@@ -662,10 +618,10 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, | |||
662 | 618 | ||
663 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_HT) { | 619 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_HT) { |
664 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) | 620 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) |
665 | setup_ht_cap(priv, | 621 | ath9k_cmn_setup_ht_cap(ah, |
666 | &common->sbands[IEEE80211_BAND_2GHZ].ht_cap); | 622 | &common->sbands[IEEE80211_BAND_2GHZ].ht_cap); |
667 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) | 623 | if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) |
668 | setup_ht_cap(priv, | 624 | ath9k_cmn_setup_ht_cap(ah, |
669 | &common->sbands[IEEE80211_BAND_5GHZ].ht_cap); | 625 | &common->sbands[IEEE80211_BAND_5GHZ].ht_cap); |
670 | } | 626 | } |
671 | 627 | ||