1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _SPCOM_H_ 20 #define _SPCOM_H_ 21 #include <linux/types.h> 22 #ifndef BIT 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #define BIT(x) (1 << x) 25 #endif 26 #ifndef PAGE_SIZE 27 #define PAGE_SIZE 4096 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #endif 30 #define SPCOM_CHANNEL_NAME_SIZE 32 31 #define SPCOM_GET_NEXT_REQUEST_SIZE (PAGE_SIZE - 1) 32 enum spcom_cmd_id { 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 SPCOM_CMD_LOAD_APP = 0x4C4F4144, 35 SPCOM_CMD_RESET_SP = 0x52455354, 36 SPCOM_CMD_SEND = 0x53454E44, 37 SPCOM_CMD_SEND_MODIFIED = 0x534E444D, 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 SPCOM_CMD_LOCK_ION_BUF = 0x4C4F434B, 40 SPCOM_CMD_UNLOCK_ION_BUF = 0x554C434B, 41 SPCOM_CMD_FSSR = 0x46535352, 42 SPCOM_CMD_CREATE_CHANNEL = 0x43524554, 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 }; 45 enum spcom_poll_events { 46 SPCOM_POLL_LINK_STATE = BIT(1), 47 SPCOM_POLL_CH_CONNECT = BIT(2), 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 SPCOM_POLL_READY_FLAG = BIT(14), 50 SPCOM_POLL_WAIT_FLAG = BIT(15), 51 }; 52 struct spcom_user_command { 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 enum spcom_cmd_id cmd_id; 55 uint32_t arg; 56 } __attribute__((packed)); 57 struct spcom_send_command { 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 enum spcom_cmd_id cmd_id; 60 uint32_t timeout_msec; 61 uint32_t buf_size; 62 char buf[0]; 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 } __attribute__((packed)); 65 struct spcom_user_create_channel_command { 66 enum spcom_cmd_id cmd_id; 67 char ch_name[SPCOM_CHANNEL_NAME_SIZE]; 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 } __attribute__((packed)); 70 #define SPCOM_MAX_ION_BUF 4 71 struct spcom_ion_info { 72 int32_t fd; 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 uint32_t buf_offset; 75 }; 76 #define SPCOM_ION_FD_UNLOCK_ALL 0xFFFF 77 struct spcom_ion_handle { 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 int32_t fd; 80 }; 81 struct spcom_user_send_modified_command { 82 enum spcom_cmd_id cmd_id; 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 struct spcom_ion_info ion_info[SPCOM_MAX_ION_BUF]; 85 uint32_t timeout_msec; 86 uint32_t buf_size; 87 char buf[0]; 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 } __attribute__((packed)); 90 #endif 91 92