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

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

#ifndef ATH11K_HTC_H
#define ATH11K_HTC_H

#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/bug.h>
#include <linux/skbuff.h>
#include <linux/timer.h>

struct ath11k_base;

#define HTC_HDR_ENDPOINTID
#define HTC_HDR_FLAGS
#define HTC_HDR_PAYLOADLEN
#define HTC_HDR_CONTROLBYTES0
#define HTC_HDR_CONTROLBYTES1
#define HTC_HDR_RESERVED

#define HTC_SVC_MSG_SERVICE_ID
#define HTC_SVC_MSG_CONNECTIONFLAGS
#define HTC_SVC_MSG_SERVICEMETALENGTH
#define HTC_READY_MSG_CREDITCOUNT
#define HTC_READY_MSG_CREDITSIZE
#define HTC_READY_MSG_MAXENDPOINTS

#define HTC_READY_EX_MSG_HTCVERSION
#define HTC_READY_EX_MSG_MAXMSGSPERHTCBUNDLE

#define HTC_SVC_RESP_MSG_SERVICEID
#define HTC_SVC_RESP_MSG_STATUS
#define HTC_SVC_RESP_MSG_ENDPOINTID
#define HTC_SVC_RESP_MSG_MAXMSGSIZE
#define HTC_SVC_RESP_MSG_SERVICEMETALENGTH

#define HTC_MSG_MESSAGEID
#define HTC_SETUP_COMPLETE_EX_MSG_SETUPFLAGS
#define HTC_SETUP_COMPLETE_EX_MSG_MAXMSGSPERBUNDLEDRECV
#define HTC_SETUP_COMPLETE_EX_MSG_RSVD0
#define HTC_SETUP_COMPLETE_EX_MSG_RSVD1
#define HTC_SETUP_COMPLETE_EX_MSG_RSVD2

enum ath11k_htc_tx_flags {};

enum ath11k_htc_rx_flags {};

struct ath11k_htc_hdr {} __packed __aligned();

enum ath11k_htc_msg_id {};

enum ath11k_htc_version {};

#define ATH11K_HTC_CONN_FLAGS_THRESHOLD_LEVEL_MASK
#define ATH11K_HTC_CONN_FLAGS_RECV_ALLOC

enum ath11k_htc_conn_flags {};

enum ath11k_htc_conn_svc_status {};

struct ath11k_htc_ready {} __packed;

struct ath11k_htc_ready_extended {} __packed;

struct ath11k_htc_conn_svc {} __packed;

struct ath11k_htc_conn_svc_resp {} __packed;

#define ATH11K_GLOBAL_DISABLE_CREDIT_FLOW

struct ath11k_htc_setup_complete_extended {} __packed;

struct ath11k_htc_msg {} __packed __aligned();

enum ath11k_htc_record_id {};

struct ath11k_htc_record_hdr {} __packed;

struct ath11k_htc_credit_report {} __packed;

struct ath11k_htc_record {} __packed __aligned();

enum ath11k_htc_svc_gid {};

#define SVC

enum ath11k_htc_svc_id {};

#undef SVC

enum ath11k_htc_ep_id {};

struct ath11k_htc_ep_ops {};

/* service connection information */
struct ath11k_htc_svc_conn_req {};

/* service connection response information */
struct ath11k_htc_svc_conn_resp {};

#define ATH11K_NUM_CONTROL_TX_BUFFERS
#define ATH11K_HTC_MAX_LEN
#define ATH11K_HTC_MAX_CTRL_MSG_LEN
#define ATH11K_HTC_WAIT_TIMEOUT_HZ
#define ATH11K_HTC_CONTROL_BUFFER_SIZE
#define ATH11K_HTC_CONN_SVC_TIMEOUT_HZ
#define ATH11K_HTC_MAX_SERVICE_ALLOC_ENTRIES

struct ath11k_htc_ep {};

struct ath11k_htc_svc_tx_credits {};

struct ath11k_htc {};

int ath11k_htc_init(struct ath11k_base *ar);
int ath11k_htc_wait_target(struct ath11k_htc *htc);
int ath11k_htc_start(struct ath11k_htc *htc);
int ath11k_htc_connect_service(struct ath11k_htc *htc,
			       struct ath11k_htc_svc_conn_req  *conn_req,
			       struct ath11k_htc_svc_conn_resp *conn_resp);
int ath11k_htc_send(struct ath11k_htc *htc, enum ath11k_htc_ep_id eid,
		    struct sk_buff *packet);
struct sk_buff *ath11k_htc_alloc_skb(struct ath11k_base *ar, int size);
void ath11k_htc_rx_completion_handler(struct ath11k_base *ar,
				      struct sk_buff *skb);
void ath11k_htc_tx_completion_handler(struct ath11k_base *ab,
				      struct sk_buff *skb);
#endif