IOUSBMassStorageDriverNub missing

Problem Statement:

Can anyone suggest why in very few mac systems storage device don’t have “IOUSBMassStorageDriverNub” in the “IORegistry”? And in this case which “IOServiceMatching” should be used for storage devices?


Description:

“IOUSBMassStorageDriverNub” is missing in the “IORegistry” of few mac systems (~3—4 out of millions) for Storage devices. As expected storage device appears under “IOUSBDevice” in the “IORegistry” but My intention is to entertain only storage devices not any other peripheral devices like “USB host”, “Key board”, “Mouse”, etc…

In order to receive “IOServiceMatchingCallback“ for newly added storage device into the system, I am using the below code snippet:

void MyClass::registerNotificationsForUSBStorageDevices()

{

CFMutableDictionaryRef matchingDict;

kern_return_t kr;

CFRunLoopRef runLoop = CFRunLoopGetCurrent();

IONotificationPortRef notifyPort = IONotificationPortCreate(kIOMasterPortDefault);

CFRunLoopSourceRef runLoopSource = IONotificationPortGetRunLoopSource(notifyPort);

matchingDict = IOServiceMatching("IOUSBMassStorageDriverNub");


matchingDict = (CFMutableDictionaryRef) CFRetain(matchingDict);

kr = IOServiceAddMatchingNotification(notifyPort, kIOFirstMatchNotification, matchingDict,

(IOServiceMatchingCallback)USBStorageDeviceAddedCallback, NULL, &usbDeviceAddedNotification);

//For already connected devices

USBStorageDeviceAddedCallback (NULL, usbDeviceAddedNotification);

CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopDefaultMode);

return;

}

Can you reproduce this in your office? If so, you should grab an I/O Registry dump to explore what get registered and how. If not, try asking one of the users experiencing the problem for such a dump.

You can grab the dump using:

$ ioreg -l -c -w 0

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I have shared the dump in email. Looking forward to your input.

I have shared the dump in email.

Thanks.

Comparing the two logs the critical difference seems to be the

IOUSBHostInterface@0
service. In the working case it has been registered — that is, it has the ‘registered’ flag set — but that’s not true in the failing case.

I don’t know the USB family well enough to offer any input as to why an

IOUSBDevice
service would register an
IOUSBInterface
in one case but not in another. Sorry. My only recommendation is that you open a DTS tech support incident and discuss this with DTS’s USB expert.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
IOUSBMassStorageDriverNub missing
 
 
Q