Changeset 9934f7d in mainline for uspace/srv/hid/input/ctl/kbdev.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) {
Note: See TracChangeset for help on using the changeset viewer.