~jakub/helenos/ia64-revival

« back to all changes in this revision

Viewing changes to uspace/srv/hid/adb_mouse/adb_mouse.c

  • Committer: Jakub Jermar
  • Date: 2011-04-13 14:45:41 UTC
  • mfrom: (527.1.397 main-clone)
  • Revision ID: jakub@jermar.eu-20110413144541-x0j3r1zxqhsljx1o
MergeĀ mainlineĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
/** @file
39
39
 */
40
40
 
41
 
#include <ipc/ipc.h>
42
41
#include <ipc/mouse.h>
43
42
#include <stdio.h>
44
43
#include <stdlib.h>
77
76
        char dev_path[DEVMAP_NAME_MAXLEN + 1];
78
77
        snprintf(dev_path, DEVMAP_NAME_MAXLEN, "%s/mouse", NAMESPACE);
79
78
 
80
 
        dev_handle_t dev_handle;
81
 
        if (devmap_device_register(dev_path, &dev_handle) != EOK) {
 
79
        devmap_handle_t devmap_handle;
 
80
        if (devmap_device_register(dev_path, &devmap_handle) != EOK) {
82
81
                printf(NAME ": Unable to register device %s\n", dev_path);
83
82
                return -1;
84
83
        }
97
96
        ipc_call_t call;
98
97
        int retval;
99
98
 
100
 
        ipc_answer_0(iid, EOK);
 
99
        async_answer_0(iid, EOK);
101
100
 
102
101
        while (1) {
103
102
                callid = async_get_call(&call);
104
 
                switch (IPC_GET_METHOD(call)) {
 
103
                switch (IPC_GET_IMETHOD(call)) {
105
104
                case IPC_M_PHONE_HUNGUP:
106
105
                        if (client_phone != -1) {
107
 
                                ipc_hangup(client_phone);
 
106
                                async_hangup(client_phone);
108
107
                                client_phone = -1;
109
108
                        }
110
109
 
111
 
                        ipc_answer_0(callid, EOK);
 
110
                        async_answer_0(callid, EOK);
112
111
                        return;
113
112
                case IPC_M_CONNECT_TO_ME:
114
113
                        if (client_phone != -1) {
121
120
                default:
122
121
                        retval = EINVAL;
123
122
                }
124
 
                ipc_answer_0(callid, retval);
 
123
                async_answer_0(callid, retval);
125
124
        }
126
125
}
127
126