diff options
| author | Preetham Chandru Ramchandra <pchandru@nvidia.com> | 2021-05-18 10:41:05 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2021-05-24 15:54:44 -0400 |
| commit | 6fcc5021a8f8eaef1a2a8e2c342728d1a6ff35d0 (patch) | |
| tree | 5fe2465a247cffbd372472fd505a06e590cd58bc /include/linux | |
| parent | c8476d100544b6944dcd03f709a08a9e2836ad37 (diff) | |
tegra: safety: Add client registration
Add client registration and deregistration calls.
The clients registers with a callback function which gets called when
ivc ready is received from L2SS.
Bug 200700404
Change-Id: I358f4ad7ada547dfb81bb60c990b2f84235a9651
Signed-off-by: Preetham Chandru Ramchandra <pchandru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2531217
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/tegra_l1ss_ioctl.h | 7 | ||||
| -rw-r--r-- | include/linux/tegra_l1ss_kernel_interface.h | 46 |
2 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/tegra_l1ss_ioctl.h b/include/linux/tegra_l1ss_ioctl.h index 195ef04d2..f42697499 100644 --- a/include/linux/tegra_l1ss_ioctl.h +++ b/include/linux/tegra_l1ss_ioctl.h | |||
| @@ -232,6 +232,13 @@ typedef struct { | |||
| 232 | }; | 232 | }; |
| 233 | } nv_guard_request_t; | 233 | } nv_guard_request_t; |
| 234 | 234 | ||
| 235 | /* | ||
| 236 | * Identifies a client | ||
| 237 | */ | ||
| 238 | typedef uint32_t nv_guard_client_id_t; | ||
| 239 | |||
| 240 | #define NVGUARD_INVALID_CLIENTID (0U) | ||
| 241 | #define NVGUARD_MAX_CLIENT_CONNECTIONS (4U * NVGUARD_GROUPID_MAX) | ||
| 235 | 242 | ||
| 236 | #define L1SS_CLIENT_REQUEST _IOR(L1SS_IOCTL_MAGIC, 1, nv_guard_request_t) | 243 | #define L1SS_CLIENT_REQUEST _IOR(L1SS_IOCTL_MAGIC, 1, nv_guard_request_t) |
| 237 | 244 | ||
diff --git a/include/linux/tegra_l1ss_kernel_interface.h b/include/linux/tegra_l1ss_kernel_interface.h index 62e34592b..105f487a5 100644 --- a/include/linux/tegra_l1ss_kernel_interface.h +++ b/include/linux/tegra_l1ss_kernel_interface.h | |||
| @@ -17,7 +17,53 @@ | |||
| 17 | #ifndef _L1SS_INTERFACE_H | 17 | #ifndef _L1SS_INTERFACE_H |
| 18 | #define _L1SS_INTERFACE_H | 18 | #define _L1SS_INTERFACE_H |
| 19 | 19 | ||
| 20 | #include <linux/types.h> | ||
| 20 | #include <linux/tegra_l1ss_ioctl.h> | 21 | #include <linux/tegra_l1ss_ioctl.h> |
| 21 | 22 | ||
| 23 | typedef enum { | ||
| 24 | L1SS_NOT_READY, | ||
| 25 | L1SS_READY, | ||
| 26 | L1SS_ALIVE_CHECK, | ||
| 27 | } l1ss_cli_callback_param; | ||
| 28 | |||
| 29 | typedef int (*client_callback)(l1ss_cli_callback_param, void *); | ||
| 30 | |||
| 31 | typedef struct { | ||
| 32 | nv_guard_client_id_t id; | ||
| 33 | client_callback cli_callback; | ||
| 34 | void *data; | ||
| 35 | } client_param_t; | ||
| 36 | |||
| 37 | struct l1ss_client_param_node { | ||
| 38 | struct list_head cli_list; | ||
| 39 | client_param_t *p; | ||
| 40 | }; | ||
| 41 | |||
| 42 | #ifdef CONFIG_TEGRA_SAFETY | ||
| 22 | int l1ss_submit_rq(nv_guard_request_t *req, bool can_sleep); | 43 | int l1ss_submit_rq(nv_guard_request_t *req, bool can_sleep); |
| 44 | int l1ss_register_client(client_param_t *p); | ||
| 45 | int l1ss_deregister_client(nv_guard_client_id_t id); | ||
| 46 | int l1ss_notify_client(l1ss_cli_callback_param val); | ||
| 47 | void l1ss_set_ivc_ready(void); | ||
| 48 | #else | ||
| 49 | inline int l1ss_register_client(client_param_t *p) | ||
| 50 | { | ||
| 51 | return -ENODEV; | ||
| 52 | } | ||
| 53 | |||
| 54 | inline int l1ss_deregister_client(nv_guard_client_id_t id) | ||
| 55 | { | ||
| 56 | return 0; | ||
| 57 | } | ||
| 58 | |||
| 59 | inline int l1ss_notify_client(l1ss_cli_callback_param val) | ||
| 60 | { | ||
| 61 | return 0; | ||
| 62 | } | ||
| 63 | |||
| 64 | inline int l1ss_submit_rq(nv_guard_request_t *req, bool can_sleep) | ||
| 65 | { | ||
| 66 | return 0; | ||
| 67 | } | ||
| 68 | #endif | ||
| 23 | #endif | 69 | #endif |
