Changeset 2b0db98 in mainline for uspace/srv/devman/main.c
- Timestamp:
- 2011-01-07T14:02:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6986418
- Parents:
- d99120f (diff), 0f191a2 (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 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/main.c
rd99120f r2b0db98 281 281 * handle. 282 282 */ 283 devmap_device_register(devmap_pathname, &cli->devmap_handle); 283 devmap_device_register_with_iface(devmap_pathname, 284 &cli->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP); 284 285 285 286 /* … … 457 458 458 459 if (driver == NULL) { 459 printf(NAME ": devman_forward error - the device is not in %" PRIun 460 " usable state.\n", handle); 460 printf(NAME ": devman_forward error - the device %" PRIun \ 461 " (%s) is not in usable state.\n", 462 handle, dev->pathname); 461 463 ipc_answer_0(iid, ENOENT); 462 464 return; … … 486 488 static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall) 487 489 { 488 devmap_handle_t devmap_handle = IPC_GET_ IMETHOD(*icall);490 devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall); 489 491 node_t *dev; 490 492 … … 503 505 } 504 506 505 printf(NAME ": devman_connection_devmapper: forward connection to "506 "device %s to driver %s.\n", dev->pathname, dev->drv->name);507 507 ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0, 508 508 IPC_FF_NONE); 509 printf(NAME ": devman_connection_devmapper: forwarded connection to " 510 "device %s to driver %s.\n", dev->pathname, dev->drv->name); 509 511 } 510 512 … … 512 514 static void devman_connection(ipc_callid_t iid, ipc_call_t *icall) 513 515 { 514 /*515 * Silly hack to enable the device manager to register as a driver by516 * the device mapper. If the ipc method is not IPC_M_CONNECT_ME_TO, this517 * is not the forwarded connection from naming service, so it must be a518 * connection from the devmapper which thinks this is a devmapper-style519 * driver. So pretend this is a devmapper-style driver. (This does not520 * work for device with handle == IPC_M_CONNECT_ME_TO, because devmapper521 * passes device handle to the driver as an ipc method.)522 */523 if (IPC_GET_IMETHOD(*icall) != IPC_M_CONNECT_ME_TO)524 devman_connection_devmapper(iid, icall);525 526 /*527 * ipc method is IPC_M_CONNECT_ME_TO, so this is forwarded connection528 * from naming service by which we registered as device manager, so be529 * device manager.530 */531 532 516 /* Select interface. */ 533 517 switch ((sysarg_t) (IPC_GET_ARG1(*icall))) { … … 542 526 devman_forward(iid, icall, false); 543 527 break; 528 case DEVMAN_CONNECT_FROM_DEVMAP: 529 /* Someone connected through devmap node. */ 530 devman_connection_devmapper(iid, icall); 531 break; 544 532 case DEVMAN_CONNECT_TO_PARENTS_DEVICE: 545 533 /* Connect client to selected device. */
Note:
See TracChangeset
for help on using the changeset viewer.