Path: blob/main/sys/contrib/dev/athk/ath12k/dp_rx.h
48375 views
/* SPDX-License-Identifier: BSD-3-Clause-Clear */1/*2* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.3* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.4*/5#ifndef ATH12K_DP_RX_H6#define ATH12K_DP_RX_H78#include "core.h"9#include "rx_desc.h"10#include "debug.h"1112#define DP_MAX_NWIFI_HDR_LEN 301314struct ath12k_dp_rx_tid {15u8 tid;16u32 *vaddr;17dma_addr_t paddr;18u32 size;19u32 ba_win_sz;20bool active;2122/* Info related to rx fragments */23u32 cur_sn;24u16 last_frag_no;25u16 rx_frag_bitmap;2627struct sk_buff_head rx_frags;28struct hal_reo_dest_ring *dst_ring_desc;2930/* Timer info related to fragments */31struct timer_list frag_timer;32struct ath12k_base *ab;33};3435struct ath12k_dp_rx_reo_cache_flush_elem {36struct list_head list;37struct ath12k_dp_rx_tid data;38unsigned long ts;39};4041struct ath12k_dp_rx_reo_cmd {42struct list_head list;43struct ath12k_dp_rx_tid data;44int cmd_num;45void (*handler)(struct ath12k_dp *dp, void *ctx,46enum hal_reo_cmd_status status);47};4849#define ATH12K_DP_RX_REO_DESC_FREE_THRES 6450#define ATH12K_DP_RX_REO_DESC_FREE_TIMEOUT_MS 10005152enum ath12k_dp_rx_decap_type {53DP_RX_DECAP_TYPE_RAW,54DP_RX_DECAP_TYPE_NATIVE_WIFI,55DP_RX_DECAP_TYPE_ETHERNET2_DIX,56DP_RX_DECAP_TYPE_8023,57};5859struct ath12k_dp_rx_rfc1042_hdr {60u8 llc_dsap;61u8 llc_ssap;62u8 llc_ctrl;63u8 snap_oui[3];64__be16 snap_type;65} __packed;6667static inline u32 ath12k_he_gi_to_nl80211_he_gi(u8 sgi)68{69u32 ret = 0;7071switch (sgi) {72case RX_MSDU_START_SGI_0_8_US:73ret = NL80211_RATE_INFO_HE_GI_0_8;74break;75case RX_MSDU_START_SGI_1_6_US:76ret = NL80211_RATE_INFO_HE_GI_1_6;77break;78case RX_MSDU_START_SGI_3_2_US:79ret = NL80211_RATE_INFO_HE_GI_3_2;80break;81}8283return ret;84}8586int ath12k_dp_rx_ampdu_start(struct ath12k *ar,87struct ieee80211_ampdu_params *params);88int ath12k_dp_rx_ampdu_stop(struct ath12k *ar,89struct ieee80211_ampdu_params *params);90int ath12k_dp_rx_peer_pn_replay_config(struct ath12k_vif *arvif,91const u8 *peer_addr,92enum set_key_cmd key_cmd,93struct ieee80211_key_conf *key);94void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_peer *peer);95void ath12k_dp_rx_peer_tid_delete(struct ath12k *ar,96struct ath12k_peer *peer, u8 tid);97int ath12k_dp_rx_peer_tid_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_id,98u8 tid, u32 ba_win_sz, u16 ssn,99enum hal_pn_type pn_type);100void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab,101struct sk_buff *skb);102int ath12k_dp_rx_pdev_reo_setup(struct ath12k_base *ab);103void ath12k_dp_rx_pdev_reo_cleanup(struct ath12k_base *ab);104int ath12k_dp_rx_htt_setup(struct ath12k_base *ab);105int ath12k_dp_rx_alloc(struct ath12k_base *ab);106void ath12k_dp_rx_free(struct ath12k_base *ab);107int ath12k_dp_rx_pdev_alloc(struct ath12k_base *ab, int pdev_idx);108void ath12k_dp_rx_pdev_free(struct ath12k_base *ab, int pdev_idx);109void ath12k_dp_rx_reo_cmd_list_cleanup(struct ath12k_base *ab);110void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab);111int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,112struct napi_struct *napi, int budget);113int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi,114int budget);115int ath12k_dp_rx_process(struct ath12k_base *ab, int mac_id,116struct napi_struct *napi,117int budget);118int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, int mac_id,119struct dp_rxdma_ring *rx_ring,120int req_entries,121enum hal_rx_buf_return_buf_manager mgr,122bool hw_cc);123int ath12k_dp_rx_pdev_mon_attach(struct ath12k *ar);124int ath12k_dp_rx_peer_frag_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_id);125126int ath12k_dp_rx_pktlog_start(struct ath12k_base *ab);127int ath12k_dp_rx_pktlog_stop(struct ath12k_base *ab, bool stop_timer);128u8 ath12k_dp_rx_h_l3pad(struct ath12k_base *ab,129struct hal_rx_desc *desc);130struct ath12k_peer *131ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu);132u8 ath12k_dp_rx_h_decap_type(struct ath12k_base *ab,133struct hal_rx_desc *desc);134u32 ath12k_dp_rx_h_mpdu_err(struct ath12k_base *ab,135struct hal_rx_desc *desc);136void ath12k_dp_rx_h_ppdu(struct ath12k *ar, struct hal_rx_desc *rx_desc,137struct ieee80211_rx_status *rx_status);138struct ath12k_peer *139ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu);140141int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab);142int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab);143144#endif /* ATH12K_DP_RX_H */145146147