hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
-@@ -692,6 +705,17 @@ void ath9k_set_hw_capab(struct ath_softc
+@@ -692,6 +705,16 @@ void ath9k_set_hw_capab(struct ath_softc
hw->sta_data_size = sizeof(struct ath_node);
hw->vif_data_size = sizeof(struct ath_vif);
+ hw->wiphy->available_antennas_tx = BIT(ah->caps.max_txchains) - 1;
+
+ /* single chain devices with rx diversity */
-+ if (ah->caps.max_rxchains == 1 &&
-+ ath9k_hw_ops(ah)->antdiv_comb_conf_get)
-+ hw->wiphy->available_antennas_rx = 3;
++ if (ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
++ hw->wiphy->available_antennas_rx = BIT(0) | BIT(1);
+
+ sc->ant_rx = hw->wiphy->available_antennas_rx;
+ sc->ant_tx = hw->wiphy->available_antennas_tx;
#ifdef CONFIG_ATH9K_RATE_CONTROL
hw->rate_control_algorithm = "ath9k_rate_control";
#endif
-@@ -703,12 +727,7 @@ void ath9k_set_hw_capab(struct ath_softc
+@@ -703,12 +726,7 @@ void ath9k_set_hw_capab(struct ath_softc
hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
&sc->sbands[IEEE80211_BAND_5GHZ];
}
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
-@@ -652,6 +652,7 @@ struct ath_softc {
+@@ -654,6 +654,7 @@ struct ath_softc {
struct ath_descdma txsdma;
struct ath_ant_comb ant_comb;
-+ u32 ant_tx, ant_rx;
++ u8 ant_tx, ant_rx;
};
void ath9k_tasklet(unsigned long data);
-@@ -673,6 +674,7 @@ int ath9k_init_device(u16 devid, struct
+@@ -674,6 +675,7 @@ int ath9k_init_device(u16 devid, struct
const struct ath_bus_ops *bus_ops);
void ath9k_deinit_device(struct ath_softc *sc);
void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw);
bool ath9k_uses_beacons(int type);
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
-@@ -262,6 +262,22 @@ static bool ath_complete_reset(struct at
+@@ -280,6 +280,22 @@ static bool ath_complete_reset(struct at
ath_start_ani(common);
}
ieee80211_wake_queues(sc->hw);
return true;
-@@ -2360,6 +2376,59 @@ static int ath9k_get_stats(struct ieee80
+@@ -2383,6 +2399,59 @@ static int ath9k_get_stats(struct ieee80
return 0;
}
struct ieee80211_ops ath9k_ops = {
.tx = ath9k_tx,
.start = ath9k_start,
-@@ -2386,4 +2455,6 @@ struct ieee80211_ops ath9k_ops = {
+@@ -2409,4 +2478,6 @@ struct ieee80211_ops ath9k_ops = {
.tx_frames_pending = ath9k_tx_frames_pending,
.tx_last_beacon = ath9k_tx_last_beacon,
.get_stats = ath9k_get_stats,