*/ i = 0; /* i = min, j = max, n = default */ j = 255; if (usb_endpoint_xfer_int(d)) { i = 1; switch (to_usb_device(ddev)->speed) { case USB_SPEED_SUPER: case USB_SPEED_HIGH: /* Many device manufacturers are using full-speed * bInterval values in high-speed inte...
若为root hub,将调用rh_urb_enqueue(),共有两种传输事务(控制传输和中断传输 static int rh_urb_enqueue (struct usb_hcd *hcd, struct urb *urb) { if (usb_endpoint_xfer_int(&urb->ep->desc)) // 中断传输 return rh_queue_status (hcd, urb); if (usb_endpoint_xfer_control(&urb->ep->desc...
这涉及到两个函数usb_endpoint_xfer_int和usb_endpoint_xfer_isoc,它们都在include/linux/usb.h里定义 第三个问题是to_usb_device。usb_parse_endpoint()的参数是struct device结构体,要获得设备的速度就需要使用to_usb_device将它转化为struct usb_device结构体。 OK,接着继续看usb_parse_endpoint函数下面应该很明...
[drivers/usb/dwc3/gadget.c]/* 端点0的描述符在dwc3 gadget驱动中定义 */staticstruct usb_endpoint_descriptor dwc3_gadget_ep0_desc={.bLength=USB_DT_ENDPOINT_SIZE,// 端点描述符长度.bDescriptorType=USB_DT_ENDPOINT,// 描述符类型为端点描述符.bmAttributes=USB_ENDPOINT_XFER_CONTROL,// 端点0使用控...
UsbEndpointendpointOut=null;UsbInterfaceusbInterface=mUsbDevice.getInterface(0);for(inti=0;i<usbInterface.getEndpointCount();i++){UsbEndpointendpoint=usbInterface.getEndpoint(i);if(endpoint.getType()==UsbConstants.USB_ENDPOINT_XFER_BULK&&endpoint.getDirection()==UsbConstants.USB_DIR_OUT){endpointOu...
Code "-ESHUTDOWN" indicates completion caused by device disconnect, or when the driver disabled the endpoint. */ int status; /* Reports bytes transferred to/from the buffer. For reads (OUT transfers) this may be less than the requested length. If the short_not_ok flag is set, short ...
->xfertype = usb_endpoint_type(&ep->desc); 得到端点类型,并根据不同的类型进行设置,如填充urb的transfer_flags字段。 如果是ISO传输,根据iso packet的数量(urb->number_of_packets),初始化每一个packet。 (urb->iso_frame_desc[n]) 如果是iso/int传输,根据端点速度类型设置urb->interval ...
.bmAttributes = USB_ENDPOINT_XFER_BULK,.wMaxPacketSize = cpu_to_le16(512),};static struct usb_endpoint_descriptor hs_bulk_out_desc = {.bLength = USB_DT_ENDPOINT_SIZE,.bDescriptorType = USB_DT_ENDPOINT,.bEndpointAddress = USB_DIR_OUT,.bmAttributes = USB_ENDPOINT_XFER_BULK,.wMaxPacket...
配置"I2C/interrupts/vbus-supply/u***_con"的属性#需要配置u***c0_orien_sw的属性remote-endpoint ...
int is_control = usb_endpoint_xfer_control(&ep->desc); if (is_out || is_control) { usb_settoggle(dev, epnum, 1, 0); dev->ep_out[epnum] = ep; } if (!is_out || is_control) { usb_settoggle(dev, epnum, 0, 0); ...