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

Commit e2bbf87c authored by Jordan Crouse's avatar Jordan Crouse
Browse files

uapi: Fix QCOM headers to work with UAPI_HEADER_TEST



UAPI_HEADER_TEST ensures that all the uapi headers can be built as
standalone files which facilitates their use in the wider world. Fix
headers to use common kernel definitions.

Change-Id: Ic0dedbad3052d7355ddca5450cc72d3a3582d0ed
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 2090d939
Loading
Loading
Loading
Loading
+354 −354

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -2107,7 +2107,7 @@ struct ipa_ioc_query_intf_rx_props {
struct ipa_ioc_nat_alloc_mem {
	char dev_name[IPA_RESOURCE_NAME_MAX];
	size_t size;
	off_t offset;
	__kernel_off_t offset;
};

/**
@@ -2118,7 +2118,7 @@ struct ipa_ioc_nat_alloc_mem {
 */
struct ipa_ioc_nat_ipv6ct_table_alloc {
	size_t size;
	off_t offset;
	__kernel_off_t offset;
};

/**
+77 −77
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ struct kgsl_devinfo {
	 * number 200, 205, 220, etc...
	 */
	unsigned int gpu_id;
	size_t gmem_sizebytes;
	__kernel_size_t gmem_sizebytes;
};

/*
@@ -343,7 +343,7 @@ enum kgsl_timestamp_type {
/*
 * kgsl_capabilities_properties returns a list of supported properties.
 * If the user passes 0 for 'count' the kernel will set it to the number of
 * supported properties. The list is expected to be 'count * sizeof(uint32_t)'
 * supported properties. The list is expected to be 'count * sizeof(__u32)'
 * bytes long. The kernel will return the actual number of entries copied into
 * list via 'count'.
 */
