Driver Type for Custom Ethernet based device?

Hi

I am looking to create a driver for a custom ethernet based device. Trying to understand what IOService subclass I should be focusing on when I go to build my custom driver.

Here is my current setup:

  • external card has ethernet port
  • ethernet cable connected via ethernet to thunderbolt adapter to thunderbolt port on MacBook
  • in Networking preferences, I have configured the ethernet connection using manual configured IPv4 connection
    • IP Address: 10.9.9.2 (matches how the device registers itself when connected to a windows box)
    • Router: 10.9.9.9 fixed IP set by the manufacturer on the card
    • Subnet Mask: 255.255.255.0

With this arrangement, I am able to ping the card, and from what I can tell in Wireshark, behaves the same as when connected to a windows box.

For writing a driver - do I focus on IOUserNetworkEthernet or IOPCIDevice as the base IOService class for my driver?

I have started down the IOUserNetworkEthernet route - but things are not working well. After reading through some documentation etc, starting to think maybe IOPCIDevice and doing PCIe might be the better choice.

Any assistance on helping me set direction would be great.

Thx.

After more research - I'm thinking I have approached this problem the wrong way - since I can ping the card I am trying to communicate with, and the firmware on the card communicates via UDP - I probably don't need a driver. Just need to attempt basic UDP based socket communication to work with the card.

Your conclusion in your comments is correct. Since this device is already fully recognized by the OS, there is no need to write a driver for it. Simply communicate with it over UDP.

However, to answer the underlying question of "what kind of driver do I write for a networking device connected via a thunderbolt dongle": That would be a NetworkingDriverKit driver. While the device is connected via a Thunderbolt adapter, it's just that, an adapter. This would also be true of a USB to Ethernet adapter. No need to suddenly also write a USBDriverKit driver in case someone uses a different type of dongle. Ultimately, the device will be communicating via a networking protocol, so that's the DriverKit you would need to use for this kind of application. For example, if you were to connect it to an ethernet jack of a Mac, it would still work. But then you wouldn't need PCIDriverKit at all! So focus on the main transport, and ignore adapters in the chain.

Driver Type for Custom Ethernet based device?
 
 
Q