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>
This commit is contained in:
parent
1c1bdf2764
commit
e53b624ae5
@ -1901,7 +1901,7 @@ done:
|
|||||||
static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb,
|
static void __cvmx_usb_perform_callback(cvmx_usb_internal_state_t *usb,
|
||||||
cvmx_usb_pipe_t *pipe,
|
cvmx_usb_pipe_t *pipe,
|
||||||
cvmx_usb_transaction_t *transaction,
|
cvmx_usb_transaction_t *transaction,
|
||||||
cvmx_usb_callback_t reason,
|
enum cvmx_usb_callback reason,
|
||||||
enum cvmx_usb_complete complete_code)
|
enum cvmx_usb_complete complete_code)
|
||||||
{
|
{
|
||||||
cvmx_usb_callback_func_t callback = usb->callback[reason];
|
cvmx_usb_callback_func_t callback = usb->callback[reason];
|
||||||
@ -2507,7 +2507,7 @@ int cvmx_usb_close_pipe(cvmx_usb_state_t *state, int pipe_handle)
|
|||||||
* Returns: 0 or a negative error code.
|
* Returns: 0 or a negative error code.
|
||||||
*/
|
*/
|
||||||
int cvmx_usb_register_callback(cvmx_usb_state_t *state,
|
int cvmx_usb_register_callback(cvmx_usb_state_t *state,
|
||||||
cvmx_usb_callback_t reason,
|
enum cvmx_usb_callback reason,
|
||||||
cvmx_usb_callback_func_t callback,
|
cvmx_usb_callback_func_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
* The port callback prototype needs to look as follows:
|
* The port callback prototype needs to look as follows:
|
||||||
*
|
*
|
||||||
* void port_callback(cvmx_usb_state_t *usb,
|
* void port_callback(cvmx_usb_state_t *usb,
|
||||||
* cvmx_usb_callback_t reason,
|
* enum cvmx_usb_callback reason,
|
||||||
* enum cvmx_usb_complete status,
|
* enum cvmx_usb_complete status,
|
||||||
* int pipe_handle,
|
* int pipe_handle,
|
||||||
* int submit_handle,
|
* int submit_handle,
|
||||||
@ -147,7 +147,7 @@
|
|||||||
* The completion callback prototype needs to look as follows:
|
* The completion callback prototype needs to look as follows:
|
||||||
*
|
*
|
||||||
* void complete_callback(cvmx_usb_state_t *usb,
|
* void complete_callback(cvmx_usb_state_t *usb,
|
||||||
* cvmx_usb_callback_t reason,
|
* enum cvmx_usb_callback reason,
|
||||||
* enum cvmx_usb_complete status,
|
* enum cvmx_usb_complete status,
|
||||||
* int pipe_handle,
|
* int pipe_handle,
|
||||||
* int submit_handle,
|
* int submit_handle,
|
||||||
@ -350,21 +350,28 @@ typedef struct
|
|||||||
} cvmx_usb_iso_packet_t;
|
} cvmx_usb_iso_packet_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Possible callback reasons for the USB API.
|
* enum cvmx_usb_callback - possible callback reasons for the USB API
|
||||||
|
*
|
||||||
|
* @CVMX_USB_CALLBACK_TRANSFER_COMPLETE: A callback of this type is called when
|
||||||
|
* a submitted transfer completes. The
|
||||||
|
* completion callback will be called even
|
||||||
|
* if the transfer fails or is canceled.
|
||||||
|
* The status parameter will contain
|
||||||
|
* details of why he callback was called.
|
||||||
|
* @CVMX_USB_CALLBACK_PORT_CHANGED: The status of the port changed. For
|
||||||
|
* example, someone may have plugged a
|
||||||
|
* device in. The status parameter
|
||||||
|
* contains CVMX_USB_COMPLETE_SUCCESS. Use
|
||||||
|
* cvmx_usb_get_status() to get the new
|
||||||
|
* port status.
|
||||||
|
* @__CVMX_USB_CALLBACK_END: Do not use. Used internally for array
|
||||||
|
* bounds.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
enum cvmx_usb_callback {
|
||||||
{
|
CVMX_USB_CALLBACK_TRANSFER_COMPLETE,
|
||||||
CVMX_USB_CALLBACK_TRANSFER_COMPLETE,
|
CVMX_USB_CALLBACK_PORT_CHANGED,
|
||||||
/**< A callback of this type is called when a submitted transfer
|
__CVMX_USB_CALLBACK_END
|
||||||
completes. The completion callback will be called even if the
|
};
|
||||||
transfer fails or is canceled. The status parameter will
|
|
||||||
contain details of why he callback was called. */
|
|
||||||
CVMX_USB_CALLBACK_PORT_CHANGED, /**< The status of the port changed. For example, someone may have
|
|
||||||
plugged a device in. The status parameter contains
|
|
||||||
CVMX_USB_COMPLETE_SUCCESS. Use cvmx_usb_get_status() to get
|
|
||||||
the new port status. */
|
|
||||||
__CVMX_USB_CALLBACK_END /**< Do not use. Used internally for array bounds */
|
|
||||||
} cvmx_usb_callback_t;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* USB state internal data. The contents of this structure
|
* USB state internal data. The contents of this structure
|
||||||
@ -381,7 +388,7 @@ typedef struct
|
|||||||
* The parameters are as follows:
|
* The parameters are as follows:
|
||||||
* - state = USB device state populated by
|
* - state = USB device state populated by
|
||||||
* cvmx_usb_initialize().
|
* cvmx_usb_initialize().
|
||||||
* - reason = The cvmx_usb_callback_t used to register
|
* - reason = The enum cvmx_usb_callback used to register
|
||||||
* the callback.
|
* the callback.
|
||||||
* - status = The enum cvmx_usb_complete representing the
|
* - status = The enum cvmx_usb_complete representing the
|
||||||
* status code of a transaction.
|
* status code of a transaction.
|
||||||
@ -395,7 +402,7 @@ typedef struct
|
|||||||
* function cvmx_usb_submit() or
|
* function cvmx_usb_submit() or
|
||||||
* cvmx_usb_register_callback() */
|
* cvmx_usb_register_callback() */
|
||||||
typedef void (*cvmx_usb_callback_func_t)(cvmx_usb_state_t *state,
|
typedef void (*cvmx_usb_callback_func_t)(cvmx_usb_state_t *state,
|
||||||
cvmx_usb_callback_t reason,
|
enum cvmx_usb_callback reason,
|
||||||
enum cvmx_usb_complete status,
|
enum cvmx_usb_complete status,
|
||||||
int pipe_handle, int submit_handle,
|
int pipe_handle, int submit_handle,
|
||||||
int bytes_transferred, void *user_data);
|
int bytes_transferred, void *user_data);
|
||||||
@ -481,7 +488,7 @@ extern int cvmx_usb_cancel(cvmx_usb_state_t *state, int pipe_handle,
|
|||||||
extern int cvmx_usb_cancel_all(cvmx_usb_state_t *state, int pipe_handle);
|
extern int cvmx_usb_cancel_all(cvmx_usb_state_t *state, int pipe_handle);
|
||||||
extern int cvmx_usb_close_pipe(cvmx_usb_state_t *state, int pipe_handle);
|
extern int cvmx_usb_close_pipe(cvmx_usb_state_t *state, int pipe_handle);
|
||||||
extern int cvmx_usb_register_callback(cvmx_usb_state_t *state,
|
extern int cvmx_usb_register_callback(cvmx_usb_state_t *state,
|
||||||
cvmx_usb_callback_t reason,
|
enum cvmx_usb_callback reason,
|
||||||
cvmx_usb_callback_func_t callback,
|
cvmx_usb_callback_func_t callback,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
extern int cvmx_usb_get_frame_number(cvmx_usb_state_t *state);
|
extern int cvmx_usb_get_frame_number(cvmx_usb_state_t *state);
|
||||||
|
@ -59,7 +59,7 @@ static irqreturn_t octeon_usb_irq(struct usb_hcd *hcd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void octeon_usb_port_callback(cvmx_usb_state_t *usb,
|
static void octeon_usb_port_callback(cvmx_usb_state_t *usb,
|
||||||
cvmx_usb_callback_t reason,
|
enum cvmx_usb_callback reason,
|
||||||
enum cvmx_usb_complete status,
|
enum cvmx_usb_complete status,
|
||||||
int pipe_handle,
|
int pipe_handle,
|
||||||
int submit_handle,
|
int submit_handle,
|
||||||
@ -106,7 +106,7 @@ static int octeon_usb_get_frame_number(struct usb_hcd *hcd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb,
|
static void octeon_usb_urb_complete_callback(cvmx_usb_state_t *usb,
|
||||||
cvmx_usb_callback_t reason,
|
enum cvmx_usb_callback reason,
|
||||||
enum cvmx_usb_complete status,
|
enum cvmx_usb_complete status,
|
||||||
int pipe_handle,
|
int pipe_handle,
|
||||||
int submit_handle,
|
int submit_handle,
|
||||||
|
Loading…
Reference in New Issue
Block a user