History log of /haiku/src/add-ons/kernel/busses/usb/uhci.h
Revision Date Author Comments
# 629f071b 27-Feb-2024 X512 <danger_mail@list.ru>

pci: extend MSI interrupt vector number to 32 bits

Also increase MSI message data size to 32 bits according to PCIe spec.

Remove 0xff check for MSI interrupts because it is potentially valid
interrupt vector number. Reject 0xff only for legacy pin interrupts.

- MSI-X supports up to 2048 interrupts per device that do not fit to
`uint8`.

- Non-x86 systems may use separate interrupt vector ranges for
hard-wired interrupts and MSI interrupts so `uint8` is not enough to
represent all of them.

Change-Id: Iaf9ffb197ec23db0f97ffe3ea756d28d7bfc8705
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7433
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 55a46882 30-May-2023 Augustin Cavalier <waddlesplash@gmail.com>

USB: Support physical-vector bulk requests.

Introduce a new utility method, "generic_memcpy", which takes
generic_addr_t plus indications of whether these specify virtual or
physical addresses (and potentially user addresess) and calls the
appropriate memcpy variant depending.

All bus drivers adjusted to support this at once. We don't actually
take advantage of the physical addresses in any way (yet), as USB
controllers have some pretty specific requirements that would have
to be carefully validated to use these directly.

All bus drivers tested and confirmed to still be working.

Change-Id: I66326667e148091147bb2b3d0843a26fb7e5bda6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6479
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 99626c29 29-May-2023 Augustin Cavalier <waddlesplash@gmail.com>

USB: Use generic_io_vec in Transfer.

Prepares the way for actual physical-address request support,
which is not yet wired up.

Change-Id: I1b2d04a31e334a79b8361280fa0f3a5fbdb43d2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6478
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# e6ce95c5 10-Oct-2022 Jérôme Duval <jerome.duval@gmail.com>

usb: register device nodes for hubs and devices

the device identifier is the USBID. no actual interface to be used by drivers.

Change-Id: I9fd1fdab0d02f1b82380c619b39bc3a12a9e2333
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5736
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 547ddb90 01-Oct-2022 Jérôme Duval <jerome.duval@gmail.com>

uhci: switch to the new driver API

Change-Id: Ifc95a32066d0089d3fd41e489604d58815c074af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5711
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 5c6d92d7 12-Apr-2019 Augustin Cavalier <waddlesplash@gmail.com>

busses/usb: Move ::AddTo to be above the class constructors.

It is called before them (and is responsible for calling them),
so having it in the middle of the file does not make a lot of sense.

Already done for XHCI. Only one functional change -- removing the
set_dprintf_enabled call. Drivers probably shouldn't spuriously
re-enable that if it was specifically disabled.


# 159aa93b 31-Aug-2014 Michael Lotz <mmlr@mlotz.ch>

USB: Generalize logic for debug transfers used within KDL.

Pull debug transfer methods into the base BusManager class and
implement them for UHCI and EHCI. This makes it possible to have a
single debugger command installed by the USB stack instead of HCI
specific ones.


# c45ac5ad 30-Jul-2013 Jerome Duval <jerome.duval@gmail.com>

UHCI USB: add MSI support

* similar to OHCI support by mmlr.
* interrupt handler is removed on destruction.


# 2997a191 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Fixed UHCI for x86_64.


# 8bcc50c3 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added arch_debug_blue_screen_try_getchar() and arch_debug_serial_try_getchar()
which don't wait for a character, but return -1 when no character is
available ATM. Implemented correctly for x86 only.
* Changed the semantics of the debugger_module_info::debugger_getchar() hook.
It is supposed to return immediately now.
* Adjusted usb_keyboard accordingly. Hacked UHCI's debug_process_transfer() to
achieve that. It does now start, check, or cancel a transfer. Split
UHCI::ProcessDebugTransfer() into StartDebugTransfer(), and
CheckDebugTransfer() accordingly, and also added a CancelDebugTransfer().
The latter seems to have issues. Michael, please have a look. I have no clue
what I'm doing. :-)
* Adjusted kgetc() to poll all possible inputs using the new
functions/semantics. This allows to use any input (USB, PS/2, serial) in KDL.
* Removed the no longer needed "serial_input" command.
* read_line(): Also support 0x7f as backspace code. That's what xterm sends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42126 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 38fc536e 14-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

Some more constness.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36250 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 853e6be8 14-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

* Rename usb_p.h to usb_private.h.
* Some automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36247 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1393394b 22-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

We need to guarantee that when cancel returns that the callback won't be called
anymore. It could happen that the transfer was already in the process of being
finished, so wasn't in the list of pending transfers anymore. Cancel would then
return even though the callback wasn't called yet. This could lead to a callback
being called after a driver was already unloaded (even after it cleaned up the
pipes it used).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33239 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 527e6eef 11-May-2009 Michael Lotz <mmlr@mlotz.ch>

