2019-11-23 09:58:40 +02:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
|
|
|
*/
|
|
|
|
#ifndef ATH11K_DP_RX_H
|
|
|
|
#define ATH11K_DP_RX_H
|
|
|
|
|
|
|
|
#include "core.h"
|
|
|
|
#include "rx_desc.h"
|
|
|
|
#include "debug.h"
|
|
|
|
|
2020-03-17 16:52:38 +02:00
|
|
|
#define DP_MAX_NWIFI_HDR_LEN 30
|
|
|
|
|
2019-11-23 09:58:40 +02:00
|
|
|
#define DP_RX_MPDU_ERR_FCS BIT(0)
|
|
|
|
#define DP_RX_MPDU_ERR_DECRYPT BIT(1)
|
|
|
|
#define DP_RX_MPDU_ERR_TKIP_MIC BIT(2)
|
|
|
|
#define DP_RX_MPDU_ERR_AMSDU_ERR BIT(3)
|
|
|
|
#define DP_RX_MPDU_ERR_OVERFLOW BIT(4)
|
|
|
|
#define DP_RX_MPDU_ERR_MSDU_LEN BIT(5)
|
|
|
|
#define DP_RX_MPDU_ERR_MPDU_LEN BIT(6)
|
|
|
|
#define DP_RX_MPDU_ERR_UNENCRYPTED_FRAME BIT(7)
|
|
|
|
|
|
|
|
enum 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 ath11k_dp_amsdu_subframe_hdr {
|
|
|
|
u8 dst[ETH_ALEN];
|
|
|
|
u8 src[ETH_ALEN];
|
|
|
|
__be16 len;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
struct ath11k_dp_rfc1042_hdr {
|
|
|
|
u8 llc_dsap;
|
|
|
|
u8 llc_ssap;
|
|
|
|
u8 llc_ctrl;
|
|
|
|
u8 snap_oui[3];
|
|
|
|
__be16 snap_type;
|
|
|
|
} __packed;
|
|
|
|
|
|
|
|
int ath11k_dp_rx_ampdu_start(struct ath11k *ar,
|
|
|
|
struct ieee80211_ampdu_params *params);
|
|
|
|
int ath11k_dp_rx_ampdu_stop(struct ath11k *ar,
|
|
|
|
struct ieee80211_ampdu_params *params);
|
2020-03-16 07:37:22 +02:00
|
|
|
int ath11k_dp_peer_rx_pn_replay_config(struct ath11k_vif *arvif,
|
|
|
|
const u8 *peer_addr,
|
|
|
|
enum set_key_cmd key_cmd,
|
|
|
|
struct ieee80211_key_conf *key);
|
2019-11-23 09:58:40 +02:00
|
|
|
void ath11k_peer_rx_tid_cleanup(struct ath11k *ar, struct ath11k_peer *peer);
|
2020-02-14 07:48:44 +05:30
|
|
|
void ath11k_peer_rx_tid_delete(struct ath11k *ar,
|
|
|
|
struct ath11k_peer *peer, u8 tid);
|
2019-11-23 09:58:40 +02:00
|
|
|
int ath11k_peer_rx_tid_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id,
|
2020-03-16 07:37:22 +02:00
|
|
|
u8 tid, u32 ba_win_sz, u16 ssn,
|
|
|
|
enum hal_pn_type pn_type);
|
2019-11-23 09:58:40 +02:00
|
|
|
void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,
|
|
|
|
struct sk_buff *skb);
|
2019-11-28 08:21:58 +00:00
|
|
|
int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab);
|
|
|
|
void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab);
|
2019-11-23 09:58:40 +02:00
|
|
|
int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int pdev_idx);
|
|
|
|
void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int pdev_idx);
|
|
|
|
void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab);
|
|
|
|
void ath11k_dp_process_reo_status(struct ath11k_base *ab);
|
|
|
|
int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget);
|
|
|
|
int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab,
|
|
|
|
struct napi_struct *napi, int budget);
|
|
|
|
int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,
|
|
|
|
int budget);
|
|
|
|
int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,
|
2020-03-17 16:52:38 +02:00
|
|
|
struct napi_struct *napi,
|
2019-11-23 09:58:40 +02:00
|
|
|
int budget);
|
|
|
|
int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id,
|
|
|
|
struct dp_rxdma_ring *rx_ring,
|
|
|
|
int req_entries,
|
2020-09-29 20:15:36 +03:00
|
|
|
enum hal_rx_buf_return_buf_manager mgr);
|
2019-11-23 09:58:40 +02:00
|
|
|
int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len,
|
|
|
|
int (*iter)(struct ath11k_base *ar, u16 tag, u16 len,
|
|
|
|
const void *ptr, void *data),
|
|
|
|
void *data);
|
|
|
|
int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id,
|
|
|
|
struct napi_struct *napi, int budget);
|
|
|
|
int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
|
|
|
|
struct napi_struct *napi, int budget);
|
|
|
|
int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id,
|
|
|
|
struct dp_rxdma_ring *rx_ring,
|
|
|
|
int req_entries,
|
2020-09-29 20:15:36 +03:00
|
|
|
enum hal_rx_buf_return_buf_manager mgr);
|
2019-11-23 09:58:40 +02:00
|
|
|
int ath11k_dp_rx_pdev_mon_detach(struct ath11k *ar);
|
|
|
|
int ath11k_dp_rx_pdev_mon_attach(struct ath11k *ar);
|
ath11k: handle RX fragments
IPQ8074 HW has support to verify the PN of the received frames.
For all frames except for fragmented ones, HW checks the PN and
delivers them to the driver. For fragmented frames, driver is
required to do a little more; it has to reassemble the fragments
and then reinject them to the HW for verifying the PN. Currently,
to keep the logic simple, PN verifcation is disabled in HW and is
handled in mac80211 for all the frames (fragmented and unfragmented).
On the contrary, offloading PN Validation to the HW brings important
benefits. It reduces CPU cycles spent on the host CPU for verifying
the same; helps in enabling features which improve performance like
mac80211 fast RX path, enabling multiple REO rings for parallel RX
processing, 802.11 decapsulation offloading. All these features are
dependent on PN offload which in turn is dependent on handling of
the received fragments in the driver.
When TKIP security is used, additional handling is required while
processing the fragments; since MIC is computed on an MSDU in TKIP,
only the last fragment has the MIC info. In this case, driver has to
compute the MIC after reassembly and compare it against the MIC
present in the frame. For this, MICHAEL_MIC kernel crypto library
APIs are used and the dependencies are appropriately set.
Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-03-16 07:37:19 +02:00
|
|
|
int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id);
|
2019-11-23 09:58:40 +02:00
|
|
|
|
2020-12-11 19:35:46 +02:00
|
|
|
int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab);
|
|
|
|
int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer);
|
|
|
|
|
2019-11-23 09:58:40 +02:00
|
|
|
#endif /* ATH11K_DP_RX_H */
|