mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
Merge "char: virtio_eavb: Add virtio_eavb frontend driver"
This commit is contained in:
commit
7db29deefa
6 changed files with 2373 additions and 0 deletions
|
|
@ -572,6 +572,15 @@ config ADSPRPC_QGKI
|
|||
in a GKI kernel or not.
|
||||
Say Y if the driver is being compiled in a QGKI kernel.
|
||||
|
||||
config VIRTIO_EAVB
|
||||
tristate "Virtio eavb driver"
|
||||
depends on VIRTIO
|
||||
help
|
||||
This the virtual eavb frontend driver based on virtio. Eavb
|
||||
means ethernet Audio Video Bridging. It provides unified ioctl
|
||||
interface for userspace. Say Y if you want to support virtual
|
||||
eavb.
|
||||
|
||||
config MSM_RDBG
|
||||
tristate "QTI Remote debug driver"
|
||||
help
|
||||
|
|
|
|||
|
|
@ -62,3 +62,4 @@ obj-$(CONFIG_MSM_ADSPRPC) += frpc-adsprpc.o
|
|||
obj-$(CONFIG_ADI) += adi.o
|
||||
obj-$(CONFIG_MSM_RDBG) += rdbg.o
|
||||
obj-$(CONFIG_MSM_FASTCVPD) += fastcvpd.o
|
||||
obj-$(CONFIG_VIRTIO_EAVB) += virtio_eavb/
|
||||
|
|
|
|||
6
drivers/char/virtio_eavb/Makefile
Normal file
6
drivers/char/virtio_eavb/Makefile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
ccflags-y := -DEAVB_DEBUGFS
|
||||
|
||||
obj-$(CONFIG_VIRTIO_EAVB) += eavb_fe.o
|
||||
|
||||
eavb_fe-y := virtio_eavb.o
|
||||
318
drivers/char/virtio_eavb/vio_eavb.h
Normal file
318
drivers/char/virtio_eavb/vio_eavb.h
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#ifndef __VDEV_VIRTIO_EAVB_H__
|
||||
#define __VDEV_VIRTIO_EAVB_H__
|
||||
|
||||
#define IF_NAMESIZE 16
|
||||
#define STATION_ADDR_SIZE 8
|
||||
#define MAX_STREAM_NUM 8
|
||||
#define MAX_CONFIG_FILE_PATH 512
|
||||
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 1
|
||||
|
||||
#define VIRTIO_EAVB_T_CREATE_STREAM 0
|
||||
#define VIRTIO_EAVB_T_GET_STREAM_INFO 1
|
||||
#define VIRTIO_EAVB_T_CONNECT_STREAM 2
|
||||
#define VIRTIO_EAVB_T_RECEIVE 3
|
||||
#define VIRTIO_EAVB_T_TRANSMIT 4
|
||||
#define VIRTIO_EAVB_T_DISCONNECT_STREAM 5
|
||||
#define VIRTIO_EAVB_T_DESTROY_STREAM 6
|
||||
#define VIRTIO_EAVB_T_CREATE_STREAM_PATH 7
|
||||
#define VIRTIO_EAVB_T_VERSION 8
|
||||
#define VIRTIO_EAVB_T_MMAP 9
|
||||
#define VIRTIO_EAVB_T_MUNMAP 10
|
||||
#define VIRTIO_EAVB_T_UPDATE_CLK 11
|
||||
|
||||
struct vio_msg_hdr {
|
||||
uint16_t msgid; /* unique message id */
|
||||
uint16_t len; /* command total length */
|
||||
uint32_t cmd; /* command */
|
||||
uint64_t streamctx_hdl;/* streamCtx handle */
|
||||
int32_t stream_idx; /* streamCtx idx in BE */
|
||||
int32_t result; /* command result */
|
||||
} __packed;
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_CREATE_STREAM
|
||||
*/
|
||||
|
||||
struct vio_stream_config {
|
||||
uint16_t stream_id;
|
||||
char eth_interface[IF_NAMESIZE];
|
||||
uint16_t vlan_id;
|
||||
uint16_t ring_buffer_elem_count;
|
||||
int ring_buffer_mode;
|
||||
int avb_role; /* talker = 0 or listener = 1 */
|
||||
uint8_t dest_macaddr[STATION_ADDR_SIZE];
|
||||
uint8_t stream_addr[STATION_ADDR_SIZE];
|
||||
/* "crf_macaddr" or "crf_dest_macaddr" */
|
||||
uint8_t crf_dest_macaddr[STATION_ADDR_SIZE];
|
||||
uint8_t crf_stream_addr[STATION_ADDR_SIZE];
|
||||
int mapping_type;
|
||||
int wakeup_interval; /* "wakeup_interval" or "tx_interval" */
|
||||
int tx_pkts_per_sec; /* if not set, do default */
|
||||
int max_stale_ms; /* int max_stale_ns = max_stale_ms*1000 */
|
||||
int presentation_time_ms; /* if not set, do default */
|
||||
int enforce_presentation_time;
|
||||
int sr_class_type; /* A = 0 B = 1 AAF = 2 */
|
||||
/* sets number of items to se sent on each tx / rx */
|
||||
int packing_factor;
|
||||
int bandwidth;
|
||||
|
||||
/* H.264 */
|
||||
int max_payload; /* "max_payload" or "max_video_payload" */
|
||||
|
||||
int mrp_enabled;
|
||||
|
||||
/* Audio Specific */
|
||||
int pcm_bit_depth;
|
||||
int pcm_channels;
|
||||
int sample_rate; /* in hz */
|
||||
unsigned char endianness; /* 0 = big 1 = little */
|
||||
|
||||
int ieee1722_standard;
|
||||
|
||||
/* Thread priority in QNX side */
|
||||
int talker_priority;
|
||||
int listener_priority;
|
||||
int crf_priority;
|
||||
|
||||
/* CRF */
|
||||
/* 0 - disabled
|
||||
* 1 - CRF talker (listener drives reference)
|
||||
* 2 - CRF with talker reference (talker has CRF talker)
|
||||
*/
|
||||
int crf_mode;
|
||||
|
||||
/* 0 - custom
|
||||
* 1- audio
|
||||
* 2- video frame
|
||||
* 3 - video line
|
||||
* 4 - machine cycle
|
||||
*/
|
||||
int crf_type;
|
||||
|
||||
/* time interval after how many events timestamp is to be produced
|
||||
* (base_frequency * pull) / timestamp_interval =
|
||||
* # of timestamps per second
|
||||
*/
|
||||
int crf_timestamping_interval;
|
||||
int crf_timestamping_interval_remote;
|
||||
int crf_timestamping_interval_local;
|
||||
/* enables/disables dynamic IPG adjustments */
|
||||
int crf_allow_dynamic_tx_adjust;
|
||||
/* indicates how many CRF timestamps per each CRF packet */
|
||||
int crf_num_timestamps_per_pkt;
|
||||
|
||||
int64_t crf_mcr_adjust_min_ppm;
|
||||
int64_t crf_mcr_adjust_max_ppm;
|
||||
|
||||
uint16_t crf_stream_id; /* CRF stream ID */
|
||||
int32_t crf_base_frequency; /* CRF base frequency */
|
||||
|
||||
int32_t crf_listener_ts_smoothing;
|
||||
int32_t crf_talker_ts_smoothing;
|
||||
|
||||
/* multiplier for the base frequency; */
|
||||
int crf_pull;
|
||||
/* indicates how often to issue MCR callback events
|
||||
* how many packets will generate one callback.
|
||||
*/
|
||||
int crf_event_callback_interval;
|
||||
/* Indicates how often to update IPG */
|
||||
int crf_dynamic_tx_adjust_interval;
|
||||
|
||||
/* stats */
|
||||
int32_t enable_stats_reporting;
|
||||
int32_t stats_reporting_interval;
|
||||
int32_t stats_reporting_samples;
|
||||
|
||||
/* packet tracking */
|
||||
int32_t enable_packet_tracking;
|
||||
int32_t packet_tracking_interval;
|
||||
int blocking_write_enabled;
|
||||
double blocking_write_fill_level;
|
||||
int app_tx_block_enabled;
|
||||
int stream_interleaving_enabled;
|
||||
int create_talker_thread;
|
||||
int create_crf_threads;
|
||||
int listener_bpf_pkts_per_buff;
|
||||
} __packed;
|
||||
|
||||
|
||||
struct vio_create_stream_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
struct vio_stream_config cfg;
|
||||
uint64_t streamCtx;
|
||||
int32_t stream_idx;
|
||||
} __packed;
|
||||
|
||||
|
||||
struct vio_create_stream_path_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
char path[MAX_CONFIG_FILE_PATH];
|
||||
uint64_t streamCtx;
|
||||
int32_t stream_idx;
|
||||
} __packed;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_GET_STREAM_INFO
|
||||
*/
|
||||
|
||||
struct eavb_stream_info {
|
||||
int role;
|
||||
int mapping_type;
|
||||
/* Max packet payload size */
|
||||
unsigned int max_payload;
|
||||
/* Number of packets sent per wake */
|
||||
unsigned int pkts_per_wake;
|
||||
/* Time to sleep between wakes */
|
||||
unsigned int wakeup_period_us;
|
||||
|
||||
/* Audio Specific */
|
||||
/* Audio bit depth 8/16/24/32 */
|
||||
int pcm_bit_depth;
|
||||
/* Audio channels 1/2 */
|
||||
int num_pcm_channels;
|
||||
/* Audio sample rate in hz */
|
||||
int sample_rate;
|
||||
/* Audio sample endianness 0(big)/1(little) */
|
||||
unsigned char endianness;
|
||||
|
||||
/* Max buffer size (Bytes) allowed */
|
||||
unsigned int max_buffer_size;
|
||||
} __packed;
|
||||
|
||||
|
||||
struct vio_get_stream_info_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
struct eavb_stream_info stream_info;
|
||||
} __packed;
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_CONNECT_STREAM
|
||||
*/
|
||||
|
||||
struct vio_connect_stream_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
} __packed;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_RECEIVE
|
||||
*/
|
||||
|
||||
struct eavb_buf_hdr {
|
||||
/* This flag is used for H.264 and MJPEG streams:
|
||||
* 1. H.264: Set for the very last packet of an access unit.
|
||||
* 2. MJPEG Set the last packet of a video frame.
|
||||
*/
|
||||
uint32_t flag_end_of_frame:1;
|
||||
|
||||
/* This flag is used in file transfer only:
|
||||
* Set for the last packet in the file
|
||||
*/
|
||||
uint32_t flag_end_of_file:1;
|
||||
|
||||
uint32_t flag_reserved:30;
|
||||
|
||||
/* Audio event Layout D3scription Valid Channels
|
||||
* event value
|
||||
* 0 Static layout Based on config
|
||||
* 1 Mono 0
|
||||
* 2 Stereo 0, 1
|
||||
* 3 5.1 0,1,2,3,4,5
|
||||
* 4 7.1 0,1,2,3,4,5,6,7
|
||||
* 5-15 Custom Defined by System
|
||||
* Integrator
|
||||
*/
|
||||
uint32_t event;
|
||||
|
||||
uint32_t reserved;
|
||||
uint32_t payload_size; /* Size of the payload (bytes) */
|
||||
} __packed;
|
||||
|
||||
struct eavb_buf_data {
|
||||
struct eavb_buf_hdr hdr;
|
||||
uint64_t gpa; /* GVM physical address of buffer */
|
||||
} __packed;
|
||||
|
||||
struct vio_receive_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
struct eavb_buf_data data; /* IN/OUT */
|
||||
int32_t received;
|
||||
} __packed;
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_TRANSMIT
|
||||
*/
|
||||
|
||||
struct vio_transmit_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
struct eavb_buf_data data; /* IN/OUT */
|
||||
int32_t written;
|
||||
} __packed;
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_DISCONNECT_STREAM
|
||||
*/
|
||||
|
||||
struct vio_disconnect_stream_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
} __packed;
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_DESTROY_STREAM
|
||||
*/
|
||||
|
||||
struct vio_destroy_stream_msg {
|
||||
struct vio_msg_hdr mhdr;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_VERSION
|
||||
*/
|
||||
struct vio_version_msg {
|
||||
struct vio_msg_hdr mhdr; /* IN */
|
||||
uint16_t major; /* IN */
|
||||
uint16_t minor; /* IN */
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_MMAP
|
||||
*/
|
||||
|
||||
struct vio_mmap_msg {
|
||||
struct vio_msg_hdr mhdr; /* IN */
|
||||
uint32_t size; /* IN */
|
||||
uint64_t gpa; /* IN */
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_MUNMAP
|
||||
*/
|
||||
struct vio_munmap_msg {
|
||||
struct vio_msg_hdr mhdr; /* IN */
|
||||
uint64_t gpa; /* IN */
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_UPDATE_CLK
|
||||
*/
|
||||
struct vio_update_clk_msg {
|
||||
struct vio_msg_hdr mhdr; /* IN */
|
||||
uint64_t clk; /* IN */
|
||||
} __packed;
|
||||
|
||||
#endif /* __VDEV_VIRTIO_EAVB_H__ */
|
||||
1652
drivers/char/virtio_eavb/virtio_eavb.c
Normal file
1652
drivers/char/virtio_eavb/virtio_eavb.c
Normal file
File diff suppressed because it is too large
Load diff
387
include/uapi/linux/eavb_shared.h
Normal file
387
include/uapi/linux/eavb_shared.h
Normal file
|
|
@ -0,0 +1,387 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
||||
/*
|
||||
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#ifndef __EAVB_SHARED_H__
|
||||
#define __EAVB_SHARED_H__
|
||||
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define EAVB_IOCTL_MAGIC 'B'
|
||||
|
||||
/* ioctl request */
|
||||
#define EAVB_IOCTL_CREATE_STREAM \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 1, struct eavb_ioctl_create_stream)
|
||||
#define EAVB_IOCTL_GET_STREAM_INFO \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 2, struct eavb_ioctl_get_stream_info)
|
||||
|
||||
/* DEPRECATED Do not use this in new code */
|
||||
#define EAVB_IOCTL_CONNECT_STREAM \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 3, struct eavb_ioctl_connect_stream)
|
||||
|
||||
#define EAVB_IOCTL_RECEIVE \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 4, struct eavb_ioctl_receive)
|
||||
#define EAVB_IOCTL_RECV_DONE \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 5, struct eavb_ioctl_recv_done)
|
||||
#define EAVB_IOCTL_TRANSMIT \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 6, struct eavb_ioctl_transmit)
|
||||
#define EAVB_IOCTL_DISCONNECT_STREAM \
|
||||
_IOW(EAVB_IOCTL_MAGIC, 9, struct eavb_ioctl_disconnect_stream)
|
||||
#define EAVB_IOCTL_DESTROY_STREAM \
|
||||
_IOW(EAVB_IOCTL_MAGIC, 10, struct eavb_ioctl_destroy_stream)
|
||||
#define EAVB_IOCTL_CREATE_STREAM_WITH_PATH \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 11, struct eavb_ioctl_create_stream_with_path)
|
||||
#define EAVB_IOCTL_GET_CRF_TS \
|
||||
_IOWR(EAVB_IOCTL_MAGIC, 12, __u64)
|
||||
|
||||
/* default value */
|
||||
#define STATION_ADDR_SIZE 8
|
||||
#define IF_NAMESIZE 16
|
||||
#define MAX_CONFIG_FILE_PATH 512
|
||||
|
||||
/* Invalid value for config file */
|
||||
#define AVB_INVALID_ADDR (0xFF)
|
||||
#define AVB_INVALID_INTEGER (-1)
|
||||
#define AVB_INVALID_UINT (-1)
|
||||
|
||||
|
||||
enum avb_role {
|
||||
AVB_ROLE_TALKER = 0,
|
||||
AVB_ROLE_LISTENER,
|
||||
AVB_ROLE_CRF_TALKER,
|
||||
AVB_ROLE_INVALID = -1
|
||||
};
|
||||
|
||||
enum stream_mapping_type {
|
||||
NONE = 0,
|
||||
PCM,
|
||||
H264,
|
||||
MPEG2TS,
|
||||
MJPEG,
|
||||
CRF,
|
||||
MAPPING_TYPE_INVALID = -1
|
||||
};
|
||||
|
||||
enum ring_buffer_mode {
|
||||
/* Return error when new data doesn't fit in ring buffer */
|
||||
RING_BUFFER_MODE_FILL = 0,
|
||||
/* Drop oldest samples to make room for new data */
|
||||
RING_BUFFER_MODE_DROP_OLD = 1,
|
||||
/* Drop oldest samples to make room for new data */
|
||||
RING_BUFFER_MODE_INVALID = -1
|
||||
};
|
||||
|
||||
enum avb_class {
|
||||
CLASS_A = 0,
|
||||
CLASS_B = 1,
|
||||
CLASS_AAF = 2,
|
||||
CLASS_INVALID = -1
|
||||
};
|
||||
|
||||
enum data_endianness {
|
||||
ENDIAN_BIG = 0,
|
||||
ENDIAN_LITTLE = 1,
|
||||
ENDIAN_INVALID = -1
|
||||
};
|
||||
|
||||
enum avb_ieee1722_version {
|
||||
QAVB_IEEE_1722_ver_2010 = 0,
|
||||
QAVB_IEEE_1722_ver_2016,
|
||||
QAVB_IEEE_1722_ver_INVALID = -1,
|
||||
};
|
||||
|
||||
enum avtp_crf_mode {
|
||||
/* CRF disabled */
|
||||
QAVB_AVTP_CRF_MODE_DISABLED = 0,
|
||||
/* CRF talker */
|
||||
QAVB_AVTP_CRF_MODE_TALKER,
|
||||
/* CRF listener, PPM = local - remote */
|
||||
QAVB_AVTP_CRF_MODE_LISTENER,
|
||||
/* CRF listener, PPM = nominal - remote */
|
||||
QAVB_AVTP_CRF_MODE_LISTENER_NOMINAL,
|
||||
QAVB_AVTP_CRF_MODE_MAX
|
||||
};
|
||||
|
||||
enum avtp_crf_type {
|
||||
/* user specified */
|
||||
QAVB_AVTP_CRF_TYPE_USER = 0,
|
||||
/* audio ample timestamp */
|
||||
QAVB_AVTP_CRF_TYPE_AUDIO_SAMPLE,
|
||||
/* video frame sync timestamp */
|
||||
QAVB_AVTP_CRF_TYPE_VIDEO_FRAME,
|
||||
/* video line timestamp */
|
||||
QAVB_AVTP_CRF_TYPE_VIDEO_LINE,
|
||||
/* machine cycle timestamp */
|
||||
QAVB_AVTP_CRF_TYPE_MACHINE_CYCLE,
|
||||
QAVB_AVTP_CRF_TYPE_MAX
|
||||
};
|
||||
|
||||
enum avtp_crf_pull {
|
||||
/* Multiply base_frequency field by 1.0 */
|
||||
QAVB_AVTP_CRF_PULL_1_DIV_1_0 = 0,
|
||||
/* Multiply base_frequency field by 1/1.1001 */
|
||||
QAVB_AVTP_CRF_PULL_1_DIV_1_DOT_1001,
|
||||
/* Multiply base_frequency field by 1.1001 */
|
||||
QAVB_AVTP_CRF_PULL_1_DOT_1001,
|
||||
/* Multiply base_frequency field by 24/25 */
|
||||
QAVB_AVTP_CRF_PULL_24_DIV_25,
|
||||
/* Multiply base_frequency field by 25/24 */
|
||||
QAVB_AVTP_CRF_PULL_25_DIV_24,
|
||||
/* Multiply base_frequency field by 8 */
|
||||
QAVB_AVTP_CRF_PULL_8,
|
||||
QAVB_AVTP_CRF_PULL_MAX
|
||||
};
|
||||
|
||||
struct eavb_ioctl_hdr {
|
||||
__u64 streamCtx;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_CREATE_STREAM
|
||||
*/
|
||||
|
||||
/* DEPRECATED Do not use this in new code */
|
||||
struct eavb_ioctl_stream_config {
|
||||
__u16 stream_id;
|
||||
char eth_interface[IF_NAMESIZE];
|
||||
__u16 vlan_id;
|
||||
__u16 ring_buffer_elem_count;
|
||||
enum ring_buffer_mode ring_buffer_mode;
|
||||
/* talker = 0 or listener = 1 */
|
||||
enum avb_role avb_role;
|
||||
__u8 dest_macaddr[STATION_ADDR_SIZE];
|
||||
__u8 stream_addr[STATION_ADDR_SIZE];
|
||||
/* "crf_macaddr" or "crf_dest_macaddr" */
|
||||
__u8 crf_dest_macaddr[STATION_ADDR_SIZE];
|
||||
__u8 crf_stream_addr[STATION_ADDR_SIZE];
|
||||
enum stream_mapping_type mapping_type;
|
||||
int wakeup_interval; /* "wakeup_interval" or "tx_interval" */
|
||||
int tx_pkts_per_sec; /* if not set, do default */
|
||||
int max_stale_ms; /* int max_stale_ns = max_stale_ms*1000; */
|
||||
int presentation_time_ms; /* if not set, do default */
|
||||
int enforce_presentation_time;
|
||||
int sr_class_type; /* A = 0 B = 1 AAF = 2 */
|
||||
/* sets number of items to se sent on each tx / rx */
|
||||
int packing_factor;
|
||||
int bandwidth;
|
||||
|
||||
/* H.264 */
|
||||
int max_payload; /* "max_payload" or "max_video_payload" */
|
||||
|
||||
int mrp_enabled;
|
||||
|
||||
/* Audio Specific */
|
||||
int pcm_bit_depth;
|
||||
int pcm_channels;
|
||||
int sample_rate; /* in hz */
|
||||
unsigned char endianness; /* 0 = big 1 = little */
|
||||
|
||||
int ieee1722_standard;
|
||||
|
||||
/* Thread priority in QNX side */
|
||||
int talker_priority;
|
||||
int listener_priority;
|
||||
int crf_priority;
|
||||
|
||||
/* CRF */
|
||||
|
||||
/* 0 - disabled
|
||||
* 1 - CRF talker (listener drives reference)
|
||||
* 2 - CRF with talker reference (talker has CRF talker)
|
||||
*/
|
||||
int crf_mode;
|
||||
|
||||
/* 0 - custom
|
||||
* 1- audio
|
||||
* 2- video frame
|
||||
* 3 - video line
|
||||
* 4 - machine cycle
|
||||
*/
|
||||
int crf_type;
|
||||
|
||||
/* time interval after how many events timestamp is to be produced
|
||||
* (base_frequency * pull) / timestamp_interval =
|
||||
* # of timestamps per second
|
||||
*/
|
||||
int crf_timestamping_interval;
|
||||
int crf_timestamping_interval_remote;
|
||||
int crf_timestamping_interval_local;
|
||||
/* enables/disables dynamic IPG adjustments */
|
||||
int crf_allow_dynamic_tx_adjust;
|
||||
/* indicates how many CRF timestamps per each CRF packet */
|
||||
int crf_num_timestamps_per_pkt;
|
||||
|
||||
__s64 crf_mcr_adjust_min_ppm;
|
||||
__s64 crf_mcr_adjust_max_ppm;
|
||||
|
||||
__u16 crf_stream_id; /* CRF stream ID */
|
||||
__s32 crf_base_frequency; /* CRF base frequency */
|
||||
|
||||
__s32 crf_listener_ts_smoothing;
|
||||
__s32 crf_talker_ts_smoothing;
|
||||
|
||||
/* multiplier for the base frequency */
|
||||
int crf_pull;
|
||||
/* indicates how often to issue MCR callback events
|
||||
* how many packets will generate one callback.
|
||||
*/
|
||||
int crf_event_callback_interval;
|
||||
/* Indicates how often to update IPG */
|
||||
int crf_dynamic_tx_adjust_interval;
|
||||
|
||||
/* stats */
|
||||
__s32 enable_stats_reporting;
|
||||
__s32 stats_reporting_interval;
|
||||
__s32 stats_reporting_samples;
|
||||
|
||||
/* packet tracking */
|
||||
__s32 enable_packet_tracking;
|
||||
__s32 packet_tracking_interval;
|
||||
int blocking_write_enabled;
|
||||
double blocking_write_fill_level;
|
||||
int app_tx_block_enabled;
|
||||
int stream_interleaving_enabled;
|
||||
int create_talker_thread;
|
||||
int create_crf_threads;
|
||||
int listener_bpf_pkts_per_buff;
|
||||
} __packed;
|
||||
|
||||
/* DEPRECATED Do not use this in new code */
|
||||
struct eavb_ioctl_create_stream {
|
||||
struct eavb_ioctl_stream_config config; /* IN */
|
||||
struct eavb_ioctl_hdr hdr; /* OUT */
|
||||
};
|
||||
|
||||
struct eavb_ioctl_create_stream_with_path {
|
||||
char path[MAX_CONFIG_FILE_PATH]; /* IN */
|
||||
struct eavb_ioctl_hdr hdr; /* OUT */
|
||||
};
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_GET_STREAM_INFO
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_stream_info {
|
||||
enum avb_role role;
|
||||
enum stream_mapping_type mapping_type;
|
||||
/* Max packet payload size */
|
||||
unsigned int max_payload;
|
||||
/* Number of packets sent per wake */
|
||||
unsigned int pkts_per_wake;
|
||||
/* Time to sleep between wakes */
|
||||
unsigned int wakeup_period_us;
|
||||
|
||||
/* Audio Specific */
|
||||
/* Audio bit depth 8/16/24/32 */
|
||||
int pcm_bit_depth;
|
||||
/* Audio channels 1/2 */
|
||||
int num_pcm_channels;
|
||||
/* Audio sample rate in hz */
|
||||
int sample_rate;
|
||||
/* Audio sample endianness 0(big)/1(little) */
|
||||
unsigned char endianness;
|
||||
|
||||
/* Max buffer size (Bytes) allowed */
|
||||
unsigned int max_buffer_size;
|
||||
} __packed;
|
||||
|
||||
struct eavb_ioctl_get_stream_info {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
struct eavb_ioctl_stream_info info; /* OUT */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_CONNECT_STREAM
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_connect_stream {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_RECEIVE
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_buf_hdr {
|
||||
/* This flag is used for H.264 and MJPEG streams:
|
||||
* 1. H.264: Set for the very last packet of an access unit.
|
||||
* 2. MJPEG Set the last packet of a video frame.
|
||||
*/
|
||||
__u32 flag_end_of_frame:1;
|
||||
/* This flag is used in file transfer only:
|
||||
* Set for the last packet in the file
|
||||
*/
|
||||
__u32 flag_end_of_file:1;
|
||||
__u32 flag_reserved:30;
|
||||
/* Audio event Layout D3scription Valid Channels
|
||||
* event value
|
||||
* 0 Static layout Based on config
|
||||
* 1 Mono 0
|
||||
* 2 Stereo 0, 1
|
||||
* 3 5.1 0,1,2,3,4,5
|
||||
* 4 7.1 0,1,2,3,4,5,6,7
|
||||
* 5-15 Custom Defined by System
|
||||
* Integrator
|
||||
*/
|
||||
__u32 event;
|
||||
__u32 reserved;
|
||||
/* Size of the payload (bytes) */
|
||||
__u32 payload_size;
|
||||
} __packed;
|
||||
|
||||
struct eavb_ioctl_buf_data {
|
||||
struct eavb_ioctl_buf_hdr hdr;
|
||||
/* virtual address of buffer */
|
||||
__u64 pbuf;
|
||||
} __packed;
|
||||
|
||||
struct eavb_ioctl_receive {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
struct eavb_ioctl_buf_data data; /* IN/OUT */
|
||||
__s32 received; /* OUT */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_RECV_DONE
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_recv_done {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
struct eavb_ioctl_buf_data data; /* IN */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_TRANSMIT
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_transmit {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
struct eavb_ioctl_buf_data data; /* IN/OUT */
|
||||
__s32 written;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_DISCONNECT_STREAM
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_disconnect_stream {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* EAVB_IOCTL_DESTROY_STREAM
|
||||
*/
|
||||
|
||||
struct eavb_ioctl_destroy_stream {
|
||||
struct eavb_ioctl_hdr hdr; /* IN */
|
||||
};
|
||||
|
||||
#endif /*__EAVB_SHARED_H__*/
|
||||
Loading…
Reference in a new issue