* @iso_packets: For ISO transactions, the sub packets in the request.
* @actual_bytes: Actual bytes transfer for this transaction.
* @stage: For control transactions, the current stage.
- * @callback_data: User's data.
+ * @urb: URB.
*/
struct cvmx_usb_transaction {
struct cvmx_usb_transaction *prev;
int retries;
int actual_bytes;
enum cvmx_usb_stage stage;
- void *callback_data;
+ struct urb *urb;
};
/**
int pipe_handle,
int submit_handle,
int bytes_transferred,
- void *user_data)
+ struct urb *urb)
{
struct octeon_hcd *priv = cvmx_usb_to_octeon(usb);
struct usb_hcd *hcd = octeon_to_hcd(priv);
struct device *dev = hcd->self.controller;
- struct urb *urb = user_data;
urb->actual_length = bytes_transferred;
urb->hcpriv = NULL;
octeon_usb_urb_complete_callback(usb, complete_code, pipe_handle,
submit_handle,
transaction->actual_bytes,
- transaction->callback_data);
+ transaction->urb);
__cvmx_usb_free_transaction(usb, transaction);
done:
return;
* For ISO, the number of packet in the transaction.
* @iso_packets:
* A description of each ISO packet
- * @user_data: User's data for the callback
+ * @urb: URB for the callback
*
* Returns: Submit handle or negative on failure. Matches the result
* in the external API.
int iso_start_frame,
int iso_number_packets,
struct cvmx_usb_iso_packet *iso_packets,
- void *user_data)
+ struct urb *urb)
{
int submit_handle;
struct cvmx_usb_transaction *transaction;
transaction->iso_start_frame = iso_start_frame;
transaction->iso_number_packets = iso_number_packets;
transaction->iso_packets = iso_packets;
- transaction->callback_data = user_data;
+ transaction->urb = urb;
if (transaction->type == CVMX_USB_TRANSFER_CONTROL)
transaction->stage = CVMX_USB_STAGE_SETUP;
else
* zero.
* @buffer_length:
* Length of buffer in bytes.
- * @user_data: User supplied data returned when the
- * callback is called.
+ * @urb: URB returned when the callback is called.
*
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
*/
static int cvmx_usb_submit_bulk(struct cvmx_usb_state *usb, int pipe_handle,
uint64_t buffer, int buffer_length,
- void *user_data)
+ struct urb *urb)
{
int submit_handle;
0, /* iso_start_frame */
0, /* iso_number_packets */
NULL, /* iso_packets */
- user_data);
+ urb);
return submit_handle;
}
* zero.
* @buffer_length:
* Length of buffer in bytes.
- * @user_data: User supplied data returned when the
- * callback is called.
+ * @urb: URB returned when the callback is called.
*
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
*/
static int cvmx_usb_submit_interrupt(struct cvmx_usb_state *usb,
int pipe_handle, uint64_t buffer,
- int buffer_length, void *user_data)
+ int buffer_length, struct urb *urb)
{
int submit_handle;
0, /* iso_start_frame */
0, /* iso_number_packets */
NULL, /* iso_packets */
- user_data);
+ urb);
return submit_handle;
}
* zero.
* @buffer_length:
* Length of buffer in bytes.
- * @user_data: User supplied data returned when the
- * callback is called.
+ * @urb: URB returned when the callback is called.
*
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
static int cvmx_usb_submit_control(struct cvmx_usb_state *usb,
int pipe_handle, uint64_t control_header,
uint64_t buffer, int buffer_length,
- void *user_data)
+ struct urb *urb)
{
int submit_handle;
union cvmx_usb_control_header *header =
0, /* iso_start_frame */
0, /* iso_number_packets */
NULL, /* iso_packets */
- user_data);
+ urb);
return submit_handle;
}
* zero.
* @buffer_length:
* Length of buffer in bytes.
- * @user_data: User supplied data returned when the
- * callback is called.
+ * @urb: URB returned when the callback is called.
*
* Returns: A submitted transaction handle or negative on
* failure. Negative values are error codes.
int number_packets, struct
cvmx_usb_iso_packet packets[],
uint64_t buffer, int buffer_length,
- void *user_data)
+ struct urb *urb)
{
int submit_handle;
start_frame,
number_packets,
packets,
- user_data);
+ urb);
return submit_handle;
}