Do not free the descriptor chains and transfer queue head directly when
finishing transfers. The host controller might still be using some of those
structures. In the (unlikely) case that a freed memory chunk would be
immediately re-used and filled with new values this would lead the controller
to either find invalid values and assert a process error or it could follow
invalid list links leading to host system errors. We have to wait with freeing
until the controller processing the next frame to make sure this cannot happen.
The unlikely case should also have been the cause of bug #2481.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aaf77384 11-May-2009 Michael Lotz <mmlr@mlotz.ch>

Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30713 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6eba0636 22-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Added simplified possibility to schedule UHCI transfers from within KDL.
* Added debugger commands to resolve usb_ids to pipes.
* Adjusted the physical memory allocator to be usable in a slimmed down mode
when running inside the kernel debugger.
* Implemented USB keyboard support for KDL through a kernel debugger add-on.
* Added kgetc() and made use of it where previously individual methods were used
to ensure that reading characters always goes through the kernel debugger
add-ons and the other methods.

This has some preconditions to meet though:
1) The keyboard must be in the boot protocol (currently the case but needs to
be revisited once we have a full usb_hid).
2) The keyboard must be attached to a UHCI root port (i.e. not use EHCI or OHCI,
also not through hubs unless those are USB 1.1).
3) the usb_hid driver has to be opened for this to work. This means that for the
time between initializing USB and when usb_hid is opened by the input_server
there is no keyboard support.

Also note that this has no way of detecting hot-plug, meaning that you can't
re-attach your USB keyboard from the hub to the root port once in KDL.

On the bright side of things, since this is a non-destructive mechanism it is
possible to enter and leave KDL without loosing the USB state.

Tested OK in QEMU, not tested on real hardware yet, will see in a few minutes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29291 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f14fe767 23-Jan-2009 Michael Lotz <mmlr@mlotz.ch>

* Rework the USB tracing mechanism. Cleaned it up and make it more convenient to
use. It will now print out the usb_ids of the objects that generate the trace
messages. These IDs are unique compared to the device address used previously,
because device addresses are per bus while usb_ids are global. This makes
trace output from devices across multiple controllers distinguishable.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29002 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b1385bc3 06-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

* When encountering an unrecoverable error at least turn off interrupts until
we properly handle this case (cancel everything and reset the controller) to
avoid flooding the system with interrupts.
* Also only check for enabled interrupts to not steal potentially shared
interrupts.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25823 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b07b8e0 28-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b5d39e8 23-Jan-2008 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Added force paramater to CancelQueuedIsochronousTransfers along with a TODO
* Replaced space with tab


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 187574cf 23-Nov-2007 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Small clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22985 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 13508e8b 14-Nov-2007 Michael Lotz <mmlr@mlotz.ch>

Completely redesign the USB explore process. Replaces the scary race conditions of the previous locking mechanism and simplifies handling of device changes by a more centralized approach.
Changes are now collected during explore and notifications as well as rescans are done at once. Through this a driver is also not rescanned multiple times anymore.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22929 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ee21f1bc 13-Oct-2007 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Fix some bugs introduced by myself ;)
* Removed IOC bit on last TD. To find out whether the TD removed is the
last one of a transfer it simply iterate through every transfer submitted. Not the best
solution, but should be ok for now. Improvements will be made when there will be some driver to test it with.
* Clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22545 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16298429 10-Aug-2007 Michael Lotz <mmlr@mlotz.ch>

Change the way UHCI does things. Restructured processing of transfers in the finisher thread:
* Transfer removal is now done only from the finisher
* Processing is only done after the transfer has been removed from the list
* Canceling transfers only sets a flag so the finisher can remove the transfer
* The callback at cancel is done synchronously though

This fixes quite a few race conditions where transfers were processed while they where already removed. It could happen before that callbacks would have been called twice or freed descriptors/callback buffers were accessed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21882 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7ca97e35 17-Jul-2007 Michael Lotz <mmlr@mlotz.ch>

Patches by Salvatore Benedetto to fix changes made by me and also the underlaying problem that caused high CPU usage in the isochronous finisher thread. Also includes patches to support isochronous support through USBKit / usb_raw. Thanks!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21636 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 21727943 27-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Fixing bug #1284.

* Rearranged isochronous finishing to happen from within the finisher thread
* Removed the separate isochronous finishing thread

Since the finisher thread blocks when no transfers are complete this should bring down CPU load.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21516 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac9d1195 25-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Commiting patch by Salvatore Benedetto. This adds isochronous handling to the USB bus manager and enables inbound isochronous support in the UHCI driver. Thanks!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21503 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6bdd7b4 27-May-2007 François Revol <revol@free.fr>

Patch by Salvatore Benedetto:
Code readability; portability fixes.
Added unimplemented SubmitIsochronous().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40fd2328 07-May-2007 Jérôme Duval <korli@users.berlios.de>

implemented CancelQueuedTransfers for uhci


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21057 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ad50dab 25-Mar-2007 Michael Lotz <mmlr@mlotz.ch>

