summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhub.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix two more PRs:imp2007-06-301-1/+2
| | | | | | | | | | (1) Add size parameter to usbd_get_string() (2) Properly limit speed when a full speed hub is plugged into a high speed hub. Submitted by: Hans Petter Selasky PR: 80773, 79725 Approved by: re@ (kensmith)
* Change uhub to dynamic status size for status change endpoint. From aimp2007-06-291-2/+2
| | | | | | | | | | | | pr, the submitter says: Found this while running freebsd as guest in qemu with -usb parameter. The patch implements the missing dynamic size based on number of ports a hub has. Submitted by: Lonnie Mendez PR: 94946 Approved by: re@ (blanket)
* Latest round of usb cleanups:imp2007-06-211-21/+39
| | | | | | | | | | | | | | | | | | | o Consistently use device_foo_t and bus_foo_t for functions implementing device_foo and bus_foo respectively. Adjust those routines that were wrong (we should do this throughout the tree). o make all the modules depend on usb. Otherwise these modules won't load. o ucycom doesn't need usb_port.h o Minor unifdefing o uhub, umass, ums, urio, uscanner conversion complete. o ukbd: Remove the NO_SET_PROTO quirk (fixes a PR 77940). NetBSD removed their check and setting the proto a long time ago. o umodem panic fixed. UQ_ASSUME_CM_OVER_DATA quirk removed because I've never seen a umodem that needed this rejection for proection (this gets rid of ~20% of the quirks). Approved by: re@ (kensmith) PR: 77940
* Mark the few remaining drivers that haven't been converted as needingimp2007-06-181-0/+1
| | | | usb_port.h by explicitly including it.
* Expand USB_MATCH_STARTimp2007-06-171-1/+1
|
* Expand USB_DETACH, USB_ATTACH and USB_MATCH inline. No functionalimp2007-06-131-2/+4
| | | | change, and MD5's appear to be the same.
* Remove USBDEV() macro. We do not need a macro that is defined as itsimp2007-06-121-5/+4
| | | | only argument. It was used inconsistently in the tree, so remove it.
* Remove devinfo junk.imp2007-06-091-7/+2
| | | | | | Remove bogus bzero/memset Expand USB_ATTACH_SETUP Minor nits
* Fix build (sc->dev => sc->sc_dev).flz2007-02-031-1/+1
|
* Fix memory leak of devinfo. The leak itself was documented inimp2007-02-031-122/+66
| | | | | | | | | | | | | | | | | | PR/108719, but there's a simpler fix: free it after it is used, and then get rid of the redundant frees this causes. Other leaks in this PR not yet fixed. While I'm here, remove NetBSD/OpenBSD code and some of the portability #defines that were getting in the way of understanding this code. The devinfo bug was harder to spot because one needed to know that device_set_desc_copy() was used inside of one of them (one that didn't take an argument!). Prefer device_printf(sc->sc_dev, "...") to printf("%s:...", device_get_nameunit(sc->sc_dev)). This saves almost 300 bytes. PR: 108719 Submitted by: Antoine Brodin
* More removing compatibility macros.imp2006-09-071-23/+23
| | | | | | md5 still the same. "Dave, stop. I feel my mind slipping away." -- hal
* s/Static/static/gimp2006-09-061-7/+7
| | | | | | | | | | s/device_ptr_t/device_t/g No md5 changes in the .o's # Note to the md5 tracking club: $FreeBSD$ changes md5 after every commit # so you need to checkout -kk to get $FreeBSD$ instead of the actual value # of the keyword.
* Provide the USB device release number along with other parametersiedowse2005-08-231-4/+4
| | | | | | | | so that devd can match on it. This field was already available to usbd and is used by a number of usbd.conf entries, so now it is possible to transfer those entries to devd.conf. Submitted by: Anish Mistry
* Take out Giant in uhub_child_* in giant. There's one place where weimp2005-05-111-9/+16
| | | | | | | could sleep which I think can lead to races. However, there are fewer with this code than without it. Submitted by: Hans Petter Selasky
* Use usbd_get_string() instead of calling usbd_get_string_desc()iedowse2005-03-251-15/+3
| | | | | | | | | with the wrong language parameter when retrieving the device serial number. This invalid request caused some devices not to work at all. PR: usb/79190 Submitted by: Hans Petter Selasky <hselasky@c2i.net>
* Root hubs don't have transaction translators, so skip printing theiedowse2005-03-201-1/+1
| | | | message about them if the hub depth is zero.
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* When a port cannot be set up, report the error code in the `disablingiedowse2004-11-091-2/+2
| | | | port X' message.
* Merge recent USB2/EHCI related changes from NetBSD:iedowse2004-11-031-4/+44
| | | | | | | | | | | | | | | | o Reduce the interrupt delay to 2 microframes. o Follow the spec more closely when updating the overlay qTD in the QH. o No need to generate an interrupt at the data part of a control transfer, it's generated by the status transfer. o Make sure to update the data toggle on short transfers. o Turn the printf about needing toggle update into a DPRINTF. o Keep track of what high speed port (if any) a device belongs to so we can set the transaction translator fields for the transfer. o Verbosely refuse to open low/full speed pipes that depend on unimplemented split transaction support. o Fix various typos in comments. Obtained from: NetBSD
* We don't need a uhub_child_detached() routine now that we don't detachimp2004-09-091-34/+2
| | | | | | | | | | | | | | device_t instances when no driver attaches. They are left around, and we need to remember them. # The usbd_device_handle->subdevs[] array likely is completely bogus # at this point, but one change at a time, since its removal will need # to have similar code replace it extracted from newbus. Part of the patch submitted by Peter Pentchev after an excellent analysis of the underlying problems. MFC After: 1 week
* Tweak the compatibility macros a little so that the device printing isimp2004-08-151-1/+0
| | | | moved into them.
* Next step in making usb more newbus:imp2004-08-141-26/+14
| | | | | | | | | | | | | o reprobe children when a new driver is added to uhub o fix the usbd_probe_and_attach to set the ivars to a malloc'd area, as well as freeing the ivars on child destruction. o Don't delete children that don't attach. Evidentally, the need to do this is a common misconception. o minor formatting foo that may violate style(9) at the moment, but keeps the diffs against my p4 tree smaller. This does not solve the ugen gobbling things up problem, but the fixes I have for that expose bugs in other parts of the tree...
* Make the USB subsystem unloadable and detachable, though currentlyiedowse2004-08-021-1/+2
| | | | | a significant amount of memory may be leaked each time a host controller is detached.
* Remove redundant inclusion of bus_if.h. It isn't needed in this file, asimp2004-07-221-1/+0
| | | | sys/bus.h includes it.
* MFp4:imp2004-07-221-30/+29
| | | | | | | Improve child_detached a little and make it conform better to style(9). Also, improve comment about what we'll be doing in the future about driver_added. Soon it will be possible to kldload usb drivers and have them attach w/o a need to disconnect/reconnect them.
* MFNetBSD.le2004-07-011-2/+5
| | | | | | | | rev. 1.68, author: mycroft Ignore a port error that happens to come in at the same time as a connect status change. Some root hubs seem to report both. Obtained from: NetBSD
* Add pnpinfo and location information to uhub. We also keep track ofimp2004-06-301-0/+107
| | | | | | the subdevices of uhub better now to accomplish this. Submitted by: Bernd Walter
* Initialise `restartcnt' in the newly malloc'd usbd_port structure,iedowse2004-06-101-0/+1
| | | | | | | | | as otherwise the junk it contains may cause uhub_explore to give up without ever trying to restart the port. This fixes the following errors I was seeing with a VIA UHCI controller: uhub0: port error, restarting port 1 uhub0: port error, giving up port 1
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Merge up-to-date with NetBSD. No functional changes.joe2003-07-141-6/+2
|
* MFNetBSD:joe2003-07-141-5/+3
| | | | | | | date: 2002/10/01 01:25:25; author: thorpej; Use CFATTACH_DECL(). Not a functional change on FreeBSD.
* MFNetBSD:joe2003-07-141-2/+1
| | | | | | date: 2002/09/23 05:51:20; author: simonb; Remove breaks after returns, unreachable returns and returns after returns(!).
* MFNetBSD:joe2003-07-141-1/+5
| | | | | date: 2003/02/08 03:32:51; author: ichiro; change URL pointers of USB[1,2] specification
* As defined by USB Specification Rev 2.0 (in section 11.24.2.5), tojoe2003-07-141-1/+1
| | | | | | | | | | | | | | get a Hub descriptor, we have to set req.wValue to "Descriptor Type and Descriptor Index". In this case, Descriptor Type is 0x29 (UDESC_HUB), Descriptor Index should be 0. If I don't do a check (dev->address > 1 ... ), root hub fails. A new Cytronix 4-port USB 2.0 Hub (Cypress CY7C65640 chip) now works after this patch. Submitted by: Alexander Pohoyda <alexander.pohoyda@gmx.net> MFC after: 7 days
* WARNING: white space diffjmg2003-07-041-15/+15
| | | | | | This code reduces the number of trailing white space to be more in line w/ NetBSD. I don't regenerate usbdevs, saving that for when it really changes.
* Use the hw.usb sysctl tree instead of debug.usb.joe2002-08-081-1/+2
| | | | Requested by: imp
* Replace the FOO_DEBUG definitions with USB_DEBUG, and switch thejoe2002-07-311-1/+1
| | | | | | debugging levels to off by default. Now that debug levels can be tweaked by sysctl we don't need to go through hoops to get the different usb parts to produce debug data.
* Wake up Joe! It would help if I included sys/sysctl.h.joe2002-07-311-0/+1
|
* Add a sysctl (debug.usb.uhub) for tweaking the uhub debug levels.joe2002-07-311-1/+3
|
* Avoid reprobing on loading a driver. This does not work as the ivars setn_hibma2002-06-171-0/+15
| | | | | | | | | during the previous probe are stale. What really should be done is route the probe through device_probe_and_attach bit this is one of those ICBBATIASS (I can't be bothered as there is a simpler solution). The user can easily replug the device after kldloading a new device driver.
* Reduce the difference between our version and NetBSD's. (Nojoe2002-04-071-11/+10
| | | | functional changes.)
* MFNetBSD:joe2002-04-071-1/+2
| | | | | | revision 1.57 date: 2001/11/20 16:08:37; author: augustss; state: Exp; lines: +3 -2 Add a comment.
* MFNetBSD: ohci.c (1.109), uhci.c (1.144), uhub.c (1.56), usb.c (1.57),joe2002-04-071-1/+1
| | | | | | | | usbdi.c (1.86), usbdivar.h (1.66) [Some partial, because most of this was merged in a while ago] date: 2001/11/20 13:48:03; author: augustss; Keep track of device speed for USB 2.0.
* MFNetBSD:joe2002-04-071-3/+3
| | | | | | revision 1.55 date: 2001/11/16 02:21:54; author: augustss; state: Exp; lines: +4 -4 Better error message.
* MFNetBSD: uhub.c (1.54), usb_subr.c (1.92)joe2002-04-071-1/+18
| | | | | date: 2001/11/16 01:57:47; author: augustss; Handle devices that disappear during reset gracefully.
* MFNetBSD:joe2002-04-071-2/+8
| | | | | | revision 1.52 date: 2001/10/26 17:53:59; author: augustss; state: Exp; lines: +8 -2 Compare pointer with NULL instead of using them as a condition.
* MFNetBSD:joe2002-04-071-3/+3
| | | | | | revision 1.51 date: 2001/10/24 15:30:17; author: augustss; state: Exp; lines: +3 -3 Better debug message.
* MFNetBSD: uhub.c (1.49), usb.c (1.51), usbdi.h (1.48), usbdivar.h (1.63)joe2002-04-021-2/+3
| | | | | | | | | date: 2001/01/21 19:00:06; author: augustss; Change the operation of the USB event thread. Before it only performed USB device discovery, now it can also perform (short) tasks for device drivers that need a process context, but don't have one. This is not pretty, but better than using busy-wait in an interrupt context.
* Merge from NetBSD:joe2002-02-191-4/+13
| | | | | * rev 1.47: Update a URL * rev 1.56: Keep track of device speed for USB 2.0.
* Merge from NetBSD.joe2002-01-281-1/+4
| | | | | | | | | | | | | | | | | | | | uhub.c: revision 1.37 usb.4: revision 1.30 usb.c: revision 1.38 usb.h: revision 1.40 usb_port.h: revision 1.21 usb_subr.c: revision 1.65 usbdi.h: revision 1.40 Split the attach/detach events up into device, driver and controller attach and detach events. The commit message from NetBSD was: date: 2000/02/02 07:34:00; author: augustss; state: Exp; Change the USB event mechanism to include more information about devices and drivers. Partly from FreeBSD. Also rework usbd to take these new event types into account.
OpenPOWER on IntegriCloud