Changeset a33f0a6 in mainline for uspace/srv/hid/input/port/gxemul.c


Ignore:
Timestamp:
2011-08-03T17:34:57Z (14 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1940326
Parents:
52a79081 (diff), 3fab770 (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 mainline

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/port/gxemul.c

    r52a79081 ra33f0a6  
    11/*
    22 * Copyright (c) 2007 Michal Kebrt
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    4243#include <errno.h>
    4344
     45static int gxemul_port_init(kbd_dev_t *);
     46static void gxemul_port_yield(void);
     47static void gxemul_port_reclaim(void);
     48static void gxemul_port_write(uint8_t data);
     49
     50kbd_port_ops_t gxemul_port = {
     51        .init = gxemul_port_init,
     52        .yield = gxemul_port_yield,
     53        .reclaim = gxemul_port_reclaim,
     54        .write = gxemul_port_write
     55};
     56
     57static kbd_dev_t *kbd_dev;
     58
    4459static irq_cmd_t gxemul_cmds[] = {
    4560        {
     
    6176
    6277/** Initializes keyboard handler. */
    63 int kbd_port_init(void)
     78static int gxemul_port_init(kbd_dev_t *kdev)
    6479{
     80        kbd_dev = kdev;
     81       
    6582        sysarg_t addr;
    6683        if (sysinfo_get_value("kbd.address.virtual", &addr) != EOK)
     
    7794}
    7895
    79 void kbd_port_yield(void)
     96static void gxemul_port_yield(void)
    8097{
    8198}
    8299
    83 void kbd_port_reclaim(void)
     100static void gxemul_port_reclaim(void)
    84101{
    85102}
    86103
    87 void kbd_port_write(uint8_t data)
     104static void gxemul_port_write(uint8_t data)
    88105{
    89106        (void) data;
     
    91108
    92109/** Process data sent when a key is pressed.
    93  * 
    94  *  @param keybuffer Buffer of pressed keys.
    95  *  @param call      IPC call.
    96110 *
    97  *  @return Always 1.
     111 * @param keybuffer Buffer of pressed keys.
     112 * @param call      IPC call.
     113 *
    98114 */
    99115static void gxemul_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    100116{
    101         int scan_code = IPC_GET_ARG2(*call);
    102 
    103         kbd_push_scancode(scan_code);
     117        kbd_push_data(kbd_dev, IPC_GET_ARG2(*call));
    104118}
    105119
Note: See TracChangeset for help on using the changeset viewer.