Changeset 47a7174f in mainline for uspace/srv
- Timestamp:
- 2010-12-17T22:03:15Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7551706b
- Parents:
- 0bff73a
- Location:
- uspace/srv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
r0bff73a r47a7174f 670 670 } 671 671 672 devmap_device_register(devmap_pathname, &node->devmap_handle); 672 devmap_device_register_with_iface(devmap_pathname, 673 &node->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP); 673 674 674 675 tree_add_devmap_device(tree, node); -
uspace/srv/devman/main.c
r0bff73a r47a7174f 486 486 static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall) 487 487 { 488 devmap_handle_t devmap_handle = IPC_GET_ IMETHOD(*icall);488 devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall); 489 489 node_t *dev; 490 490 … … 503 503 } 504 504 505 printf(NAME ": devman_connection_devmapper: forward connection to "506 "device %s to driver %s.\n", dev->pathname, dev->drv->name);507 505 ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0, 508 506 IPC_FF_NONE); 507 printf(NAME ": devman_connection_devmapper: forwarded connection to " 508 "device %s to driver %s.\n", dev->pathname, dev->drv->name); 509 509 } 510 510 … … 512 512 static void devman_connection(ipc_callid_t iid, ipc_call_t *icall) 513 513 { 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 514 /* Select interface. */ 533 515 switch ((sysarg_t) (IPC_GET_ARG1(*icall))) { … … 542 524 devman_forward(iid, icall, false); 543 525 break; 526 case DEVMAN_CONNECT_FROM_DEVMAP: 527 /* Someone connected through devmap node. */ 528 devman_connection_devmapper(iid, icall); 529 break; 544 530 case DEVMAN_CONNECT_TO_PARENTS_DEVICE: 545 531 /* Connect client to selected device. */ -
uspace/srv/devmap/devmap.c
r0bff73a r47a7174f 99 99 /** Device driver handling this device */ 100 100 devmap_driver_t *driver; 101 /** Use this interface when forwarding to driver. */ 102 sysarg_t forward_interface; 101 103 } devmap_device_t; 102 104 … … 517 519 } 518 520 521 /* Set the interface, if any. */ 522 device->forward_interface = IPC_GET_ARG1(*icall); 523 519 524 /* Get fqdn */ 520 525 char *fqdn; … … 566 571 /* Get unique device handle */ 567 572 device->handle = devmap_create_handle(); 568 573 569 574 devmap_namespace_addref(namespace, device); 570 575 device->driver = driver; … … 617 622 } 618 623 619 ipc_forward_fast(callid, dev->driver->phone, dev->handle, 620 IPC_GET_ARG3(*call), 0, IPC_FF_NONE); 624 if (dev->forward_interface == 0) { 625 /* The IPC_GET_ARG3(*icall) would be always zero, 626 * wouldn't it? So why to pass it at all? 627 */ 628 ipc_forward_fast(callid, dev->driver->phone, 629 dev->handle, 0, 0, 630 IPC_FF_NONE); 631 } else { 632 ipc_forward_fast(callid, dev->driver->phone, 633 dev->forward_interface, dev->handle, 0, 634 IPC_FF_NONE); 635 } 621 636 622 637 fibril_mutex_unlock(&devices_list_mutex);
Note:
See TracChangeset
for help on using the changeset viewer.