summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath11k/dp.c
diff options
context:
space:
mode:
authorGovindaraj Saminathan <gsamin@codeaurora.org>2020-02-14 05:18:44 +0300
committerKalle Valo <kvalo@codeaurora.org>2020-03-11 19:43:43 +0300
commita36adf54cbc851bed26e4823730c3ffbabae602e (patch)
tree7362e5ecf44fc3226be6045e86b1bf307b6fd539 /drivers/net/wireless/ath/ath11k/dp.c
parentbbdc8c5abbd4ce90828027342fc4430c05bc797a (diff)
downloadlinux-a36adf54cbc851bed26e4823730c3ffbabae602e.tar.xz
ath11k: config reorder queue for all tids during peer setup
Currently rx tid setup is happening for TID 0 and TID 16 during peer setup. And if other TID packets received for the peer it will be redirected to rx error ring and not through reo ring. And this rx tid configuration cannot be done in the rx error ring path since it is a atomic context. So moving the rx tid setup for all tids during the peer setup. This is required to enable PN offload functionality to route all packets through reo ring. Co-developed-by: Tamizh Chelvam <tamizhr@codeaurora.org> Signed-off-by: Tamizh Chelvam <tamizhr@codeaurora.org> Signed-off-by: Govindaraj Saminathan <gsamin@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/dp.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/dp.c41
1 files changed, 27 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index b112825a52ed..ce7634111bcf 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -39,8 +39,9 @@ void ath11k_dp_peer_cleanup(struct ath11k *ar, int vdev_id, const u8 *addr)
int ath11k_dp_peer_setup(struct ath11k *ar, int vdev_id, const u8 *addr)
{
struct ath11k_base *ab = ar->ab;
+ struct ath11k_peer *peer;
u32 reo_dest;
- int ret;
+ int ret = 0, tid;
/* NOTE: reo_dest ring id starts from 1 unlike mac_id which starts from 0 */
reo_dest = ar->dp.mac_id + 1;
@@ -54,24 +55,36 @@ int ath11k_dp_peer_setup(struct ath11k *ar, int vdev_id, const u8 *addr)
return ret;
}
- ret = ath11k_peer_rx_tid_setup(ar, addr, vdev_id,
- HAL_DESC_REO_NON_QOS_TID, 1, 0);
- if (ret) {
- ath11k_warn(ab, "failed to setup rxd tid queue for non-qos tid %d\n",
- ret);
- return ret;
- }
-
- ret = ath11k_peer_rx_tid_setup(ar, addr, vdev_id, 0, 1, 0);
- if (ret) {
- ath11k_warn(ab, "failed to setup rxd tid queue for tid 0 %d\n",
- ret);
- return ret;
+ for (tid = 0; tid <= IEEE80211_NUM_TIDS; tid++) {
+ ret = ath11k_peer_rx_tid_setup(ar, addr, vdev_id,
+ tid, 1, 0);
+ if (ret) {
+ ath11k_warn(ab, "failed to setup rxd tid queue for tid %d: %d\n",
+ tid, ret);
+ goto peer_clean;
+ }
}
/* TODO: Setup other peer specific resource used in data path */
return 0;
+
+peer_clean:
+ spin_lock_bh(&ab->base_lock);
+
+ peer = ath11k_peer_find(ab, vdev_id, addr);
+ if (!peer) {
+ ath11k_warn(ab, "failed to find the peer to del rx tid\n");
+ spin_unlock_bh(&ab->base_lock);
+ return -ENOENT;
+ }
+
+ for (; tid >= 0; tid--)
+ ath11k_peer_rx_tid_delete(ar, peer, tid);
+
+ spin_unlock_bh(&ab->base_lock);
+
+ return ret;
}
void ath11k_dp_srng_cleanup(struct ath11k_base *ab, struct dp_srng *ring)