aboutsummaryrefslogtreecommitdiff
path: root/write-stm-device/stm_user_api.h
diff options
context:
space:
mode:
authorChunyan Zhang <zhang.chunyan@linaro.org>2016-08-19 20:56:48 +0800
committerChunyan Zhang <zhang.chunyan@linaro.org>2016-08-22 13:52:53 +0800
commit0fac4baa140f501f527d33a81c936a63eea45f63 (patch)
tree58dfde1ccddedb2dec50123abf28f154f4526db7 /write-stm-device/stm_user_api.h
parent8eb9940ca4591dd6b92788b2aad6d4056cd74ec7 (diff)
downloadsample-app-stm-write-sample.tar.gz
write STM directly without policy assignationstm-write-sample
If no policy assigned to STM device before writing, a default policy will be applied, so we have to be sure that a policy named 'default' can be found under /config/stp-policy/<stm_device>/ Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Diffstat (limited to 'write-stm-device/stm_user_api.h')
-rw-r--r--write-stm-device/stm_user_api.h40
1 files changed, 1 insertions, 39 deletions
diff --git a/write-stm-device/stm_user_api.h b/write-stm-device/stm_user_api.h
index 0f9299e..ba043d6 100644
--- a/write-stm-device/stm_user_api.h
+++ b/write-stm-device/stm_user_api.h
@@ -1,58 +1,20 @@
#ifndef __STM_USER_API_H
#define __STM_USER_API_H
-#define BYTES_PER_CHANNEL 256
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE) //4096
-#define MAP_MASK (PAGE_SIZE - 1)
-#define STM_MAP_SIZE PAGE_SIZE
-
#define STM_DEVICE_NAME "/dev/20100000.stm"
#define ETF_SYS_NAME "20010000.etf"
#define ETR_SYS_NAME "20070000.etr"
#define STM_SYS_NAME "20100000.stm"
-#define STP_POLICY_NAME "test"
#define TEST_DATA_SIZE 4
-#define POLICY_NAME_LEN 8
-
-#define STP_POLICY_ID_SET _IOWR('%', 0, struct stp_policy_id)
-
-enum stm_flags {
- STM_FLAG_TIMESTAMPED = 0x08,
- STM_FLAG_MARKED = 0x10,
- STM_FLAG_GUARANTEED = 0x80,
-};
-
-enum stm_pkt_type {
- STM_PKT_TYPE_DATA = 0x98,
- STM_PKT_TYPE_FLAG = 0xE8,
- STM_PKT_TYPE_TRIG = 0xF8,
-};
-
-enum error_no {
- E_COMMON = -1,
-};
-
-struct stp_policy_id {
- unsigned int size;
- unsigned short master;
- unsigned short channel;
- unsigned short width;
- /* padding */
- unsigned short __reserved_0;
- unsigned int __reserved_1;
- /* policy name */
- char id[0];
-};
struct stm_dev {
int fd;
- struct stp_policy_id *policy;
} g_stm_dev;
int request_stm_resource(struct stm_dev *dev, unsigned int chan,
unsigned int width);
-void release_stm_reaource(struct stm_dev *dev);
+void release_stm_resource(struct stm_dev *dev);
unsigned int stm_char_write(int fd, const char *data, unsigned int size);
#endif /* __STM_USER_API_H */