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         unsigned char lockstate;        /* 3 bits */ 
  22 #define VC_SCROLLOCK    0       /* scroll-lock mode */
  23 #define VC_NUMLOCK      1       /* numeric lock mode */
  24 #define VC_CAPSLOCK     2       /* capslock mode */
  25 
  26 
  27         unsigned char modeflags;
  28 #define VC_APPLIC       0       /* application key mode */
  29 #define VC_CKMODE       1       /* cursor key mode */
  30 #define VC_REPEAT       2       /* keyboard repeat */
  31 #define VC_CRLF         3       /* 0 - enter sends CR, 1 - enter sends CRLF */
  32 #define VC_META         4       /* 0 - meta, 1 - meta=prefix with ESC */
  33 #define VC_PAUSE        5       /* pause key pressed - unused */
  34 #define VC_RAW          6       /* raw (scancode) mode */
  35 #define VC_MEDIUMRAW    7       /* medium raw (keycode) mode */
  36 };
  37 
  38 extern struct kbd_struct kbd_table[];
  39 
  40 
  41 extern unsigned long kbd_init(unsigned long);
  42 
  43 extern inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  44 {
  45         return ((kbd->ledstate >> flag) & 1);
  46 }
  47 
  48 extern inline int vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  49 {
  50         return ((kbd->lockstate >> flag) & 1);
  51 }
  52 
  53 extern inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  54 {
  55         return ((kbd->modeflags >> flag) & 1);
  56 }
  57 
  58 extern inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  59 {
  60         kbd->ledstate |= 1 << flag;
  61 }
  62 
  63 extern inline void set_vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  64 {
  65         kbd->lockstate |= 1 << flag;
  66 }
  67 
  68 extern inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  69 {
  70         kbd->modeflags |= 1 << flag;
  71 }
  72 
  73 extern inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  74 {
  75         kbd->ledstate &= ~(1 << flag);
  76 }
  77 
  78 extern inline void clr_vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  79 {
  80         kbd->lockstate &= ~(1 << flag);
  81 }
  82 
  83 extern inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  84 {
  85         kbd->modeflags &= ~(1 << flag);
  86 }
  87 
  88 extern inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  89 {
  90         kbd->ledstate ^= 1 << flag;
  91 }
  92 
  93 extern inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  94 {
  95         kbd->lockstate ^= 1 << flag;
  96 }
  97 
  98 extern inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
     /* [previous][next][first][last][top][bottom][index][help] */
  99 {
 100         kbd->modeflags ^= 1 << flag;
 101 }
 102 
 103 #endif

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