Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jul 1997 10:43:58 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        terry@lambert.org (Terry Lambert)
Cc:        se@FreeBSD.ORG, Shimon@i-connect.net, freebsd-hackers@FreeBSD.ORG
Subject:   Re: pcireg.h lost children... ?
Message-ID:  <199707210113.KAA19725@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199707202320.QAA09987@phaeton.artisoft.com> from Terry Lambert at "Jul 20, 97 04:20:36 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert stands accused of saying:
> > One of the changes to the PCI code, that might follow (I have
> > not completely made up my mind) is, that the probe will just
> > associate a driver with a list of vendor/device IDs, and there
> > will no longer be a xxx_probe() function in the drivers.
> 
> How does a PCI driver for, for instance, a DEC chip based ethernet
> board find boards for which a vendor/driver assignment has not yet
> been made?

The same way it does now.

> Currently, the probe code will find the board, and it will just work.

You should read the probe code I think.  To save your fingers the effort,
here it is :

static char*
tulip_pci_probe(
    pcici_t config_id,
    pcidi_t device_id)
{
    if (PCI_VENDORID(device_id) != DEC_VENDORID)
        return NULL;
    if (PCI_CHIPID(device_id) == CHIPID_21040)
        return "Digital 21040 Ethernet";
    if (PCI_CHIPID(device_id) == CHIPID_21041)
        return "Digital 21041 Ethernet";
    if (PCI_CHIPID(device_id) == CHIPID_21140) {
        u_int32_t revinfo = pci_conf_read(config_id, PCI_CFRV) & 0xFF;
        if (revinfo >= 0x20)
            return "Digital 21140A Fast Ethernet";
        else
            return "Digital 21140 Fast Ethernet";

    }
    return NULL;
}


Now, if we remove this information from the driver and put it
somewhere in a Big Central Localtion, like, oh say W95 does (seeing as
you respect their design decisions), the central localtion can be
updated rapidly without having to rebuild and reinstall the driver.

Nifty, eh?

> One big problem I can see this causing (though I admit it cures
> one of my loudest complaints: destructive probing) is that the
> vendor/device/driver association list could quicly get too large
> to fit on the same floppy as the BSD kernel.  8-(.

You split it into two parts; the ones needed to boot with, and a
second set for "frivolous" devices. 8)

> 					Terry Lambert

-- 
]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
]] Genesis Software                     genesis@gsoft.com.au            [[
]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707210113.KAA19725>