2016-10-20 13:47:19 +00:00
|
|
|
#
|
|
|
|
# Smartcard test
|
|
|
|
#
|
|
|
|
# NOTE: The vendor id and product id of the USB card reader to be used must be
|
|
|
|
# configured for the application and for the USB driver.
|
|
|
|
#
|
|
|
|
|
2021-01-29 12:48:00 +00:00
|
|
|
if {[have_include "power_on/qemu"] || [have_spec linux]} {
|
|
|
|
puts "Run script does not support Qemu or Linux"
|
2016-10-20 13:47:19 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2019-04-29 13:24:37 +00:00
|
|
|
assert_spec x86_64
|
2016-10-20 13:47:19 +00:00
|
|
|
|
2019-02-08 14:00:41 +00:00
|
|
|
#
|
|
|
|
# Please configure your reader's vendor and product IDs here
|
|
|
|
#
|
|
|
|
proc smartcard_vendor_id {} { return "0x04e6" }
|
|
|
|
proc smartcard_product_id {} { return "0x5116" }
|
|
|
|
|
2016-10-20 13:47:19 +00:00
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
|
|
|
create_boot_directory
|
2022-09-16 09:51:38 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
2024-05-30 13:46:57 +00:00
|
|
|
[depot_user]/pkg/test_usb_host-[board] \
|
2022-09-16 09:51:38 +00:00
|
|
|
[depot_user]/src/report_rom \
|
|
|
|
[depot_user]/src/init
|
2023-11-24 10:57:35 +00:00
|
|
|
build {
|
|
|
|
lib/libc lib/libm lib/vfs lib/posix lib/libusb lib/vfs_libusb lib/vfs_pipe
|
|
|
|
test/smartcard
|
|
|
|
}
|
2016-10-20 13:47:19 +00:00
|
|
|
|
2022-09-16 09:51:38 +00:00
|
|
|
install_config {
|
2016-10-20 13:47:19 +00:00
|
|
|
<config>
|
|
|
|
<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>
|
2017-05-07 20:36:11 +00:00
|
|
|
</default-route>
|
2022-09-16 09:51:38 +00:00
|
|
|
<default caps="100"/>
|
2016-10-20 13:47:19 +00:00
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2022-09-16 09:51:38 +00:00
|
|
|
|
2019-02-08 14:00:41 +00:00
|
|
|
<start name="report_rom">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
2022-09-16 09:51:38 +00:00
|
|
|
<config>
|
2024-05-30 13:46:57 +00:00
|
|
|
<default-policy report="usb -> usb -> devices"/>
|
2019-02-08 14:00:41 +00:00
|
|
|
</config>
|
2022-09-16 09:51:38 +00:00
|
|
|
<route>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
2019-02-08 14:00:41 +00:00
|
|
|
</start>
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="usb" caps="1500" managing_system="yes">
|
2022-09-16 09:51:38 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
|
|
|
<provides> <service name="Usb"/> </provides>
|
2019-02-08 14:00:41 +00:00
|
|
|
<route>
|
2022-09-16 09:51:38 +00:00
|
|
|
<service name="ROM" label="config">
|
|
|
|
<parent label="drivers.config"/> </service>
|
2019-02-08 14:00:41 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2022-09-16 09:51:38 +00:00
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
2019-02-08 14:00:41 +00:00
|
|
|
</route>
|
2016-10-20 13:47:19 +00:00
|
|
|
</start>
|
2019-04-29 13:24:37 +00:00
|
|
|
|
2019-02-11 11:51:28 +00:00
|
|
|
<start name="test-smartcard" caps="150">
|
usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.
The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.
The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.
This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.
The adaptations necessary target the following areas:
* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
with the new policy rules of the USB host controller driver
Fix genodelabs/genode#5021
2023-09-14 08:55:11 +00:00
|
|
|
<resource name="RAM" quantum="5M"/>
|
2016-10-20 13:47:19 +00:00
|
|
|
<config>
|
2017-03-20 11:04:55 +00:00
|
|
|
<vfs>
|
2022-02-01 16:39:37 +00:00
|
|
|
<dir name="dev">
|
|
|
|
<log/>
|
|
|
|
<inline name="rtc">2018-01-01 00:01</inline>
|
|
|
|
<libusb/>
|
|
|
|
</dir>
|
2020-07-23 13:14:54 +00:00
|
|
|
<dir name="pipe"> <pipe/> </dir>
|
2017-03-20 11:04:55 +00:00
|
|
|
<dir name="ifd-ccid.bundle">
|
|
|
|
<dir name="Contents">
|
|
|
|
<rom name="Info.plist"/>
|
2016-10-20 13:47:19 +00:00
|
|
|
</dir>
|
2017-03-20 11:04:55 +00:00
|
|
|
</dir>
|
|
|
|
</vfs>
|
2020-07-23 13:14:54 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" pipe="/pipe"/>
|
2019-08-20 13:55:24 +00:00
|
|
|
<env key="LIBUSB_DEBUG" value="1"/> <!-- log libusb errors -->
|
2016-10-20 13:47:19 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
#
|
2022-09-16 09:51:38 +00:00
|
|
|
# Define USB host controller config
|
2016-10-20 13:47:19 +00:00
|
|
|
#
|
2022-09-16 09:51:38 +00:00
|
|
|
append usb_config {
|
|
|
|
<config bios_handoff="yes">
|
|
|
|
<report devices="yes"/>
|
usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.
The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.
The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.
This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.
The adaptations necessary target the following areas:
* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
with the new policy rules of the USB host controller driver
Fix genodelabs/genode#5021
2023-09-14 08:55:11 +00:00
|
|
|
<policy label="test-smartcard -> "><device vendor_id="} [smartcard_vendor_id] {" product_id="} [smartcard_product_id] {"/></policy>
|
2022-09-16 09:51:38 +00:00
|
|
|
</config>}
|
2024-05-30 13:46:57 +00:00
|
|
|
set fd [open [run_dir]/genode/usb_host.config w]
|
2022-09-16 09:51:38 +00:00
|
|
|
puts $fd $usb_config
|
|
|
|
close $fd
|
2016-10-20 13:47:19 +00:00
|
|
|
|
2023-11-24 10:57:35 +00:00
|
|
|
build_boot_image [list {*}[build_artifacts] Info.plist]
|
2016-10-20 13:47:19 +00:00
|
|
|
|
|
|
|
run_genode_until { Response: 62 0A 82 01 38 83 02 3F 00 8A 01 05 90 00} 30
|
|
|
|
|
|
|
|
exec rm bin/Info.plist
|