id_table = rte_zmalloc_socket(name, sizeof(*id_table), 0, socket_id);
if (id_table == NULL)
goto err;
+ id_table->device_id = 0xBEEF;
dev_private = rte_zmalloc_socket(name, sizeof(*dev_private), 0, socket_id);
if (dev_private == NULL)
eth_dev->pci_dev = pci_dev;
eth_dev->pci_dev->driver = ð_drv->pci_drv;
- eth_dev->pci_dev->driver->id_table->device_id = 0xBEEF;
-
eth_dev->rx_pkt_burst = virtual_ethdev_rx_burst_success;
eth_dev->tx_pkt_burst = virtual_ethdev_tx_burst_success;
const char *name; /**< Driver name. */
pci_devinit_t *devinit; /**< Device init. function. */
pci_devuninit_t *devuninit; /**< Device uninit function. */
- struct rte_pci_id *id_table; /**< ID table, NULL terminated. */
+ const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */
uint32_t drv_flags; /**< Flags contolling handling of device. */
};
rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev)
{
int ret;
- struct rte_pci_id *id_table;
+ const struct rte_pci_id *id_table;
- for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
+ for (id_table = dr->id_table; id_table->vendor_id != 0; id_table++) {
/* check if device's identifiers match the driver's ones */
if (id_table->vendor_id != dev->id.vendor_id &&
rte_eal_pci_close_one_driver(struct rte_pci_driver *dr,
struct rte_pci_device *dev)
{
- struct rte_pci_id *id_table;
+ const struct rte_pci_id *id_table;
if ((dr == NULL) || (dev == NULL))
return -EINVAL;
- for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
+ for (id_table = dr->id_table; id_table->vendor_id != 0; id_table++) {
/* check if device's identifiers match the driver's ones */
if (id_table->vendor_id != dev->id.vendor_id &&
RTE_BOND_LOG(ERR, "Unable to malloc pci_id_table on socket");
goto err;
}
+ pci_id_table->device_id = PCI_ANY_ID;
+ pci_id_table->subsystem_device_id = PCI_ANY_ID;
+ pci_id_table->vendor_id = PCI_ANY_ID;
+ pci_id_table->subsystem_vendor_id = PCI_ANY_ID;
pci_drv->id_table = pci_id_table;
-
- pci_drv->id_table->device_id = PCI_ANY_ID;
- pci_drv->id_table->subsystem_device_id = PCI_ANY_ID;
- pci_drv->id_table->vendor_id = PCI_ANY_ID;
- pci_drv->id_table->subsystem_vendor_id = PCI_ANY_ID;
-
pci_drv->drv_flags = RTE_PCI_DRV_INTR_LSC;
internals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id);
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_em_map[] = {
+static const struct rte_pci_id pci_id_em_map[] = {
#define RTE_PCI_DEV_ID_DECL_EM(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_igb_map[] = {
+static const struct rte_pci_id pci_id_igb_map[] = {
#define RTE_PCI_DEV_ID_DECL_IGB(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
/*
* The set of PCI devices this driver supports (for 82576&I350 VF)
*/
-static struct rte_pci_id pci_id_igbvf_map[] = {
+static const struct rte_pci_id pci_id_igbvf_map[] = {
#define RTE_PCI_DEV_ID_DECL_IGBVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_enic_map[] = {
+static const struct rte_pci_id pci_id_enic_map[] = {
#define RTE_PCI_DEV_ID_DECL_ENIC(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#ifndef PCI_VENDOR_ID_CISCO
#define PCI_VENDOR_ID_CISCO 0x1137
* The set of PCI devices this driver supports. This driver will enable both PF
* and SRIOV-VF devices.
*/
-static struct rte_pci_id pci_id_fm10k_map[] = {
+static const struct rte_pci_id pci_id_fm10k_map[] = {
#define RTE_PCI_DEV_ID_DECL_FM10K(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
#define RTE_PCI_DEV_ID_DECL_FM10KVF(vend, dev) { RTE_PCI_DEVICE(vend, dev) },
#include "rte_pci_dev_ids.h"
static void i40e_configure_registers(struct i40e_hw *hw);
static void i40e_hw_init(struct i40e_hw *hw);
-static struct rte_pci_id pci_id_i40e_map[] = {
+static const struct rte_pci_id pci_id_i40e_map[] = {
#define RTE_PCI_DEV_ID_DECL_I40E(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
{ .vendor_id = 0, /* sentinel */ },
return 0;
}
-static struct rte_pci_id pci_id_i40evf_map[] = {
+static const struct rte_pci_id pci_id_i40evf_map[] = {
#define RTE_PCI_DEV_ID_DECL_I40EVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
{ .vendor_id = 0, /* sentinel */ },
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_ixgbe_map[] = {
+static const struct rte_pci_id pci_id_ixgbe_map[] = {
#define RTE_PCI_DEV_ID_DECL_IXGBE(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
/*
* The set of PCI devices this driver supports (for 82599 VF)
*/
-static struct rte_pci_id pci_id_ixgbevf_map[] = {
+static const struct rte_pci_id pci_id_ixgbevf_map[] = {
#define RTE_PCI_DEV_ID_DECL_IXGBEVF(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
return -err;
}
-static struct rte_pci_id mlx4_pci_id_map[] = {
+static const struct rte_pci_id mlx4_pci_id_map[] = {
{
.vendor_id = PCI_VENDOR_ID_MELLANOX,
.device_id = PCI_DEVICE_ID_MELLANOX_CONNECTX3,
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_virtio_map[] = {
+static const struct rte_pci_id pci_id_virtio_map[] = {
#define RTE_PCI_DEV_ID_DECL_VIRTIO(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_vmxnet3_map[] = {
+static const struct rte_pci_id pci_id_vmxnet3_map[] = {
#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"