xref: /linux/rust/kernel/pci/id.rs (revision 07fdad3a93756b872da7b53647715c48d0f4a2d0)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 //! PCI device identifiers and related types.
4 //!
5 //! This module contains PCI class codes, Vendor IDs, and supporting types.
6 
7 use crate::{bindings, error::code::EINVAL, error::Error, prelude::*};
8 use core::fmt;
9 
10 /// PCI device class codes.
11 ///
12 /// Each entry contains the full 24-bit PCI class code (base class in bits
13 /// 23-16, subclass in bits 15-8, programming interface in bits 7-0).
14 ///
15 /// # Examples
16 ///
17 /// ```
18 /// # use kernel::{device::Core, pci::{self, Class}, prelude::*};
19 /// fn probe_device(pdev: &pci::Device<Core>) -> Result {
20 ///     let pci_class = pdev.pci_class();
21 ///     dev_info!(
22 ///         pdev.as_ref(),
23 ///         "Detected PCI class: {}\n",
24 ///         pci_class
25 ///     );
26 ///     Ok(())
27 /// }
28 /// ```
29 #[derive(Clone, Copy, PartialEq, Eq)]
30 #[repr(transparent)]
31 pub struct Class(u32);
32 
33 /// PCI class mask constants for matching [`Class`] codes.
34 #[repr(u32)]
35 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
36 pub enum ClassMask {
37     /// Match the full 24-bit class code.
38     Full = 0xffffff,
39     /// Match the upper 16 bits of the class code (base class and subclass only)
40     ClassSubclass = 0xffff00,
41 }
42 
43 macro_rules! define_all_pci_classes {
44     (
45         $($variant:ident = $binding:expr,)+
46     ) => {
47         impl Class {
48             $(
49                 #[allow(missing_docs)]
50                 pub const $variant: Self = Self(Self::to_24bit_class($binding));
51             )+
52         }
53 
54         impl fmt::Display for Class {
55             fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
56                 match self {
57                     $(
58                         &Self::$variant => write!(f, stringify!($variant)),
59                     )+
60                     _ => <Self as fmt::Debug>::fmt(self, f),
61                 }
62             }
63         }
64     };
65 }
66 
67 /// Once constructed, a [`Class`] contains a valid PCI class code.
68 impl Class {
69     /// Create a [`Class`] from a raw 24-bit class code.
70     #[inline]
71     pub(super) fn from_raw(class_code: u32) -> Self {
72         Self(class_code)
73     }
74 
75     /// Get the raw 24-bit class code value.
76     #[inline]
77     pub const fn as_raw(self) -> u32 {
78         self.0
79     }
80 
81     // Converts a PCI class constant to 24-bit format.
82     //
83     // Many device drivers use only the upper 16 bits (base class and subclass),
84     // but some use the full 24 bits. In order to support both cases, store the
85     // class code as a 24-bit value, where 16-bit values are shifted up 8 bits.
86     const fn to_24bit_class(val: u32) -> u32 {
87         if val > 0xFFFF {
88             val
89         } else {
90             val << 8
91         }
92     }
93 }
94 
95 impl fmt::Debug for Class {
96     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
97         write!(f, "0x{:06x}", self.0)
98     }
99 }
100 
101 impl ClassMask {
102     /// Get the raw mask value.
103     #[inline]
104     pub const fn as_raw(self) -> u32 {
105         self as u32
106     }
107 }
108 
109 impl TryFrom<u32> for ClassMask {
110     type Error = Error;
111 
112     fn try_from(value: u32) -> Result<Self, Self::Error> {
113         match value {
114             0xffffff => Ok(ClassMask::Full),
115             0xffff00 => Ok(ClassMask::ClassSubclass),
116             _ => Err(EINVAL),
117         }
118     }
119 }
120 
121 /// PCI vendor IDs.
122 ///
123 /// Each entry contains the 16-bit PCI vendor ID as assigned by the PCI SIG.
124 #[derive(Clone, Copy, PartialEq, Eq)]
125 #[repr(transparent)]
126 pub struct Vendor(u16);
127 
128 macro_rules! define_all_pci_vendors {
129     (
130         $($variant:ident = $binding:expr,)+
131     ) => {
132         impl Vendor {
133             $(
134                 #[allow(missing_docs)]
135                 pub const $variant: Self = Self($binding as u16);
136             )+
137         }
138 
139         impl fmt::Display for Vendor {
140             fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
141                 match self {
142                     $(
143                         &Self::$variant => write!(f, stringify!($variant)),
144                     )+
145                     _ => <Self as fmt::Debug>::fmt(self, f),
146                 }
147             }
148         }
149     };
150 }
151 
152 /// Once constructed, a `Vendor` contains a valid PCI Vendor ID.
153 impl Vendor {
154     /// Create a Vendor from a raw 16-bit vendor ID.
155     #[inline]
156     pub(super) fn from_raw(vendor_id: u16) -> Self {
157         Self(vendor_id)
158     }
159 
160     /// Get the raw 16-bit vendor ID value.
161     #[inline]
162     pub const fn as_raw(self) -> u16 {
163         self.0
164     }
165 }
166 
167 impl fmt::Debug for Vendor {
168     #[inline]
169     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
170         write!(f, "0x{:04x}", self.0)
171     }
172 }
173 
174 define_all_pci_classes! {
175     NOT_DEFINED                = bindings::PCI_CLASS_NOT_DEFINED,                // 0x000000
176     NOT_DEFINED_VGA            = bindings::PCI_CLASS_NOT_DEFINED_VGA,            // 0x000100
177 
178     STORAGE_SCSI               = bindings::PCI_CLASS_STORAGE_SCSI,               // 0x010000
179     STORAGE_IDE                = bindings::PCI_CLASS_STORAGE_IDE,                // 0x010100
180     STORAGE_FLOPPY             = bindings::PCI_CLASS_STORAGE_FLOPPY,             // 0x010200
181     STORAGE_IPI                = bindings::PCI_CLASS_STORAGE_IPI,                // 0x010300
182     STORAGE_RAID               = bindings::PCI_CLASS_STORAGE_RAID,               // 0x010400
183     STORAGE_SATA               = bindings::PCI_CLASS_STORAGE_SATA,               // 0x010600
184     STORAGE_SATA_AHCI          = bindings::PCI_CLASS_STORAGE_SATA_AHCI,          // 0x010601
185     STORAGE_SAS                = bindings::PCI_CLASS_STORAGE_SAS,                // 0x010700
186     STORAGE_EXPRESS            = bindings::PCI_CLASS_STORAGE_EXPRESS,            // 0x010802
187     STORAGE_OTHER              = bindings::PCI_CLASS_STORAGE_OTHER,              // 0x018000
188 
189     NETWORK_ETHERNET           = bindings::PCI_CLASS_NETWORK_ETHERNET,           // 0x020000
190     NETWORK_TOKEN_RING         = bindings::PCI_CLASS_NETWORK_TOKEN_RING,         // 0x020100
191     NETWORK_FDDI               = bindings::PCI_CLASS_NETWORK_FDDI,               // 0x020200
192     NETWORK_ATM                = bindings::PCI_CLASS_NETWORK_ATM,                // 0x020300
193     NETWORK_OTHER              = bindings::PCI_CLASS_NETWORK_OTHER,              // 0x028000
194 
195     DISPLAY_VGA                = bindings::PCI_CLASS_DISPLAY_VGA,                // 0x030000
196     DISPLAY_XGA                = bindings::PCI_CLASS_DISPLAY_XGA,                // 0x030100
197     DISPLAY_3D                 = bindings::PCI_CLASS_DISPLAY_3D,                 // 0x030200
198     DISPLAY_OTHER              = bindings::PCI_CLASS_DISPLAY_OTHER,              // 0x038000
199 
200     MULTIMEDIA_VIDEO           = bindings::PCI_CLASS_MULTIMEDIA_VIDEO,           // 0x040000
201     MULTIMEDIA_AUDIO           = bindings::PCI_CLASS_MULTIMEDIA_AUDIO,           // 0x040100
202     MULTIMEDIA_PHONE           = bindings::PCI_CLASS_MULTIMEDIA_PHONE,           // 0x040200
203     MULTIMEDIA_HD_AUDIO        = bindings::PCI_CLASS_MULTIMEDIA_HD_AUDIO,        // 0x040300
204     MULTIMEDIA_OTHER           = bindings::PCI_CLASS_MULTIMEDIA_OTHER,           // 0x048000
205 
206     MEMORY_RAM                 = bindings::PCI_CLASS_MEMORY_RAM,                 // 0x050000
207     MEMORY_FLASH               = bindings::PCI_CLASS_MEMORY_FLASH,               // 0x050100
208     MEMORY_CXL                 = bindings::PCI_CLASS_MEMORY_CXL,                 // 0x050200
209     MEMORY_OTHER               = bindings::PCI_CLASS_MEMORY_OTHER,               // 0x058000
210 
211     BRIDGE_HOST                = bindings::PCI_CLASS_BRIDGE_HOST,                // 0x060000
212     BRIDGE_ISA                 = bindings::PCI_CLASS_BRIDGE_ISA,                 // 0x060100
213     BRIDGE_EISA                = bindings::PCI_CLASS_BRIDGE_EISA,                // 0x060200
214     BRIDGE_MC                  = bindings::PCI_CLASS_BRIDGE_MC,                  // 0x060300
215     BRIDGE_PCI_NORMAL          = bindings::PCI_CLASS_BRIDGE_PCI_NORMAL,          // 0x060400
216     BRIDGE_PCI_SUBTRACTIVE     = bindings::PCI_CLASS_BRIDGE_PCI_SUBTRACTIVE,     // 0x060401
217     BRIDGE_PCMCIA              = bindings::PCI_CLASS_BRIDGE_PCMCIA,              // 0x060500
218     BRIDGE_NUBUS               = bindings::PCI_CLASS_BRIDGE_NUBUS,               // 0x060600
219     BRIDGE_CARDBUS             = bindings::PCI_CLASS_BRIDGE_CARDBUS,             // 0x060700
220     BRIDGE_RACEWAY             = bindings::PCI_CLASS_BRIDGE_RACEWAY,             // 0x060800
221     BRIDGE_OTHER               = bindings::PCI_CLASS_BRIDGE_OTHER,               // 0x068000
222 
223     COMMUNICATION_SERIAL       = bindings::PCI_CLASS_COMMUNICATION_SERIAL,       // 0x070000
224     COMMUNICATION_PARALLEL     = bindings::PCI_CLASS_COMMUNICATION_PARALLEL,     // 0x070100
225     COMMUNICATION_MULTISERIAL  = bindings::PCI_CLASS_COMMUNICATION_MULTISERIAL,  // 0x070200
226     COMMUNICATION_MODEM        = bindings::PCI_CLASS_COMMUNICATION_MODEM,        // 0x070300
227     COMMUNICATION_OTHER        = bindings::PCI_CLASS_COMMUNICATION_OTHER,        // 0x078000
228 
229     SYSTEM_PIC                 = bindings::PCI_CLASS_SYSTEM_PIC,                 // 0x080000
230     SYSTEM_PIC_IOAPIC          = bindings::PCI_CLASS_SYSTEM_PIC_IOAPIC,          // 0x080010
231     SYSTEM_PIC_IOXAPIC         = bindings::PCI_CLASS_SYSTEM_PIC_IOXAPIC,         // 0x080020
232     SYSTEM_DMA                 = bindings::PCI_CLASS_SYSTEM_DMA,                 // 0x080100
233     SYSTEM_TIMER               = bindings::PCI_CLASS_SYSTEM_TIMER,               // 0x080200
234     SYSTEM_RTC                 = bindings::PCI_CLASS_SYSTEM_RTC,                 // 0x080300
235     SYSTEM_PCI_HOTPLUG         = bindings::PCI_CLASS_SYSTEM_PCI_HOTPLUG,         // 0x080400
236     SYSTEM_SDHCI               = bindings::PCI_CLASS_SYSTEM_SDHCI,               // 0x080500
237     SYSTEM_RCEC                = bindings::PCI_CLASS_SYSTEM_RCEC,                // 0x080700
238     SYSTEM_OTHER               = bindings::PCI_CLASS_SYSTEM_OTHER,               // 0x088000
239 
240     INPUT_KEYBOARD             = bindings::PCI_CLASS_INPUT_KEYBOARD,             // 0x090000
241     INPUT_PEN                  = bindings::PCI_CLASS_INPUT_PEN,                  // 0x090100
242     INPUT_MOUSE                = bindings::PCI_CLASS_INPUT_MOUSE,                // 0x090200
243     INPUT_SCANNER              = bindings::PCI_CLASS_INPUT_SCANNER,              // 0x090300
244     INPUT_GAMEPORT             = bindings::PCI_CLASS_INPUT_GAMEPORT,             // 0x090400
245     INPUT_OTHER                = bindings::PCI_CLASS_INPUT_OTHER,                // 0x098000
246 
247     DOCKING_GENERIC            = bindings::PCI_CLASS_DOCKING_GENERIC,            // 0x0a0000
248     DOCKING_OTHER              = bindings::PCI_CLASS_DOCKING_OTHER,              // 0x0a8000
249 
250     PROCESSOR_386              = bindings::PCI_CLASS_PROCESSOR_386,              // 0x0b0000
251     PROCESSOR_486              = bindings::PCI_CLASS_PROCESSOR_486,              // 0x0b0100
252     PROCESSOR_PENTIUM          = bindings::PCI_CLASS_PROCESSOR_PENTIUM,          // 0x0b0200
253     PROCESSOR_ALPHA            = bindings::PCI_CLASS_PROCESSOR_ALPHA,            // 0x0b1000
254     PROCESSOR_POWERPC          = bindings::PCI_CLASS_PROCESSOR_POWERPC,          // 0x0b2000
255     PROCESSOR_MIPS             = bindings::PCI_CLASS_PROCESSOR_MIPS,             // 0x0b3000
256     PROCESSOR_CO               = bindings::PCI_CLASS_PROCESSOR_CO,               // 0x0b4000
257 
258     SERIAL_FIREWIRE            = bindings::PCI_CLASS_SERIAL_FIREWIRE,            // 0x0c0000
259     SERIAL_FIREWIRE_OHCI       = bindings::PCI_CLASS_SERIAL_FIREWIRE_OHCI,       // 0x0c0010
260     SERIAL_ACCESS              = bindings::PCI_CLASS_SERIAL_ACCESS,              // 0x0c0100
261     SERIAL_SSA                 = bindings::PCI_CLASS_SERIAL_SSA,                 // 0x0c0200
262     SERIAL_USB_UHCI            = bindings::PCI_CLASS_SERIAL_USB_UHCI,            // 0x0c0300
263     SERIAL_USB_OHCI            = bindings::PCI_CLASS_SERIAL_USB_OHCI,            // 0x0c0310
264     SERIAL_USB_EHCI            = bindings::PCI_CLASS_SERIAL_USB_EHCI,            // 0x0c0320
265     SERIAL_USB_XHCI            = bindings::PCI_CLASS_SERIAL_USB_XHCI,            // 0x0c0330
266     SERIAL_USB_CDNS            = bindings::PCI_CLASS_SERIAL_USB_CDNS,            // 0x0c0380
267     SERIAL_USB_DEVICE          = bindings::PCI_CLASS_SERIAL_USB_DEVICE,          // 0x0c03fe
268     SERIAL_FIBER               = bindings::PCI_CLASS_SERIAL_FIBER,               // 0x0c0400
269     SERIAL_SMBUS               = bindings::PCI_CLASS_SERIAL_SMBUS,               // 0x0c0500
270     SERIAL_IPMI_SMIC           = bindings::PCI_CLASS_SERIAL_IPMI_SMIC,           // 0x0c0700
271     SERIAL_IPMI_KCS            = bindings::PCI_CLASS_SERIAL_IPMI_KCS,            // 0x0c0701
272     SERIAL_IPMI_BT             = bindings::PCI_CLASS_SERIAL_IPMI_BT,             // 0x0c0702
273 
274     WIRELESS_RF_CONTROLLER     = bindings::PCI_CLASS_WIRELESS_RF_CONTROLLER,     // 0x0d1000
275     WIRELESS_WHCI              = bindings::PCI_CLASS_WIRELESS_WHCI,              // 0x0d1010
276 
277     INTELLIGENT_I2O            = bindings::PCI_CLASS_INTELLIGENT_I2O,            // 0x0e0000
278 
279     SATELLITE_TV               = bindings::PCI_CLASS_SATELLITE_TV,               // 0x0f0000
280     SATELLITE_AUDIO            = bindings::PCI_CLASS_SATELLITE_AUDIO,            // 0x0f0100
281     SATELLITE_VOICE            = bindings::PCI_CLASS_SATELLITE_VOICE,            // 0x0f0300
282     SATELLITE_DATA             = bindings::PCI_CLASS_SATELLITE_DATA,             // 0x0f0400
283 
284     CRYPT_NETWORK              = bindings::PCI_CLASS_CRYPT_NETWORK,              // 0x100000
285     CRYPT_ENTERTAINMENT        = bindings::PCI_CLASS_CRYPT_ENTERTAINMENT,        // 0x100100
286     CRYPT_OTHER                = bindings::PCI_CLASS_CRYPT_OTHER,                // 0x108000
287 
288     SP_DPIO                    = bindings::PCI_CLASS_SP_DPIO,                    // 0x110000
289     SP_OTHER                   = bindings::PCI_CLASS_SP_OTHER,                   // 0x118000
290 
291     ACCELERATOR_PROCESSING     = bindings::PCI_CLASS_ACCELERATOR_PROCESSING,     // 0x120000
292 
293     OTHERS                     = bindings::PCI_CLASS_OTHERS,                     // 0xff0000
294 }
295 
296 define_all_pci_vendors! {
297     PCI_SIG                  = bindings::PCI_VENDOR_ID_PCI_SIG,                  // 0x0001
298     LOONGSON                 = bindings::PCI_VENDOR_ID_LOONGSON,                 // 0x0014
299     SOLIDIGM                 = bindings::PCI_VENDOR_ID_SOLIDIGM,                 // 0x025e
300     TTTECH                   = bindings::PCI_VENDOR_ID_TTTECH,                   // 0x0357
301     DYNALINK                 = bindings::PCI_VENDOR_ID_DYNALINK,                 // 0x0675
302     UBIQUITI                 = bindings::PCI_VENDOR_ID_UBIQUITI,                 // 0x0777
303     BERKOM                   = bindings::PCI_VENDOR_ID_BERKOM,                   // 0x0871
304     ITTIM                    = bindings::PCI_VENDOR_ID_ITTIM,                    // 0x0b48
305     COMPAQ                   = bindings::PCI_VENDOR_ID_COMPAQ,                   // 0x0e11
306     LSI_LOGIC                = bindings::PCI_VENDOR_ID_LSI_LOGIC,                // 0x1000
307     ATI                      = bindings::PCI_VENDOR_ID_ATI,                      // 0x1002
308     VLSI                     = bindings::PCI_VENDOR_ID_VLSI,                     // 0x1004
309     ADL                      = bindings::PCI_VENDOR_ID_ADL,                      // 0x1005
310     NS                       = bindings::PCI_VENDOR_ID_NS,                       // 0x100b
311     TSENG                    = bindings::PCI_VENDOR_ID_TSENG,                    // 0x100c
312     WEITEK                   = bindings::PCI_VENDOR_ID_WEITEK,                   // 0x100e
313     DEC                      = bindings::PCI_VENDOR_ID_DEC,                      // 0x1011
314     CIRRUS                   = bindings::PCI_VENDOR_ID_CIRRUS,                   // 0x1013
315     IBM                      = bindings::PCI_VENDOR_ID_IBM,                      // 0x1014
316     UNISYS                   = bindings::PCI_VENDOR_ID_UNISYS,                   // 0x1018
317     COMPEX2                  = bindings::PCI_VENDOR_ID_COMPEX2,                  // 0x101a
318     WD                       = bindings::PCI_VENDOR_ID_WD,                       // 0x101c
319     AMI                      = bindings::PCI_VENDOR_ID_AMI,                      // 0x101e
320     AMD                      = bindings::PCI_VENDOR_ID_AMD,                      // 0x1022
321     TRIDENT                  = bindings::PCI_VENDOR_ID_TRIDENT,                  // 0x1023
322     AI                       = bindings::PCI_VENDOR_ID_AI,                       // 0x1025
323     DELL                     = bindings::PCI_VENDOR_ID_DELL,                     // 0x1028
324     MATROX                   = bindings::PCI_VENDOR_ID_MATROX,                   // 0x102B
325     MOBILITY_ELECTRONICS     = bindings::PCI_VENDOR_ID_MOBILITY_ELECTRONICS,     // 0x14f2
326     CT                       = bindings::PCI_VENDOR_ID_CT,                       // 0x102c
327     MIRO                     = bindings::PCI_VENDOR_ID_MIRO,                     // 0x1031
328     NEC                      = bindings::PCI_VENDOR_ID_NEC,                      // 0x1033
329     FD                       = bindings::PCI_VENDOR_ID_FD,                       // 0x1036
330     SI                       = bindings::PCI_VENDOR_ID_SI,                       // 0x1039
331     HP                       = bindings::PCI_VENDOR_ID_HP,                       // 0x103c
332     HP_3PAR                  = bindings::PCI_VENDOR_ID_HP_3PAR,                  // 0x1590
333     PCTECH                   = bindings::PCI_VENDOR_ID_PCTECH,                   // 0x1042
334     ASUSTEK                  = bindings::PCI_VENDOR_ID_ASUSTEK,                  // 0x1043
335     DPT                      = bindings::PCI_VENDOR_ID_DPT,                      // 0x1044
336     OPTI                     = bindings::PCI_VENDOR_ID_OPTI,                     // 0x1045
337     ELSA                     = bindings::PCI_VENDOR_ID_ELSA,                     // 0x1048
338     STMICRO                  = bindings::PCI_VENDOR_ID_STMICRO,                  // 0x104A
339     BUSLOGIC                 = bindings::PCI_VENDOR_ID_BUSLOGIC,                 // 0x104B
340     TI                       = bindings::PCI_VENDOR_ID_TI,                       // 0x104c
341     SONY                     = bindings::PCI_VENDOR_ID_SONY,                     // 0x104d
342     WINBOND2                 = bindings::PCI_VENDOR_ID_WINBOND2,                 // 0x1050
343     ANIGMA                   = bindings::PCI_VENDOR_ID_ANIGMA,                   // 0x1051
344     EFAR                     = bindings::PCI_VENDOR_ID_EFAR,                     // 0x1055
345     MOTOROLA                 = bindings::PCI_VENDOR_ID_MOTOROLA,                 // 0x1057
346     PROMISE                  = bindings::PCI_VENDOR_ID_PROMISE,                  // 0x105a
347     FOXCONN                  = bindings::PCI_VENDOR_ID_FOXCONN,                  // 0x105b
348     UMC                      = bindings::PCI_VENDOR_ID_UMC,                      // 0x1060
349     PICOPOWER                = bindings::PCI_VENDOR_ID_PICOPOWER,                // 0x1066
350     MYLEX                    = bindings::PCI_VENDOR_ID_MYLEX,                    // 0x1069
351     APPLE                    = bindings::PCI_VENDOR_ID_APPLE,                    // 0x106b
352     YAMAHA                   = bindings::PCI_VENDOR_ID_YAMAHA,                   // 0x1073
353     QLOGIC                   = bindings::PCI_VENDOR_ID_QLOGIC,                   // 0x1077
354     CYRIX                    = bindings::PCI_VENDOR_ID_CYRIX,                    // 0x1078
355     CONTAQ                   = bindings::PCI_VENDOR_ID_CONTAQ,                   // 0x1080
356     OLICOM                   = bindings::PCI_VENDOR_ID_OLICOM,                   // 0x108d
357     SUN                      = bindings::PCI_VENDOR_ID_SUN,                      // 0x108e
358     NI                       = bindings::PCI_VENDOR_ID_NI,                       // 0x1093
359     CMD                      = bindings::PCI_VENDOR_ID_CMD,                      // 0x1095
360     BROOKTREE                = bindings::PCI_VENDOR_ID_BROOKTREE,                // 0x109e
361     SGI                      = bindings::PCI_VENDOR_ID_SGI,                      // 0x10a9
362     WINBOND                  = bindings::PCI_VENDOR_ID_WINBOND,                  // 0x10ad
363     PLX                      = bindings::PCI_VENDOR_ID_PLX,                      // 0x10b5
364     MADGE                    = bindings::PCI_VENDOR_ID_MADGE,                    // 0x10b6
365     THREECOM                 = bindings::PCI_VENDOR_ID_3COM,                     // 0x10b7
366     AL                       = bindings::PCI_VENDOR_ID_AL,                       // 0x10b9
367     NEOMAGIC                 = bindings::PCI_VENDOR_ID_NEOMAGIC,                 // 0x10c8
368     TCONRAD                  = bindings::PCI_VENDOR_ID_TCONRAD,                  // 0x10da
369     ROHM                     = bindings::PCI_VENDOR_ID_ROHM,                     // 0x10db
370     NVIDIA                   = bindings::PCI_VENDOR_ID_NVIDIA,                   // 0x10de
371     IMS                      = bindings::PCI_VENDOR_ID_IMS,                      // 0x10e0
372     AMCC                     = bindings::PCI_VENDOR_ID_AMCC,                     // 0x10e8
373     AMPERE                   = bindings::PCI_VENDOR_ID_AMPERE,                   // 0x1def
374     INTERG                   = bindings::PCI_VENDOR_ID_INTERG,                   // 0x10ea
375     REALTEK                  = bindings::PCI_VENDOR_ID_REALTEK,                  // 0x10ec
376     XILINX                   = bindings::PCI_VENDOR_ID_XILINX,                   // 0x10ee
377     INIT                     = bindings::PCI_VENDOR_ID_INIT,                     // 0x1101
378     CREATIVE                 = bindings::PCI_VENDOR_ID_CREATIVE,                 // 0x1102
379     TTI                      = bindings::PCI_VENDOR_ID_TTI,                      // 0x1103
380     SIGMA                    = bindings::PCI_VENDOR_ID_SIGMA,                    // 0x1105
381     VIA                      = bindings::PCI_VENDOR_ID_VIA,                      // 0x1106
382     SIEMENS                  = bindings::PCI_VENDOR_ID_SIEMENS,                  // 0x110A
383     VORTEX                   = bindings::PCI_VENDOR_ID_VORTEX,                   // 0x1119
384     EF                       = bindings::PCI_VENDOR_ID_EF,                       // 0x111a
385     IDT                      = bindings::PCI_VENDOR_ID_IDT,                      // 0x111d
386     FORE                     = bindings::PCI_VENDOR_ID_FORE,                     // 0x1127
387     PHILIPS                  = bindings::PCI_VENDOR_ID_PHILIPS,                  // 0x1131
388     EICON                    = bindings::PCI_VENDOR_ID_EICON,                    // 0x1133
389     CISCO                    = bindings::PCI_VENDOR_ID_CISCO,                    // 0x1137
390     ZIATECH                  = bindings::PCI_VENDOR_ID_ZIATECH,                  // 0x1138
391     SYSKONNECT               = bindings::PCI_VENDOR_ID_SYSKONNECT,               // 0x1148
392     DIGI                     = bindings::PCI_VENDOR_ID_DIGI,                     // 0x114f
393     XIRCOM                   = bindings::PCI_VENDOR_ID_XIRCOM,                   // 0x115d
394     SERVERWORKS              = bindings::PCI_VENDOR_ID_SERVERWORKS,              // 0x1166
395     ALTERA                   = bindings::PCI_VENDOR_ID_ALTERA,                   // 0x1172
396     SBE                      = bindings::PCI_VENDOR_ID_SBE,                      // 0x1176
397     TOSHIBA                  = bindings::PCI_VENDOR_ID_TOSHIBA,                  // 0x1179
398     TOSHIBA_2                = bindings::PCI_VENDOR_ID_TOSHIBA_2,                // 0x102f
399     ATTO                     = bindings::PCI_VENDOR_ID_ATTO,                     // 0x117c
400     RICOH                    = bindings::PCI_VENDOR_ID_RICOH,                    // 0x1180
401     DLINK                    = bindings::PCI_VENDOR_ID_DLINK,                    // 0x1186
402     ARTOP                    = bindings::PCI_VENDOR_ID_ARTOP,                    // 0x1191
403     ZEITNET                  = bindings::PCI_VENDOR_ID_ZEITNET,                  // 0x1193
404     FUJITSU_ME               = bindings::PCI_VENDOR_ID_FUJITSU_ME,               // 0x119e
405     MARVELL                  = bindings::PCI_VENDOR_ID_MARVELL,                  // 0x11ab
406     MARVELL_EXT              = bindings::PCI_VENDOR_ID_MARVELL_EXT,              // 0x1b4b
407     V3                       = bindings::PCI_VENDOR_ID_V3,                       // 0x11b0
408     ATT                      = bindings::PCI_VENDOR_ID_ATT,                      // 0x11c1
409     SPECIALIX                = bindings::PCI_VENDOR_ID_SPECIALIX,                // 0x11cb
410     ANALOG_DEVICES           = bindings::PCI_VENDOR_ID_ANALOG_DEVICES,           // 0x11d4
411     ZORAN                    = bindings::PCI_VENDOR_ID_ZORAN,                    // 0x11de
412     COMPEX                   = bindings::PCI_VENDOR_ID_COMPEX,                   // 0x11f6
413     MICROSEMI                = bindings::PCI_VENDOR_ID_MICROSEMI,                // 0x11f8
414     RP                       = bindings::PCI_VENDOR_ID_RP,                       // 0x11fe
415     CYCLADES                 = bindings::PCI_VENDOR_ID_CYCLADES,                 // 0x120e
416     ESSENTIAL                = bindings::PCI_VENDOR_ID_ESSENTIAL,                // 0x120f
417     O2                       = bindings::PCI_VENDOR_ID_O2,                       // 0x1217
418     THREEDX                  = bindings::PCI_VENDOR_ID_3DFX,                     // 0x121a
419     AVM                      = bindings::PCI_VENDOR_ID_AVM,                      // 0x1244
420     STALLION                 = bindings::PCI_VENDOR_ID_STALLION,                 // 0x124d
421     AT                       = bindings::PCI_VENDOR_ID_AT,                       // 0x1259
422     ASIX                     = bindings::PCI_VENDOR_ID_ASIX,                     // 0x125b
423     ESS                      = bindings::PCI_VENDOR_ID_ESS,                      // 0x125d
424     SATSAGEM                 = bindings::PCI_VENDOR_ID_SATSAGEM,                 // 0x1267
425     ENSONIQ                  = bindings::PCI_VENDOR_ID_ENSONIQ,                  // 0x1274
426     TRANSMETA                = bindings::PCI_VENDOR_ID_TRANSMETA,                // 0x1279
427     ROCKWELL                 = bindings::PCI_VENDOR_ID_ROCKWELL,                 // 0x127A
428     ITE                      = bindings::PCI_VENDOR_ID_ITE,                      // 0x1283
429     ALTEON                   = bindings::PCI_VENDOR_ID_ALTEON,                   // 0x12ae
430     NVIDIA_SGS               = bindings::PCI_VENDOR_ID_NVIDIA_SGS,               // 0x12d2
431     PERICOM                  = bindings::PCI_VENDOR_ID_PERICOM,                  // 0x12D8
432     AUREAL                   = bindings::PCI_VENDOR_ID_AUREAL,                   // 0x12eb
433     ELECTRONICDESIGNGMBH     = bindings::PCI_VENDOR_ID_ELECTRONICDESIGNGMBH,     // 0x12f8
434     ESDGMBH                  = bindings::PCI_VENDOR_ID_ESDGMBH,                  // 0x12fe
435     CB                       = bindings::PCI_VENDOR_ID_CB,                       // 0x1307
436     SIIG                     = bindings::PCI_VENDOR_ID_SIIG,                     // 0x131f
437     RADISYS                  = bindings::PCI_VENDOR_ID_RADISYS,                  // 0x1331
438     MICRO_MEMORY             = bindings::PCI_VENDOR_ID_MICRO_MEMORY,             // 0x1332
439     DOMEX                    = bindings::PCI_VENDOR_ID_DOMEX,                    // 0x134a
440     INTASHIELD               = bindings::PCI_VENDOR_ID_INTASHIELD,               // 0x135a
441     QUATECH                  = bindings::PCI_VENDOR_ID_QUATECH,                  // 0x135C
442     SEALEVEL                 = bindings::PCI_VENDOR_ID_SEALEVEL,                 // 0x135e
443     HYPERCOPE                = bindings::PCI_VENDOR_ID_HYPERCOPE,                // 0x1365
444     DIGIGRAM                 = bindings::PCI_VENDOR_ID_DIGIGRAM,                 // 0x1369
445     KAWASAKI                 = bindings::PCI_VENDOR_ID_KAWASAKI,                 // 0x136b
446     CNET                     = bindings::PCI_VENDOR_ID_CNET,                     // 0x1371
447     LMC                      = bindings::PCI_VENDOR_ID_LMC,                      // 0x1376
448     NETGEAR                  = bindings::PCI_VENDOR_ID_NETGEAR,                  // 0x1385
449     APPLICOM                 = bindings::PCI_VENDOR_ID_APPLICOM,                 // 0x1389
450     MOXA                     = bindings::PCI_VENDOR_ID_MOXA,                     // 0x1393
451     CCD                      = bindings::PCI_VENDOR_ID_CCD,                      // 0x1397
452     EXAR                     = bindings::PCI_VENDOR_ID_EXAR,                     // 0x13a8
453     MICROGATE                = bindings::PCI_VENDOR_ID_MICROGATE,                // 0x13c0
454     THREEWARE                = bindings::PCI_VENDOR_ID_3WARE,                    // 0x13C1
455     IOMEGA                   = bindings::PCI_VENDOR_ID_IOMEGA,                   // 0x13ca
456     ABOCOM                   = bindings::PCI_VENDOR_ID_ABOCOM,                   // 0x13D1
457     SUNDANCE                 = bindings::PCI_VENDOR_ID_SUNDANCE,                 // 0x13f0
458     CMEDIA                   = bindings::PCI_VENDOR_ID_CMEDIA,                   // 0x13f6
459     ADVANTECH                = bindings::PCI_VENDOR_ID_ADVANTECH,                // 0x13fe
460     MEILHAUS                 = bindings::PCI_VENDOR_ID_MEILHAUS,                 // 0x1402
461     LAVA                     = bindings::PCI_VENDOR_ID_LAVA,                     // 0x1407
462     TIMEDIA                  = bindings::PCI_VENDOR_ID_TIMEDIA,                  // 0x1409
463     ICE                      = bindings::PCI_VENDOR_ID_ICE,                      // 0x1412
464     MICROSOFT                = bindings::PCI_VENDOR_ID_MICROSOFT,                // 0x1414
465     OXSEMI                   = bindings::PCI_VENDOR_ID_OXSEMI,                   // 0x1415
466     CHELSIO                  = bindings::PCI_VENDOR_ID_CHELSIO,                  // 0x1425
467     EDIMAX                   = bindings::PCI_VENDOR_ID_EDIMAX,                   // 0x1432
468     ADLINK                   = bindings::PCI_VENDOR_ID_ADLINK,                   // 0x144a
469     SAMSUNG                  = bindings::PCI_VENDOR_ID_SAMSUNG,                  // 0x144d
470     GIGABYTE                 = bindings::PCI_VENDOR_ID_GIGABYTE,                 // 0x1458
471     AMBIT                    = bindings::PCI_VENDOR_ID_AMBIT,                    // 0x1468
472     MYRICOM                  = bindings::PCI_VENDOR_ID_MYRICOM,                  // 0x14c1
473     MEDIATEK                 = bindings::PCI_VENDOR_ID_MEDIATEK,                 // 0x14c3
474     TITAN                    = bindings::PCI_VENDOR_ID_TITAN,                    // 0x14D2
475     PANACOM                  = bindings::PCI_VENDOR_ID_PANACOM,                  // 0x14d4
476     SIPACKETS                = bindings::PCI_VENDOR_ID_SIPACKETS,                // 0x14d9
477     AFAVLAB                  = bindings::PCI_VENDOR_ID_AFAVLAB,                  // 0x14db
478     AMPLICON                 = bindings::PCI_VENDOR_ID_AMPLICON,                 // 0x14dc
479     BCM_GVC                  = bindings::PCI_VENDOR_ID_BCM_GVC,                  // 0x14a4
480     BROADCOM                 = bindings::PCI_VENDOR_ID_BROADCOM,                 // 0x14e4
481     TOPIC                    = bindings::PCI_VENDOR_ID_TOPIC,                    // 0x151f
482     MAINPINE                 = bindings::PCI_VENDOR_ID_MAINPINE,                 // 0x1522
483     ENE                      = bindings::PCI_VENDOR_ID_ENE,                      // 0x1524
484     SYBA                     = bindings::PCI_VENDOR_ID_SYBA,                     // 0x1592
485     MORETON                  = bindings::PCI_VENDOR_ID_MORETON,                  // 0x15aa
486     VMWARE                   = bindings::PCI_VENDOR_ID_VMWARE,                   // 0x15ad
487     ZOLTRIX                  = bindings::PCI_VENDOR_ID_ZOLTRIX,                  // 0x15b0
488     MELLANOX                 = bindings::PCI_VENDOR_ID_MELLANOX,                 // 0x15b3
489     DFI                      = bindings::PCI_VENDOR_ID_DFI,                      // 0x15bd
490     QUICKNET                 = bindings::PCI_VENDOR_ID_QUICKNET,                 // 0x15e2
491     ADDIDATA                 = bindings::PCI_VENDOR_ID_ADDIDATA,                 // 0x15B8
492     PDC                      = bindings::PCI_VENDOR_ID_PDC,                      // 0x15e9
493     FARSITE                  = bindings::PCI_VENDOR_ID_FARSITE,                  // 0x1619
494     ARIMA                    = bindings::PCI_VENDOR_ID_ARIMA,                    // 0x161f
495     BROCADE                  = bindings::PCI_VENDOR_ID_BROCADE,                  // 0x1657
496     SIBYTE                   = bindings::PCI_VENDOR_ID_SIBYTE,                   // 0x166d
497     ATHEROS                  = bindings::PCI_VENDOR_ID_ATHEROS,                  // 0x168c
498     NETCELL                  = bindings::PCI_VENDOR_ID_NETCELL,                  // 0x169c
499     CENATEK                  = bindings::PCI_VENDOR_ID_CENATEK,                  // 0x16CA
500     SYNOPSYS                 = bindings::PCI_VENDOR_ID_SYNOPSYS,                 // 0x16c3
501     USR                      = bindings::PCI_VENDOR_ID_USR,                      // 0x16ec
502     VITESSE                  = bindings::PCI_VENDOR_ID_VITESSE,                  // 0x1725
503     LINKSYS                  = bindings::PCI_VENDOR_ID_LINKSYS,                  // 0x1737
504     ALTIMA                   = bindings::PCI_VENDOR_ID_ALTIMA,                   // 0x173b
505     CAVIUM                   = bindings::PCI_VENDOR_ID_CAVIUM,                   // 0x177d
506     TECHWELL                 = bindings::PCI_VENDOR_ID_TECHWELL,                 // 0x1797
507     BELKIN                   = bindings::PCI_VENDOR_ID_BELKIN,                   // 0x1799
508     RDC                      = bindings::PCI_VENDOR_ID_RDC,                      // 0x17f3
509     GLI                      = bindings::PCI_VENDOR_ID_GLI,                      // 0x17a0
510     LENOVO                   = bindings::PCI_VENDOR_ID_LENOVO,                   // 0x17aa
511     QCOM                     = bindings::PCI_VENDOR_ID_QCOM,                     // 0x17cb
512     CDNS                     = bindings::PCI_VENDOR_ID_CDNS,                     // 0x17cd
513     ARECA                    = bindings::PCI_VENDOR_ID_ARECA,                    // 0x17d3
514     S2IO                     = bindings::PCI_VENDOR_ID_S2IO,                     // 0x17d5
515     SITECOM                  = bindings::PCI_VENDOR_ID_SITECOM,                  // 0x182d
516     TOPSPIN                  = bindings::PCI_VENDOR_ID_TOPSPIN,                  // 0x1867
517     COMMTECH                 = bindings::PCI_VENDOR_ID_COMMTECH,                 // 0x18f7
518     SILAN                    = bindings::PCI_VENDOR_ID_SILAN,                    // 0x1904
519     RENESAS                  = bindings::PCI_VENDOR_ID_RENESAS,                  // 0x1912
520     SOLARFLARE               = bindings::PCI_VENDOR_ID_SOLARFLARE,               // 0x1924
521     TDI                      = bindings::PCI_VENDOR_ID_TDI,                      // 0x192E
522     NXP                      = bindings::PCI_VENDOR_ID_NXP,                      // 0x1957
523     PASEMI                   = bindings::PCI_VENDOR_ID_PASEMI,                   // 0x1959
524     ATTANSIC                 = bindings::PCI_VENDOR_ID_ATTANSIC,                 // 0x1969
525     JMICRON                  = bindings::PCI_VENDOR_ID_JMICRON,                  // 0x197B
526     KORENIX                  = bindings::PCI_VENDOR_ID_KORENIX,                  // 0x1982
527     HUAWEI                   = bindings::PCI_VENDOR_ID_HUAWEI,                   // 0x19e5
528     NETRONOME                = bindings::PCI_VENDOR_ID_NETRONOME,                // 0x19ee
529     QMI                      = bindings::PCI_VENDOR_ID_QMI,                      // 0x1a32
530     AZWAVE                   = bindings::PCI_VENDOR_ID_AZWAVE,                   // 0x1a3b
531     REDHAT_QUMRANET          = bindings::PCI_VENDOR_ID_REDHAT_QUMRANET,          // 0x1af4
532     ASMEDIA                  = bindings::PCI_VENDOR_ID_ASMEDIA,                  // 0x1b21
533     REDHAT                   = bindings::PCI_VENDOR_ID_REDHAT,                   // 0x1b36
534     WCHIC                    = bindings::PCI_VENDOR_ID_WCHIC,                    // 0x1c00
535     SILICOM_DENMARK          = bindings::PCI_VENDOR_ID_SILICOM_DENMARK,          // 0x1c2c
536     AMAZON_ANNAPURNA_LABS    = bindings::PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS,    // 0x1c36
537     CIRCUITCO                = bindings::PCI_VENDOR_ID_CIRCUITCO,                // 0x1cc8
538     AMAZON                   = bindings::PCI_VENDOR_ID_AMAZON,                   // 0x1d0f
539     ZHAOXIN                  = bindings::PCI_VENDOR_ID_ZHAOXIN,                  // 0x1d17
540     ROCKCHIP                 = bindings::PCI_VENDOR_ID_ROCKCHIP,                 // 0x1d87
541     HYGON                    = bindings::PCI_VENDOR_ID_HYGON,                    // 0x1d94
542     META                     = bindings::PCI_VENDOR_ID_META,                     // 0x1d9b
543     FUNGIBLE                 = bindings::PCI_VENDOR_ID_FUNGIBLE,                 // 0x1dad
544     HXT                      = bindings::PCI_VENDOR_ID_HXT,                      // 0x1dbf
545     TEKRAM                   = bindings::PCI_VENDOR_ID_TEKRAM,                   // 0x1de1
546     RPI                      = bindings::PCI_VENDOR_ID_RPI,                      // 0x1de4
547     ALIBABA                  = bindings::PCI_VENDOR_ID_ALIBABA,                  // 0x1ded
548     CXL                      = bindings::PCI_VENDOR_ID_CXL,                      // 0x1e98
549     TEHUTI                   = bindings::PCI_VENDOR_ID_TEHUTI,                   // 0x1fc9
550     SUNIX                    = bindings::PCI_VENDOR_ID_SUNIX,                    // 0x1fd4
551     HINT                     = bindings::PCI_VENDOR_ID_HINT,                     // 0x3388
552     THREEDLABS               = bindings::PCI_VENDOR_ID_3DLABS,                   // 0x3d3d
553     NETXEN                   = bindings::PCI_VENDOR_ID_NETXEN,                   // 0x4040
554     AKS                      = bindings::PCI_VENDOR_ID_AKS,                      // 0x416c
555     WCHCN                    = bindings::PCI_VENDOR_ID_WCHCN,                    // 0x4348
556     ACCESSIO                 = bindings::PCI_VENDOR_ID_ACCESSIO,                 // 0x494f
557     S3                       = bindings::PCI_VENDOR_ID_S3,                       // 0x5333
558     DUNORD                   = bindings::PCI_VENDOR_ID_DUNORD,                   // 0x5544
559     DCI                      = bindings::PCI_VENDOR_ID_DCI,                      // 0x6666
560     GLENFLY                  = bindings::PCI_VENDOR_ID_GLENFLY,                  // 0x6766
561     INTEL                    = bindings::PCI_VENDOR_ID_INTEL,                    // 0x8086
562     WANGXUN                  = bindings::PCI_VENDOR_ID_WANGXUN,                  // 0x8088
563     SCALEMP                  = bindings::PCI_VENDOR_ID_SCALEMP,                  // 0x8686
564     COMPUTONE                = bindings::PCI_VENDOR_ID_COMPUTONE,                // 0x8e0e
565     KTI                      = bindings::PCI_VENDOR_ID_KTI,                      // 0x8e2e
566     ADAPTEC                  = bindings::PCI_VENDOR_ID_ADAPTEC,                  // 0x9004
567     ADAPTEC2                 = bindings::PCI_VENDOR_ID_ADAPTEC2,                 // 0x9005
568     HOLTEK                   = bindings::PCI_VENDOR_ID_HOLTEK,                   // 0x9412
569     NETMOS                   = bindings::PCI_VENDOR_ID_NETMOS,                   // 0x9710
570     THREECOM_2               = bindings::PCI_VENDOR_ID_3COM_2,                   // 0xa727
571     SOLIDRUN                 = bindings::PCI_VENDOR_ID_SOLIDRUN,                 // 0xd063
572     DIGIUM                   = bindings::PCI_VENDOR_ID_DIGIUM,                   // 0xd161
573     TIGERJET                 = bindings::PCI_VENDOR_ID_TIGERJET,                 // 0xe159
574     XILINX_RME               = bindings::PCI_VENDOR_ID_XILINX_RME,               // 0xea60
575     XEN                      = bindings::PCI_VENDOR_ID_XEN,                      // 0x5853
576     OCZ                      = bindings::PCI_VENDOR_ID_OCZ,                      // 0x1b85
577     NCUBE                    = bindings::PCI_VENDOR_ID_NCUBE,                    // 0x10ff
578 }
579