1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */ 2 /* 3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 4 */ 5 #ifndef ATH11K_DP_RX_H 6 #define ATH11K_DP_RX_H 7 8 #include "core.h" 9 #include "rx_desc.h" 10 #include "debug.h" 11 12 #define DP_MAX_NWIFI_HDR_LEN 30 13 14 #define DP_RX_MPDU_ERR_FCS BIT(0) 15 #define DP_RX_MPDU_ERR_DECRYPT BIT(1) 16 #define DP_RX_MPDU_ERR_TKIP_MIC BIT(2) 17 #define DP_RX_MPDU_ERR_AMSDU_ERR BIT(3) 18 #define DP_RX_MPDU_ERR_OVERFLOW BIT(4) 19 #define DP_RX_MPDU_ERR_MSDU_LEN BIT(5) 20 #define DP_RX_MPDU_ERR_MPDU_LEN BIT(6) 21 #define DP_RX_MPDU_ERR_UNENCRYPTED_FRAME BIT(7) 22 23 enum dp_rx_decap_type { 24 DP_RX_DECAP_TYPE_RAW, 25 DP_RX_DECAP_TYPE_NATIVE_WIFI, 26 DP_RX_DECAP_TYPE_ETHERNET2_DIX, 27 DP_RX_DECAP_TYPE_8023, 28 }; 29 30 struct ath11k_dp_amsdu_subframe_hdr { 31 u8 dst[ETH_ALEN]; 32 u8 src[ETH_ALEN]; 33 __be16 len; 34 } __packed; 35 36 struct ath11k_dp_rfc1042_hdr { 37 u8 llc_dsap; 38 u8 llc_ssap; 39 u8 llc_ctrl; 40 u8 snap_oui[3]; 41 __be16 snap_type; 42 } __packed; 43 44 int ath11k_dp_rx_ampdu_start(struct ath11k *ar, 45 struct ieee80211_ampdu_params *params); 46 int ath11k_dp_rx_ampdu_stop(struct ath11k *ar, 47 struct ieee80211_ampdu_params *params); 48 int ath11k_dp_peer_rx_pn_replay_config(struct ath11k_vif *arvif, 49 const u8 *peer_addr, 50 enum set_key_cmd key_cmd, 51 struct ieee80211_key_conf *key); 52 void ath11k_peer_frags_flush(struct ath11k *ar, struct ath11k_peer *peer); 53 void ath11k_peer_rx_tid_cleanup(struct ath11k *ar, struct ath11k_peer *peer); 54 void ath11k_peer_rx_tid_delete(struct ath11k *ar, 55 struct ath11k_peer *peer, u8 tid); 56 int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, 57 u8 tid, u32 ba_win_sz, u16 ssn, 58 enum hal_pn_type pn_type); 59 void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, 60 struct sk_buff *skb); 61 int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab); 62 void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab); 63 int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int pdev_idx); 64 void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int pdev_idx); 65 void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab); 66 void ath11k_dp_process_reo_status(struct ath11k_base *ab); 67 int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget); 68 int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, 69 struct napi_struct *napi, int budget); 70 int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, 71 int budget); 72 int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id, 73 struct napi_struct *napi, 74 int budget); 75 int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, 76 struct dp_rxdma_ring *rx_ring, 77 int req_entries, 78 enum hal_rx_buf_return_buf_manager mgr); 79 #if defined(__linux__) 80 int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, 81 #elif defined(__FreeBSD__) 82 int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const u8 *ptr, size_t len, 83 #endif 84 int (*iter)(struct ath11k_base *ar, u16 tag, u16 len, 85 const void *ptr, void *data), 86 void *data); 87 int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, 88 struct napi_struct *napi, int budget); 89 int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, 90 struct napi_struct *napi, int budget); 91 int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id, 92 struct dp_rxdma_ring *rx_ring, 93 int req_entries, 94 enum hal_rx_buf_return_buf_manager mgr); 95 int ath11k_dp_rx_pdev_mon_detach(struct ath11k *ar); 96 int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar); 97 int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id); 98 99 int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab); 100 int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer); 101 102 #endif /* ATH11K_DP_RX_H */ 103