summaryrefslogtreecommitdiff
path: root/sys/src/cmd/nusb/serial/ftdi.c
AgeCommit message (Collapse)Author
2022-02-21nusb: Fix handling of interface altsetting.cinap_lenrek
The altsetting was handled only for a single endpoint (per interface number), but has to be handled for each endpoint (per interface *AND* altsetting number). A multi function device (like a disk) can have multiple interfaces, all with the same interface number but varying altsetting numbers and each of these interfaces would list distict endpoint configurations. Multiple interfaces can even share some endpoints (they use the same endpoint addresses), but we still have to duplicate them for each interface+altsetting number (as they'r part of actually distict interfaces with distict endpoint configurations). It is also important to *NOT* make endpoints bi-directional (dir == Eboth) when only one direction is used in a interface/altsetting and the other direction in another. This was the case for nusb/disk with some seagate drive where endpoints where shared between the UAS and usb storage class interface (but with distict altsettings). The duplicate endpoints (as in using the same endpoint address) are chained together by a next pointer and the head is stored in Usbdev.ep[addr], where addr is the endpoint address. These Ep structures will have distinct endpoint numbers Ep.id (when they have conflicting types), but all will share the endpoint address (lower 4 bits of the endpoint number). The consequence is that all of the endpoints configuration (attributes, interval) is now stored in the Ep struct and no more Altc struct is present. A pointer to the Ep struct has to be passed to openep() for it to configure the endpoint. For the Iface struct, we will now create multiple of them: one for each interface *AND* altsetting nunber, chained together on a next pointer and the head being stored in conf->iface[ifaceid]. -- cinap
2020-10-17nusb/serial: add ids for FT230X (thanks mischief)Ori Bernstein
2017-04-01nusb/lib: make usbcmd() return value symmetic; returning size of data phase ↵cinap_lenrek
(if any) (thanks aiju) usbcmd() with Rh2d used to return the command size (8+ndata) wile returning only ndata for Rd2h. this changes it to always return ndata for Rh2d. it mostly doesnt matter as Rh2d callers only check r < 0 for error, but this makes the interface symmetic.
2015-05-11nusb/serial: recognize aijuboard jtag interfacecinap_lenrek
2014-12-24nusb/serial: fix nusb/serial hang with ftdicinap_lenrek
have to create process, not a thread in ftdi code so main process can exit after posting fs service.
2014-07-05nusb/serial: implement flushescinap_lenrek
handle reads and writes with 9pqueue(2) so they can be flushed and wont hang the filesystem. this also lets us get rid of the timeouts. ftdi is still full of braindamage that should be rewritten, but i dont have a device to test.
2014-07-05nusb/serial: more cleanupcinap_lenrek
2014-07-05support for huawei e220 g3 modem, cleanup nusb/serialcinap_lenrek
2013-04-26nusb/serial: Add support for Amontec JTAGkey devices (from sources)cinap_lenrek
2011-07-30added nusb/serialaiju