112e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris/*
212e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * System Trace Module (STM) userspace interfaces
312e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * Copyright (c) 2014, Intel Corporation.
412e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris *
512e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * This program is free software; you can redistribute it and/or modify it
612e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * under the terms and conditions of the GNU General Public License,
712e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * version 2, as published by the Free Software Foundation.
812e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris *
912e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * This program is distributed in the hope it will be useful, but WITHOUT
1012e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1112e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
1212e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * more details.
1312e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris *
1412e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * STM class implements generic infrastructure for  System Trace Module devices
1512e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * as defined in MIPI STPv2 specification.
1612e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris */
1712e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris
1812e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#ifndef _UAPI_LINUX_STM_H
1912e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#define _UAPI_LINUX_STM_H
2012e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris
2112e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#include <linux/types.h>
2212e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris
2312e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris/**
2412e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * struct stp_policy_id - identification for the STP policy
2512e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * @size:	size of the structure including real id[] length
2612e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * @master:	assigned master
2712e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * @channel:	first assigned channel
2812e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * @width:	number of requested channels
2912e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * @id:		identification string
3012e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris *
3112e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * User must calculate the total size of the structure and put it into
3212e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * @size field, fill out the @id and desired @width. In return, kernel
3312e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris * fills out @master, @channel and @width.
3412e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris */
3512e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferrisstruct stp_policy_id {
3612e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	__u32		size;
3712e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	__u16		master;
3812e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	__u16		channel;
3912e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	__u16		width;
4012e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	/* padding */
4112e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	__u16		__reserved_0;
4212e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	__u32		__reserved_1;
4312e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris	char		id[0];
4412e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris};
4512e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris
4612e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#define STP_POLICY_ID_SET	_IOWR('%', 0, struct stp_policy_id)
4712e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#define STP_POLICY_ID_GET	_IOR('%', 1, struct stp_policy_id)
4812e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#define STP_SET_OPTIONS		_IOW('%', 2, __u64)
4912e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris
5012e1f28cce28271eb109a5bae818a804f0c3bb27Christopher Ferris#endif /* _UAPI_LINUX_STM_H */
51