[1c0b8d7] | 1 | /* |
---|
[014292a1] | 2 | * This file is an extension of the generic console driver |
---|
[1c0b8d7] | 3 | * shell used by all console drivers using libchip, it contains |
---|
| 4 | * the console_control routine, This bsp needs its own version |
---|
| 5 | * of this method to handle the keyboard and mouse as a single |
---|
| 6 | * device. |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | /* |
---|
| 10 | * COPYRIGHT (c) 1989-2011. |
---|
| 11 | * On-Line Applications Research Corporation (OAR). |
---|
| 12 | * |
---|
| 13 | * The license and distribution terms for this file may be |
---|
| 14 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 15 | * http://www.rtems.org/license/LICENSE. |
---|
[1c0b8d7] | 16 | */ |
---|
| 17 | |
---|
| 18 | #include <bsp.h> |
---|
| 19 | #include <stdlib.h> |
---|
| 20 | #include <assert.h> |
---|
| 21 | #include <termios.h> |
---|
[578d839] | 22 | #include <rtems/libio.h> |
---|
| 23 | #include <rtems/console.h> |
---|
[1c0b8d7] | 24 | |
---|
| 25 | #include <bsp/irq.h> |
---|
| 26 | |
---|
| 27 | #include <rtems/termiostypes.h> |
---|
| 28 | #include <libchip/serial.h> |
---|
| 29 | #include <rtems/mouse_parser.h> |
---|
[607c854] | 30 | #if BSP_ENABLE_VGA |
---|
[1efd148b] | 31 | #include <rtems/keyboard.h> |
---|
[607c854] | 32 | #endif |
---|
[b43ea9f] | 33 | #include "../../../../../../../bsps/shared/dev/serial/legacy-console.h" |
---|
[1c0b8d7] | 34 | |
---|
| 35 | /* |
---|
| 36 | * console_control |
---|
| 37 | * |
---|
| 38 | * this routine uses the termios driver to process io |
---|
| 39 | */ |
---|
| 40 | rtems_device_driver console_control( |
---|
| 41 | rtems_device_major_number major, |
---|
| 42 | rtems_device_minor_number minor, |
---|
| 43 | void * arg |
---|
| 44 | ) |
---|
| 45 | { |
---|
[607c854] | 46 | #if BSP_ENABLE_VGA |
---|
[014292a1] | 47 | if (minor == 0) { |
---|
| 48 | rtems_libio_ioctl_args_t *args = arg; |
---|
[1c0b8d7] | 49 | |
---|
[014292a1] | 50 | switch (args->command) { |
---|
| 51 | default: |
---|
| 52 | if( vt_ioctl( args->command, (unsigned long)args->buffer ) != 0 ) |
---|
| 53 | return rtems_termios_ioctl (arg); |
---|
| 54 | break; |
---|
[1c0b8d7] | 55 | |
---|
[014292a1] | 56 | case MW_UID_REGISTER_DEVICE: |
---|
[1503c1c3] | 57 | printk( "SerialMouse: reg=%s\n", (const char*) args->buffer ); |
---|
[014292a1] | 58 | register_kbd_msg_queue( args->buffer, 0 ); |
---|
| 59 | break; |
---|
[1c0b8d7] | 60 | |
---|
[014292a1] | 61 | case MW_UID_UNREGISTER_DEVICE: |
---|
| 62 | unregister_kbd_msg_queue( 0 ); |
---|
| 63 | break; |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | args->ioctl_return = 0; |
---|
| 67 | return RTEMS_SUCCESSFUL; |
---|
[1c0b8d7] | 68 | } |
---|
[607c854] | 69 | #endif |
---|
[014292a1] | 70 | return rtems_termios_ioctl (arg); |
---|
[1c0b8d7] | 71 | } |
---|