⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyb_arc.c

📁 内核linux2.4.20,可跟rtlinux3.2打补丁 组成实时linux系统,编译内核
💻 C
字号:
/* *  linux/drivers/acorn/char/keyb_arc.c * *  Copyright (C) 2000 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * *  Acorn keyboard driver for ARM Linux. * *  The Acorn keyboard appears to have a ***very*** buggy reset protocol - *  every reset behaves differently.  We try to get round this by attempting *  a few things... */#include <linux/config.h>#include <linux/sched.h>#include <linux/interrupt.h>#include <linux/tty.h>#include <linux/tty_flip.h>#include <linux/mm.h>#include <linux/slab.h>#include <linux/ptrace.h>#include <linux/signal.h>#include <linux/timer.h>#include <linux/random.h>#include <linux/ctype.h>#include <linux/init.h>#include <linux/kbd_ll.h>#include <linux/kbd_kern.h>#include <linux/delay.h>#include <asm/bitops.h>#include <asm/keyboard.h>#include <asm/irq.h>#include <asm/hardware.h>#include <asm/hardware/ioc.h>#include "../../char/busmouse.h"extern struct tasklet_struct keyboard_tasklet;extern void kbd_reset_kdown(void);#define VERSION 108#define KBD_REPORT_ERR#define KBD_REPORT_UNKN#include <asm/io.h>#include <asm/system.h>static char kbd_txval[4];static unsigned char kbd_txhead, kbd_txtail;#define KBD_INCTXPTR(ptr) ((ptr) = ((ptr) + 1) & 3)static int kbd_id = -1;static DECLARE_WAIT_QUEUE_HEAD(kbd_waitq);#ifdef CONFIG_KBDMOUSEstatic int mousedev;#endif/* * Protocol codes to send the keyboard. */#define HRST 0xff	/* reset keyboard */#define RAK1 0xfe	/* reset response */#define RAK2 0xfd	/* reset response */#define BACK 0x3f	/* Ack for first keyboard pair */#define SMAK 0x33	/* Last data byte ack (key scanning + mouse movement scanning) */#define MACK 0x32	/* Last data byte ack (mouse movement scanning) */#define SACK 0x31	/* Last data byte ack (key scanning) */#define NACK 0x30	/* Last data byte ack (no scanning, mouse data) */#define RQMP 0x22	/* Request mouse data */#define PRST 0x21	/* nothing */#define RQID 0x20	/* Request ID */#define UP_FLAG 1#ifdef CONFIG_MAGIC_SYSRQunsigned char a5kkbd_sysrq_xlate[] = {    27,    0,    0,    0,    0,    0,    0,    0,     0,    0,    0,    0,    0,    0,    0,    0,   '`',  '1',  '2',  '3',  '4',  '5',  '6',  '7',   '8',  '9',  '0',  '-',  '=',  '

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -