vt: add the framework for reporting the keyboard map and VT size
authorAlan Cox <alan@linux.intel.com>
Tue, 30 Dec 2014 19:04:17 +0000 (19:04 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 30 Dec 2014 19:04:17 +0000 (19:04 +0000)
Kernel/include/vt.h
Kernel/vt.c

index 709bed0..4968769 100644 (file)
@@ -3,6 +3,10 @@
 
 /* Optional defines */
 
+#ifndef MAX_VT
+#define MAX_VT 1
+#endif
+
 #ifndef VT_MAP_CHAR
 #define VT_MAP_CHAR(x)         (x)
 #endif
@@ -33,5 +37,6 @@ void scroll_up(void);
 void scroll_down(void);
 void plot_char(int8_t y, int8_t x, uint16_t c);
 void do_beep(void);
+int vt_ioctl(uint8_t minor, uint16_t op, char *ptr);
 
 #endif
\ No newline at end of file
index 71353f9..2a58d65 100644 (file)
@@ -1,4 +1,5 @@
 #include <kernel.h>
+#include <tty.h>
 #include <vt.h>
 #include <devtty.h>
 
@@ -182,6 +183,24 @@ void vtoutput(unsigned char *p, unsigned int len)
        cursor_on(cursory, cursorx);
 }
 
+int vt_ioctl(uint8_t minor, uint16_t request, char *data)
+{
+       /* FIXME: need to address the multiple vt switching case
+          here.. probably need to switch vt */
+       if (minor <= MAX_VT) {
+               switch(request) {
+                       case KBMAPSIZE:
+                               return KEY_ROWS << 8 | KEY_COLS;
+                       case KBMAPGET:
+                               return uput(keymap, data, sizeof(keymap));
+                       case VTSIZE:
+                               return VT_HEIGHT << 8 | VT_WIDTH;
+               }
+       }
+       return tty_ioctl(minor, request, data);
+}
+
+
 void vtinit(void)
 {
        vtmode = 0;