【发布时间】:2016-02-02 04:21:12
【问题描述】:
我想知道是否有一种方法可以在 OS X 上以通用方式使用 USB 调制解调器(华为 E1550 种类),例如通用 USB 调制解调器。问题是操作系统不会将其识别为合法的 CDC ACM 设备(它是,但它没有宣传是这样的)。
在 Linux 上,加密狗被自动识别为 USB 串行设备。
我不想在我的任何机器上安装 ZTE 和华为供应商驱动程序是有原因的:这些人编写的东西几乎不能正常工作(我上次使用 ZTE 驱动程序的经历涉及向我的日志发送垃圾邮件、占用 RAM,而我无法禁用它),他们的驱动程序不向前兼容,他们忽略了将它们与较新的操作系统版本同步,并且他们通常打算将这些驱动程序与运营商膨胀软件一起分发。
Apple 的开发人员文档以模糊的方式写道,可以编写无代码 kext 以强制匹配设备上的特定驱动程序,或阻止为匹配设备加载通用驱动程序。事实上,大多数对无代码 kext 的搜索都会产生诸如“如何防止我的串行加密狗被识别为调制解调器?”之类的问题,而我想要的却完全相反!
到目前为止,我编写这样一个无代码 kext 的尝试以失败告终 - kextutil 告诉 kext 已成功加载,但它不存在,AppleCDCACM.kext 也是如此(它具有我想要使用的 IOClass)。
JFYI,从 Linux 收集的 lsusb 信息:
Bus 004 Device 005: ID 12d1:1001 华为技术有限公司 E169/E620/E800 HSDPA Modem 设备描述符: b长度 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x12d1 华为技术有限公司 idProduct 0x1001 E169/E620/E800 HSDPA 调制解调器 bcdDevice 0.00 iManufacturer 2 华为技术 iProduct 1 华为手机 iSerial 0 bNumConfigurations 1 配置描述符: b长度 9 bDescriptorType 2 w总长度 85 bNumInterfaces 3 b配置值 1 iConfiguration 3 高通配置 bm属性 0xe0 自供电 远程唤醒 最大功率 500mA 接口描述符: b长度 9 bDescriptorType 4 b接口编号 0 b备用设置 0 bNumEndpoints 3 bInterfaceClass 255 供应商特定类 bInterfaceSubClass 255 供应商特定子类 bInterfaceProtocol 255 供应商特定协议 接口 0 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bm属性 3 传输类型中断 同步类型 无 使用类型数据 wMaxPacketSize 0x0040 1x 64 字节 b 间隔 5 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bm属性 2 传输类型散装 同步类型 无 使用类型数据 wMaxPacketSize 0x0200 1x 512 字节 b 间隔 32 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bm属性 2 传输类型散装 同步类型 无 使用类型数据 wMaxPacketSize 0x0200 1x 512 字节 b 间隔 32 接口描述符: b长度 9 bDescriptorType 4 b接口编号 1 b备用设置 0 bNumEndpoints 2 bInterfaceClass 255 供应商特定类 bInterfaceSubClass 255 供应商特定子类 bInterfaceProtocol 255 供应商特定协议 接口 0 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bm属性 2 传输类型散装 同步类型 无 使用类型数据 wMaxPacketSize 0x0200 1x 512 字节 b 间隔 32 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bm属性 2 传输类型散装 同步类型 无 使用类型数据 wMaxPacketSize 0x0200 1x 512 字节 b 间隔 32 接口描述符: b长度 9 bDescriptorType 4 b接口编号 2 b备用设置 0 bNumEndpoints 2 bInterfaceClass 255 供应商特定类 bInterfaceSubClass 255 供应商特定子类 bInterfaceProtocol 255 供应商特定协议 接口 0 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x84 EP 4 IN bm属性 2 传输类型散装 同步类型 无 使用类型数据 wMaxPacketSize 0x0200 1x 512 字节 b 间隔 32 端点描述符: b长度 7 bDescriptorType 5 bEndpointAddress 0x03 EP 3 OUT bm属性 2 传输类型散装 同步类型 无 使用类型数据 wMaxPacketSize 0x0200 1x 512 字节 b 间隔 32 设备限定符(用于其他设备速度): b长度 10 bDescriptorType 6 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 bNumConfigurations 1 无法获取调试描述符:资源暂时不可用 设备状态:0x0001 自供电我要连接的接口是接口 0(调制解调器)。
ioreg 是这样看的:
| | | | | +-o 华为手机@1d110000
| | | | | +-o AppleUSBHostLegacyClient
| | | | | +-o AppleUSBHostCompositeDevice
| | | | | +-o IOUSBHostInterface@0
| | | | | | {
| | | | | | “USB端口类型”= 0
| | | | | | "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| | | | | | "bcdDevice" = 0
| | | | | | “USB 速度” = 3
| | | | | | “idProduct” = 4097
| | | | | | “bConfigurationValue” = 1
| | | | | | “bInterfaceSubClass” = 255
| | | | | | “位置 ID”= 487653376
| | | | | | "IOGeneralInterest" = "IOCommand 不可序列化"
| | | | | | "IOClassNameOverride" = "IOUSBInterface"
| | | | | | "AppleUSBAlternateServiceRegistryID" = 4294969542
| | | | | | “idVendor”= 4817
| | | | | | "bInterfaceProtocol" = 255
| | | | | | “bAlternateSetting” = 0
| | | | | | “bInterfaceNumber” = 0
| | | | | | “bInterfaceClass” = 255
| | | | | | }
| | | | | |
| | | | | +-o IOUSBHostInterface@1
| | | | | | {
| | | | | | “USB端口类型”= 0
| | | | | | "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| | | | | | "bcdDevice" = 0
| | | | | | “USB 速度” = 3
| | | | | | “idProduct” = 4097
| | | | | | “bConfigurationValue” = 1
| | | | | | “bInterfaceSubClass” = 255
| | | | | | “位置 ID”= 487653376
| | | | | | "IOGeneralInterest" = "IOCommand 不可序列化"
| | | | | | "IOClassNameOverride" = "IOUSBInterface"
| | | | | | "AppleUSBAlternateServiceRegistryID" = 4294969544
| | | | | | “idVendor”= 4817
| | | | | | "bInterfaceProtocol" = 255
| | | | | | “bAlternateSetting” = 0
| | | | | | “bInterfaceNumber” = 1
| | | | | | “bInterfaceClass” = 255
| | | | | | }
| | | | | |
| | | | | +-o IOUSBHostInterface@2
| | | | | {
| | | | | “USB端口类型”= 0
| | | | | "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| | | | | "bcdDevice" = 0
| | | | | “USB 速度” = 3
| | | | | “idProduct” = 4097
| | | | | “bConfigurationValue” = 1
| | | | | “bInterfaceSubClass” = 255
| | | | | “位置 ID”= 487653376
| | | | | "IOGeneralInterest" = "IOCommand 不可序列化"
| | | | | "IOClassNameOverride" = "IOUSBInterface"
| | | | | "AppleUSBAlternateServiceRegistryID" = 4294969546
| | | | | “idVendor”= 4817
| | | | | "bInterfaceProtocol" = 255
| | | | | “bAlternateSetting” = 0
| | | | | “bInterfaceNumber” = 2
| | | | | “bInterfaceClass” = 255
| | | | | }
| | | | |
到目前为止,Info.plist 看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15C27b</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>name.fedevych.GenericWWAN</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>GenericWWAN</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>99.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>99.0.0</string>
<key>IOKitPersonalities</key>
<dict>
<key>HUAWEI_0x12d11001_Control</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.usb.cdc.acm</string>
<key>IOClass</key>
<string>AppleUSBACMControl</string>
<key>IOProviderClass</key>
<string>IOUSBHostInterface</string>
<key>idVendor</key>
<integer>4817</integer>
<key>idProduct</key>
<integer>4097</integer>
<key>bcdDevice</key>
<integer>0</integer>
<key>bInterfaceNumber</key>
<integer>0</integer>
<key>bConfigurationValue</key>
<integer>1</integer>
<key>IOMatchCategory</key>
<string>com.apple.driver.AppleUSBACMControl</string>
</dict>
<key>HUAWEI_0x12d11001_Data</key>
<dict>
<key>CFBundleIdentifier</key>
<string>com.apple.driver.usb.cdc.acm</string>
<key>IOClass</key>
<string>AppleUSBACMData</string>
<key>IOProviderClass</key>
<string>IOUSBHostInterface</string>
<key>idVendor</key>
<integer>4817</integer>
<key>idProduct</key>
<integer>4097</integer>
<key>bcdDevice</key>
<integer>0</integer>
<key>bInterfaceNumber</key>
<integer>0</integer>
<key>bConfigurationValue</key>
<integer>1</integer>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict/>
</dict>
</plist>
任何指针?
【问题讨论】:
标签: macos serial-port modem cdc kernel-extension