Control (e.g. devctl() and ioctl())

Very similar to io-net's speedo_devctl() function, if we look at trunk/sys/dev_qnx/speedo/devctl.c, we will find the speedo_ioctl() function. It's passed an unsigned cmd, which the driver can choose to either implement or not.

Looking at speedo_ioctl(), we can see it handles SIOCGDRVCOM, which nicinfo uses to get driver configuration information and counts. If the driver doesn't implement SIOCGDRVCOM, it will fall through at the end of the switch statement to the generic ether_ioctl() function in io-pkt, which actually does implement a very bare-bones version of the nicinfo stats. This was actually implemented for ported BSD drivers.

Another interesting couple of values for cmd are SIOCSIFMEDIA and SIOCGIFMEDIA. This functionality is new for io-pkt. In io-net, there was no way to set the link speed/duplex/etc. except via command-line options. However with io-pkt, we can use the MEDIA ioctl() commands (e.g. via the ifconfig utility) to change the link speed and duplex on the fly.

Look at trunk/sys/dev_qnx/speedo/bsd_media.c for details of how this is implemented — it's heavily commented, and is very similar for all native io-pkt drivers. Note that your driver doesn't need to implement the MEDIA ioctls, but if it chooses to do so, then this functionality is immediately available external to io-pkt.