linux/include/linux/soc/qcom/apr.h

/* SPDX-License-Identifier: GPL-2.0 */

#ifndef __QCOM_APR_H_
#define __QCOM_APR_H_

#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <dt-bindings/soc/qcom,apr.h>
#include <dt-bindings/soc/qcom,gpr.h>

extern const struct bus_type aprbus;

#define APR_HDR_LEN(hdr_len)

/*
 * HEADER field
 * version:0:3
 * header_size : 4:7
 * message_type : 8:9
 * reserved: 10:15
 */
#define APR_HDR_FIELD(msg_type, hdr_len, ver)

#define APR_HDR_SIZE
#define APR_SEQ_CMD_HDR_FIELD
/* Version */
#define APR_PKT_VER

/* Command and Response Types */
#define APR_MSG_TYPE_EVENT
#define APR_MSG_TYPE_CMD_RSP
#define APR_MSG_TYPE_SEQ_CMD
#define APR_MSG_TYPE_NSEQ_CMD
#define APR_MSG_TYPE_MAX

/* APR Basic Response Message */
#define APR_BASIC_RSP_RESULT
#define APR_RSP_ACCEPTED

struct aprv2_ibasic_rsp_result_t {};

/* hdr field Ver [0:3], Size [4:7], Message type [8:10] */
#define APR_HDR_FIELD_VER(h)
#define APR_HDR_FIELD_SIZE(h)
#define APR_HDR_FIELD_SIZE_BYTES(h)
#define APR_HDR_FIELD_MT(h)

struct apr_hdr {} __packed;

struct apr_pkt {};

struct apr_resp_pkt {};

struct gpr_hdr {} __packed;

struct gpr_pkt {};

struct gpr_resp_pkt {};

#define GPR_HDR_SIZE
#define GPR_PKT_VER
#define GPR_PKT_HEADER_WORD_SIZE
#define GPR_PKT_HEADER_BYTE_SIZE

#define GPR_BASIC_RSP_RESULT

struct gpr_ibasic_rsp_result_t {};

#define GPR_BASIC_EVT_ACCEPTED

struct gpr_ibasic_rsp_accepted_t {};

/* Bits 0 to 15 -- Minor version,  Bits 16 to 31 -- Major version */
#define APR_SVC_MAJOR_VERSION(v)
#define APR_SVC_MINOR_VERSION(v)

gpr_port_cb;
struct packet_router;
struct pkt_router_svc {};

gpr_port_t;

struct apr_device {};

gpr_device_t;

#define to_apr_device(d)
#define svc_to_apr_device(d)

struct apr_driver {};

gpr_driver_t;
#define to_apr_driver(d)

/*
 * use a macro to avoid include chaining to get THIS_MODULE
 */
#define apr_driver_register(drv)

int __apr_driver_register(struct apr_driver *drv, struct module *owner);
void apr_driver_unregister(struct apr_driver *drv);

/**
 * module_apr_driver() - Helper macro for registering a aprbus driver
 * @__apr_driver: apr_driver struct
 *
 * Helper macro for aprbus drivers which do not do anything special in
 * module init/exit. This eliminates a lot of boilerplate. Each module
 * may only use this macro once, and calling it replaces module_init()
 * and module_exit()
 */
#define module_apr_driver(__apr_driver)
#define module_gpr_driver(__gpr_driver)

int apr_send_pkt(struct apr_device *adev, struct apr_pkt *pkt);

gpr_port_t *gpr_alloc_port(gpr_device_t *gdev, struct device *dev,
				gpr_port_cb cb, void *priv);
void gpr_free_port(gpr_port_t *port);
int gpr_send_port_pkt(gpr_port_t *port, struct gpr_pkt *pkt);
int gpr_send_pkt(gpr_device_t *gdev, struct gpr_pkt *pkt);

#endif /* __QCOM_APR_H_ */