1. 在probe中创建URB
- struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags)
- void *usb_buffer_alloc(struct usb_device *dev, size_t size, gfp_t mem_flags, dma_addr_t *dma)
- static inline void usb_fill_int_urb(struct urb *urb,
struct usb_device *dev,
unsigned int pipe,
void *transfer_buffer,
int buffer_length,
usb_complete_t complete_fn,
void *context,
int interval)
2. 将URB分配给USB设备的指定endpoint
3. 在需要往endpoint写数据时,将URB提交到USB core
- int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
4. USB core将URB提交到特定的USB host controller
5. USB host controller发送到USB设备
6. 发送完成后,USB host controller通过回调通知到USB设备驱动
阅读(1571) | 评论(0) | 转发(0) |