使用 I/O 套件访问串行至 USB 设备
我遇到以下问题:我有一台 Wintec WBT-202 GPS 设备,它能够通过 USB 将位置数据作为 NMEA 数据实时传输。在这个 USB 内部,它只是一个 USB 转串行桥,在 Windows 下使用标准 usbser.sys
驱动程序运行。
我的问题是让它在 Mac OS X 下工作。
硬件 USB GPS 鼠标使用 Atmel AT91SAM7S256 芯片,该芯片也负责 USB 接口。
问题在 Mac OS X 下没有任何反应。在 /dev
下没有创建新的字符设备来使该设备可访问。
在 Windows 下,使用标准驱动程序 usbser.sys
。只有一个 .inf 文件将供应商 ID 和产品 ID 指向该驱动程序。 通过在 Windows 上使用 Snoopy Pro(一种 USB 嗅探软件),我知道一旦设备正确初始化,它就会以 ASCII NMEA 字符串的形式发送数据,这就是我想要的。
问题 1 是否有适用于 Mac OS X 的 usbser.sys
等效项?如果是,是否可以使用无代码 kext 来确保驱动程序匹配正确进行?
如果这不起作用,我将使用用户空间中的 IOKit 向设备发送和接收消息。我仍然对它的详细工作原理有疑问,因为我不完全理解苹果的文档。如果连接了 USB 设备,则会发生驱动程序匹配。如果找不到驱动程序会发生什么情况。
问题 2 是否会加载一些通用 USB 驱动程序,我可以从用户空间与内核“对话”?我如何知道已加载正确的驱动程序?
问题3 我看到WWDC08中有一个“I/O Kit入门”会议,有什么办法可以访问这个会议视频吗?
我附加了 USBProbe 的一些日志和 I/O 注册表摘录。
任何有关我如何开始哪些文档提供了不错的教程的评论将不胜感激。
我研究了 Amit Singh 的《Mac OS X 内部结构 - 系统内部结构》、Apple 的文档“I/O Kit 入门”、“I/O Kit 基础指南”以及 USB 私有数据示例。
附录
USB 探针
Full Speed device @ 8 (0xFD360000): ............................................. Communication device: "WINTEC WBT202 CDC"
Port Information: 0x0019
Captive
External Device
Connected
Enabled
Device Descriptor
Descriptor Version Number: 0x0200
Device Class: 2 (Communication)
Device Subclass: 0
Device Protocol: 0
Device MaxPacketSize: 8
Device VendorID/ProductID: 0x03EB/0x6119 (Atmel Corporation)
Device Version Number: 0x0100
Number of Configurations: 1
Manufacturer String: 0 (none)
Product String: 1 "WINTEC WBT202 CDC"
Serial Number String: 0 (none)
Configuration Descriptor
Length (and contents): 67
Raw Descriptor (hex) 0000: 09 02 43 00 02 01 00 C0 32 09 04 00 00 01 02 02
Raw Descriptor (hex) 0010: 00 00 05 24 00 10 01 05 24 01 01 00 04 24 02 02
Raw Descriptor (hex) 0020: 05 24 06 00 01 07 05 83 03 40 00 0A 09 04 01 00
Raw Descriptor (hex) 0030: 02 0A 00 00 00 07 05 01 02 40 00 00 07 05 82 02
Raw Descriptor (hex) 0040: 40 00 00
Number of Interfaces: 2
Configuration Value: 1
Attributes: 0xC0 (self-powered)
MaxPower: 100 ma
Interface #0 - Communications-Control
Alternate Setting 0
Number of Endpoints 1
Interface Class: 2 (Communications-Control)
Interface Subclass; 2
Interface Protocol: 0
Comm Class Header Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 00 10 01
Comm Class Call Management Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 01 01 00
Comm Class Abstract Control Management Functional Descriptor
Raw Descriptor (hex) 0000: 04 24 02 02
Comm Class Union Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 06 00 01
Endpoint 0x83 - Interrupt Input
Address: 0x83 (IN)
Attributes: 0x03 (Interrupt no synchronization data endpoint)
Max Packet Size: 64
Polling Interval: 10 ms
Interface #1 - Communications-Data/Unknown Comm Class Model
Alternate Setting 0
Number of Endpoints 2
Interface Class: 10 (Communications-Data)
Interface Subclass; 0 (Unknown Comm Class Model)
Interface Protocol: 0
Endpoint 0x01 - Bulk Output
Address: 0x01 (OUT)
Attributes: 0x02 (Bulk no synchronization data endpoint)
Max Packet Size: 64
Polling Interval: 0 ms
Endpoint 0x82 - Bulk Input
Address: 0x82 (IN)
Attributes: 0x02 (Bulk no synchronization data endpoint)
Max Packet Size: 64
Polling Interval: 0 ms
IO 注册表
8: WINTEC WBT202 CDC@fd360000 <class IOUSBDevice>
AppleUSBCDC <class AppleUSBCDC>
IOUSBInterface@0 <class IOUSBInterface>
AppleUSBCDCACMControl <class AppleUSBCDCACMControl>
IOUSBInterface@1 <class IOUSBInterface>
bcdDevice 256 (0x100)
bDeviceClass 2 (0x2)
bDeviceProtocol 0 (0x0)
bDeviceSubClass 0 (0x0)
bMaxPacketSize0 8 (0x8)
bNumConfigurations 1 (0x1)
Bus Power Available 250 (0xfa)
Device Speed 1 (0x1)
idProduct 24857 (0x6119)
idVendor 1003 (0x3eb)
iManufacturer 0 (0x0)
IOCFPlugInTypes
9dc7b780-9ec0-11d4-a54f-000a27052861 IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle
IOGeneralInterest IOCommand is not serializable
IOUserClientClass IOUSBDeviceUserClientV2
iProduct 1 (0x1)
iSerialNumber 0 (0x0)
locationID -46792704 (0xfd360000)
Low Power Displayed No
non-removable yes
PortNum 6 (0x6)
Requested Power 50 (0x32)
sessionID 1167822359 (0x459b8e17459b8e17)
USB Address 5 (0x5)
USB Product Name WINTEC WBT202 CDC
USB 探针登录设备连接
12.719 [5] AppleUSBHub[0x6805a00]::ProcessStatusChanged found (0x 40) in statusChangedBitmap
12.719 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(+) now (1)
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: port 6 obtained runLock
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: calling GetPortStatus for port 6
12.719 [5] AppleUSBHub[0x6805a00]::powerChangeDone - spawning _checkForActivePortsThread
12.719 [5] AppleUSBEHCI[0x65ea000]::FindControlBulkEndpoint (inactive) - linking to active list: 65997c0
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - Hub 0xfd300000 port 6 - Initial status(0x0101)/change(0x0001)
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - change 4 clearing feature 0x10.
12.719 [5] AppleUSBHub[0x6805a00]::ClearPortFeature port/feature (60010) - clearing
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - status(0x0101) - change(0x0000) - before call to (4) handler function
12.719 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - handling port 6 changes (101,0).
12.719 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler port (6) - waiting 100 ms before asserting reset
12.819 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - port 6 - no existing device found on port
12.820 [4] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler port 6 status(0101)/change(0000) - no error from GetPortStatus
12.820 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - port 6 - device detected, calling AddDevice
12.820 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(+) now (2)
12.820 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - port 6 done, ending.
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err (0) on return from call to (4) handler function
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: calling GetPortStatus for port 6
12.820 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - start
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - Hub 0xfd300000 port 6 - Initial status(0x0101)/change(0x0000)
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err = 0 - done, releasing _runLock
12.820 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(-) now (1)
12.820 [3] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(269), outstandingIO(0), _interruptReadPending(false) - rearming read
12.820 [5] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(269) - spawning _checkForActivePortsThread
12.820 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - bus 0x65ea000 - acquiring dev zero lock
12.820 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - about to obtain device zero lock
12.820 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - not already locked - obtaining
12.820 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - setting _devZeroLock to true
12.820 [5] AppleUSBEHCI[0x65ea000]: Acquired Device Zero
12.820 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - resetting port
12.820 [5] AppleUSBHub[0x6805a00]::SetPortFeature port/feature (60004) - setting
12.821 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - (err = 0) done - returning .
12.821 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(-) now (0)
12.879 [5] AppleUSBHub[0x6805a00]::ProcessStatusChanged found (0x 40) in statusChangedBitmap
12.879 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(+) now (1)
12.879 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: port 6 obtained runLock
12.879 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: delaying 100ms before first GetPortStatus after a reset of port 6
12.879 [5] AppleUSBHub[0x6805a00]::powerChangeDone - spawning _checkForActivePortsThread
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: calling GetPortStatus for port 6
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - Hub 0xfd300000 port 6 - Initial status(0x0103)/change(0x0010)
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - change 1 clearing feature 0x14.
12.979 [5] AppleUSBHub[0x6805a00]::ClearPortFeature port/feature (60014) - clearing
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - status(0x0103) - change(0x0000) - before call to (1) handler function
12.979 [5] ***** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - start - status(0x0103) change (0x0000)
12.979 [5] **1** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - delaying 10 ms
12.989 [5] **2** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - found full speed device
12.989 [5] **2** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - configuring dev zero
12.989 [5] AppleUSBEHCI[0x65ea000]::ConfigureDeviceZero, new method called with hub:3, port:6
12.989 [5] AppleUSBEHCI[0x65ea000]::CreateDevice, high speed ancestor hub:3, port:6
12.989 [5] AppleUSBEHCI[0x65ea000]::DoCreateEP, high speed ancestor hub:3, port:6
12.989 [3] AppleUSBEHCI[0x65ea000]::UIMCreateControlEndpoint(0, 0, 8, 1 @(3, 6))
12.989 [5] **3** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - getting dev zero desc
12.990 [5] **3** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, using 8 for maxPacketSize
12.992 [5] **5** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, Releasing DeviceZero after successful SetAddress to 5
12.992 [5] AppleUSBEHCI[0x65ea000]::UIMDeleteEndpoint: unlinking async endpoint
12.993 [5] AppleUSBEHCI[0x65ea000]::UIMDeleteEndpoint: Deallocating 0x68bd700
12.993 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - about to release device zero lock
12.993 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - releasing lock
12.993 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - wakeup done
12.993 [5] AppleUSBEHCI[0x65ea000]:: Released Device Zero
12.993 [5] AppleUSBEHCI[0x65ea000]::CreateDevice, new method called with hub:3, port:6
12.993 [5] AppleUSBEHCI[0x65ea000]::CreateDevice, high speed ancestor hub:3, port:6
12.993 [5] AppleUSBEHCI[0x65ea000]::CreateDevice: addr=5, speed=full, power=500
12.993 [5] IOUSBDevice @ 5 (500mA available, full speed)
12.993 [5] AppleUSBEHCI[0x65ea000]::DoCreateEP, high speed ancestor hub:3, port:6
12.993 [3] AppleUSBEHCI[0x65ea000]::UIMCreateControlEndpoint(5, 0, 8, 1 @(3, 6))
12.993 [5] IOUSBDevice[0xd335c00]::GetDeviceDescriptor (size 18)
12.994 [5] IOUSBDevice[0xd335c00]::GetStringDescriptor Got string descriptor 1, length 36, got 36
12.994 [5] **10** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, at addr: 5, Successful
12.994 [5] AppleUSBHub[0x6805a00]::GetPortInformation for port[6]
12.995 [5] WINTEC WBT202 CDC[0xd335c00]::GetDeviceInformation Hub device name is HubDevice at USB address 3
12.995 [5] AppleUSBHub[0x6656800]::GetPortInformation for port[3]
12.995 [5] AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - Port 6 of Hub at 0xfd300000 (USB Address: 5), calling registerService for device WINTEC WBT202 CDC
12.995 [5] AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, err = 0, ALL DONE
12.995 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err (0) on return from call to (1) handler function
12.995 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err = 0 - done, releasing _runLock
12.995 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(-) now (0)
12.995 [3] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(274), outstandingIO(0), _interruptReadPending(false) - rearming read
12.995 [5] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(274) - spawning _checkForActivePortsThread
12.999 [5] Finding device driver for WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDC, score: 69000, wildCard = 0
12.999 [5] Finding device driver for WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 106999, wildCard = 3
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::handleOpen - [0xdd78880] is not an IOUSBInterface
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::TakeGetConfigLock - calling through to ChangeGetConfigLock
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::ChangeGetConfigLock - setting _GETCONFIGLOCK to true
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetFullConfigurationDescriptor - Index (0) - getting first 4 bytes of config descriptor
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetConfigDescriptor (length: 4)
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetFullConfigurationDescriptor - Index (0) - getting full 67 bytes of config descriptor
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetConfigDescriptor (length: 67)
13.003 [5] WINTEC WBT202 CDC[0xd335c00]::ReleaseGetConfigLock - calling through to ChangeGetConfigLock
13.003 [5] WINTEC WBT202 CDC[0xd335c00]::ChangeGetConfigLock - setting _GETCONFIGLOCK to false and calling commandWakeup
13.503 [5] WINTEC WBT202 CDC[0xd335c00]::TerminateInterfaces interfaceList 0 terminate: 1
13.503 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration to 1
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration Found InterfaceDescription[0] = 0x68bc889
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration Found InterfaceDescription[1] = 0x68bc8ac
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::RegisterInterfaces interfaceArray 0x6de9b00
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::RegisterInterfaces matching to interface = 0x8261700
13.553 [5] Finding driver for interface #0 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
13.567 [5] Finding driver for interface #0 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMControl, score: 50000, wildCard = 0
13.570 [5] AppleUSBEHCI[0x65ea000]::DoCreateEP, high speed ancestor hub:3, port:6
13.570 [5] AppleUSBEHCI[0x65ea000]: UIMCreateInterruptEndpoint endpoint does NOT exist (this is normal)
13.570 [5] AppleUSBEHCI[0x65ea000]::AllocateInterruptBandwidth - pED[0x68bd780] _speed(1)
13.570 [3] AppleUSBEHCITTInfo[0x682b400]::AllocatePeriodicBandwidth: pSPE[0x6f8ae40]
13.570 [5] AppleUSBEHCISplitPeriodicEndpoint[0x6f8ae40]::FindStartFrameAndStartTime - _FSBytesUsed (78)
13.570 [5] AppleUSBEHCISplitPeriodicEndpoint[0x6f8ae40]::FindStartFrameAndStartTime - using Start Time entry found - _startFrame(1) _startTime(36)
13.570 [5] AppleUSBEHCI[0x65ea000]::AllocateInterruptBandwidth - returning 0x0(success)
13.571 [5] AppleUSBHub[0x6805a00]::powerChangeDone - spawning _checkForActivePortsThread
13.573 [5] WINTEC WBT202 CDC[0xd335c00]::RegisterInterfaces matching to interface = 0xd337700
13.621 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
13.636 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.024 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.075 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
14.089 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.090 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 50000, wildCard = 0
14.266 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 50000, wildCard = 0
14.315 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
14.330 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.330 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 50000, wildCard = 0
14.334 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration returning success
编辑:附加日志文件摘录设备连接后的 console.app
16.02.11 09:05:55 kernel 0 0 AppleUSBCDCACMControl: getFunctionalDescriptors - Descriptors are incorrect, checking...
16.02.11 09:05:55 kernel 0 1 AppleUSBCDCACMData: start - Find CDC driver for data interface failed
I have the following problem: I have a Wintec WBT-202 GPS device which has the ability to transmit the location data live as NMEA data over USB. Inside this USB it is just a USB to serial bridge which is run under Windows using the standard usbser.sys
driver.
My problem is to get it working under Mac OS X.
The hardware the USB GPS mouse uses an Atmel AT91SAM7S256 chip which also is responsible for the USB interface.
The problem under Mac OS X there is nothing happening. There is no new character device created under /dev
to make this device accessible.
Under Windows the standard driver usbser.sys
is used. There is just an .inf file pointing the vendorID and productID to this driver.
From using Snoopy Pro on Windows (a USB sniffing software) I know that once the device is properly initialized it sends the data as ASCII NMEA strings, which is all I want.
Question 1 Is there an usbser.sys
equivalent for Mac OS X? If yes, could a codeless kext be used to make sure driver matching occurs properly?
If this would not work, I would use IOKit from user space to send and receive messages to the device. I still have questions of how this would work in detail, because I do not fully understand apple's documentation. If a USB device is connected, driver matching occurs. what happens if no driver is found.
Question 2 Could it be that then some generic USB driver is loaded to which I am able to "talk to" in the kernel from user space? How do I know that the right driver is loaded?
Question 3 I saw that there was a "getting started with I/O Kit" session in WWDC08 is there a way to get access to this session video?
I have appended some logs of USBProbe and the I/O registry excerpt.
Any comments about how I could start which documentation provides a decent tutorial would be greatly appreciated.
I have looked into Mac OS X Internals - A System Internals by Amit Singh, Apple's documentation "Getting started with I/O Kit", "I/O Kit Fundamentals Guide" and the USB private data sample.
APPENDIX
USB Probe
Full Speed device @ 8 (0xFD360000): ............................................. Communication device: "WINTEC WBT202 CDC"
Port Information: 0x0019
Captive
External Device
Connected
Enabled
Device Descriptor
Descriptor Version Number: 0x0200
Device Class: 2 (Communication)
Device Subclass: 0
Device Protocol: 0
Device MaxPacketSize: 8
Device VendorID/ProductID: 0x03EB/0x6119 (Atmel Corporation)
Device Version Number: 0x0100
Number of Configurations: 1
Manufacturer String: 0 (none)
Product String: 1 "WINTEC WBT202 CDC"
Serial Number String: 0 (none)
Configuration Descriptor
Length (and contents): 67
Raw Descriptor (hex) 0000: 09 02 43 00 02 01 00 C0 32 09 04 00 00 01 02 02
Raw Descriptor (hex) 0010: 00 00 05 24 00 10 01 05 24 01 01 00 04 24 02 02
Raw Descriptor (hex) 0020: 05 24 06 00 01 07 05 83 03 40 00 0A 09 04 01 00
Raw Descriptor (hex) 0030: 02 0A 00 00 00 07 05 01 02 40 00 00 07 05 82 02
Raw Descriptor (hex) 0040: 40 00 00
Number of Interfaces: 2
Configuration Value: 1
Attributes: 0xC0 (self-powered)
MaxPower: 100 ma
Interface #0 - Communications-Control
Alternate Setting 0
Number of Endpoints 1
Interface Class: 2 (Communications-Control)
Interface Subclass; 2
Interface Protocol: 0
Comm Class Header Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 00 10 01
Comm Class Call Management Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 01 01 00
Comm Class Abstract Control Management Functional Descriptor
Raw Descriptor (hex) 0000: 04 24 02 02
Comm Class Union Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 06 00 01
Endpoint 0x83 - Interrupt Input
Address: 0x83 (IN)
Attributes: 0x03 (Interrupt no synchronization data endpoint)
Max Packet Size: 64
Polling Interval: 10 ms
Interface #1 - Communications-Data/Unknown Comm Class Model
Alternate Setting 0
Number of Endpoints 2
Interface Class: 10 (Communications-Data)
Interface Subclass; 0 (Unknown Comm Class Model)
Interface Protocol: 0
Endpoint 0x01 - Bulk Output
Address: 0x01 (OUT)
Attributes: 0x02 (Bulk no synchronization data endpoint)
Max Packet Size: 64
Polling Interval: 0 ms
Endpoint 0x82 - Bulk Input
Address: 0x82 (IN)
Attributes: 0x02 (Bulk no synchronization data endpoint)
Max Packet Size: 64
Polling Interval: 0 ms
IO Registry
8: WINTEC WBT202 CDC@fd360000 <class IOUSBDevice>
AppleUSBCDC <class AppleUSBCDC>
IOUSBInterface@0 <class IOUSBInterface>
AppleUSBCDCACMControl <class AppleUSBCDCACMControl>
IOUSBInterface@1 <class IOUSBInterface>
bcdDevice 256 (0x100)
bDeviceClass 2 (0x2)
bDeviceProtocol 0 (0x0)
bDeviceSubClass 0 (0x0)
bMaxPacketSize0 8 (0x8)
bNumConfigurations 1 (0x1)
Bus Power Available 250 (0xfa)
Device Speed 1 (0x1)
idProduct 24857 (0x6119)
idVendor 1003 (0x3eb)
iManufacturer 0 (0x0)
IOCFPlugInTypes
9dc7b780-9ec0-11d4-a54f-000a27052861 IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle
IOGeneralInterest IOCommand is not serializable
IOUserClientClass IOUSBDeviceUserClientV2
iProduct 1 (0x1)
iSerialNumber 0 (0x0)
locationID -46792704 (0xfd360000)
Low Power Displayed No
non-removable yes
PortNum 6 (0x6)
Requested Power 50 (0x32)
sessionID 1167822359 (0x459b8e17459b8e17)
USB Address 5 (0x5)
USB Product Name WINTEC WBT202 CDC
USB probe log on device attach
12.719 [5] AppleUSBHub[0x6805a00]::ProcessStatusChanged found (0x 40) in statusChangedBitmap
12.719 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(+) now (1)
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: port 6 obtained runLock
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: calling GetPortStatus for port 6
12.719 [5] AppleUSBHub[0x6805a00]::powerChangeDone - spawning _checkForActivePortsThread
12.719 [5] AppleUSBEHCI[0x65ea000]::FindControlBulkEndpoint (inactive) - linking to active list: 65997c0
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - Hub 0xfd300000 port 6 - Initial status(0x0101)/change(0x0001)
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - change 4 clearing feature 0x10.
12.719 [5] AppleUSBHub[0x6805a00]::ClearPortFeature port/feature (60010) - clearing
12.719 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - status(0x0101) - change(0x0000) - before call to (4) handler function
12.719 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - handling port 6 changes (101,0).
12.719 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler port (6) - waiting 100 ms before asserting reset
12.819 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - port 6 - no existing device found on port
12.820 [4] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler port 6 status(0101)/change(0000) - no error from GetPortStatus
12.820 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - port 6 - device detected, calling AddDevice
12.820 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(+) now (2)
12.820 [5] AppleUSBHubPort[0x6807200]::DefaultConnectionChangeHandler - port 6 done, ending.
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err (0) on return from call to (4) handler function
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: calling GetPortStatus for port 6
12.820 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - start
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - Hub 0xfd300000 port 6 - Initial status(0x0101)/change(0x0000)
12.820 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err = 0 - done, releasing _runLock
12.820 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(-) now (1)
12.820 [3] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(269), outstandingIO(0), _interruptReadPending(false) - rearming read
12.820 [5] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(269) - spawning _checkForActivePortsThread
12.820 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - bus 0x65ea000 - acquiring dev zero lock
12.820 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - about to obtain device zero lock
12.820 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - not already locked - obtaining
12.820 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - setting _devZeroLock to true
12.820 [5] AppleUSBEHCI[0x65ea000]: Acquired Device Zero
12.820 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - resetting port
12.820 [5] AppleUSBHub[0x6805a00]::SetPortFeature port/feature (60004) - setting
12.821 [5] ***** AppleUSBHubPort[0x6807200]::AddDevice - port 6 on hub at 0xfd300000 - (err = 0) done - returning .
12.821 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(-) now (0)
12.879 [5] AppleUSBHub[0x6805a00]::ProcessStatusChanged found (0x 40) in statusChangedBitmap
12.879 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(+) now (1)
12.879 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: port 6 obtained runLock
12.879 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: delaying 100ms before first GetPortStatus after a reset of port 6
12.879 [5] AppleUSBHub[0x6805a00]::powerChangeDone - spawning _checkForActivePortsThread
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler: calling GetPortStatus for port 6
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - Hub 0xfd300000 port 6 - Initial status(0x0103)/change(0x0010)
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - change 1 clearing feature 0x14.
12.979 [5] AppleUSBHub[0x6805a00]::ClearPortFeature port/feature (60014) - clearing
12.979 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - status(0x0103) - change(0x0000) - before call to (1) handler function
12.979 [5] ***** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - start - status(0x0103) change (0x0000)
12.979 [5] **1** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - delaying 10 ms
12.989 [5] **2** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - found full speed device
12.989 [5] **2** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - configuring dev zero
12.989 [5] AppleUSBEHCI[0x65ea000]::ConfigureDeviceZero, new method called with hub:3, port:6
12.989 [5] AppleUSBEHCI[0x65ea000]::CreateDevice, high speed ancestor hub:3, port:6
12.989 [5] AppleUSBEHCI[0x65ea000]::DoCreateEP, high speed ancestor hub:3, port:6
12.989 [3] AppleUSBEHCI[0x65ea000]::UIMCreateControlEndpoint(0, 0, 8, 1 @(3, 6))
12.989 [5] **3** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6 on hub at 0xfd300000 - getting dev zero desc
12.990 [5] **3** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, using 8 for maxPacketSize
12.992 [5] **5** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, Releasing DeviceZero after successful SetAddress to 5
12.992 [5] AppleUSBEHCI[0x65ea000]::UIMDeleteEndpoint: unlinking async endpoint
12.993 [5] AppleUSBEHCI[0x65ea000]::UIMDeleteEndpoint: Deallocating 0x68bd700
12.993 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - about to release device zero lock
12.993 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - releasing lock
12.993 [5] AppleUSBEHCI[0x65ea000]::ProtectedDevZeroLock - wakeup done
12.993 [5] AppleUSBEHCI[0x65ea000]:: Released Device Zero
12.993 [5] AppleUSBEHCI[0x65ea000]::CreateDevice, new method called with hub:3, port:6
12.993 [5] AppleUSBEHCI[0x65ea000]::CreateDevice, high speed ancestor hub:3, port:6
12.993 [5] AppleUSBEHCI[0x65ea000]::CreateDevice: addr=5, speed=full, power=500
12.993 [5] IOUSBDevice @ 5 (500mA available, full speed)
12.993 [5] AppleUSBEHCI[0x65ea000]::DoCreateEP, high speed ancestor hub:3, port:6
12.993 [3] AppleUSBEHCI[0x65ea000]::UIMCreateControlEndpoint(5, 0, 8, 1 @(3, 6))
12.993 [5] IOUSBDevice[0xd335c00]::GetDeviceDescriptor (size 18)
12.994 [5] IOUSBDevice[0xd335c00]::GetStringDescriptor Got string descriptor 1, length 36, got 36
12.994 [5] **10** AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, at addr: 5, Successful
12.994 [5] AppleUSBHub[0x6805a00]::GetPortInformation for port[6]
12.995 [5] WINTEC WBT202 CDC[0xd335c00]::GetDeviceInformation Hub device name is HubDevice at USB address 3
12.995 [5] AppleUSBHub[0x6656800]::GetPortInformation for port[3]
12.995 [5] AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - Port 6 of Hub at 0xfd300000 (USB Address: 5), calling registerService for device WINTEC WBT202 CDC
12.995 [5] AppleUSBHubPort[0x6807200]::AddDeviceResetChangeHandler - port 6, err = 0, ALL DONE
12.995 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err (0) on return from call to (1) handler function
12.995 [5] AppleUSBHubPort[0x6807200]::PortStatusChangedHandler - port 6 - err = 0 - done, releasing _runLock
12.995 [3] AppleUSBHub[0x6805a00]::ChangeRaisedPowerState(-) now (0)
12.995 [3] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(274), outstandingIO(0), _interruptReadPending(false) - rearming read
12.995 [5] AppleUSBHub[0x6805a00]::DecrementOutstandingIO(274) - spawning _checkForActivePortsThread
12.999 [5] Finding device driver for WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDC, score: 69000, wildCard = 0
12.999 [5] Finding device driver for WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 106999, wildCard = 3
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::handleOpen - [0xdd78880] is not an IOUSBInterface
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::TakeGetConfigLock - calling through to ChangeGetConfigLock
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::ChangeGetConfigLock - setting _GETCONFIGLOCK to true
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetFullConfigurationDescriptor - Index (0) - getting first 4 bytes of config descriptor
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetConfigDescriptor (length: 4)
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetFullConfigurationDescriptor - Index (0) - getting full 67 bytes of config descriptor
13.002 [5] WINTEC WBT202 CDC[0xd335c00]::GetConfigDescriptor (length: 67)
13.003 [5] WINTEC WBT202 CDC[0xd335c00]::ReleaseGetConfigLock - calling through to ChangeGetConfigLock
13.003 [5] WINTEC WBT202 CDC[0xd335c00]::ChangeGetConfigLock - setting _GETCONFIGLOCK to false and calling commandWakeup
13.503 [5] WINTEC WBT202 CDC[0xd335c00]::TerminateInterfaces interfaceList 0 terminate: 1
13.503 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration to 1
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration Found InterfaceDescription[0] = 0x68bc889
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration Found InterfaceDescription[1] = 0x68bc8ac
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::RegisterInterfaces interfaceArray 0x6de9b00
13.504 [5] WINTEC WBT202 CDC[0xd335c00]::RegisterInterfaces matching to interface = 0x8261700
13.553 [5] Finding driver for interface #0 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
13.567 [5] Finding driver for interface #0 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMControl, score: 50000, wildCard = 0
13.570 [5] AppleUSBEHCI[0x65ea000]::DoCreateEP, high speed ancestor hub:3, port:6
13.570 [5] AppleUSBEHCI[0x65ea000]: UIMCreateInterruptEndpoint endpoint does NOT exist (this is normal)
13.570 [5] AppleUSBEHCI[0x65ea000]::AllocateInterruptBandwidth - pED[0x68bd780] _speed(1)
13.570 [3] AppleUSBEHCITTInfo[0x682b400]::AllocatePeriodicBandwidth: pSPE[0x6f8ae40]
13.570 [5] AppleUSBEHCISplitPeriodicEndpoint[0x6f8ae40]::FindStartFrameAndStartTime - _FSBytesUsed (78)
13.570 [5] AppleUSBEHCISplitPeriodicEndpoint[0x6f8ae40]::FindStartFrameAndStartTime - using Start Time entry found - _startFrame(1) _startTime(36)
13.570 [5] AppleUSBEHCI[0x65ea000]::AllocateInterruptBandwidth - returning 0x0(success)
13.571 [5] AppleUSBHub[0x6805a00]::powerChangeDone - spawning _checkForActivePortsThread
13.573 [5] WINTEC WBT202 CDC[0xd335c00]::RegisterInterfaces matching to interface = 0xd337700
13.621 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
13.636 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.024 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.075 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
14.089 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.090 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 50000, wildCard = 0
14.266 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 50000, wildCard = 0
14.315 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.iokit.IOUSBUserClient, score: 104999, wildCard = 5
14.330 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCACMData, score: 50000, wildCard = 0
14.330 [5] Finding driver for interface #1 of WINTEC WBT202 CDC, matching personality using com.apple.driver.AppleUSBCDCECMData, score: 50000, wildCard = 0
14.334 [5] WINTEC WBT202 CDC[0xd335c00]::SetConfiguration returning success
EDIT: appended the log file excerpt from console.app after device attach
16.02.11 09:05:55 kernel 0 0 AppleUSBCDCACMControl: getFunctionalDescriptors - Descriptors are incorrect, checking...
16.02.11 09:05:55 kernel 0 1 AppleUSBCDCACMData: start - Find CDC driver for data interface failed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在 Apple 的 USB 邮件列表中发帖得到的答案是 Apple
AppleUSBCDCACMData
驱动程序存在一个错误,导致无法正常工作。我在苹果的雷达上提交了一个错误,希望他们能尽快修复它。The answer I got from posting to Apple's USB mailing list is that the Apple
AppleUSBCDCACMData
driver has a bug in it preventing from doing its work. I filed a bug on Apple's radar and hope they will fix it soon.看起来系统的 CDC 驱动程序匹配正确,应该会创建
/dev/ttyusbmodem*
IIRC,我会检查系统日志中的错误消息,以防万一这不起作用。It looks like the system's CDC driver is matching correctly, which should create
/dev/ttyusbmodem*
IIRC, I'd check the system logs for error messages in case this isn't working.如果您是 USB 驱动程序员,您应该下载 AppleUSBCDCDriver 项目的源代码,其中包含 AppleUSBCDCDriver.kext、AppleUSBCDCACMControl.kext、AppleUSBCDCACMData.kext、AppleUSBCDCECMControl.kext、AppleUSBCDCECMData.kext。
我可以保证的是,你一定可以通过修复代码并构建自己的驱动程序来解决这个问题。(记住更改驱动程序的类名。)
我可以确认的是,AppleUSBCDCDriver主要是根据标准通信设计的设备类规范,包括苹果开发团队的考虑,这个问题不应该是一个错误。
在Mac OS上,驱动匹配主要根据驱动程序的info.plist,就像Windows上的.inf文件一样。
If u are a USB Driver programmer, u should download the source code for AppleUSBCDCDriver project, which contains AppleUSBCDCDriver.kext, AppleUSBCDCACMControl.kext, AppleUSBCDCACMData.kext, AppleUSBCDCECMControl.kext, AppleUSBCDCECMData.kext.
What i can promise is that, u definitly could solve this issue by fix the code and build your own driver.(Remember to change the driver's class name.)
What i can confirm is that, the AppleUSBCDCDriver is mainly designed according to the Standard Communication Device Class Specification, and including the consideration by Apple Developement Team, and this issue should not be a bug.
On Mac OS, driver matching is mainly according to the info.plist of the driver, just like .inf file on Windows.
对于
AppleUSBCDCACMData
中提到的错误有一个解决方法。您需要为呼叫管理描述符分配一个接口。您将其设置为 00。您显示:
通信类呼叫管理功能描述符
原始描述符(十六进制)0000: 05 24 01 01 00
缺少和分配。使用 ATMEL USB 库,它看起来像这样:
There is a workaround for the bug mentioned in
AppleUSBCDCACMData
. You need to assign an interface to the call management descriptor. You have it set to 00.You show:
Comm Class Call Management Functional Descriptor
Raw Descriptor (hex) 0000: 05 24 01 01 00
That lacks and assignment. Using the ATMEL USB libraries, it would look like this: