Commit Graph

26 Commits

Author SHA1 Message Date
Alexander Boettcher c1493b2ed2 usb: avoid pagefault during session destruction
due to pointer to object allocated in context of the session object.

Fixes #2565
2017-11-09 12:18:05 +01:00
Sebastian Sumpf 5adda2d934 usb: add asynchronous interface release
This became necessary, since URBs may still be pending upon interface
release.

Fixes #2466
2017-08-17 11:04:22 +02:00
Norman Feske 4d442bca30 Streamline exception types
This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.

Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.

This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
2017-05-31 13:16:07 +02:00
Norman Feske 6609aafb05 Replace Quota_exceeded by Insufficient_ram_quota
This patch replaces the 'Parent::Quota_exceeded',
'Service::Quota_exceeded', and 'Root::Quota_exceeded' exceptions
by the single 'Insufficient_ram_quota' exception type.

Furthermore, the 'Parent' interface distinguished now between
'Out_of_ram' (the child's RAM is exhausted) from
'Insufficient_ram_quota' (the child's RAM donation does not suffice to
establish the session).

This eliminates ambiguities and removes the need to convert exception
types along the path of the session creation.

Issue #2398
2017-05-31 13:16:05 +02:00
Alexander Boettcher 80eddd8731 usb: add OHCI support
Fixes #2357
2017-05-31 13:16:00 +02:00
Christian Helmuth 1d99e7ede9 base: classify signals as I/O and application level
Fixes #2363
2017-05-31 13:15:58 +02:00
Alexander Boettcher 2668a55688 usb_drv: fix various nullpointer in raw binding
during reset of a VM, usb device ejected before hand:

ded! amount=27941, size=4096, consumed=24576
Warning: could not allocate metadata
[init -> nit_fb1] using xywh=(0,0,2560,1440)
[init -> usb_drv] dev_info: new SuperSpeed USB device number 2 using xhci_hcd
[init -> vbox1] Attach USB device 0002:0002 (vendor=951, product=16a5)
Warning: Quota exceeded! amount=36133, size=4096, consumed=32768
Warning: could not allocate metadata
[init -> nit_fb1] using xywh=(0,0,2560,1440)
[init -> vbox1] EMT-0    VMMDev: Guest Additions capability report: (0x5 -> 0x5) seamless: yes, hostWindowMapping: no, graphics: yes
[init -> vbox1] EMT-0    VMMDev: Guest Additions capability report: (0x5 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
[init -> vbox1] EMT-0    VMMDev: Guest Additions capability report: (0x0 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
[init -> vbox1] EMT-1    VMMDev: Guest Additions capability report: (0x0 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no
Warning: Quota exceeded! amount=44325, size=4096, consumed=40960
Warning: could not allocate metadata
[init -> vbox1] fb resize : [0] 2560x1440 -> 1024x768
no RM attachment (READ pf_addr=0x4 pf_ip=0x105367e from pager_object: pd='init -> usb_drv' thread='ep')
page fault, pd='init -> usb_drv' thread='ep' cpu=0 ip=0x105367e address=0x4 stack pointer=0xa07fef18 qualifiers=0x4 irUwp reason=1

Seen during #2338
2017-05-02 15:28:55 +02:00
Norman Feske 29b8d609c9 Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
Josef Söntgen 3c57a8b3c2 usb_session: pass Region_map explicitly
Issue #2280.
2017-02-28 12:59:17 +01:00
Emery Hemingway 48150a706b update Reporter constructors
The Reporter utility needs a reference to the environment at
construction to establish Report connections.

Ref #1987
Fix #2232
2017-02-07 19:20:29 +01:00
Josef Söntgen dee56aeafa usb_drv: add missing device pointer checks
The usb_drv must always check the device pointer in all session facing.
methods. A errorneous client can otherwise trigger a page-fault in the
driver.

Fixes #2133.
2016-10-21 12:39:37 +02:00
Christian Prochaska 82e228a715 usb_drv: raw session fixes
- use the correct memory free functions on errors
- report packet submit errors
- rename 'Usb::Packet_descriptor::transfer.timeout' as
 'Usb::Packet_descriptor::transfer.polling_interval'

Fixes #2135
2016-10-21 12:39:37 +02:00
Christian Prochaska e2ae01f870 usb_drv: fix policy parsing
Fixes #2112
2016-10-21 12:39:32 +02:00
Norman Feske e370e08e01 Define Genode::size_t as unsigned long
Fixes #2105
2016-10-21 12:39:29 +02:00
Alexander Boettcher d409b0e98b usb: fix for unconfigured usb devices
Avoids null pointer in usb raw.
2016-08-29 17:23:20 +02:00
Emery Hemingway f8337b511b Move Session_label from os to base
Session_label constructor now takes a bare string rather than a
serialized argument buffer.
Replace all instances of previous constructor with 'label_from_args'
function.

Issue #1787
2016-07-11 13:09:24 +02:00
Sebastian Sumpf d48219138c usb: transition to the new base API
* remove all 'Genode::env()' calls
* use attached roms to read configuration
* use compoenent framework
* remove all PDBG, PINF, PWRN macros

Issue #1987
Fixes #2019
2016-06-28 11:09:25 +02:00
Sebastian Sumpf 369ff2a001 dde_linux: update usb to 4.4.3
Issue #1974.
2016-05-26 15:54:12 +02:00
Norman Feske 807be83b1b Remove inconsistent use of 'is_' prefix
Fixes #1963
2016-05-23 15:52:39 +02:00
Josef Söntgen 133c46a784 usb_drv: handle EP stall in Usb_session
Fixes #1945.
2016-05-09 13:09:54 +02:00
Alexander Boettcher 463b39fc73 xml reporter: support different start node name
Currently the report name is used implicitly as first xml node name for the
report.  This is inconvenient if one component wants to generate various xml
reports under various names (e.g. to steer consumers/clients slightly
differently) but with the same xml node tree structure.

Fixes #1940
2016-05-09 13:09:54 +02:00
Josef Söntgen 46e4c3dc9b usb_drv: release interfaces on Usb session close
Interfaces that have been claimed by a component always have to be
released when the session is closed in case the component
malfunctioned.

Fixes #1869.
2016-02-05 10:47:45 +01:00
Sebastian Sumpf 716eab21e3 usb_drv: change Usb session and raw driver
- Use 'label' attribute to identify device instead of
  bus/dev and vendor_id/product_id

- Implement release_interface RPC

- Report 'label' as well as 'bus' and 'dev'

- Add policy handling to raw driver (includes reconfiguration
  at runtime)

- Use own memory backing store for large DMA allocations

Issue #1863.
2016-01-27 16:15:34 +01:00
Christian Prochaska 2d869dd15e usb_drv: generate a device list report
The report lists all connected devices and gets updated when devices are
added or removed.

Example report:

<devices>
    <device vendor_id="0x17ef" product_id="0x4816"/>
    <device vendor_id="0x0a5c" product_id="0x217f"/>
    <device vendor_id="0x8087" product_id="0x0020"/>
    <device vendor_id="0x8087" product_id="0x0020"/>
    <device vendor_id="0x1d6b" product_id="0x0002"/>
    <device vendor_id="0x1d6b" product_id="0x0002"/>
</devices>

There is no distinction yet for multiple devices of the same type.

The report is named "devices" and an example policy for 'report_rom' would
look like:

<policy label="vbox -> usb_devices" report="usb_drv -> devices"/>

The report only gets generated if enabled in the 'usb_drv' configuration:

<config>
    <raw>
        <report devices="yes"/>
    </raw>
</config>

Fixes #1506
2015-05-26 09:39:46 +02:00
Christian Prochaska 1001a04883 usb_drv improvements
- send a 'state_change' signal on session creation if the device is
  already attached
- evaluate the status code of a finished asynchronous operation
- return the number of actually transferred bytes for control transfers,
  too

Fixes #1490
2015-05-06 12:01:30 +02:00
Sebastian Sumpf 0c2bdf9edd usb_drv: Remote USB driver interface
Issue #1329
2015-02-16 13:40:33 +01:00