1
0
Fork 0
Commit Graph

168 Commits (cab054ab47fa3fdf1c597a9874363680bfdab33e)

Author SHA1 Message Date
Aaro Koskinen 120ee599b5 staging: octeon-usb: prevent memory corruption
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>
2014-03-20 01:51:12 +00:00
Raluca Oncioiu b49f11335d Staging: octeon-usb: Remove unnecessary brackets
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>
2014-03-07 16:10:54 -08:00
Raluca Oncioiu 1da69aa92b Staging: octeon-usb: Break up long lines
Break up long lines.

Signed-off-by: Raluca Oncioiu <raluca.oncioiu91@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 16:08:01 -08:00
David Daney b91619c284 staging: octeon-usb: Probe via device tree populated platform device.
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>
2014-02-07 09:11:28 -08:00
Peter Chen 3c9740a117 usb: hcd: move controller wakeup setting initialization to individual driver
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>
2013-12-08 18:06:46 -08:00
Aaro Koskinen 5669601d92 staging: octeon-usb: use list.h for transactions
Use list.h helpers for transactions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:46:00 -07:00
Aaro Koskinen 4a23ee1bd7 staging: octeon-usb: use list.h for pipes
Use list.h helpers for pipes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:46:00 -07:00
Aaro Koskinen f011fefa8a staging: octeon-usb: use list_for_each_entry_safe()
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>
2013-10-11 15:46:00 -07:00
Aaro Koskinen 244544a185 staging: octeon-usb: use list_del_init()
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>
2013-10-11 15:45:59 -07:00
Aaro Koskinen d2695a8a3d staging: octeon-usb: use dynamic allocation for pipes
Use dynamic memory allocation for pipes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen a2dfef06e6 staging: octeon-usb: use dynamic allocation for transactions
Use dynamic memory allocation for transactions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:59 -07:00
Aaro Koskinen f121910396 staging: octeon-usb: use a single .h file
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>
2013-10-11 15:45:59 -07:00
Aaro Koskinen 7d7bc26b1d staging: octeon-usb: CN3xxx: program p_xenbn and p_rclk through p_rtype
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>
2013-10-11 15:45:59 -07:00
Aaro Koskinen 34b70b9e05 staging: octeon-usb: delete cvmx_usbnx_clk_ctl_cn50xx
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>
2013-10-11 15:45:59 -07:00
Aaro Koskinen d8d8e148fd staging: octeon-usb: delete unused cvmx_usbnx_usbp_ctl_status definitions
cvmx_usbnx_usbp_ctl_status was multiplied for different OCTEONS and all
those definitions are unused. Delete them.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11 15:45:58 -07:00
Aaro Koskinen aa87afe207 staging: octeon-usb: refactor __cvmx_usb_pipe_needs_split
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>
2013-10-06 22:02:22 -07:00
Aaro Koskinen 3e1674c093 staging: octeon-usb: eliminate submit_handle
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 60f815078f staging: octeon-usb: eliminate pipe_handle
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen be44063df5 staging: octeon-usb: clean up hcpriv usage
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen e16b5e3f14 staging: octeon-usb: cvmx_usb_submit_control: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 9fdbb6964b staging: octeon-usb: cvmx_usb_submit_interrupt: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 2ae09e8721 staging: octeon-usb: cvmx_usb_submit_control: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 9ccca70718 staging: octeon-usb: cvmx_usb_submit_bulk: get params from urb
Get the transfer parameters from urb.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 0cce1004c1 staging: octeon-usb: replace generic transfer callback data with urb
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 75ee512487 staging: octeon-usb: call transfer completion callback directly
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 393e214686 staging: octeon-usb: call port change callback directly
Call port change callback directly.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 29a202fa76 staging: octeon-usb: inline cvmx_usb_set_status
Inline a trivial function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06 22:02:21 -07:00
Aaro Koskinen cb61c60098 staging: octeon-usb: eliminate cvmx_usb_internal_state
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 6570b4a991 staging: octeon-usb: merge cvmx-usb into octeon-hcd
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>
2013-10-06 22:02:21 -07:00
Aaro Koskinen 72b80113a6 staging: octeon-usb: cvmx-usb.h: make comments to fit into 80 columns
Make comments to fit into 80 columns.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:12 -07:00
Aaro Koskinen ab09e5c148 staging: octeon-usb: cvmx-usb.c: make comments to fit into 80 columns
Make comments to fit into 80 columns.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen d0adff6acd staging: octeon-usb: cvmx-usb: delete unused macros
Delete unused cvmx_read_csr / cvmx_write_csr macros.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 5bffcff517 staging: octeon-usb: eliminate CVMX_PREFETCH_PREFX
Eliminate CVMX_PREFETCH_PREFX.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 1e50e9ac31 staging: octeon-usb: eliminate CVMX_PREFETCH_PREF0
Eliminate CVMX_PREFETCH_PREF0.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 10828735df staging: octeon-usb: delete CVMX_PREFETCH128
Delete unused macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:06 -07:00
Aaro Koskinen 5e77a281eb staging: octeon-usb: inline CVMX_PREFETCH0
Inline CVMX_PREFETCH0 macro.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen e50aa24e79 staging: octeon-usb: replace CVMX_CLZ with __fls()
Replace CVMX_CLZ macro with __fls().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen e43de55ce2 staging: octeon-usb: delete redundant flags from cvmx_usb_open_pipe()
Delete redudant flags parameter.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen 951a444c61 staging: octeon-usb: delete redundant flags from __cvmx_usb_submit_transaction()
Delete redundant flags parameter.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen 5dc0316c1b staging: octeon-usb: delete cvmx_usb_isochronous_flags
Delete unused flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:38:05 -07:00
Aaro Koskinen 9be317e69e staging: octeon-usb: delete redundant flags from cvmx_usb_initialize()
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>
2013-10-03 13:38:05 -07:00
Thomas Meyer 0a69bb4691 staging: octeon-usb: Cocci spatch "noderef"
sizeof when applied to a pointer typed expression gives the size of the
pointer.
Found by coccinelle spatch "misc/noderef.cocci"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:53:39 -07:00
Aaro Koskinen b9cc16c03d staging: octeon-usb: eliminate remaining typedef unions
Remaining typedef unions can be trivially eliminated with the pattern:

	foo_t -> union foo

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:50 -07:00
Aaro Koskinen 47509e4a9c staging: octeon-usb: cvmx_usb_control_header_t -> union cvmx_usb_control_header
Replace cvmx_usb_control_header_t with union cvmx_usb_control_header.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:49 -07:00
Aaro Koskinen 2bf249e482 staging: octeon-usb: cvmx_usb_internal_state_t -> struct cvmx_usb_internal_state
Replace cvmx_usb_internal_state_t with struct cvmx_usb_internal_state.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:48 -07:00
Aaro Koskinen 0ff6ac84f9 staging: octeon-usb: cvmx_usb_tx_fifo_t -> struct cvmx_usb_tx_fifo
Replace cvmx_usb_tx_fifo_t with struct cvmx_usb_tx_fifo_t.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:47 -07:00
Aaro Koskinen bb06528d6e staging: octeon-usb: cvmx_usb_pipe_list_t -> struct cvmx_usb_pipe_list
Replace cvmx_usb_pipe_list_t with struct cvmx_usb_pipe_list.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:46 -07:00
Aaro Koskinen 4ec3ae8412 staging: octeon-usb: cvmx_usb_pipe_t -> struct cvmx_usb_pipe
Replace cvmx_usb_pipe_t with struct cvmx_usb_pipe.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:46 -07:00
Aaro Koskinen 48f61f832d staging: octeon-usb: cvmx_usb_transaction_t -> struct cvmx_usb_transaction
Replace cvmx_usb_transaction_t with struct cvmx_usb_transaction.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:51:45 -07:00
Aaro Koskinen a24ed35a19 staging: octeon-usb: cvmx_usb_state_t -> struct cvmx_usb_state
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>
2013-07-31 17:51:44 -07:00
Aaro Koskinen 6e0e1b0069 staging: octeon-usb: cvmx_usb_iso_packet_t -> struct cvmx_usb_iso_packet
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>
2013-07-31 17:51:43 -07:00
Aaro Koskinen 51a19621cc staging: octeon-usb: cvmx_usb_port_status_t -> struct cvmx_usb_port_status
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>
2013-07-31 17:51:43 -07:00
Aaro Koskinen 03f9adf44c staging: octeon-usb: cvmx_usb_stage_t -> enum cvmx_usb_stage
Replace cvmx_usb_stage_t with enum cvmx_usb_stage.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:10 -07:00
Aaro Koskinen 4f1d6ba901 staging: octeon-usb: cvmx_usb_transaction_flags_t -> enum cvmx_usb_transaction_flags
Replace cvmx_usb_transaction_flags_t with enum cvmx_usb_transaction_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:09 -07:00
Aaro Koskinen ff9a3e3982 staging: octeon-usb: cvmx_usb_isochronous_flags_t -> enum cvmx_usb_isochronous_flags
Replace cvmx_usb_isochronous_flags_t with enum cvmx_usb_isochronous_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:08 -07:00
Aaro Koskinen 3f937c51b4 staging: octeon-usb: cvmx_usb_pipe_flags_t -> enum cvmx_usb_pipe_flags
Replace cvmx_usb_pipe_flags_t with enum cvmx_usb_pipe_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:07 -07:00
Aaro Koskinen 1c25754815 staging: octeon-usb: cvmx_usb_initialize_flags_t -> enum cvmx_usb_initialize_flags
Replace cvmx_usb_initialize_flags_t with enum cvmx_usb_initialize_flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:50:06 -07:00
Aaro Koskinen e53b624ae5 staging: octeon-usb: cvmx_usb_callback_t -> enum cvmx_usb_callback
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>
2013-07-31 17:49:06 -07:00
Aaro Koskinen 1c1bdf2764 staging: octeon-usb: cvmx_usb_complete_t -> enum cvmx_usb_complete
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>
2013-07-31 17:49:06 -07:00
Aaro Koskinen f1e1c1f69e staging: octeon-usb: cvmx_usb_direction_t -> enum cvmx_usb_direction
Replace cvmx_usb_direction_t with enum cvmx_usb_direction.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31 17:49:05 -07:00
Aaro Koskinen 394d4e080f staging: octeon-usb: cvmx_usb_transfer_t -> enum cvmx_usb_transfer
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>
2013-07-31 17:49:04 -07:00
Aaro Koskinen 4918072eb0 staging: octeon-usb: cvmx_usb_speed_t -> enum cvmx_usb_speed
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>
2013-07-31 17:49:04 -07:00
Aaro Koskinen 12aede9f2f staging: octeon-usb: cvmx-usb: reformat documentation
Reformat the high-level documentation to human readable plain text by
removing HTML and other tags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:29 -07:00
Aaro Koskinen 3d1dc6adf0 staging: octeon-usb: cvmx-usb: delete CVS keyword markers
Delete CVS keyword markers.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:29 -07:00
Aaro Koskinen 46e0270c25 staging: octeon-usb: cvmx-usb: convert @return
Convert "@return" to "Returns: ".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:29 -07:00
Aaro Koskinen 116c163f99 staging: octeon-usb: cvmx-usb: convert @param
Convert "@param name" inside comments to "@name:".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:25 -07:00
Aaro Koskinen a6945527d3 staging: octeon-usb: cvmx-usb: delete duplicated documentation from .h file
Delete duplicated function call documentation from the .h file. These
functions are just internal anyway, and the .h file will be completely
removed in the future when the driver will be made a single self-contained
.c file.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:24 -07:00
Aaro Koskinen 6995ae41b3 staging: octeon-usb: cvmx-usb: delete @INTERNAL
Delete "@INTERNAL" from comments.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen 1084937123 staging: octeon-usb: cvmx-usb: reformat long comments
Reformat long comments according to multi-line comment style.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen eeb90cb287 staging: octeon-usb: cvmx-usb: fix whitespace issues
Fix most of the whitespace issues reported by checkpatch:
	- use tabs for indentation
	- brace placement vs. newlines
	- (foo_t*) -> (foo_t *)
	- i=0 -> i = 0

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen 95e67a7a29 staging: octeon-usb: cvmx-usb: delete __cvmx_usb_complete_to_string()
Delete a redundant function.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen 5645bcf98b staging: octeon-usb: cvmx-usb: replace cvmx_le16_to_cpu with le16_to_cpu
Replace cvmx_le16_to_cpu() with le16_to_cpu().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:43:23 -07:00
Aaro Koskinen ee7d14ce5e staging: octeon-usb: cvmx-usb: replace cvmx_wait_usec with udelay
Just use udelay().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:29 -07:00
Aaro Koskinen 2e5ae89870 staging: octeon-usb: cvmx-usb: replace long udelays with mdelays
Replace long udelays with mdelays.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:28 -07:00
Aaro Koskinen 27bf55251c staging: octeon-usb: cvmx-usb: eliminate cvmx_likely/unlikely
Just use likely/unlikely.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:28 -07:00
Aaro Koskinen 6d658cb2ab staging: octeon-usb: cvmx-usb: utilize Linux error codes
Use generic Linux error codes to replace cvmx_usb_status_t.

