title: USB Device Enumeration on OS X
body: <p>I have a codeless kext that I use to connect to a USB single-chip device (CSR BC4) - it works great. If I connect multiple devices to an external hub, it still works great.</p>
  
  <p>In the IOKitPersonalities dictionary of my info.plist, for the device and interface dictionaries, I have been matching on the CSR driver in the IOBluetoothFamily.kext with a CFBundleIdentifier that referenced that CSR kext and the IOClass from that package.</p>
  
  <p>Fast forward to a new device that uses multiple CSR BC7 chips on an internal hub. Long story short, I was unable to get that device to properly match all the chips in the device. An Apple driver would generally grab two of the chips. If I plugged in two devices, I would get all the chips from one and no chips from the other. Days of digging ensued. I kept seeing references on Apple lists about using a CFBundleIdentifier of "com.apple.kernel.iokit" or "com.apple.kpi.iokit" with an IOClass of "IOService"</p>
  
  <p>I tried com.apple.kernel.iokit with no luck for neither of my devices. Since I am on a 64-bit platform, I decided to try com.apple.kpi.iokit - bingo! Both devices work like a charm.</p>
  
  <p>My question is what am I really matching to? I can understand matching the device to an existing driver, but what am I matching to in this case? I cannot find anything definitive from Apple that really tells me what I am doing.</p>
  
  <p>Any help appreciated!</p>
  
  <p>Example initial personality:</p>
  
  <pre><code>MyCsrDevice  
    CFBundleIdentifier    com.apple.driver.CSRUSBBluetoothHCIController  
    IOClass               CSRUSBBluetoothHCIController  
    IOProviderClass       IOUSBDevice  
    idProduct             32  
    idVendor              vvvv  
  
  MyCsrInterface  
    CFBundleIdentifier    com.apple.driver.CSRUSBBluetoothHCIController  
    IOClass               CSRUSBBluetoothHCIController  
    IOProviderClass       IOUSBInterface  
    idProduct             32  
    idVendor              vvvv 
    bInterfaceNumber      0  
    bConfigurationValue   1  
  </code></pre>
  
  <p>Example current personality:</p>
  
  <pre><code>MyCsrDevice  
    CFBundleIdentifier    com.apple.kpi.iokit  
    IOClass               IOService  
    IOProviderClass       IOUSBDevice  
    idProduct             32  
    idVendor              vvvv 
  
  MyCsrInterface  
    CFBundleIdentifier    com.apple.kpi.iokit  
    IOClass               IOService  
    IOProviderClass       IOUSBInterface  
    idProduct             32  
    idVendor              vvvv 
    bInterfaceNumber      0  
    bConfigurationValue   1    
  </code></pre>