Subject: Re: Re: Token Ring driver for NetBSD
To: None <tech-net@NetBSD.ORG>
From: Onno van der Linden <onno@simplex.nl>
List: tech-net
Date: 08/29/1996 22:04:15
John Messenger <John.Messenger@proteon.com> wrote:
> Onno,
> 
> I hope you don't mind me copying this conversation to tech-net.

Of course not.

> I'd be really interested to look at your driver.  Did you arrange to
> have good separation between the chipset-specific stuff and the
> token-ring code?  There's obviously scope for generic code to handle
> most of the token-ring protocols like route discovery and ARP.  It
> should be possible to combine these with FDDI as well.

The driver is pretty much a straight forward port to NetBSD from
the driver that's in the PS2 port of Mach 3.0. It takes care of all
of the low level stuff. For the higher level stuff I copied
Matt Thomas' if_fddisubr.c to if_trsubr.c and started to change
a few lines here and there (mainly to handle the source route stuff).

> The problems that I came across were: how to combine source-route
> discovery and caching with the ARP cache without wasting storage on
> non-token-ring interfaces;

Based on Matt Thomas' suggestion from more than a year ago
("I'd make it part of the llinfo with the llinfo be variable sized")
I've added a bit of code to if_ether.c. Here's a little snippet:

         switch (SDL(gate)->sdl_type) {
         case IFT_IEEE8025:
                allocsize = sizeof(struct llinfo_arp) + sizeof(struct tr_rif);
                break;
         default:
                allocsize = sizeof(struct llinfo_arp);
         }
         R_Malloc(la, struct llinfo_arp *, allocsize);


In tr_output() rt->rt_llinfo + sizeof(struct llinfo_arp) returns a pointer
to a bunch of zeros or the source route info that needs to be inserted.

>                           how to do ARP on token ring (the details of
> how to react to non-IEEE hardware types and whether to compare source
> addresses with the hardware address inside the packet to detect
> bitswapped addresses due to bridging from Ethernet, etc).  I have a
> collection of email messages relating to ARP that you can look at if
> you are interested.

I've got the complete tech-net archive on my disk including your mail
about the handling of bridged ethernet->token-ring and vice versa.
My current if_ether.c only handles both "normal" cases (straight ethernet
and straight token-ring). I think Ignatios Souvatzis wanted to have
arcnet support and decided to hack on it a bit, don't know how far he got
though.

Onno