Class Codes in include/linux/pci_ids.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been working on the pci_device_id struct, and I have noticed a 
problem.  In the struct, class refers to the Class code register of the 
adapter's PCI config registers.  This is a 24 bit register, but the 
#defines from include/linux/pci_ids.h that are used to fill class are only 
16 bits.  The 16 bits defined in pci_ids.h are class code (8 bits) and 
sub-class code (8 bits). The 8 bits they are missing is the programming 
interface code.  This is causing code to look like the following:

(from drivers/net/acenic.c)
static struct pci_device_id acenic_pci_tbl[] = {
        { PCI_VENDOR_ID_ALTEON, PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE,
          PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_NETWORK_ETHERNET << 8, 
0xffff00, },
....

Notice the "<< 8" in the class field.  This is unnecessary as the 
programming interface code is 00h for all network adapters (and almost 
every other adapter).  Is there something I am missing?

Thanks,

Jon Mason                jonmason@us.ibm.com
Software Engineer        Phone:(512)838.4162
Linux eServer I/O        Fax:  (512)838.3509
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux