Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/main.c

    r1f383dde r124c061  
    281281         * handle.
    282282         */
    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);
    284285       
    285286        /*
     
    477478        }
    478479
    479 //      printf(NAME ": devman_forward: forward connection to device %s to "
    480 //          "driver %s.\n", dev->pathname, driver->name);
     480        printf(NAME ": devman_forward: forward connection to device %s to "
     481            "driver %s.\n", dev->pathname, driver->name);
    481482        ipc_forward_fast(iid, driver->phone, method, dev->handle, 0, IPC_FF_NONE);
    482483}
     
    486487static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall)
    487488{
    488         devmap_handle_t devmap_handle = IPC_GET_IMETHOD(*icall);
     489        devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall);
    489490        node_t *dev;
    490491
     
    503504        }
    504505       
    505         printf(NAME ": devman_connection_devmapper: forward connection to "
    506             "device %s to driver %s.\n", dev->pathname, dev->drv->name);
    507506        ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0,
    508507            IPC_FF_NONE);
     508        printf(NAME ": devman_connection_devmapper: forwarded connection to "
     509            "device %s to driver %s.\n", dev->pathname, dev->drv->name);
    509510}
    510511
     
    512513static void devman_connection(ipc_callid_t iid, ipc_call_t *icall)
    513514{
    514         /*
    515          * Silly hack to enable the device manager to register as a driver by
    516          * the device mapper. If the ipc method is not IPC_M_CONNECT_ME_TO, this
    517          * is not the forwarded connection from naming service, so it must be a
    518          * connection from the devmapper which thinks this is a devmapper-style
    519          * driver. So pretend this is a devmapper-style driver. (This does not
    520          * work for device with handle == IPC_M_CONNECT_ME_TO, because devmapper
    521          * 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 connection
    528          * from naming service by which we registered as device manager, so be
    529          * device manager.
    530          */
    531        
    532515        /* Select interface. */
    533516        switch ((sysarg_t) (IPC_GET_ARG1(*icall))) {
     
    542525                devman_forward(iid, icall, false);
    543526                break;
     527        case DEVMAN_CONNECT_FROM_DEVMAP:
     528                /* Someone connected through devmap node. */
     529                devman_connection_devmapper(iid, icall);
     530                break;
    544531        case DEVMAN_CONNECT_TO_PARENTS_DEVICE:
    545532                /* Connect client to selected device. */
     
    599586
    600587        /* Register device manager at naming service. */
    601         sysarg_t phonead;
    602         if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAN, 0, 0, &phonead) != 0)
     588        if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAN, 0, 0, NULL, NULL) != 0)
    603589                return -1;
    604590
Note: See TracChangeset for help on using the changeset viewer.