Changeset 1875a0c in mainline for uspace/srv/hid/input/include


Ignore:
Timestamp:
2011-06-21T19:10:20Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
022d9f67
Parents:
a9d85df
Message:

input server improvements

  • integrate legacy port mouse drivers (PS/2, ADB) into the input server (to be on par with the legacy keyboard drivers)
  • create generic port/protocol layers for the mouse in the input server
  • rename the "hid_in" namespace to "hid" namespace (hid_in/input was rather redundant)
  • rename the mouse event IPC messages to be more consistent with the keyboard event messages
  • rename input server ops structure members to be more generic (parse_scancode → parse)
  • cstyle changes (newlines, comments, printouts)
Location:
uspace/srv/hid/input/include
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/include/input.h

    ra9d85df r1875a0c  
    4242
    4343#define NAME       "input"
    44 #define NAMESPACE  "hid_in"
     44#define NAMESPACE  "hid"
    4545
    4646extern bool irc_service;
    4747extern int irc_phone;
    48 
    49 extern list_t mouse_devs;
    50 
    51 void input_event_move(int, int);
    52 void input_event_button(int bnum, int press);
    5348
    5449#endif
  • uspace/srv/hid/input/include/kbd.h

    ra9d85df r1875a0c  
    7171} kbd_dev_t;
    7272
    73 extern void kbd_push_scancode(kbd_dev_t *, int);
    74 extern void kbd_push_ev(kbd_dev_t *, int, unsigned int);
     73extern void kbd_push_data(kbd_dev_t *, sysarg_t);
     74extern void kbd_push_event(kbd_dev_t *, int, unsigned int);
    7575
    7676#endif
  • uspace/srv/hid/input/include/kbd_ctl.h

    ra9d85df r1875a0c  
    2828
    2929/** @addtogroup inputgen generic
    30  * @brief       Keyboard controller driver interface.
    31  * @ingroup  input
     30 * @brief Keyboard controller driver interface.
     31 * @ingroup input
    3232 * @{
    3333 */
     
    4343
    4444typedef struct kbd_ctl_ops {
    45         void (*parse_scancode)(int);
     45        void (*parse)(sysarg_t);
    4646        int (*init)(struct kbd_dev *);
    47         void (*set_ind)(struct kbd_dev *, unsigned);
     47        void (*set_ind)(struct kbd_dev *, unsigned int);
    4848} kbd_ctl_ops_t;
    4949
     
    5959/**
    6060 * @}
    61  */
    62 
     61 */
  • uspace/srv/hid/input/include/kbd_port.h

    ra9d85df r1875a0c  
    2828
    2929/** @addtogroup inputgen generic
    30  * @brief       Keyboard port driver interface.
    31  * @ingroup  input
     30 * @brief Keyboard port driver interface.
     31 * @ingroup input
    3232 * @{
    3333 */
     
    5151extern kbd_port_ops_t adb_port;
    5252extern kbd_port_ops_t chardev_port;
    53 extern kbd_port_ops_t dummy_port;
    5453extern kbd_port_ops_t gxemul_port;
    5554extern kbd_port_ops_t msim_port;
     
    6564/**
    6665 * @}
    67  */
    68 
     66 */
  • uspace/srv/hid/input/include/mouse.h

    ra9d85df r1875a0c  
    4040#include <adt/list.h>
    4141
     42struct mouse_port_ops;
     43struct mouse_proto_ops;
     44
    4245typedef struct mouse_dev {
    4346        /** Link to mouse_devs list */
    4447        link_t mouse_devs;
    45 
    46         /** Path to the device */
     48       
     49        /** Path to the device (only for mouseev devices) */
    4750        const char *dev_path;
     51       
     52        /** Port ops */
     53        struct mouse_port_ops *port_ops;
     54       
     55        /** Protocol ops */
     56        struct mouse_proto_ops *proto_ops;
    4857} mouse_dev_t;
    4958
    50 int mouse_add_dev(const char *dev_path);
     59extern void mouse_push_data(mouse_dev_t *, sysarg_t);
     60extern void mouse_push_event_move(mouse_dev_t *, int, int);
     61extern void mouse_push_event_button(mouse_dev_t *, int, int);
    5162
    5263#endif
  • uspace/srv/hid/input/include/mouse_port.h

    ra9d85df r1875a0c  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2011 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup mouse
    30  * @brief
     29/** @addtogroup inputgen generic
     30 * @brief Mouse port driver interface.
     31 * @ingroup input
    3132 * @{
    3233 */
     
    3940#include <sys/types.h>
    4041
    41 extern int mouse_port_init(void);
    42 extern void mouse_port_yield(void);
    43 extern void mouse_port_reclaim(void);
    44 extern void mouse_port_write(uint8_t);
     42struct mouse_dev;
     43
     44typedef struct mouse_port_ops {
     45        int (*init)(struct mouse_dev *);
     46        void (*yield)(void);
     47        void (*reclaim)(void);
     48        void (*write)(uint8_t);
     49} mouse_port_ops_t;
     50
     51extern mouse_port_ops_t adb_mouse_port;
     52extern mouse_port_ops_t chardev_mouse_port;
    4553
    4654#endif
     
    4856/**
    4957 * @}
    50  */
    51 
     58 */
  • uspace/srv/hid/input/include/mouse_proto.h

    ra9d85df r1875a0c  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2011 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup mouse
    30  * @brief
     29/** @addtogroup inputgen generic
     30 * @brief Mouse protocol driver interface.
     31 * @ingroup input
    3132 * @{
    3233 */
     
    3738#define MOUSE_PROTO_H_
    3839
    39 extern void mouse_proto_parse_byte(int);
    40 extern int mouse_proto_init(void);
     40#include <mouse_port.h>
     41
     42struct mouse_dev;
     43
     44typedef struct mouse_proto_ops {
     45        void (*parse)(sysarg_t);
     46        int (*init)(struct mouse_dev *);
     47} mouse_proto_ops_t;
     48
     49extern mouse_proto_ops_t adb_proto;
     50extern mouse_proto_ops_t ps2_proto;
     51extern mouse_proto_ops_t mousedev_proto;
    4152
    4253#endif
Note: See TracChangeset for help on using the changeset viewer.