• Bug#265745: pciutils: lspci uses wrong header type for PCI-X cap

    From Roland Dreier@1:229/2 to All on Sat Aug 14 20:30:09 2004
    From: [email protected]

    This is a multi-part MIME message sent by reportbug.

    Package: pciutils
    Version: 1:2.1.11-15
    Severity: normal
    Tags: patch

    At least on my system (with a 2.6 kernel and sysfs), lspci::show_pcix()
    uses a header type of 0x80, which leads to nothing being displayed for
    PCI-X capabilities, for example (note the cap at offset 0x94 is type 7,
    PCI-X):

    0000:04:03.1 SCSI storage controller: Adaptec AIC-7902 U320 (rev 03)
    Subsystem: Adaptec: Unknown device ffff
    Flags: bus master, 66MHz, medium devsel, latency 64, IRQ 31
    I/O ports at dc00 [size=256]
    Memory at fe2fe000 (64-bit, non-prefetchable) [disabled] [size=8K]
    I/O ports at d800 [size=256]
    Expansion ROM at fe200000 [disabled] [size=512K]
    Capabilities: [dc] Power Management version 1
    Capabilities: [a0] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable-
    Capabilities: [94] 00: 05 90 1f 80 15 01 30 02 03 00 00 01 10 40 80 00 10: 01 dc 00 00 04 e0 2f fe 00 00 00 00 01 d8 00 00
    20: 00 00 00 00 00 00 00 00 00 00 00 00 05 90 ff ff
    30: 00 00 20 fe dc 00 00 00 00 00 00 00 05 02 28 19
    40: c6 a3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    90: 00 00 00 00 07 00 42 00 19 04 03 06 00 02 00 00
    a0: 05 94 82 00 00 00 00 00 00 00 00 00 00 00 00 00
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 01 a0 01 00
    e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    f0: 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 02

    Changing the test to use get_conf_byte() as in the attached patch
    fixes this for me.


    -- System Information:
    Debian Release: 3.1
    APT prefers testing
    APT policy: (500, 'testing')
    Architecture: i386 (i686)
    Kernel: Linux 2.6.7
    Locale: LANG=C, LC_CTYPE=C

    Versions of packages pciutils depends on:
    ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an

    -- no debconf information

    Index: pciutils-2.1.11/lspci.c ===================================================================
    --- pciutils-2.1.11.orig/lspci.c 2004-08-14 10:51:38.767278906 -0700
    +++ pciutils-2.1.11/lspci.c 2004-08-14 10:52:13.653515366 -0700
    @@ -580,7 +580,7 @@
    static void
    show_pcix(struct device *d, int where)
    {
    - switch (d->dev->hdrtype)
    + switch (get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f)
    {
    case PCI_HEADER_TYPE_NORMAL:
    show_pcix_nobridge(d, where);

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)