Fixed design flaw in the UHCI fragment implementation and a memory leak both introduced in the last commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20418 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 145461d5 25-Mar-2007 Michael Lotz <mmlr@mlotz.ch>

Implemented fragmented USB transfers. The transfer length will max out at a certain point to not overflow the allocator. The fragmented transfers are resubmitted until all fragments are sent / received.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20416 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9c8cdfd8 07-Jan-2007 Michael Lotz <mmlr@mlotz.ch>

* Reworked transfer queuing so that each transfer is grouped with it's own queue head
* Fixed max packet size under bandwidth reclamation
* Increased the thread priority of the finisher thread so that USB input devices should be more responsible under load
* Added a comment to clarify the queue concept

The queue management should now be less complex and less error prone.
The max packet size is now set to 64 bytes which is the maximum size allowed. Transfers that caused babble errors before should now work.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19738 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7145ff17 20-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented compatibility workaround for BeOS to be able to write user memory from the kernel finisher thread

This fixes crashing of the USB Mass Storage driver under R5. It is fully working there now.
I hope to be able to do this more cleanly under Haiku though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18894 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bcc2d1b6 15-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented usable thread synchronisation for UHCI and EHCI.
* Cleaned interrupt handlers for both busses, too.
* Fixed memory leak of the queue head stray descriptors in EHCI.
* Fixed warnings about assigning NULL to the module flags field.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18857 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8fedfdfc 30-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Rewrote some stack internals (again). Everything is now created using a parent object that shares the BusManager and Stack information to reduce individual constructors.
* Don't inherit Device and Interface from pipes anymore. The device has a default pipe member now.
* Since the parent of each Object is now known, we can send control messages using the default pipe of the device from all attached elements (pipes and interfaces).
* Fixed the generic {Set|Clear}Feature() and GetStatus() calls to include the endpoint address for pipe specific requests.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18710 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ffe3f107 27-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Redisigned some of the USB Stack. Unified constructors, removed redundant functions and moved some other functions around
* Implemented the EHCIRootHub
* Reworked UHCIRootHub to be more of a utility class and moved the actual work into the UHCI BusManager
* Implemented port reset in EHCI. Ports with low and fullspeed devices are now correctly handed over to the companion host controller.

Attachs and detachs as well as port resetting / enabling works now in EHCI. Only the actual data transfers are missing thereafter ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18656 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e857d24 25-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Adding skeleton EHCI driver. Some parts filled from the specs and the UHCI driver.
* Corrected some errors I found while reading UHCI.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18626 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02ce23a1 24-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Unified and disabled TRACEing for the usb stack and uhci hcd
* Fixed warnings
* Some cleanup
* Added myself as an author to some files

No functional changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18614 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1e8c0b36 19-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented iovec based data handling in Transfer and UHCI
* Implemented QueueBulkV of the v3 API that uses it

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18540 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b0ec61f 19-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Added USB API Version 3. It's put into USB3.h while the v2 API resides in USB2.h. USB.h just includes USB2.h for now.
* Rewrote both headers on the way.
* The usb module now exports both, the v2 and v3 module_info.
* Changed the internals of the USB Stack to give out usb_ids instead of opaque handles to internal classes.
* Cleaned up some more of the Stack by moving members into other classes and removing unused stuff.
* Updated the usb_raw driver from v2 to v3 API.

Since both usb_hid (which still uses the v2 API) and usb_raw (which now uses the v3 API) work, I'd call it a success ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18539 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 49617128 14-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Fixed data toggle handling. It must be taken after the transfer finished and from the last transmitted transfer descriptor (which in case of a short packet is not neccessarily the last descriptor of the chain)
* Moved convenience endpoint requests from ControlPipe to Pipe

With this change, bulk transfers are fairly stable now. See here for evidence: http://haiku.mlotz.ch/haiku-usb01.png ;). Those are pictures from my Canon Digital Ixus 750 downloaded with Exposure using the PTP plugin. I of course navigated Haiku with my USB Logitech iFeel mouse which works nice since some days.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18510 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d83f3c1a 13-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Fixed setting configurations (need to use the configuration_value instead of the index of course)
* Fixed reported power status of the UHCI Root Hub
* Added preservation of the SOF_MODIFY register when doing a global reset of the UHC
* Read out the actual length for outgoing transfers too
* Made actual length handling for transfers a bit safer and correct in respect to NULL packets
* Use short packet detect to handle short packets
* First step at implementing the hub interrupt

Since the devices are now configured correctly, some bulk transfers actually work. Also my hub now reports its status correctly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18506 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f1020a6c 12-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Changed the Stack lock to a benaphore
* Removed some debug output from UHCI
* Added some debug output to the usb module instead ;)
* Rewrote the way new devices are attached and ports are handled (now more similar to FreeBSD)
* Corrected handling of port resets so that they should work on hubs too
* Cleaned up some headers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18499 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8c6a851 11-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented most of the USB module public API (using opaque handles like in R5 will change that to using IDs later)
* Fixed the UHCI root hub and the hub implementation. Interface and endpoint descriptors are part of the configuration descriptor, they cannot be requested individually.
* Added simple support for interrupt and bulk transfers to UHCI. It's enough to get my USB mouse working to a stable and usable degree.
* Cleaned up and reworked some other parts, added allocation checks and such.

