Main Page | Directories | File List | Globals

adi_char.c File Reference

#include <agnix/agnix.h>
#include <agnix/adi/adi.h>
#include <agnix/memory.h>
#include <agnix/strings.h>
#include <agnix/console.h>

Include dependency graph for adi_char.c:

Go to the source code of this file.

Defines

#define MOD_NAME   "CHAR: "

Functions

int adi_chrdrv_kbd_init (void)
int adi_sysconsole_init (void)
int adi_text_display_init (void)
int __init adi_console_init (void)
int adi_register_chrdev (struct adi_chrdev_s *chrdev)
adi_chrdev_s * adi_chrdev_find_by_name (char *name)
int __init adi_chrdrv_init (void)

Variables

adi_chrdev_s adi_chrdevs [ADI_CHRDEV_MAX]


Define Documentation

#define MOD_NAME   "CHAR: "
 

Definition at line 20 of file adi_char.c.


Function Documentation

struct adi_chrdev_s* adi_chrdev_find_by_name char *  name  ) 
 

Definition at line 48 of file adi_char.c.

References adi_chrdevs, and strcmp().

Referenced by do_sys_open().

00049 {
00050     int i;
00051 
00052     for (i = 0; i < ADI_CHRDEV_MAX; i++) {
00053         if (!strcmp(adi_chrdevs[i].dev_name, name))
00054             return &adi_chrdevs[i];
00055     }
00056     
00057     return NULL;
00058 }

Here is the call graph for this function:

int __init adi_chrdrv_init void   ) 
 

Definition at line 60 of file adi_char.c.

References adi_chrdrv_kbd_init(), MOD_NAME, and printk().

Referenced by adi_drivers_init().

00061 {
00062     printk(MOD_NAME "Initializing character drivers\n");
00063 
00064     adi_chrdrv_kbd_init();
00065     
00066     return 0;
00067 }

Here is the call graph for this function:

int adi_chrdrv_kbd_init void   ) 
 

Definition at line 376 of file keyboard.c.

References install_irq(), KBD_CCMD_IFACETEST, KBD_CCMD_SELFTEST, KBD_CCMD_WRITEMODE, kbd_cmd_write(), kbd_data_read_wait(), kbd_data_write(), KBD_DCMD_ENABLE, KBD_IRQ, kbd_irq_routine, kbd_set_actions(), kbd_set_leds(), MOD_NAME, and printk().

Referenced by adi_chrdrv_init().

00377 {
00378     char data;
00379 
00380     printk(MOD_NAME "PC keyboard ... ");
00381 
00382     kbd_cmd_write(KBD_CCMD_SELFTEST);
00383     if ((data=kbd_data_read_wait()) != 0x55) {
00384         printk("Your keyboard is failed!\n");
00385         return -1;
00386     }
00387 
00388     kbd_cmd_write(KBD_CCMD_IFACETEST);
00389     if (kbd_data_read_wait() != 0x00) {
00390         printk("Your keyboard is failed!\n");
00391         return -1;
00392     }
00393 
00394     printk("ok\n");
00395 
00396     kbd_cmd_write(KBD_CCMD_WRITEMODE);
00397     kbd_data_write(0x40 | 0x20 | 0x04 | 0x01);
00398 
00399 //    kbd_data_write(KBD_DCMD_RESET);
00400     kbd_data_write(KBD_DCMD_ENABLE);
00401 
00402     kbd_set_leds(0x00);
00403 
00404     kbd_set_actions();
00405 
00406     install_irq(KBD_IRQ, &kbd_irq_routine);
00407 
00408     return 0;
00409 }

Here is the call graph for this function:

int __init adi_console_init void   ) 
 

Definition at line 28 of file adi_char.c.

References adi_sysconsole_init(), and adi_text_display_init().

Referenced by start_kernel().

00029 {
00030     adi_text_display_init();
00031     adi_sysconsole_init();
00032 
00033     return 0;
00034 }

Here is the call graph for this function:

int adi_register_chrdev struct adi_chrdev_s *  chrdev  ) 
 

Definition at line 36 of file adi_char.c.

References adi_chrdevs, and memcpy().

Referenced by register_terminal().

00037 {
00038     u8 dev_minor = chrdev->dev_nr;
00039 
00040     if (adi_chrdevs[dev_minor].dev_nr != 0)
00041         return -1;
00042 
00043     memcpy((void *)&adi_chrdevs[dev_minor], (void *)chrdev, sizeof(struct adi_chrdev_s));
00044     
00045     return 0;
00046 }

Here is the call graph for this function:

int adi_sysconsole_init void   ) 
 

Definition at line 285 of file syscons.c.

References kernel_panic(), memset(), register_terminal(), register_terminal_driver(), term_cur, term_init, term_sys, term_sys_driver, term_sys_ops, term_sys_var, and wait_list_init().

Referenced by adi_console_init().

00286 {
00287     int i;
00288 
00289     for (i = 0; i < MAX_TERMINALS; i++) {
00290         memset(&term_sys[i], 0, sizeof(struct terminal_s));
00291 
00292         INIT_LIST_HEAD(&(term_sys[i].term_list));
00293         INIT_LIST_HEAD(&(term_sys[i].term_sys_list));
00294         wait_list_init(&(term_sys[i].wait_list));
00295 
00296         term_sys[i].term_nr        = i;
00297         term_sys[i].term_var       = &term_sys_var;
00298         term_sys[i].ops            = &term_sys_ops;
00299         term_sys[i].term_active    = 0;
00300         
00301         if (register_terminal(&term_sys[i]) < 0)
00302             kernel_panic("register_terminal() error\n");       
00303 
00304         register_terminal_driver(&term_sys[i], &term_sys_driver);
00305     }
00306 
00307     term_sys[0].term_active = 1;
00308     term_cur                = 0;
00309     term_init               = 1;
00310     
00311     return 0;
00312 }

Here is the call graph for this function:

int adi_text_display_init void   ) 
 

Definition at line 48 of file textdisp.c.

References TEXT_DISP_BASE_ADDR, text_display, text_display_ops, textdisp_init(), and textdisp_putc().

Referenced by adi_console_init().

00049 {
00050     text_display_ops.init = textdisp_init;
00051     text_display_ops.putc = textdisp_putc;
00052 
00053     text_display.disp_base_addr = (char *)TEXT_DISP_BASE_ADDR;
00054     text_display.disp_size_x = 80;
00055     text_display.disp_size_y = 25;
00056     text_display.ops = &text_display_ops;
00057 
00058     textdisp_init();
00059 
00060     return 0;
00061 }

Here is the call graph for this function:


Variable Documentation

struct adi_chrdev_s adi_chrdevs[ADI_CHRDEV_MAX]
 

Definition at line 22 of file adi_char.c.

Referenced by adi_chrdev_find_by_name(), and adi_register_chrdev().

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix