__CVMX_USB_CALLBACK_END
};
-/**
- * USB state internal data. The contents of this structure
- * may change in future SDKs. No data in it should be referenced
- * by user's of this API.
- */
-struct cvmx_usb_state {
- char data[65536];
-};
+struct cvmx_usb_state;
/**
* USB callback functions are always of the following type.
* The parameters are as follows:
- * - state = USB device state populated by
- * cvmx_usb_initialize().
+ * - usb = USB device state populated by cvmx_usb_initialize().
* - reason = The enum cvmx_usb_callback used to register
* the callback.
* - status = The enum cvmx_usb_complete representing the
* - user_data = The user pointer supplied to the
* function cvmx_usb_submit() or
* cvmx_usb_register_callback() */
-typedef void (*cvmx_usb_callback_func_t)(struct cvmx_usb_state *state,
+typedef void (*cvmx_usb_callback_func_t)(struct cvmx_usb_state *usb,
enum cvmx_usb_callback reason,
enum cvmx_usb_complete status,
int pipe_handle, int submit_handle,
};
/**
- * struct cvmx_usb_internal_state - the state of the USB block
+ * struct cvmx_usb_state - the state of the USB block
*
* init_flags: Flags passed to initialize.
* index: Which USB block this is for.
* frame_number: Increments every SOF interrupt for time keeping.
* active_split: Points to the current active split, or NULL.
*/
-struct cvmx_usb_internal_state {
+struct cvmx_usb_state {
int init_flags;
int index;
int idle_hardware_channels;
*
* Returns: Result of the read
*/
-static inline uint32_t __cvmx_usb_read_csr32(struct cvmx_usb_internal_state *usb,
+static inline uint32_t __cvmx_usb_read_csr32(struct cvmx_usb_state *usb,
uint64_t address)
{
uint32_t result = cvmx_read64_uint32(address ^ 4);
* @address: 64bit address to write
* @value: Value to write
*/
-static inline void __cvmx_usb_write_csr32(struct cvmx_usb_internal_state *usb,
+static inline void __cvmx_usb_write_csr32(struct cvmx_usb_state *usb,
uint64_t address, uint32_t value)
{
cvmx_write64_uint32(address ^ 4, value);
*
* Returns: Result of the read
*/
-static inline uint64_t __cvmx_usb_read_csr64(struct cvmx_usb_internal_state *usb,
+static inline uint64_t __cvmx_usb_read_csr64(struct cvmx_usb_state *usb,
uint64_t address)
{
uint64_t result = cvmx_read64_uint64(address);
* @address: 64bit address to write
* @value: Value to write
*/
-static inline void __cvmx_usb_write_csr64(struct cvmx_usb_internal_state *usb,
+static inline void __cvmx_usb_write_csr64(struct cvmx_usb_state *usb,
uint64_t address, uint64_t value)
{
cvmx_write64_uint64(address, value);
*
* Returns: Non zero if we need to do split transactions
*/
-static inline int __cvmx_usb_pipe_needs_split(struct cvmx_usb_internal_state *usb, struct cvmx_usb_pipe *pipe)
+static inline int __cvmx_usb_pipe_needs_split(struct cvmx_usb_state *usb,
+ struct cvmx_usb_pipe *pipe)
{
return ((pipe->device_speed != CVMX_USB_SPEED_HIGH) && (usb->usbcx_hprt.s.prtspd == CVMX_USB_SPEED_HIGH));
}
*
* Returns: Transaction or NULL
*/
-static inline struct cvmx_usb_transaction *__cvmx_usb_alloc_transaction(struct cvmx_usb_internal_state *usb)
+static inline struct cvmx_usb_transaction *__cvmx_usb_alloc_transaction(struct cvmx_usb_state *usb)
{
struct cvmx_usb_transaction *t;
t = usb->free_transaction_head;
* @transaction:
* Transaction to free
*/
-static inline void __cvmx_usb_free_transaction(struct cvmx_usb_internal_state *usb,
+static inline void __cvmx_usb_free_transaction(struct cvmx_usb_state *usb,
struct cvmx_usb_transaction *transaction)
{
transaction->flags = 0;
* other access to the Octeon USB port is made. The port starts
* off in the disabled state.
*
- * @state: Pointer to an empty struct cvmx_usb_state
+ * @usb: Pointer to an empty struct cvmx_usb_state
* that will be populated by the initialize call.
* This structure is then passed to all other USB
* functions.
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_initialize(struct cvmx_usb_state *state,
+static int cvmx_usb_initialize(struct cvmx_usb_state *usb,
int usb_port_number)
{
union cvmx_usbnx_clk_ctl usbn_clk_ctl;
union cvmx_usbnx_usbp_ctl_status usbn_usbp_ctl_status;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
enum cvmx_usb_initialize_flags flags = 0;
- /* Make sure that state is large enough to store the internal state */
- if (sizeof(*state) < sizeof(*usb))
- return -EINVAL;
/* At first allow 0-1 for the usb port number */
if ((usb_port_number < 0) || (usb_port_number > 1))
return -EINVAL;
* The port should be disabled with all pipes closed when this
* function is called.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_shutdown(struct cvmx_usb_state *state)
+static int cvmx_usb_shutdown(struct cvmx_usb_state *usb)
{
union cvmx_usbnx_clk_ctl usbn_clk_ctl;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Make sure all pipes are closed */
if (usb->idle_pipes.head ||
* Enable a USB port. After this call succeeds, the USB port is
* online and servicing requests.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_enable(struct cvmx_usb_state *state)
+static int cvmx_usb_enable(struct cvmx_usb_state *usb)
{
union cvmx_usbcx_ghwcfg3 usbcx_ghwcfg3;
- 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));
* Transactions in process will fail and call their
* associated callbacks.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_disable(struct cvmx_usb_state *state)
+static int cvmx_usb_disable(struct cvmx_usb_state *usb)
{
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
-
/* Disable the port */
USB_SET_FIELD32(CVMX_USBCX_HPRT(usb->index), union cvmx_usbcx_hprt, prtena, 1);
return 0;
* on the last call to cvmx_usb_set_status(). In order to clear
* them, you must update the status through cvmx_usb_set_status().
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*
* Returns: Port status information
*/
-static struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *state)
+static struct cvmx_usb_port_status cvmx_usb_get_status(struct cvmx_usb_state *usb)
{
union cvmx_usbcx_hprt usbc_hprt;
struct cvmx_usb_port_status result;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
memset(&result, 0, sizeof(result));
* status passed to this function is not used. No fields can be
* changed through this call.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @port_status:
* Port status to set, most like returned by cvmx_usb_get_status()
*/
-static void cvmx_usb_set_status(struct cvmx_usb_state *state,
+static void cvmx_usb_set_status(struct cvmx_usb_state *usb,
struct cvmx_usb_port_status port_status)
{
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
usb->port_status = port_status;
return;
}
/**
* Convert a USB transaction into a handle
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @transaction:
* Transaction to get handle for
*
* Returns: Handle
*/
-static inline int __cvmx_usb_get_submit_handle(struct cvmx_usb_internal_state *usb,
+static inline int __cvmx_usb_get_submit_handle(struct cvmx_usb_state *usb,
struct cvmx_usb_transaction *transaction)
{
return ((unsigned long)transaction - (unsigned long)usb->transaction) /
/**
* Convert a USB pipe into a handle
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe: Pipe to get handle for
*
* Returns: Handle
*/
-static inline int __cvmx_usb_get_pipe_handle(struct cvmx_usb_internal_state *usb,
+static inline int __cvmx_usb_get_pipe_handle(struct cvmx_usb_state *usb,
struct cvmx_usb_pipe *pipe)
{
return ((unsigned long)pipe - (unsigned long)usb->pipe) / sizeof(*pipe);
* must be opened before data can be transferred between a device
* and Octeon.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @device_addr:
* USB device address to open the pipe to
* (0-127).
* Returns: A non negative value is a pipe handle. Negative
* values are error codes.
*/
-static int cvmx_usb_open_pipe(struct cvmx_usb_state *state,
+static int cvmx_usb_open_pipe(struct cvmx_usb_state *usb,
int device_addr, int endpoint_num,
enum cvmx_usb_speed device_speed, int max_packet,
enum cvmx_usb_transfer transfer_type,
int hub_device_addr, int hub_port)
{
struct cvmx_usb_pipe *pipe;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
if (unlikely((device_addr < 0) || (device_addr > MAX_USB_ADDRESS)))
return -EINVAL;
* in non DMA mode. It is very important that this function be called quickly
* enough to prevent FIFO overflow.
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*/
-static void __cvmx_usb_poll_rx_fifo(struct cvmx_usb_internal_state *usb)
+static void __cvmx_usb_poll_rx_fifo(struct cvmx_usb_state *usb)
{
union cvmx_usbcx_grxstsph rx_status;
int channel;
* Fill the TX hardware fifo with data out of the software
* fifos
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @fifo: Software fifo to use
* @available: Amount of space in the hardware fifo
*
* Returns: Non zero if the hardware fifo was too small and needs
* to be serviced again.
*/
-static int __cvmx_usb_fill_tx_hw(struct cvmx_usb_internal_state *usb, struct cvmx_usb_tx_fifo *fifo, int available)
+static int __cvmx_usb_fill_tx_hw(struct cvmx_usb_state *usb,
+ struct cvmx_usb_tx_fifo *fifo, int available)
{
/*
* We're done either when there isn't anymore space or the software FIFO
/**
* Check the hardware FIFOs and fill them as needed
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*/
-static void __cvmx_usb_poll_tx_fifo(struct cvmx_usb_internal_state *usb)
+static void __cvmx_usb_poll_tx_fifo(struct cvmx_usb_state *usb)
{
if (usb->periodic.head != usb->periodic.tail) {
union cvmx_usbcx_hptxsts tx_status;
/**
* Fill the TX FIFO with an outgoing packet
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @channel: Channel number to get packet from
*/
-static void __cvmx_usb_fill_tx_fifo(struct cvmx_usb_internal_state *usb, int channel)
+static void __cvmx_usb_fill_tx_fifo(struct cvmx_usb_state *usb, int channel)
{
union cvmx_usbcx_hccharx hcchar;
union cvmx_usbcx_hcspltx usbc_hcsplt;
* the generic stuff will already have been done in
* __cvmx_usb_start_channel()
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @channel: Channel to setup
* @pipe: Pipe for control transaction
*/
-static void __cvmx_usb_start_channel_control(struct cvmx_usb_internal_state *usb,
+static void __cvmx_usb_start_channel_control(struct cvmx_usb_state *usb,
int channel,
struct cvmx_usb_pipe *pipe)
{
/**
* Start a channel to perform the pipe's head transaction
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @channel: Channel to setup
* @pipe: Pipe to start
*/
-static void __cvmx_usb_start_channel(struct cvmx_usb_internal_state *usb,
+static void __cvmx_usb_start_channel(struct cvmx_usb_state *usb,
int channel,
struct cvmx_usb_pipe *pipe)
{
/**
* Find a pipe that is ready to be scheduled to hardware.
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @list: Pipe list to search
* @current_frame:
* Frame counter to use as a time reference.
*
* Returns: Pipe or NULL if none are ready
*/
-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)
+static struct cvmx_usb_pipe *__cvmx_usb_find_ready_pipe(struct cvmx_usb_state *usb, struct cvmx_usb_pipe_list *list, uint64_t current_frame)
{
struct cvmx_usb_pipe *pipe = list->head;
while (pipe) {
* Called whenever a pipe might need to be scheduled to the
* hardware.
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @is_sof: True if this schedule was called on a SOF interrupt.
*/
-static void __cvmx_usb_schedule(struct cvmx_usb_internal_state *usb, int is_sof)
+static void __cvmx_usb_schedule(struct cvmx_usb_state *usb, int is_sof)
{
int channel;
struct cvmx_usb_pipe *pipe;
/**
* Call a user's callback for a specific reason.
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe: Pipe the callback is for or NULL
* @transaction:
* Transaction the callback is for or NULL
* @complete_code:
* Completion code for the transaction, if any
*/
-static void __cvmx_usb_perform_callback(struct cvmx_usb_internal_state *usb,
+static void __cvmx_usb_perform_callback(struct cvmx_usb_state *usb,
struct cvmx_usb_pipe *pipe,
struct cvmx_usb_transaction *transaction,
enum cvmx_usb_callback reason,
if (!callback)
return;
- callback((struct cvmx_usb_state *)usb, reason, complete_code, pipe_handle, submit_handle,
+ callback(usb, reason, complete_code, pipe_handle, submit_handle,
bytes_transferred, user_data);
}
* Signal the completion of a transaction and free it. The
* transaction will be removed from the pipe transaction list.
*
- * @usb: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe: Pipe the transaction is on
* @transaction:
* Transaction that completed
* @complete_code:
* Completion code
*/
-static void __cvmx_usb_perform_complete(struct cvmx_usb_internal_state *usb,
+static void __cvmx_usb_perform_complete(struct cvmx_usb_state *usb,
struct cvmx_usb_pipe *pipe,
struct cvmx_usb_transaction *transaction,
enum cvmx_usb_complete complete_code)
* Returns: Submit handle or negative on failure. Matches the result
* in the external API.
*/
-static int __cvmx_usb_submit_transaction(struct cvmx_usb_internal_state *usb,
+static int __cvmx_usb_submit_transaction(struct cvmx_usb_state *usb,
int pipe_handle,
enum cvmx_usb_transfer type,
uint64_t buffer,
/**
* Call to submit a USB Bulk transfer to a pipe.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Handle to the pipe for the transfer.
* @buffer: Physical address of the data buffer in
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
*/
-static int cvmx_usb_submit_bulk(struct cvmx_usb_state *state, int pipe_handle,
+static int cvmx_usb_submit_bulk(struct cvmx_usb_state *usb, int pipe_handle,
uint64_t buffer, int buffer_length,
cvmx_usb_callback_func_t callback,
void *user_data)
{
int submit_handle;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Pipe handle checking is done later in a common place */
if (unlikely(!buffer))
/**
* Call to submit a USB Interrupt transfer to a pipe.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Handle to the pipe for the transfer.
* @buffer: Physical address of the data buffer in
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
*/
-static int cvmx_usb_submit_interrupt(struct cvmx_usb_state *state,
+static int cvmx_usb_submit_interrupt(struct cvmx_usb_state *usb,
int pipe_handle, uint64_t buffer,
int buffer_length,
cvmx_usb_callback_func_t callback,
void *user_data)
{
int submit_handle;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Pipe handle checking is done later in a common place */
if (unlikely(!buffer))
/**
* Call to submit a USB Control transfer to a pipe.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Handle to the pipe for the transfer.
* @control_header:
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
*/
-static int cvmx_usb_submit_control(struct cvmx_usb_state *state,
+static int cvmx_usb_submit_control(struct cvmx_usb_state *usb,
int pipe_handle, uint64_t control_header,
uint64_t buffer, int buffer_length,
cvmx_usb_callback_func_t callback,
void *user_data)
{
int submit_handle;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
union cvmx_usb_control_header *header =
cvmx_phys_to_ptr(control_header);
/**
* Call to submit a USB Isochronous transfer to a pipe.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Handle to the pipe for the transfer.
* @start_frame:
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
*/
-static int cvmx_usb_submit_isochronous(struct cvmx_usb_state *state,
+static int cvmx_usb_submit_isochronous(struct cvmx_usb_state *usb,
int pipe_handle, int start_frame,
int number_packets, struct
cvmx_usb_iso_packet packets[],
void *user_data)
{
int submit_handle;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
/* Pipe handle checking is done later in a common place */
if (unlikely(start_frame < 0))
* a frame or two for the cvmx_usb_poll() function to call the
* associated callback.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Pipe handle to cancel requests in.
* @submit_handle:
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_cancel(struct cvmx_usb_state *state, int pipe_handle,
+static int cvmx_usb_cancel(struct cvmx_usb_state *usb, int pipe_handle,
int submit_handle)
{
struct cvmx_usb_transaction *transaction;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle;
if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES)))
* Cancel all outstanding requests in a pipe. Logically all this
* does is call cvmx_usb_cancel() in a loop.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Pipe handle to cancel requests in.
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_cancel_all(struct cvmx_usb_state *state, int pipe_handle)
+static int cvmx_usb_cancel_all(struct cvmx_usb_state *usb, int pipe_handle)
{
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle;
if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES)))
/* Simply loop through and attempt to cancel each transaction */
while (pipe->head) {
- int result = cvmx_usb_cancel(state, pipe_handle,
+ int result = cvmx_usb_cancel(usb, pipe_handle,
__cvmx_usb_get_submit_handle(usb, pipe->head));
if (unlikely(result != 0))
return result;
/**
* Close a pipe created with cvmx_usb_open_pipe().
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @pipe_handle:
* Pipe handle to close.
*
* Returns: 0 or a negative error code. EBUSY is returned if the pipe has
* outstanding transfers.
*/
-static int cvmx_usb_close_pipe(struct cvmx_usb_state *state, int pipe_handle)
+static int cvmx_usb_close_pipe(struct cvmx_usb_state *usb, int pipe_handle)
{
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
struct cvmx_usb_pipe *pipe = usb->pipe + pipe_handle;
if (unlikely((pipe_handle < 0) || (pipe_handle >= MAX_PIPES)))
/**
* Register a function to be called when various USB events occur.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
* @reason: Which event to register for.
* @callback: Function to call when the event occurs.
* @user_data: User data parameter to the function.
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_register_callback(struct cvmx_usb_state *state,
+static int cvmx_usb_register_callback(struct cvmx_usb_state *usb,
enum cvmx_usb_callback reason,
cvmx_usb_callback_func_t callback,
void *user_data)
{
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
-
if (unlikely(reason >= __CVMX_USB_CALLBACK_END))
return -EINVAL;
if (unlikely(!callback))
* Get the current USB protocol level frame number. The frame
* number is always in the range of 0-0x7ff.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*
* Returns: USB frame number
*/
-static int cvmx_usb_get_frame_number(struct cvmx_usb_state *state)
+static int cvmx_usb_get_frame_number(struct cvmx_usb_state *usb)
{
int frame_number;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
union cvmx_usbcx_hfnum usbc_hfnum;
usbc_hfnum.u32 = __cvmx_usb_read_csr32(usb, CVMX_USBCX_HFNUM(usb->index));
*
* Returns: Zero on success
*/
-static int __cvmx_usb_poll_channel(struct cvmx_usb_internal_state *usb, int channel)
+static int __cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel)
{
union cvmx_usbcx_hcintx usbc_hcint;
union cvmx_usbcx_hctsizx usbc_hctsiz;
(usb->frame_number - pipe->next_tx_frame) % pipe->interval;
} else {
struct cvmx_usb_port_status port;
- port = cvmx_usb_get_status((struct cvmx_usb_state *)usb);
+ port = cvmx_usb_get_status(usb);
if (port.port_enabled) {
/* We'll retry the exact same transaction again */
transaction->retries++;
* handler for the USB controller. It can also be called
* periodically in a loop for non-interrupt based operation.
*
- * @state: USB device state populated by
- * cvmx_usb_initialize().
+ * @usb: USB device state populated by cvmx_usb_initialize().
*
* Returns: 0 or a negative error code.
*/
-static int cvmx_usb_poll(struct cvmx_usb_state *state)
+static int cvmx_usb_poll(struct cvmx_usb_state *usb)
{
union cvmx_usbcx_hfnum usbc_hfnum;
union cvmx_usbcx_gintsts usbc_gintsts;
- struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
CVMX_PREFETCH(usb, 0);
CVMX_PREFETCH(usb, 1*128);