Router在支持3g上网卡时通常是通过usb_modeswitch将USB转换为Serial串口设备,通过AT command来控制modem的拨号。近期做的CPE也是通过这种方式控制LTE module的。
1. USB Architecture
USB总线将各种USB设备连接到USB Host,PC通过Host Controller(xhci)控制USB Host从而与USB设备实现通信。Root hub被集成到USB Host中用来提供USB设备的接入点(attachment points).
2. USB componments
组成USB设备的逻辑单元:
(1)Endpoint, 它是PC与USB设备通信最终的物理通道。每个Endpoint(OUT/IN endpoint)只能进行单向数据传输。
OUT Endpoint:Host –>USB device; IN Endpoint: USB device –>Host
所以要至少两个endpoint才能实现Host与USB device的双向数据传输。
(2)Interface, 一组Endpoint绑定为一个Interface,每个Interface处理一类逻辑连接,如USB网卡,一些USB设备有多个接口。
(3)Configuration, 一组USB Interface绑定为一个Configuration。
三者的关系:
其中每个Interface作为单独的功能单元,可以绑定不同的driver。
如图为Innofidei LTE module信息。C-Configuration,I-Interface,E-Endpoint。
可以看到该设备只有一个Configuarion,该Configuration由3个Interface组成。每个Interface都有两个Endpoint(一个IN,一个OUT)。
其中Interface 0的驱动为cdc_eem,为USB CDC设备,即USB以太网网卡,Interface 1、2为USB serial设备,分别用于执行AT command和跟踪设备Trace log。
3. Linux USB subsystem
Linux下提供了一个USB Core子系统来封装了USB功能特性,提供了一个统一接口给USB设备驱动方便的存取和控制USB硬件。
4.USB Serial Driver
Reference:
1,Linux Device Drivers, Third Edition
转载于:https://www.cnblogs.com/nixer/archive/2012/09/19/2693962.html
相关资源:DirectX修复工具V4.0增强版