aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/linux/pci.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-09-08 19:52:02 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-09-09 20:11:03 +0000
commit56dd5438b04b869065d8e901c315496bb6777455 (patch)
tree517190c53cfd2725d716eda6dddf9a64ad814084 /src/vlib/linux/pci.c
parent816122e303efb5012f6897bd53ff8fe28cd8fa1c (diff)
move unix_file_* code to vppinfra
This will allow us to use this code in client libraries without vlib. Change-Id: I8557b752496841ba588aa36b6082cbe2cd1867fe Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/linux/pci.c')
-rw-r--r--src/vlib/linux/pci.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index cd2affdc903..4ce19190531 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -68,8 +68,8 @@ typedef struct
/* Minor device for uio device. */
u32 uio_minor;
- /* Index given by unix_file_add. */
- u32 unix_file_index;
+ /* Index given by clib_file_add. */
+ u32 clib_file_index;
} linux_pci_device_t;
@@ -237,7 +237,7 @@ scan_uio_dir (void *arg, u8 * path_name, u8 * file_name)
}
static clib_error_t *
-linux_pci_uio_read_ready (unix_file_t * uf)
+linux_pci_uio_read_ready (clib_file_t * uf)
{
vlib_pci_main_t *pm = &pci_main;
vlib_pci_device_t *d;
@@ -257,7 +257,7 @@ linux_pci_uio_read_ready (unix_file_t * uf)
}
static clib_error_t *
-linux_pci_uio_error_ready (unix_file_t * uf)
+linux_pci_uio_error_ready (clib_file_t * uf)
{
u32 error_index = (u32) uf->private_data;
@@ -294,15 +294,14 @@ add_device (vlib_pci_device_t * dev, linux_pci_device_t * pdev)
}
{
- unix_file_t template = { 0 };
- unix_main_t *um = &unix_main;
+ clib_file_t template = { 0 };
template.read_function = linux_pci_uio_read_ready;
template.file_descriptor = l->uio_fd;
template.error_function = linux_pci_uio_error_ready;
template.private_data = dev - pm->pci_devs;
- l->unix_file_index = unix_file_add (um, &template);
+ l->clib_file_index = clib_file_add (&file_main, &template);
}
}