root/drivers/char/kbd_kern.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. vc_kbd_led
  2. vc_kbd_lock
  3. vc_kbd_mode
  4. set_vc_kbd_led
  5. set_vc_kbd_lock
  6. set_vc_kbd_mode
  7. clr_vc_kbd_led
  8. clr_vc_kbd_lock
  9. clr_vc_kbd_mode
  10. chg_vc_kbd_led
  11. chg_vc_kbd_lock
  12. chg_vc_kbd_mode

   1 #ifndef _KBD_KERN_H
   2 #define _KBD_KERN_H
   3 
   4 #include <linux/interrupt.h>
   5 #define set_leds() mark_bh(KEYBOARD_BH)
   6 
   7 #include <linux/keyboard.h>
   8 
   9 /*
  10  * kbd->xxx contains the VC-local things (flag settings etc..)
  11  *
  12  * Note: externally visible are LED_SCR, LED_NUM, LED_CAP defined in kd.h
  13  *       The code in KDGETLED / KDSETLED depends on the internal and
  14  *       external order being the same.
  15  *
  16  * Note: lockstate is used as index in the array key_map.
  17  */
  18 struct kbd_struct {
  19         unsigned char ledstate;         /* 3 bits */
  20         unsigned char default_ledstate;
  21 #define VC_SCROLLOCK    0       /* scroll-lock mode */
  22 #define VC_NUMLOCK      1       /* numeric lock mode */
  23 #define VC_CAPSLOCK     2       /* capslock mode */
  24 
  25         unsigned char lockstate;        /* 4 bits - must be in 0..15 */
  26 #define VC_SHIFTLOCK    KG_SHIFT        /* shift lock mode */
  27 #define VC_ALTGRLOCK    KG_ALTGR        /* altgr lock mode */
  28 #define VC_CTRLLOCK     KG_CTRL         /* control lock mode */
  29 #define VC_ALTLOCK      KG_ALT          /* alt lock mode */
  30 
  31         unsigned char modeflags;
  32 #define VC_APPLIC       0       /* application key mode */
  33 #define VC_CKMODE       1       /* cursor key mode */
  34 #define VC_REPEAT       2       /* keyboard repeat */
  35 #define VC_CRLF         3       /* 0 - enter sends CR, 1 - enter sends CRLF */
  36 #define VC_META         4       /* 0 - meta, 1 - meta=prefix with ESC */
  37 #define VC_PAUSE        5       /* pause key pressed - unused */
  38 #define VC_RAW          6       /* raw (scancode) mode */
  39 #define VC_MEDIUMRAW    7       /* medium raw (keycode) mode */
  40 };
  41 
  42 extern struct kbd_struct kbd_table[];
  43 
  44 
  45 extern unsigned long kbd_init(unsigned long);
  46 
  47 extern inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  48 {
  49         return ((kbd->ledstate >> flag) & 1);
  50 }
  51 
  52 extern inline int vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  53 {
  54         return ((kbd->lockstate >> flag) & 1);
  55 }
  56 
  57 extern inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  58 {
  59         return ((kbd->modeflags >> flag) & 1);
  60 }
  61 
  62 extern inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  63 {
  64         kbd->ledstate |= 1 << flag;
  65 }
  66 
  67 extern inline void set_vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  68 {
  69         kbd->lockstate |= 1 << flag;
  70 }
  71 
  72 extern inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  73 {
  74         kbd->modeflags |= 1 << flag;
  75 }
  76 
  77 extern inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  78 {
  79         kbd->ledstate &= ~(1 << flag);
  80 }
  81 
  82 extern inline void clr_vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  83 {
  84         kbd->lockstate &= ~(1 << flag);
  85 }
  86 
  87 extern inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  88 {
  89         kbd->modeflags &= ~(1 << flag);
  90 }
  91 
  92 extern inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  93 {
  94         kbd->ledstate ^= 1 << flag;
  95 }
  96 
  97 extern inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  98 {
  99         kbd->lockstate ^= 1 << flag;
 100 }
 101 
 102 extern inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
 103 {
 104         kbd->modeflags ^= 1 << flag;
 105 }
 106 
 107 #endif

/* [previous][next][first][last][top][bottom][index][help] */