USB_interface结构体分析

转自http://liu1227787871.blog.163.com/blog/static/20536319720129149102907/

struct usb_interface { //本接口对应的所有的设置(与配置不是一个概念) struct usb_host_interface *altsetting; struct usb_host_interface *cur_altsetting;//当前活跃的设置 unsigned num_altsetting; //可选设置的数量 /* If there is an interface association descriptor then it will list * the associated interfaces */ struct usb_interface_assoc_descriptor *intf_assoc; int minor; //本接口绑定的次设备号 enum usb_interface_condition condition; //接口是否绑定 unsigned sysfs_files_created:1; /* 文件系统存在的文件的属性 */ unsigned ep_devs_created:1; /* endpoint "devices" exist */ unsigned unregistering:1; /* 标识卸载interface */ unsigned needs_remote_wakeup:1; /* 驱动要求远程唤醒 */ unsigned needs_altsetting0:1; /* 当设置0被推迟时标识 */ unsigned needs_binding:1; /* needs delayed unbind/rebind */ unsigned reset_running:1; unsigned resetting_device:1; /* true: bandwidth alloc after reset */ struct device dev; /* interface specific device info */

//当接口被绑定到usb主设备号的时候,它指向文件系统中表示的usb设备 struct device *usb_dev; atomic_t pm_usage_cnt; /* usage counter for autosuspend */ struct work_struct reset_ws; /* for resets in atomic context */ };

/* host-side wrapper for one interface setting's parsed descriptors */ struct usb_host_interface { struct usb_interface_descriptor desc;//接口描述符 /* array of desc.bNumEndpoint endpoints associated with this * interface setting. these will be in no particular order. */ struct usb_host_endpoint *endpoint; //本接口对应的端点 char *string; /* iInterface string, if present */ unsigned char *extra; /* Extra descriptors */ int extralen; };

struct usb_interface_descriptor { __u8 bLength; //描述符的size __u8 bDescriptorType; //描述符的类型 __u8 bInterfaceNumber;//接口号 __u8 bAlternateSetting;//用与选择接口的设置 __u8 bNumEndpoints; //本接口对应的端口的数量 __u8 bInterfaceClass;//指明本接口属于哪一个类 __u8 bInterfaceSubClass;//根据bInterfaceClass确定 __u8 bInterfaceProtocol;//协议码 __u8 iInterface;//字符串描述符中本接口描述符的索引 } __attribute__ ((packed));


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值