Date: Tue, 12 Mar 1996 10:46:43 +1030 (CST) From: Michael Smith <msmith@atrad.adelaide.edu.au> To: yaser@doleh.com (Yaser K. Doleh) Cc: freebsd-hackers@FreeBSD.org Subject: Re: First attempt to write a device driver Message-ID: <199603120016.KAA24351@genesis.atrad.adelaide.edu.au> In-Reply-To: <199603111829.NAA03888@doleh.com> from "Yaser K. Doleh" at Mar 11, 96 01:29:30 pm
next in thread | previous in thread | raw e-mail | index | archive | help
Yaser K. Doleh stands accused of saying: > When I put an entry in the kernel config like > > device tr0 at isa? port 0xA20 net irq 11 iomem 0xde000 vector trintr > > Does this means the routine "trintr" will called when the card generate > an interrupt ? Yes. > I don't seem to be able to get this routine called. I think I followed > what the IBM manual says but no interrupts. So from the BSD kernel > point of view what is my check list to make sure my "trintr" gets > called. Make sure the above is in your config, make sure you have interrupts enabled on the card. > How can I tell the kernel that this is a network device ? > > The kernel does not seem to recongnize the device as a network > device ? i.e. when I boot with -c the device is not listed under > network devices. You mean the 'visual' mode doesn't know your driver? That's because there's no way for it to find all the names of drivers installed itself, so that information is in the table at the top of /sys/i386/i386/userconfig.c. Look for the string "EDIT THIS LIST", and create an entry like the other network devices. > I used the ix driver as a starting point and basicly changed what > the functions do. I even attached the driver to the ethernet code > just to experiment. I can ifconfig the interface, my ioctl function > is called and I can ping the interface itself (normal since this has > nothing to do with my driver). Looks like you've got the rest of the skeleton working fine. > I am also thinking of really hooking the driver to the ethernet code > and just convert tokenring<->ethernet in my driver. So to the machine > it will look like this is an ethernet driver but to the network > it will look like its a tokenring. Um, that's an interesting approach. I'd be inclined to seperate the two so that the token-specific code could be reused for other hardware though. Have a look at /sys/net/if_ether.c. There's already code in there to handle LLC (look for "LLC" 8) which I believe is the major obstacle. Your driver shouldn't try to interpret the contents of packets itself. > Yaser Doleh -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603120016.KAA24351>