summaryrefslogtreecommitdiffstats
path: root/src/vlib/linux/pci.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-09-14 19:04:50 +0200
committerDave Barach <openvpp@barachs.net>2017-09-15 16:34:50 +0000
commit01914ce45729833cec88c65689de9a0336cd40cc (patch)
tree99068f85d2b7b4e55154706286ab629acc7e4ab6 /src/vlib/linux/pci.c
parentce41a5c8032ff581a56b990361a2368c879a7adf (diff)
vppinfra: add clib_mem_vm_ext_alloc function
Change-Id: Iff33694fc42cc3bcc73cf1372339053a6365039c Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/linux/pci.c')
-rw-r--r--src/vlib/linux/pci.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index 4ce19190531..790f168a355 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -37,10 +37,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <vppinfra/linux/sysfs.h>
+
#include <vlib/vlib.h>
#include <vlib/pci/pci.h>
#include <vlib/unix/unix.h>
-#include <vlib/linux/sysfs.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -104,7 +105,7 @@ vlib_pci_bind_to_uio (vlib_pci_device_t * d, char *uio_driver_name)
format_vlib_pci_addr, &d->bus_address);
s = format (s, "%v/driver%c", dev_dir_name, 0);
- driver_name = vlib_sysfs_link_to_name ((char *) s);
+ driver_name = clib_sysfs_link_to_name ((char *) s);
vec_reset_length (s);
if (driver_name &&
@@ -183,32 +184,32 @@ vlib_pci_bind_to_uio (vlib_pci_device_t * d, char *uio_driver_name)
vec_reset_length (s);
s = format (s, "%v/driver/unbind%c", dev_dir_name, 0);
- vlib_sysfs_write ((char *) s, "%U", format_vlib_pci_addr, &d->bus_address);
+ clib_sysfs_write ((char *) s, "%U", format_vlib_pci_addr, &d->bus_address);
vec_reset_length (s);
s = format (s, "%v/driver_override%c", dev_dir_name, 0);
if (access ((char *) s, F_OK) == 0)
{
- vlib_sysfs_write ((char *) s, "%s", uio_driver_name);
+ clib_sysfs_write ((char *) s, "%s", uio_driver_name);
clear_driver_override = 1;
}
else
{
vec_reset_length (s);
s = format (s, "/sys/bus/pci/drivers/%s/new_id%c", uio_driver_name, 0);
- vlib_sysfs_write ((char *) s, "0x%04x 0x%04x", d->vendor_id,
+ clib_sysfs_write ((char *) s, "0x%04x 0x%04x", d->vendor_id,
d->device_id);
}
vec_reset_length (s);
s = format (s, "/sys/bus/pci/drivers/%s/bind%c", uio_driver_name, 0);
- vlib_sysfs_write ((char *) s, "%U", format_vlib_pci_addr, &d->bus_address);
+ clib_sysfs_write ((char *) s, "%U", format_vlib_pci_addr, &d->bus_address);
vec_reset_length (s);
if (clear_driver_override)
{
s = format (s, "%v/driver_override%c", dev_dir_name, 0);
- vlib_sysfs_write ((char *) s, "%c", 0);
+ clib_sysfs_write ((char *) s, "%c", 0);
vec_reset_length (s);
}
@@ -602,28 +603,28 @@ scan_device (void *arg, u8 * dev_dir_name, u8 * ignored)
dev->numa_node = -1;
vec_reset_length (f);
f = format (f, "%v/numa_node%c", dev_dir_name, 0);
- vlib_sysfs_read ((char *) f, "%u", &dev->numa_node);
+ clib_sysfs_read ((char *) f, "%u", &dev->numa_node);
vec_reset_length (f);
f = format (f, "%v/class%c", dev_dir_name, 0);
- vlib_sysfs_read ((char *) f, "0x%x", &tmp);
+ clib_sysfs_read ((char *) f, "0x%x", &tmp);
dev->device_class = tmp >> 8;
vec_reset_length (f);
f = format (f, "%v/vendor%c", dev_dir_name, 0);
- vlib_sysfs_read ((char *) f, "0x%x", &tmp);
+ clib_sysfs_read ((char *) f, "0x%x", &tmp);
dev->vendor_id = tmp;
vec_reset_length (f);
f = format (f, "%v/device%c", dev_dir_name, 0);
- vlib_sysfs_read ((char *) f, "0x%x", &tmp);
+ clib_sysfs_read ((char *) f, "0x%x", &tmp);
dev->device_id = tmp;
error = init_device (vm, dev, &pdev);
vec_reset_length (f);
f = format (f, "%v/driver%c", dev_dir_name, 0);
- dev->driver_name = vlib_sysfs_link_to_name ((char *) f);
+ dev->driver_name = clib_sysfs_link_to_name ((char *) f);
done:
vec_free (f);