Changeset 93fb170c in mainline for uspace/srv/devman/main.c


Ignore:
Timestamp:
2011-01-08T18:51:31Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
15be932
Parents:
8f748215 (diff), a523af4 (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.
Message:

Merge from main branch

File:
1 edited

Legend:

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

    r8f748215 r93fb170c  
    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        /*
     
    457458       
    458459        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);
    461463                ipc_answer_0(iid, ENOENT);
    462464                return;
     
    486488static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall)
    487489{
    488         devmap_handle_t devmap_handle = IPC_GET_IMETHOD(*icall);
     490        devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall);
    489491        node_t *dev;
    490492
     
    503505        }
    504506       
    505         printf(NAME ": devman_connection_devmapper: forward connection to "
    506             "device %s to driver %s.\n", dev->pathname, dev->drv->name);
    507507        ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0,
    508508            IPC_FF_NONE);
     509        printf(NAME ": devman_connection_devmapper: forwarded connection to "
     510            "device %s to driver %s.\n", dev->pathname, dev->drv->name);
    509511}
    510512
     
    512514static void devman_connection(ipc_callid_t iid, ipc_call_t *icall)
    513515{
    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        
    532516        /* Select interface. */
    533517        switch ((sysarg_t) (IPC_GET_ARG1(*icall))) {
     
    542526                devman_forward(iid, icall, false);
    543527                break;
     528        case DEVMAN_CONNECT_FROM_DEVMAP:
     529                /* Someone connected through devmap node. */
     530                devman_connection_devmapper(iid, icall);
     531                break;
    544532        case DEVMAN_CONNECT_TO_PARENTS_DEVICE:
    545533                /* Connect client to selected device. */
Note: See TracChangeset for help on using the changeset viewer.