/* ** ext_getch() ** ** A getch() work-alike for use with extended keyboards. ** ** Parameters: none ** ** Returns: Extended key code as follows: ** 0->255 Normal key ** 256->511 Numeric pad key or Function key ** 512->767 Cursor pad key or Numeric pad ** "duplicate" key (Enter, /, *, -, +) ** ** Original Copyright 1992 by Bob Stout as part of ** the MicroFirm Function Library (MFL) ** ** This subset version is hereby donated to the public domain. */ #include #include #define LoByte(x) ((unsigned char)((x) & 0xff)) #define HiByte(x) ((unsigned char)((unsigned short)(x) >> 8)) int ext_getch(void) { int key; union REGS regs; regs.h.ah = 0x10; int86(0x16, ®s, ®s); key = regs.x.ax; switch (LoByte(key)) { case 0: key = HiByte(key) + 256; break; case 0xe0: key = HiByte(key) + 512; break; default: if (0xe0 == HiByte(key)) key = LoByte(key) + 512; else { if (ispunct(LoByte(key)) && HiByte(key) > 0x36) key = LoByte(key) + 512; else key = LoByte(key); } } return key; } t-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-10-20 15:44:19 +0200
committerTobias Klauser <tklauser@distanz.ch>2017-02-15 10:34:18 +0100
commit5db4992d8f040b8d8db0b86d42806e0c417f7ccf (patch)
tree5b06e952af482d45f3ade64e77824662e34b7fa2 /drivers/usb/misc/Makefile
parent370ebb0ef6255132373ed35d13e7b1d8d2eb7003 (diff)
usbnet: pegasus: Use net_device_stats from struct net_devicends-private-remove
Instead of using a private copy of struct net_device_stats in struct pegasus, use stats from struct net_device. Also remove the now unnecessary .ndo_get_stats function. Cc: Petko Manolov <petkan@nucleusys.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'drivers/usb/misc/Makefile')