Turn USB HID drivers into event-session clients

Issue #3845
This commit is contained in:
Norman Feske
2020-08-13 16:03:59 +02:00
parent 974118acec
commit a2381c7e4c
26 changed files with 105 additions and 186 deletions

View File

@@ -399,7 +399,6 @@ append config {
append_if $use_usb config {
<start name="usb_drv" priority="-1" caps="120">
<resource name="RAM" quantum="12M"/>
<provides><service name="Input"/></provides>
<config uhci="yes" ehci="yes" xhci="yes">
<hid/>
</config>

View File

@@ -274,12 +274,12 @@ if { ![get_cmd_switch --autopilot] } { run_genode_until forever }
# autopilot test
run_genode_until {\[init -\> log_terminal\] \[init -\> test-input\] Input event #0\t} 90
run_genode_until {\[init -\> log_terminal\] \[init -\> event_dump\] Input event #0\t} 90
# remove everything before the first interesting line
regexp {(\[init -\> log_terminal\] \[init -\> test-input\] Input event #0\t.*)} $output all output
regexp {(\[init -\> log_terminal\] \[init -\> event_dump\] Input event #0\t.*)} $output all output
run_genode_until {.*\[init -\> test-input\] Input event #11.*\n} 60 [output_spawn_id]
run_genode_until {.*\[init -\> event_dump\] Input event #11.*\n} 60 [output_spawn_id]
unify_output { number [0-9]+} ""
unify_output {(?n)on usb-dummy.*$} ""
@@ -294,12 +294,12 @@ filter_out_color_escape_sequences
trim_lines
compare_output_to {
[init -> log_terminal] [init -> test-input] Input event #0 PRESS KEY_X 65534 key count: 1
[init -> log_terminal] [init -> test-input] Input event #1 RELEASE KEY_X key count: 0
[init -> log_terminal] [init -> test-input] Input event #2 PRESS BTN_LEFT 65534 key count: 1
[init -> log_terminal] [init -> test-input] Input event #3 REL_MOTION -1+0 key count: 1
[init -> log_terminal] [init -> test-input] Input event #4 REL_MOTION +0+1 key count: 1
[init -> log_terminal] [init -> test-input] Input event #5 RELEASE BTN_LEFT key count: 0
[init -> log_terminal] [init -> event_dump] Input event #0 PRESS KEY_X 65534 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #1 RELEASE KEY_X key count: 0
[init -> log_terminal] [init -> event_dump] Input event #2 PRESS BTN_LEFT 65534 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #3 REL_MOTION -1+0 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #4 REL_MOTION +0+1 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #5 RELEASE BTN_LEFT key count: 0
[init -> usb_drv] dev_info: USB disconnect, device
[init -> log_terminal] [init -> usb_drv] dev_info: USB disconnect, device
[init -> usb_drv] dev_info: new full-speed USB device
@@ -309,10 +309,10 @@ compare_output_to {
[init -> log_terminal] [init -> usb_drv] dev_info: input: USB HID v1.11 Keyboard [D L]
[init -> log_terminal] [init -> usb_drv] dev_info: D L
[init -> log_terminal] [init -> usb_drv] dev_info: input: USB HID v1.11 Mouse [D L]
[init -> log_terminal] [init -> test-input] Input event #6 PRESS KEY_X 65534 key count: 1
[init -> log_terminal] [init -> test-input] Input event #7 RELEASE KEY_X key count: 0
[init -> log_terminal] [init -> test-input] Input event #8 PRESS BTN_LEFT 65534 key count: 1
[init -> log_terminal] [init -> test-input] Input event #9 REL_MOTION -1+0 key count: 1
[init -> log_terminal] [init -> test-input] Input event #10 REL_MOTION +0+1 key count: 1
[init -> log_terminal] [init -> test-input] Input event #11 RELEASE BTN_LEFT key count: 0
[init -> log_terminal] [init -> event_dump] Input event #6 PRESS KEY_X 65534 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #7 RELEASE KEY_X key count: 0
[init -> log_terminal] [init -> event_dump] Input event #8 PRESS BTN_LEFT 65534 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #9 REL_MOTION -1+0 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #10 REL_MOTION +0+1 key count: 1
[init -> log_terminal] [init -> event_dump] Input event #11 RELEASE BTN_LEFT key count: 0
}

View File

@@ -91,8 +91,7 @@ append_if [expr $use_ps2] config {
append_if [expr $use_usb] config {
<start name="usb_drv" priority="-1" caps="120">
<resource name="RAM" quantum="12M"/>
<provides><service name="Input"/></provides>}
<resource name="RAM" quantum="12M"/>}
append_if [expr $use_usb] config {
<config uhci="yes" ehci="yes" xhci="yes">
@@ -114,7 +113,6 @@ append_if [have_spec framebuffer] config {
append_if [have_spec sdl] config {
<start name="fb_sdl" priority="-1" ld="no">
<resource name="RAM" quantum="4M"/>
<provides> <service name="Input"/> </provides>
</start>}
append_if [have_spec x86] config {
@@ -172,9 +170,6 @@ append config {
<route>
<service name="Report"> <child name="report_rom" /> </service>}
append_if [expr $use_usb] config {
<service name="Input"> <child name="usb_drv"/> </service>}
append config {
<any-service> <parent/> <any-child /> </any-service>
</route>
@@ -222,8 +217,6 @@ append_if [expr $use_gui] config {
<service name="Nic"> <child name="nic_bridge"/> </service>
<service name="Report" label="shape"> <child name="pointer" label="gui_fb2 -> shape"/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="Framebuffer"> <child name="gui_fb2" /> </service>
<service name="Input"> <child name="gui_fb2" /> </service>
<any-service> <parent /> <any-child /> </any-service>
</route>
</start>}
@@ -256,8 +249,6 @@ append_if [expr $use_bridge] config {
append config {
<service name="Report" label="shape"> <child name="pointer" label="gui_fb1 -> shape"/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="Framebuffer"> <child name="gui_fb1" /> </service>
<service name="Input"> <child name="gui_fb1" /> </service>
<any-service> <parent /> <any-child /> </any-service>
</route>
</start>

View File

@@ -35,7 +35,6 @@ append build_components {
server/fs_rom
drivers/ahci
drivers/framebuffer
app/input_event_client
}
lappend_if [expr $use_serial] build_components server/log_terminal
@@ -340,28 +339,15 @@ append_if [expr $use_usb] config {
<start name="usb_drv" priority="-1" caps="120">
<resource name="RAM" quantum="20M"/>
<provides>
<service name="Input"/>
<service name="Usb"/>
</provides>
<provides> <service name="Usb"/> </provides>
<route>
<service name="Report"><child name="report_rom"/></service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="Event"> <child name="event_filter" label="usb_hid"/> </service>
<service name="ROM" label="config">
<child name="usb_config_rom" label="usb_drv.config"/> </service>
<any-service><parent/><any-child/></any-service>
</route>
</start>
<start name="usb" caps="90">
<resource name="RAM" quantum="1M"/>
<binary name="input_event_client"/>
<config/>
<route>
<service name="Event"> <child name="event_filter" label="usb_hid"/> </service>
<service name="Input"> <child name="usb_drv"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
}
append_if [have_spec framebuffer] config {
@@ -400,7 +386,6 @@ append boot_modules {
libc.lib.so vfs.lib.so libm.lib.so
libiconv.lib.so stdcxx.lib.so
qemu-usb.lib.so
input_event_client
}
lappend_if [expr $use_rumpfs] boot_modules rump.lib.so