X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_pci.c;h=798537606637f98d98f7b00c4e5fec06982c1a0e;hb=dd0eedb1cfcf0cb7423d859177c5bc6f931eaf8a;hp=69f78d9263012a7be599babc2615dc6f8b461a09;hpb=26e09db6cb5fd9bbf0feb928561af9932694574b;p=dpdk.git diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 69f78d9263..7985376066 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -52,11 +52,11 @@ * PCI test * ======== * - * - Register a driver with a ``devinit()`` function. + * - Register a driver with a ``probe()`` function. * * - Dump all PCI devices. * - * - Check that the ``devinit()`` function is called at least once. + * - Check that the ``probe()`` function is called at least once. */ int test_pci_run = 0; /* value checked by the multiprocess test */ @@ -66,27 +66,31 @@ static int my_driver_init(struct rte_pci_driver *dr, struct rte_pci_device *dev); /* IXGBE NICS */ -struct rte_pci_id my_driver_id[] = { +const struct rte_pci_id my_driver_id[] = { {RTE_PCI_DEVICE(0x0001, 0x1234)}, { .vendor_id = 0, /* sentinel */ }, }; -struct rte_pci_id my_driver_id2[] = { +const struct rte_pci_id my_driver_id2[] = { {RTE_PCI_DEVICE(0x0001, 0x4444)}, {RTE_PCI_DEVICE(0x0002, 0xabcd)}, { .vendor_id = 0, /* sentinel */ }, }; struct rte_pci_driver my_driver = { - .name = "test_driver", - .devinit = my_driver_init, + .driver = { + .name = "test_driver" + }, + .probe = my_driver_init, .id_table = my_driver_id, .drv_flags = 0, }; struct rte_pci_driver my_driver2 = { - .name = "test_driver2", - .devinit = my_driver_init, + .driver = { + .name = "test_driver2" + }, + .probe = my_driver_init, .id_table = my_driver_id2, .drv_flags = 0, }; @@ -95,7 +99,7 @@ static int my_driver_init(__attribute__((unused)) struct rte_pci_driver *dr, struct rte_pci_device *dev) { - printf("My driver init called in %s\n", dr->name); + printf("My driver init called in %s\n", dr->driver.name); printf("%x:%x:%x.%d", dev->addr.domain, dev->addr.bus, dev->addr.devid, dev->addr.function); printf(" - vendor:%x device:%x\n", dev->id.vendor_id, dev->id.device_id);