Changes in uspace/srv/hid/kbd/generic/kbd.c [57d129e:d9fae235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/kbd/generic/kbd.c
r57d129e rd9fae235 36 36 */ 37 37 38 #include <ipc/ipc.h> 38 39 #include <ipc/services.h> 39 40 #include <ipc/kbd.h> … … 67 68 static unsigned lock_keys; 68 69 69 bool irc_service = false;70 int irc_phone = -1;70 int cir_service = 0; 71 int cir_phone = -1; 71 72 72 73 #define NUM_LAYOUTS 3 … … 172 173 int retval; 173 174 174 async_answer_0(iid, EOK);175 ipc_answer_0(iid, EOK); 175 176 176 177 while (1) { 177 178 callid = async_get_call(&call); 178 switch (IPC_GET_ IMETHOD(call)) {179 switch (IPC_GET_METHOD(call)) { 179 180 case IPC_M_PHONE_HUNGUP: 180 181 if (client_phone != -1) { 181 async_hangup(client_phone);182 ipc_hangup(client_phone); 182 183 client_phone = -1; 183 184 } 184 185 185 async_answer_0(callid, EOK);186 ipc_answer_0(callid, EOK); 186 187 return; 187 188 case IPC_M_CONNECT_TO_ME: … … 204 205 retval = EINVAL; 205 206 } 206 async_answer_0(callid, retval);207 ipc_answer_0(callid, retval); 207 208 } 208 209 } … … 216 217 sysarg_t obio; 217 218 218 if (((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 219 || ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio))) 220 irc_service = true; 221 222 if (irc_service) { 223 while (irc_phone < 0) 224 irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0); 219 if ((sysinfo_get_value("kbd.cir.fhc", &fhc) == EOK) && (fhc)) 220 cir_service = SERVICE_FHC; 221 else if ((sysinfo_get_value("kbd.cir.obio", &obio) == EOK) && (obio)) 222 cir_service = SERVICE_OBIO; 223 224 if (cir_service) { 225 while (cir_phone < 0) { 226 cir_phone = ipc_connect_me_to_blocking(PHONE_NS, cir_service, 227 0, 0); 228 } 225 229 } 226 230 … … 246 250 snprintf(kbd, DEVMAP_NAME_MAXLEN, "%s/%s", NAMESPACE, NAME); 247 251 248 dev map_handle_t devmap_handle;249 if (devmap_device_register(kbd, &dev map_handle) != EOK) {252 dev_handle_t dev_handle; 253 if (devmap_device_register(kbd, &dev_handle) != EOK) { 250 254 printf("%s: Unable to register device %s\n", NAME, kbd); 251 255 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.