Commit Graph

23 Commits

Author SHA1 Message Date
Nikunj A Dadhania b25d5796db usb: print unhandled descriptor in debug mode
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-12-09 15:52:15 +11:00
Thomas Huth edd582383f Stack optimization in libusb: split up setup_new_device()
When scanning hubs, the code in libusb can be called recursively, for
example usb_hub_init() calls setup_new_device(), which then calls
slof_usb_handle() to execute Forth code for the next device.
If that next device is a hub, we end up recursively in usb_hub_init()
again.
Since stack space is limited in SLOF, we can optimize here a little
bit by splitting up the setup_new_device() function into the part
that retrieves the descriptors (which takes most of the stack space
in this code path since the descriptors are placed on the stack),
and the part that populates the the device tree node of the new
device (which is responsible for the recursion).

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-12-01 17:02:04 +11:00
Nikunj A Dadhania a6c2d4cfd2 usb-core: adjust port numbers in set_address
There is a mismatch between the port number between qemu and slof. Was
unearthed while using bootindex.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-26 10:10:48 +05:30
Nikunj A Dadhania 8281a9333c usb-xhci: memory freeing and using returns as bool uniformly
* Fix freeing of memory in error path
* Boolean and int were used interchangebly at various points,
  consolidate it to use boolean

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-16 15:40:04 +05:30
Nikunj A Dadhania 7bc3d6b7d7 Fix dprintf macros at various points
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-16 13:59:30 +05:30
Nikunj A Dadhania 32dcbfadcd usb-xhci: add xhci host controller support
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-15 10:36:51 +05:30
Nikunj A Dadhania ce91e6a282 usb-xhci: add xhci support
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-11-15 10:36:51 +05:30
Nikunj A Dadhania 22c4d4b3ae usb-core: disable xhci
Code still does not support xhci, disable creation of xhci node, as it
was causing crash in the quiesce path.

Also check if ops pointer is verified before accessing function
pointers during usb_hcd_exit.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-15 22:23:28 +05:30
Nikunj A Dadhania 2b14fb9a9e usb-msc: handle stall and other fixes
* Add Reset Recovery procedure
* Zero cbw and csw memory everytime
* Add delays during cbw, data and csw stage
* Increment tag after every command

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:01:21 +05:30
Nikunj A Dadhania 50302c3eb9 usb-core: Add CLEAR FEATURE api
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 12:01:20 +05:30
Nikunj A Dadhania 1abf624dfb usb: fix various issues found with js2x
* JS20 exposed various timing related issues that were not apparent in
  the emulated environment.
* Reset the USB Bus
* JS20 overrides the frame_interval and periodic_start on setting the
  controller to USB operational. Reprogram them.
* ohci fix the data-toggle bits.
* Robust error handling

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:50:02 +05:30
Nikunj A Dadhania 5a75cd882e usb: Use separate in-memory endian swap
Convert pending in-memory byteswaps to accessors

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-08-21 10:49:41 +05:30
Benjamin Herrenschmidt fa6de662a9 usb: Fix a couple of warnings
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-08-06 16:03:55 +10:00
Nikunj A Dadhania d7354e2724 usb: unmap buffers
Clean up all the dma allocated buffers and remove their mappings.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 4be0500365 USB storage driver
* Integrated with generic scsi
* Support multiple LUNs

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
[ Changed to adapt to latest scsi rework ]
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Avik Sil 56795bfabe usb-core: add usb bulk support
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 6eb646603d USB keyboard driver
Portions of keyboard driver(usb-key.h and usb-hid.c) inherited from
code originally written by former SLOF team

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 2deb222c4c usb-core: setup new device
* Configures the newly found usb devices.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Fixes-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 912a746dc1 usb-core: create dev pool allocation
Have a device structure pool and provide apis usb_devpool_[get,put]

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 91826241af usb-core: usb send control
Introduce generice usb_send_control and implement correspoding stubs
in ohci and ehci

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 0376b7eb56 usb-core: implement usb_{get,put}_pipe routines
Generic routines to get pipe structure from controller.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30
Nikunj A Dadhania a4e14d308f usb-core: hcd registration and query routines
* usb-core: hcd registration
  	    query hcd operations structure
            hcd controller init routines
* usb-ohci: stub ochi controller init

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30
Nikunj A Dadhania c4ddc59f67 usb-core: registration and makefiles
* Introduce libusb
* USB core register routine and required forth changes
* USB OHCI skeleton file

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@de.ibm.com>
2013-07-24 14:46:22 +05:30