pci: rename pci_device_has_non_null_driver to non_uio

This more accurately represents what function it performs.

Also remove pci_device_has_uio_driver() from the public API.  Callers
should use pci_device_has_non_uio_driver() instead.

Change-Id: I9623fe1345b43e981d5823804e33d01ac0d3bb1c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-01-11 15:48:00 -07:00
parent 2ced60e9bf
commit 040742359e
8 changed files with 18 additions and 17 deletions

View File

@ -176,8 +176,8 @@ ioat_init(void)
pci_dev->vendor_id, pci_dev->device_id,
pci_device_get_device_name(pci_dev));
if (pci_device_has_non_null_driver(pci_dev)) {
printf("Device has kernel driver, skipping...\n");
if (pci_device_has_non_uio_driver(pci_dev)) {
printf("Device has non-uio kernel driver, skipping...\n");
continue;
}

View File

@ -191,8 +191,8 @@ ioat_init(void)
pci_dev->vendor_id, pci_dev->device_id,
pci_device_get_device_name(pci_dev));
if (pci_device_has_non_null_driver(pci_dev)) {
printf("Device has kernel driver, skipping...\n");
if (pci_device_has_non_uio_driver(pci_dev)) {
printf("Device has non-uio kernel driver, skipping...\n");
continue;
}

View File

@ -584,8 +584,8 @@ int main(int argc, char **argv)
while ((pci_dev = pci_device_next(pci_dev_iter))) {
struct nvme_controller *ctrlr;
if (pci_device_has_non_null_driver(pci_dev)) {
fprintf(stderr, "non-null kernel driver attached to nvme\n");
if (pci_device_has_non_uio_driver(pci_dev)) {
fprintf(stderr, "non-uio kernel driver attached to nvme\n");
fprintf(stderr, " controller at pci bdf %d:%d:%d\n",
pci_dev->bus, pci_dev->dev, pci_dev->func);
fprintf(stderr, " skipping...\n");

View File

@ -705,8 +705,8 @@ register_controllers(void)
while ((pci_dev = pci_device_next(pci_dev_iter))) {
struct nvme_controller *ctrlr;
if (pci_device_has_non_null_driver(pci_dev)) {
fprintf(stderr, "non-null kernel driver attached to nvme\n");
if (pci_device_has_non_uio_driver(pci_dev)) {
fprintf(stderr, "non-uio kernel driver attached to nvme\n");
fprintf(stderr, " controller at pci bdf %d:%d:%d\n",
pci_dev->bus, pci_dev->dev, pci_dev->func);
fprintf(stderr, " skipping...\n");

View File

@ -39,8 +39,7 @@
#define PCI_UIO_DRIVER "uio_pci_generic"
int pci_device_get_serial_number(struct pci_device *dev, char *sn, int len);
int pci_device_has_uio_driver(struct pci_device *dev);
int pci_device_has_non_null_driver(struct pci_device *dev);
int pci_device_has_non_uio_driver(struct pci_device *dev);
int pci_device_unbind_kernel_driver(struct pci_device *dev);
int pci_device_bind_uio_driver(struct pci_device *dev, char *driver_name);
int pci_device_switch_to_uio_driver(struct pci_device *pci_dev);

View File

@ -95,7 +95,8 @@ pci_device_get_serial_number(struct pci_device *dev, char *sn, int len)
return -1;
}
int
#ifdef __linux__
static int
pci_device_has_uio_driver(struct pci_device *dev)
{
struct dirent *e;
@ -129,10 +130,11 @@ pci_device_has_uio_driver(struct pci_device *dev)
return 1;
}
#endif
#ifdef __FreeBSD__
int
pci_device_has_non_null_driver(struct pci_device *dev)
pci_device_has_non_uio_driver(struct pci_device *dev)
{
struct pci_conf_io configsel;
struct pci_match_conf pattern;
@ -183,7 +185,7 @@ pci_device_has_non_null_driver(struct pci_device *dev)
}
#else
int
pci_device_has_non_null_driver(struct pci_device *dev)
pci_device_has_non_uio_driver(struct pci_device *dev)
{
return pci_device_has_kernel_driver(dev) && !pci_device_has_uio_driver(dev);
}

View File

@ -242,8 +242,8 @@ int main(int argc, char **argv)
while ((pci_dev = pci_device_next(pci_dev_iter))) {
struct dev *dev;
if (pci_device_has_non_null_driver(pci_dev)) {
fprintf(stderr, "non-null kernel driver attached to nvme\n");
if (pci_device_has_non_uio_driver(pci_dev)) {
fprintf(stderr, "non-uio kernel driver attached to nvme\n");
fprintf(stderr, " controller at pci bdf %d:%d:%d\n",
pci_dev->bus, pci_dev->dev, pci_dev->func);
fprintf(stderr, " skipping...\n");

View File

@ -528,8 +528,8 @@ register_controllers(void)
while ((pci_dev = pci_device_next(pci_dev_iter))) {
struct nvme_controller *ctrlr;
if (pci_device_has_non_null_driver(pci_dev)) {
fprintf(stderr, "non-null kernel driver attached to nvme\n");
if (pci_device_has_non_uio_driver(pci_dev)) {
fprintf(stderr, "non-uio kernel driver attached to nvme\n");
fprintf(stderr, " controller at pci bdf %d:%d:%d\n",
pci_dev->bus, pci_dev->dev, pci_dev->func);
fprintf(stderr, " skipping...\n");