~ubuntu-branches/ubuntu/precise/seabios/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/0011-Document-usb-hid.c-functions.patch

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2010-06-29 10:42:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100629104246-9fhu2qksk0lrsln0
Tags: 0.6.0-0ubuntu1
* Merge 0.6.0 release
  * also add all the patches from git which are included in qemu since
    May 11 (per qemu commit 14ac15d3ac8e0ef1c91204e2ac772b6412a6b99e)
  * plus the two next git patches, which are also needed for (LP: #598649)
* switched to dpkg-source 3.0 (quilt) format
* add a watch file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 5718d5662d33355403e7aa62227acecac1755a4f Mon Sep 17 00:00:00 2001
 
2
From: Kevin O'Connor <kevin@koconnor.net>
 
3
Date: Sat, 1 May 2010 19:25:41 -0400
 
4
Subject: [PATCH 11/17] Document usb-hid.c functions.
 
5
 
 
6
---
 
7
 src/usb-hid.c |   10 ++++++++++
 
8
 1 files changed, 10 insertions(+), 0 deletions(-)
 
9
 
 
10
diff --git a/src/usb-hid.c b/src/usb-hid.c
 
11
index 67b5e54..f82965d 100644
 
12
--- a/src/usb-hid.c
 
13
+++ b/src/usb-hid.c
 
14
@@ -17,6 +17,7 @@ struct usb_pipe *keyboard_pipe VAR16VISIBLE;
 
15
  * Setup
 
16
  ****************************************************************/
 
17
 
 
18
+// Send USB HID protocol message.
 
19
 static int
 
20
 set_protocol(struct usb_pipe *pipe, u16 val)
 
21
 {
 
22
@@ -29,6 +30,7 @@ set_protocol(struct usb_pipe *pipe, u16 val)
 
23
     return send_default_control(pipe, &req, NULL);
 
24
 }
 
25
 
 
26
+// Send USB HID SetIdle request.
 
27
 static int
 
28
 set_idle(struct usb_pipe *pipe, int ms)
 
29
 {
 
30
@@ -93,6 +95,7 @@ usb_keyboard_setup(void)
 
31
  * Keyboard events
 
32
  ****************************************************************/
 
33
 
 
34
+// Mapping from USB key id to ps2 key sequence.
 
35
 static u16 KeyToScanCode[] VAR16 = {
 
36
     0x0000, 0x0000, 0x0000, 0x0000, 0x001e, 0x0030, 0x002e, 0x0020,
 
37
     0x0012, 0x0021, 0x0022, 0x0023, 0x0017, 0x0024, 0x0025, 0x0026,
 
38
@@ -109,6 +112,7 @@ static u16 KeyToScanCode[] VAR16 = {
 
39
     0x0048, 0x0049, 0x0052, 0x0053
 
40
 };
 
41
 
 
42
+// Mapping from USB modifier id to ps2 key sequence.
 
43
 static u16 ModifierToScanCode[] VAR16 = {
 
44
     //lcntl, lshift, lalt, lgui, rcntl, rshift, ralt, rgui
 
45
     0x001d, 0x002a, 0x0038, 0xe05b, 0xe01d, 0x0036, 0xe038, 0xe05c
 
46
@@ -116,12 +120,14 @@ static u16 ModifierToScanCode[] VAR16 = {
 
47
 
 
48
 #define RELEASEBIT 0x80
 
49
 
 
50
+// Format of USB event data
 
51
 struct keyevent {
 
52
     u8 modifiers;
 
53
     u8 reserved;
 
54
     u8 keys[6];
 
55
 };
 
56
 
 
57
+// Translate data from KeyToScanCode[] to calls to process_key().
 
58
 static void
 
59
 prockeys(u16 keys)
 
60
 {
 
61
@@ -139,6 +145,7 @@ prockeys(u16 keys)
 
62
     process_key(keys);
 
63
 }
 
64
 
 
65
+// Handle a USB key press/release event.
 
66
 static void
 
67
 procscankey(u8 key, u8 flags)
 
68
 {
 
69
@@ -149,6 +156,7 @@ procscankey(u8 key, u8 flags)
 
70
         prockeys(keys | flags);
 
71
 }
 
72
 
 
73
+// Handle a USB modifier press/release event.
 
74
 static void
 
75
 procmodkey(u8 mods, u8 flags)
 
76
 {
 
77
@@ -161,6 +169,7 @@ procmodkey(u8 mods, u8 flags)
 
78
         }
 
79
 }
 
80
 
 
81
+// Process USB keyboard data.
 
82
 static void noinline
 
83
 handle_key(struct keyevent *data)
 
84
 {
 
85
@@ -225,6 +234,7 @@ handle_key(struct keyevent *data)
 
86
     SET_EBDA2(ebda_seg, usbkey_last.data, old.data);
 
87
 }
 
88
 
 
89
+// Check for USB events pending - called periodically from timer interrupt.
 
90
 void
 
91
 usb_check_key(void)
 
92
 {
 
93
-- 
 
94
1.7.1
 
95