从无代码的KEXT迁移到DEXT. USB介面消失 [英] Migrating from codeless KEXT to DEXT. Usb interfaces disappeared

查看:151
本文介绍了从无代码的KEXT迁移到DEXT. USB介面消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从KEXT迁移到DEXT.我的USB设备不应与经典驱动程序匹配(在其他情况下,它不允许打开设备和界面).

I'm trying to migrate from KEXT to DEXT. My USB device should not be matched by the classic driver (in the other case, it does not allow to open the device and interface).

我正在使用示例USB应用程序进行测试.

I am using a sample USB application for testing.

因此,在安装系统扩展之前,我能够看到1个设备和3个接口. 但是,当我安装系统扩展(下一个)时,找不到任何接口.他们似乎迷路了. 要搜索接口,我使用命令"ioreg -lirc IOUSBHostInterface".

So, before installing the system extension, I was able to see 1 device and 3 interfaces. However, when I install the system extension (next), I can not find any interfaces. They seem to be lost. To search for interfaces I use the command "ioreg -lirc IOUSBHostInterface".

知道为什么会发生这种情况吗?

我的驱动程序Info.plist文件

<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>IOKitPersonalities</key>
    <dict>
        <key>MyUserUSBInterfaceDriver</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            <key>IOClass</key>
            <string>IOService</string>
            <key>IOProviderClass</key>
            <string>IOUSBHostDevice</string>
            <key>IOUserClass</key>
            <string>MyUserUSBInterfaceDriver</string>
            <key>IOUserServerName</key>
            <string>sc.knight.MyUserUSBInterfaceDriver</string>
            <key>idProduct</key>
            <integer>4</integer>
            <key>idVendor</key>
            <integer>10978</integer>
        </dict>
    </dict>
    <key>OSBundleUsageDescription</key>
    <string>Example user space USB driver</string>
</dict>
</plist>

和驱动程序权利文件

<plist version="1.0">
<dict>
    <key>com.apple.developer.driverkit</key>
    <true/>
    <key>com.apple.developer.driverkit.transport.usb</key>
    <array>
        <dict>
            <key>idVendor</key>
            <integer>10978</integer>
            <key>idProduct</key>
            <integer>4</integer>
        </dict>
    </array>
</dict>
</plist>

安装扩展名后,"ioreg -lirc IOUSBHostDevice"命令的结果. 如您所见... 0个界面

Results of the "ioreg -lirc IOUSBHostDevice" command after installing the extension. As you can see... 0 interfaces

admins-MBP:USBApp-updated-master-2 copy admin$ ioreg -lirc IOUSBHostDevice

+-o VXi Point@14300000  <class IORegistryEntry:IOService:IOUSBNub:IOUSBDevice, id 0x100000657, registered, matched, active, busy 0 (210 ms), retain 20>

.......

  | }

  | 

  +-o AppleUSBHostLegacyClient  <class IORegistryEntry:IOService:AppleUSBHostLegacyClient, id 0x10000065a, !registered, !matched, active, busy 0, retain 8>. 
  |   {

  |     "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=1,"CapabilityFlags"=65536,"MaxPowerState"=2,"DriverPowerState"=1}

  |   }

  |   

  +-o MyUserUSBInterfaceDriver  <class IORegistryEntry:IOService, id 0x10000065d, !registered, !matched, active, busy 0, retain 7>

      {

        ......

      }

推荐答案

我认为问题可能是这样的:

I think the problem might be this:

        <key>IOProviderClass</key>
        <string>IOUSBHostDevice</string>

这将在USB设备的根级别上匹配.如果这样做,DEXT将需要实现IOKit通常免费提供的所有基本USB描述符.

This will match on the root level of the USB device. If you do this, your DEXT would need to implement all the basic USB descriptor stuff that IOKit normally does for free.

尝试将IOProviderClass更改为IOUSBHostInterface是否对您有用.

Try if changing IOProviderClass to IOUSBHostInterface works for you.

这篇关于从无代码的KEXT迁移到DEXT. USB介面消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