linux USB子系统(一)
来源:互联网 发布:ipad怎么装windows系统 编辑:程序博客网 时间:2024/04/26 15:42
框架
数据结构
usb_dev结构体
struct usb_device { ... enum usb_device_state state; enum usb_device_speed speed; .... struct usb_device *parent; struct usb_bus *bus; //断点0 struct usb_host_endpoint ep0; //设备模型 struct device dev; //设备描述符 struct usb_device_descriptor descriptor; //所有的配置 struct usb_host_config *config; //active配置 struct usb_host_config *actconfig; struct usb_host_endpoint *ep_in[16]; struct usb_host_endpoint *ep_out[16]; char **rawdescriptors; unsigned short bus_mA; u8 portnum; u8 level; .... //hub int maxchild; struct usb_device *children[USB_MAXCHILDREN]; ....};
描述符:
struct usb_device_descriptor { __u8 bLength; __u8 bDescriptorType; __le16 bcdUSB; //1.0 or 2.0 __u8 bDeviceClass; //hid,cdc,etc __u8 bDeviceSubClass; __u8 bDeviceProtocol; __u8 bMaxPacketSize0; //端点0数据大小 __le16 idVendor;// __le16 idProduct;// __le16 bcdDevice; __u8 iManufacturer; __u8 iProduct; __u8 iSerialNumber; __u8 bNumConfigurations;} __attribute__ ((packed));struct usb_config_descriptor { __u8 bLength; __u8 bDescriptorType; __le16 wTotalLength; __u8 bNumInterfaces; //itfa ? __u8 bConfigurationValue; __u8 iConfiguration; __u8 bmAttributes;//供电模式 __u8 bMaxPower;} __attribute__ ((packed));struct usb_interface_descriptor { __u8 bLength; __u8 bDescriptorType; __u8 bInterfaceNumber; //what intf __u8 bAlternateSetting; __u8 bNumEndpoints;//端点数 __u8 bInterfaceClass;//接口类 __u8 bInterfaceSubClass; __u8 bInterfaceProtocol;//接口协议 __u8 iInterface;} __attribute__ ((packed));struct usb_endpoint_descriptor { __u8 bLength; __u8 bDescriptorType; __u8 bEndpointAddress;//端点地址 __u8 bmAttributes;//端点属性 等时 or blk __le16 wMaxPacketSize; //数据包大小 __u8 bInterval;//间隔传输时间 /* NOTE: these two are _only_ in audio endpoints. */ /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */ __u8 bRefresh; __u8 bSynchAddress;} __attribute__ ((packed));
0 0
- Linux usb子系统(一):子系统架构
- Linux usb子系统(一):子系统架构
- linux USB子系统(一)
- usb 子系统(一): 子系统架构
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- Linux usb子系统(一) _写一个usb鼠标驱动
- 一、usb子系统
- Linux-USB子系统
- Linux子系统系列-USB
- Linux USB子系统 (1)
- Linux USB子系统 (2)
- Rapid GUI programming with Python and Qt ——Introduction
- Flume-ng报错
- 记录一下做项目时遇到问题的解决思路(一)
- 游戏攻略资料收集,制作技巧经验分享-游戏编辑2
- openstack技术博客链接
- linux USB子系统(一)
- 公约数
- 集合框架_02_List集合共性
- 【Qt开发】QT样式表单 qss的样式优化
- PHP 中常用的 9 个魔术方法
- java导入导出下载Excel文件(带下拉框)
- 关于Alarm的定时任务
- 建造者模式和抽象工厂的区别
- html 与 html5 的那点事儿