summaryrefslogtreecommitdiffstats
path: root/drivers/staging/octeon-usb/octeon-hcd.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: Convert __FUNCTION__ to __func__Joe Perches2014-05-251-1/+1
| | | | | | | Use the normal mechanism for emitting a function name. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: Fix lines with more than 80 chars in octeon-hcd.cPaul Davies C2014-05-241-23/+66
| | | | | | | Some lines with more than 80 characters are converted in to multiple lines. Signed-off-by: Paul Davies C <pauldaviesc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: Add blank line after all declarations in octeon-hcd.cPaul Davies C2014-05-241-2/+17
| | | | | | | Add blank lines after each declarations in drivers/staging/octeon-usb/octeon-hcd.c. Signed-off-by: Paul Davies C <pauldaviesc@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use generic prefetchAaro Koskinen2014-05-241-11/+5
| | | | | | | Use generic prefetch. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete redudant prefetchesAaro Koskinen2014-05-241-2/+0
| | | | | | | | cvmx_usb_pipe fits into a cache-line so additional prefetches are not really helping anything. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging:Octeon-usb:octeon-hcd.c return valuePaul McQuade2014-05-231-1/+1
| | | | | | | return value instead of function. Signed-off-by: Paul McQuade <paulmcquad@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: prevent memory corruptionAaro Koskinen2014-03-201-0/+108
| | | | | | | | | | | | | | | | | | octeon-hcd will crash the kernel when SLOB is used. This usually happens after the 18-byte control transfer when a device descriptor is read. The DMA engine is always transfering full 32-bit words and if the transfer is shorter, some random garbage appears after the buffer. The problem is not visible with SLUB since it rounds up the allocations to word boundary, and the extra bytes will go undetected. Fix by providing quirk functions for DMA map/unmap that allocate a bigger temporary buffer when necessary. Tested by booting EdgeRouter Lite to USB stick root file system with SLAB, SLOB and SLUB kernels. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=72121 Reported-by: Sergey Popov <pinkbyte@gentoo.org> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: octeon-usb: Remove unnecessary bracketsRaluca Oncioiu2014-03-071-3/+3
| | | | | | | | | Remove brackets from single line branches of if statements. Break long lines. Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: octeon-usb: Break up long linesRaluca Oncioiu2014-03-071-202/+436
| | | | | | | Break up long lines. Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: Probe via device tree populated platform device.David Daney2014-02-071-157/+116
| | | | | | | | | | Extract clocking parameters from the device tree, and remove now dead code and types. Signed-off-by: David Daney <david.daney@cavium.com> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: hcd: move controller wakeup setting initialization to individual driverPeter Chen2013-12-081-0/+1
| | | | | | | | | | | | | | | Individual controller driver has different requirement for wakeup setting, so move it from core to itself. In order to align with current etting the default wakeup setting is enabled (except for chipidea host). Pass compile test with below commands: make O=outout/all allmodconfig make -j$CPU_NUM O=outout/all drivers/usb Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list.h for transactionsAaro Koskinen2013-10-111-41/+36
| | | | | | | Use list.h helpers for transactions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list.h for pipesAaro Koskinen2013-10-111-81/+24
| | | | | | | Use list.h helpers for pipes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list_for_each_entry_safe()Aaro Koskinen2013-10-111-2/+3
| | | | | | | Use list_for_each_entry_safe() when deleting all list items. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use list_del_init()Aaro Koskinen2013-10-111-8/+3
| | | | | | | Replace list_del() + INIT_LIST_HEAD() with list_del_init(). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use dynamic allocation for pipesAaro Koskinen2013-10-111-37/+3
| | | | | | | Use dynamic memory allocation for pipes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use dynamic allocation for transactionsAaro Koskinen2013-10-111-73/+2
| | | | | | | Use dynamic memory allocation for transactions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: use a single .h fileAaro Koskinen2013-10-111-2/+1
| | | | | | | | | Merge USBC and USBN register definitions into a single header file. Although all HW definitions are purely internal to the driver, it's better to keep them separate due to the large size of the file. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: CN3xxx: program p_xenbn and p_rclk through p_rtypeAaro Koskinen2013-10-111-14/+8
| | | | | | | | Do the clock setup through p_rtype on all OCTEONs. This enables to get rid of duplicated register definitions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete cvmx_usbnx_clk_ctl_cn50xxAaro Koskinen2013-10-111-4/+4
| | | | | | | | Add the missing bits to common clk ctl definition, and we can delete duplicated definitions. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: refactor __cvmx_usb_pipe_needs_splitAaro Koskinen2013-10-061-1/+2
| | | | | | | Split a long line and remove redundant parenthesis. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate submit_handleAaro Koskinen2013-10-061-142/+90
| | | | | | | Eliminate submit_handle, use a direct reference instead. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate pipe_handleAaro Koskinen2013-10-061-129/+92
| | | | | | | Eliminate pipe_handle, use a direct reference instead. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: clean up hcpriv usageAaro Koskinen2013-10-061-6/+6
| | | | | | | | Use ep->hcpriv for pipe handle and urb->hcpriv for submit handle, instead of packing both into the same field. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_control: get params from urbAaro Koskinen2013-10-061-46/+10
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_interrupt: get params from urbAaro Koskinen2013-10-061-21/+5
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_control: get params from urbAaro Koskinen2013-10-061-27/+6
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_submit_bulk: get params from urbAaro Koskinen2013-10-061-20/+4
| | | | | | | Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: replace generic transfer callback data with urbAaro Koskinen2013-10-061-24/+19
| | | | | | | URB is always passed, so we can use strong typing here. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: call transfer completion callback directlyAaro Koskinen2013-10-061-243/+111
| | | | | | | The callback is always the same, we can just call it directly. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: call port change callback directlyAaro Koskinen2013-10-061-101/+31
| | | | | | | Call port change callback directly. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: inline cvmx_usb_set_statusAaro Koskinen2013-10-061-27/+5
| | | | | | | Inline a trivial function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: eliminate cvmx_usb_internal_stateAaro Koskinen2013-10-061-133/+77
| | | | | | | | | Eliminate cvmx_usb_internal_state, just use cvmx_usb_state everywhere. This also enables to allocate only the needed amount of data for the USB internal state, instead of always allocating 64 KB. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: merge cvmx-usb into octeon-hcdAaro Koskinen2013-10-061-1/+3416
| | | | | | | | | | cvmx-usb module provided Cavium "OS abstraction layer" for USB functionality. To make this driver a proper Linux driver, we need to refactor this layer out. By making all the code internal to the HCD driver makes this task easier. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete redundant flags from cvmx_usb_open_pipe()Aaro Koskinen2013-10-031-1/+0
| | | | | | | Delete redudant flags parameter. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete cvmx_usb_isochronous_flagsAaro Koskinen2013-10-031-1/+0
| | | | | | | Delete unused flags. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: delete redundant flags from cvmx_usb_initialize()Aaro Koskinen2013-10-031-1/+1
| | | | | | | | The function will always figure out the used clock internally, so delete a redudant parameter and the flag. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_state_t -> struct cvmx_usb_stateAaro Koskinen2013-07-311-4/+4
| | | | | | | Replace cvmx_usb_state_t with struct cvmx_usb_state. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_iso_packet_t -> struct cvmx_usb_iso_packetAaro Koskinen2013-07-311-3/+6
| | | | | | | Replace cvmx_usb_iso_packet_t with struct cvmx_usb_iso_packet. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_port_status_t -> struct cvmx_usb_port_statusAaro Koskinen2013-07-311-2/+2
| | | | | | | Replace cvmx_usb_port_status_t with struct cvmx_usb_port_status. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_callback_t -> enum cvmx_usb_callbackAaro Koskinen2013-07-311-2/+2
| | | | | | | Replace cvmx_usb_callback_t with enum cvmx_usb_callback. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_complete_t -> enum cvmx_usb_completeAaro Koskinen2013-07-311-2/+2
| | | | | | | Replace cvmx_usb_complete_t with enum cvmx_usb_complete. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_transfer_t -> enum cvmx_usb_transferAaro Koskinen2013-07-311-1/+1
| | | | | | | Replace cvmx_usb_transfer_t with enum cvmx_usb_transfer. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: cvmx_usb_speed_t -> enum cvmx_usb_speedAaro Koskinen2013-07-311-1/+1
| | | | | | | Replace cvmx_usb_speed_t with enum cvmx_usb_speed. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: octeon-hcd: eliminate printk()sAaro Koskinen2013-06-181-2/+1
| | | | | | | Replace one printk() with dev_dbg(), and delete the other. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: octeon-hcd: delete commented-out codeAaro Koskinen2013-06-181-1/+0
| | | | | | | Delete commented-out code. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: octeon-hcd: reformat long commentsAaro Koskinen2013-06-181-22/+52
| | | | | | | Fix some comments to fit into 80 colums. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: octeon-hcd: use dev_dbgAaro Koskinen2013-06-181-88/+77
| | | | | | | | Replace DEBUG macros with dev_dbg. Some less useful are completely deleted. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: octeon-hcd: make internal variable staticAaro Koskinen2013-06-171-1/+1
| | | | | | | Make an internal variable static. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: octeon-usb: octeon-hcd: fix some includesAaro Koskinen2013-06-171-2/+2
| | | | | | | Avoid including from "asm/". Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud