drivers: pci: struct pci_dev_info rename class
Rename class in pci_dev_info struct to allow to use C++ compilers. Updated drivers to use new struct. Change-Id: I17b94cb7bc094bccd615c8389a28589bfa90cab8 Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
This commit is contained in:
parent
fdf494fa46
commit
02812f4635
9 changed files with 20 additions and 20 deletions
|
@ -286,7 +286,7 @@ static struct eth_config eth_config_0 = {
|
||||||
.irq_num = CONFIG_ETH_DW_0_IRQ,
|
.irq_num = CONFIG_ETH_DW_0_IRQ,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_ETH_DW_CLASS,
|
.pci_dev.class_type = CONFIG_ETH_DW_CLASS,
|
||||||
.pci_dev.bus = CONFIG_ETH_DW_0_BUS,
|
.pci_dev.bus = CONFIG_ETH_DW_0_BUS,
|
||||||
.pci_dev.dev = CONFIG_ETH_DW_0_DEV,
|
.pci_dev.dev = CONFIG_ETH_DW_0_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_ETH_DW_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_ETH_DW_VENDOR_ID,
|
||||||
|
|
|
@ -434,7 +434,7 @@ struct gpio_dw_config gpio_config_0 = {
|
||||||
.irq_num = CONFIG_GPIO_DW_0_IRQ,
|
.irq_num = CONFIG_GPIO_DW_0_IRQ,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_GPIO_DW_CLASS,
|
.pci_dev.class_type = CONFIG_GPIO_DW_CLASS,
|
||||||
.pci_dev.bus = CONFIG_GPIO_DW_0_BUS,
|
.pci_dev.bus = CONFIG_GPIO_DW_0_BUS,
|
||||||
.pci_dev.dev = CONFIG_GPIO_DW_0_DEV,
|
.pci_dev.dev = CONFIG_GPIO_DW_0_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_GPIO_DW_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_GPIO_DW_VENDOR_ID,
|
||||||
|
@ -514,7 +514,7 @@ struct gpio_dw_config gpio_dw_config_1 = {
|
||||||
.irq_num = CONFIG_GPIO_DW_1_IRQ,
|
.irq_num = CONFIG_GPIO_DW_1_IRQ,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_GPIO_DW_CLASS,
|
.pci_dev.class_type = CONFIG_GPIO_DW_CLASS,
|
||||||
.pci_dev.bus = CONFIG_GPIO_DW_1_BUS,
|
.pci_dev.bus = CONFIG_GPIO_DW_1_BUS,
|
||||||
.pci_dev.dev = CONFIG_GPIO_DW_1_DEV,
|
.pci_dev.dev = CONFIG_GPIO_DW_1_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_GPIO_DW_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_GPIO_DW_VENDOR_ID,
|
||||||
|
|
|
@ -712,7 +712,7 @@ struct i2c_dw_rom_config i2c_config_dw_0 = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_I2C_DW_CLASS,
|
.pci_dev.class_type = CONFIG_I2C_DW_CLASS,
|
||||||
.pci_dev.bus = CONFIG_I2C_DW_0_BUS,
|
.pci_dev.bus = CONFIG_I2C_DW_0_BUS,
|
||||||
.pci_dev.dev = CONFIG_I2C_DW_0_DEV,
|
.pci_dev.dev = CONFIG_I2C_DW_0_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_I2C_DW_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_I2C_DW_VENDOR_ID,
|
||||||
|
@ -774,7 +774,7 @@ struct i2c_dw_rom_config i2c_config_dw_1 = {
|
||||||
.config_func = i2c_config_1,
|
.config_func = i2c_config_1,
|
||||||
|
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_I2C_DW_CLASS,
|
.pci_dev.class_type = CONFIG_I2C_DW_CLASS,
|
||||||
.pci_dev.bus = CONFIG_I2C_DW_1_BUS,
|
.pci_dev.bus = CONFIG_I2C_DW_1_BUS,
|
||||||
.pci_dev.dev = CONFIG_I2C_DW_1_DEV,
|
.pci_dev.dev = CONFIG_I2C_DW_1_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_I2C_DW_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_I2C_DW_VENDOR_ID,
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
*
|
*
|
||||||
* EXAMPLE
|
* EXAMPLE
|
||||||
* struct pci_dev_info info = {
|
* struct pci_dev_info info = {
|
||||||
* .class = PCI_CLASS_COMM_CTLR
|
* .class_type = PCI_CLASS_COMM_CTLR
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* pci_bus_scan_init();
|
* pci_bus_scan_init();
|
||||||
|
@ -286,8 +286,8 @@ static inline int pci_dev_scan(union pci_addr_reg pci_ctrl_addr,
|
||||||
* Skip a device if its class is specified by the
|
* Skip a device if its class is specified by the
|
||||||
* caller and does not match
|
* caller and does not match
|
||||||
*/
|
*/
|
||||||
if (lookup.info.class &&
|
if (lookup.info.class_type &&
|
||||||
pci_dev_header.field.class != lookup.info.class) {
|
pci_dev_header.field.class != lookup.info.class_type) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ static inline int pci_dev_scan(union pci_addr_reg pci_ctrl_addr,
|
||||||
pci_dev_header.field.vendor_id;
|
pci_dev_header.field.vendor_id;
|
||||||
dev_info->device_id =
|
dev_info->device_id =
|
||||||
pci_dev_header.field.device_id;
|
pci_dev_header.field.device_id;
|
||||||
dev_info->class =
|
dev_info->class_type =
|
||||||
pci_dev_header.field.class;
|
pci_dev_header.field.class;
|
||||||
dev_info->irq = pci_pin2irq(
|
dev_info->irq = pci_pin2irq(
|
||||||
pci_dev_header.field.interrupt_pin);
|
pci_dev_header.field.interrupt_pin);
|
||||||
|
@ -342,7 +342,7 @@ static inline int pci_dev_scan(union pci_addr_reg pci_ctrl_addr,
|
||||||
|
|
||||||
void pci_bus_scan_init(void)
|
void pci_bus_scan_init(void)
|
||||||
{
|
{
|
||||||
lookup.info.class = 0;
|
lookup.info.class_type = 0;
|
||||||
lookup.info.vendor_id = 0;
|
lookup.info.vendor_id = 0;
|
||||||
lookup.info.device_id = 0;
|
lookup.info.device_id = 0;
|
||||||
lookup.info.function = PCI_FUNCTION_ANY;
|
lookup.info.function = PCI_FUNCTION_ANY;
|
||||||
|
@ -370,12 +370,12 @@ int pci_bus_scan(struct pci_dev_info *dev_info)
|
||||||
{
|
{
|
||||||
union pci_addr_reg pci_ctrl_addr;
|
union pci_addr_reg pci_ctrl_addr;
|
||||||
|
|
||||||
if (!lookup.info.class &&
|
if (!lookup.info.class_type &&
|
||||||
!lookup.info.vendor_id &&
|
!lookup.info.vendor_id &&
|
||||||
!lookup.info.device_id &&
|
!lookup.info.device_id &&
|
||||||
lookup.info.bar == PCI_BAR_ANY &&
|
lookup.info.bar == PCI_BAR_ANY &&
|
||||||
lookup.info.function == PCI_FUNCTION_ANY) {
|
lookup.info.function == PCI_FUNCTION_ANY) {
|
||||||
lookup.info.class = dev_info->class;
|
lookup.info.class_type = dev_info->class_type;
|
||||||
lookup.info.vendor_id = dev_info->vendor_id;
|
lookup.info.vendor_id = dev_info->vendor_id;
|
||||||
lookup.info.device_id = dev_info->device_id;
|
lookup.info.device_id = dev_info->device_id;
|
||||||
lookup.info.function = dev_info->function;
|
lookup.info.function = dev_info->function;
|
||||||
|
@ -472,7 +472,7 @@ void pci_show(struct pci_dev_info *dev_info)
|
||||||
dev_info->dev,
|
dev_info->dev,
|
||||||
dev_info->vendor_id,
|
dev_info->vendor_id,
|
||||||
dev_info->device_id,
|
dev_info->device_id,
|
||||||
dev_info->class,
|
dev_info->class_type,
|
||||||
dev_info->function,
|
dev_info->function,
|
||||||
dev_info->bar,
|
dev_info->bar,
|
||||||
(dev_info->mem_type == BAR_SPACE_MEM) ? "MEM" : "I/O",
|
(dev_info->mem_type == BAR_SPACE_MEM) ? "MEM" : "I/O",
|
||||||
|
|
|
@ -159,7 +159,7 @@ int pci_legacy_bridge_detect(struct pci_dev_info *dev_info)
|
||||||
dev_info->dev = CONFIG_PCI_LEGACY_BRIDGE_DEV;
|
dev_info->dev = CONFIG_PCI_LEGACY_BRIDGE_DEV;
|
||||||
dev_info->function = 0;
|
dev_info->function = 0;
|
||||||
dev_info->mem_type = BAR_SPACE_MEM;
|
dev_info->mem_type = BAR_SPACE_MEM;
|
||||||
dev_info->class = pci_dev_header.field.class;
|
dev_info->class_type = pci_dev_header.field.class;
|
||||||
dev_info->bar = 0;
|
dev_info->bar = 0;
|
||||||
dev_info->vendor_id = pci_dev_header.field.vendor_id;
|
dev_info->vendor_id = pci_dev_header.field.vendor_id;
|
||||||
dev_info->device_id = pci_dev_header.field.device_id;
|
dev_info->device_id = pci_dev_header.field.device_id;
|
||||||
|
|
|
@ -566,7 +566,7 @@ struct uart_device_config uart_ns16550_dev_cfg_0 = {
|
||||||
.init_info.options = CONFIG_UART_NS16550_PORT_0_OPTIONS,
|
.init_info.options = CONFIG_UART_NS16550_PORT_0_OPTIONS,
|
||||||
|
|
||||||
#ifdef CONFIG_UART_NS16550_PORT_0_PCI
|
#ifdef CONFIG_UART_NS16550_PORT_0_PCI
|
||||||
.pci_dev.class = CONFIG_UART_NS16550_PORT_0_PCI_CLASS,
|
.pci_dev.class_type = CONFIG_UART_NS16550_PORT_0_PCI_CLASS,
|
||||||
.pci_dev.bus = CONFIG_UART_NS16550_PORT_0_PCI_BUS,
|
.pci_dev.bus = CONFIG_UART_NS16550_PORT_0_PCI_BUS,
|
||||||
.pci_dev.dev = CONFIG_UART_NS16550_PORT_0_PCI_DEV,
|
.pci_dev.dev = CONFIG_UART_NS16550_PORT_0_PCI_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_UART_NS16550_PORT_0_PCI_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_UART_NS16550_PORT_0_PCI_VENDOR_ID,
|
||||||
|
@ -600,7 +600,7 @@ struct uart_device_config uart_ns16550_dev_cfg_1 = {
|
||||||
.init_info.options = CONFIG_UART_NS16550_PORT_1_OPTIONS,
|
.init_info.options = CONFIG_UART_NS16550_PORT_1_OPTIONS,
|
||||||
|
|
||||||
#ifdef CONFIG_UART_NS16550_PORT_1_PCI
|
#ifdef CONFIG_UART_NS16550_PORT_1_PCI
|
||||||
.pci_dev.class = CONFIG_UART_NS16550_PORT_1_PCI_CLASS,
|
.pci_dev.class_type = CONFIG_UART_NS16550_PORT_1_PCI_CLASS,
|
||||||
.pci_dev.bus = CONFIG_UART_NS16550_PORT_1_PCI_BUS,
|
.pci_dev.bus = CONFIG_UART_NS16550_PORT_1_PCI_BUS,
|
||||||
.pci_dev.dev = CONFIG_UART_NS16550_PORT_1_PCI_DEV,
|
.pci_dev.dev = CONFIG_UART_NS16550_PORT_1_PCI_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_UART_NS16550_PORT_1_PCI_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_UART_NS16550_PORT_1_PCI_VENDOR_ID,
|
||||||
|
|
|
@ -456,7 +456,7 @@ struct spi_intel_config spi_intel_config_0 = {
|
||||||
.regs = CONFIG_SPI_INTEL_PORT_0_REGS,
|
.regs = CONFIG_SPI_INTEL_PORT_0_REGS,
|
||||||
.irq = CONFIG_SPI_INTEL_PORT_0_IRQ,
|
.irq = CONFIG_SPI_INTEL_PORT_0_IRQ,
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_SPI_INTEL_CLASS,
|
.pci_dev.class_type = CONFIG_SPI_INTEL_CLASS,
|
||||||
.pci_dev.bus = CONFIG_SPI_INTEL_PORT_0_BUS,
|
.pci_dev.bus = CONFIG_SPI_INTEL_PORT_0_BUS,
|
||||||
.pci_dev.dev = CONFIG_SPI_INTEL_PORT_0_DEV,
|
.pci_dev.dev = CONFIG_SPI_INTEL_PORT_0_DEV,
|
||||||
.pci_dev.vendor_id = CONFIG_SPI_INTEL_VENDOR_ID,
|
.pci_dev.vendor_id = CONFIG_SPI_INTEL_VENDOR_ID,
|
||||||
|
@ -500,7 +500,7 @@ struct spi_intel_config spi_intel_config_1 = {
|
||||||
.regs = CONFIG_SPI_INTEL_PORT_1_REGS,
|
.regs = CONFIG_SPI_INTEL_PORT_1_REGS,
|
||||||
.irq = CONFIG_SPI_INTEL_PORT_1_IRQ,
|
.irq = CONFIG_SPI_INTEL_PORT_1_IRQ,
|
||||||
#if CONFIG_PCI
|
#if CONFIG_PCI
|
||||||
.pci_dev.class = CONFIG_SPI_INTEL_CLASS,
|
.pci_dev.class_type = CONFIG_SPI_INTEL_CLASS,
|
||||||
.pci_dev.bus = CONFIG_SPI_INTEL_PORT_1_BUS,
|
.pci_dev.bus = CONFIG_SPI_INTEL_PORT_1_BUS,
|
||||||
.pci_dev.dev = CONFIG_SPI_INTEL_PORT_1_DEV,
|
.pci_dev.dev = CONFIG_SPI_INTEL_PORT_1_DEV,
|
||||||
.pci_dev.function = CONFIG_SPI_INTEL_PORT_1_FUNCTION,
|
.pci_dev.function = CONFIG_SPI_INTEL_PORT_1_FUNCTION,
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct pci_dev_info {
|
||||||
uint32_t dev:5;
|
uint32_t dev:5;
|
||||||
uint32_t function:4;
|
uint32_t function:4;
|
||||||
uint32_t mem_type:1; /* memory type: BAR_SPACE_MEM/BAR_SPACE_IO */
|
uint32_t mem_type:1; /* memory type: BAR_SPACE_MEM/BAR_SPACE_IO */
|
||||||
uint32_t class:8;
|
uint32_t class_type:8;
|
||||||
uint32_t bar:3;
|
uint32_t bar:3;
|
||||||
uint32_t _reserved:3;
|
uint32_t _reserved:3;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ void pci_enumerate(void)
|
||||||
|
|
||||||
while (pci_bus_scan(&info)) {
|
while (pci_bus_scan(&info)) {
|
||||||
pci_show(&info);
|
pci_show(&info);
|
||||||
info.class = 0;
|
info.class_type = 0;
|
||||||
info.vendor_id = 0;
|
info.vendor_id = 0;
|
||||||
info.device_id = 0;
|
info.device_id = 0;
|
||||||
info.function = PCI_FUNCTION_ANY;
|
info.function = PCI_FUNCTION_ANY;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue