diff options
author | Richard Hughes <richard@hughsie.com> | 2009-02-09 15:09:43 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2009-02-09 15:09:43 +0000 |
commit | a7868a4564112c11320eef62e31b54d8c2c2b196 (patch) | |
tree | b293e380a5bd12747a70c3ed67753e7b08dba50a /libdevkit-power/dkp-enum.c | |
parent | 7a5fb2301f3ec2c3e3d85601410811d619925e1d (diff) |
bugfix: fix the QoS interface, and abstract out the object
Diffstat (limited to 'libdevkit-power/dkp-enum.c')
-rw-r--r-- | libdevkit-power/dkp-enum.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libdevkit-power/dkp-enum.c b/libdevkit-power/dkp-enum.c index be93e7e..8cdcee9 100644 --- a/libdevkit-power/dkp-enum.c +++ b/libdevkit-power/dkp-enum.c @@ -203,3 +203,29 @@ dkp_device_technology_from_text (const gchar *technology) return DKP_DEVICE_TECHNOLGY_UNKNOWN; } +/** + * dkp_qos_type_to_text: + **/ +const gchar * +dkp_qos_type_to_text (DkpQosType type) +{ + if (type == DKP_QOS_TYPE_NETWORK) + return "network"; + if (type == DKP_QOS_TYPE_CPU_DMA) + return "cpu_dma"; + return NULL; +} + +/** + * dkp_qos_type_from_text: + **/ +DkpQosType +dkp_qos_type_from_text (const gchar *type) +{ + if (egg_strequal (type, "network")) + return DKP_QOS_TYPE_NETWORK; + if (egg_strequal (type, "cpu_dma")) + return DKP_QOS_TYPE_CPU_DMA; + return DKP_QOS_TYPE_UNKNOWN; +} + |