Re: How to handle USB_ENDPOINT_XFER_BULK in gadget API?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 26 Apr 2011, baseplast wrote:

> Hi!
> 
> Please, advice, how can i handle the request USB_ENDPOINT_XFER_BULK
> inside client's API.
> i'm unsing dummy_hcd.ko module at debian 6 kernel 2.6.32.
> 
> I correclty handling ad gadget side the control requests, using
> 
> usb_gadget_driver
>  .setup function
> 
>  it handles control request only with setup packets.
>  my gadget device uses USB_ENDPOINT_XFER_BULK for ep1 and ep81.
> 
>  at dummy_hcd.c code i found only
> 
>                  /* non-control requests */
>                 limit = total;
>                 switch (usb_pipetype (urb->pipe)) {
>                 case PIPE_ISOCHRONOUS:
>                         /* FIXME is it urb->interval since the last xfer?
>                          * use urb->iso_frame_desc[i].
>                          * complete whether or not ep has requests queued.
>                          * report random errors, to debug drivers.
>                          */
>                         limit = max (limit, periodic_bytes (dum, ep));
>                         status = -ENOSYS;
>                         break;
> 
>                 case PIPE_INTERRUPT:
>                         /* FIXME is it urb->interval since the last xfer?
>                          * this almost certainly polls too fast.
>                          */
>                         limit = max (limit, periodic_bytes (dum, ep));
>                         /* FALLTHROUGH */
> 
>                 // case PIPE_BULK:  case PIPE_CONTROL:
>                 default:
>                 treat_control_like_bulk:
>                         ep->last_io = jiffies;
>                         total = transfer(dum, urb, ep, limit, &status);
>                         break;
>                 }
> 
> =======================================================================
> any device's side way to receive and emulate such requests?

Read include/linux/usb/gadget.h.  You need to use usb_ep_queue().

See drivers/usb/gadget/zero.c for an example of how to use bulk 
endpoints.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux