Izumi Tsutsui from the NetBSD Team give me a hand but I not a programmer and I can not do that ...
NetBSD sources are split to common (called machine independent) sources
and port (including atari specific, called machine dependent) sources
so it's a bit hard to check one specific device.
For SMC_TT, following files are used:
src/sys/arch/atari/vme/if_we_vme.c (SMC_TT specific part)
src/sys/dev/ic/we.c (SMC Elite Ultra chip specific)
src/sys/dev/ic/dp8390.c (common DP8390 specific)
bus_space_read_1() and bus_space_write_1() functions are
something like inb() and outb() on x86.
You can see which address should be used to access
ISA SMC Elite Ultra chip registers in if_we_vme.c comments:https://nxr.netbsd.org/xref/src/sys/arc ... c?r=1.4#90
ISA I/O / SMC_TT address (8bit access)
0x280 / 0xFE200280
0x281 / 0xFE300280
0x282 / 0xFE200282
0x283 / 0xFE300282
0x284 / 0xFE200284
0x285 / 0xFE300284
ISA MEM / SMC_TT address (16bit access)
0xD0000 / 0xFE0D0000
0xD0002 / 0xFE0D0002
The orignal SMC_TT documents also help:http://cd.textfiles.com/atarilibrary/at ... /LANCE.TXT
It looks OCR'ed so several words are incomplete (and annoying for
machine translations), but I guess no problem for German people :-)
To port drivers to other OS, it might be easier to check
Linux and other OS drivers:https://git.kernel.org/pub/scm/linux/ke ... .c?h=v4.14
-> https://github.com/freemint/freemint/tr ... ockets/xif
Hmm. It looks freemint drivers are similar to Linux one.
In general NIC drivers have the following funcionts:
- initialization (probe, reset, setup, getting MAC address etc.)
- TX packets
- RX packets
- interrupt handling
On the other hand, freemit xif seem to require the following interfaces:
- xxx_open() - reset and setup device
- xxx_close() - reset chip to stop all packets
- xxx_output() - transmit packets passed from network layer
- xxx_config() - OS specific for network layer, maybe not necessary at debug phase
RX packets seem handled in the interrupt routine.
The following ones looks device specific
- xxx_probe() - checking if the device exists; not necessary at debug phase (you can assume it's always there)
- xxx_reset() - chip specific; sequence of write registers, setup shared memory etc.
- xxx_install_ints() - interrupt setup; maybe chip and OS specific so it's better to ask freemint guys
- xxx_int - interrupt handler; receiving packets and TX packet completion are notified via interrupt
To check TX/RX packet functions, the following NetBSD bootloader sources might help to check differences LANCE (am7990) and WD80x3 with DP8390:https://nxr.netbsd.org/xref/src/sys/arc ... lib/netif/