summaryrefslogtreecommitdiff
path: root/sys/src/cmd/nusb/disk
AgeCommit message (Collapse)Author
2022-10-08nusb/disk: always allow raw scsi request (even without media present)cinap_lenrek
2022-10-01nusb/disk: fix interactions with libdiskArne Meyer
libdisk openscsi expects that the ctl file, starts with "inquiry". All other sd drivers do this, so nusb/disk should too.
2022-02-23nusb/disk: use setalt(), print argv0 in prints instead of "disk:"cinap_lenrek
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
2018-12-24nusb/disk: revert previous attempts and just not issue capacity command when ↵cinap_lenrek
theres no media present
2018-12-23Make the check work.Ori Bernstein
Embarrassing.
2018-12-24nusb/disk: implement 64 bit lba read/write commands (16 byte commands)cinap_lenrek
untested.
2018-12-24nusb/disk: fix typo "("cinap_lenrek
2018-12-23Don't unnecessarily unstall devices.Ori Bernstein
Some SD card readers are slow to unstall. We try to unstall them in a loop if there's no SD card in there, but they're not stalled. They're happily reporting that there's no SD card in them by giving back the appropriate error code. Skipping the unstall speeds up the retry loop, cutting the time spent attaching the USB device at boot from multiple minutes to nearly instant.
2018-10-15nusb/disk: also drive usb attached scsi devicesmischief
2018-02-18nusb: add missing header dependencies to mkfilescinap_lenrek
2017-08-11nusb/disk: add a 100ms sleep after ums reset, remove unused note handler, ↵cinap_lenrek
cleanup my pretec usb stick sometimes hangs on the first inquiry request, waiting for the inquiry response forever. adding a 100ms delay after the reset command seems to fix it. getting rid of unused "ding()" note handler and simplify umsrequest() incomplete read handling.
2017-07-31nusb/*: cleanupcinap_lenrek
2016-01-07format pointer subtraction results with %zd instead of %ld (for long -> ↵cinap_lenrek
intptr on amd64)
2015-05-30nusb/disk: adding identical partition is a no-opcinap_lenrek
2014-07-05support for huawei e220 g3 modem, cleanup nusb/serialcinap_lenrek
2014-06-28nusb: implement aijus stable uniqueue device namescinap_lenrek
instead of naming devices by ther dynamically assigned device address, we hash device uniqueue fields from the device descriptor and produce a 5 digit hex string that will identify the device across machines. when there is a collision (less than 1% chance with 100 devices), usbd will append the device address to the name to make it uniqueue for this machine. the hname is passed to drivers in the devid argument, which now has the form addr:hname, where the colon and hname can be omited (for backwards compatibility). when the new behaviour isnt desired, nousbhname= environment variable can be defined giving the old behaviour.
2013-10-26mkfiles: do not rely on path containing the . elementcinap_lenrek
when executing generated binaries and helper scripts, always execute them as ./name instead of relying that path contsins the dot.
2013-10-16nusb/disk: handle blocking usb access with srv releasedcinap_lenrek
usb is bound after /dev, so a hanging usb device will hang access to /dev. we avoid this by releasing the srv, which allows the fs to still handle reads and walks of the directories. ios are serialized by a qlock in the Umsc structure.
2013-03-10nusb/disk: add small delay after unit start command (for thinkpad sdcard reader)cinap_lenrek
diskparts fails on thinkpad x200 sdcard reader if we dont give the unit some time to startup. the device took about 100ms to become ready so status poll loop with a long timeout would be overkill.
2013-02-13nusb/disk: allow 12 and 16 byte raw scsi commands (from erik quanstro)cinap_lenrek
2013-01-03scsi: do only 36 byte inquirycinap_lenrek
some devices freeze up with inqiry allocation length other than 36 bytes. as we do not really care about the vendor specific part of the inquiry, lets only do 36 byte inquiry for now.
2012-03-01nusb: debug flagscinap_lenrek
2012-02-23correcting unicode superscripts for 1 2 and 3cinap_lenrek
2011-08-19nusb/disk: small clenupscinap_lenrek
2011-08-01nusb: fix usage inconsitency, shr namescinap_lenrek
2011-07-30devshr: changed #σc to contain directoriesaiju
nusb: detaching
2011-07-28nusb/disk: adaption to lib9paiju
2011-07-27nusb: improvedaiju