Introduce two more layers between device and endpoint:

device -> active config -> claimed interface -> endpoints.
Device can have at most one active config. A config can have
multiple claimed interfaces, each with a specific alt setting.
An interface with an alt setting defines a list of endpoints.
This commit is contained in:
Sebastian Zagrodzki
2017-04-29 00:01:11 +02:00
parent d193e605a4
commit 5f122b4dcd
10 changed files with 309 additions and 250 deletions

View File

@@ -17,7 +17,7 @@ package usb
func (e *endpoint) newStream(size, count int, submit bool) (*stream, error) {
var ts []transferIntf
for i := 0; i < count; i++ {
t, err := newUSBTransfer(e.h, &e.Info, make([]byte, size), e.timeout)
t, err := newUSBTransfer(e.h, &e.Info, make([]byte, size), e.Timeout)
if err != nil {
for _, t := range ts {
t.free()