dde_linux: usb support extra data and zero config

- Vendor devices add addtional data to the config descriptor, read and
  added to the usb session
- allow '0' configuration within the usb session

issue #3822
This commit is contained in:
Sebastian Sumpf
2020-12-02 09:28:20 +01:00
committed by Norman Feske
parent 537472e9af
commit 36eeab6df2
6 changed files with 90 additions and 21 deletions

View File

@ -80,10 +80,16 @@ class Usb::Session_client : public Genode::Rpc_client<Session>
call<Rpc_iface_descr>(index, alt_setting, interface_descr);
}
bool interface_extra(unsigned index, unsigned alt_setting,
Interface_extra *interface_data) override
{
return call<Rpc_iface_extra>(index, alt_setting, interface_data);
}
void endpoint_descriptor(unsigned interface_num,
unsigned alt_setting,
unsigned endpoint_num,
Endpoint_descriptor *endpoint_descr) override
unsigned alt_setting,
unsigned endpoint_num,
Endpoint_descriptor *endpoint_descr) override
{
call<Rpc_ep_descr>(interface_num, alt_setting, endpoint_num, endpoint_descr);
}

View File

@ -182,6 +182,9 @@ struct Usb::Session : public Genode::Session
virtual void interface_descriptor(unsigned index, unsigned alt_setting,
Interface_descriptor *interface_descr) = 0;
virtual bool interface_extra(unsigned index, unsigned alt_setting,
Interface_extra *interface_data) = 0;
/**
* Return endpoint for interface index/alternate setting tuple
*/
@ -208,6 +211,8 @@ struct Usb::Session : public Genode::Session
GENODE_RPC(Rpc_alt_settings, unsigned, alt_settings, unsigned);
GENODE_RPC_THROW(Rpc_iface_descr, void, interface_descriptor, GENODE_TYPE_LIST(Device_not_found,
Interface_not_found), unsigned, unsigned, Interface_descriptor *);
GENODE_RPC_THROW(Rpc_iface_extra, bool, interface_extra, GENODE_TYPE_LIST(Device_not_found,
Interface_not_found), unsigned, unsigned, Interface_extra *);
GENODE_RPC_THROW(Rpc_ep_descr, void, endpoint_descriptor, GENODE_TYPE_LIST(Device_not_found,
Interface_not_found), unsigned, unsigned, unsigned, Endpoint_descriptor *);
GENODE_RPC_THROW(Rpc_claim_interface, void, claim_interface, GENODE_TYPE_LIST(Interface_not_found,
@ -215,8 +220,8 @@ struct Usb::Session : public Genode::Session
GENODE_RPC_THROW(Rpc_release_interface, void, release_interface, GENODE_TYPE_LIST(Interface_not_found),
unsigned);
GENODE_RPC_INTERFACE(Rpc_plugged, Rpc_sigh_state_change, Rpc_tx_cap, Rpc_config_descr,
Rpc_iface_descr, Rpc_ep_descr, Rpc_alt_settings, Rpc_claim_interface,
Rpc_release_interface);
Rpc_iface_descr, Rpc_iface_extra, Rpc_ep_descr, Rpc_alt_settings,
Rpc_claim_interface, Rpc_release_interface);
};
#endif /* _INCLUDE__USB_SESSION__USB_SESSION_H_ */