Changeset 977fcea in mainline for uspace/lib/drv/generic/remote_char_dev.c
- Timestamp:
- 2011-01-14T10:11:11Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f9dd44d
- Parents:
- 0bd2879 (diff), 6610565b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_char_dev.c
r0bd2879 r977fcea 37 37 #include <errno.h> 38 38 39 #include " char.h"39 #include "ops/char_dev.h" 40 40 #include "driver.h" 41 41 … … 46 46 47 47 /** Remote character interface operations. */ 48 static remote_iface_func_ptr_t remote_char_ iface_ops[] = {48 static remote_iface_func_ptr_t remote_char_dev_iface_ops[] = { 49 49 &remote_char_read, 50 50 &remote_char_write … … 56 56 * character interface. 57 57 */ 58 remote_iface_t remote_char_ iface = {59 .method_count = sizeof(remote_char_ iface_ops) /58 remote_iface_t remote_char_dev_iface = { 59 .method_count = sizeof(remote_char_dev_iface_ops) / 60 60 sizeof(remote_iface_func_ptr_t), 61 .methods = remote_char_ iface_ops61 .methods = remote_char_dev_iface_ops 62 62 }; 63 63 … … 69 69 * 70 70 * @param dev The device from which the data are read. 71 * @param iface The local interfacestructure.71 * @param ops The local ops structure. 72 72 */ 73 73 static void 74 remote_char_read(device_t *dev, void * iface, ipc_callid_t callid,74 remote_char_read(device_t *dev, void *ops, ipc_callid_t callid, 75 75 ipc_call_t *call) 76 { 77 char_ iface_t *char_iface = (char_iface_t *) iface;76 { 77 char_dev_ops_t *char_dev_ops = (char_dev_ops_t *) ops; 78 78 ipc_callid_t cid; 79 79 … … 85 85 } 86 86 87 if (!char_ iface->read) {87 if (!char_dev_ops->read) { 88 88 async_data_read_finalize(cid, NULL, 0); 89 89 ipc_answer_0(callid, ENOTSUP); … … 95 95 96 96 char buf[MAX_CHAR_RW_COUNT]; 97 int ret = (*char_ iface->read)(dev, buf, len);97 int ret = (*char_dev_ops->read)(dev, buf, len); 98 98 99 99 if (ret < 0) { … … 116 116 * 117 117 * @param dev The device to which the data are written. 118 * @param iface The local interfacestructure.118 * @param ops The local ops structure. 119 119 */ 120 120 static void 121 remote_char_write(device_t *dev, void * iface, ipc_callid_t callid,121 remote_char_write(device_t *dev, void *ops, ipc_callid_t callid, 122 122 ipc_call_t *call) 123 123 { 124 char_ iface_t *char_iface = (char_iface_t *) iface;124 char_dev_ops_t *char_dev_ops = (char_dev_ops_t *) ops; 125 125 ipc_callid_t cid; 126 126 size_t len; … … 132 132 } 133 133 134 if (!char_ iface->write) {134 if (!char_dev_ops->write) { 135 135 async_data_write_finalize(cid, NULL, 0); 136 136 ipc_answer_0(callid, ENOTSUP); 137 137 return; 138 } 138 } 139 139 140 140 if (len > MAX_CHAR_RW_COUNT) … … 145 145 async_data_write_finalize(cid, buf, len); 146 146 147 int ret = (*char_ iface->write)(dev, buf, len);147 int ret = (*char_dev_ops->write)(dev, buf, len); 148 148 if (ret < 0) { 149 149 /* Some error occured. */
Note:
See TracChangeset
for help on using the changeset viewer.