The conversion table:

	Before				After
	cvmx_usb_status_t		int
	CVMX_USB_SUCCESS		0
	CVMX_USB_INVALID_PARAM		-EINVAL
	CVMX_USB_NO_MEMORY		-ENOMEM
	CVMX_USB_BUSY			-EBUSY
	CVMX_USB_TIMEOUT		-ETIMEDOUT
	CVMX_USB_INCORRECT_MODE		Deleted (was never used)

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:28 -07:00
Aaro Koskinen 684f94ccbd staging: octeon-usb: cvmx-usb: delete __cplusplus
Delete __cplusplus.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:28 -07:00
Aaro Koskinen 67f70fc624 staging: octeon-usb: cvmx-usb: delete redundant example code
Delete redundant example code found in comments. It's already there in
the driver proper.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:28 -07:00
Aaro Koskinen a7c679482d staging: octeon-usb: cvmx-usb: delete redundant debug flags
Delete redudant debug flags and dead code behind them.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:27 -07:00
Aaro Koskinen 1b50850d01 staging: octeon-usb: cvmx-usb: delete driver-specific tracing code
Delete call, parameter, and return value tracing.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:27 -07:00
Aaro Koskinen f6ba63fce2 staging: octeon-usb: use correct board type for EdgeRouter Lite
Use CVMX_BOARD_TYPE_UBNT_E100 for EdgeRouter Lite.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:27 -07:00
Aaro Koskinen 272705e937 staging: octeon-usb: depend on CAVIUM_OCTEON_SOC
The USB driver should depend on SOC instead of CPU.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:41:27 -07:00
Aaro Koskinen d935217df1 staging: octeon-usb: octeon-hcd: eliminate printk()s
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>
2013-06-18 11:17:04 -07:00
Aaro Koskinen 334715f31b staging: octeon-usb: octeon-hcd: delete commented-out code
Delete commented-out code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:17:04 -07:00
Aaro Koskinen 87e7e57acd staging: octeon-usb: octeon-hcd: reformat long comments
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>
2013-06-18 11:17:03 -07:00
Aaro Koskinen 71e06db3b9 staging: octeon-usb: octeon-hcd: use dev_dbg
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>
2013-06-18 11:17:03 -07:00
Aaro Koskinen f5ed3a3870 staging: octeon-usb: octeon-hcd: make internal variable static
Make an internal variable static.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 14:53:07 -07:00
Aaro Koskinen 2a81d2b01f staging: octeon-usb: octeon-hcd: fix some includes
Avoid including from "asm/".

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 14:51:36 -07:00
Aaro Koskinen c7609eac88 staging: octeon-usb: octeon-hcd: add missing braces
One else branch was missing braces.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 14:50:47 -07:00
Aaro Koskinen 771378bb05 staging: octeon-usb: octeon-hcd: use tabs for code indent
Replace spaces with tabs where possible.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17 14:49:14 -07:00
Aaro Koskinen 47d8994bc1 staging: octeon-usb: cvmx-usbnx-defs.h: reformat a comment
Reformat a comment to fit it into 80 columns line lenght.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:32 -07:00
Aaro Koskinen b6bcaa488b staging: octeon-usb: cvmx-usbnx-defs.h: reformat license text to fit 80 cols
Reformat the original license text to fit in 80-column terminal. No
change in wording.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:31 -07:00
Aaro Koskinen bd4a270536 staging: octeon-usb: cvmx-usbnx-defs.h: delete CVS keyword marker
Delete CVS keyword marker and a comment that the file is autogenerated.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:31 -07:00
Aaro Koskinen 97d63efafb staging: octeon-usb: cvmx-usbnx-defs.h: clean up macros
Use helper macros to avoid copy-paste and too long lines.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:31 -07:00
Aaro Koskinen 322fb897fd staging: octeon-usb: cvmx-usbnx-defs.h: delete unused macros
Delete unused macros.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:31 -07:00
Aaro Koskinen d49e411251 staging: octeon-usb: cvmx-usbnx-defs.h: fix comment style
Adjust struct member comments to be closer to kernel-doc format.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:31 -07:00
Aaro Koskinen 39e873bb2a staging: octeon-usb: cvmx-usbnx-defs.h: fix struct indentation
Fix struct indentation.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:30 -07:00
Aaro Koskinen 7f4a470c8d staging: octeon-usb: cvmx-usbnx-defs.h: fix brace placement
Fix placement of braces in structs and unions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:30 -07:00
Aaro Koskinen f2b9b33b82 staging: octeon-usb: cvmx-usbnx-defs.h: delete unused union members
Delete unused union members.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:30 -07:00
Aaro Koskinen 5fcf133a56 staging: octeon-usb: cvmx-usbnx-defs.h: delete unused data types
Delete unused data types.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-08 22:04:28 -07:00