Use new pc_usb_host_drv in all recipes and tests

* Switch from the legacy usb_host driver to the new PC version
  in recipes and automated tests
* Update documentation snippets
* Remove outdated, unused usb_rndis run-script

Fix genodelabs/genode#4416
This commit is contained in:
Stefan Kalkowski 2022-02-16 17:37:07 +01:00 committed by Norman Feske
parent a30c4281d2
commit 14d1ca17a9
16 changed files with 44 additions and 216 deletions

View File

@ -9,7 +9,7 @@ proc have_platform_drv {} {
proc usb_host_drv_binary { } {
if {[have_board rpi]} { return legacy_rpi_usb_host_drv }
if {[have_board imx6q_sabrelite]} { return legacy_imx6q_sabrelite_usb_host_drv }
if {[have_board pc]} { return legacy_pc_usb_host_drv }
if {[have_board pc]} { return pc_usb_host_drv }
return no_usb_drv_available
}
@ -41,8 +41,8 @@ proc acpi_drv_name { } {
proc platform_drv_build_components {} {
set drv_build_components ""
lappend_if [have_platform_drv] drv_build_components drivers/platform
if {[have_board pc]} {
lappend drv_build_components drivers/platform/legacy/x86
lappend drv_build_components server/report_rom
if {[acpi_drv_name] eq "acpi_drv"} {
lappend drv_build_components drivers/acpi

View File

@ -283,6 +283,8 @@ run_genode_until {\[init -\> event_dump\] Input event #11.*\n} 40 [output_spawn_
# pay only attention to the output of init and its children
grep_output {^\[init }
unify_output { dev_info:} ""
unify_output { usb [0-9\-]+:} ""
unify_output { number [0-9]+} ""
unify_output {(?n)on usb-usbbus.*$} ""
unify_output {(?n)using .*$} ""
@ -299,10 +301,10 @@ compare_output_to {
[init -> event_dump] Input event #3 REL_MOTION -1+0 key count: 1
[init -> event_dump] Input event #4 REL_MOTION +0+1 key count: 1
[init -> event_dump] Input event #5 RELEASE BTN_LEFT key count: 0
[init -> usb_drv] dev_info: USB disconnect, device
[init -> usb_drv] dev_info: new full-speed USB device
[init -> usb_hid_drv] dev_info: input: USB HID v1.11 Keyboard [HID 03eb:204d]
[init -> usb_hid_drv] dev_info: input: USB HID v1.11 Mouse [HID 03eb:204d]
[init -> usb_drv] USB disconnect, device
[init -> usb_drv] new full-speed USB device
[init -> usb_hid_drv] input: USB HID v1.11 Keyboard [HID 03eb:204d]
[init -> usb_hid_drv] input: USB HID v1.11 Mouse [HID 03eb:204d]
[init -> event_dump] Input event #6 PRESS KEY_X 65534 key count: 1
[init -> event_dump] Input event #7 RELEASE KEY_X key count: 0
[init -> event_dump] Input event #8 PRESS BTN_LEFT 65534 key count: 1

View File

@ -21,7 +21,7 @@ if {![have_include "power_on/qemu"]} {
set build_components {
core init timer
drivers/usb_host
drivers/usb_host/pc
drivers/usb_hid
server/event_dump
server/dynamic_rom
@ -72,10 +72,10 @@ append config {
</start>
<start name="usb_drv" caps="150">
<binary name="} [usb_host_drv_binary] {"/>
<binary name="pc_usb_host_drv"/>
<resource name="RAM" quantum="12M"/>
<provides> <service name="Usb"/> </provides>
<config uhci="no" ohci="no" ehci="no" xhci="yes" bios_handoff="yes">
<config bios_handoff="yes">
<report devices="yes"/>
<policy label_prefix="usb_hid_drv" class="0x3"/>
</config>
@ -154,9 +154,8 @@ install_config $config
# generic modules
set boot_modules {
core ld.lib.so init timer event_dump dynamic_rom
usb_hid_drv
usb_hid_drv pc_usb_host_drv
}
append boot_modules [usb_host_drv_binary]
append_platform_drv_boot_modules

View File

@ -71,7 +71,6 @@ append_if [have_spec x86] config {
append config {
</config>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>

View File

@ -1,172 +0,0 @@
#
# \brief Test for using the TCP/IP terminal over USB (RNDIS, CDC_ETHER or USB NIC)
# \author Alexander Senier
# \date 2017-10-19
#
assert_spec x86
#
# Build
#
set build_components {
core init timer
drivers/usb_host
drivers/usb_net
server/tcp_terminal
test/terminal_echo
lib/vfs/lwip
lib/vfs/pipe
server/nic_router
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
#
# Generate config
#
set config ""
append config {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="usb_drv" caps="120">
<binary name="} [usb_host_drv_binary] {"/>
<resource name="RAM" quantum="24M"/>
<provides><service name="Usb"/></provides>
<config>
<policy label_prefix="usb_net_drv" vendor_id="0x0b95" product_id="0x1790"/>
</config>
</start>
<start name="usb_net_drv">
<resource name="RAM" quantum="20M"/>
<config mode="uplink_client" mac="02:00:00:00:01:01" />
<route>
<service name="Uplink"><child name="nic_router"/></service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="nic_router" caps="200">
<resource name="RAM" quantum="10M"/>
<provides>
<service name="Nic"/>
<service name="Uplink"/>
</provides>
<config verbose_domain_state="yes">
<policy label_prefix="tcp_terminal" domain="downlink"/>
<policy label_prefix="usb_net_drv" domain="uplink"/>
<domain name="uplink">
<nat domain="downlink" tcp-ports="16384"/>
<tcp-forward port="88" domain="downlink" to="10.0.3.2"/>
</domain>
<domain name="downlink" interface="10.0.3.1/24">
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2"/>
</domain>
</config>
</start>
<start name="tcp_terminal" caps="200">
<resource name="RAM" quantum="3M"/>
<provides> <service name="Terminal"/> </provides>
<config>
<policy label_prefix="test-terminal_echo" port="8888"/>
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <lwip dhcp="yes"/> </dir>
<dir name="pipe"> <pipe/> </dir>
</vfs>
<libc stdout="/dev/log" socket="/socket" pipe="/pipe"/>
</config>
<route>
<service name="Nic"> <child name="nic_router" /> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="test-terminal_echo">
<resource name="RAM" quantum="2M"/>
</start>}
append_platform_drv_config
append config {
</config>
}
install_config $config
#
# Boot modules
#
# generic modules
set boot_modules {
core ld.lib.so init timer
libc.lib.so vfs.lib.so vfs_pipe.lib.so
tcp_terminal
test-terminal_echo
vfs_lwip.lib.so
usb_net_drv
nic_router
}
append boot_modules [usb_host_drv_binary]
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -device usb-ehci,id=ehci"
# Samsung RNDIS (tested with S5, Galaxy Tab S
append qemu_args " -device usb-host,bus=ehci.0,vendorid=0x04e8,productid=0x6860"
append qemu_args " -device usb-host,bus=ehci.0,vendorid=0x04e8,productid=0x6863"
append qemu_args " -device usb-host,bus=ehci.0,vendorid=0x04e8,productid=0x6864"
# ASIX Electronics Corp. AX88179 Gigabit Ethernet
append qemu_args " -device usb-host,bus=ehci.0,vendorid=0x0b95,productid=0x1790"
# Motorola Moto E, G4 Play
append qemu_args " -device usb-host,id=motoe,bus=ehci.0,vendorid=0x22b8,productid=0x2e25"
# HTC A9
append qemu_args " -device usb-host,id=htc,bus=ehci.0,vendorid=0x0bb4,productid=0x0ffe"
append qemu_args " -nographic"
run_genode_until forever
# vi: set ft=tcl :

View File

@ -1,7 +1,7 @@
_/src/platform_drv
_/src/acpi_drv
_/src/ps2_drv
_/src/legacy_usb_host_drv
_/src/pc_usb_host_drv
_/src/usb_hid_drv
_/src/usb_block_drv
_/src/vesa_drv

View File

@ -133,7 +133,7 @@
</start>
<start name="usb_drv" caps="200">
<binary name="legacy_pc_usb_host_drv"/>
<binary name="pc_usb_host_drv"/>
<resource name="RAM" quantum="16M"/>
<provides> <service name="Usb"/> </provides>
<route>

View File

@ -712,14 +712,13 @@ void Driver_manager::Main::_generate_usb_drv_config(Reporter &usb_drv_config,
{
Reporter::Xml_generator xml(usb_drv_config, [&] () {
xml.attribute("uhci", true);
xml.attribute("ehci", true);
xml.attribute("ohci", _use_ohci);
xml.attribute("xhci", true);
xml.attribute("capslock_led", "rom");
xml.attribute("numlock_led", "rom");
xml.node("report", [&] () { xml.attribute("devices", true); });
xml.node("report", [&] () {
xml.attribute("config", true);
xml.attribute("devices", true);
});
/* incorporate user-managed policy */
policy.with_raw_content([&] (char const *start, size_t length) {

View File

@ -77,7 +77,7 @@ append config {
<binary name="} [usb_host_drv_binary] {"/>
<resource name="RAM" quantum="16M"/>
<provides><service name="Usb"/></provides>
<config uhci="yes" ehci="yes" xhci="yes" bios_handoff="yes">
<config bios_handoff="yes">
<report devices="yes"/>
<policy label="test-smartcard -> usb_device"
vendor_id="} [smartcard_vendor_id] {" product_id="} [smartcard_product_id] {"/>

View File

@ -1,3 +1,5 @@
assert_spec x86
set build_components { }
# fuji4
@ -25,7 +27,8 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/nitpicker \
[depot_user]/src/dynamic_rom \
[depot_user]/src/rom_reporter \
[depot_user]/src/legacy_usb_host_drv \
[depot_user]/src/report_rom \
[depot_user]/src/pc_usb_host_drv \
[depot_user]/src/vesa_drv \
[depot_user]/src/test-capture \
[depot_user]/pkg/usb_webcam
@ -66,12 +69,11 @@ append config {
</start>
<start name="usb_drv" priority="0" caps="200">
<binary name="legacy_pc_usb_host_drv"/>
<binary name="pc_usb_host_drv"/>
<resource name="RAM" quantum="16M"/>
<!-- <resource name="CPU" quantum="10"/> -->
<provides><service name="Usb"/></provides>
<config uhci="yes" ehci="yes" xhci="yes" bios_handoff="no">
<report devices="no"/>
<config bios_handoff="no">
<policy label_suffix="usb_webcam -> usb_device"
vendor_id="} [libuvc_vendor_id] {" product_id="} [libuvc_product_id] {"/>
</config>

View File

@ -1,7 +1,7 @@
_/src/platform_drv
_/src/acpi_drv
_/src/ps2_drv
_/src/legacy_usb_host_drv
_/src/pc_usb_host_drv
_/src/usb_hid_drv
_/src/vesa_drv
_/src/report_rom

View File

@ -107,10 +107,10 @@
</start>
<start name="usb_drv" caps="150">
<binary name="legacy_pc_usb_host_drv"/>
<binary name="pc_usb_host_drv"/>
<resource name="RAM" quantum="16M"/>
<provides> <service name="Usb"/> </provides>
<config uhci="yes" ohci="yes" ehci="yes" xhci="yes">
<config>
<report devices="yes"/>
<policy label_prefix="usb_hid_drv" class="0x3"/>
</config>

View File

@ -59,12 +59,9 @@ following USB driver configuration:
!<start name="usb_drv">
![...]
! <config uhci="yes" ehci="yes" xhci="yes">
! <hid/>
! <raw>
! <report devices="yes"/>
! <policy label="vbox -> usb-1-3" vendor_id="0x1b1c" product_id="0x1a09" bus="0x0001" device="0x0003"/>
! </raw>
! <config>
! <report devices="yes"/>
! <policy label="vbox -> usb-1-3" vendor_id="0x1b1c" product_id="0x1a09" bus="0x0001" device="0x0003"/>
! </config>
!</start>

View File

@ -29,7 +29,7 @@ driver:
!<start name="usb_drv">
! <resource name="RAM" quantum="12M"/>
! <provides><service name="Usb"/></provides>
! <config uhci="yes" ehci="yes" xhci="yes">
! <config>
! <raw>
! <policy label="usb_block_drv -> usb_stick" vendor_id="0x13fe" product_id="0x5200"/>
! </raw>

View File

@ -84,7 +84,7 @@ append config {
<import>
<inline name="usb_drv.config">
<config>
<report devices="yes"/>
<report devices="yes" config="yes"/>
<policy label_prefix="virtualbox" class="0x3"/>
</config>
</inline>
@ -289,6 +289,8 @@ regexp {(\[init -\> log_terminal\] \[init -\> event_dump\] Input event #0\t.*)}
run_genode_until {.*\[init -\> event_dump\] Input event #11.*\n} 60 [output_spawn_id]
unify_output { dev_info:} ""
unify_output { usb [0-9\-]+:} ""
unify_output { number [0-9]+} ""
unify_output {(?n)on usb-usbbus.*$} ""
unify_output {(?n)using .*$} ""
@ -308,13 +310,13 @@ compare_output_to {
[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
[init -> usb_drv] USB disconnect, device
[init -> log_terminal] [init -> usb_drv] USB disconnect, device
[init -> usb_drv] new full-speed USB device
[init -> virtualbox] Attach USB device (vendor=3eb, product=204d)
[init -> log_terminal] [init -> usb_drv] dev_info: new full-speed USB device
[init -> log_terminal] [init -> usb_hid_drv] dev_info: input: USB HID v1.11 Keyboard [HID 03eb:204d]
[init -> log_terminal] [init -> usb_hid_drv] dev_info: input: USB HID v1.11 Mouse [HID 03eb:204d]
[init -> log_terminal] [init -> usb_drv] new full-speed USB device
[init -> log_terminal] [init -> usb_hid_drv] input: USB HID v1.11 Keyboard [HID 03eb:204d]
[init -> log_terminal] [init -> usb_hid_drv] input: USB HID v1.11 Mouse [HID 03eb:204d]
[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

View File

@ -39,7 +39,7 @@ if {$use_vms > 1} {
}
if {$use_usb} {
import_from_depot [depot_user]/src/legacy_usb_host_drv \
import_from_depot [depot_user]/src/pc_usb_host_drv \
[depot_user]/src/usb_hid_drv
}
@ -280,7 +280,7 @@ append_if [expr $use_usb] config {
<ram/>
<import>
<inline name="usb_drv.config">
<config uhci="yes" ohci="yes" ehci="yes" xhci="yes">
<config>
<report devices="yes"/>
<policy label_prefix="usb_hid_drv" class="0x3"/>
</config>
@ -350,7 +350,7 @@ append_if [expr $use_usb] config {
</start>
<start name="usb_drv" caps="200">
<binary name="legacy_pc_usb_host_drv"/>
<binary name="pc_usb_host_drv"/>
<resource name="RAM" quantum="20M"/>
<provides> <service name="Usb"/> </provides>
<route>