USB相关结构体之struct usb_device
来源:互联网 发布:最好的远程桌面软件 编辑:程序博客网 时间:2024/06/06 02:43
struct usb_device {
intdevnum; //设备号,也称设备地址
chardevpath[16];
u32route;
enum usb_device_statestate;
enum usb_device_speedspeed;
struct usb_tt*tt;
intttport;
unsigned int toggle[2];
struct usb_device *parent;
struct usb_bus *bus; //usb设备所在的总线
//0号端口,可以双向传输
struct usb_host_endpoint ep0; //usb主机端口结构体,详见注释1
struct device dev;
struct usb_device_descriptor descriptor;//usb设备描述符,详见注释2
struct usb_host_bos *bos;
struct usb_host_config *config;
struct usb_host_config *actconfig; //配置结构体,详见注释3
//由此我们看出usb最多支持33个端口,1个控制端口,16个输入端口,16个输出端口
struct usb_host_endpoint *ep_in[16];//输入端口
struct usb_host_endpoint *ep_out[16];//输出端口
char **rawdescriptors;
unsigned short bus_mA;
u8 portnum;
u8 level;
unsigned can_submit:1;
unsigned persist_enabled:1;
unsigned have_langid:1;
unsigned authorized:1;
unsigned authenticated:1;
unsigned wusb:1;
unsigned lpm_capable:1;
unsigned usb2_hw_lpm_capable:1;
unsigned usb2_hw_lpm_enabled:1;
int string_langid;
/* static strings from the device */
char *product;
char *manufacturer;
char *serial;
struct list_head filelist;
#ifdef CONFIG_USB_DEVICE_CLASS
struct device *usb_classdev;
#endif
#ifdef CONFIG_USB_DEVICEFS
struct dentry *usbfs_dentry;
#endif
int maxchild;
struct usb_device **children;
u32 quirks;
atomic_t urbnum;
unsigned long active_duration;
#ifdef CONFIG_PM
unsigned long connect_time;
unsigned do_remote_wakeup:1;
unsigned reset_resume:1;
#endif
struct wusb_dev *wusb_dev;
int slot_id;
enum usb_device_removable removable;
};
注释1:
struct usb_host_endpoint {
struct usb_endpoint_descriptordesc; //端口描述符,详见注释1-1
struct usb_ss_ep_comp_descriptorss_ep_comp;
struct list_headurb_list; //本端点的请求块的队列
void*hcpriv;
struct ep_device*ep_dev; /* For sysfs info */
unsigned char *extra; /* Extra descriptors */
int extralen;
int enabled;
};
注释1-1:
struct usb_endpoint_descriptor {
__u8 bLength;
__u8 bDescriptorType;
__u8 bEndpointAddress; //端口地址
__u8 bmAttributes;
__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));
注释2:
struct usb_device_descriptor {
__u8 bLength;
__u8 bDescriptorType;
__le16 bcdUSB;
__u8 bDeviceClass;
__u8 bDeviceSubClass;
__u8 bDeviceProtocol;
__u8 bMaxPacketSize0;//一次传输的最大数据量
__le16 idVendor;
__le16 idProduct;
__le16 bcdDevice;
__u8 iManufacturer;
__u8 iProduct;
__u8 iSerialNumber;
__u8 bNumConfigurations;
} __attribute__ ((packed));
注释3:
struct usb_host_config {
struct usb_config_descriptordesc; //配置描述符,详见注释3-1
char *string;/* iConfiguration string, if present */
//接口代表一种功能,而配置是功能的组合
struct usb_interface_assoc_descriptor *intf_assoc[USB_MAXIADS];
/* the interfaces associated with this configuration,
* stored in no particular order */
struct usb_interface *interface[USB_MAXINTERFACES];
/* Interface information available even when this is not the
* active configuration */
struct usb_interface_cache *intf_cache[USB_MAXINTERFACES];
unsigned char *extra; /* Extra descriptors */
int extralen;
};
- USB相关结构体之struct usb_device
- struct usb_device(include/linux/usb.h)
- struct usb_device
- usb-skeleton.c 之 19--- struct usb_driver 结构体
- USB相关结构体
- usb子系统相关结构体
- struct cdev结构体以及相关函数
- linux下与实践相关的结构体 struct timeb,struct timeval ,struct timezone,struct timespec,struct tm 等
- linux下与时间相关的结构体 struct timeb,struct timeval ,struct timezone,struct timespec,struct tm 等
- 一、usb子系统相关结构体
- 一、usb子系统相关结构体
- C#基础之结构体(struct)
- C++之特殊结构体struct
- 新型结构体---Swift之Struct
- 文件结构体之struct stat
- C语言学习之结构体struct
- C#基础知识之结构体(Struct)
- C++之struct结构体使用详解
- Fast Paxos算法简介
- DiskGenius分区工具
- 音视频互动开发平台的介绍
- openssl在高性能网络框架中的使用(自定义BIO)
- WIN7通过注册表移动我的文档等系统文件夹默认位置
- USB相关结构体之struct usb_device
- .js文件打开出错问题解决
- 关闭浏览器,和浏览器禁用cookie时Session处理的方法
- ucos源码分析------OSMemCreate()
- mysql用sql语句复制表
- Java学习笔记(持续更新)
- SmartUpload上传组件实现文件的上传和下载功能
- ant+svn+tomcat实现自动构建
- 命名空间