Changeset 15f3c3f in mainline for uspace/srv/hid/input/generic/input.c


Ignore:
Timestamp:
2011-06-22T22:00:52Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86ffa27f
Parents:
ef09a7a
Message:

Rename devmap to loc, devfs to locfs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/generic/input.c

    ref09a7a r15f3c3f  
    5353#include <io/console.h>
    5454#include <io/keycode.h>
    55 #include <devmap.h>
     55#include <loc.h>
    5656#include <input.h>
    5757#include <kbd.h>
     
    324324/** Add new kbdev device.
    325325 *
    326  * @param dev_path Filesystem path to the device (/dev/class/...)
     326 * @param dev_path Filesystem path to the device (/loc/class/...)
    327327 *
    328328 */
     
    352352/** Add new mousedev device.
    353353 *
    354  * @param dev_path Filesystem path to the device (/dev/class/...)
     354 * @param dev_path Filesystem path to the device (/loc/class/...)
    355355 *
    356356 */
     
    486486/** Periodically check for new input devices.
    487487 *
    488  * Looks under /dev/class/keyboard and /dev/class/mouse.
     488 * Looks under /loc/class/keyboard and /loc/class/mouse.
    489489 *
    490490 * @param arg Ignored
     
    504504                 * Check for new keyboard device
    505505                 */
    506                 rc = asprintf(&dev_path, "/dev/class/keyboard\\%zu", kbd_id);
     506                rc = asprintf(&dev_path, "/loc/class/keyboard\\%zu", kbd_id);
    507507                if (rc < 0)
    508508                        continue;
     
    521521                 * Check for new mouse device
    522522                 */
    523                 rc = asprintf(&dev_path, "/dev/class/mouse\\%zu", mouse_id);
     523                rc = asprintf(&dev_path, "/loc/class/mouse\\%zu", mouse_id);
    524524                if (rc < 0)
    525525                        continue;
     
    573573        /* Add legacy keyboard devices. */
    574574        kbd_add_legacy_devs();
    575        
     575
    576576        /* Add legacy mouse devices. */
    577577        mouse_add_legacy_devs();
    578578       
    579579        /* Register driver */
    580         int rc = devmap_driver_register(NAME, client_connection);
     580        int rc = loc_server_register(NAME, client_connection);
    581581        if (rc < 0) {
    582                 printf("%s: Unable to register driver (%d)\n", NAME, rc);
     582                printf("%s: Unable to register server (%d)\n", NAME, rc);
    583583                return -1;
    584584        }
    585585       
    586         char kbd[DEVMAP_NAME_MAXLEN + 1];
    587         snprintf(kbd, DEVMAP_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
    588        
    589         devmap_handle_t devmap_handle;
    590         if (devmap_device_register(kbd, &devmap_handle) != EOK) {
    591                 printf("%s: Unable to register device %s\n", NAME, kbd);
     586        char kbd[LOC_NAME_MAXLEN + 1];
     587        snprintf(kbd, LOC_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
     588       
     589        service_id_t service_id;
     590        if (loc_service_register(kbd, &service_id) != EOK) {
     591                printf("%s: Unable to register service %s\n", NAME, kbd);
    592592                return -1;
    593593        }
Note: See TracChangeset for help on using the changeset viewer.