staging: octeon-usb: cvmx_usb_submit_control: get params from urb
Get the transfer parameters from urb. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9fdbb6964b
commit
e16b5e3f14
|
@ -2497,57 +2497,25 @@ static int cvmx_usb_submit_control(struct cvmx_usb_state *usb, int pipe_handle,
|
||||||
* @usb: USB device state populated by cvmx_usb_initialize().
|
* @usb: USB device state populated by cvmx_usb_initialize().
|
||||||
* @pipe_handle:
|
* @pipe_handle:
|
||||||
* Handle to the pipe for the transfer.
|
* Handle to the pipe for the transfer.
|
||||||
* @start_frame:
|
|
||||||
* Number of frames into the future to schedule
|
|
||||||
* this transaction.
|
|
||||||
* @number_packets:
|
|
||||||
* Number of sequential packets to transfer.
|
|
||||||
* "packets" is a pointer to an array of this
|
|
||||||
* many packet structures.
|
|
||||||
* @packets: Description of each transfer packet as
|
|
||||||
* defined by struct cvmx_usb_iso_packet. The array
|
|
||||||
* pointed to here must stay valid until the
|
|
||||||
* complete callback is called.
|
|
||||||
* @buffer: Physical address of the data buffer in
|
|
||||||
* memory. Note that this is NOT A POINTER, but
|
|
||||||
* the full 64bit physical address of the
|
|
||||||
* buffer. This may be zero if buffer_length is
|
|
||||||
* zero.
|
|
||||||
* @buffer_length:
|
|
||||||
* Length of buffer in bytes.
|
|
||||||
* @urb: URB returned when the callback is called.
|
* @urb: URB returned when the callback is called.
|
||||||
*
|
*
|
||||||
* Returns: A submitted transaction handle or negative on
|
* Returns: A submitted transaction handle or negative on
|
||||||
* failure. Negative values are error codes.
|
* failure. Negative values are error codes.
|
||||||
*/
|
*/
|
||||||
static int cvmx_usb_submit_isochronous(struct cvmx_usb_state *usb,
|
static int cvmx_usb_submit_isochronous(struct cvmx_usb_state *usb,
|
||||||
int pipe_handle, int start_frame,
|
int pipe_handle, struct urb *urb)
|
||||||
int number_packets, struct
|
|
||||||
cvmx_usb_iso_packet packets[],
|
|
||||||
uint64_t buffer, int buffer_length,
|
|
||||||
struct urb *urb)
|
|
||||||
{
|
{
|
||||||
int submit_handle;
|
int submit_handle;
|
||||||
|
struct cvmx_usb_iso_packet *packets;
|
||||||
|
|
||||||
/* Pipe handle checking is done later in a common place */
|
packets = (struct cvmx_usb_iso_packet *) urb->setup_packet;
|
||||||
if (unlikely(start_frame < 0))
|
|
||||||
return -EINVAL;
|
|
||||||
if (unlikely(number_packets < 1))
|
|
||||||
return -EINVAL;
|
|
||||||
if (unlikely(!packets))
|
|
||||||
return -EINVAL;
|
|
||||||
if (unlikely(!buffer))
|
|
||||||
return -EINVAL;
|
|
||||||
if (unlikely(buffer_length < 0))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
submit_handle = __cvmx_usb_submit_transaction(usb, pipe_handle,
|
submit_handle = __cvmx_usb_submit_transaction(usb, pipe_handle,
|
||||||
CVMX_USB_TRANSFER_ISOCHRONOUS,
|
CVMX_USB_TRANSFER_ISOCHRONOUS,
|
||||||
buffer,
|
urb->transfer_dma,
|
||||||
buffer_length,
|
urb->transfer_buffer_length,
|
||||||
0, /* control_header */
|
0, /* control_header */
|
||||||
start_frame,
|
urb->start_frame,
|
||||||
number_packets,
|
urb->number_of_packets,
|
||||||
packets,
|
packets,
|
||||||
urb);
|
urb);
|
||||||
return submit_handle;
|
return submit_handle;
|
||||||
|
@ -3410,13 +3378,9 @@ static int octeon_usb_urb_enqueue(struct usb_hcd *hcd,
|
||||||
* this saves us a bunch of logic.
|
* this saves us a bunch of logic.
|
||||||
*/
|
*/
|
||||||
urb->setup_packet = (char *)iso_packet;
|
urb->setup_packet = (char *)iso_packet;
|
||||||
submit_handle = cvmx_usb_submit_isochronous(&priv->usb, pipe_handle,
|
submit_handle = cvmx_usb_submit_isochronous(&priv->usb,
|
||||||
urb->start_frame,
|
pipe_handle,
|
||||||
urb->number_of_packets,
|
urb);
|
||||||
iso_packet,
|
|
||||||
urb->transfer_dma,
|
|
||||||
urb->transfer_buffer_length,
|
|
||||||
urb);
|
|
||||||
/*
|
/*
|
||||||
* If submit failed we need to free our private packet
|
* If submit failed we need to free our private packet
|
||||||
* list.
|
* list.
|
||||||
|
|
Loading…
Reference in New Issue