Changes in uspace/srv/hw/char/i8042/i8042.c [ffa2c8ef:d9fae235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/char/i8042/i8042.c
rffa2c8ef rd9fae235 40 40 #include <libarch/ddi.h> 41 41 #include <devmap.h> 42 #include <ipc/ipc.h> 42 43 #include <async.h> 43 44 #include <unistd.h> … … 45 46 #include <stdio.h> 46 47 #include <errno.h> 47 #include <inttypes.h>48 48 49 49 #include "i8042.h" … … 145 145 146 146 snprintf(name, 16, "%s/ps2%c", NAMESPACE, dchar[i]); 147 rc = devmap_device_register(name, &i8042_port[i].dev map_handle);147 rc = devmap_device_register(name, &i8042_port[i].dev_handle); 148 148 if (rc != EOK) { 149 devmap_hangup_phone(DEVMAP_DRIVER); 149 150 printf(NAME ": Unable to register device %s.\n", name); 150 151 return rc; … … 198 199 i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status; 199 200 i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data; 200 register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd); 201 register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd); 202 printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n", 203 NAME, inr_a, inr_b); 201 ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd); 202 ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd); 203 printf("%s: registered for interrupts %d and %d\n", NAME, inr_a, inr_b); 204 204 205 205 wait_ready(); … … 217 217 ipc_callid_t callid; 218 218 ipc_call_t call; 219 sysarg_t method;220 dev map_handle_t dh;219 ipcarg_t method; 220 dev_handle_t dh; 221 221 int retval; 222 222 int dev_id, i; … … 230 230 dev_id = -1; 231 231 for (i = 0; i < MAX_DEVS; i++) { 232 if (i8042_port[i].dev map_handle == dh)232 if (i8042_port[i].dev_handle == dh) 233 233 dev_id = i; 234 234 } 235 235 236 236 if (dev_id < 0) { 237 async_answer_0(iid, EINVAL);237 ipc_answer_0(iid, EINVAL); 238 238 return; 239 239 } 240 240 241 241 /* Answer the IPC_M_CONNECT_ME_TO call. */ 242 async_answer_0(iid, EOK);242 ipc_answer_0(iid, EOK); 243 243 244 244 printf(NAME ": accepted connection\n"); … … 246 246 while (1) { 247 247 callid = async_get_call(&call); 248 method = IPC_GET_ IMETHOD(call);248 method = IPC_GET_METHOD(call); 249 249 switch (method) { 250 250 case IPC_M_PHONE_HUNGUP: 251 251 /* The other side has hung up. */ 252 async_answer_0(callid, EOK);252 ipc_answer_0(callid, EOK); 253 253 return; 254 254 case IPC_M_CONNECT_TO_ME: … … 262 262 break; 263 263 case IPC_FIRST_USER_METHOD: 264 printf(NAME ": write % " PRIun "to devid %d\n",264 printf(NAME ": write %d to devid %d\n", 265 265 IPC_GET_ARG1(call), dev_id); 266 266 i8042_port_write(dev_id, IPC_GET_ARG1(call)); … … 271 271 break; 272 272 } 273 async_answer_0(callid, retval);273 ipc_answer_0(callid, retval); 274 274 } 275 275 }
Note:
See TracChangeset
for help on using the changeset viewer.