ecm工作原理 usb_USB中CDC-ECM的了解和配置

USB中典型类及子类:

类别

解释

子类

典型应用

IC芯片

备注

视频类

免驱USB摄像头

ECM(p24)

免驱USB网卡

......

曾经接触过UVC。今天接触了CDC-ECM原理上是一样的,定义一套标准协议主从机都遵守了就不须要额外的驱动程序。

简单翻译(其有用Google的多一些)一下usbcdc11的第3.8.2关于CDC-ECM的章节。

3.8.2 Ethernet Networking Control Model

以太网控制模型是用在主从设备间的以太网帧数据的交换。通信类接口用于配置和管理以太网程序,程序中包括的“以太网控制模型”子类码是通信类接口描写叙述定义。

数据接口则用于在USB总线上交换USB数据包。这些USB数以的包封装了完整的以太网包。CRC校验和不能包括在以太网收发数据包中。

检验失败的帧数据不能再发送到主机。这意味着设备必须可以缓冲至少一个完整的以太网帧数据。

虽然USB虚拟网络接口通常一直保持连接状态,一些网络设备管理的要求,须要正确地初始化设备和主机网络堆栈两者。

也可能是偶然的变化配置或状态,比如,添加组播过滤器。

这是有效的通信类接口与通信类子类乙太网路控制模型的唯一一类特定的请求代码列于表10。

Linux内核配置支持CDC-ECM:

Device Drivers --->

[*] Network device support --->

USB Network Adapters --->

Multi-purpose USB Networking Framework

-*- CDC Ethernet support (smart devices such as cable modems)

匹配CDC-ECM设备的LOG信息:

usb 1-1: new full speed USB device using s3c2410-ohci and address 3

usb 1-1: New USB device found, idVendor=0bda, idProduct=8152

usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-1: Product: USB 10/100 LAN

usb 1-1: Manufacturer: Realtek

usb 1-1: SerialNumber: 00E04C36004F

usb 1-1: configuration #2 chosen from 2 choices

eth1: register 'cdc_ether' at usb-s3c24xx-1, CDC Ethernet Device, 00:e0:4c:36:00:4f

然后就完事了。它就是一个普通的网卡了。

总结:ECM的驱动源代码文件是drivers/net/usb/cdc_ether.c。不须要加入Vid Pid等等不论什么操作就能够使用。cdc_ether.c与传统的以太网芯片的驱动程序并不一样。并非实现xxx_open(),xxx_stop(),xxx_tx(), xxx_hard_header(), xxx_get_stats, xxx_tx_timeout()而是实现了:usbnet_generic_cdc_bind(), usbnet_cdc_unbind(),usbnet_cdc_bind(), usbnet_cdc_status()等4个API。

ECM(太网控制模型)协议文档 The USB Communications Device Class Specification 1.1 contains general Communications Class specifications, and details for seven device subclasses. That specification has been editorially reorganized into a common USB CDC 1.2 specification [USBCDC1.2] and a set of subclass specifications. This should help implementers understand what is necessary for each device subclass and facilitate specification maintenance by the USB Device Working Group. This document is one of those subclass specifications. It contains material technically identical to that contained in USB CDC 1.1. It is intended to guide implementers of USB-connected devices of the types listed in the following section. 1.2 Scope This document specifies one device subclass intended for use with Communication devices, based on the Universal Serial Bus Class Definitions for Communication Devices specification [USBCDC1.2]. It supports Ethernet (IEEE 802.3) and similar devices. The intention of this specification is that all material presented here is technically compatible with the previous version of the USB CDC 1.1 Specification, from which it is derived. Numeric codes are defined for subclass codes, protocol codes, management elements, and notification elements. In some cases material from [USBCDC1.2] is repeated for clarity. In such cases, [USBCDC1.2] shall be treated as the controlling document. In this specification, the word ‘shall’ or ‘must’ is used for mandatory requirements, the word ‘should’ is used to express recommendations and the word ‘may’ is used for options.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值