Changeset 984a9ba in mainline for uspace/lib/drv/generic/remote_clock_dev.c
- Timestamp:
- 2018-07-05T09:34:09Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63d46341
- Parents:
- 76f566d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_clock_dev.c
r76f566d r984a9ba 42 42 #include <ddf/driver.h> 43 43 44 static void remote_clock_time_get(ddf_fun_t *, void *, cap_call_handle_t, 45 ipc_call_t *); 46 static void remote_clock_time_set(ddf_fun_t *, void *, cap_call_handle_t, 47 ipc_call_t *); 44 static void remote_clock_time_get(ddf_fun_t *, void *, ipc_call_t *); 45 static void remote_clock_time_set(ddf_fun_t *, void *, ipc_call_t *); 48 46 49 47 /** Remote clock interface operations */ … … 65 63 /** Process the time_get() request from the remote client 66 64 * 67 * @param fun The function from which the time is read 68 * @param ops The local ops structure 65 * @param fun The function from which the time is read 66 * @param ops The local ops structure 67 * 69 68 */ 70 static void 71 remote_clock_time_get(ddf_fun_t *fun, void *ops, cap_call_handle_t chandle, 72 ipc_call_t *call) 69 static void remote_clock_time_get(ddf_fun_t *fun, void *ops, ipc_call_t *call) 73 70 { 74 71 clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops; 75 cap_call_handle_t call_handle;76 72 struct tm t; 77 73 errno_t rc; 74 75 ipc_call_t data; 78 76 size_t len; 79 80 if (!async_data_read_receive(&call_handle, &len)) { 77 if (!async_data_read_receive(&data, &len)) { 81 78 /* TODO: Handle protocol error */ 82 async_answer_0(c handle, EINVAL);79 async_answer_0(call, EINVAL); 83 80 return; 84 81 } … … 86 83 if (!clock_dev_ops->time_get) { 87 84 /* The driver does not provide the time_get() functionality */ 88 async_answer_0( call_handle, ENOTSUP);89 async_answer_0(c handle, ENOTSUP);85 async_answer_0(&data, ENOTSUP); 86 async_answer_0(call, ENOTSUP); 90 87 return; 91 88 } … … 95 92 if (rc != EOK) { 96 93 /* Some error occurred */ 97 async_answer_0( call_handle, rc);98 async_answer_0(c handle, rc);94 async_answer_0(&data, rc); 95 async_answer_0(call, rc); 99 96 return; 100 97 } 101 98 102 99 /* The operation was successful */ 103 async_data_read_finalize( call_handle, &t, sizeof(struct tm));104 async_answer_0(c handle, rc);100 async_data_read_finalize(&data, &t, sizeof(struct tm)); 101 async_answer_0(call, rc); 105 102 } 106 103 107 104 /** Process the time_set() request from the remote client 108 105 * 109 * @param fun The function to which the data are written 110 * @param ops The local ops structure 106 * @param fun The function to which the data are written 107 * @param ops The local ops structure 108 * 111 109 */ 112 static void remote_clock_time_set(ddf_fun_t *fun, void *ops, 113 cap_call_handle_t chandle, ipc_call_t *call) 110 static void remote_clock_time_set(ddf_fun_t *fun, void *ops, ipc_call_t *call) 114 111 { 115 112 clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops; 116 errno_t rc; 117 struct tm t; 118 cap_call_handle_t call_handle; 119 size_t len; 113 errno_t rc; 114 struct tm t; 120 115 121 if (!async_data_write_receive(&call_handle, &len)) { 116 ipc_call_t data; 117 size_t len; 118 119 if (!async_data_write_receive(&data, &len)) { 122 120 /* TODO: Handle protocol error */ 123 async_answer_0(c handle, EINVAL);121 async_answer_0(call, EINVAL); 124 122 return; 125 123 } … … 127 125 if (!clock_dev_ops->time_set) { 128 126 /* The driver does not support the time_set() functionality */ 129 async_answer_0( call_handle, ENOTSUP);130 async_answer_0(c handle, ENOTSUP);127 async_answer_0(&data, ENOTSUP); 128 async_answer_0(call, ENOTSUP); 131 129 return; 132 130 } 133 131 134 async_data_write_finalize( call_handle, &t, sizeof(struct tm));132 async_data_write_finalize(&data, &t, sizeof(struct tm)); 135 133 136 134 rc = (*clock_dev_ops->time_set)(fun, &t); 137 135 138 async_answer_0(c handle, rc);136 async_answer_0(call, rc); 139 137 } 140 138 … … 142 140 * @} 143 141 */ 144
Note:
See TracChangeset
for help on using the changeset viewer.