summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uvisor.c
AgeCommit message (Collapse)Author
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2020-03-13PR/55068: sc.dying: Fix printf formats:christos
- no %s/%p for kernel log - 0x% -> %# - always %j for kernel log
2020-01-07Localify, constify.maxv
2019-12-27s/transfered/transferred/msaitoh
2019-09-14Fix possible NULL deref. Found by vHCI.maxv
2019-05-09clean up ucom parents some more:mrg
- it's always "bool sc_dying" now, with true/false - heavy use of static functions - remove all ucom parent ca_activate callbacks. they're never called. - callbacks should generally do little to nothing if sc_dying is set - open resources should be released in detach after setting sc_dying - don't complain about usbd_abort_pipe() or usbd_close_pipe() failure - when releasing resources, zero the softc member as well - remove ucom_methods members no longer destined to be filled in - generally, DPRINTF() before sc_dying short circuit - use EIO when dying, not ENXIO or 0 - add some ucom_open() callbacks that simply return EIO if dying
2019-05-05remove explicit 'extern struct cfdriver <my>_cd;' and use ioconf.hmrg
2019-05-04clean up ucom / ucom-parent interface slightly:mrg
- document what the ucom_methods{} callbacks argument are and that they are all optional. - remove almost all methods being assigned to NULL, as they are all C99 initialisers and thus don't need NULL assignments. - ucom_get_status() callback always has lsr/msr pointers as valid. remove all tests for not NULL in these functions.
2016-11-25+#include "opt_usb.h"skrll
2016-07-07KNF. Remove extra spaces. No functional change.msaitoh
2016-04-23Merge nick-nhusbskrll
- API / infrastructure changes to support memory management changes. - Memory management improvements and bug fixes. - HCDs should now be MP safe - conversion to KERNHIST based debug - FS/LS isoc support on ehci(4). - conversion to kmem(9) - Some USB 3 support - mostly from Takahiro HAYASHI (t-hash). - interrupt transfers now get proper DMA operations - general bug fixes - kern/48308 - uhub status notification improvements - umass(4) probe fix (applied to HEAD already) - ohci(4) short transfer fix
2011-12-23Revert previous due to active usbmp branch(es).jakllsch
2011-12-22Adjust-away inconsistent and trailing whitespace.jakllsch
2010-11-03Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),dyoung
USB_MATCH(), et cetera. These files produce the same assembly (according to objdump -d) before and after the change
2009-11-12Simplify activation hooks. (sc_dying must die!)dyoung
2009-09-23fix up USB drivers printing of autoconf informationplunky
1. expand the USB_ATTACH_SETUP macro (requested by jmcneill) 2. reorder the attach function so that the first thing it does is print newlines. 3. after this, we can call usbd_devinfo_alloc(), which polls the device allowing a context switch, and aprint_normal() the device information. this avoids problems where autoconf messages are getting mixed up.
2008-05-24Split device_t and softc for all USB device drivers, and related cosmeticcube
changes. Matthias Drochner kindly reviewed this patch, and tested ums, ubt, uaudio and ral. I tested umass myself.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-05use aprint_*_dev and device_xnamecegger
2008-02-18Use device_t and its accessor functions.dyoung
Register _childdetached methods with drivers that attach children. Wait to set child references to NULL there, instead of doing that in the detach method. Replace many uses of USB_DECLARE_DRIVER() with CFATTACH_DECL2().
2007-10-25remove #include <usbhid.h> as its not neededplunky
2007-03-13Introduce different autoconf interface attributes for USB driversdrochner
matching (and handling) a whole device and those which match an interface only. This will allow to enforce some rules, eg that the former don't use interface information for matching or that the latter don't modify global device state. The previous way left too much freedom do the drivers which led to inconsistencies and abuse. For now, I've not changed locators and submatch rules, this will happen later. There should not be any change in behaviour, except in the case of some drivers which did behave inconsistently: if_atu, if_axe, uep: matched the configured device in the interface stage, but did configuration again. I've converted them to match in the device stage. ustir, utoppy: matched in the interface stage, but only against vendor/device information, and used any configuration/interface without checking. Changed to match in device stage, and added some simple code to configure and use the first interface. If you have one of those devices, please test!
2007-01-24In detach(), check for incomplete initialisation which might happen ifdrochner
attach() encounters an error. avoids a NULL pointer dereference panic reported by Steven M. Bellovin
2006-11-16__unused removal on arguments; approved by core.christos
2006-10-12- sprinkle __unused on function decls.christos
- fix a couple of unused bugs - no more -Wno-unused for i386
2005-12-11merge ktrace-lwp.christos
2005-05-30- const poisoningchristos
- eliminate variable shadowing
2005-05-11Don't keep the devinfo string on the stack, instead use malloc/free.augustss
This should cure some rare stack overflows.
2005-02-27nuke trailing whitespaceperry
2004-09-13a round of autoconf cleanup:drochner
-convert submatch() style functions (passed to config_search() or config_found_sm()) to the locator passing variants -pass interface attributes in some cases -make submatch() functions look uniformly as far as possible -avoid macros which just hide cfdata members, and reduce dependencies on "locators.h"
2004-07-07Add another Zire device, from PR 25929.mycroft
2004-04-23use bounded string ops (snprintf, strl*)itojun
2004-01-28Add Sony Clie v3.5. From FreeBSD.augustss
2003-11-07enable support for the TREO 600carrel
tested and works...
2003-10-28Or the config_deactivate() return values.mycroft
2003-08-03Bunch of changes to make the Palm Tungsten T work:nathanw
* Mark the actual Handspring Visor as type "VISOR" and all others "PALM4" (notably, the Sony Clie 41 changes from Visor-type to Palm4-type). * For Palm4-type devices, use the GET_PALM_CONNECTION_INFORMATION query instead of the GET_CONNECTION_INFORMATION query, and interpret the returned data structure appropriately. This permits attaching a ucom device to newer devices such as the Tungsten T that do not support the Visor-style query (data structure definition gleaned from the Linux 2.4.21 visor.c). * Crank down UVISORBUFSIZE from 1024 to 64 to avoid a problem where the Palm device and the USB host controller deadlock. The USB host controller is expecting an early-end-of-transmission packet with 0 data, and the Palm doesn't send one because it's already communicated the amount of data it's going to send in a header (which ucom/uvisor are oblivious to). This is the problem that has been known on the pilot-link lists as the "[Free]BSD USB problem", but not understood. XXX It would be better for the Palm protocol to be handled entirely in userland via ugen, since the serial protocol abstraction isn't really adequate for the amount of structure that's here, and the 64-byte limit is just a workaround. The pilot-link tools aren't up to the task yet, though.
2003-04-11Use Tungsten T instead of m550.simonb
2003-02-07Add more PDAs (untested).augustss
2003-02-05Add Palm Zire. From kern/20206, Michael van Elst.augustss
2002-08-13Add Palm m515. From FreeBSD.augustss
2002-07-11Get rid of trailing white space.augustss
2002-06-16Match Sony Clie 4.1.augustss
2002-02-27Add some more stuff that might make Palm and Sony devices work.augustss
(Gleaned from Linux.)
2002-02-11Give usbd_do_request_flags() an extra argument for the timeout.augustss
2001-11-13add RCSIDslukem
2001-01-23Ad support for an extra message in the ucom attach code.augustss
2001-01-23There are more ports than meet the eye on the Visor. Connect a ucomaugustss
to each of them.
2001-01-23Make sure driver attach/detach events are generated in a consistent manner.augustss
2000-09-03Handle output packet headers in a cleaner way. From IWAMOTO Toshihiroaugustss
<iwamoto@sat.t.u-tokyo.ac.jp>, fixes kern/10573.