@@ -372,18 +372,18 @@ struct kgsl_capabilities {

struct kgsl_shadowprop {
	unsigned long gpuaddr;
	size_t size;
	__kernel_size_t size;
	unsigned int flags; /* contains KGSL_FLAGS_ values */
};

struct kgsl_qdss_stm_prop {
	uint64_t gpuaddr;
	uint64_t size;
	__u64 gpuaddr;
	__u64 size;
};

struct kgsl_qtimer_prop {
	uint64_t gpuaddr;
	uint64_t size;
	__u64 gpuaddr;
	__u64 size;
};

struct kgsl_version {
@@ -394,8 +394,8 @@ struct kgsl_version {
};

struct kgsl_sp_generic_mem {
	uint64_t local;
	uint64_t pvt;
	__u64 local;
	__u64 pvt;
};

struct kgsl_ucode_version {
@@ -471,7 +471,7 @@ struct kgsl_context_property_fault {
struct kgsl_ibdesc {
	unsigned long gpuaddr;
	unsigned long __pad;
	size_t sizedwords;
	__kernel_size_t sizedwords;
	unsigned int ctrl;
};

@@ -491,11 +491,11 @@ struct kgsl_ibdesc {
 * execution time
 */
struct kgsl_cmdbatch_profiling_buffer {
	uint64_t wall_clock_s;
	uint64_t wall_clock_ns;
	uint64_t gpu_ticks_queued;
	uint64_t gpu_ticks_submitted;
	uint64_t gpu_ticks_retired;
	__u64 wall_clock_s;
	__u64 wall_clock_ns;
	__u64 gpu_ticks_queued;
	__u64 gpu_ticks_submitted;
	__u64 gpu_ticks_retired;
};

/* ioctls */
@@ -515,7 +515,7 @@ struct kgsl_cmdbatch_profiling_buffer {
struct kgsl_device_getproperty {
	unsigned int type;
	void __user *value;
	size_t sizebytes;
	__kernel_size_t sizebytes;
};

#define IOCTL_KGSL_DEVICE_GETPROPERTY \
@@ -631,8 +631,8 @@ struct kgsl_drawctxt_destroy {
struct kgsl_map_user_mem {
	int fd;
	unsigned long gpuaddr;   /*output param */
	size_t len;
	size_t offset;
	__kernel_size_t len;
	__kernel_size_t offset;
	unsigned long hostptr;   /*input param */
	enum kgsl_user_mem_type memtype;
	unsigned int flags;
@@ -778,7 +778,7 @@ struct kgsl_cmdwindow_write {

struct kgsl_gpumem_alloc {
	unsigned long gpuaddr; /* output param */
	size_t size;
	__kernel_size_t size;
	unsigned int flags;
};

@@ -787,7 +787,7 @@ struct kgsl_gpumem_alloc {

struct kgsl_cff_syncmem {
	unsigned long gpuaddr;
	size_t len;
	__kernel_size_t len;
	unsigned int __pad[2]; /* For future binary compatibility */
};

@@ -805,7 +805,7 @@ struct kgsl_timestamp_event {
	unsigned int timestamp;  /* Timestamp to trigger event on */
	unsigned int context_id; /* Context for the timestamp */
	void __user *priv;	 /* Pointer to the event specific blob */
	size_t len;              /* Size of the event specific blob */
	__kernel_size_t len;              /* Size of the event specific blob */
};

#define IOCTL_KGSL_TIMESTAMP_EVENT_OLD \
@@ -860,8 +860,8 @@ struct kgsl_timestamp_event_fence {
struct kgsl_gpumem_alloc_id {
	unsigned int id;
	unsigned int flags;
	size_t size;
	size_t mmapsize;
	__kernel_size_t size;
	__kernel_size_t mmapsize;
	unsigned long gpuaddr;
/* private: reserved for future use*/
	unsigned long __pad[2];
@@ -906,8 +906,8 @@ struct kgsl_gpumem_get_info {
	unsigned long gpuaddr;
	unsigned int id;
	unsigned int flags;
	size_t size;
	size_t mmapsize;
	__kernel_size_t size;
	__kernel_size_t mmapsize;
	unsigned long useraddr;
/* private: reserved for future use*/
	unsigned long __pad[4];
@@ -934,8 +934,8 @@ struct kgsl_gpumem_sync_cache {
	unsigned long gpuaddr;
	unsigned int id;
	unsigned int op;
	size_t offset;
	size_t length;
	__kernel_size_t offset;
	__kernel_size_t length;
};

#define KGSL_GPUMEM_CACHE_CLEAN (1 << 0)
@@ -1111,7 +1111,7 @@ struct kgsl_cmd_syncpoint_fence {
struct kgsl_cmd_syncpoint {
	int type;
	void __user *priv;
	size_t size;
	__kernel_size_t size;
};

/* Flag to indicate that the cmdlist may contain memlists */
@@ -1165,7 +1165,7 @@ struct kgsl_device_constraint {
	unsigned int type;
	unsigned int context_id;
	void __user *data;
	size_t size;
	__kernel_size_t size;
};

/* Constraint Type*/
@@ -1266,8 +1266,8 @@ struct kgsl_syncsource_signal_fence {
 * @id: ID of the GPU object to sync
 */
struct kgsl_cff_sync_gpuobj {
	uint64_t offset;
	uint64_t length;
	__u64 offset;
	__u64 length;
	unsigned int id;
};

@@ -1285,13 +1285,13 @@ struct kgsl_cff_sync_gpuobj {
 * @metadata: Pointer to the user specified metadata to store for the object
 */
struct kgsl_gpuobj_alloc {
	uint64_t size;
	uint64_t flags;
	uint64_t va_len;
	uint64_t mmapsize;
	__u64 size;
	__u64 flags;
	__u64 va_len;
	__u64 mmapsize;
	unsigned int id;
	unsigned int metadata_len;
	uint64_t metadata;
	__u64 metadata;
};

/* Let the user know that this header supports the gpuobj metadata */
@@ -1311,8 +1311,8 @@ struct kgsl_gpuobj_alloc {
 * @len: Length of the data passed in priv
 */
struct kgsl_gpuobj_free {
	uint64_t flags;
	uint64_t priv;
	__u64 flags;
	__u64 __user priv;
	unsigned int id;
	unsigned int type;
	unsigned int len;
@@ -1355,11 +1355,11 @@ struct kgsl_gpu_event_fence {
 * id - GPU object ID of the object to query
 */
struct kgsl_gpuobj_info {
	uint64_t gpuaddr;
	uint64_t flags;
	uint64_t size;
	uint64_t va_len;
	uint64_t va_addr;
	__u64 gpuaddr;
	__u64 flags;
	__u64 size;
	__u64 va_len;
	__u64 va_addr;
	unsigned int id;
};

@@ -1375,9 +1375,9 @@ struct kgsl_gpuobj_info {
 * @id: Returns the ID of the new GPU object
 */
struct kgsl_gpuobj_import {
	uint64_t priv;
	uint64_t priv_len;
	uint64_t flags;
	__u64 __user priv;
	__u64 priv_len;
	__u64 flags;
	unsigned int type;
	unsigned int id;
};
@@ -1395,7 +1395,7 @@ struct kgsl_gpuobj_import_dma_buf {
 * @virtaddr: Virtual address of the object to import
 */
struct kgsl_gpuobj_import_useraddr {
	uint64_t virtaddr;
	__u64 virtaddr;
};

#define IOCTL_KGSL_GPUOBJ_IMPORT \
@@ -1410,8 +1410,8 @@ struct kgsl_gpuobj_import_useraddr {
 */

struct kgsl_gpuobj_sync_obj {
	uint64_t offset;
	uint64_t length;
	__u64 offset;
	__u64 length;
	unsigned int id;
	unsigned int op;
};
@@ -1424,7 +1424,7 @@ struct kgsl_gpuobj_sync_obj {
 */

struct kgsl_gpuobj_sync {
	uint64_t objs;
	__u64 __user objs;
	unsigned int obj_len;
	unsigned int count;
};
@@ -1441,9 +1441,9 @@ struct kgsl_gpuobj_sync {
 * @id - GPU command object ID
 */
struct kgsl_command_object {
	uint64_t offset;
	uint64_t gpuaddr;
	uint64_t size;
	__u64 offset;
	__u64 gpuaddr;
	__u64 size;
	unsigned int flags;
	unsigned int id;
};
@@ -1455,8 +1455,8 @@ struct kgsl_command_object {
 * @type: type of sync point defined here
 */
struct kgsl_command_syncpoint {
	uint64_t priv;
	uint64_t size;
	__u64 __user priv;
	__u64 size;
	unsigned int type;
};

@@ -1476,14 +1476,14 @@ struct kgsl_command_syncpoint {
 * @timestamp: Timestamp for the submitted commands
 */
struct kgsl_gpu_command {
	uint64_t flags;
	uint64_t cmdlist;
	__u64 flags;
	__u64 __user cmdlist;
	unsigned int cmdsize;
	unsigned int numcmds;
	uint64_t objlist;
	__u64 __user objlist;
	unsigned int objsize;
	unsigned int numobjs;
	uint64_t synclist;
	__u64 __user synclist;
	unsigned int syncsize;
	unsigned int numsyncs;
	unsigned int context_id;
@@ -1511,7 +1511,7 @@ struct kgsl_gpu_command {
 * returned back.
 */
struct kgsl_preemption_counters_query {
	uint64_t counters;
	__u64 __user counters;
	unsigned int size_user;
	unsigned int size_priority_level;
	unsigned int max_priority_level;
@@ -1535,8 +1535,8 @@ struct kgsl_preemption_counters_query {
#define KGSL_GPUOBJ_SET_INFO_TYPE (1 << 1)

struct kgsl_gpuobj_set_info {
	uint64_t flags;
	uint64_t metadata;
	__u64 flags;
	__u64 metadata;
	unsigned int id;
	unsigned int metadata_len;
	unsigned int type;
@@ -1553,9 +1553,9 @@ struct kgsl_gpuobj_set_info {
 * @id: Returned ID for this allocation
 */
struct kgsl_sparse_phys_alloc {
	uint64_t size;
	uint64_t pagesize;
	uint64_t flags;
	__u64 size;
	__u64 pagesize;
	__u64 flags;
	unsigned int id;
};

@@ -1582,10 +1582,10 @@ struct kgsl_sparse_phys_free {
 * @gpuaddr: Returned GPU address for this allocation
 */
struct kgsl_sparse_virt_alloc {
	uint64_t size;
	uint64_t pagesize;
	uint64_t flags;
	uint64_t gpuaddr;
	__u64 size;
	__u64 pagesize;
	__u64 flags;
	__u64 gpuaddr;
	unsigned int id;
};

@@ -1612,10 +1612,10 @@ struct kgsl_sparse_virt_free {
 * @id: Physical ID to bind (bind only)
 */
struct kgsl_sparse_binding_object {
	uint64_t virtoffset;
	uint64_t physoffset;
	uint64_t size;
	uint64_t flags;
	__u64 virtoffset;
	__u64 physoffset;
	__u64 size;
	__u64 flags;
	unsigned int id;
};

@@ -1628,7 +1628,7 @@ struct kgsl_sparse_binding_object {
 *
 */
struct kgsl_sparse_bind {
	uint64_t list;
	__u64 __user list;
	unsigned int id;
	unsigned int size;
	unsigned int count;
@@ -1652,9 +1652,9 @@ struct kgsl_sparse_bind {
 * @id: Virtual ID to bind/unbind
 */
struct kgsl_gpu_sparse_command {
	uint64_t flags;
	uint64_t sparselist;
	uint64_t synclist;
	__u64 flags;
	__u64 __user sparselist;
	__u64 __user synclist;
	unsigned int sparsesize;
	unsigned int numsparse;
	unsigned int syncsize;
+20 −18
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@
#ifndef _UAPI_MSM_RMNET_H_
#define _UAPI_MSM_RMNET_H_

#include <linux/types.h>

/* Bitmap macros for RmNET driver operation mode. */
#define RMNET_MODE_NONE     (0x00)
#define RMNET_MODE_LLP_ETH  (0x01)
@@ -101,52 +103,52 @@
#endif

struct rmnet_ioctl_extended_s {
	uint32_t   extended_ioctl;
	__u32   extended_ioctl;
	union {
		uint32_t data; /* Generic data field for most extended IOCTLs */
		__u32 data; /* Generic data field for most extended IOCTLs */

		/* Return values for
		 *    RMNET_IOCTL_GET_DRIVER_NAME
		 *    RMNET_IOCTL_GET_DFLT_CONTROL_CHANNEL
		 */
		int8_t if_name[IFNAMSIZ];
		__s8 if_name[IFNAMSIZ];

		/* Input values for the RMNET_IOCTL_ADD_MUX_CHANNEL IOCTL */
		struct {
			uint32_t  mux_id;
			int8_t    vchannel_name[IFNAMSIZ];
			__u32  mux_id;
			__s8    vchannel_name[IFNAMSIZ];
		} rmnet_mux_val;

		/* Input values for the RMNET_IOCTL_FLOW_CONTROL IOCTL */
		struct {
			uint8_t   flow_mode;
			uint8_t   mux_id;
			__u8   flow_mode;
			__u8   mux_id;
		} flow_control_prop;

		/* Return values for RMNET_IOCTL_GET_EP_PAIR */
		struct {
			uint32_t   consumer_pipe_num;
			uint32_t   producer_pipe_num;
			__u32   consumer_pipe_num;
			__u32   producer_pipe_num;
		} ipa_ep_pair;

		struct {
			uint32_t __data; /* Placeholder for legacy data*/
			uint32_t agg_size;
			uint32_t agg_count;
			__u32 __data; /* Placeholder for legacy data*/
			__u32 agg_size;
			__u32 agg_count;
		} ingress_format;

		/* Input values for the RMNET_IOCTL_SET_OFFLOAD */
		struct {
			uint32_t   flags;
			uint8_t    mux_id;
			__u32   flags;
			__u8    mux_id;
		} offload_params;
	} u;
};

struct rmnet_ioctl_data_s {
	union {
		uint32_t	operation_mode;
		uint32_t	tcm_handle;
		__u32	operation_mode;
		__u32	tcm_handle;
	} u;
};

@@ -157,13 +159,13 @@ struct rmnet_ioctl_data_s {
struct QMI_QOS_HDR_S {
	unsigned char    version;
	unsigned char    flags;
	uint32_t         flow_id;
	__u32         flow_id;
} __attribute((__packed__));

/* QMI QoS 8-byte header. */
struct qmi_qos_hdr8_s {
	struct QMI_QOS_HDR_S   hdr;
	uint8_t                reserved[2];
	__u8                reserved[2];
} __attribute((__packed__));

#endif /* _UAPI_MSM_RMNET_H_ */
+25 −25
Original line number Diff line number Diff line
@@ -101,10 +101,10 @@ enum qcedev_sha_alg_enum {
 */
struct	buf_info {
	union {
		uint32_t	offset;
		uint8_t		*vaddr;
		__u32	offset;
		__u8		*vaddr;
	};
	uint32_t	len;
	__u32	len;
};

/**
@@ -183,19 +183,19 @@ struct qcedev_pmem_info {
 * data array to 0.
 */
struct	qcedev_cipher_op_req {
	uint8_t				use_pmem;
	__u8				use_pmem;
	union {
		struct qcedev_pmem_info	pmem;
		struct qcedev_vbuf_info	vbuf;
	};
	uint32_t			entries;
	uint32_t			data_len;
	uint8_t				in_place_op;
	uint8_t				enckey[QCEDEV_MAX_KEY_SIZE];
	uint32_t			encklen;
	uint8_t				iv[QCEDEV_MAX_IV_SIZE];
	uint32_t			ivlen;
	uint32_t			byteoffset;
	__u32			entries;
	__u32			data_len;
	__u8				in_place_op;
	__u8				enckey[QCEDEV_MAX_KEY_SIZE];
	__u32			encklen;
	__u8				iv[QCEDEV_MAX_IV_SIZE];
	__u32			ivlen;
	__u32			byteoffset;
	enum qcedev_cipher_alg_enum	alg;
	enum qcedev_cipher_mode_enum	mode;
	enum qcedev_oper_enum		op;
@@ -214,12 +214,12 @@ struct qcedev_cipher_op_req {
 */
struct	qcedev_sha_op_req {
	struct buf_info			data[QCEDEV_MAX_BUFFERS];
	uint32_t			entries;
	uint32_t			data_len;
	uint8_t				digest[QCEDEV_MAX_SHA_DIGEST];
	uint32_t			diglen;
	uint8_t				*authkey;
	uint32_t			authklen;
	__u32			entries;
	__u32			data_len;
	__u8				digest[QCEDEV_MAX_SHA_DIGEST];
	__u32			diglen;
	__u8				*authkey;
	__u32			authklen;
	enum qcedev_sha_alg_enum	alg;
};

@@ -243,11 +243,11 @@ struct qfips_verify_t {
 *			each fd in fd[].
 */
struct qcedev_map_buf_req {
	int32_t         fd[QCEDEV_MAX_BUFFERS];
	uint32_t        num_fds;
	uint32_t        fd_size[QCEDEV_MAX_BUFFERS];
	uint32_t        fd_offset[QCEDEV_MAX_BUFFERS];
	uint64_t        buf_vaddr[QCEDEV_MAX_BUFFERS];
	__s32         fd[QCEDEV_MAX_BUFFERS];
	__u32        num_fds;
	__u32        fd_size[QCEDEV_MAX_BUFFERS];
	__u32        fd_offset[QCEDEV_MAX_BUFFERS];
	__u64        buf_vaddr[QCEDEV_MAX_BUFFERS];
};

/**
@@ -256,8 +256,8 @@ struct qcedev_map_buf_req {
 * num_fds (IN):       Number of fds in fd[].
 */
struct  qcedev_unmap_buf_req {
	int32_t         fd[QCEDEV_MAX_BUFFERS];
	uint32_t        num_fds;
	__s32         fd[QCEDEV_MAX_BUFFERS];
	__u32        num_fds;
};

struct file;
Loading