Yes, my internet connection is back up :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18496 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ba81a76 23-Jul-2006 Michael Lotz <mmlr@mlotz.ch>

Continuing work on the USB stack and UHCI driver.
* Moved the transfer descriptor management into the UHCI class
* Added locking to the driver and the queues
* Added service thread for finished transfers (to be implemented correctly)
* Cleaned up some headers and added myself as author

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18245 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64312bc9 28-May-2006 Michael Lotz <mmlr@mlotz.ch>

* Moved the transfer descriptor handling to separate functions
* Added debugging facilities
* Implemented the data stage of control messages

The device descriptor can now be successfully retrieved. Now interrupt, bulk and isochronous data transfers need to be implemented.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17623 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64d49b54 28-May-2006 Michael Lotz <mmlr@mlotz.ch>

And another forgotten header. Sorry to pollute the logs :-).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17617 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 26f34d1c 27-May-2006 Michael Lotz <mmlr@mlotz.ch>

* Cleaned up / applied style to the BusManager class
* Fixed some copy&paste errors I introduced earlier
* Removed the "one UHCI bus only" limit
* Other fixes

The hub now sees when a new device is connected but failes when getting its descriptor.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17611 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 76e69839 27-May-2006 Michael Lotz <mmlr@mlotz.ch>

The framelist was allocated in the object which caused the host controller to fail. Also the root hub is now setup after the host controller is started since new devices are created which use transfers to discover their parameters. The controller should now be correctly initialized and stay up.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17610 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 12b05115 27-May-2006 Michael Lotz <mmlr@mlotz.ch>

Picking up work on the USB stack. First of all adapting the style of the UHCI driver. Not yet working any more than until now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17607 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67c3d9eb 11-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed building of the UHCI and OHCI modules [reported by AndyBe].


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15914 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6ea6477 19-Aug-2005 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Some major reworking. Re-enable the old way of building up the framelist pointers. MAke some parts more verbose for testing. Fix the stray td to actually something useful.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13993 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5a072ced 14-Mar-2005 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Quick merge of my development branch with mainline (for SVN switch).
The OHCI stuff was done by Jixt (thanks)./installusb
All is still very much work in progress

Patches applied:

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--base-0
tag of Niels.Reedijk@gmail.com--haiku-2005/usb-busses--mainline--0.1--base-0

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-1
Set the PORT_STATUS_LOW_SPEED flag correctly (using the register bitflag for low speed devices, instead of the proper lowspeed flag)

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-2
Clean up transfers when they're done

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-3


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-4


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-5


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-6


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-7
Remove obsolete ehci.c

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-8


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-9
Completed memory allocation + initialization

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-10
First attempt at performing control transfers - failed miserably

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-11
Trying to read a 16bit value into a 8bit integer, stupid

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-12
nicer way of getting the base io address

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-13
Take over control from BIOS

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-14
Revert change for disabling USB BIOS support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11743 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77a66901 19-Jul-2004 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Summary: Merge in recent changes
Keywords:

Patches applied:

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-12
Update/add license header

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-13
Changes to init routine and memory management

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-14
Move uhci_properties_t into its own header -- cleans up the implementation

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-15
Add a virtual schedule that can be used to hook in all kinds of transfers

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-16
Improve rh handling

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-17
Change module to be subclass of BusManager

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-18
Reimplemented the uhci root hub

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-19
merge with mainline


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8422 a95241bf-73f2-0310-859d-f6bbb57e9c96


# df870398 13-Apr-2004 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Summary: Several changes to the root hub managing code
Keywords:

Patches applied:

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-4
Commit because of switch of development machines

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-5
Support for hub descriptors

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-6
Some more hub-management code


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7192 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07b15fef 30-Dec-2003 Niels Sascha Reedijk <niels.reedijk@gmail.com>

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-1
Fix things up before big changes
* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-2
Continued development on device initialisation
* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-3
Finished Driver initialisation


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5831 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1501c2bf 12-Aug-2003 Niels Sascha Reedijk <niels.reedijk@gmail.com>

This is just an outline of the USB stack: what it is going to look like. It is definately not
ready for testing. Also the documentation is far from complete (it's in it's early phases).
Unfortunately I don't have enough experience in hardware programming to prototype
it first, so I'll be testing the things that I design in the document.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4275 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 159aa93b31cb5d926ef4939a16419e7d02979b1c 31-Aug-2014 Michael Lotz <mmlr@mlotz.ch>

USB: Generalize logic for debug transfers used within KDL.

