Abir Ghosh | 989d5e9 | 2016-10-09 11:47:28 +0300 | [diff] [blame] | 1 | #ifndef _UAPI_QBT1000_H_ |
| 2 | #define _UAPI_QBT1000_H_ |
| 3 | |
| 4 | #define MAX_NAME_SIZE 32 |
| 5 | |
| 6 | /* |
| 7 | * enum qbt1000_commands - |
| 8 | * enumeration of command options |
| 9 | * @QBT1000_LOAD_APP - cmd loads TZ app |
| 10 | * @QBT1000_UNLOAD_APP - cmd unloads TZ app |
| 11 | * @QBT1000_SEND_TZCMD - sends cmd to TZ app |
| 12 | * @QBT1000_SET_FINGER_DETECT_KEY - sets the input key to send on finger detect |
| 13 | * @QBT1000_CONFIGURE_POWER_KEY - enables/disables sending the power key on |
| 14 | finger down events |
| 15 | */ |
| 16 | enum qbt1000_commands { |
| 17 | QBT1000_LOAD_APP = 100, |
| 18 | QBT1000_UNLOAD_APP = 101, |
| 19 | QBT1000_SEND_TZCMD = 102, |
| 20 | QBT1000_SET_FINGER_DETECT_KEY = 103, |
| 21 | QBT1000_CONFIGURE_POWER_KEY = 104 |
| 22 | }; |
| 23 | |
| 24 | /* |
| 25 | * enum qbt1000_fw_event - |
| 26 | * enumeration of firmware events |
| 27 | * @FW_EVENT_FINGER_DOWN - finger down detected |
| 28 | * @FW_EVENT_FINGER_UP - finger up detected |
| 29 | * @FW_EVENT_INDICATION - an indication IPC from the firmware is pending |
| 30 | */ |
| 31 | enum qbt1000_fw_event { |
| 32 | FW_EVENT_FINGER_DOWN = 1, |
| 33 | FW_EVENT_FINGER_UP = 2, |
| 34 | FW_EVENT_CBGE_REQUIRED = 3, |
| 35 | }; |
| 36 | |
| 37 | /* |
| 38 | * struct qbt1000_app - |
| 39 | * used to load and unload apps in TZ |
| 40 | * @app_handle - qseecom handle for clients |
| 41 | * @name - Name of secure app to load |
| 42 | * @size - Size of requested buffer of secure app |
| 43 | * @high_band_width - 1 - for high bandwidth usage |
| 44 | * 0 - for normal bandwidth usage |
| 45 | */ |
| 46 | struct qbt1000_app { |
| 47 | struct qseecom_handle **app_handle; |
| 48 | char name[MAX_NAME_SIZE]; |
| 49 | uint32_t size; |
| 50 | uint8_t high_band_width; |
| 51 | }; |
| 52 | |
| 53 | /* |
| 54 | * struct qbt1000_send_tz_cmd - |
| 55 | * used to cmds to TZ App |
| 56 | * @app_handle - qseecom handle for clients |
| 57 | * @req_buf - Buffer containing request for secure app |
| 58 | * @req_buf_len - Length of request buffer |
| 59 | * @rsp_buf - Buffer containing response from secure app |
| 60 | * @rsp_buf_len - Length of response buffer |
| 61 | */ |
| 62 | struct qbt1000_send_tz_cmd { |
| 63 | struct qseecom_handle *app_handle; |
| 64 | uint8_t *req_buf; |
| 65 | uint32_t req_buf_len; |
| 66 | uint8_t *rsp_buf; |
| 67 | uint32_t rsp_buf_len; |
| 68 | }; |
| 69 | |
| 70 | /* |
| 71 | * struct qbt1000_erie_event - |
| 72 | * used to receive events from Erie |
| 73 | * @buf - Buffer containing event from Erie |
| 74 | * @buf_len - Length of buffer |
| 75 | */ |
| 76 | struct qbt1000_erie_event { |
| 77 | uint8_t *buf; |
| 78 | uint32_t buf_len; |
| 79 | }; |
| 80 | |
| 81 | /* |
| 82 | * struct qbt1000_set_finger_detect_key - |
| 83 | * used to configure the input key which is sent on finger down/up event |
| 84 | * @key_code - Key code to send on finger down/up. 0 disables sending key events |
| 85 | */ |
| 86 | struct qbt1000_set_finger_detect_key { |
| 87 | unsigned int key_code; |
| 88 | }; |
| 89 | |
| 90 | /* |
| 91 | * struct qbt1000_configure_power_key - |
| 92 | * used to configure whether the power key is sent on finger down |
| 93 | * @enable - if non-zero, power key is sent on finger down |
| 94 | */ |
| 95 | struct qbt1000_configure_power_key { |
| 96 | unsigned int enable; |
| 97 | }; |
| 98 | |
| 99 | #endif /* _UAPI_QBT1000_H_ */ |