patch-2.2.18 linux/drivers/usb/mkmap
Next file: linux/drivers/usb/mouse.c
Previous file: linux/drivers/usb/microtek.h
Back to the patch index
Back to the overall index
- Lines: 84
- Date:
Thu Jan 1 01:00:00 1970
- Orig file:
v2.2.17/drivers/usb/mkmap
- Orig date:
Fri Apr 21 12:46:37 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/usb/mkmap linux/drivers/usb/mkmap
@@ -1,83 +0,0 @@
-#!/usr/bin/perl
-
-($ME = $0) =~ s|.*/||;
-
-$file = "maps/serial.map";
-$line = 1;
-open(PC, $file) || die("$!");
-while(<PC>)
-{
- if(/^\s*keycode\s+(\d+)\s*=\s*(\S+)/)
- {
- my($idx) = int($1);
- my($sym) = $2;
- if(defined($map{uc($sym)}))
- {
- # print STDERR "$file:$line: warning: `$sym' redefined\n";
- }
- $map{uc($sym)} = $idx;
- }
- $line++;
-}
-close(PC);
-
-$file = "maps/fixup.map";
-$line = 1;
-open(FIXUP, $file) || die("$!");
-while(<FIXUP>)
-{
- if(/^\s*keycode\s+(\d+)\s*=\s*/)
- {
- my($idx) = int($1);
- for $sym (split(/\s+/, $'))
- {
- $map{uc($sym)} = $idx;
- }
- }
- $line++;
-}
-close(FIXUP);
-
-$file = "maps/usb.map";
-$line = 1;
-open(USB, $file) || die("$!");
-while(<USB>)
-{
- if(/^\s*keycode\s+(\d+)\s*=\s*/)
- {
- my($idx) = int($1);
- for $sym (split(/\s+/, $'))
- {
- my($val) = $map{uc($sym)};
- $map[$idx] = $val;
- if(!defined($val))
- {
- print STDERR "$file:$line: warning: `$sym' undefined\n";
- }
- else
- {
- last;
- }
- }
- }
- $line++;
-}
-close(USB);
-
-print "unsigned char usb_kbd_map[256] = \n{\n";
-for($x = 0; $x < 32; $x++)
-{
- if($x && !($x % 2))
- {
- print "\n";
- }
- print " ";
- for($y = 0; $y < 8; $y++)
- {
- my($idx) = $x * 8 + $y;
- print sprintf(" 0x%02x,",
- int(defined($map[$idx]) ? $map[$idx]:0));
- }
- print "\n";
-}
-print "};\n";
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)