Commit Graph

157 Commits

Author SHA1 Message Date
mycroft e63d9a6eae Restructure interrupt handling a little:
* Only futz with the done list in the soft interrupt handler.  In the hard
  interrupt handler, do nothing except mask WDH and queue the soft interrupt.
  This simplifies a bunch of code, removes two O(n^2) queue manipulations,
  and gets rid of some really sketchy stuff around the queue head access.
* Use the auto-masking code at the end of the interrupt handler for both WDH
  and RHSC interrupts.  Again, this reduces the code a little, and avoids
  multiple writebacks to the chip registers.
2005-03-11 19:25:22 +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 330c69ca0e Make sure to ack the interrupt even if we are ignoring it. Otherwise, we will
keep coming back.
2004-12-22 19:36:13 +00:00
fvdl a3cea30b50 Implement an USB memory reserve. Allocate some memory per host controller
in the wanted bus_dma space. If an allocation fails during operation
(i.e. when hotplugging an umass device), fall back to using the reserve.

The amount can be configured as USB_MEM_RESERVE. The default value is
256k.

Ideally, there would be a way to steal pages in the desired area from
UVM, but that's far more complicated, and this is not intrusive, plus
it works.
2004-12-21 16:41:24 +00:00
augustss d32a749096 Allow strings descriptor 0 to be fetched. It's the default language index. 2004-10-26 20:46:16 +00:00
mycroft 584d70dbc1 Avoid touching the xfer after calling usb_transfer_complete(), as the
driver callback may have recycled it.  From PR 25960.
2004-07-17 20:24:15 +00:00
mycroft b48bbc8b8a Fix an error in a printf() format.
Swap the order that two items are written; possibly fixes a race condition
that would affect isoc transfers.
2004-07-06 04:53:09 +00:00
mycroft ac575d2a58 Make one message dependent on ohcidebug, so it doesn't interfere with polled
operation; e.g. when entering a root device or in DDB.
2004-06-29 03:56:04 +00:00
mycroft 7c3a6504d0 Adjust a couple of comments to make it clear WTF is going on. 2004-06-22 18:27:46 +00:00
mycroft 941901b304 Failure to properly mask off UE_DIR_IN from the endpoint address was causing
OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set spuriously, causing rather
interesting lossage.

Suddenly I get MUCH better performance with ehci...
2004-06-22 07:20:35 +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
augustss 0e57233a47 Try harder to avoid 0 ports woth AMD756. From OpenBSD. 2003-11-23 19:20:25 +00:00
augustss 50ce2db105 Fix swapped lines in cleanup in ohci_init(). From OpenBSD. 2003-11-23 19:18:06 +00:00
simonb 78c2103e34 Remove assigned-to but otherwise unused variables.
Remove unreachable break after return statements.
2003-10-18 04:50:35 +00:00
toshii 6bd45c6229 Fix a done list handling bug which exhibits under high shared interrupt
rate and bus traffic.  As the interrupt register is read after checking
hcca_done_head, there was a small chance of dropping a done list.
Ignore OHCI_WDH interrupt bit if hcca_done_head is zero so that OHCI_WDH
is processed later.
2003-10-11 03:04:26 +00:00
mycroft dad4d4580d Update actlen even in the case where a TD returns an error -- this is critical
for the umass bulk-only STALL case.
2003-09-10 20:08:29 +00:00
gson 34388cbdcc Function names printed in debug messages did not always match the
actual name of the function.
2003-05-13 04:41:59 +00:00
tsutsui 881b65ce01 Use mstohz() in <sys/param.h> rather than homegrown MS_TO_TICKS(). 2003-02-22 05:24:16 +00:00
ichiro 6236662a85 change URL pointers of USB[1,2] specification 2003-02-08 03:32:50 +00:00
simonb d7b879c6ec Grrr. So much for my ability to use grep(1) effectively. Pointed out
by Stephen Degler in private mail.
2003-01-20 07:12:12 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
toshii cf41cc5294 Add a couple of le32toh which were missing in the previous.
Pointed out by SOMEYA Yoshihiko.
2002-12-10 14:07:37 +00:00
toshii 21318640e1 Update xfer->frlengths for input isoc transfer. Based on patches from
SOMEYA Yoshihiko.
Also fix error handling for isoc transfer somewhat; usb_transfer_complete
shouldn't be called for more than once.
2002-12-07 07:33:20 +00:00
toshii 44f269f8ff Fix several nits. Mostly from SOMEYA Yoshihiko.
- Call usbd_transfer_complete at splusb.
- Fix a botched for loop in ohci_rem_ed.
- In ohci_close_pipe, wait 1ms after removing an ED to avoid possible race
 condition.
