Changeset a46e56b in mainline for uspace/lib/drv/generic/remote_clock_dev.c
- Timestamp:
- 2018-03-22T06:49:35Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_clock_dev.c
r3e242d2 ra46e56b 69 69 */ 70 70 static void 71 remote_clock_time_get(ddf_fun_t *fun, void *ops, cap_call_handle_t c allid,71 remote_clock_time_get(ddf_fun_t *fun, void *ops, cap_call_handle_t chandle, 72 72 ipc_call_t *call) 73 73 { 74 74 clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops; 75 cap_call_handle_t c id;75 cap_call_handle_t call_handle; 76 76 struct tm t; 77 77 errno_t rc; 78 78 size_t len; 79 79 80 if (!async_data_read_receive(&c id, &len)) {80 if (!async_data_read_receive(&call_handle, &len)) { 81 81 /* TODO: Handle protocol error */ 82 async_answer_0(c allid, EINVAL);82 async_answer_0(chandle, EINVAL); 83 83 return; 84 84 } … … 86 86 if (!clock_dev_ops->time_get) { 87 87 /* The driver does not provide the time_get() functionality */ 88 async_answer_0(c id, ENOTSUP);89 async_answer_0(c allid, ENOTSUP);88 async_answer_0(call_handle, ENOTSUP); 89 async_answer_0(chandle, ENOTSUP); 90 90 return; 91 91 } … … 95 95 if (rc != EOK) { 96 96 /* Some error occurred */ 97 async_answer_0(c id, rc);98 async_answer_0(c allid, rc);97 async_answer_0(call_handle, rc); 98 async_answer_0(chandle, rc); 99 99 return; 100 100 } 101 101 102 102 /* The operation was successful */ 103 async_data_read_finalize(c id, &t, sizeof(struct tm));104 async_answer_0(c allid, rc);103 async_data_read_finalize(call_handle, &t, sizeof(struct tm)); 104 async_answer_0(chandle, rc); 105 105 } 106 106 … … 111 111 */ 112 112 static void remote_clock_time_set(ddf_fun_t *fun, void *ops, 113 cap_call_handle_t c allid, ipc_call_t *call)113 cap_call_handle_t chandle, ipc_call_t *call) 114 114 { 115 115 clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops; 116 116 errno_t rc; 117 117 struct tm t; 118 cap_call_handle_t c id;118 cap_call_handle_t call_handle; 119 119 size_t len; 120 120 121 if (!async_data_write_receive(&c id, &len)) {121 if (!async_data_write_receive(&call_handle, &len)) { 122 122 /* TODO: Handle protocol error */ 123 async_answer_0(c allid, EINVAL);123 async_answer_0(chandle, EINVAL); 124 124 return; 125 125 } … … 127 127 if (!clock_dev_ops->time_set) { 128 128 /* The driver does not support the time_set() functionality */ 129 async_answer_0(c id, ENOTSUP);130 async_answer_0(c allid, ENOTSUP);129 async_answer_0(call_handle, ENOTSUP); 130 async_answer_0(chandle, ENOTSUP); 131 131 return; 132 132 } 133 133 134 async_data_write_finalize(c id, &t, sizeof(struct tm));134 async_data_write_finalize(call_handle, &t, sizeof(struct tm)); 135 135 136 136 rc = (*clock_dev_ops->time_set)(fun, &t); 137 137 138 async_answer_0(c allid, rc);138 async_answer_0(chandle, rc); 139 139 } 140 140
Note:
See TracChangeset
for help on using the changeset viewer.