Lines Matching full:console

101 /* Structure that defines a single console.
104 * The actual usable size of each console is console_buf_size -1;
423 struct octeon_console *console; in octeon_console_handle_result() local
425 console = &oct->console[console_num]; in octeon_console_handle_result()
427 console->waiting = 0; in octeon_console_handle_result()
433 struct octeon_console *console, in output_console_line() argument
450 * having been read from the console). in output_console_line()
454 if (console->leftover[0] && in output_console_line()
455 (line != console->leftover)) { in output_console_line()
456 if (console->print) in output_console_line()
457 (*console->print)(oct, (u32)console_num, in output_console_line()
458 console->leftover, in output_console_line()
460 console->leftover[0] = '\0'; in output_console_line()
462 if (console->print) in output_console_line()
463 (*console->print)(oct, (u32)console_num, in output_console_line()
473 len = strlen(console->leftover); in output_console_line()
474 strncpy(&console->leftover[len], line, in output_console_line()
475 sizeof(console->leftover) - len); in output_console_line()
483 struct octeon_console *console; in check_console() local
489 console = &oct->console[console_num]; in check_console()
494 /* Take console output regardless of whether it will in check_console()
502 if (console->waiting) in check_console()
504 if (console->print) { in check_console()
505 output_console_line(oct, console, console_num, in check_console()
509 dev_err(&oct->pci_dev->dev, "Error reading console %u, ret=%d\n", in check_console()
516 /* If nothing is read after polling the console, in check_console()
519 if (console->print && (total_read == 0) && in check_console()
520 (console->leftover[0])) { in check_console()
522 len = strlen(console->leftover); in check_console()
523 console->leftover[len] = '\n'; in check_console()
524 output_console_line(oct, console, console_num, in check_console()
525 console->leftover, (s32)(len + 1)); in check_console()
526 console->leftover[0] = '\0'; in check_console()
548 dev_err(&oct->pci_dev->dev, "Could not find console '%s'\n", in octeon_init_consoles()
554 * mapping to a region of Octeon DRAM that contains the PCI console in octeon_init_consoles()
580 struct octeon_console *console; in octeon_get_uboot_version() local
601 console = &oct->console[console_num]; in octeon_get_uboot_version()
606 /* Take console output regardless of whether it will in octeon_get_uboot_version()
618 if (console->waiting) in octeon_get_uboot_version()
621 dev_err(&oct->pci_dev->dev, "Error reading console %u, ret=%d\n", in octeon_get_uboot_version()
628 /* If nothing is read after polling the console, in octeon_get_uboot_version()
631 if ((total_read == 0) && (console->leftover[0])) { in octeon_get_uboot_version()
633 console_num, console->leftover); in octeon_get_uboot_version()
634 console->leftover[0] = '\0'; in octeon_get_uboot_version()
660 struct octeon_console *console; in octeon_add_console() local
664 "trying to read from console number %d when only 0 to %d exist\n", in octeon_add_console()
667 console = &oct->console[console_num]; in octeon_add_console()
669 console->waiting = 0; in octeon_add_console()
674 console->addr = octeon_read_device_mem64(oct, coreaddr); in octeon_add_console()
675 coreaddr = console->addr + offsetof(struct octeon_pci_console, in octeon_add_console()
677 console->buffer_size = octeon_read_device_mem32(oct, coreaddr); in octeon_add_console()
678 coreaddr = console->addr + offsetof(struct octeon_pci_console, in octeon_add_console()
680 console->input_base_addr = in octeon_add_console()
682 coreaddr = console->addr + offsetof(struct octeon_pci_console, in octeon_add_console()
684 console->output_base_addr = in octeon_add_console()
686 console->leftover[0] = '\0'; in octeon_add_console()
698 /* an empty string means use default debug console enablement */ in octeon_add_console()
704 console->active = 1; in octeon_add_console()
718 struct octeon_console *console; in octeon_remove_consoles() local
721 console = &oct->console[i]; in octeon_remove_consoles()
723 if (!console->active) in octeon_remove_consoles()
728 console->addr = 0; in octeon_remove_consoles()
729 console->buffer_size = 0; in octeon_remove_consoles()
730 console->input_base_addr = 0; in octeon_remove_consoles()
731 console->output_base_addr = 0; in octeon_remove_consoles()
763 struct octeon_console *console; in octeon_console_read() local
766 dev_err(&oct->pci_dev->dev, "Attempted to read from disabled console %d\n", in octeon_console_read()
771 console = &oct->console[console_num]; in octeon_console_read()
776 rd_idx = octeon_read_device_mem32(oct, console->addr + in octeon_console_read()
778 wr_idx = octeon_read_device_mem32(oct, console->addr + in octeon_console_read()
781 bytes_to_read = octeon_console_avail_bytes(console->buffer_size, in octeon_console_read()
791 if (rd_idx + bytes_to_read >= console->buffer_size) in octeon_console_read()
792 bytes_to_read = console->buffer_size - rd_idx; in octeon_console_read()
794 octeon_pci_read_core_mem(oct, console->output_base_addr + rd_idx, in octeon_console_read()
796 octeon_write_device_mem32(oct, console->addr + in octeon_console_read()
800 console->buffer_size); in octeon_console_read()