linux/drivers/net/wireless/ath/ath11k/ce.h

/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#ifndef ATH11K_CE_H
#define ATH11K_CE_H

#define CE_COUNT_MAX

/* Byte swap data words */
#define CE_ATTR_BYTE_SWAP_DATA

/* no interrupt on copy completion */
#define CE_ATTR_DIS_INTR

/* Host software's Copy Engine configuration. */
#ifdef __BIG_ENDIAN
#define CE_ATTR_FLAGS
#else
#define CE_ATTR_FLAGS
#endif

/* Threshold to poll for tx completion in case of Interrupt disabled CE's */
#define ATH11K_CE_USAGE_THRESHOLD

void ath11k_ce_byte_swap(void *mem, u32 len);

/*
 * Directions for interconnect pipe configuration.
 * These definitions may be used during configuration and are shared
 * between Host and Target.
 *
 * Pipe Directions are relative to the Host, so PIPEDIR_IN means
 * "coming IN over air through Target to Host" as with a WiFi Rx operation.
 * Conversely, PIPEDIR_OUT means "going OUT from Host through Target over air"
 * as with a WiFi Tx operation. This is somewhat awkward for the "middle-man"
 * Target since things that are "PIPEDIR_OUT" are coming IN to the Target
 * over the interconnect.
 */
#define PIPEDIR_NONE
#define PIPEDIR_IN
#define PIPEDIR_OUT
#define PIPEDIR_INOUT
#define PIPEDIR_INOUT_H2H

/* CE address/mask */
#define CE_HOST_IE_ADDRESS
#define CE_HOST_IE_2_ADDRESS
#define CE_HOST_IE_3_ADDRESS

/* CE IE registers are different for IPQ5018 */
#define CE_HOST_IPQ5018_IE_ADDRESS
#define CE_HOST_IPQ5018_IE_2_ADDRESS
#define CE_HOST_IPQ5018_IE_3_ADDRESS

#define CE_HOST_IE_3_SHIFT

#define CE_RING_IDX_INCR(nentries_mask, idx)

#define ATH11K_CE_RX_POST_RETRY_JIFFIES

struct ath11k_base;

/*
 * Establish a mapping between a service/direction and a pipe.
 * Configuration information for a Copy Engine pipe and services.
 * Passed from Host to Target through QMI message and must be in
 * little endian format.
 */
struct service_to_pipe {};

/*
 * Configuration information for a Copy Engine pipe.
 * Passed from Host to Target through QMI message during startup (one per CE).
 *
 * NOTE: Structure is shared between Host software and Target firmware!
 */
struct ce_pipe_config {};

struct ce_ie_addr {};

struct ce_remap {};

struct ce_attr {};

#define CE_DESC_RING_ALIGN

struct ath11k_ce_ring {};

struct ath11k_ce_pipe {};

struct ath11k_ce {};

extern const struct ce_attr ath11k_host_ce_config_ipq8074[];
extern const struct ce_attr ath11k_host_ce_config_qca6390[];
extern const struct ce_attr ath11k_host_ce_config_qcn9074[];

void ath11k_ce_cleanup_pipes(struct ath11k_base *ab);
void ath11k_ce_rx_replenish_retry(struct timer_list *t);
void ath11k_ce_per_engine_service(struct ath11k_base *ab, u16 ce_id);
int ath11k_ce_send(struct ath11k_base *ab, struct sk_buff *skb, u8 pipe_id,
		   u16 transfer_id);
void ath11k_ce_rx_post_buf(struct ath11k_base *ab);
int ath11k_ce_init_pipes(struct ath11k_base *ab);
int ath11k_ce_alloc_pipes(struct ath11k_base *ab);
void ath11k_ce_free_pipes(struct ath11k_base *ab);
int ath11k_ce_get_attr_flags(struct ath11k_base *ab, int ce_id);
void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
void ath11k_ce_get_shadow_config(struct ath11k_base *ab,
				 u32 **shadow_cfg, u32 *shadow_cfg_len);
void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab);

#endif