Changeset 5cd136ab in mainline for uspace/srv/devman/main.c
- Timestamp:
- 2010-04-02T13:37:58Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a66bc2
- Parents:
- 57937dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/main.c
r57937dd r5cd136ab 51 51 #include <ctype.h> 52 52 #include <ipc/devman.h> 53 #include <ipc/driver.h> 53 54 #include <thread.h> 54 55 … … 158 159 { 159 160 int ret = EOK; 160 int i;161 size_t i; 161 162 for (i = 0; i < match_count; i++) { 162 163 if (EOK != (ret = devman_receive_match_id(match_ids))) { … … 257 258 } 258 259 260 static void devman_forward(ipc_callid_t iid, ipc_call_t *icall, bool drv_to_parent) { 261 device_handle_t handle; 262 node_t *dev = find_dev_node(&device_tree, handle); 263 if (NULL == dev) { 264 ipc_answer_0(iid, ENOENT); 265 return; 266 } 267 268 driver_t *driver = NULL; 269 270 if (drv_to_parent) { 271 driver = dev->parent->drv; 272 } else { 273 driver = dev->drv; 274 } 275 276 if (NULL == driver) { 277 ipc_answer_0(iid, ENOENT); 278 return; 279 } 280 281 int method; 282 if (drv_to_parent) { 283 method = DRIVER_DRIVER; 284 } else { 285 method = DRIVER_CLIENT; 286 } 287 288 ipc_forward_fast(iid, driver->phone, method, dev->handle, 0, IPC_FF_NONE); 289 } 290 259 291 /** Function for handling connections to device manager. 260 292 * … … 269 301 /*case DEVMAN_CLIENT: 270 302 devmap_connection_client(iid, icall); 271 break; 303 break;*/ 272 304 case DEVMAN_CONNECT_TO_DEVICE: 273 305 // Connect client to selected device 274 devmap_forward(iid, icall); 275 break;*/ 306 devman_forward(iid, icall, false); 307 break; 308 case DEVMAN_CONNECT_TO_PARENTS_DEVICE: 309 // Connect client to selected device 310 devman_forward(iid, icall, true); 311 break; 276 312 default: 277 313 /* No such interface */
Note:
See TracChangeset
for help on using the changeset viewer.