Skip to content

Commit e263bda

Browse files
alagusankarKalle Valo
authored and
Kalle Valo
committed
ath10k: high latency fixes for beacon buffer
Beacon buffer for high latency devices does not use DMA. other similar buffer allocation methods in the driver have already been modified for high latency path. Fix the beacon buffer allocation left out in the earlier high latency changes. Signed-off-by: Alagu Sankar <[email protected]> Signed-off-by: Erik Stromdahl <[email protected]> [fabio: adapt it to use ar->bus_param.dev_type ] Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 86a03da commit e263bda

File tree

1 file changed

+23
-8
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+23
-8
lines changed

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,12 @@ static void ath10k_mac_vif_beacon_cleanup(struct ath10k_vif *arvif)
993993
ath10k_mac_vif_beacon_free(arvif);
994994

995995
if (arvif->beacon_buf) {
996-
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
997-
arvif->beacon_buf, arvif->beacon_paddr);
996+
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL)
997+
kfree(arvif->beacon_buf);
998+
else
999+
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
1000+
arvif->beacon_buf,
1001+
arvif->beacon_paddr);
9981002
arvif->beacon_buf = NULL;
9991003
}
10001004
}
@@ -5576,10 +5580,17 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
55765580
if (vif->type == NL80211_IFTYPE_ADHOC ||
55775581
vif->type == NL80211_IFTYPE_MESH_POINT ||
55785582
vif->type == NL80211_IFTYPE_AP) {
5579-
arvif->beacon_buf = dma_alloc_coherent(ar->dev,
5580-
IEEE80211_MAX_FRAME_LEN,
5581-
&arvif->beacon_paddr,
5582-
GFP_ATOMIC);
5583+
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL) {
5584+
arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN,
5585+
GFP_KERNEL);
5586+
arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf;
5587+
} else {
5588+
arvif->beacon_buf =
5589+
dma_alloc_coherent(ar->dev,
5590+
IEEE80211_MAX_FRAME_LEN,
5591+
&arvif->beacon_paddr,
5592+
GFP_ATOMIC);
5593+
}
55835594
if (!arvif->beacon_buf) {
55845595
ret = -ENOMEM;
55855596
ath10k_warn(ar, "failed to allocate beacon buffer: %d\n",
@@ -5794,8 +5805,12 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
57945805

57955806
err:
57965807
if (arvif->beacon_buf) {
5797-
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
5798-
arvif->beacon_buf, arvif->beacon_paddr);
5808+
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL)
5809+
kfree(arvif->beacon_buf);
5810+
else
5811+
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
5812+
arvif->beacon_buf,
5813+
arvif->beacon_paddr);
57995814
arvif->beacon_buf = NULL;
58005815
}
58015816

0 commit comments

Comments
 (0)