technology: Add support for regulatory domain notification
authorSamuel Ortiz <sameo@linux.intel.com>
Thu, 9 Dec 2010 00:28:15 +0000 (01:28 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 9 Dec 2010 00:28:15 +0000 (01:28 +0100)
include/technology.h
src/technology.c

index 6117f8f..9cf4656 100644 (file)
@@ -38,6 +38,8 @@ struct connman_technology;
 
 void connman_technology_tethering_notify(struct connman_technology *technology,
                                                        connman_bool_t enabled);
+void connman_technology_regdom_notify(struct connman_technology *technology,
+                                                       const char *alpha2);
 
 struct connman_technology_driver {
        const char *name;
index c5600e2..66fec98 100644 (file)
@@ -58,6 +58,7 @@ struct connman_technology {
        GSList *device_list;
        gint enabled;
        gint blocked;
+       char *regdom;
 
        struct connman_technology_driver *driver;
        void *driver_data;
@@ -246,6 +247,20 @@ int __connman_technology_disable_tethering(const char *bridge)
        return set_tethering(bridge, FALSE);
 }
 
+void connman_technology_regdom_notify(struct connman_technology *technology,
+                                                       const char *alpha2)
+{
+       DBG("");
+
+       if (alpha2 == NULL)
+               connman_error("Failed to set regulatory domain");
+       else
+               DBG("Regulatory domain set to %s", alpha2);
+
+       g_free(technology->regdom);
+       technology->regdom = g_strdup(alpha2);
+}
+
 int __connman_technology_set_regdom(const char *alpha2)
 {
        GSList *list;
@@ -504,6 +519,7 @@ static void technology_put(struct connman_technology *technology)
        g_hash_table_destroy(technology->rfkill_list);
 
        g_free(technology->path);
+       g_free(technology->regdom);
        g_free(technology);
 }