Commit Graph

90 Commits

Author SHA1 Message Date
ad
a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
drochner
27622eb242 Work around imperfect hub emulation in the ehci root hub (ohci is affected
too, but that's not critical): real hubs send port status change
notifications until acknowledged, ehci/ohci send only once so there is
a chance that this gets lost if notifications are disabled during a scan.
The temporary fix is to force a rescan; the real fix will involve a
change in interrupt handling in ehci/ohci which needs more work and
testing.
ehci is critical because a port status change during scan regularely
happens if a full/lowspeed device is connected, due to the handover
process.
Fixes a problem where full/lowspeed devices were not reattached after
a disconnect, reported by Kouichirou Hiratsuka and Juan RP
on current-users.
2007-03-23 21:51:34 +00:00
drochner
4d1d1f005b fix variable in DEBUG code, from Lubomir Kundrak per PR kern/36036 2007-03-19 14:02:56 +00:00
drochner
82d96e1fac Keep track of the per-port status change notifications coming in
through the interrupt pipe; during exploration check only the ports
where we got such a notification. This speeds up things.
(I believe we should go a step further and use a thread per hub
instead of per bus. If power management gets implemented, we should
be able to react quickly on a resume event.)
Try to simplify the logics in the explore function a bit. (The reattach
thing was hacked in badly, not sure whether I broke it. Only used
by if_atu.)
Clean up some dead code.
2007-03-15 15:29:09 +00:00
drochner
8258b792b7 Introduce different autoconf interface attributes for USB drivers
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-03-13 13:51:53 +00:00
drochner
a0afd1c3d9 Remove the check which disallows to connect a bus powered hub to another
bus powered hub. While one can interpret the spec that way, it is not
stated clearly, and is at most a side effect of power budgeting.
Also, there are devices which don't report correctly whether they
are self powered, so the check was unreliable.
2007-02-26 13:33:09 +00:00
drochner
9659abca43 Allocate storage for status change notifications dynamically, depending
on the number of ports. One byte wasn't even sufficient for 8 ports.
The code doesn't make use of the status bits yet, but it might be used
to speed up the exploration loop later.
2007-01-07 16:50:02 +00:00
drochner
d395a37b84 -comment out transaction translator support for now, it doesn't do more
than allocating memory, and it does wrongly use the hub's capabilities
 but not the actual setting
-switch a high-speed hub to "multiple TTs" but ignore errors; since
 we don't care whether there is one or multiple this is a "best effort"
 thing
2006-12-01 20:48:50 +00:00
drochner
263cbcd833 don't specify a polling interval for the interrupt pipe -- that's
what the descriptor is good for
2006-11-30 16:30:33 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
drochner
f0834e56c6 clean up the USB attachment stuff a bit: use a dedicated interface
attribute ("usbdevif") to attach USB devices, be it a plain device or
a hub, and remove some strangeness caused by the former usb/uhub mess
2006-10-24 21:03:30 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos
cd2eb11f45 Coverity CID 2330: Spell out that we are going to use the memory we allocated. 2006-04-14 16:26:46 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
augustss
834327c847 Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows.
2005-05-11 10:02:28 +00:00
augustss
5283bc3d82 Root hubs don't have transaction translators, so don't print anything
about them for depth 0.  From FreeBSD.
2005-04-30 20:54:13 +00:00
mycroft
2d562a01e2 Copyright maintenance. 2005-03-02 11:37:27 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
joff
9a12dd0ebe Implementation requirements of usb_needs_reattach(), from OpenBSD and required
for atu(4) to do a USB reconnect after firmware upload.
2005-01-24 01:30:38 +00:00
augustss
4d2499feda Free memory in the correct order. Pointed out by Jeff Rizzo. 2004-10-26 05:00:59 +00:00
augustss
90d454c7f7 Keep track of what high speed port (if any) a device belongs to so we can
set the transaction translator fields for the transfer.
Add a gross hack for split transaction completion in the ehci driver that
allows control transfers to be translated.  Interrupt transfers do not work.
Warn when any low/full speed device is opened.
2004-10-23 16:17:56 +00:00
augustss
4eb781d843 Print information for high speed hubs about the number of TTs.
Print a message when low/full speed devices are ignored on high speed hubs.
2004-10-22 12:03:21 +00:00
mycroft
658b1114e7 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.
2004-06-29 06:30:05 +00:00
petrov
3936b06424 Initialize restartcnt. from FreeBSD. 2004-06-11 17:25:47 +00:00
itojun
300aa0dcd5 use bounded string ops (snprintf, strl*) 2004-04-23 17:25:25 +00:00
toshii
05069ebd4d Use the correct wValue to get hub desriptors.
Also, make wValue checks of root hub codes less strict.
2003-12-29 08:17:10 +00:00
ichiro
6236662a85 change URL pointers of USB[1,2] specification 2003-02-08 03:32:50 +00:00
dsainty
439063014c Initialise uhubdebug so that it's patchable in a kernel image 2003-01-02 03:20:09 +00:00
thorpej
b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej
90c48d2563 Use CFATTACH_DECL(). 2002-10-01 01:25:25 +00:00
thorpej
bf97c13c6c Declare all cfattach structures const. 2002-09-27 20:41:46 +00:00
simonb
4e3613273b Remove breaks after returns, unreachable returns and returns after
returns(!).
2002-09-23 05:51:10 +00:00
augustss
86650920c9 Get rid of trailing white space. 2002-07-11 21:14:24 +00:00
augustss
7679101a11 Add a comment. 2001-11-20 16:08:37 +00:00
augustss
7e4459fe10 Keep track of device speed for USB 2.0. 2001-11-20 13:48:03 +00:00
augustss
3b323cfaae Better error message. 2001-11-16 02:21:54 +00:00
augustss
3db4a768d4 Handle devices that disappear during reset gracefully. 2001-11-16 01:57:47 +00:00
lukem
667807e40c add RCSIDs 2001-11-13 06:24:53 +00:00
augustss
dc901ef1f3 Compare pointer with NULL instead of using them as a condition. 2001-10-26 17:53:59 +00:00
augustss
97d4315865 Better debug message. 2001-10-24 15:30:17 +00:00
augustss
c5a4cc1291 Only clear the endpoint on stall (from FreeBSD). 2001-09-28 23:42:16 +00:00
augustss
df20cb2972 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.
2001-01-21 19:00:06 +00:00
augustss
79f0bd6e1f Update many URLs. 2000-12-29 01:24:55 +00:00
augustss
d71044b313 Don't give up so easily if the device does not respond properly.
Mostly from Nick Hibma (FreeBSD).
2000-09-24 02:08:38 +00:00
augustss
4b45dfbb69 Fix a device diconnect bug found by Christian Groessler <cpg@aladdin.de>. 2000-09-22 02:34:58 +00:00
augustss
ed9486e158 Bring the coding style into the 80s, i.e., get rid of __P and use
ANSI prototypes and declarations.
2000-06-01 14:28:57 +00:00
augustss
30c20f930f Change my email address. 2000-04-27 15:26:44 +00:00
augustss
46fb8de93a Use a 255 ms interrupt interval even if the descriptor in the hub asks
for something else, because the spec says that it should be 255.
2000-04-21 19:51:43 +00:00
augustss
3d9d091685 Change the exact sequence of commands when a hub is attached to follow
Windoze more closely.  This makes more devices work.

After two years of doing USB work I've finally access to a USB protocol
analyzer.  Which means I should be able to mimic what Windoze does in
certain cases instead of just following the specs.  Following the specs
is not enough since the devices often don't.
2000-04-21 16:05:50 +00:00
augustss
fc72e72d7d Change (almost) all static to Static. The symbol `Static' can then be defined
to `' or `static' depending on if you want to debug or not.
2000-03-27 12:33:53 +00:00