Changeset 7cfe5c0 in mainline for uspace/srv/hid/input


Ignore:
Timestamp:
2012-08-20T19:16:24Z (14 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6b99156
Parents:
b9cb911 (diff), 01e397ac (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:

Merged with mainline 0.5.0 changes.

Location:
uspace/srv/hid/input
Files:
21 edited
14 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/Makefile

    rb9cb911 r7cfe5c0  
    2929
    3030USPACE_PREFIX = ../../..
    31 EXTRA_CFLAGS = -Iinclude
    3231BINARY = input
    3332
    3433SOURCES = \
    35         generic/gsp.c \
    36         generic/input.c \
    37         generic/layout.c \
    38         generic/stroke.c \
    3934        layout/cz.c \
    4035        layout/us_qwerty.c \
     
    5651        ctl/pc.c \
    5752        ctl/stty.c \
    58         ctl/sun.c
     53        ctl/sun.c \
     54        gsp.c \
     55        input.c \
     56        layout.c \
     57        stroke.c
    5958
    6059include $(USPACE_PREFIX)/Makefile.common
  • uspace/srv/hid/input/ctl/apple.c

    rb9cb911 r7cfe5c0  
    3636 */
    3737
    38 #include <kbd.h>
    3938#include <io/console.h>
    4039#include <io/keycode.h>
    41 #include <kbd_ctl.h>
    42 #include <kbd_port.h>
     40#include "../kbd.h"
     41#include "../kbd_ctl.h"
     42#include "../kbd_port.h"
    4343
    4444static void apple_ctl_parse(sysarg_t);
  • uspace/srv/hid/input/ctl/gxe_fb.c

    rb9cb911 r7cfe5c0  
    3333/**
    3434 * @file
    35  * @brief       GXEmul framebuffer-mode keyboard controller driver.
     35 * @brief GXEmul framebuffer-mode keyboard controller driver.
    3636 */
    3737
    38 #include <kbd.h>
    3938#include <io/console.h>
    4039#include <io/keycode.h>
    41 #include <kbd_ctl.h>
    42 #include <kbd_port.h>
    43 #include <gsp.h>
    44 #include <stroke.h>
     40#include "../stroke.h"
     41#include "../gsp.h"
     42#include "../kbd.h"
     43#include "../kbd_port.h"
     44#include "../kbd_ctl.h"
    4545
    4646static void gxe_fb_ctl_parse(sysarg_t);
  • uspace/srv/hid/input/ctl/kbdev.c

    rb9cb911 r7cfe5c0  
    4040#include <errno.h>
    4141#include <fcntl.h>
    42 #include <gsp.h>
    4342#include <io/console.h>
    4443#include <io/keycode.h>
    4544#include <ipc/kbdev.h>
    46 #include <input.h>
    47 #include <kbd.h>
    48 #include <kbd_ctl.h>
    49 #include <kbd_port.h>
    5045#include <loc.h>
    5146#include <stdlib.h>
    5247#include <vfs/vfs_sess.h>
    5348#include <sys/typefmt.h>
     49#include "../gsp.h"
     50#include "../input.h"
     51#include "../kbd.h"
     52#include "../kbd_ctl.h"
     53#include "../kbd_port.h"
    5454
    5555static int kbdev_ctl_init(kbd_dev_t *);
  • uspace/srv/hid/input/ctl/pc.c

    rb9cb911 r7cfe5c0  
    3636 */
    3737
    38 #include <kbd.h>
    3938#include <io/console.h>
    4039#include <io/keycode.h>
    41 #include <kbd_ctl.h>
    42 #include <kbd_port.h>
    43 #include <gsp.h>
     40#include "../gsp.h"
     41#include "../kbd.h"
     42#include "../kbd_port.h"
     43#include "../kbd_ctl.h"
    4444
    4545static void pc_ctl_parse(sysarg_t);
  • uspace/srv/hid/input/ctl/stty.c

    rb9cb911 r7cfe5c0  
    3838 */
    3939
    40 #include <kbd.h>
    4140#include <io/keycode.h>
    42 #include <kbd_ctl.h>
    43 #include <kbd_port.h>
    44 #include <gsp.h>
    45 #include <stroke.h>
     41#include "../stroke.h"
     42#include "../gsp.h"
     43#include "../kbd.h"
     44#include "../kbd_port.h"
     45#include "../kbd_ctl.h"
    4646
    4747static void stty_ctl_parse(sysarg_t);
  • uspace/srv/hid/input/ctl/sun.c

    rb9cb911 r7cfe5c0  
    3737 */
    3838
    39 #include <kbd.h>
    4039#include <io/console.h>
    4140#include <io/keycode.h>
    42 #include <kbd_ctl.h>
    43 #include <kbd_port.h>
     41#include "../kbd.h"
     42#include "../kbd_port.h"
     43#include "../kbd_ctl.h"
    4444
    4545static void sun_ctl_parse(sysarg_t);
  • uspace/srv/hid/input/gsp.c

    rb9cb911 r7cfe5c0  
    3131 * @ingroup  input
    3232 * @{
    33  */ 
     33 */
    3434/** @file
    35  * @brief       Generic scancode parser.
     35 * @brief Generic scancode parser.
    3636 *
    3737 * The scancode parser is a simple finite state machine. It is described
     
    4949 */
    5050
    51 #include <gsp.h>
    5251#include <adt/hash_table.h>
    5352#include <adt/hash.h>
    5453#include <stdlib.h>
    5554#include <stdio.h>
     55#include "gsp.h"
    5656
    5757/*
  • uspace/srv/hid/input/input.c

    rb9cb911 r7cfe5c0  
    5454#include <io/keycode.h>
    5555#include <loc.h>
    56 #include <input.h>
    57 #include <kbd.h>
    58 #include <kbd_port.h>
    59 #include <kbd_ctl.h>
    60 #include <mouse_proto.h>
    61 #include <layout.h>
    62 #include <mouse.h>
     56#include "layout.h"
     57#include "kbd.h"
     58#include "kbd_port.h"
     59#include "kbd_ctl.h"
     60#include "mouse.h"
     61#include "mouse_proto.h"
     62#include "input.h"
    6363
    6464#define NUM_LAYOUTS  3
     
    189189        }
    190190        async_exchange_end(exch);
     191}
     192
     193/** Mouse pointer has moved in absolute mode. */
     194void mouse_push_event_abs_move(mouse_dev_t *mdev, unsigned int x, unsigned int y,
     195    unsigned int max_x, unsigned int max_y)
     196{
     197        if (max_x && max_y) {
     198                async_exch_t *exch = async_exchange_begin(client_sess);
     199                async_msg_4(exch, INPUT_EVENT_ABS_MOVE, x, y, max_x, max_y);
     200                async_exchange_end(exch);
     201        }
    191202}
    192203
     
    635646}
    636647
     648static void usage(char *name)
     649{
     650        printf("Usage: %s <service_name>\n", name);
     651}
     652
    637653int main(int argc, char **argv)
    638654{
     655        if (argc < 2) {
     656                usage(argv[0]);
     657                return 1;
     658        }
     659       
    639660        printf("%s: HelenOS input service\n", NAME);
    640661       
     
    667688        }
    668689       
    669         char kbd[LOC_NAME_MAXLEN + 1];
    670         snprintf(kbd, LOC_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME);
    671        
    672690        service_id_t service_id;
    673         rc = loc_service_register(kbd, &service_id);
    674         if (rc != EOK) {
    675                 printf("%s: Unable to register service %s\n", NAME, kbd);
     691        rc = loc_service_register(argv[1], &service_id);
     692        if (rc != EOK) {
     693                printf("%s: Unable to register service %s\n", NAME, argv[1]);
    676694                return rc;
    677695        }
     
    681699       
    682700        printf("%s: Accepting connections\n", NAME);
     701        task_retval(0);
    683702        async_manager();
    684703       
  • uspace/srv/hid/input/input.h

    rb9cb911 r7cfe5c0  
    4242#include <async.h>
    4343
    44 #define NAME       "input"
    45 #define NAMESPACE  "hid"
     44#define NAME  "input"
    4645
    4746extern bool irc_service;
  • uspace/srv/hid/input/kbd_ctl.h

    rb9cb911 r7cfe5c0  
    3838#define KBD_CTL_H_
    3939
    40 #include <kbd_port.h>
     40#include "kbd_port.h"
    4141
    4242struct kbd_dev;
  • uspace/srv/hid/input/layout.c

    rb9cb911 r7cfe5c0  
    3737
    3838#include <errno.h>
    39 #include <input.h>
    40 #include <layout.h>
    4139#include <stdlib.h>
     40#include "input.h"
     41#include "layout.h"
    4242
    4343/** Create a new layout instance. */
  • uspace/srv/hid/input/layout/cz.c

    rb9cb911 r7cfe5c0  
    3333
    3434#include <errno.h>
    35 #include <input.h>
    3635#include <io/console.h>
    3736#include <io/keycode.h>
    3837#include <bool.h>
    39 #include <layout.h>
    4038#include <stdlib.h>
     39#include "../input.h"
     40#include "../layout.h"
    4141
    4242static int cz_create(layout_t *);
  • uspace/srv/hid/input/layout/us_dvorak.c

    rb9cb911 r7cfe5c0  
    3333
    3434#include <errno.h>
    35 #include <kbd.h>
    3635#include <io/console.h>
    3736#include <io/keycode.h>
    38 #include <layout.h>
     37#include "../layout.h"
     38#include "../kbd.h"
    3939
    4040static int us_dvorak_create(layout_t *);
  • uspace/srv/hid/input/layout/us_qwerty.c

    rb9cb911 r7cfe5c0  
    2828
    2929/** @addtogroup input
    30  * @brief       US QWERTY layout.
     30 * @brief US QWERTY layout.
    3131 * @{
    3232 */
    3333
    3434#include <errno.h>
    35 #include <kbd.h>
    3635#include <io/console.h>
    3736#include <io/keycode.h>
    38 #include <layout.h>
     37#include "../layout.h"
     38#include "../kbd.h"
    3939
    4040static int us_qwerty_create(layout_t *);
  • uspace/srv/hid/input/mouse.h

    rb9cb911 r7cfe5c0  
    6363extern void mouse_push_data(mouse_dev_t *, sysarg_t);
    6464extern void mouse_push_event_move(mouse_dev_t *, int, int, int);
     65extern void mouse_push_event_abs_move(mouse_dev_t *, unsigned int, unsigned int,
     66    unsigned int, unsigned int);
    6567extern void mouse_push_event_button(mouse_dev_t *, int, int);
    6668
  • uspace/srv/hid/input/mouse_proto.h

    rb9cb911 r7cfe5c0  
    3838#define MOUSE_PROTO_H_
    3939
    40 #include <mouse_port.h>
     40#include "mouse_port.h"
    4141
    4242struct mouse_dev;
  • uspace/srv/hid/input/port/adb.c

    rb9cb911 r7cfe5c0  
    3737#include <ipc/adb.h>
    3838#include <async.h>
    39 #include <input.h>
    40 #include <kbd_port.h>
    41 #include <kbd.h>
    4239#include <vfs/vfs.h>
    4340#include <fcntl.h>
    4441#include <errno.h>
    4542#include <loc.h>
     43#include "../input.h"
     44#include "../kbd_port.h"
     45#include "../kbd.h"
    4646
    4747static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
  • uspace/srv/hid/input/port/adb_mouse.c

    rb9cb911 r7cfe5c0  
    3737#include <ipc/adb.h>
    3838#include <async.h>
    39 #include <input.h>
    40 #include <mouse_port.h>
    41 #include <mouse.h>
    4239#include <errno.h>
    4340#include <loc.h>
    4441#include <stdio.h>
     42#include "../mouse.h"
     43#include "../mouse_port.h"
     44#include "../input.h"
    4545
    4646static mouse_dev_t *mouse_dev;
  • uspace/srv/hid/input/port/chardev.c

    rb9cb911 r7cfe5c0  
    3737#include <ipc/char.h>
    3838#include <async.h>
    39 #include <input.h>
    40 #include <kbd_port.h>
    41 #include <kbd.h>
    4239#include <loc.h>
    4340#include <errno.h>
    4441#include <stdio.h>
     42#include "../input.h"
     43#include "../kbd_port.h"
     44#include "../kbd.h"
    4545
    4646static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
  • uspace/srv/hid/input/port/gxemul.c

    rb9cb911 r7cfe5c0  
    3131 * @{
    3232 * @ingroup  kbd
    33  */ 
     33 */
    3434/** @file
    35  * @brief       GXEmul keyboard port driver.
     35 * @brief GXEmul keyboard port driver.
    3636 */
    3737
    3838#include <async.h>
    3939#include <sysinfo.h>
    40 #include <kbd_port.h>
    41 #include <kbd.h>
    4240#include <ddi.h>
    4341#include <errno.h>
     42#include "../kbd_port.h"
     43#include "../kbd.h"
    4444
    4545static int gxemul_port_init(kbd_dev_t *);
  • uspace/srv/hid/input/port/msim.c

    rb9cb911 r7cfe5c0  
    3838#include <async.h>
    3939#include <sysinfo.h>
    40 #include <kbd_port.h>
    41 #include <kbd.h>
    4240#include <ddi.h>
    4341#include <errno.h>
     42#include "../kbd_port.h"
     43#include "../kbd.h"
    4444
    4545static int msim_port_init(kbd_dev_t *);
  • uspace/srv/hid/input/port/niagara.c

    rb9cb911 r7cfe5c0  
    3131 * @ingroup  kbd
    3232 * @{
    33  */ 
     33 */
    3434/** @file
    35  * @brief       Niagara console keyboard port driver.
     35 * @brief Niagara console keyboard port driver.
    3636 */
    3737
     
    3939#include <ddi.h>
    4040#include <async.h>
    41 #include <kbd.h>
    42 #include <kbd_port.h>
    4341#include <sysinfo.h>
    4442#include <stdio.h>
     
    4644#include <bool.h>
    4745#include <errno.h>
     46#include "../kbd_port.h"
     47#include "../kbd.h"
    4848
    4949static int niagara_port_init(kbd_dev_t *);
  • uspace/srv/hid/input/port/ns16550.c

    rb9cb911 r7cfe5c0  
    3939#include <async.h>
    4040#include <sysinfo.h>
    41 #include <input.h>
    42 #include <kbd.h>
    43 #include <kbd_port.h>
    4441#include <ddi.h>
    4542#include <errno.h>
     43#include "../input.h"
     44#include "../kbd_port.h"
     45#include "../kbd.h"
    4646
    4747static int ns16550_port_init(kbd_dev_t *);
  • uspace/srv/hid/input/port/pl050.c

    rb9cb911 r7cfe5c0  
    4141#include <unistd.h>
    4242#include <sysinfo.h>
    43 #include <kbd_port.h>
    44 #include <kbd.h>
    4543#include <ddi.h>
    4644#include <stdio.h>
    4745#include <errno.h>
     46#include "../kbd_port.h"
     47#include "../kbd.h"
    4848
    4949static int pl050_port_init(kbd_dev_t *);
  • uspace/srv/hid/input/port/ski.c

    rb9cb911 r7cfe5c0  
    3131 * @ingroup  kbd
    3232 * @{
    33  */ 
     33 */
    3434/** @file
    35  * @brief       Ski console keyboard port driver.
     35 * @brief Ski console keyboard port driver.
    3636 */
    37 
    3837
    3938#include <stdlib.h>
    4039#include <unistd.h>
    41 #include <kbd.h>
    42 #include <kbd_port.h>
    4340#include <sys/types.h>
    4441#include <thread.h>
    4542#include <bool.h>
     43#include "../kbd_port.h"
     44#include "../kbd.h"
    4645
    4746static int ski_port_init(kbd_dev_t *);
  • uspace/srv/hid/input/proto/adb.c

    rb9cb911 r7cfe5c0  
    3737
    3838#include <bool.h>
    39 #include <mouse.h>
    40 #include <mouse_port.h>
    41 #include <mouse_proto.h>
     39#include "../mouse.h"
     40#include "../mouse_port.h"
     41#include "../mouse_proto.h"
    4242
    4343static mouse_dev_t *mouse_dev;
  • uspace/srv/hid/input/proto/mousedev.c

    rb9cb911 r7cfe5c0  
    4343#include <errno.h>
    4444#include <ipc/mouseev.h>
    45 #include <input.h>
    4645#include <loc.h>
    47 #include <mouse.h>
    48 #include <mouse_port.h>
    49 #include <mouse_proto.h>
    5046#include <sys/typefmt.h>
     47#include "../mouse.h"
     48#include "../mouse_port.h"
     49#include "../mouse_proto.h"
     50#include "../input.h"
    5151
    5252/** Mousedev softstate */
     
    9494                            IPC_GET_ARG1(call), IPC_GET_ARG2(call),
    9595                            IPC_GET_ARG3(call));
     96                        retval = EOK;
     97                        break;
     98                case MOUSEEV_ABS_MOVE_EVENT:
     99                        mouse_push_event_abs_move(mousedev->mouse_dev,
     100                                IPC_GET_ARG1(call), IPC_GET_ARG2(call),
     101                                IPC_GET_ARG3(call), IPC_GET_ARG4(call));
    96102                        retval = EOK;
    97103                        break;
  • uspace/srv/hid/input/stroke.c

    rb9cb911 r7cfe5c0  
    4040 */
    4141
    42 #include <stroke.h>
    43 #include <kbd.h>
    4442#include <io/console.h>
    4543#include <io/keycode.h>
     44#include "stroke.h"
     45#include "kbd.h"
    4646
    4747/** Correspondence between modifers and the modifier keycodes. */
  • uspace/srv/hid/input/stroke.h

    rb9cb911 r7cfe5c0  
    2828
    2929/** @addtogroup inputgen generic
    30  * @brief       Generic scancode parser.
    31  * @ingroup  input
     30 * @brief Generic scancode parser.
     31 * @ingroup input
    3232 * @{
    33  */ 
     33 */
    3434/** @file
    3535 */
     
    3838#define KBD_STROKE_H_
    3939
    40 #include <kbd.h>
     40#include "kbd.h"
    4141
    4242extern void stroke_sim(kbd_dev_t *, unsigned, unsigned);
     
    4646/**
    4747 * @}
    48  */
    49 
     48 */
Note: See TracChangeset for help on using the changeset viewer.