限制USB小工具驱动程序速度 [英] Limit USB gadget driver speed

查看:94
本文介绍了限制USB小工具驱动程序速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tl; dr:如何强迫Linux拒绝高速USB连接,使其默认为全速?

tl;dr: How do I compel Linux to reject high-speed USB connections so that it defaults to full speed?

完整说明:

我正在编写基于Linux小工具零的USB小工具驱动程序.我测试的硬件具有高速USB,实际产品并非如此.由于某种原因,该小工具(尽管在任何配置上都没有高速描述符)被报告为高速小工具 (复合小工具的set_config函数上的struct usb_gadget->speed==USB_SPEED_HIGH). 这样一来,驱动程序在配置绑定之前就惨不忍睹(试图加载显然不存在的高速配置).

I'm writing a USB gadget driver based on Linux gadget zero. The hardware I'm testing on has high speed capable USB which won't be the case of the actual product. For some reason, the gadget (although it has no high speed descriptors on any configuration) is being reported as a high speed gadget (struct usb_gadget->speed==USB_SPEED_HIGH on set_config function of composite gadget). This makes the driver fail miserably just before configuration bind (trying to load a high speed configuration that obviously doesn’t exist).

我正在寻找一种通知Linux该小工具不具备高速功能的方法,以便当主机将主机从全速切换到高速时连接被拒绝(或会产生类似结果的东西).

I'm looking for a way to inform Linux that the gadget is not high speed capable so that when a host connects the switch from fullspeed to highspeed is denied (or something that would produce a similar results).

推荐答案

uhciohci内核模块驱动USB 1.X控制器. ehci模块驱动USB 2.0控制器.

uhci and ohci kernel modules drive USB 1.X controllers. ehci modules drives USB 2.0 controller.

如果您卸载其中一个,则对另一个实施了限制.

If you unload one of these, you enforce a restriction to the other.

这篇关于限制USB小工具驱动程序速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