Changes in uspace/srv/hid/console/console.c [a2a3763:103ae7f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
ra2a3763 r103ae7f8 57 57 #include <io/style.h> 58 58 #include <io/screenbuffer.h> 59 #include <inttypes.h>60 59 61 60 #include "console.h" … … 68 67 /** Interval for checking for new keyboard (1/4s). */ 69 68 #define HOTPLUG_WATCH_INTERVAL (1000 * 250) 70 71 /* Kernel defines 32 but does not export it. */72 #define MAX_IPC_OUTGOING_PHONES 12873 /** To allow proper phone closing. */74 static ipc_callid_t driver_phones[MAX_IPC_OUTGOING_PHONES] = { 0 };75 69 76 70 /** Phone to the keyboard driver. */ … … 96 90 contents and related settings. */ 97 91 } console_t; 98 99 100 92 101 93 /** Array of data for virtual consoles */ … … 409 401 } 410 402 411 static void close_driver_phone(ipc_callid_t hash)412 {413 int i;414 for (i = 0; i < MAX_IPC_OUTGOING_PHONES; i++) {415 if (driver_phones[i] == hash) {416 printf("Device %" PRIxn " gone.\n", hash);417 driver_phones[i] = 0;418 async_hangup(i);419 return;420 }421 }422 }423 424 403 /** Handler for keyboard */ 425 404 static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall) … … 436 415 case IPC_M_PHONE_HUNGUP: 437 416 /* TODO: Handle hangup */ 438 close_driver_phone(iid);439 417 return; 440 418 case KBD_EVENT: … … 480 458 case IPC_M_PHONE_HUNGUP: 481 459 /* TODO: Handle hangup */ 482 close_driver_phone(iid);483 460 return; 484 461 case MEVENT_BUTTON: … … 738 715 } 739 716 740 static int async_connect_to_me_hack(int phone, sysarg_t arg1, sysarg_t arg2,741 sysarg_t arg3, async_client_conn_t client_receiver, ipc_callid_t *hash)742 {743 sysarg_t task_hash;744 sysarg_t phone_hash;745 int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3,746 NULL, NULL, NULL, &task_hash, &phone_hash);747 if (rc != EOK)748 return rc;749 750 if (client_receiver != NULL)751 async_new_connection(task_hash, phone_hash, phone_hash, NULL,752 client_receiver);753 754 if (hash != NULL) {755 *hash = phone_hash;756 }757 758 return EOK;759 }760 761 717 static int connect_keyboard_or_mouse(const char *devname, 762 718 async_client_conn_t handler, const char *path) … … 773 729 } 774 730 775 ipc_callid_t hash; 776 int rc = async_connect_to_me_hack(phone, SERVICE_CONSOLE, 0, phone, 777 handler, &hash); 731 int rc = async_connect_to_me(phone, SERVICE_CONSOLE, 0, 0, handler); 778 732 if (rc != EOK) { 779 733 printf(NAME ": " \ … … 783 737 } 784 738 785 driver_phones[phone] = hash; 786 787 printf(NAME ": found %s \"%s\" (%" PRIxn ").\n", devname, path, hash); 739 printf(NAME ": found %s \"%s\".\n", devname, path); 788 740 789 741 return phone;
Note:
See TracChangeset
for help on using the changeset viewer.