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>
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>
* 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>
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>
* 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>
* 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>
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>
* 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>
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>
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>
* 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>
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>
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>
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>