diff --git a/clients/cli/general.c b/clients/cli/general.c index 14502111d..55371d13f 100644 --- a/clients/cli/general.c +++ b/clients/cli/general.c @@ -1242,6 +1242,41 @@ device_overview (NmCli *nmc, NMDevice *device) g_string_append_printf (outbuf, "%s, ", tmp); g_free (tmp); } + + switch (nm_device_get_device_type (device)) { + case NM_DEVICE_TYPE_WIFI: + case NM_DEVICE_TYPE_OLPC_MESH: + case NM_DEVICE_TYPE_WIFI_P2P: + if (!nm_client_wireless_get_enabled (nmc->client)) { + tmp = nmc_colorize (&nmc->nmc_config, NM_META_COLOR_DEVICE_DISABLED, _("sw disabled")); + g_string_append_printf (outbuf, "%s, ", tmp); + g_free (tmp); + } + if (!nm_client_wireless_hardware_get_enabled (nmc->client)) { + tmp = nmc_colorize (&nmc->nmc_config, NM_META_COLOR_DEVICE_DISABLED, _("hw disabled")); + g_string_append_printf (outbuf, "%s, ", tmp); + g_free (tmp); + } + break; + case NM_DEVICE_TYPE_MODEM: + if ( nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device)) + & (NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS | NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)) { + if (!nm_client_wwan_get_enabled (nmc->client)) { + tmp = nmc_colorize (&nmc->nmc_config, NM_META_COLOR_DEVICE_DISABLED, _("sw disabled")); + g_string_append_printf (outbuf, "%s, ", tmp); + g_free (tmp); + } + if (!nm_client_wwan_hardware_get_enabled (nmc->client)) { + tmp = nmc_colorize (&nmc->nmc_config, NM_META_COLOR_DEVICE_DISABLED, _("hw disabled")); + g_string_append_printf (outbuf, "%s, ", tmp); + g_free (tmp); + } + } + break; + default: + break; + } + if (nm_device_is_software (device)) g_string_append_printf (outbuf, "%s, ", _("sw")); else diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 599369bf2..7eb9ef82d 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -52,6 +52,7 @@ [NM_META_COLOR_DEVICE_FIRMWARE_MISSING] = "31", \ [NM_META_COLOR_DEVICE_PLUGIN_MISSING] = "31", \ [NM_META_COLOR_DEVICE_UNAVAILABLE] = "2", \ + [NM_META_COLOR_DEVICE_DISABLED] = "31", \ [NM_META_COLOR_MANAGER_RUNNING] = "32", \ [NM_META_COLOR_MANAGER_STARTING] = "33", \ [NM_META_COLOR_MANAGER_STOPPED] = "31", \ @@ -558,6 +559,7 @@ parse_color_scheme (char *palette_buffer, [NM_META_COLOR_DEVICE_FIRMWARE_MISSING] = "device-firmware-missing", [NM_META_COLOR_DEVICE_PLUGIN_MISSING] = "device-plugin-missing", [NM_META_COLOR_DEVICE_UNAVAILABLE] = "device-unavailable", + [NM_META_COLOR_DEVICE_DISABLED] = "device-disabled", [NM_META_COLOR_DEVICE_UNKNOWN] = "device-unknown", [NM_META_COLOR_MANAGER_RUNNING] = "manager-running", [NM_META_COLOR_MANAGER_STARTING] = "manager-starting", diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index 44cfcdc42..2f184e494 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -89,6 +89,7 @@ typedef enum { NM_META_COLOR_DEVICE_FIRMWARE_MISSING, NM_META_COLOR_DEVICE_PLUGIN_MISSING, NM_META_COLOR_DEVICE_UNAVAILABLE, + NM_META_COLOR_DEVICE_DISABLED, NM_META_COLOR_DEVICE_UNKNOWN, NM_META_COLOR_MANAGER_RUNNING, NM_META_COLOR_MANAGER_STARTING, diff --git a/man/nmcli.xml b/man/nmcli.xml index e9517456f..203337693 100644 --- a/man/nmcli.xml +++ b/man/nmcli.xml @@ -2192,6 +2192,13 @@ It's equivalent to the +bond.options 'option=value' syntax. + + + + Device is disabled by software or hardware kill switch. + + +