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