Changeset f658458 in mainline for uspace/lib
- Timestamp:
- 2010-05-02T20:49:09Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb864a0
- Parents:
- 25a7e11d
- Location:
- uspace/lib
- Files:
-
- 7 edited
-
libc/generic/device/char.c (modified) (2 diffs)
-
libc/generic/devman.c (modified) (1 diff)
-
libc/include/devman.h (modified) (1 diff)
-
libc/include/ipc/devman.h (modified) (1 diff)
-
libdrv/generic/driver.c (modified) (2 diffs)
-
libdrv/generic/remote_char.c (modified) (1 diff)
-
libdrv/include/driver.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/device/char.c
r25a7e11d rf658458 38 38 #include <async.h> 39 39 #include <malloc.h> 40 #include <stdio.h> 40 41 41 42 … … 46 47 async_serialize_start(); 47 48 49 printf("calling interface %d\n", DEV_IFACE_ID(CHAR_DEV_IFACE)); 48 50 aid_t req = async_send_1(dev_phone, DEV_IFACE_ID(CHAR_DEV_IFACE), CHAR_READ_DEV, &answer); 49 51 -
uspace/lib/libc/generic/devman.c
r25a7e11d rf658458 230 230 } 231 231 232 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags) 233 { 234 int phone = devman_get_phone(DEVMAN_CLIENT, flags); 235 236 if (phone < 0) 237 return phone; 238 239 async_serialize_start(); 240 241 ipc_call_t answer; 242 aid_t req = async_send_2(phone, DEVMAN_DEVICE_GET_HANDLE, flags, 0, 243 &answer); 244 245 ipcarg_t retval = async_data_write_start(phone, pathname, str_size(pathname)); 246 if (retval != EOK) { 247 async_wait_for(req, NULL); 248 async_serialize_end(); 249 return retval; 250 } 251 252 async_wait_for(req, &retval); 253 254 async_serialize_end(); 255 256 if (retval != EOK) { 257 if (handle != NULL) 258 *handle = (device_handle_t) -1; 259 return retval; 260 } 261 262 if (handle != NULL) 263 *handle = (device_handle_t) IPC_GET_ARG1(answer); 264 265 return retval; 266 } 267 268 232 269 /** @} 233 270 */ -
uspace/lib/libc/include/devman.h
r25a7e11d rf658458 51 51 int devman_parent_device_connect(device_handle_t handle, unsigned int flags); 52 52 53 int devman_device_get_handle(const char *pathname, device_handle_t *handle, unsigned int flags); 54 53 55 54 56 #endif -
uspace/lib/libc/include/ipc/devman.h
r25a7e11d rf658458 138 138 } devman_to_driver_t; 139 139 140 typedef enum { 141 DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD 142 } client_to_devman_t; 143 140 144 #endif 141 145 -
uspace/lib/libdrv/generic/driver.c
r25a7e11d rf658458 254 254 if (!is_valid_iface_idx(iface_idx)) { 255 255 // this is not device's interface 256 printf("%s: driver_connection_gen error - invalid interface id % x.", driver->name, method);256 printf("%s: driver_connection_gen error - invalid interface id %d.", driver->name, iface_idx); 257 257 ipc_answer_0(callid, ENOTSUP); 258 258 break; … … 265 265 if (NULL == iface) { 266 266 printf("%s: driver_connection_gen error - ", driver->name); 267 printf("device with handle % x has no interface with id %x.\n", handle, method);267 printf("device with handle %d has no interface with id %d.\n", handle, iface_idx); 268 268 ipc_answer_0(callid, ENOTSUP); 269 269 break; -
uspace/lib/libdrv/generic/remote_char.c
r25a7e11d rf658458 56 56 57 57 static void remote_char_read(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call) 58 { 58 { 59 59 char_iface_t *char_iface = (char_iface_t *)iface; 60 if (!char_iface->read) {61 ipc_answer_0(callid, ENOTSUP);62 return;63 }64 60 65 61 size_t len; 66 62 if (!async_data_read_receive(&callid, &len)) { 67 63 // TODO handle protocol error 64 ipc_answer_0(callid, EINVAL); 65 return; 66 } 67 68 if (!char_iface->read) { 69 async_data_read_finalize(callid, NULL, 0); 70 ipc_answer_0(callid, ENOTSUP); 68 71 return; 69 72 } -
uspace/lib/libdrv/include/driver.h
r25a7e11d rf658458 163 163 { 164 164 assert(is_valid_iface_idx(idx)); 165 165 if (NULL == dev->class) { 166 return NULL; 167 } 166 168 return dev->class->interfaces[idx]; 167 169 }
Note:
See TracChangeset
for help on using the changeset viewer.
