]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Bus/Usb/UsbKb/Dxe/keyboard.c
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / EdkModulePkg / Bus / Usb / UsbKb / Dxe / keyboard.c
index 1328e6a0983b1acdc9754d8055792c6f789e5e14..79eded33c3c0ec0bd685746efb0e2343c7e6daa0 100644 (file)
@@ -210,9 +210,6 @@ InitUSBKeyboard (
   UINT8               Duration;\r
   EFI_STATUS          Status;\r
   UINT32              TransferResult;\r
-  EFI_USB_IO_PROTOCOL *UsbIo;\r
-\r
-  UsbIo = UsbKeyboardDevice->UsbIo;\r
 \r
   KbdReportStatusCode (\r
     UsbKeyboardDevice->DevicePath,\r
@@ -360,19 +357,16 @@ KeyboardHandler (
   UINT8               Index;\r
   UINT8               Index2;\r
   BOOLEAN             Down;\r
-  EFI_STATUS          Status;\r
   BOOLEAN             KeyRelease;\r
   BOOLEAN             KeyPress;\r
   UINT8               SavedTail;\r
   USB_KEY             UsbKey;\r
   UINT8               NewRepeatKey;\r
   UINT32              UsbStatus;\r
-  UINT8               *DataPtr;\r
 \r
   ASSERT (Context);\r
 \r
   NewRepeatKey      = 0;\r
-  DataPtr           = (UINT8 *) Data;\r
   UsbKeyboardDevice = (USB_KB_DEV *) Context;\r
   UsbIo             = UsbKeyboardDevice->UsbIo;\r
 \r
@@ -412,15 +406,15 @@ KeyboardHandler (
     // Delete & Submit this interrupt again\r
     //\r
     \r
-    Status = UsbIo->UsbAsyncInterruptTransfer (\r
-                      UsbIo,\r
-                      UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,\r
-                      FALSE,\r
-                      0,\r
-                      0,\r
-                      NULL,\r
-                      NULL\r
-                      );\r
+    UsbIo->UsbAsyncInterruptTransfer (\r
+             UsbIo,\r
+             UsbKeyboardDevice->IntEndpointDescriptor.EndpointAddress,\r
+             FALSE,\r
+             0,\r
+             0,\r
+             NULL,\r
+             NULL\r
+             );\r
 \r
     gBS->SetTimer (\r
           UsbKeyboardDevice->DelayedRecoveryEvent,\r
@@ -761,9 +755,13 @@ USBParseKey (
     // fall through\r
     //\r
     case 0x47:\r
-    //\r
-    // fall through\r
-    //\r
+         //\r
+           // Turn on the ScrollLock light on KB\r
+           //\r
+      UsbKeyboardDevice->ScrollOn ^= 1;\r
+      SetKeyLED (UsbKeyboardDevice);\r
+      continue;\r
+      break;    \r
     case 0x48:\r
     //\r
     // fall through\r
@@ -1042,6 +1040,7 @@ SetKeyLED (
   //\r
   Led.NumLock   = (UINT8) UsbKeyboardDevice->NumLockOn;\r
   Led.CapsLock  = (UINT8) UsbKeyboardDevice->CapsOn;\r
+  Led.ScrollLock = (UINT8) UsbKeyboardDevice->ScrollOn;  \r
   Led.Resrvd    = 0;\r
 \r
   ReportId      = 0;\r