I would like to write a software stack that interfaces with my SANA compliant network
Why? Why can't you use IP?
I should also warn you that very old device drivers do not handle multiple readers correctly. Only the SANA2 R2 and later demand that packets are sent to all readers. If this is not implemented correctly the result is that packets appear to be lost (when they are read by the "other" caller).
This means that you won't be able to use the driver reliably for two different things.. such as TCP/IP Stack and Envoy. Luckily such buggy drivers are in the minority these days.
If I understand correctly now, the device driver for the NIC "extends" the system with SANA compliant functions - correct?
No. The drivers are standalone drivers, they don't integrate to the system other than being opened with OpenDevice() call, just like any other device driver.
How would this work with multiple NICs present in the system?
You open the correct device and unit number for your NIC.
Does the device spec include some sort of unit numbering, where each unit corresponds to a unique set of SANA functions?
No.
If SANA functions are provided by the network card device driver (eg. a2065.device or ariadne_ii.device) then the implementation of that device driver is according to SANA spec version - is there some way to check to which spec the driver conforms?
Not by design, but it should be possible to detect it manually.
If device implements S2_ADDMULTICASTADDRESSES then it's R3.
If device implements commands from
http://web.archive.org/web/20020602075950/www.amigadev.net/documents/sana2r4.html then it's R4.
However, it isn't that clear cut. There are other extensions as well, and some drivers might have gaps in their support. That is they might support some extensions while ignoring some other.