Commit graph

140 commits

Author SHA1 Message Date
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
Aaro Koskinen 877ea664f6 staging: octeon-usb: cvmx-usbcx-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-06 13:15:04 -07:00
Aaro Koskinen 56ac87dbae staging: octeon-usb: cvmx-usbcx-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-06 13:15:04 -07:00
Aaro Koskinen 1337de71a9 staging: octeon-usb: cvmx-usbcx-defs.h: avoid long lines in comments
Format all comments (except license text) to fit to 80 column terminals.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 13:15:04 -07:00
Aaro Koskinen 3d3792e91f staging: octeon-usb: cvmx-usbcx-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-06 13:15:03 -07:00
Aaro Koskinen 8f55eb2ee3 staging: octeon-usb: cvmx-usbcx-defs.h: delete unused macros
Delete some unused macros.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-06 13:15:03 -07:00
Aaro Koskinen ebf5950a9a staging: octeon-usb: cvmx-usbcx-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-06 13:15:03 -07:00
Aaro Koskinen 215f7493f5 staging: octeon-usb: cvmx-usbcx-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-06 13:13:58 -07:00
Aaro Koskinen ceba5567fd staging: octeon-usb: cvmx-usbcx-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-06 13:13:57 -07:00
Aaro Koskinen 8aaefbef65 staging: octeon-usb: cvmx-usbcx-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-06 13:13:57 -07:00
Aaro Koskinen a972c4830d staging: octeon-usb: cvmx-usbcx-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-06 13:12:44 -07:00
Wei Yongjun 57f9c1d862 staging: octeon-usb: remove duplicated include from octeon-hcd.c
Remove duplicated include.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:35:59 -07:00
Devendra Naga 5e15430eaf staging: octeon-usb: call device_unregister when platform_device_register_simple fails
device_register is called before platform_device_register_simple gets called.
unregister and reset the octeon_usb_registered variable

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:25:42 -07:00
Devendra Naga 55fa328aec staging: octeon-usb: check return value of platform_device_register_simple
the return value is a pointer having an error set. we have to check for
IS_ERR and return PTR_ERR when appropriate

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:25:41 -07:00
Devendra Naga 3fa98f34b8 staging: octeon-usb: fix more checkpatch errors/warns
place the opening brace right after the if, else, else if, switch
statements.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:25:41 -07:00
Devendra Naga a2417928d6 staging: octeon-usb: more checkpatch fixes
place the opening brace right after the if,else, else if,switch
statements.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:25:41 -07:00
Devendra Naga 3e842f73c6 staging: octeon-usb: fix checkpatch error
this places the opening braces just after the if, else, elseif, switch
statements

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:25:41 -07:00
Devendra Naga 1ead9c58df staging: octeon-usb: place opening braces of structs, enums on top
this fixes coding style problem, placing of the braces just right after the
struct name, not below the struct name.

this reduces the errors reported by checkpatch script from

total: 1496 errors, 2133 warnings, 3344 lines checked

to

total: 1488 errors, 2132 warnings, 3336 lines checked

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-05 15:25:41 -07:00
Aaro Koskinen b164935b38 staging: MIPS: add Octeon USB HCD support
Add support for Octeon USB HCD. Tested on EdgeRouter Lite with USB
mass storage.

The driver has been extracted from GPL sources of EdgeRouter Lite firmware
(based on Linux 2.6.32.13). Some minor fixes and cleanups have been done
to make it work with 3.10-rc3.

$ uname -a
Linux (none) 3.10.0-rc3-edge-00005-g86cb5bc #41 SMP PREEMPT Sat Jun 1 20:41:46 EEST 2013 mips64 GNU/Linux
$ modprobe octeon-usb
[   37.971683] octeon_usb: module is from the staging directory, the quality is unknown, you have been warned.
[   37.983649] OcteonUSB: Detected 1 ports
[   37.999360] OcteonUSB OcteonUSB.0: Octeon Host Controller
[   38.004847] OcteonUSB OcteonUSB.0: new USB bus registered, assigned bus number 1
[   38.012332] OcteonUSB OcteonUSB.0: irq 122, io mem 0x00000000
[   38.019970] hub 1-0:1.0: USB hub found
[   38.023851] hub 1-0:1.0: 1 port detected
[   38.028101] OcteonUSB: Registered HCD for port 0 on irq 122
[   38.391443] usb 1-1: new high-speed USB device number 2 using OcteonUSB
[   38.586922] usb-storage 1-1:1.0: USB Mass Storage device detected
[   38.597375] scsi0 : usb-storage 1-1:1.0
[   39.604111] scsi 0:0:0:0: Direct-Access              USB DISK 2.0     PMAP PQ: 0 ANSI: 4
[   39.619113] sd 0:0:0:0: [sda] 7579008 512-byte logical blocks: (3.88 GB/3.61 GiB)
[   39.630696] sd 0:0:0:0: [sda] Write Protect is off
[   39.635945] sd 0:0:0:0: [sda] No Caching mode page present
[   39.641464] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   39.651341] sd 0:0:0:0: [sda] No Caching mode page present
[   39.656917] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   39.664296]  sda: sda1 sda2
[   39.675574] sd 0:0:0:0: [sda] No Caching mode page present
[   39.681093] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   39.687223] sd 0:0:0:0: [sda] Attached SCSI removable disk

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: David Daney <ddaney.cavm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-03 12:45:03 -07:00