Changeset a79b42a in mainline
- Timestamp:
- 2016-12-24T13:23:30Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3b3faf51
- Parents:
- 00130656
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/input.c
r00130656 ra79b42a 95 95 static bool active = true; 96 96 97 /** Serial console specified by the user */ 98 static char *serial_console; 99 97 100 /** List of keyboard devices */ 98 101 static list_t kbd_devs; … … 580 583 static int serial_add_srldev(service_id_t service_id, serial_dev_t **sdevp) 581 584 { 585 bool match = false; 586 582 587 serial_dev_t *sdev = serial_dev_new(); 583 588 if (sdev == NULL) … … 585 590 586 591 sdev->kdev->svc_id = service_id; 587 sdev->kdev->port_ops = NULL; 588 sdev->kdev->ctl_ops = &stty_ctl; 589 590 sdev->sess = loc_service_connect(service_id, INTERFACE_DDF, 591 IPC_FLAG_BLOCKING); 592 592 593 593 int rc = loc_service_get_name(service_id, &sdev->kdev->svc_name); 594 if (rc != EOK) { 595 sdev->kdev->svc_name = NULL; 594 if (rc != EOK) 596 595 goto fail; 597 } 598 599 /* Initialize controller driver. */ 600 if ((*sdev->kdev->ctl_ops->init)(sdev->kdev) != 0) { 601 goto fail; 602 } 603 596 604 597 list_append(&sdev->link, &serial_devs); 605 598 606 fid_t fid = fibril_create(serial_consumer, sdev); 607 fibril_add_ready(fid); 599 /* 600 * Is this the device the user wants to use as a serial console? 601 */ 602 match = (serial_console != NULL) && 603 !str_cmp(serial_console, sdev->kdev->svc_name); 604 605 if (match) { 606 sdev->kdev->ctl_ops = &stty_ctl; 607 608 /* Initialize controller driver. */ 609 if ((*sdev->kdev->ctl_ops->init)(sdev->kdev) != 0) { 610 list_remove(&sdev->link); 611 goto fail; 612 } 613 614 sdev->sess = loc_service_connect(service_id, INTERFACE_DDF, 615 IPC_FLAG_BLOCKING); 616 617 fid_t fid = fibril_create(serial_consumer, sdev); 618 fibril_add_ready(fid); 619 } 608 620 609 621 *sdevp = sdev; … … 866 878 int main(int argc, char **argv) 867 879 { 880 int rc; 881 868 882 if (argc < 2) { 869 883 usage(argv[0]); … … 888 902 INTERFACE_IRC, 0); 889 903 } 904 905 char *boot_args; 906 size_t size; 907 908 boot_args = sysinfo_get_data("boot_args", &size); 909 if (boot_args && size) { 910 char *args = boot_args; 911 char *arg; 912 #define ARG_CONSOLE "console=" 913 while ((arg = str_tok(args, " ", &args)) != NULL) { 914 if (!str_lcmp(arg, ARG_CONSOLE, 915 str_length(ARG_CONSOLE))) { 916 serial_console = arg + str_length(ARG_CONSOLE); 917 break; 918 } 919 } 920 } 890 921 891 922 /* Add legacy keyboard devices. */ … … 900 931 async_set_fallback_port_handler(client_connection, NULL); 901 932 902 intrc = loc_server_register(NAME);933 rc = loc_server_register(NAME); 903 934 if (rc != EOK) { 904 935 printf("%s: Unable to register server\n", NAME);
Note:
See TracChangeset
for help on using the changeset viewer.