I've recently run into some cases where there are devices that have a
given PCI/device id set, that is inadequate to fully identify the
device.

For example, there are two major variants of realtek 8139.  The main
8139 family, which is pretty "sucky", and the 8139C+.  The 8139C+
supports pretty much everything that the 8169 does (including vlan
tagging, hardware checksum offload, descriptor based DMA, etc.)

The way to tell the difference is to look at a revision register that
isn't part of the normal PCI configuration space.

Solaris' driver binding/identification mechanism is not up to the task.

I'd like to offer a suggestion for an enhancement here.

Specifically, it would be nice if there was a way to integrate some
"quirks" code, or something similiar, that was part of the core kernel,
but which runs before normal device drivers attach.  (Perhaps associated
with driver aliases.)  The purpose of this code would be to "change" the
device name to allow a different binding to occur.

For example, imagine the following API:

int check_rtl8139(dev_info_t dip)
{
        /* map registers and check the hwrev */
        if (hwrev == RTL8139C+) {
                /* rge can handle this one to get better support */
                ddi_rename_dip(dip, "SUNW,rtl8139C+");
        }
}

device_quirks_register("pci10ec,8139", &check_rtl8139);

By the way, this could be used to solve the problem for QFE versus HME
binding on x86 as well.  Checking the parent node, or the Fcode PROM on
the device, could tell us whether to assign the node name "SUNW,qfe" or
"SUNW,hme".

Basically, this gives the ability to rename a device node like Fcode
does, without requiring the presence of Fcode (which isn't supported on
x86) to do so.

I think it is pretty obvious that this table has to be in the core
kernel somehow.

Thoughts?

        -- Garrett

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to