Pull debug transfer methods into the base BusManager class and
implement them for UHCI and EHCI. This makes it possible to have a
single debugger command installed by the USB stack instead of HCI
specific ones.


# c45ac5ad59cf7fea1595e471f46e8e5400e69cec 30-Jul-2013 Jerome Duval <jerome.duval@gmail.com>

UHCI USB: add MSI support

* similar to OHCI support by mmlr.
* interrupt handler is removed on destruction.


# 2997a1912589c1b6c3276eaa4ab797040cd69230 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Fixed UHCI for x86_64.


# 8bcc50c336108e882e215c8c5cec57155464edf4 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added arch_debug_blue_screen_try_getchar() and arch_debug_serial_try_getchar()
which don't wait for a character, but return -1 when no character is
available ATM. Implemented correctly for x86 only.
* Changed the semantics of the debugger_module_info::debugger_getchar() hook.
It is supposed to return immediately now.
* Adjusted usb_keyboard accordingly. Hacked UHCI's debug_process_transfer() to
achieve that. It does now start, check, or cancel a transfer. Split
UHCI::ProcessDebugTransfer() into StartDebugTransfer(), and
CheckDebugTransfer() accordingly, and also added a CancelDebugTransfer().
The latter seems to have issues. Michael, please have a look. I have no clue
what I'm doing. :-)
* Adjusted kgetc() to poll all possible inputs using the new
functions/semantics. This allows to use any input (USB, PS/2, serial) in KDL.
* Removed the no longer needed "serial_input" command.
* read_line(): Also support 0x7f as backspace code. That's what xterm sends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42126 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 38fc536e0525ec97d60d4bdd29dbe68e4b17ec13 14-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

Some more constness.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36250 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 853e6be8ca7117d62f497d539aa044adc2fdf573 14-Apr-2010 Michael Lotz <mmlr@mlotz.ch>

* Rename usb_p.h to usb_private.h.
* Some automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36247 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1393394ba6adde434020a48e5d9b7b22822150b0 22-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

We need to guarantee that when cancel returns that the callback won't be called
anymore. It could happen that the transfer was already in the process of being
finished, so wasn't in the list of pending transfers anymore. Cancel would then
return even though the callback wasn't called yet. This could lead to a callback
being called after a driver was already unloaded (even after it cleaned up the
pipes it used).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33239 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 527e6eefef6ac11ed9047845d4890c75947de892 11-May-2009 Michael Lotz <mmlr@mlotz.ch>

Do not free the descriptor chains and transfer queue head directly when
finishing transfers. The host controller might still be using some of those
structures. In the (unlikely) case that a freed memory chunk would be
immediately re-used and filled with new values this would lead the controller
to either find invalid values and assert a process error or it could follow
invalid list links leading to host system errors. We have to wait with freeing
until the controller processing the next frame to make sure this cannot happen.
The unlikely case should also have been the cause of bug #2481.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# aaf773849933563f0a6dbdf7816bbbfc9c65b6e3 11-May-2009 Michael Lotz <mmlr@mlotz.ch>

Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30713 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6eba063647cc4ff5aa863e1b5dc5093c22a3acb0 22-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Added simplified possibility to schedule UHCI transfers from within KDL.
* Added debugger commands to resolve usb_ids to pipes.
* Adjusted the physical memory allocator to be usable in a slimmed down mode
when running inside the kernel debugger.
* Implemented USB keyboard support for KDL through a kernel debugger add-on.
* Added kgetc() and made use of it where previously individual methods were used
to ensure that reading characters always goes through the kernel debugger
add-ons and the other methods.

This has some preconditions to meet though:
1) The keyboard must be in the boot protocol (currently the case but needs to
be revisited once we have a full usb_hid).
2) The keyboard must be attached to a UHCI root port (i.e. not use EHCI or OHCI,
also not through hubs unless those are USB 1.1).
3) the usb_hid driver has to be opened for this to work. This means that for the
time between initializing USB and when usb_hid is opened by the input_server
there is no keyboard support.

Also note that this has no way of detecting hot-plug, meaning that you can't
re-attach your USB keyboard from the hub to the root port once in KDL.

On the bright side of things, since this is a non-destructive mechanism it is
possible to enter and leave KDL without loosing the USB state.

Tested OK in QEMU, not tested on real hardware yet, will see in a few minutes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29291 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f14fe767bf568186bbd0678e35b03c99d8a264c6 23-Jan-2009 Michael Lotz <mmlr@mlotz.ch>

* Rework the USB tracing mechanism. Cleaned it up and make it more convenient to
use. It will now print out the usb_ids of the objects that generate the trace
messages. These IDs are unique compared to the device address used previously,
because device addresses are per bus while usb_ids are global. This makes
trace output from devices across multiple controllers distinguishable.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29002 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b1385bc32d5b482f08e960629194af418b1aa882 06-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

* When encountering an unrecoverable error at least turn off interrupts until
we properly handle this case (cancel everything and reset the controller) to
avoid flooding the system with interrupts.
* Also only check for enabled interrupts to not steal potentially shared
interrupts.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25823 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b07b8e0f1a7f1e76f31db24a21a42cbb01d7b9c 28-May-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Replaced all instances of benaphores in the kernel code by mutexes.
* Removed kernel benaphores.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25690 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b5d39e85946c3f9f0a4452332675b5cd680f794 23-Jan-2008 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Added force paramater to CancelQueuedIsochronousTransfers along with a TODO
* Replaced space with tab


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23715 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 187574cf691a28c022868e1533d5540937dc9556 23-Nov-2007 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Small clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22985 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 13508e8bd034aac27c2e3271aefa04e255520d99 14-Nov-2007 Michael Lotz <mmlr@mlotz.ch>

Completely redesign the USB explore process. Replaces the scary race conditions of the previous locking mechanism and simplifies handling of device changes by a more centralized approach.
Changes are now collected during explore and notifications as well as rescans are done at once. Through this a driver is also not rescanned multiple times anymore.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22929 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ee21f1bcb75f8d0d629a7fd56b0007256d726724 13-Oct-2007 Salvatore Benedetto <salvatore.benedetto@gmail.com>

* Fix some bugs introduced by myself ;)
* Removed IOC bit on last TD. To find out whether the TD removed is the
last one of a transfer it simply iterate through every transfer submitted. Not the best
solution, but should be ok for now. Improvements will be made when there will be some driver to test it with.
* Clean up


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22545 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16298429e5bdf3b579c0e6fcdeee34867a6e474b 10-Aug-2007 Michael Lotz <mmlr@mlotz.ch>

Change the way UHCI does things. Restructured processing of transfers in the finisher thread:
* Transfer removal is now done only from the finisher
* Processing is only done after the transfer has been removed from the list
* Canceling transfers only sets a flag so the finisher can remove the transfer
* The callback at cancel is done synchronously though

This fixes quite a few race conditions where transfers were processed while they where already removed. It could happen before that callbacks would have been called twice or freed descriptors/callback buffers were accessed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21882 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7ca97e354826f2569efddb8100b32d8f61db9c59 17-Jul-2007 Michael Lotz <mmlr@mlotz.ch>

Patches by Salvatore Benedetto to fix changes made by me and also the underlaying problem that caused high CPU usage in the isochronous finisher thread. Also includes patches to support isochronous support through USBKit / usb_raw. Thanks!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21636 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2172794336d98f822ede847be20b7f6c5664fe2d 27-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Fixing bug #1284.

* Rearranged isochronous finishing to happen from within the finisher thread
* Removed the separate isochronous finishing thread

Since the finisher thread blocks when no transfers are complete this should bring down CPU load.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21516 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ac9d119566e5c19de0279483c4847996b2f1a879 25-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Commiting patch by Salvatore Benedetto. This adds isochronous handling to the USB bus manager and enables inbound isochronous support in the UHCI driver. Thanks!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21503 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6bdd7b4a90e593d260c84b449643030b52417da 27-May-2007 François Revol <revol@free.fr>

Patch by Salvatore Benedetto:
Code readability; portability fixes.
Added unimplemented SubmitIsochronous().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40fd2328176d31eda2e778f189ef94eb41163f1c 07-May-2007 Jérôme Duval <korli@users.berlios.de>

implemented CancelQueuedTransfers for uhci


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21057 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3ad50dab2ecad0e4ec61c1b0d5f4134f04443605 25-Mar-2007 Michael Lotz <mmlr@mlotz.ch>

Fixed design flaw in the UHCI fragment implementation and a memory leak both introduced in the last commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20418 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 145461d547a8e5e1be7ad8b31cc974caf893b884 25-Mar-2007 Michael Lotz <mmlr@mlotz.ch>

Implemented fragmented USB transfers. The transfer length will max out at a certain point to not overflow the allocator. The fragmented transfers are resubmitted until all fragments are sent / received.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20416 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9c8cdfd89ea9681cb5fbf163f5d833028cd09caa 07-Jan-2007 Michael Lotz <mmlr@mlotz.ch>

* Reworked transfer queuing so that each transfer is grouped with it's own queue head
* Fixed max packet size under bandwidth reclamation
* Increased the thread priority of the finisher thread so that USB input devices should be more responsible under load
* Added a comment to clarify the queue concept

The queue management should now be less complex and less error prone.
The max packet size is now set to 64 bytes which is the maximum size allowed. Transfers that caused babble errors before should now work.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19738 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7145ff1705037d7310ea0d608484279c1dabfa64 20-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented compatibility workaround for BeOS to be able to write user memory from the kernel finisher thread

