summaryrefslogtreecommitdiff
path: root/sys/dev/usb/umass.c
AgeCommit message (Collapse)Author
2013-05-30Enforce ca_activate tree-walks over the entire heirarchy for all events,Theo de Raadt
cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
2013-04-15Get rid of various 'typedef struct' definitions and use plain structureMarcus Glocker
definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
2011-07-03Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingMatthew Dempsky
that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
2011-05-24On OpenBSD, we've always attached scsibus(4) to umass(4), even forMatthew Dempsky
ATAPI devices. atapiscsi(4) is only for handling ATAPI devices on an ATA bus, so umass(4) shouldn't care about it. ok krw@, dlg@; no objections from deraadt@
2011-01-25garbage collect "usb events". without /dev/usb there is no way to accessJacob Meuser
them from userland, and nothing in the kernel uses them. ok krw@, miod@
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2008-09-25Add 'default:' stanza to switch() to make clear that 'status' is alwaysKenneth R Westerback
initialized. From NetBSD. "won't hurt" miod@.
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-05-18avoid leaking pipes by not zeroing the pipe after aborting it, soFederico G. Schwindt
umass_disco() have a chance to free'em later. from nathanw@netbsd. miod@ ok.
2008-02-03Redo umass_bbb_get_max_lun() and uses thereof toKenneth R Westerback
1) Not bail out of umass_attach() just because the max lun cannot be found. Assume 0 and complete attachment. 2) Not expose sc->maxlun to possible misbehaving devices. Provide a buffer and copy it into sc->maxlun only if the attempt to get the max lun succeeds. 3) Shrink and simplify error handling and debug output. Prompted by the recurrance of the problem reported in PR#5478. Code taken for the most part from FreeBSD. ok miod@
2007-10-11treat usb vendor/product names as a locator, and have usbd_print handle it,Theo de Raadt
so that it shows up before the :. as a result, all the usb devices do not need to have name printing code anymore. all this now works and prints nicely because usbd_probe_and_attach() is serialized. ok kettenis
2007-09-15Allow to pull out an usb stick with ffs filesystem while mountedAlexander Bluhm
and a file is written onto the stick. Without these fixes the machine panics or hangs. The usb fix calls the callback when the stick is pulled out to free the associated buffers. Otherwise we have busy buffers for ever and the automatic unmount will panic. The change in the scsi layer prevents passing down further dirty buffers to usb after the stick has been deactivated. In vfs the automatic unmount has moved from the function vgonel() to vop_generic_revoke(). Both are called when the sd device's vnode is removed. In vgonel() the VXLOCK is already held which can cause a deadlock. So call dounmount() earlier. ok krw@, I like this marco@, tested by ian@
2007-06-14Remove the definition and usage of the USB_DECLARE_DRIVER_CLASS andMarc Balmer
USB_DECLARE_DRIVER macros. No binary change. ok dlg.
2007-06-14Move the inclusion of sys/timeout.h from usb_port.h to the drivers thatMarc Balmer
need it. If a USB driver uses timeout(9) functions, the header file sys/timeout.h must be included. Tested by me (i386, macppc, sparc64), ckuethe (amd64), & todd (sparc, zaurus). ok dlg.
2007-06-13Remove the definition and use of umass/umass_quirks related macros.Marc Balmer
No binary change. ok dlg.
2007-06-10Remove the definition and use of the USBDEVNAME macro.Marc Balmer
(This might look easy, but it was a big diff. Thanks to dlg and especially jsg for looking over it; we found at least four mistakes in the initial diff.) ok jsg.
2007-06-10Remove the definition and use of the USBDEV macro. It only created confusionMarc Balmer
and the address of it's argument: USBDEV(sc->sc_dev) yields &sc->sc_dev. No binary changes. ok jsg.
2007-06-05Remove the "Static" declaration of many functions. It was defined to be emptyMarc Balmer
and it was not consistently used. It was confusing as it suggested these functions were static, which they were not. discussed with dlg and jsg, ok jsg.
2007-06-01Remove more Free(?)BSD and NetBSD #ifdef/#endifs. No functional norMarc Balmer
binary change. ok jsg
2007-05-27Farewell USB_{ATTACH,MATCH,DETACH}* you will not be missed.Jonathan Gray
ok deraadt@ krw@ mbalmer@
2006-06-23In a drivers activate() entry point, if on DVACT_DEACTIVATE it doesMiod Vallat
something, then it MUST return zero on DVACT_ACTIVATE, not EOPNOTSUPP; this very popular bug has been cut and pasted a lot of times... ok deraadt@ mickey@
2005-08-01Don't keep the devinfo string on the stack, instead use malloc/free.Brad Smith
This should cure some rare stack overflows. From augustss NetBSD ok dlg@ pascoe@
2005-05-24Set the data length on CBI data transfers.Christopher Pascoe
ok dlg@
2005-05-15Oops. atapiscsi.h is needed because that's where NATAPISCSI isKenneth R Westerback
defined. Fixes Y-E DATA USB Floppy Drive that otherwise complains about 'atapiscsi not configured'. Should fix PR #4204 from Ben Hooper.
2005-05-14Try to ensure that UFI/ATAPI USB umass devices always get the zeroKenneth R Westerback
padded 12 byte commands mandated by the standard. Adapt the Linux data length twiddling on certain commands. We used to have some of this in a different form, curtesy of csapuntz@, but it got lost in subsequent merges. Fixes the USB card reader of Quentin Barnes who provided much testing and feedback for over a year! Tested by drahn@, ok marco@, 'this is good stuff' deraadt@.
2005-04-01Add support for polled umass/SCSI transactions. Should eliminate the panicsChristopher Pascoe
seen at reboot time after writing to umass devices. ok dlg@, testing markus@
2005-03-28Use USBD_DEFAULT_TIMEOUT on control transfers, rather than the SCSI requestChristopher Pascoe
timeout. ok dlg@
2005-03-28minor spelling corrections.Christopher Pascoe
ok dlg@
2004-07-21update the netbsd license and tagsDavid Gwynne
ok krw@
2004-07-21from netbsd, umass.c 1.103David Gwynne
Mostly stylistic change, making comments and printf()s similar between BBB and CBI. ok krw@
2004-07-21from netbsd, umass.c 1.105David Gwynne
do less work if we hit an error ok krw@
2004-07-21from netbsd, umass.c 1.112David Gwynne
Fix a printf() error. ok krw@
2004-07-21from netbsd, umass.c 1.116David Gwynne
When starting a bulk-only transfer, punt early if the device is going away. ok krw@
2004-07-21from netbsd, umass.c 1.104David Gwynne
Do the quirk initialization earlier. ok krw@
2004-07-21from netbsd, umass.c 1.101David Gwynne
On a Bulk-In data stall, make sure we copy back the data received, per the spec. This is the real problem behind FORCE_SHORT_INQUIRY. ok krw@
2004-07-21from netbsd, umass.c 1.100 1.113 1.115, umass_scsipi.c 1.11, umassvar.h 1.21David Gwynne
log message for umass 1.98, umass_scsipi.c 1.11, umassvar.h 1.21: Fix several problems with CCI handling, and enable it: * We were never calling the callback function when we got a UFI CCI(!). * We were passing a bogus residual count on non-UFI CCIs. * After a REQUEST SENSE, the UFI CCI may include the ASC/ASCQ from the sense information -- don't consider this a failure. In addition, remove a horrible hack that was causing us to drop sense information on the floor and return empty INQUIRY responses, often in the case where there is a UNIT ATTENTION pending during the INQUIRY. (Some drives send the data and then fail, some don't.) log message for umass.c 1.113: Do not return STATUS_WIRE_FAILED in response to a CBI stall. This is perfectly normal, and is used to report errors. Instead, use STATUS_CMD_FAILED, which causes us to do a REQUEST SENSE. Should address PR 22960. log message for umass.c 1.115: Do not do a CBI reset before returning STATUS_CMD_FAILED. This causes any sense information to be thrown away, and is therefore nonsensical. ok krw@
2004-07-17from netbsd, umass.c 1.98, umassvar.h 1.20David Gwynne
log message: Remove UMASS_QUIRK_NO_START_STOP and UMASS_QUIRK_NO_MAX_LUN. We don't have UMASS_QUIRK_NO_START_STOP so I didn't have to remove it. I consider umass_quirks.c to be too different so I hand removed references to the removed defines. There are some useless entries in there now which will be cleaned up after umass is merged with netbsd. ok deraadt@
2004-07-15from netbsd via dlg, umass.c revision 1.97:Theo de Raadt
Well, this is bloody obscure... My Imation USB FlashGO! adapter responds to a Get Max Lun request with a stall. With uhci, this does the expected thing. With ohci, it was returning a "data underrun" error because we weren't setting "buffer rounding" (i.e. USBD_SHORT_XFER_OK), and the underrun was taking priority. This happened with both the ohci in a Mac cube and the builtin ohci on the S3C2410. So, set USBD_SHORT_XFER_OK on the Get Max Lun. Now I get a stall reported and umass attaches correctly.
2004-06-08Make umass CBI buffer handling consistant with BBB buffer handling byKenneth R Westerback
using sc->data_buffer (not sc->tranfer_data), in the actual data transfer operations. From NetBSD PR #25676. ok tdeval@ deraadt@
2003-11-07updated URLs from Jared Yanovich;Jason McIntyre
however, I did not apply the diff exactly. After hunting around I found URLs for the missing files, and the ../index.html link appears not to work. I replaced it with a more suitable link.
2003-05-17sync with NetBSD and add various local hacks to make things work correctlyNathan Binkert
with our scsi layer
2003-05-07string cleanup; nate okTheo de Raadt
2003-04-27strcpy/sprintf cleanup of sys/dev. miod@, deraadt@ says to commit.Hakan Olsson
2003-01-05spellingTheo de Raadt
2002-12-15Fix/Cleanup some SCSI #defines.Kenneth R Westerback
1) Correctly define MODE_SENSE_BIG as 0x5a, not 0x54. 2) Delete duplicate #define's of some opcodes in scsi_disk.h. 3) Delete multiple #define's for same opcode in scsi_disk.h. 4) Replace uses of deleted opcodes in umass.c with remaining ones. ok millert@ tdeval@
2002-10-12Remove more '\n's from panic() statements. Both trailing and leading.Kenneth R Westerback
Diff generated by Chris Kuethe.
2002-07-25get rid of trailing whitespaceNathan Binkert
2002-06-21Trial and error gives me this tweak for the trumpion 0x1100 device.Artur Grabowski
2002-05-07Meant to commit only ulpt and committed everything. Most things weren't readyNathan Binkert
2002-05-07Sync ulpt driver with NetBSDNathan Binkert