Commit 2bf249e4 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

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: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0ff6ac84
...@@ -228,30 +228,50 @@ struct cvmx_usb_tx_fifo { ...@@ -228,30 +228,50 @@ struct cvmx_usb_tx_fifo {
}; };
/** /**
* The state of the USB block is stored in this structure * struct cvmx_usb_internal_state - the state of the USB block
*
* init_flags: Flags passed to initialize.
* index: Which USB block this is for.
* idle_hardware_channels: Bit set for every idle hardware channel.
* usbcx_hprt: Stored port status so we don't need to read a CSR to
* determine splits.
* pipe_for_channel: Map channels to pipes.
* free_transaction_head: List of free transactions head.
* free_transaction_tail: List of free transactions tail.
* pipe: Storage for pipes.
* transaction: Storage for transactions.
* callback: User global callbacks.
* callback_data: User data for each callback.
* indent: Used by debug output to indent functions.
* port_status: Last port status used for change notification.
* free_pipes: List of all pipes that are currently closed.
* idle_pipes: List of open pipes that have no transactions.
* active_pipes: Active pipes indexed by transfer type.
* frame_number: Increments every SOF interrupt for time keeping.
* active_split: Points to the current active split, or NULL.
*/ */
typedef struct { struct cvmx_usb_internal_state {
int init_flags; /**< Flags passed to initialize */ int init_flags;
int index; /**< Which USB block this is for */ int index;
int idle_hardware_channels; /**< Bit set for every idle hardware channel */ int idle_hardware_channels;
cvmx_usbcx_hprt_t usbcx_hprt; /**< Stored port status so we don't need to read a CSR to determine splits */ cvmx_usbcx_hprt_t usbcx_hprt;
struct cvmx_usb_pipe *pipe_for_channel[MAX_CHANNELS]; /**< Map channels to pipes */ struct cvmx_usb_pipe *pipe_for_channel[MAX_CHANNELS];
struct cvmx_usb_transaction *free_transaction_head; /**< List of free transactions head */ struct cvmx_usb_transaction *free_transaction_head;
struct cvmx_usb_transaction *free_transaction_tail; /**< List of free transactions tail */ struct cvmx_usb_transaction *free_transaction_tail;
struct cvmx_usb_pipe pipe[MAX_PIPES]; /**< Storage for pipes */ struct cvmx_usb_pipe pipe[MAX_PIPES];
struct cvmx_usb_transaction transaction[MAX_TRANSACTIONS]; /**< Storage for transactions */ struct cvmx_usb_transaction transaction[MAX_TRANSACTIONS];
cvmx_usb_callback_func_t callback[__CVMX_USB_CALLBACK_END]; /**< User global callbacks */ cvmx_usb_callback_func_t callback[__CVMX_USB_CALLBACK_END];
void *callback_data[__CVMX_USB_CALLBACK_END]; /**< User data for each callback */ void *callback_data[__CVMX_USB_CALLBACK_END];
int indent; /**< Used by debug output to indent functions */ int indent;
struct cvmx_usb_port_status port_status; /**< Last port status used for change notification */ struct cvmx_usb_port_status port_status;
struct cvmx_usb_pipe_list free_pipes; /**< List of all pipes that are currently closed */ struct cvmx_usb_pipe_list free_pipes;
struct cvmx_usb_pipe_list idle_pipes; /**< List of open pipes that have no transactions */ struct cvmx_usb_pipe_list idle_pipes;
struct cvmx_usb_pipe_list active_pipes[4]; /**< Active pipes indexed by transfer type */ struct cvmx_usb_pipe_list active_pipes[4];
uint64_t frame_number; /**< Increments every SOF interrupt for time keeping */ uint64_t frame_number;
struct cvmx_usb_transaction *active_split; /**< Points to the current active split, or NULL */ struct cvmx_usb_transaction *active_split;
struct cvmx_usb_tx_fifo periodic; struct cvmx_usb_tx_fifo periodic;
struct cvmx_usb_tx_fifo nonperiodic; struct cvmx_usb_tx_fifo nonperiodic;
} cvmx_usb_internal_state_t; };
/* This macro spins on a field waiting for it to reach a value */ /* This macro spins on a field waiting for it to reach a value */
#define CVMX_WAIT_FOR_FIELD32(address, type, field, op, value, timeout_usec)\ #define CVMX_WAIT_FOR_FIELD32(address, type, field, op, value, timeout_usec)\
...@@ -312,7 +332,7 @@ static int octeon_usb_get_clock_type(void) ...@@ -312,7 +332,7 @@ static int octeon_usb_get_clock_type(void)
* *
* Returns: Result of the read * Returns: Result of the read
*/ */
static inline uint32_t __cvmx_usb_read_csr32(cvmx_usb_internal_state_t *usb, static inline uint32_t __cvmx_usb_read_csr32(struct cvmx_usb_internal_state *usb,
uint64_t address) uint64_t address)
{ {
uint32_t result = cvmx_read64_uint32(address ^ 4); uint32_t result = cvmx_read64_uint32(address ^ 4);
...@@ -329,7 +349,7 @@ static inline uint32_t __cvmx_usb_read_csr32(cvmx_usb_internal_state_t *usb, ...@@ -329,7 +349,7 @@ static inline uint32_t __cvmx_usb_read_csr32(cvmx_usb_internal_state_t *usb,
* @address: 64bit address to write * @address: 64bit address to write
* @value: Value to write * @value: Value to write
*/ */
static inline void __cvmx_usb_write_csr32(cvmx_usb_internal_state_t *usb, static inline void __cvmx_usb_write_csr32(struct cvmx_usb_internal_state *usb,
uint64_t address, uint32_t value) uint64_t address, uint32_t value)
{ {
cvmx_write64_uint32(address ^ 4, value); cvmx_write64_uint32(address ^ 4, value);
...@@ -346,7 +366,7 @@ static inline void __cvmx_usb_write_csr32(cvmx_usb_internal_state_t *usb, ...@@ -346,7 +366,7 @@ static inline void __cvmx_usb_write_csr32(cvmx_usb_internal_state_t *usb,
* *
* Returns: Result of the read * Returns: Result of the read
*/ */
static inline uint64_t __cvmx_usb_read_csr64(cvmx_usb_internal_state_t *usb, static inline uint64_t __cvmx_usb_read_csr64(struct cvmx_usb_internal_state *usb,
uint64_t address) uint64_t address)
{ {
uint64_t result = cvmx_read64_uint64(address); uint64_t result = cvmx_read64_uint64(address);
...@@ -362,7 +382,7 @@ static inline uint64_t __cvmx_usb_read_csr64(cvmx_usb_internal_state_t *usb, ...@@ -362,7 +382,7 @@ static inline uint64_t __cvmx_usb_read_csr64(cvmx_usb_internal_state_t *usb,
* @address: 64bit address to write * @address: 64bit address to write
* @value: Value to write * @value: Value to write
*/ */
static inline void __cvmx_usb_write_csr64(cvmx_usb_internal_state_t *usb, static inline void __cvmx_usb_write_csr64(struct cvmx_usb_internal_state *usb,
uint64_t address, uint64_t value) uint64_t address, uint64_t value)
{ {
cvmx_write64_uint64(address, value); cvmx_write64_uint64(address, value);
...@@ -377,7 +397,7 @@ static inline void __cvmx_usb_write_csr64(cvmx_usb_internal_state_t *usb, ...@@ -377,7 +397,7 @@ static inline void __cvmx_usb_write_csr64(cvmx_usb_internal_state_t *usb,
* *
* Returns: Non zero if we need to do split transactions * Returns: Non zero if we need to do split transactions
*/ */
static inline int __cvmx_usb_pipe_needs_split(cvmx_usb_internal_state_t *usb, struct cvmx_usb_pipe *pipe) static inline int __cvmx_usb_pipe_needs_split(struct cvmx_usb_internal_state *usb, struct cvmx_usb_pipe *pipe)
{ {
return ((pipe->device_speed != CVMX_USB_SPEED_HIGH) && (usb->usbcx_hprt.s.prtspd == CVMX_USB_SPEED_HIGH)); return ((pipe->device_speed != CVMX_USB_SPEED_HIGH) && (usb->usbcx_hprt.s.prtspd == CVMX_USB_SPEED_HIGH));
} }
...@@ -438,7 +458,7 @@ int cvmx_usb_get_num_ports(void) ...@@ -438,7 +458,7 @@ int cvmx_usb_get_num_ports(void)
* *
* Returns: Transaction or NULL * Returns: Transaction or NULL
*/ */
static inline struct cvmx_usb_transaction *__cvmx_usb_alloc_transaction(cvmx_usb_internal_state_t *usb) static inline struct cvmx_usb_transaction *__cvmx_usb_alloc_transaction(struct cvmx_usb_internal_state *usb)
{ {
struct cvmx_usb_transaction *t; struct cvmx_usb_transaction *t;
t = usb->free_transaction_head; t = usb->free_transaction_head;
...@@ -463,7 +483,7 @@ static inline struct cvmx_usb_transaction *__cvmx_usb_alloc_transaction(cvmx_usb ...@@ -463,7 +483,7 @@ static inline struct cvmx_usb_transaction *__cvmx_usb_alloc_transaction(cvmx_usb
* @transaction: * @transaction:
* Transaction to free * Transaction to free
*/ */
static inline void __cvmx_usb_free_transaction(cvmx_usb_internal_state_t *usb, static inline void __cvmx_usb_free_transaction(struct cvmx_usb_internal_state *usb,
struct cvmx_usb_transaction *transaction) struct cvmx_usb_transaction *transaction)
{ {
transaction->flags = 0; transaction->flags = 0;
...@@ -543,7 +563,7 @@ int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number, ...@@ -543,7 +563,7 @@ int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number,
{ {
cvmx_usbnx_clk_ctl_t usbn_clk_ctl; cvmx_usbnx_clk_ctl_t usbn_clk_ctl;
cvmx_usbnx_usbp_ctl_status_t usbn_usbp_ctl_status; cvmx_usbnx_usbp_ctl_status_t usbn_usbp_ctl_status;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
usb->init_flags = flags; usb->init_flags = flags;
...@@ -868,7 +888,7 @@ int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number, ...@@ -868,7 +888,7 @@ int cvmx_usb_initialize(struct cvmx_usb_state *state, int usb_port_number,
int cvmx_usb_shutdown(struct cvmx_usb_state *state) int cvmx_usb_shutdown(struct cvmx_usb_state *state)
{ {
cvmx_usbnx_clk_ctl_t usbn_clk_ctl; cvmx_usbnx_clk_ctl_t usbn_clk_ctl;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Make sure all pipes are closed */ /* Make sure all pipes are closed */
if (usb->idle_pipes.head || if (usb->idle_pipes.head ||
...@@ -903,7 +923,7 @@ int cvmx_usb_shutdown(struct cvmx_usb_state *state) ...@@ -903,7 +923,7 @@ int cvmx_usb_shutdown(struct cvmx_usb_state *state)
int cvmx_usb_enable(struct cvmx_usb_state *state) int cvmx_usb_enable(struct cvmx_usb_state *state)
{ {
cvmx_usbcx_ghwcfg3_t usbcx_ghwcfg3; cvmx_usbcx_ghwcfg3_t usbcx_ghwcfg3;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
usb->usbcx_hprt.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HPRT(usb->index)); usb->usbcx_hprt.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HPRT(usb->index));
...@@ -996,7 +1016,7 @@ int cvmx_usb_enable(struct cvmx_usb_state *state) ...@@ -996,7 +1016,7 @@ int cvmx_usb_enable(struct cvmx_usb_state *state)
*/ */
int cvmx_usb_disable(struct cvmx_usb_state *state) int cvmx_usb_disable(struct cvmx_usb_state *state)
{ {
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Disable the port */ /* Disable the port */
USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index), cvmx_usbcx_hprt_t, prtena, 1); USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index), cvmx_usbcx_hprt_t, prtena, 1);
...@@ -1022,7 +1042,7 @@ struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state) ...@@ -1022,7 +1042,7 @@ struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state)
{ {
cvmx_usbcx_hprt_t usbc_hprt; cvmx_usbcx_hprt_t usbc_hprt;
struct cvmx_usb_port_status result; struct cvmx_usb_port_status result;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
memset(&result, 0, sizeof(result)); memset(&result, 0, sizeof(result));
...@@ -1052,7 +1072,7 @@ struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state) ...@@ -1052,7 +1072,7 @@ struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state)
*/ */
void cvmx_usb_set_status(struct cvmx_usb_state *state, struct cvmx_usb_port_status port_status) void cvmx_usb_set_status(struct cvmx_usb_state *state, struct cvmx_usb_port_status port_status)
{ {
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
usb->port_status = port_status; usb->port_status = port_status;
return; return;
} }
...@@ -1068,7 +1088,7 @@ void cvmx_usb_set_status(struct cvmx_usb_state *state, struct cvmx_usb_port_stat ...@@ -1068,7 +1088,7 @@ void cvmx_usb_set_status(struct cvmx_usb_state *state, struct cvmx_usb_port_stat
* *
* Returns: Handle * Returns: Handle
*/ */
static inline int __cvmx_usb_get_submit_handle(cvmx_usb_internal_state_t *usb, static inline int __cvmx_usb_get_submit_handle(struct cvmx_usb_internal_state *usb,
struct cvmx_usb_transaction *transaction) struct cvmx_usb_transaction *transaction)
{ {
return ((unsigned long)transaction - (unsigned long)usb->transaction) / return ((unsigned long)transaction - (unsigned long)usb->transaction) /
...@@ -1085,7 +1105,7 @@ static inline int __cvmx_usb_get_submit_handle(cvmx_usb_internal_state_t *usb, ...@@ -1085,7 +1105,7 @@ static inline int __cvmx_usb_get_submit_handle(cvmx_usb_internal_state_t *usb,
* *
* Returns: Handle * Returns: Handle
*/ */
static inline int __cvmx_usb_get_pipe_handle(cvmx_usb_internal_state_t *usb, static inline int __cvmx_usb_get_pipe_handle(struct cvmx_usb_internal_state *usb,
struct cvmx_usb_pipe *pipe) struct cvmx_usb_pipe *pipe)
{ {
return ((unsigned long)pipe - (unsigned long)usb->pipe) / sizeof(*pipe); return ((unsigned long)pipe - (unsigned long)usb->pipe) / sizeof(*pipe);
...@@ -1156,7 +1176,7 @@ int cvmx_usb_open_pipe(struct cvmx_usb_state *state, enum cvmx_usb_pipe_flags fl ...@@ -1156,7 +1176,7 @@ int cvmx_usb_open_pipe(struct cvmx_usb_state *state, enum cvmx_usb_pipe_flags fl
int multi_count, int hub_device_addr, int hub_port) int multi_count, int hub_device_addr, int hub_port)
{ {
struct cvmx_usb_pipe *pipe; struct cvmx_usb_pipe *pipe;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
if (unlikely((device_addr < 0) || (device_addr > MAX_USB_ADDRESS))) if (unlikely((device_addr < 0) || (device_addr > MAX_USB_ADDRESS)))
return -EINVAL; return -EINVAL;
...@@ -1239,7 +1259,7 @@ int cvmx_usb_open_pipe(struct cvmx_usb_state *state, enum cvmx_usb_pipe_flags fl ...@@ -1239,7 +1259,7 @@ int cvmx_usb_open_pipe(struct cvmx_usb_state *state, enum cvmx_usb_pipe_flags fl
* @usb: USB device state populated by * @usb: USB device state populated by
* cvmx_usb_initialize(). * cvmx_usb_initialize().
*/ */
static void __cvmx_usb_poll_rx_fifo(cvmx_usb_internal_state_t *usb) static void __cvmx_usb_poll_rx_fifo(struct cvmx_usb_internal_state *usb)
{ {
cvmx_usbcx_grxstsph_t rx_status; cvmx_usbcx_grxstsph_t rx_status;
int channel; int channel;
...@@ -1288,7 +1308,7 @@ static void __cvmx_usb_poll_rx_fifo(cvmx_usb_internal_state_t *usb) ...@@ -1288,7 +1308,7 @@ static void __cvmx_usb_poll_rx_fifo(cvmx_usb_internal_state_t *usb)
* Returns: Non zero if the hardware fifo was too small and needs * Returns: Non zero if the hardware fifo was too small and needs
* to be serviced again. * to be serviced again.
*/ */
static int __cvmx_usb_fill_tx_hw(cvmx_usb_internal_state_t *usb, struct cvmx_usb_tx_fifo *fifo, int available) static int __cvmx_usb_fill_tx_hw(struct cvmx_usb_internal_state *usb, struct cvmx_usb_tx_fifo *fifo, int available)
{ {
/* /*
* We're done either when there isn't anymore space or the software FIFO * We're done either when there isn't anymore space or the software FIFO
...@@ -1342,7 +1362,7 @@ static int __cvmx_usb_fill_tx_hw(cvmx_usb_internal_state_t *usb, struct cvmx_usb ...@@ -1342,7 +1362,7 @@ static int __cvmx_usb_fill_tx_hw(cvmx_usb_internal_state_t *usb, struct cvmx_usb
* @usb: USB device state populated by * @usb: USB device state populated by
* cvmx_usb_initialize(). * cvmx_usb_initialize().
*/ */
static void __cvmx_usb_poll_tx_fifo(cvmx_usb_internal_state_t *usb) static void __cvmx_usb_poll_tx_fifo(struct cvmx_usb_internal_state *usb)
{ {
if (usb->periodic.head != usb->periodic.tail) { if (usb->periodic.head != usb->periodic.tail) {
cvmx_usbcx_hptxsts_t tx_status; cvmx_usbcx_hptxsts_t tx_status;
...@@ -1373,7 +1393,7 @@ static void __cvmx_usb_poll_tx_fifo(cvmx_usb_internal_state_t *usb) ...@@ -1373,7 +1393,7 @@ static void __cvmx_usb_poll_tx_fifo(cvmx_usb_internal_state_t *usb)
* cvmx_usb_initialize(). * cvmx_usb_initialize().
* @channel: Channel number to get packet from * @channel: Channel number to get packet from
*/ */
static void __cvmx_usb_fill_tx_fifo(cvmx_usb_internal_state_t *usb, int channel) static void __cvmx_usb_fill_tx_fifo(struct cvmx_usb_internal_state *usb, int channel)
{ {
cvmx_usbcx_hccharx_t hcchar; cvmx_usbcx_hccharx_t hcchar;
cvmx_usbcx_hcspltx_t usbc_hcsplt; cvmx_usbcx_hcspltx_t usbc_hcsplt;
...@@ -1423,7 +1443,7 @@ static void __cvmx_usb_fill_tx_fifo(cvmx_usb_internal_state_t *usb, int channel) ...@@ -1423,7 +1443,7 @@ static void __cvmx_usb_fill_tx_fifo(cvmx_usb_internal_state_t *usb, int channel)
* @channel: Channel to setup * @channel: Channel to setup
* @pipe: Pipe for control transaction * @pipe: Pipe for control transaction
*/ */
static void __cvmx_usb_start_channel_control(cvmx_usb_internal_state_t *usb, static void __cvmx_usb_start_channel_control(struct cvmx_usb_internal_state *usb,
int channel, int channel,
struct cvmx_usb_pipe *pipe) struct cvmx_usb_pipe *pipe)
{ {
...@@ -1552,7 +1572,7 @@ static void __cvmx_usb_start_channel_control(cvmx_usb_internal_state_t *usb, ...@@ -1552,7 +1572,7 @@ static void __cvmx_usb_start_channel_control(cvmx_usb_internal_state_t *usb,
* @channel: Channel to setup * @channel: Channel to setup
* @pipe: Pipe to start * @pipe: Pipe to start
*/ */
static void __cvmx_usb_start_channel(cvmx_usb_internal_state_t *usb, static void __cvmx_usb_start_channel(struct cvmx_usb_internal_state *usb,
int channel, int channel,
struct cvmx_usb_pipe *pipe) struct cvmx_usb_pipe *pipe)
{ {
...@@ -1841,7 +1861,7 @@ static void __cvmx_usb_start_channel(cvmx_usb_internal_state_t *usb, ...@@ -1841,7 +1861,7 @@ static void __cvmx_usb_start_channel(cvmx_usb_internal_state_t *usb,
* *
* Returns: Pipe or NULL if none are ready * Returns: Pipe or NULL if none are ready
*/ */
static struct cvmx_usb_pipe *__cvmx_usb_find_ready_pipe(cvmx_usb_internal_state_t *usb, struct cvmx_usb_pipe_list *list, uint64_t current_frame) static struct cvmx_usb_pipe *__cvmx_usb_find_ready_pipe(struct cvmx_usb_internal_state *usb, struct cvmx_usb_pipe_list *list, uint64_t current_frame)
{ {
struct cvmx_usb_pipe *pipe = list->head; struct cvmx_usb_pipe *pipe = list->head;
while (pipe) { while (pipe) {
...@@ -1867,7 +1887,7 @@ static struct cvmx_usb_pipe *__cvmx_usb_find_ready_pipe(cvmx_usb_internal_state_ ...@@ -1867,7 +1887,7 @@ static struct cvmx_usb_pipe *__cvmx_usb_find_ready_pipe(cvmx_usb_internal_state_
* cvmx_usb_initialize(). * cvmx_usb_initialize().
* @is_sof: True if this schedule was called on a SOF interrupt. * @is_sof: True if this schedule was called on a SOF interrupt.
*/ */
static void __cvmx_usb_schedule(cvmx_usb_internal_state_t *usb, int is_sof) static void __cvmx_usb_schedule(struct cvmx_usb_internal_state *usb, int is_sof)
{ {
int channel; int channel;
struct cvmx_usb_pipe *pipe; struct cvmx_usb_pipe *pipe;
...@@ -1945,7 +1965,7 @@ static void __cvmx_usb_schedule(cvmx_usb_internal_state_t *usb, int is_sof) ...@@ -1945,7 +1965,7 @@ static void __cvmx_usb_schedule(cvmx_usb_internal_state_t *usb, int is_sof)
* @complete_code: * @complete_code:
* Completion code for the transaction, if any * Completion code for the transaction, if any
*/ */
static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb, static void __cvmx_usb_perform_callback(struct cvmx_usb_internal_state *usb,
struct cvmx_usb_pipe *pipe, struct cvmx_usb_pipe *pipe,
struct cvmx_usb_transaction *transaction, struct cvmx_usb_transaction *transaction,
enum cvmx_usb_callback reason, enum cvmx_usb_callback reason,
...@@ -1990,7 +2010,7 @@ static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb, ...@@ -1990,7 +2010,7 @@ static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb,
* @complete_code: * @complete_code:
* Completion code * Completion code
*/ */
static void __cvmx_usb_perform_complete(cvmx_usb_internal_state_t *usb, static void __cvmx_usb_perform_complete(struct cvmx_usb_internal_state *usb,
struct cvmx_usb_pipe *pipe, struct cvmx_usb_pipe *pipe,
struct cvmx_usb_transaction *transaction, struct cvmx_usb_transaction *transaction,
enum cvmx_usb_complete complete_code) enum cvmx_usb_complete complete_code)
...@@ -2070,7 +2090,7 @@ static void __cvmx_usb_perform_complete(cvmx_usb_internal_state_t *usb, ...@@ -2070,7 +2090,7 @@ static void __cvmx_usb_perform_complete(cvmx_usb_internal_state_t *usb,
* Returns: Submit handle or negative on failure. Matches the result * Returns: Submit handle or negative on failure. Matches the result
* in the external API. * in the external API.
*/ */
static int __cvmx_usb_submit_transaction(cvmx_usb_internal_state_t *usb, static int __cvmx_usb_submit_transaction(struct cvmx_usb_internal_state *usb,
int pipe_handle, int pipe_handle,
enum cvmx_usb_transfer type, enum cvmx_usb_transfer type,
int flags, int flags,
...@@ -2175,7 +2195,7 @@ int cvmx_usb_submit_bulk(struct cvmx_usb_state *state, int pipe_handle, ...@@ -2175,7 +2195,7 @@ int cvmx_usb_submit_bulk(struct cvmx_usb_state *state, int pipe_handle,
void *user_data) void *user_data)
{ {
int submit_handle; int submit_handle;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Pipe handle checking is done later in a common place */ /* Pipe handle checking is done later in a common place */
if (unlikely(!buffer)) if (unlikely(!buffer))
...@@ -2234,7 +2254,7 @@ int cvmx_usb_submit_interrupt(struct cvmx_usb_state *state, int pipe_handle, ...@@ -2234,7 +2254,7 @@ int cvmx_usb_submit_interrupt(struct cvmx_usb_state *state, int pipe_handle,
void *user_data) void *user_data)
{ {
int submit_handle; int submit_handle;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Pipe handle checking is done later in a common place */ /* Pipe handle checking is done later in a common place */
if (unlikely(!buffer)) if (unlikely(!buffer))
...@@ -2298,7 +2318,7 @@ int cvmx_usb_submit_control(struct cvmx_usb_state *state, int pipe_handle, ...@@ -2298,7 +2318,7 @@ int cvmx_usb_submit_control(struct cvmx_usb_state *state, int pipe_handle,
void *user_data) void *user_data)
{ {
int submit_handle; int submit_handle;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
cvmx_usb_control_header_t *header = cvmx_phys_to_ptr(control_header); cvmx_usb_control_header_t *header = cvmx_phys_to_ptr(control_header);
/* Pipe handle checking is done later in a common place */ /* Pipe handle checking is done later in a common place */
...@@ -2380,7 +2400,7 @@ int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle, ...@@ -2380,7 +2400,7 @@ int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle,
void *user_data) void *user_data)
{ {
int submit_handle; int submit_handle;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Pipe handle checking is done later in a common place */ /* Pipe handle checking is done later in a common place */
if (unlikely(start_frame < 0)) if (unlikely(start_frame < 0))
...@@ -2430,7 +2450,7 @@ int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle, ...@@ -2430,7 +2450,7 @@ int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state, int pipe_handle,
int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle, int submit_handle) int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle, int submit_handle)
{ {
struct cvmx_usb_transaction *transaction; struct cvmx_usb_transaction *transaction;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle; struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle;
if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES))) if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES)))
...@@ -2486,7 +2506,7 @@ int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle, int submit_ha ...@@ -2486,7 +2506,7 @@ int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle, int submit_ha
*/ */
int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle) int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle)
{ {
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle; struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle;
if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES))) if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES)))
...@@ -2520,7 +2540,7 @@ int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle) ...@@ -2520,7 +2540,7 @@ int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle)
*/ */
int cvmx_usb_close_pipe(struct cvmx_usb_state *state, int pipe_handle) int cvmx_usb_close_pipe(struct cvmx_usb_state *state, int pipe_handle)
{ {
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle; struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle;
if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES))) if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES)))
...@@ -2558,7 +2578,7 @@ int cvmx_usb_register_callback(struct cvmx_usb_state *state, ...@@ -2558,7 +2578,7 @@ int cvmx_usb_register_callback(struct cvmx_usb_state *state,
cvmx_usb_callback_func_t callback, cvmx_usb_callback_func_t callback,
void *user_data) void *user_data)
{ {
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
if (unlikely(reason >= __CVMX_USB_CALLBACK_END)) if (unlikely(reason >= __CVMX_USB_CALLBACK_END))
return -EINVAL; return -EINVAL;
...@@ -2584,7 +2604,7 @@ int cvmx_usb_register_callback(struct cvmx_usb_state *state, ...@@ -2584,7 +2604,7 @@ int cvmx_usb_register_callback(struct cvmx_usb_state *state,
int cvmx_usb_get_frame_number(struct cvmx_usb_state *state) int cvmx_usb_get_frame_number(struct cvmx_usb_state *state)
{ {
int frame_number; int frame_number;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
cvmx_usbcx_hfnum_t usbc_hfnum; cvmx_usbcx_hfnum_t usbc_hfnum;
usbc_hfnum.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFNUM(usb->index)); usbc_hfnum.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFNUM(usb->index));
...@@ -2602,7 +2622,7 @@ int cvmx_usb_get_frame_number(struct cvmx_usb_state *state) ...@@ -2602,7 +2622,7 @@ int cvmx_usb_get_frame_number(struct cvmx_usb_state *state)
* *
* Returns: Zero on success * Returns: Zero on success
*/ */
static int __cvmx_usb_poll_channel(cvmx_usb_internal_state_t *usb, int channel) static int __cvmx_usb_poll_channel(struct cvmx_usb_internal_state *usb, int channel)
{ {
cvmx_usbcx_hcintx_t usbc_hcint; cvmx_usbcx_hcintx_t usbc_hcint;
cvmx_usbcx_hctsizx_t usbc_hctsiz; cvmx_usbcx_hctsizx_t usbc_hctsiz;
...@@ -3043,7 +3063,7 @@ int cvmx_usb_poll(struct cvmx_usb_state *state) ...@@ -3043,7 +3063,7 @@ int cvmx_usb_poll(struct cvmx_usb_state *state)
{ {
cvmx_usbcx_hfnum_t usbc_hfnum; cvmx_usbcx_hfnum_t usbc_hfnum;
cvmx_usbcx_gintsts_t usbc_gintsts; cvmx_usbcx_gintsts_t usbc_gintsts;
cvmx_usb_internal_state_t *usb = (cvmx_usb_internal_state_t *)state; struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
CVMX_PREFETCH(usb, 0); CVMX_PREFETCH(usb, 0);
CVMX_PREFETCH(usb, 1*128); CVMX_PREFETCH(usb, 1*128);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment