Skip to content

darwin: fix CDCACM device detection on macOS 12+#86

Open
GowthamNanjukutty wants to merge 1 commit into
intrepidcs:masterfrom
GowthamNanjukutty:fix/darwin-iousbhostdevice-macos12
Open

darwin: fix CDCACM device detection on macOS 12+#86
GowthamNanjukutty wants to merge 1 commit into
intrepidcs:masterfrom
GowthamNanjukutty:fix/darwin-iousbhostdevice-macos12

Conversation

@GowthamNanjukutty
Copy link
Copy Markdown

On macOS 12 and later, Apple replaced IOUSBDevice with IOUSBHostDevice in the USB host stack. When walking the IORegistry parent chain to find the USB device providing a serial port, the existing code only checked IOObjectConformsTo(parent, kIOUSBDeviceClassName). On macOS 12+, this check fails because the USB device node conforms to IOUSBHostDevice instead.

Fix by also checking IOObjectConformsTo(parent, "IOUSBHostDevice"), so CDCACM device discovery works on both old and new macOS.

Verified on macOS 26 (Tahoe, arm64) with a ValueCAN 4-2 (V2D805).

On macOS 12 and later, Apple replaced IOUSBDevice with IOUSBHostDevice
in the USB host stack. When walking the IORegistry parent chain to find
the USB device providing a serial port, the existing code only checked
IOObjectConformsTo(parent, kIOUSBDeviceClassName). On macOS 12+, this
check fails because the USB device node conforms to IOUSBHostDevice
instead.

Fix by also checking IOObjectConformsTo(parent, "IOUSBHostDevice"),
so CDCACM device discovery works on both old and new macOS.

Verified on macOS 26 (Tahoe, arm64) with a ValueCAN 4-2 (V2D805).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant