18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: BSD-3-Clause-Clear */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci#ifndef ATH11K_DP_RX_H 68c2ecf20Sopenharmony_ci#define ATH11K_DP_RX_H 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#include "core.h" 98c2ecf20Sopenharmony_ci#include "rx_desc.h" 108c2ecf20Sopenharmony_ci#include "debug.h" 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#define DP_MAX_NWIFI_HDR_LEN 30 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_FCS BIT(0) 158c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_DECRYPT BIT(1) 168c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_TKIP_MIC BIT(2) 178c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_AMSDU_ERR BIT(3) 188c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_OVERFLOW BIT(4) 198c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_MSDU_LEN BIT(5) 208c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_MPDU_LEN BIT(6) 218c2ecf20Sopenharmony_ci#define DP_RX_MPDU_ERR_UNENCRYPTED_FRAME BIT(7) 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_cienum dp_rx_decap_type { 248c2ecf20Sopenharmony_ci DP_RX_DECAP_TYPE_RAW, 258c2ecf20Sopenharmony_ci DP_RX_DECAP_TYPE_NATIVE_WIFI, 268c2ecf20Sopenharmony_ci DP_RX_DECAP_TYPE_ETHERNET2_DIX, 278c2ecf20Sopenharmony_ci DP_RX_DECAP_TYPE_8023, 288c2ecf20Sopenharmony_ci}; 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_cistruct ath11k_dp_amsdu_subframe_hdr { 318c2ecf20Sopenharmony_ci u8 dst[ETH_ALEN]; 328c2ecf20Sopenharmony_ci u8 src[ETH_ALEN]; 338c2ecf20Sopenharmony_ci __be16 len; 348c2ecf20Sopenharmony_ci} __packed; 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_cistruct ath11k_dp_rfc1042_hdr { 378c2ecf20Sopenharmony_ci u8 llc_dsap; 388c2ecf20Sopenharmony_ci u8 llc_ssap; 398c2ecf20Sopenharmony_ci u8 llc_ctrl; 408c2ecf20Sopenharmony_ci u8 snap_oui[3]; 418c2ecf20Sopenharmony_ci __be16 snap_type; 428c2ecf20Sopenharmony_ci} __packed; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ciint ath11k_dp_rx_ampdu_start(struct ath11k *ar, 458c2ecf20Sopenharmony_ci struct ieee80211_ampdu_params *params); 468c2ecf20Sopenharmony_ciint ath11k_dp_rx_ampdu_stop(struct ath11k *ar, 478c2ecf20Sopenharmony_ci struct ieee80211_ampdu_params *params); 488c2ecf20Sopenharmony_ciint ath11k_dp_peer_rx_pn_replay_config(struct ath11k_vif *arvif, 498c2ecf20Sopenharmony_ci const u8 *peer_addr, 508c2ecf20Sopenharmony_ci enum set_key_cmd key_cmd, 518c2ecf20Sopenharmony_ci struct ieee80211_key_conf *key); 528c2ecf20Sopenharmony_civoid ath11k_peer_frags_flush(struct ath11k *ar, struct ath11k_peer *peer); 538c2ecf20Sopenharmony_civoid ath11k_peer_rx_tid_cleanup(struct ath11k *ar, struct ath11k_peer *peer); 548c2ecf20Sopenharmony_civoid ath11k_peer_rx_tid_delete(struct ath11k *ar, 558c2ecf20Sopenharmony_ci struct ath11k_peer *peer, u8 tid); 568c2ecf20Sopenharmony_ciint ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id, 578c2ecf20Sopenharmony_ci u8 tid, u32 ba_win_sz, u16 ssn, 588c2ecf20Sopenharmony_ci enum hal_pn_type pn_type); 598c2ecf20Sopenharmony_civoid ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, 608c2ecf20Sopenharmony_ci struct sk_buff *skb); 618c2ecf20Sopenharmony_ciint ath11k_dp_pdev_reo_setup(struct ath11k_base *ab); 628c2ecf20Sopenharmony_civoid ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab); 638c2ecf20Sopenharmony_ciint ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int pdev_idx); 648c2ecf20Sopenharmony_civoid ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int pdev_idx); 658c2ecf20Sopenharmony_civoid ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab); 668c2ecf20Sopenharmony_civoid ath11k_dp_process_reo_status(struct ath11k_base *ab); 678c2ecf20Sopenharmony_ciint ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget); 688c2ecf20Sopenharmony_ciint ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, 698c2ecf20Sopenharmony_ci struct napi_struct *napi, int budget); 708c2ecf20Sopenharmony_ciint ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, 718c2ecf20Sopenharmony_ci int budget); 728c2ecf20Sopenharmony_ciint ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id, 738c2ecf20Sopenharmony_ci struct napi_struct *napi, 748c2ecf20Sopenharmony_ci int budget); 758c2ecf20Sopenharmony_ciint ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, 768c2ecf20Sopenharmony_ci struct dp_rxdma_ring *rx_ring, 778c2ecf20Sopenharmony_ci int req_entries, 788c2ecf20Sopenharmony_ci enum hal_rx_buf_return_buf_manager mgr); 798c2ecf20Sopenharmony_ciint ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, 808c2ecf20Sopenharmony_ci int (*iter)(struct ath11k_base *ar, u16 tag, u16 len, 818c2ecf20Sopenharmony_ci const void *ptr, void *data), 828c2ecf20Sopenharmony_ci void *data); 838c2ecf20Sopenharmony_ciint ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, 848c2ecf20Sopenharmony_ci struct napi_struct *napi, int budget); 858c2ecf20Sopenharmony_ciint ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, 868c2ecf20Sopenharmony_ci struct napi_struct *napi, int budget); 878c2ecf20Sopenharmony_ciint ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id, 888c2ecf20Sopenharmony_ci struct dp_rxdma_ring *rx_ring, 898c2ecf20Sopenharmony_ci int req_entries, 908c2ecf20Sopenharmony_ci enum hal_rx_buf_return_buf_manager mgr); 918c2ecf20Sopenharmony_ciint ath11k_dp_rx_pdev_mon_detach(struct ath11k *ar); 928c2ecf20Sopenharmony_ciint ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar); 938c2ecf20Sopenharmony_ciint ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id); 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci#endif /* ATH11K_DP_RX_H */ 96