2002-12-07 07:14:28 +00:00
toshii 384b45d203 Remove junk at the end of a DPRINTF. From SOMEYA Yoshihiko. 2002-12-07 06:52:11 +00:00
augustss fc12d83285 Put some ifdefs around USB_USE_SOFTINTR stuff. From FreeBSD. 2002-09-30 16:36:19 +00:00
augustss 9dd94a1878 Remove extra call to ohci_rem_ed(). From kern/18448, Takeshi Nakayama. 2002-09-29 20:59:30 +00:00
augustss 25ff7d8c33 Add some spl calls to protect critical regions. From kern/18440,
Takeshi Nakayama.
2002-09-29 20:58:25 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
augustss 8abb6b6ba2 Fix some braindead calls to free memory (only encountered under low memory
conditions).  From OpenBSD.
2002-08-07 20:03:19 +00:00
lukem 06de426449 SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field).  whilst it's O(n),
  this mirrors the functionality of SLIST_REMOVE() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
  this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
  singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
2002-06-01 23:50:52 +00:00
augustss 0a15c2acd4 Change DMAADDR macro slightly. 2002-05-28 12:42:38 +00:00
minoura 78d97e78f0 Clear done_head in the HCCA *before* acknoledging the interrupt.
Driver lost some completed transfers under heavy loads.
2002-05-26 03:10:02 +00:00
augustss 4bc0b333ea Update dma memory access API a little. 2002-05-19 06:24:30 +00:00
augustss b32942bb23 Whitespace fixes. 2002-03-17 18:02:52 +00:00
tsutsui e01954f52a Fix a couple of typo:
- s/ehci/ohci/ (in unused arg of macro)
- s/uhci/ohci/ (in debug message)
2002-03-16 16:11:18 +00:00
augustss 7f01f1dd6b Some white space fixes from FreeBSD. 2002-02-03 18:15:20 +00:00
augustss 637dc4b2fe Change xfer abort to wait for the softintr to run. 2001-12-31 12:20:35 +00:00
augustss 04ec4ba316 Add some DIAGNOSTIC stuf that I forgot. From Nate Williams. 2001-12-27 18:48:28 +00:00
augustss d0f9a76506 Update a comment. 2001-12-27 11:27:11 +00:00
augustss 1029005107 Pay more attention to if the HC is being unplugged. 2001-11-21 08:18:39 +00:00
itojun bf755aea42 make it compilable without OHCI_DEBUG 2001-11-21 05:52:50 +00:00
augustss 28a6a57942 Use a task to perform the timeout abort so we have a process context when
sleeping.
2001-11-21 02:41:18 +00:00
augustss 5506bb0f06 Some more debug stuff. 2001-11-21 02:39:31 +00:00
augustss 2478d1b320 Cast some args to bitmask_snprintf(). 2001-11-21 02:38:35 +00:00
augustss 9716a5f26d Don't bother with interrupts when being disconnected. 2001-11-20 21:12:46 +00:00
augustss e5353fd3b5 Use longer reset for root hubs (as told in the spec). 2001-11-20 16:08:10 +00:00
augustss 7e4459fe10 Keep track of device speed for USB 2.0. 2001-11-20 13:48:03 +00:00
lukem 667807e40c add RCSIDs 2001-11-13 06:24:53 +00:00