Commit f13fd452 authored by Beniamino Galvani's avatar Beniamino Galvani

all: detect SR-IOV device support

parent 0a7694cf
......@@ -95,6 +95,7 @@ const NmcMetaGenericInfo *const nmc_fields_dev_show_cap[] = {
NMC_META_GENERIC ("CARRIER-DETECT"), /* 1 */
NMC_META_GENERIC ("SPEED"), /* 2 */
NMC_META_GENERIC ("IS-SOFTWARE"), /* 3 */
NMC_META_GENERIC ("SRIOV"), /* 4 */
NULL,
};
#define NMC_FIELDS_DEV_SHOW_CAP_COMMON "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE"
......@@ -1156,6 +1157,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
set_val_strc (arr, 1, (caps & NM_DEVICE_CAP_CARRIER_DETECT) ? _("yes") : _("no"));
set_val_str (arr, 2, speed_str);
set_val_strc (arr, 3, (caps & NM_DEVICE_CAP_IS_SOFTWARE) ? _("yes") : _("no"));
set_val_strc (arr, 4, (caps & NM_DEVICE_CAP_SRIOV) ? _("yes") : _("no"));
g_ptr_array_add (out.output_data, arr);
print_data_prepare_width (out.output_data);
......
......@@ -239,6 +239,7 @@ typedef enum {
* @NM_DEVICE_CAP_NM_SUPPORTED: NetworkManager supports this device
* @NM_DEVICE_CAP_CARRIER_DETECT: this device can indicate carrier status
* @NM_DEVICE_CAP_IS_SOFTWARE: this device is a software device
* @NM_DEVICE_CAP_SRIOV: this device supports single-root I/O virtualization
*
* General device capability flags.
**/
......@@ -247,9 +248,9 @@ typedef enum { /*< flags >*/
NM_DEVICE_CAP_NM_SUPPORTED = 0x00000001,
NM_DEVICE_CAP_CARRIER_DETECT = 0x00000002,
NM_DEVICE_CAP_IS_SOFTWARE = 0x00000004,
NM_DEVICE_CAP_SRIOV = 0x00000008,
} NMDeviceCapabilities;
/**
* NMDeviceWifiCapabilities:
* @NM_WIFI_DEVICE_CAP_NONE: device has no encryption/authentication capabilities
......
......@@ -2934,6 +2934,9 @@ realize_start_setup (NMDevice *self,
if (nm_platform_check_support_user_ipv6ll (nm_device_get_platform (self)))
priv->nm_ipv6ll = nm_platform_link_get_user_ipv6ll_enabled (nm_device_get_platform (self), priv->ifindex);
if (nm_platform_link_supports_sriov (nm_device_get_platform (self), priv->ifindex))
capabilities |= NM_DEVICE_CAP_SRIOV;
}
if (klass->get_generic_capabilities)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment