Changeset bd87ae0 in mainline for uspace/drv/char/xtkbd/xtkbd.c


Ignore:
Timestamp:
2012-01-04T00:50:07Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
41c9a22
Parents:
2f79a38
Message:

i8042, xtkbd: Switch keyboard away from DDF provided interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/xtkbd/xtkbd.c

    r2f79a38 rbd87ae0  
    3535#include <errno.h>
    3636#include <devman.h>
    37 #include <device/char_dev.h>
    3837#include <ddf/log.h>
    3938#include <io/keycode.h>
     
    4241#include <abi/ipc/methods.h>
    4342
     43#include "chardev.h"
    4444#include "xtkbd.h"
    4545
     
    259259
    260260        assert(kbd->parent_sess);
     261        async_exch_t *parent_exch = async_exchange_begin(kbd->parent_sess);
    261262        while (1) {
     263                if (!parent_exch)
     264                        parent_exch = async_exchange_begin(kbd->parent_sess);
     265
    262266                const int *map = scanmap_simple;
    263267                size_t map_size = sizeof(scanmap_simple) / sizeof(int);
    264268
    265269                uint8_t code = 0;
    266                 ssize_t size = char_dev_read(kbd->parent_sess, &code, 1);
     270                ssize_t size = chardev_read(parent_exch, &code, 1);
    267271
    268272                /** Ignore AT command reply */
     
    274278                        map = scanmap_e0;
    275279                        map_size = sizeof(scanmap_e0) / sizeof(int);
    276                         size = char_dev_read(kbd->parent_sess, &code, 1);
     280                        size = chardev_read(parent_exch, &code, 1);
    277281                        // TODO handle print screen
    278282                }
     
    334338                    ((mods & KM_SCROLL_LOCK) ? LI_SCROLL : 0);
    335339                uint8_t cmds[] = { KBD_CMD_SET_LEDS, status };
    336                 const ssize_t size =
    337                      char_dev_write(kbd->parent_sess, cmds, sizeof(cmds));
     340                async_exch_t *exch = async_exchange_begin(kbd->parent_sess);
     341                const ssize_t size = chardev_write(exch, cmds, sizeof(cmds));
     342                async_exchange_end(exch);
    338343                async_answer_0(icallid, size < 0 ? size : EOK);
    339344                break;
Note: See TracChangeset for help on using the changeset viewer.