mac80211: add pending ath9k/ath10k patches
[openwrt.git] / package / kernel / mac80211 / patches / 310-ath10k-remove-supported-chain-mask.patch
1 From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
2 Date: Tue, 27 Oct 2015 17:51:11 +0530
3 Subject: [PATCH] ath10k: remove supported chain mask
4
5 Removing supported chainmask fields as it can be always derived
6 from num_rf_chains.
7
8 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
9 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 ---
11
12 --- a/drivers/net/wireless/ath/ath10k/core.h
13 +++ b/drivers/net/wireless/ath/ath10k/core.h
14 @@ -745,8 +745,6 @@ struct ath10k {
15         int num_started_vdevs;
16  
17         /* Protected by conf-mutex */
18 -       u8 supp_tx_chainmask;
19 -       u8 supp_rx_chainmask;
20         u8 cfg_tx_chainmask;
21         u8 cfg_rx_chainmask;
22  
23 --- a/drivers/net/wireless/ath/ath10k/mac.c
24 +++ b/drivers/net/wireless/ath/ath10k/mac.c
25 @@ -3736,13 +3736,8 @@ static int ath10k_get_antenna(struct iee
26  
27         mutex_lock(&ar->conf_mutex);
28  
29 -       if (ar->cfg_tx_chainmask) {
30 -               *tx_ant = ar->cfg_tx_chainmask;
31 -               *rx_ant = ar->cfg_rx_chainmask;
32 -       } else {
33 -               *tx_ant = ar->supp_tx_chainmask;
34 -               *rx_ant = ar->supp_rx_chainmask;
35 -       }
36 +       *tx_ant = ar->cfg_tx_chainmask;
37 +       *rx_ant = ar->cfg_rx_chainmask;
38  
39         mutex_unlock(&ar->conf_mutex);
40  
41 @@ -3884,9 +3879,7 @@ static int ath10k_start(struct ieee80211
42                 }
43         }
44  
45 -       if (ar->cfg_tx_chainmask)
46 -               __ath10k_set_antenna(ar, ar->cfg_tx_chainmask,
47 -                                    ar->cfg_rx_chainmask);
48 +       __ath10k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask);
49  
50         /*
51          * By default FW set ARP frames ac to voice (6). In that case ARP
52 @@ -7169,8 +7162,8 @@ int ath10k_mac_register(struct ath10k *a
53                 BIT(NL80211_IFTYPE_AP) |
54                 BIT(NL80211_IFTYPE_MESH_POINT);
55  
56 -       ar->hw->wiphy->available_antennas_rx = ar->supp_rx_chainmask;
57 -       ar->hw->wiphy->available_antennas_tx = ar->supp_tx_chainmask;
58 +       ar->hw->wiphy->available_antennas_rx = ar->cfg_rx_chainmask;
59 +       ar->hw->wiphy->available_antennas_tx = ar->cfg_tx_chainmask;
60  
61         if (!test_bit(ATH10K_FW_FEATURE_NO_P2P, ar->fw_features))
62                 ar->hw->wiphy->interface_modes |=
63 --- a/drivers/net/wireless/ath/ath10k/wmi.c
64 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
65 @@ -4460,8 +4460,10 @@ static void ath10k_wmi_event_service_rea
66                 ar->num_rf_chains = ar->max_spatial_stream;
67         }
68  
69 -       ar->supp_tx_chainmask = (1 << ar->num_rf_chains) - 1;
70 -       ar->supp_rx_chainmask = (1 << ar->num_rf_chains) - 1;
71 +       if (!ar->cfg_tx_chainmask) {
72 +               ar->cfg_tx_chainmask = (1 << ar->num_rf_chains) - 1;
73 +               ar->cfg_rx_chainmask = (1 << ar->num_rf_chains) - 1;
74 +       }
75  
76         if (strlen(ar->hw->wiphy->fw_version) == 0) {
77                 snprintf(ar->hw->wiphy->fw_version,