Ignore:
File:
1 edited

Legend:

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

    r9934f7d r15f3c3f  
    5656#include <ipc/driver.h>
    5757#include <thread.h>
    58 #include <devmap.h>
     58#include <loc.h>
    5959
    6060#include "devman.h"
     
    326326                }
    327327        } else {
    328                 devmap_register_tree_function(fun, tree);
     328                loc_register_tree_function(fun, tree);
    329329        }
    330330       
     
    333333}
    334334
    335 static void devmap_register_class_dev(dev_class_info_t *cli)
    336 {
    337         /* Create devmap path and name for the device. */
    338         char *devmap_pathname = NULL;
    339 
    340         asprintf(&devmap_pathname, "%s/%s%c%s", DEVMAP_CLASS_NAMESPACE,
    341             cli->dev_class->name, DEVMAP_SEPARATOR, cli->dev_name);
    342         if (devmap_pathname == NULL)
     335static void loc_register_class_dev(dev_class_info_t *cli)
     336{
     337        /* Create loc path and name for the service. */
     338        char *loc_pathname = NULL;
     339
     340        asprintf(&loc_pathname, "%s/%s%c%s", LOC_CLASS_NAMESPACE,
     341            cli->dev_class->name, LOC_SEPARATOR, cli->dev_name);
     342        if (loc_pathname == NULL)
    343343                return;
    344344       
    345345        /*
    346          * Register the device by the device mapper and remember its devmap
    347          * handle.
     346         * Register the device with location service and remember its
     347         * service ID.
    348348         */
    349         devmap_device_register_with_iface(devmap_pathname,
    350             &cli->devmap_handle, DEVMAN_CONNECT_FROM_DEVMAP);
     349        loc_service_register_with_iface(loc_pathname,
     350            &cli->service_id, DEVMAN_CONNECT_FROM_LOC);
    351351       
    352352        /*
    353          * Add device to the hash map of class devices registered by device
    354          * mapper.
     353         * Add device to the hash map of class devices registered with
     354         * location service.
    355355         */
    356         class_add_devmap_function(&class_list, cli);
    357        
    358         free(devmap_pathname);
     356        class_add_loc_function(&class_list, cli);
     357       
     358        free(loc_pathname);
    359359}
    360360
     
    381381        dev_class_info_t *class_info = add_function_to_class(fun, cl, NULL);
    382382       
    383         /* Register the device's class alias by devmapper. */
    384         devmap_register_class_dev(class_info);
     383        /* Register the device's class alias with location service. */
     384        loc_register_class_dev(class_info);
    385385       
    386386        log_msg(LVL_NOTE, "Function `%s' added to class `%s' as `%s'.",
     
    659659}
    660660
    661 /** Function for handling connections from a client forwarded by the device
    662  * mapper to the device manager. */
    663 static void devman_connection_devmapper(ipc_callid_t iid, ipc_call_t *icall)
    664 {
    665         devmap_handle_t devmap_handle = IPC_GET_ARG2(*icall);
     661/** Function for handling connections from a client forwarded by the location
     662 * service to the device manager. */
     663static void devman_connection_loc(ipc_callid_t iid, ipc_call_t *icall)
     664{
     665        service_id_t service_id = IPC_GET_ARG2(*icall);
    666666        fun_node_t *fun;
    667667        dev_node_t *dev;
    668668
    669         fun = find_devmap_tree_function(&device_tree, devmap_handle);
     669        fun = find_loc_tree_function(&device_tree, service_id);
    670670        if (fun == NULL)
    671                 fun = find_devmap_class_function(&class_list, devmap_handle);
     671                fun = find_loc_class_function(&class_list, service_id);
    672672       
    673673        if (fun == NULL || fun->dev->drv == NULL) {
     
    689689       
    690690        log_msg(LVL_DEBUG,
    691             "Forwarding devmapper request for `%s' function to driver `%s'.",
     691            "Forwarding loc service request for `%s' function to driver `%s'.",
    692692            fun->pathname, dev->drv->name);
    693693}
     
    708708                devman_forward(iid, icall, false);
    709709                break;
    710         case DEVMAN_CONNECT_FROM_DEVMAP:
    711                 /* Someone connected through devmap node. */
    712                 devman_connection_devmapper(iid, icall);
     710        case DEVMAN_CONNECT_FROM_LOC:
     711                /* Someone connected through loc node. */
     712                devman_connection_loc(iid, icall);
    713713                break;
    714714        case DEVMAN_CONNECT_TO_PARENTS_DEVICE:
     
    746746       
    747747        /*
    748          * !!! devman_connection ... as the device manager is not a real devmap
     748         * !!! devman_connection ... as the device manager is not a real loc
    749749         * driver (it uses a completely different ipc protocol than an ordinary
    750          * devmap driver) forwarding a connection from client to the devman by
    751          * devmapper would not work.
     750         * loc driver) forwarding a connection from client to the devman by
     751         * location service would not work.
    752752         */
    753         devmap_driver_register(NAME, devman_connection);
     753        loc_server_register(NAME, devman_connection);
    754754       
    755755        return true;
Note: See TracChangeset for help on using the changeset viewer.