smartcard: declare vendor/product IDs at one place

Also added a report_rom for USB devices and let the driver report like
in a real scenario. Can also be used for debugging by setting
verbose="yes" in report_rom.
This commit is contained in:
Christian Helmuth 2019-02-08 15:00:41 +01:00 committed by Norman Feske
parent 3ada4f4733
commit dbac453a39
1 changed files with 22 additions and 2 deletions

View File

@ -15,6 +15,12 @@ if { [get_cmd_switch --autopilot] && ![have_spec x86_64] } {
exit 0
}
#
# Please configure your reader's vendor and product IDs here
#
proc smartcard_vendor_id {} { return "0x04e6" }
proc smartcard_product_id {} { return "0x5116" }
#
# Build
#
@ -73,14 +79,28 @@ append config {
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no">
<default-policy report="usb_drv -> devices"/>
</config>
</start>
<start name="usb_drv" caps="120">
<resource name="RAM" quantum="16M"/>
<provides><service name="Usb"/></provides>
<config uhci="yes" ehci="yes" xhci="yes" bios_handoff="yes">
<raw>
<policy label="test-smartcard -> usb_device" vendor_id="0x04e6" product_id="0x5116"/>
<report devices="yes"/>
<policy label="test-smartcard -> usb_device"
vendor_id="} [smartcard_vendor_id] {" product_id="} [smartcard_product_id] {"/>
</raw>
</config>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="test-smartcard" caps="130">
<resource name="RAM" quantum="4M"/>
@ -93,7 +113,7 @@ append config {
</dir>
</dir>
<inline name="config.pcsc-lite">
<config vendor_id="0x04e6" product_id="0x5116"/>
<config vendor_id="} [smartcard_vendor_id] {" product_id="} [smartcard_product_id] {"/>
</inline>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>