NCM 使用接口关联描述符
2025-07-08
0
0
NCM功能的USB设备可能包括接口关联描述符(IAD),以指示通信类接口和数据类接口应被视为单个功能。(这是使用WMC WHCM联合描述符的替代方案。)
IAD配置要求
基本设置
- bFunctionClass:
02h
(通信类) - 与通信类接口的bInterfaceClass相同 - bFunctionSubClass:
0Dh
(网络控制模型) - 与通信类接口的bInterfaceSubClass相同 - bFunctionProtocol: 与功能通信类接口的bInterfaceProtocol相同
- bInterfaceCount:
2
- 根据IAD ECN设置 - bFirstInterface: 通信类接口的接口号
位置要求
- IAD应出现在通信类接口之前
NCM功能的描述符顺序
当使用IAD时,NCM功能的描述符一般顺序应为:
1. 接口关联描述符
- Interface Association Descriptor (IAD)
2. 通信类接口描述符
- Communications Class Interface Descriptor (interface n)
3. 通信类接口功能描述符
- Functional descriptors for the Communication Class Interface
4. 通信类接口端点描述符
- Endpoint descriptors for the Communication Class Interface
5. 数据类接口(备用设置0)
- Data Class Interface (interface n+1, alternate setting 0)
6. 数据类接口功能描述符(备用设置0)
- Functional descriptors for Data Class Interface (interface n+1, alternate setting 0)
7. 数据类接口(备用设置1)
- Data Class Interface (interface n+1, alternate setting 1)
8. 数据类接口功能描述符(备用设置1)
- Functional descriptors for Data Class Interface (interface n+1, alternate setting 1)
9. 数据类接口端点描述符(备用设置1)
- Endpoint descriptors for Data Class Interface (interface n+1, alternate setting 1)
重要说明
接口编号
- 通信类接口: interface n
- 数据类接口: interface n+1
备用设置
替代方案
- IAD是WMC WHCM联合描述符的替代方案
- 提供更标准化的接口关联机制
使用场景
IAD的使用场景:
- 标准化接口关联
- 简化主机驱动程序
- 提供清晰的接口关系
- 符合USB规范标准
总结
- IAD提供标准化的接口关联机制
- 确保正确的描述符顺序
- 简化主机对NCM功能的理解
- 提供WMC WHCM联合描述符的替代方案