Changeset aeb49e9 in mainline for uspace/lib/drv/generic/remote_clock_dev.c
- Timestamp:
- 2012-04-04T18:33:56Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1abd6e
- Parents:
- 8354ca6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_clock_dev.c
r8354ca6 raeb49e9 42 42 static void remote_clock_time_get(ddf_fun_t *, void *, ipc_callid_t, 43 43 ipc_call_t *); 44 /*45 44 static void remote_clock_time_set(ddf_fun_t *, void *, ipc_callid_t, 46 45 ipc_call_t *); 47 */48 46 49 47 /** Remote clock interface operations */ 50 48 static remote_iface_func_ptr_t remote_clock_dev_iface_ops[] = { 51 49 &remote_clock_time_get, 52 /* XXX &remote_clock_time_set, */50 &remote_clock_time_set, 53 51 }; 54 52 … … 105 103 } 106 104 107 /* TODO: remote_clock_time_set() */ 105 /** Process the write request from the remote client 106 * 107 * @param fun The function to which the data are written 108 * @param ops The local ops structure 109 */ 110 static void remote_clock_time_set(ddf_fun_t *fun, void *ops, 111 ipc_callid_t callid, ipc_call_t *call) 112 { 113 clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops; 114 int rc; 115 struct tm t; 116 ipc_callid_t cid; 117 size_t len; 118 119 if (!async_data_write_receive(&cid, &len)) { 120 /* TODO: Handle protocol error */ 121 async_answer_0(callid, EINVAL); 122 return; 123 } 124 125 if (!clock_dev_ops->time_set) { 126 /* The driver does not support the time_set() functionality */ 127 async_data_write_finalize(cid, NULL, 0); 128 async_answer_0(callid, ENOTSUP); 129 return; 130 } 131 132 async_data_write_finalize(cid, &t, sizeof(struct tm)); 133 134 rc = (*clock_dev_ops->time_set)(fun, &t); 135 if (rc < 0) { 136 /* Some error occurred */ 137 async_answer_0(callid, rc); 138 return; 139 } 140 141 async_answer_1(callid, EOK, rc); 142 } 108 143 109 144 /**
Note:
See TracChangeset
for help on using the changeset viewer.