1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * System Trace Module (STM) userspace interfaces 4*4882a593Smuzhiyun * Copyright (c) 2014, Intel Corporation. 5*4882a593Smuzhiyun * 6*4882a593Smuzhiyun * STM class implements generic infrastructure for System Trace Module devices 7*4882a593Smuzhiyun * as defined in MIPI STPv2 specification. 8*4882a593Smuzhiyun */ 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun #ifndef _UAPI_LINUX_STM_H 11*4882a593Smuzhiyun #define _UAPI_LINUX_STM_H 12*4882a593Smuzhiyun 13*4882a593Smuzhiyun #include <linux/types.h> 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun /* Maximum allowed master and channel values */ 16*4882a593Smuzhiyun #define STP_MASTER_MAX 0xffff 17*4882a593Smuzhiyun #define STP_CHANNEL_MAX 0xffff 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun /** 20*4882a593Smuzhiyun * struct stp_policy_id - identification for the STP policy 21*4882a593Smuzhiyun * @size: size of the structure including real id[] length 22*4882a593Smuzhiyun * @master: assigned master 23*4882a593Smuzhiyun * @channel: first assigned channel 24*4882a593Smuzhiyun * @width: number of requested channels 25*4882a593Smuzhiyun * @id: identification string 26*4882a593Smuzhiyun * 27*4882a593Smuzhiyun * User must calculate the total size of the structure and put it into 28*4882a593Smuzhiyun * @size field, fill out the @id and desired @width. In return, kernel 29*4882a593Smuzhiyun * fills out @master, @channel and @width. 30*4882a593Smuzhiyun */ 31*4882a593Smuzhiyun struct stp_policy_id { 32*4882a593Smuzhiyun __u32 size; 33*4882a593Smuzhiyun __u16 master; 34*4882a593Smuzhiyun __u16 channel; 35*4882a593Smuzhiyun __u16 width; 36*4882a593Smuzhiyun /* padding */ 37*4882a593Smuzhiyun __u16 __reserved_0; 38*4882a593Smuzhiyun __u32 __reserved_1; 39*4882a593Smuzhiyun char id[0]; 40*4882a593Smuzhiyun }; 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun #define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id) 43*4882a593Smuzhiyun #define STP_POLICY_ID_GET _IOR('%', 1, struct stp_policy_id) 44*4882a593Smuzhiyun #define STP_SET_OPTIONS _IOW('%', 2, __u64) 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun #endif /* _UAPI_LINUX_STM_H */ 47