日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

USB相关结构体之struct usb_device

發(fā)布時(shí)間:2025/4/5 53 豆豆
生活随笔 收集整理的這篇文章主要介紹了 USB相关结构体之struct usb_device 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

?

struct usb_device { int devnum; ? ? //設(shè)備號(hào),也稱(chēng)設(shè)備地址 char devpath[16]; u32 route; enum usb_device_state state;? enum usb_device_speed speed;?
struct usb_tt *tt; int ttport;
unsigned int toggle[2];
struct usb_device *parent; struct usb_bus *bus; ? ? //usb設(shè)備所在的總線 ? ? ? ? //0號(hào)端口,可以雙向傳輸 struct usb_host_endpoint ep0; //usb主機(jī)端口結(jié)構(gòu)體,詳見(jiàn)注釋1
struct device dev;
struct usb_device_descriptor descriptor;//usb設(shè)備描述符,詳見(jiàn)注釋2 struct usb_host_bos *bos; struct usb_host_config *config;
struct usb_host_config *actconfig; //配置結(jié)構(gòu)體,詳見(jiàn)注釋3 ? ? ? ? ?//由此我們看出usb最多支持33個(gè)端口,1個(gè)控制端口,16個(gè)輸入端口,16個(gè)輸出端口 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_descriptor desc; //端口描述符,詳見(jiàn)注釋1-1 struct usb_ss_ep_comp_descriptor ss_ep_comp; struct list_head urb_list; ?//本端點(diǎn)的請(qǐng)求塊的隊(duì)列 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; //一次傳輸?shù)淖畲髷?shù)據(jù)量 __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;//一次傳輸?shù)淖畲髷?shù)據(jù)量 __le16 idVendor; __le16 idProduct; __le16 bcdDevice; __u8 ?iManufacturer; __u8 ?iProduct; __u8 ?iSerialNumber; __u8 ?bNumConfigurations; } __attribute__ ((packed));
注釋3: struct usb_host_config { struct usb_config_descriptor desc; //配置描述符,詳見(jiàn)注釋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; };

總結(jié)

以上是生活随笔為你收集整理的USB相关结构体之struct usb_device的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。