This fixes crashing of the USB Mass Storage driver under R5. It is fully working there now.
I hope to be able to do this more cleanly under Haiku though.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18894 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bcc2d1b69a3c9b2a7951b894ad3e5579dcbaffa1 15-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented usable thread synchronisation for UHCI and EHCI.
* Cleaned interrupt handlers for both busses, too.
* Fixed memory leak of the queue head stray descriptors in EHCI.
* Fixed warnings about assigning NULL to the module flags field.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18857 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8fedfdfcf8f931cd52a6e934a5b4e0aca565cf99 30-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Rewrote some stack internals (again). Everything is now created using a parent object that shares the BusManager and Stack information to reduce individual constructors.
* Don't inherit Device and Interface from pipes anymore. The device has a default pipe member now.
* Since the parent of each Object is now known, we can send control messages using the default pipe of the device from all attached elements (pipes and interfaces).
* Fixed the generic {Set|Clear}Feature() and GetStatus() calls to include the endpoint address for pipe specific requests.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18710 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ffe3f107c4ae65ec52128bb36115779fe07a01c0 27-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Redisigned some of the USB Stack. Unified constructors, removed redundant functions and moved some other functions around
* Implemented the EHCIRootHub
* Reworked UHCIRootHub to be more of a utility class and moved the actual work into the UHCI BusManager
* Implemented port reset in EHCI. Ports with low and fullspeed devices are now correctly handed over to the companion host controller.

Attachs and detachs as well as port resetting / enabling works now in EHCI. Only the actual data transfers are missing thereafter ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18656 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e857d24ca41743874f6b3c08bb0c35f53df5763 25-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Adding skeleton EHCI driver. Some parts filled from the specs and the UHCI driver.
* Corrected some errors I found while reading UHCI.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18626 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 02ce23a1adaf30f7d8a63fd953bb5314ea560d55 24-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Unified and disabled TRACEing for the usb stack and uhci hcd
* Fixed warnings
* Some cleanup
* Added myself as an author to some files

No functional changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18614 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1e8c0b3649ff4915369402f2e005b486ef6e7dfb 19-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented iovec based data handling in Transfer and UHCI
* Implemented QueueBulkV of the v3 API that uses it

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18540 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b0ec61f972bca106675a66c37354e38efb8016d 19-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Added USB API Version 3. It's put into USB3.h while the v2 API resides in USB2.h. USB.h just includes USB2.h for now.
* Rewrote both headers on the way.
* The usb module now exports both, the v2 and v3 module_info.
* Changed the internals of the USB Stack to give out usb_ids instead of opaque handles to internal classes.
* Cleaned up some more of the Stack by moving members into other classes and removing unused stuff.
* Updated the usb_raw driver from v2 to v3 API.

Since both usb_hid (which still uses the v2 API) and usb_raw (which now uses the v3 API) work, I'd call it a success ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18539 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 49617128ca4b55143325c5f7b8358e0307ad047d 14-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Fixed data toggle handling. It must be taken after the transfer finished and from the last transmitted transfer descriptor (which in case of a short packet is not neccessarily the last descriptor of the chain)
* Moved convenience endpoint requests from ControlPipe to Pipe

With this change, bulk transfers are fairly stable now. See here for evidence: http://haiku.mlotz.ch/haiku-usb01.png ;). Those are pictures from my Canon Digital Ixus 750 downloaded with Exposure using the PTP plugin. I of course navigated Haiku with my USB Logitech iFeel mouse which works nice since some days.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18510 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d83f3c1a45d231f5ec4e3c1127d5f44a9b54fb00 13-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Fixed setting configurations (need to use the configuration_value instead of the index of course)
* Fixed reported power status of the UHCI Root Hub
* Added preservation of the SOF_MODIFY register when doing a global reset of the UHC
* Read out the actual length for outgoing transfers too
* Made actual length handling for transfers a bit safer and correct in respect to NULL packets
* Use short packet detect to handle short packets
* First step at implementing the hub interrupt

Since the devices are now configured correctly, some bulk transfers actually work. Also my hub now reports its status correctly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18506 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f1020a6c4914d769f910ae85158a8fb9c9c060f7 12-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Changed the Stack lock to a benaphore
* Removed some debug output from UHCI
* Added some debug output to the usb module instead ;)
* Rewrote the way new devices are attached and ports are handled (now more similar to FreeBSD)
* Corrected handling of port resets so that they should work on hubs too
* Cleaned up some headers

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18499 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b8c6a85136cd56e8cf3282ca69b0d2d2832a3eee 11-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented most of the USB module public API (using opaque handles like in R5 will change that to using IDs later)
* Fixed the UHCI root hub and the hub implementation. Interface and endpoint descriptors are part of the configuration descriptor, they cannot be requested individually.
* Added simple support for interrupt and bulk transfers to UHCI. It's enough to get my USB mouse working to a stable and usable degree.
* Cleaned up and reworked some other parts, added allocation checks and such.

Yes, my internet connection is back up :)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18496 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ba81a767e9e8cd36ddd627853ae12bcf1c6b71c 23-Jul-2006 Michael Lotz <mmlr@mlotz.ch>

