From: Kalle Valo <kvalo@kernel.org>
To: linux-wireless@vger.kernel.org
Cc: ath12k@lists.infradead.org
Subject: [PATCH v2 16/50] wifi: ath12k: add dp_rx.h
Date: Wed, 16 Nov 2022 18:38:28 +0200 [thread overview]
Message-ID: <20221116163902.24996-17-kvalo@kernel.org> (raw)
In-Reply-To: <20221116163902.24996-1-kvalo@kernel.org>
From: Kalle Valo <quic_kvalo@quicinc.com>
(Patches split into one patch per file for easier review, but the final
commit will be one big patch. See the cover letter for more info.)
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp_rx.h | 145 ++++++++++++++++++++++++++++++++
1 file changed, 145 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.h b/drivers/net/wireless/ath/ath12k/dp_rx.h
new file mode 100644
index 000000000000..c955b5c859d1
--- /dev/null
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.h
@@ -0,0 +1,145 @@
+/* SPDX-License-Identifier: BSD-3-Clause-Clear */
+/*
+ * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+#ifndef ATH12K_DP_RX_H
+#define ATH12K_DP_RX_H
+
+#include "core.h"
+#include "rx_desc.h"
+#include "debug.h"
+
+#define DP_MAX_NWIFI_HDR_LEN 30
+
+struct ath12k_dp_rx_tid {
+ u8 tid;
+ u32 *vaddr;
+ dma_addr_t paddr;
+ u32 size;
+ u32 ba_win_sz;
+ bool active;
+
+ /* Info related to rx fragments */
+ u32 cur_sn;
+ u16 last_frag_no;
+ u16 rx_frag_bitmap;
+
+ struct sk_buff_head rx_frags;
+ struct hal_reo_dest_ring *dst_ring_desc;
+
+ /* Timer info related to fragments */
+ struct timer_list frag_timer;
+ struct ath12k_base *ab;
+};
+
+struct ath12k_dp_rx_reo_cache_flush_elem {
+ struct list_head list;
+ struct ath12k_dp_rx_tid data;
+ unsigned long ts;
+};
+
+struct ath12k_dp_rx_reo_cmd {
+ struct list_head list;
+ struct ath12k_dp_rx_tid data;
+ int cmd_num;
+ void (*handler)(struct ath12k_dp *dp, void *ctx,
+ enum hal_reo_cmd_status status);
+};
+
+#define ATH12K_DP_RX_REO_DESC_FREE_THRES 64
+#define ATH12K_DP_RX_REO_DESC_FREE_TIMEOUT_MS 1000
+
+enum ath12k_dp_rx_decap_type {
+ DP_RX_DECAP_TYPE_RAW,
+ DP_RX_DECAP_TYPE_NATIVE_WIFI,
+ DP_RX_DECAP_TYPE_ETHERNET2_DIX,
+ DP_RX_DECAP_TYPE_8023,
+};
+
+struct ath12k_dp_rx_rfc1042_hdr {
+ u8 llc_dsap;
+ u8 llc_ssap;
+ u8 llc_ctrl;
+ u8 snap_oui[3];
+ __be16 snap_type;
+} __packed;
+
+static inline u32 ath12k_he_gi_to_nl80211_he_gi(u8 sgi)
+{
+ u32 ret = 0;
+
+ switch (sgi) {
+ case RX_MSDU_START_SGI_0_8_US:
+ ret = NL80211_RATE_INFO_HE_GI_0_8;
+ break;
+ case RX_MSDU_START_SGI_1_6_US:
+ ret = NL80211_RATE_INFO_HE_GI_1_6;
+ break;
+ case RX_MSDU_START_SGI_3_2_US:
+ ret = NL80211_RATE_INFO_HE_GI_3_2;
+ break;
+ }
+
+ return ret;
+}
+
+int ath12k_dp_rx_ampdu_start(struct ath12k *ar,
+ struct ieee80211_ampdu_params *params);
+int ath12k_dp_rx_ampdu_stop(struct ath12k *ar,
+ struct ieee80211_ampdu_params *params);
+int ath12k_dp_rx_peer_pn_replay_config(struct ath12k_vif *arvif,
+ const u8 *peer_addr,
+ enum set_key_cmd key_cmd,
+ struct ieee80211_key_conf *key);
+void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_peer *peer);
+void ath12k_dp_rx_peer_tid_delete(struct ath12k *ar,
+ struct ath12k_peer *peer, u8 tid);
+int ath12k_dp_rx_peer_tid_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_id,
+ u8 tid, u32 ba_win_sz, u16 ssn,
+ enum hal_pn_type pn_type);
+void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab,
+ struct sk_buff *skb);
+int ath12k_dp_rx_pdev_reo_setup(struct ath12k_base *ab);
+void ath12k_dp_rx_pdev_reo_cleanup(struct ath12k_base *ab);
+int ath12k_dp_rx_htt_setup(struct ath12k_base *ab);
+int ath12k_dp_rx_alloc(struct ath12k_base *ab);
+void ath12k_dp_rx_free(struct ath12k_base *ab);
+int ath12k_dp_rx_pdev_alloc(struct ath12k_base *ab, int pdev_idx);
+void ath12k_dp_rx_pdev_free(struct ath12k_base *ab, int pdev_idx);
+void ath12k_dp_rx_reo_cmd_list_cleanup(struct ath12k_base *ab);
+void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab);
+int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
+ struct napi_struct *napi, int budget);
+int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,
+ int budget);
+int ath12k_dp_rx_process(struct ath12k_base *ab, int mac_id,
+ struct napi_struct *napi,
+ int budget);
+int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, int mac_id,
+ struct dp_rxdma_ring *rx_ring,
+ int req_entries,
+ enum hal_rx_buf_return_buf_manager mgr,
+ bool hw_cc);
+int ath12k_dp_rx_pdev_mon_attach(struct ath12k *ar);
+int ath12k_dp_rx_peer_frag_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_id);
+
+int ath12k_dp_rx_pktlog_start(struct ath12k_base *ab);
+int ath12k_dp_rx_pktlog_stop(struct ath12k_base *ab, bool stop_timer);
+u8 ath12k_dp_rx_h_l3pad(struct ath12k_base *ab,
+ struct hal_rx_desc *desc);
+struct ath12k_peer *
+ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu);
+u8 ath12k_dp_rx_h_decap_type(struct ath12k_base *ab,
+ struct hal_rx_desc *desc);
+u32 ath12k_dp_rx_h_mpdu_err(struct ath12k_base *ab,
+ struct hal_rx_desc *desc);
+void ath12k_dp_rx_h_ppdu(struct ath12k *ar, struct hal_rx_desc *rx_desc,
+ struct ieee80211_rx_status *rx_status);
+struct ath12k_peer *
+ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu);
+
+int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab);
+int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab);
+
+#endif /* ATH12K_DP_RX_H */
next prev parent reply other threads:[~2022-11-16 16:43 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 16:38 [PATCH v2 00/50] wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices Kalle Valo
2022-11-16 16:38 ` [PATCH v2 01/50] wifi: ath12k: add Kconfig Kalle Valo
2022-11-16 16:38 ` [PATCH v2 02/50] wifi: ath12k: add Makefile Kalle Valo
2022-11-16 16:38 ` [PATCH v2 03/50] wifi: ath12k: add ce.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 04/50] wifi: ath12k: add ce.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 05/50] wifi: ath12k: add core.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 06/50] wifi: ath12k: add core.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 07/50] wifi: ath12k: add dbring.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 08/50] wifi: ath12k: add dbring.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 09/50] wifi: ath12k: add debug.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 10/50] wifi: ath12k: add debug.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 11/50] wifi: ath12k: add dp.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 12/50] wifi: ath12k: add dp.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 13/50] wifi: ath12k: add dp_mon.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 14/50] wifi: ath12k: add dp_mon.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 15/50] wifi: ath12k: add dp_rx.c Kalle Valo
2022-11-16 16:38 ` Kalle Valo [this message]
2022-11-16 16:38 ` [PATCH v2 17/50] wifi: ath12k: add dp_tx.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 18/50] wifi: ath12k: add dp_tx.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 19/50] wifi: ath12k: add hal.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 20/50] wifi: ath12k: add hal.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 21/50] wifi: ath12k: add hal_desc.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 22/50] wifi: ath12k: add hal_rx.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 23/50] wifi: ath12k: add hal_rx.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 24/50] wifi: ath12k: add hal_tx.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 25/50] wifi: ath12k: add hal_tx.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 26/50] wifi: ath12k: add hif.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 27/50] wifi: ath12k: add htc.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 28/50] wifi: ath12k: add htc.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 29/50] wifi: ath12k: add hw.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 30/50] wifi: ath12k: add hw.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 31/50] wifi: ath12k: add mac.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 32/50] wifi: ath12k: add mac.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 33/50] wifi: ath12k: add mhi.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 34/50] wifi: ath12k: add mhi.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 35/50] wifi: ath12k: add pci.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 36/50] wifi: ath12k: add pci.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 37/50] wifi: ath12k: add peer.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 38/50] wifi: ath12k: add peer.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 39/50] wifi: ath12k: add qmi.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 40/50] wifi: ath12k: add qmi.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 41/50] wifi: ath12k: add reg.c Kalle Valo
2022-11-21 16:27 ` Nicolas Cavallari
2022-11-24 10:07 ` Sriram R (QUIC)
2022-11-16 16:38 ` [PATCH v2 42/50] wifi: ath12k: add reg.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 43/50] wifi: ath12k: add rx_desc.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 44/50] wifi: ath12k: add trace.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 45/50] wifi: ath12k: add trace.h Kalle Valo
2022-11-16 16:38 ` [PATCH v2 46/50] wifi: ath12k: add wmi.c Kalle Valo
2022-11-16 16:38 ` [PATCH v2 47/50] wifi: ath12k: add wmi.h Kalle Valo
2022-11-16 16:39 ` [PATCH v2 48/50] wifi: ath: add ath12k to Makefile Kalle Valo
2022-11-16 16:39 ` [PATCH v2 49/50] wifi: ath: add ath12k to Kconfig Kalle Valo
2022-11-16 16:39 ` [PATCH v2 50/50] MAINTAINERS: add ath12k Kalle Valo
2022-11-21 15:57 ` [PATCH v2 00/50] wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices Kalle Valo
2022-11-25 11:06 ` Kalle Valo
2022-11-28 14:56 ` Kalle Valo
2022-11-29 11:10 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221116163902.24996-17-kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).