Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f03ebdb authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ipc: add audio apr virtualization support"

parents 34b7d3b2 150c909b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2017, 2019, The Linux Foundation. All rights reserved.
 */
#ifndef __APR_H_
#define __APR_H_
@@ -129,6 +129,10 @@ struct apr_svc {
	struct mutex m_lock;
	spinlock_t w_lock;
	uint8_t pkt_owner;
#ifdef CONFIG_MSM_QDSP6_APRV2_VM
	uint16_t vm_dest_svc;
	uint32_t vm_handle;
#endif
};

struct apr_client {

include/ipc/aprv2_vm.h

0 → 100644
+108 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
 */
#ifndef __APRV2_VM_H__
#define __APRV2_VM_H__

#define APRV2_VM_MAX_DNS_SIZE (31)
  /* Includes NULL character. */
#define APRV2_VM_PKT_SERVICE_ID_MASK (0x00FF)
  /* Bitmask of the service ID field. */

/* Packet Structure Definition */
struct aprv2_vm_packet_t {
	uint32_t header;
	uint16_t src_addr;
	uint16_t src_port;
	uint16_t dst_addr;
	uint16_t dst_port;
	uint32_t token;
	uint32_t opcode;
};

/**
 * In order to send command/event via MM HAB, the following buffer
 * format shall be followed, where the buffer is provided to the
 * HAB send API.
 * |-----cmd_id or evt_id -----| <- 32 bit, e.g. APRV2_VM_CMDID_REGISTER
 * |-----cmd payload ----------| e.g. aprv2_vm_cmd_register_t
 * | ...                       |
 *
 * In order to receive a command response or event ack, the following
 * buffer format shall be followed, where the buffer is provided to
 * the HAB receive API.
 * |-----cmd response ---------| e.g. aprv2_vm_cmd_register_rsp_t
 * | ...                       |
 */

/* Registers a service with the backend APR driver. */
#define APRV2_VM_CMDID_REGISTER          (0x00000001)

struct aprv2_vm_cmd_register_t {
	uint32_t name_size;
    /**< The service name string size in bytes. */
	char name[APRV2_VM_MAX_DNS_SIZE];
    /**<
     * The service name string to register.
     *
     * A NULL name means the service does not have a name.
     */
	uint16_t addr;
    /**<
     *  The address to register.
     *
     * A zero value means to auto-generate a free dynamic address.
     * A non-zero value means to directly use the statically assigned address.
     */
};

struct aprv2_vm_cmd_register_rsp_t {
	int32_t status;
    /**< The status of registration. */
	uint32_t handle;
    /**< The registered service handle. */
	uint16_t addr;
    /**< The actual registered address. */
};

#define APRV2_VM_CMDID_DEREGISTER        (0x00000002)

struct aprv2_vm_cmd_deregister_t {
	uint32_t handle;
    /**< The registered service handle. */
};

struct aprv2_vm_cmd_deregister_rsp_t {
	int32_t status;
    /**< The status of de-registration. */
};

#define APRV2_VM_CMDID_ASYNC_SEND        (0x00000003)

struct aprv2_vm_cmd_async_send_t {
	uint32_t handle;
    /**< The registered service handle. */
	struct aprv2_vm_packet_t pkt_header;
    /**< The packet header. */
    /* The apr packet payload follows */
};

struct aprv2_vm_cmd_async_send_rsp_t {
	int32_t status;
    /**< The status of send. */
};

#define APRV2_VM_EVT_RX_PKT_AVAILABLE    (0x00000004)

struct aprv2_vm_evt_rx_pkt_available_t {
	struct aprv2_vm_packet_t pkt_header;
    /**< The packet header. */
    /* The apr packet payload follows */
};

struct aprv2_vm_ack_rx_pkt_available_t {
	int32_t status;
};

#endif /* __APRV2_VM_H__ */
+6 −0
Original line number Diff line number Diff line
@@ -89,6 +89,11 @@ APRV_GLINK += apr_v3.o
APRV_GLINK += apr_tal_rpmsg.o
endif

ifdef CONFIG_MSM_QDSP6_APRV2_VM
APRV_GLINK += apr_vm.o
APRV_GLINK += apr_v2.o
endif

ifdef CONFIG_WCD_DSP_GLINK
WDSP_GLINK += wcd-dsp-glink.o
endif
@@ -147,6 +152,7 @@ endif
# Module information used by KBuild framework
obj-$(CONFIG_MSM_QDSP6_APRV2_RPMSG) += apr_dlkm.o
obj-$(CONFIG_MSM_QDSP6_APRV3_RPMSG) += apr_dlkm.o
obj-$(CONFIG_MSM_QDSP6_APRV2_VM) += apr_dlkm.o
apr_dlkm-y := $(APRV_GLINK)

obj-$(CONFIG_WCD_DSP_GLINK) += wglink_dlkm.o

ipc/apr_vm.c

0 → 100644
+1477 −0

File added.

Preview size limit exceeded, changes collapsed.