Skip to content

Commit 08743f9

Browse files
alagusankar-stigregkh
authored andcommitted
ath10k: high latency fixes for beacon buffer
[ Upstream commit e263bda ] 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 <alagusankar@silex-india.com> Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> [fabio: adapt it to use ar->bus_param.dev_type ] Signed-off-by: Fabio Estevam <festevam@denx.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210818232627.2040121-1-festevam@denx.de Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fadb4cd commit 08743f9

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
@@ -985,8 +985,12 @@ static void ath10k_mac_vif_beacon_cleanup(struct ath10k_vif *arvif)
985985
ath10k_mac_vif_beacon_free(arvif);
986986

987987
if (arvif->beacon_buf) {
988-
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
989-
arvif->beacon_buf, arvif->beacon_paddr);
988+
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL)
989+
kfree(arvif->beacon_buf);
990+
else
991+
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
992+
arvif->beacon_buf,
993+
arvif->beacon_paddr);
990994
arvif->beacon_buf = NULL;
991995
}
992996
}
@@ -5251,10 +5255,17 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
52515255
if (vif->type == NL80211_IFTYPE_ADHOC ||
52525256
vif->type == NL80211_IFTYPE_MESH_POINT ||
52535257
vif->type == NL80211_IFTYPE_AP) {
5254-
arvif->beacon_buf = dma_alloc_coherent(ar->dev,
5255-
IEEE80211_MAX_FRAME_LEN,
5256-
&arvif->beacon_paddr,
5257-
GFP_ATOMIC);
5258+
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL) {
5259+
arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN,
5260+
GFP_KERNEL);
5261+
arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf;
5262+
} else {
5263+
arvif->beacon_buf =
5264+
dma_alloc_coherent(ar->dev,
5265+
IEEE80211_MAX_FRAME_LEN,
5266+
&arvif->beacon_paddr,
5267+
GFP_ATOMIC);
5268+
}
52585269
if (!arvif->beacon_buf) {
52595270
ret = -ENOMEM;
52605271
ath10k_warn(ar, "failed to allocate beacon buffer: %d\n",
@@ -5469,8 +5480,12 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
54695480

54705481
err:
54715482
if (arvif->beacon_buf) {
5472-
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
5473-
arvif->beacon_buf, arvif->beacon_paddr);
5483+
if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL)
5484+
kfree(arvif->beacon_buf);
5485+
else
5486+
dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN,
5487+
arvif->beacon_buf,
5488+
arvif->beacon_paddr);
54745489
arvif->beacon_buf = NULL;
54755490
}
54765491

0 commit comments

Comments
 (0)