Changeset 9934f7d in mainline for uspace/srv/hid


Ignore:
Timestamp:
2011-06-13T19:53:48Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a07a454
Parents:
43ac0cc
Message:

Add extra argument to async connection handlers that can be used for passing
information from async_connect_to_me() to the handler.

Location:
uspace/srv/hid
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/adb_mouse/adb_dev.c

    r43ac0cc r9934f7d  
    4848#include "adb_dev.h"
    4949
    50 static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall);
     50static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    5151
    5252int adb_dev_init(void)
     
    6868       
    6969        /* NB: The callback connection is slotted for removal */
    70         if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events) != 0) {
     70        if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events,
     71            NULL) != 0) {
    7172                printf(NAME ": Failed to create callback from device\n");
    7273                return false;
     
    7677}
    7778
    78 static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall)
     79static void adb_dev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    7980{
    8081        /* Ignore parameters, the connection is already opened */
  • uspace/srv/hid/adb_mouse/adb_mouse.c

    r43ac0cc r9934f7d  
    5252#include <kernel/ipc/ipc_methods.h>
    5353
    54 static void client_connection(ipc_callid_t iid, ipc_call_t *icall);
     54static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    5555static void mouse_ev_btn(int button, int press);
    5656static void mouse_ev_move(int dx, int dy);
     
    9494}
    9595
    96 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     96static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    9797{
    9898        ipc_callid_t callid;
  • uspace/srv/hid/char_mouse/char_mouse.c

    r43ac0cc r9934f7d  
    7979}
    8080
    81 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     81static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    8282{
    8383        ipc_callid_t callid;
  • uspace/srv/hid/char_mouse/chardev.c

    r43ac0cc r9934f7d  
    4545#include <mouse_port.h>
    4646
    47 static void chardev_events(ipc_callid_t iid, ipc_call_t *icall);
     47static void chardev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    4848
    4949static int dev_phone;
     
    6969       
    7070        /* NB: The callback connection is slotted for removal */
    71         if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, chardev_events) != 0) {
     71        if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, chardev_events,
     72            NULL) != 0) {
    7273                printf(NAME ": Failed to create callback from device\n");
    7374                return false;
     
    9091}
    9192
    92 static void chardev_events(ipc_callid_t iid, ipc_call_t *icall)
     93static void chardev_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    9394{
    9495        /* Ignore parameters, the connection is already opened */
  • uspace/srv/hid/console/console.c

    r43ac0cc r9934f7d  
    427427
    428428/** Handler for keyboard */
    429 static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall)
     429static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    430430{
    431431        /* Ignore parameters, the connection is already opened */
     
    474474
    475475/** Handler for mouse events */
    476 static void mouse_events(ipc_callid_t iid, ipc_call_t *icall)
     476static void mouse_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    477477{
    478478        /* Ignore parameters, the connection is already opened */
     
    597597
    598598/** Default thread for new connections */
    599 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     599static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    600600{
    601601        console_t *cons = NULL;
     
    759759        if (client_receiver != NULL)
    760760                async_new_connection(task_hash, phone_hash, phone_hash, NULL,
    761                     client_receiver);
     761                    client_receiver, NULL);
    762762       
    763763        if (hash != NULL)
  • uspace/srv/hid/fb/ega.c

    r43ac0cc r9934f7d  
    256256}
    257257
    258 static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall)
     258static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall,
     259    void *arg)
    259260{
    260261        size_t intersize = 0;
  • uspace/srv/hid/fb/fb.c

    r43ac0cc r9934f7d  
    15761576 *
    15771577 */
    1578 static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall)
     1578static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall,
     1579    void *arg)
    15791580{
    15801581        unsigned int vp = 0;
  • uspace/srv/hid/fb/serial_console.c

    r43ac0cc r9934f7d  
    315315 * Main function of the thread serving client connections.
    316316 */
    317 void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall)
     317void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    318318{
    319319        keyfield_t *interbuf = NULL;
  • uspace/srv/hid/fb/serial_console.h

    r43ac0cc r9934f7d  
    5252extern void serial_set_scroll_region(sysarg_t);
    5353extern void serial_console_init(putc_function_t, sysarg_t, sysarg_t);
    54 extern void serial_client_connection(ipc_callid_t, ipc_call_t *);
     54extern void serial_client_connection(ipc_callid_t, ipc_call_t *, void *arg);
    5555
    5656#endif
  • uspace/srv/hid/input/ctl/kbdev.c

    r43ac0cc r9934f7d  
    5454static void kbdev_ctl_set_ind(kbd_dev_t *, unsigned);
    5555
    56 static void kbdev_callback_conn(ipc_callid_t, ipc_call_t *);
     56static void kbdev_callback_conn(ipc_callid_t, ipc_call_t *, void *arg);
    5757
    5858kbd_ctl_ops_t kbdev_ctl = {
     
    7373        int fd;
    7474} kbdev_t;
    75 
    76 /** XXX Need to pass data from async_connect_to_me() to connection handler */
    77 static kbdev_t *unprotected_kbdev;
    7875
    7976static kbdev_t *kbdev_new(kbd_dev_t *kdev)
     
    140137        }
    141138
    142         /*
    143          * XXX We need to pass kbdev to the connection handler. Since the
    144          * framework does not support this, use a global variable.
    145          * This needs to be fixed ASAP.
    146          */
    147         unprotected_kbdev = kbdev;
    148 
    149         rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn);
     139        rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn, kbdev);
    150140        if (rc != EOK) {
    151141                printf(NAME ": Failed creating callback connection from '%s'.\n",
     
    177167}
    178168
    179 static void kbdev_callback_conn(ipc_callid_t iid, ipc_call_t *icall)
     169static void kbdev_callback_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    180170{
    181171        kbdev_t *kbdev;
     
    183173        int type, key;
    184174
    185         kbdev = unprotected_kbdev;
     175        /* Kbdev device structure */
     176        kbdev = arg;
    186177
    187178        while (true) {
  • uspace/srv/hid/input/generic/input.c

    r43ac0cc r9934f7d  
    178178}
    179179
    180 static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
     180static void client_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    181181{
    182182        ipc_callid_t callid;
  • uspace/srv/hid/input/port/adb.c

    r43ac0cc r9934f7d  
    4646#include <devmap_obsolete.h>
    4747
    48 static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall);
     48static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    4949static void adb_kbd_reg0_data(uint16_t data);
    5050
     
    8282       
    8383        /* NB: The callback connection is slotted for removal */
    84         rc = async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events);
     84        rc = async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events,
     85            NULL);
    8586        if (rc != EOK) {
    8687                printf(NAME ": Failed to create callback from device\n");
     
    104105}
    105106
    106 static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall)
     107static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    107108{
    108109        /* Ignore parameters, the connection is already opened */
  • uspace/srv/hid/input/port/chardev.c

    r43ac0cc r9934f7d  
    4545#include <stdio.h>
    4646
    47 static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall);
     47static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    4848
    4949static int chardev_port_init(kbd_dev_t *);
     
    9696       
    9797        /* NB: The callback connection is slotted for removal */
    98         if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events) != 0) {
     98        if (async_obsolete_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events,
     99            NULL) != 0) {
    99100                printf(NAME ": Failed to create callback from device\n");
    100101                return -1;
     
    117118}
    118119
    119 static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall)
     120static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    120121{
    121122        /* Ignore parameters, the connection is already opened */
  • uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c

    r43ac0cc r9934f7d  
    7373static s3c24xx_ts_t *ts;
    7474
    75 static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall);
     75static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall,
     76    void *arg);
    7677static void s3c24xx_ts_irq_handler(ipc_callid_t iid, ipc_call_t *call);
    7778static void s3c24xx_ts_pen_down(s3c24xx_ts_t *ts);
     
    373374
    374375/** Handle mouse client connection. */
    375 static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall)
     376static void s3c24xx_ts_connection(ipc_callid_t iid, ipc_call_t *icall,
     377    void *arg)
    376378{
    377379        ipc_callid_t callid;
Note: See TracChangeset for help on using the changeset viewer.