Skip to content

Commit

Permalink
ath10k: Fix locking, enable VHT in 2.4, etc.
Browse files Browse the repository at this point in the history
Actually using VHT in 2.4Ghz may require additional out-of-tree
patches for mac80211 that are not included in this patch.

The locking fix reverts a regression I had added previously.

And, rate-limit a few spammy messages that happen in certain
cases.

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Nov 16, 2016
1 parent 5b7a620 commit 2422547
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
10 changes: 6 additions & 4 deletions ath10k/htt_rx.c
Expand Up @@ -2106,8 +2106,9 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb)
*/

if (unlikely(!txq)) {
ath10k_warn(ar, "failed to lookup txq for peer_id %hu tid %hhu\n",
peer_id, tid);
if (net_ratelimit())
ath10k_warn(ar, "fetch-ind: failed to lookup txq for peer_id %hu tid %hhu\n",
peer_id, tid);
continue;
}

Expand Down Expand Up @@ -2263,8 +2264,9 @@ static void ath10k_htt_rx_tx_mode_switch_ind(struct ath10k *ar,
*/

if (unlikely(!txq)) {
ath10k_warn(ar, "failed to lookup txq for peer_id %hu tid %hhu\n",
peer_id, tid);
if (net_ratelimit())
ath10k_warn(ar, "mode-switch: failed to lookup txq for peer_id %hu tid %hhu\n",
peer_id, tid);
continue;
}

Expand Down
3 changes: 3 additions & 0 deletions ath10k/hw.h
Expand Up @@ -406,6 +406,9 @@ enum ath10k_hw_4addr_pad {
/* Over-rides for Candela Technologies firmware */
#define DEF_TARGET_10X_NUM_VDEVS_CT 16 /* Can support up to 64 with proper config of other settings.
* override w/module parm or fwcfg file */
/* NOTE: AST can really hold 4 keys, and there can be some temporarily in use as well. So this
* needs to be pretty large. 256 works in my testing with 64 station vdevs. --Ben
*/
#define TARGET_10X_AST_SKID_LIMIT_CT (ath10k_modparam_target_num_peers_ct * TARGET_10X_NUM_PEER_AST)
#define TARGET_10X_NUM_PEER_KEYS_CT (WMI_MAX_KEY_INDEX + 1) /* 4 */

Expand Down
11 changes: 7 additions & 4 deletions ath10k/mac.c
Expand Up @@ -2810,7 +2810,7 @@ static bool ath10k_mac_sta_has_ofdm_only(struct ieee80211_vif *vif,
u32 msk = arvif->bitrate_mask.control[NL80211_BAND_2GHZ].legacy &
sta->supp_rates[NL80211_BAND_2GHZ];
/* We have 12 bits of legacy rates, first 4 are /b (CCK) rates. */
return (msk & 0xfff) == 0xff0;
return (msk & 0xff0) && !(msk & 0xf);
}

static bool ath10k_mac_sta_has_ofdm_and_cck(struct ieee80211_vif *vif,
Expand All @@ -2820,7 +2820,7 @@ static bool ath10k_mac_sta_has_ofdm_and_cck(struct ieee80211_vif *vif,
u32 msk = arvif->bitrate_mask.control[NL80211_BAND_2GHZ].legacy &
sta->supp_rates[NL80211_BAND_2GHZ];
/* We have 12 bits of legacy rates, first 4 are /b (CCK) rates. */
return (msk & 0xfff) == 0xfff;
return ((msk & 0xf) && (msk & 0xff0));
}

static void ath10k_peer_assoc_h_phymode(struct ath10k *ar,
Expand Down Expand Up @@ -4338,8 +4338,8 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar)
int max;
int loop_max = 2000;

rcu_read_lock();
spin_lock_bh(&ar->txqs_lock);
rcu_read_lock();

last = list_last_entry(&ar->txqs, struct ath10k_txq, list);
while (!list_empty(&ar->txqs)) {
Expand Down Expand Up @@ -4373,8 +4373,8 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar)
break;
}

spin_unlock_bh(&ar->txqs_lock);
rcu_read_unlock();
spin_unlock_bh(&ar->txqs_lock);
}

/************/
Expand Down Expand Up @@ -4860,6 +4860,9 @@ static void ath10k_mac_setup_ht_vht_cap(struct ath10k *ar)
if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) {
band = &ar->mac.sbands[NL80211_BAND_2GHZ];
band->ht_cap = ht_cap;

/* Enable the VHT support at 2.4 GHz */
band->vht_cap = vht_cap;
}
if (ar->phy_capability & WHAL_WLAN_11A_CAPABILITY) {
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
Expand Down

0 comments on commit 2422547

Please sign in to comment.