Ignore:
File:
1 edited

Legend:

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

    r15f3c3f r333c233  
    5353#include <io/console.h>
    5454#include <io/keycode.h>
    55 #include <loc.h>
     55#include <devmap.h>
    5656#include <input.h>
    5757#include <kbd.h>
     
    324324/** Add new kbdev device.
    325325 *
    326  * @param dev_path Filesystem path to the device (/loc/class/...)
     326 * @param dev_path Filesystem path to the device (/dev/class/...)
    327327 *
    328328 */
     
    352352/** Add new mousedev device.
    353353 *
    354  * @param dev_path Filesystem path to the device (/loc/class/...)
     354 * @param dev_path Filesystem path to the device (/dev/class/...)
    355355 *
    356356 */
     
    410410#endif
    411411#if defined(MACHINE_msim)
    412         kbd_add_dev(&msim_port, &pc_ctl);
     412        kbd_add_dev(&msim_port, &stty_ctl);
    413413#endif
    414414#if (defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul)) && defined(CONFIG_FB)
     
    424424        kbd_add_dev(&niagara_port, &stty_ctl);
    425425#endif
    426 #if defined(UARCH_sparc64) && defined(MACHINE_serengeti)
    427         kbd_add_dev(&sgcn_port, &stty_ctl);
    428 #endif
    429426#if defined(UARCH_sparc64) && defined(MACHINE_generic)
    430         kbd_add_dev(&z8530_port, &sun_ctl);
    431427        kbd_add_dev(&ns16550_port, &sun_ctl);
    432428#endif
     
    486482/** Periodically check for new input devices.
    487483 *
    488  * Looks under /loc/class/keyboard and /loc/class/mouse.
     484 * Looks under /dev/class/keyboard and /dev/class/mouse.
    489485 *
    490486 * @param arg Ignored
     
    504500                 * Check for new keyboard device
    505501                 */
    506                 rc = asprintf(&dev_path, "/loc/class/keyboard\\%zu", kbd_id);
     502                rc = asprintf(&dev_path, "/dev/class/keyboard\\%zu", kbd_id);
    507503                if (rc < 0)
    508504                        continue;
     
    521517                 * Check for new mouse device
    522518                 */
    523                 rc = asprintf(&dev_path, "/loc/class/mouse\\%zu", mouse_id);
     519                rc = asprintf(&dev_path, "/dev/class/mouse\\%zu", mouse_id);
    524520                if (rc < 0)
    525521                        continue;
     
    556552        printf("%s: HelenOS input service\n", NAME);
    557553       
    558         sysarg_t fhc;
    559554        sysarg_t obio;
    560555       
     
    562557        list_initialize(&mouse_devs);
    563558       
    564         if (((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc))
    565             || ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio)))
     559        if ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio))
    566560                irc_service = true;
    567561       
     
    573567        /* Add legacy keyboard devices. */
    574568        kbd_add_legacy_devs();
    575 
     569       
    576570        /* Add legacy mouse devices. */
    577571        mouse_add_legacy_devs();
    578572       
    579573        /* Register driver */
    580         int rc = loc_server_register(NAME, client_connection);
     574        int rc = devmap_driver_register(NAME, client_connection);
    581575        if (rc < 0) {
    582                 printf("%s: Unable to register server (%d)\n", NAME, rc);
     576                printf("%s: Unable to register driver (%d)\n", NAME, rc);
    583577                return -1;
    584578        }
    585579       
    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);
     580        char kbd[DEVMAP_NAME_MAXLEN + 1];
     581        snprintf(kbd, DEVMAP_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
     582       
     583        devmap_handle_t devmap_handle;
     584        if (devmap_device_register(kbd, &devmap_handle) != EOK) {
     585                printf("%s: Unable to register device %s\n", NAME, kbd);
    592586                return -1;
    593587        }
Note: See TracChangeset for help on using the changeset viewer.