cli: add DRIVER-VERSION and FIRMWARE-VERSION fields to driver properties listing
authorJiří Klimeš <jklimes@redhat.com>
Fri, 8 Jun 2012 11:44:43 +0000 (13:44 +0200)
committerJiří Klimeš <jklimes@redhat.com>
Fri, 8 Jun 2012 11:44:43 +0000 (13:44 +0200)
cli/src/devices.c

index e44309a..6b9367b 100644 (file)
@@ -108,18 +108,20 @@ static NmcOutputField nmc_fields_dev_list_general[] = {
        {"VENDOR",            N_("VENDOR"),            20, NULL, 0},  /* 3 */
        {"PRODUCT",           N_("PRODUCT"),           50, NULL, 0},  /* 4 */
        {"DRIVER",            N_("DRIVER"),             9, NULL, 0},  /* 5 */
-       {"HWADDR",            N_("HWADDR"),            19, NULL, 0},  /* 6 */
-       {"STATE",             N_("STATE"),             14, NULL, 0},  /* 7 */
-       {"REASON",            N_("REASON"),            25, NULL, 0},  /* 8 */
-       {"UDI",               N_("UDI"),               64, NULL, 0},  /* 9 */
-       {"IP-IFACE",          N_("IP-IFACE"),          10, NULL, 0},  /* 10 */
-       {"NM-MANAGED",        N_("NM-MANAGED"),        15, NULL, 0},  /* 11 */
-       {"AUTOCONNECT",       N_("AUTOCONNECT"),       15, NULL, 0},  /* 12 */
-       {"FIRMWARE-MISSING",  N_("FIRMWARE-MISSING"),  18, NULL, 0},  /* 13 */
-       {"CONNECTION",        N_("CONNECTION"),        51, NULL, 0},  /* 14 */
+       {"DRIVER-VERSION",    N_("DRIVER-VERSION"),    18, NULL, 0},  /* 6 */
+       {"FIRMWARE-VERSION",  N_("FIRMWARE-VERSION"),  18, NULL, 0},  /* 7 */
+       {"HWADDR",            N_("HWADDR"),            19, NULL, 0},  /* 8 */
+       {"STATE",             N_("STATE"),             14, NULL, 0},  /* 9 */
+       {"REASON",            N_("REASON"),            25, NULL, 0},  /* 10 */
+       {"UDI",               N_("UDI"),               64, NULL, 0},  /* 11 */
+       {"IP-IFACE",          N_("IP-IFACE"),          10, NULL, 0},  /* 12 */
+       {"NM-MANAGED",        N_("NM-MANAGED"),        15, NULL, 0},  /* 13 */
+       {"AUTOCONNECT",       N_("AUTOCONNECT"),       15, NULL, 0},  /* 14 */
+       {"FIRMWARE-MISSING",  N_("FIRMWARE-MISSING"),  18, NULL, 0},  /* 15 */
+       {"CONNECTION",        N_("CONNECTION"),        51, NULL, 0},  /* 16 */
        {NULL, NULL, 0, NULL, 0}
 };
-#define NMC_FIELDS_DEV_LIST_GENERAL_ALL     "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,HWADDR,STATE,REASON,UDI,IP-IFACE,NM-MANAGED,AUTOCONNECT,FIRMWARE-MISSING,CONNECTION"
+#define NMC_FIELDS_DEV_LIST_GENERAL_ALL     "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,DRIVER-VERSION,FIRMWARE-VERSION,HWADDR,STATE,REASON,UDI,IP-IFACE,NM-MANAGED,AUTOCONNECT,FIRMWARE-MISSING,CONNECTION"
 #define NMC_FIELDS_DEV_LIST_GENERAL_COMMON  "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,HWADDR,STATE"
 
 /* Available fields for 'dev list' - CAPABILITIES part */
@@ -575,15 +577,17 @@ show_device_info (gpointer data, gpointer user_data)
                        nmc->allowed_fields[3].value = nm_device_get_vendor (device);
                        nmc->allowed_fields[4].value = nm_device_get_product (device);
                        nmc->allowed_fields[5].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)");
-                       nmc->allowed_fields[6].value = hwaddr ? hwaddr : _("(unknown)");
-                       nmc->allowed_fields[7].value = state_str;
-                       nmc->allowed_fields[8].value = reason_str;
-                       nmc->allowed_fields[9].value = nm_device_get_udi (device);
-                       nmc->allowed_fields[10].value = nm_device_get_ip_iface (device);
-                       nmc->allowed_fields[11].value = nm_device_get_managed (device) ? _("yes") : _("no");
-                       nmc->allowed_fields[12].value = nm_device_get_autoconnect (device) ? _("yes") : _("no");
-                       nmc->allowed_fields[13].value = nm_device_get_firmware_missing (device) ? _("yes") : _("no");
-                       nmc->allowed_fields[14].value = (acon = nm_device_get_active_connection (device)) ?
+                       nmc->allowed_fields[6].value = nm_device_get_driver_version (device);
+                       nmc->allowed_fields[7].value = nm_device_get_firmware_version (device);
+                       nmc->allowed_fields[8].value = hwaddr ? hwaddr : _("(unknown)");
+                       nmc->allowed_fields[9].value = state_str;
+                       nmc->allowed_fields[10].value = reason_str;
+                       nmc->allowed_fields[11].value = nm_device_get_udi (device);
+                       nmc->allowed_fields[12].value = nm_device_get_ip_iface (device);
+                       nmc->allowed_fields[13].value = nm_device_get_managed (device) ? _("yes") : _("no");
+                       nmc->allowed_fields[14].value = nm_device_get_autoconnect (device) ? _("yes") : _("no");
+                       nmc->allowed_fields[15].value = nm_device_get_firmware_missing (device) ? _("yes") : _("no");
+                       nmc->allowed_fields[16].value = (acon = nm_device_get_active_connection (device)) ?
                                                           nm_object_get_path (NM_OBJECT (acon)) : _("not connected");
 
                        nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;