Why is my PnP card no longer found (or found as unknown) since upgrading to FreeBSD 4.x?

FreeBSD 4.x is now much more PnP-centric and this has had the side effect of some PnP devices (e.g. sound cards and internal modems) not working even though they worked under FreeBSD 3.x.

The reasons for this behavior are explained by the following e-mail, posted to the freebsd-questions mailing list by Peter Wemm, in answer to a question about an internal modem that was no longer found after an upgrade to FreeBSD 4.x (the comments in [] have been added to clarify the context.

The PNP bios preconfigured it [the modem] and left it laying around in port space, so [in 3.x] the old-style ISA probes ``found'' it there.

Under 4.0, the ISA code is much more PnP-centric. It was possible [in 3.x] for an ISA probe to find a ``stray'' device and then for the PNP device id to match and then fail due to resource conflicts. So, it disables the programmable cards first so this double probing cannot happen. It also means that it needs to know the PnP id's for supported PnP hardware. Making this more user tweakable is on the TODO list.

To get the device working again requires finding its PnP id and adding it to the list that the ISA probes use to identify PnP devices. This is obtained using pnpinfo(8) to probe the device, for example this is the output from pnpinfo(8) for an internal modem:

    # pnpinfo
    Checking for Plug-n-Play devices...
    Card assigned CSN #1
    Vendor ID PMC2430 (0x3024a341), Serial Number 0xffffffff
    PnP Version 1.0, Vendor Version 0
    Device Description: Pace 56 Voice Internal Plug & Play Modem
    Logical Device ID: PMC2430 0x3024a341 #0
            Device supports I/O Range Check
    TAG Start DF
        I/O Range 0x3f8 .. 0x3f8, alignment 0x8, len 0x8
            [16-bit addr]
        IRQ: 4  - only one type (true/edge)

[more TAG lines elided]

    TAG End DF
    End Tag
    Successfully got 31 resources, 1 logical fdevs
    -- card select # 0x0001
    CSN PMC2430 (0x3024a341), Serial Number 0xffffffff
    Logical device #0
    IO:  0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8 0x03e8
    IRQ 5 0
    DMA 4 0
    IO range check 0x00 activate 0x01

The information you require is in the ``Vendor ID'' line at the start of the output. The hexadecimal number in parentheses (0x3024a341 in this example) is the PnP id and the string immediately before this (PMC2430) is a unique ASCII id. This information needs adding to the file /usr/src/sys/isa/sio.c.

You should first make a backup of sio.c just in case things go wrong. You will also need it to make the patch to submit with your PR (you are going to submit a PR, are you not?) then edit sio.c and search for the line

    static struct isa_pnp_id sio_ids[] = {

then scroll down to find the correct place to add the entry for your device. The entries look like this, and are sorted on the ASCII Vendor ID string which should be included in the comment to the right of the line of code along with all (if it will fit) or part of the Device Description from the output of pnpinfo(8):

    {0x0f804f3f, NULL},     /* OZO800f - Zoom 2812 (56k Modem) */
    {0x39804f3f, NULL},     /* OZO8039 - Zoom 56k flex */
    {0x3024a341, NULL},     /* PMC2430 - Pace 56 Voice Internal Modem */
    {0x1000eb49, NULL},     /* ROK0010 - Rockwell ? */
    {0x5002734a, NULL},     /* RSS0250 - 5614Jx3(G) Internal Modem */

Add the hexadecimal Vendor ID for your device in the correct place, save the file, rebuild your kernel, and reboot. Your device should now be found as an sio device as it was under FreeBSD 3.x

Suggest a Site