Re: C99 Initialisers

From: Timothy Miller
Date: Wed Aug 13 2003 - 10:48:05 EST




Dave Jones wrote:
On Tue, Aug 12, 2003 at 11:01:58AM -0700, Greg KH wrote:

What would be *really* nice, would be the ability to do something
to the effect of..

{
.vendor = PCI_VENDOR_ID_BROADCOM,
.devices = {
PCI_DEVICE_ID_TIGON3_5700,
PCI_DEVICE_ID_TIGON3_5701,
PCI_DEVICE_ID_TIGON3_5702,
PCI_DEVICE_ID_TIGON3_5703,
PCI_DEVICE_ID_TIGON3_5704,
PCI_DEVICE_ID_TIGON3_5702FE,
PCI_DEVICE_ID_TIGON3_5702X,
PCI_DEVICE_ID_TIGON3_5703X,
PCI_DEVICE_ID_TIGON3_5704S,
PCI_DEVICE_ID_TIGON3_5702A3,
PCI_DEVICE_ID_TIGON3_5703A3,
},
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID

[snip]

That's not a bad idea. Is there a way the structures could be filled so that code comes in at boot time and fills structures out?

Or even better, could there be an array of devices for each vendor, and the single vendor structure points to that list?


struct devicelist BROADCOM_devs[] {
PCI_DEVICE_ID_TIGON3_5700,
PCI_DEVICE_ID_TIGON3_5701,
PCI_DEVICE_ID_TIGON3_5702,
PCI_DEVICE_ID_TIGON3_5703,
PCI_DEVICE_ID_TIGON3_5704,
PCI_DEVICE_ID_TIGON3_5702FE,
PCI_DEVICE_ID_TIGON3_5702X,
PCI_DEVICE_ID_TIGON3_5703X,
PCI_DEVICE_ID_TIGON3_5704S,
PCI_DEVICE_ID_TIGON3_5702A3,
PCI_DEVICE_ID_TIGON3_5703A3,
LIST_TERMINATOR};

struct pci_table VENCOR_list[] {
.vendor = PCI_VENDOR_ID_BROADCOM,
.devices = &BROADCOM_devs,
.subvendor = PCI_ANY_ID
..........

};


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/