Continuing work on the USB stack and UHCI driver.
* Moved the transfer descriptor management into the UHCI class
* Added locking to the driver and the queues
* Added service thread for finished transfers (to be implemented correctly)
* Cleaned up some headers and added myself as author

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18245 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64312bc94c57de0bf7e32d5ac78d252c5c853912 28-May-2006 Michael Lotz <mmlr@mlotz.ch>

* Moved the transfer descriptor handling to separate functions
* Added debugging facilities
* Implemented the data stage of control messages

The device descriptor can now be successfully retrieved. Now interrupt, bulk and isochronous data transfers need to be implemented.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17623 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64d49b54fc2175cd871a071ec7109c4fc9420e57 28-May-2006 Michael Lotz <mmlr@mlotz.ch>

And another forgotten header. Sorry to pollute the logs :-).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17617 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 26f34d1c060c40ce975424e164274177c8f7b4c6 27-May-2006 Michael Lotz <mmlr@mlotz.ch>

* Cleaned up / applied style to the BusManager class
* Fixed some copy&paste errors I introduced earlier
* Removed the "one UHCI bus only" limit
* Other fixes

The hub now sees when a new device is connected but failes when getting its descriptor.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17611 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 76e69839f76c48846006908179cc0191d4e8b10c 27-May-2006 Michael Lotz <mmlr@mlotz.ch>

The framelist was allocated in the object which caused the host controller to fail. Also the root hub is now setup after the host controller is started since new devices are created which use transfers to discover their parameters. The controller should now be correctly initialized and stay up.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17610 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 12b05115348a8efc0d8dcf4332dcd38f4eefe5fd 27-May-2006 Michael Lotz <mmlr@mlotz.ch>

Picking up work on the USB stack. First of all adapting the style of the UHCI driver. Not yet working any more than until now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17607 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67c3d9ebe54b5344d58f06011314440f214528bd 11-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed building of the UHCI and OHCI modules [reported by AndyBe].


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15914 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6ea6477c06eb772e8ebe69be1f18d7fd1c913e2 19-Aug-2005 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Some major reworking. Re-enable the old way of building up the framelist pointers. MAke some parts more verbose for testing. Fix the stray td to actually something useful.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13993 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5a072ced7588fd5525ca52d9ce1d45a2d0786b2d 14-Mar-2005 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Quick merge of my development branch with mainline (for SVN switch).
The OHCI stuff was done by Jixt (thanks)./installusb
All is still very much work in progress

Patches applied:

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--base-0
tag of Niels.Reedijk@gmail.com--haiku-2005/usb-busses--mainline--0.1--base-0

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-1
Set the PORT_STATUS_LOW_SPEED flag correctly (using the register bitflag for low speed devices, instead of the proper lowspeed flag)

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-2
Clean up transfers when they're done

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-3


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-4


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-5


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-6


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-7
Remove obsolete ehci.c

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-8


* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-9
Completed memory allocation + initialization

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-10
First attempt at performing control transfers - failed miserably

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-11
Trying to read a 16bit value into a 8bit integer, stupid

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-12
nicer way of getting the base io address

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-13
Take over control from BIOS

* Niels.Reedijk@gmail.com--nielx-2005/usb-busses--development--0.1--patch-14
Revert change for disabling USB BIOS support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11743 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 77a66901a8fdf18feb5082a33a6bcd6e1d382a36 19-Jul-2004 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Summary: Merge in recent changes
Keywords:

Patches applied:

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-12
Update/add license header

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-13
Changes to init routine and memory management

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-14
Move uhci_properties_t into its own header -- cleans up the implementation

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-15
Add a virtual schedule that can be used to hook in all kinds of transfers

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-16
Improve rh handling

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-17
Change module to be subclass of BusManager

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-18
Reimplemented the uhci root hub

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-19
merge with mainline


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8422 a95241bf-73f2-0310-859d-f6bbb57e9c96


# df870398e811cf34c92d634d0254141d2a20c840 13-Apr-2004 Niels Sascha Reedijk <niels.reedijk@gmail.com>

Summary: Several changes to the root hub managing code
Keywords:

Patches applied:

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-4
Commit because of switch of development machines

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-5
Support for hub descriptors

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-6
Some more hub-management code


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7192 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 07b15fef0c5748b82ec8c4db1e6db74469f90c41 30-Dec-2003 Niels Sascha Reedijk <niels.reedijk@gmail.com>

* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-1
Fix things up before big changes
* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-2
Continued development on device initialisation
* n.reedijk@planet.nl--nielx-2003/usb-busses--development--0.1--patch-3
Finished Driver initialisation


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5831 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1501c2bf3ec93a4548eba2168d29c0bb68d31589 12-Aug-2003 Niels Sascha Reedijk <niels.reedijk@gmail.com>

This is just an outline of the USB stack: what it is going to look like. It is definately not
ready for testing. Also the documentation is far from complete (it's in it's early phases).
Unfortunately I don't have enough experience in hardware programming to prototype
it first, so I'll be testing the things that I design in the document.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4275 a95241bf-73f2-0310-859d-f6bbb57e9c96