The HyperNews Linux KHG Discussion Pages

## Re: Network Device Drivers

  Forum: Device Drivers
  Re: Re: Network Device Drivers (Paul Gortmaker)
  Keywords: network driver functions
  Date: Thu, 30 May 1996 10:42:09 GMT
  From: Neal Tucker <ntucker@adobe.com>

Paul Gortmaker says:
    >Somebody asked me about a year or so ago as to what the basics
    >of a net driver would look like.
    >
    >1) Probe:
    >        called at boot to check for existence of card. Best if it
    >        can check un-obtrsively by reading from memory, etc. Can
    >        also read from i/o ports. Writing to i/o ports in a probe
    >        is *not* allowed as it may kill another device.
    >        Some device initialization is usually done here (allocating
    >        i/o space, IRQs,filling in the dev->??? fields etc.)
You must be the guy that wrote that part of the ethernet HOWTO. :-) I've just recently been looking at the network device driver interface, and I read your stuff and this part confused me, since all the code I was looking at (dummy, loopback, slip..) refers to this as "init", rather than "probe". (which may sound a bit nit picky, but there were other routines called "probe" that I studied for a while, thinking they were the important ones (they turned out to be used for module initialization only) :-). But on to my real reason for writing... One thing that I think would be helpful to people trying to write a network driver for the first time is a description of how this is all hooked into the kernel. I've found plenty of examples of what the actual driver code needs to do, (lots of some_driver.c files, including skeleton.c, which is usually what people point to), but no explanation of how to get it called. Basically what it comes down to is an explanation of Space.c, which doesn't do very much, but is a bit funny looking to a first-timer. Now that I understand it, it seems a bit obvious, but back when I was going mad trying to figure out why my driver didn't execute, it would have been really nice to have it all spelled out. So once it's done, I will submit a description. If you'd like, check out a start at http://fester.axis.net/~linux/454.html. Make sure to let me and/or the rest of the world what you think. -Neal Tucker

Messages

1. network driver info by Neal Tucker
-> Network Driver Desprately Needed by Paul Atkinson