Jump to ID:
BSPs and Drivers

Project Home

Documents

Discussions

Wiki

Project Info
Forum Topic - Possible flaw in pci-bios for x86???: (3 Items)
   
 
 
Possible flaw in pci-bios for x86???  
Hi All,

I don't want to cross post but this one is related to: http://community.qnx.com/sf/discussion/do/listPosts/projects.
core_os/discussion.newcode.topc1983

There seems to be a flaw in scan_all(), find_all() and rescan_all() in server.c. It is about the following code (snippet
 from find_all():
if ((PCI_read_config32 (bus, 
                                 devfunc, 
                                 offsetof(struct _pci_config_regs, Revision_ID),
                                 1, 
                                 (char *)&dword) != PCI_SUCCESS))
    break;

if (dword == 0 || dword == 0xffffffff)
    continue;

The last 2 lines should be:
if (dword == 0xffffffff)
    continue;

because (according to the PCI specification):
This register specifies a device specific revision identifier. The value is chosen by the vendor. Zero is an acceptable 
value. This field should be viewed as a vendor defined extension to the Device ID.

At that stage in the code, PCI_read_config32 returns '0', so the register could be read and the revision ID is known and
 could be zero. And that should not be a reason to ignore the PCI adapter.

Is this a flaw in 'pci-bios' and should I fix this when I run into this problem or is QSSL going to fix this in a future
 release?

Regards,
Freddy Martens
Associations:
post4992:
              Re: pci-bios (6.3.0SP1 and 6.3.2) and Moschip MSC9815CSV based PCI card (SOLVED, PCI revisionID equals '0') -  - Freddy Martens
            
RE: Possible flaw in pci-bios for x86???  
This field also contains the class code, which cannot be zero. The Revision
ID is only one byte.


-----Original Message-----
From: Freddy Martens [mailto:fmartens-2000@planet.nl] 
Sent: Wednesday, February 13, 2008 5:10 AM
To: general-bsp
Subject: Possible flaw in pci-bios for x86???

Hi All,

I don't want to cross post but this one is related to:
http://community.qnx.com/sf/discussion/do/listPosts/projects.core_os/discuss
ion.newcode.topc1983

There seems to be a flaw in scan_all(), find_all() and rescan_all() in
server.c. It is about the following code (snippet from find_all():
if ((PCI_read_config32 (bus, 
                                 devfunc, 
                                 offsetof(struct _pci_config_regs,
Revision_ID),
                                 1, 
                                 (char *)&dword) != PCI_SUCCESS))
    break;

if (dword == 0 || dword == 0xffffffff)
    continue;

The last 2 lines should be:
if (dword == 0xffffffff)
    continue;

because (according to the PCI specification):
This register specifies a device specific revision identifier. The value is
chosen by the vendor. Zero is an acceptable value. This field should be
viewed as a vendor defined extension to the Device ID.

At that stage in the code, PCI_read_config32 returns '0', so the register
could be read and the revision ID is known and could be zero. And that
should not be a reason to ignore the PCI adapter.

Is this a flaw in 'pci-bios' and should I fix this when I run into this
problem or is QSSL going to fix this in a future release?

Regards,
Freddy Martens


_______________________________________________
QNX BSPs
http://community.qnx.com/sf/go/post4993
Re: RE: Possible flaw in pci-bios for x86???  
Thanks Hugh,

Someone is going to be pleased ;-)

Cheers,
Freddy