technology: Add regulatory domain framework
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 30 Nov 2010 19:11:20 +0000 (20:11 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 2 Dec 2010 11:07:27 +0000 (12:07 +0100)
include/technology.h
src/connman.h
src/technology.c

index 7471a53cab5c370310f3a76742dc35c0c9a7144c..6117f8f9f9d264b2e621eb48d2f81aaad96c6f5e 100644 (file)
@@ -52,6 +52,8 @@ struct connman_technology_driver {
                                                                int index);
        int (*set_tethering) (struct connman_technology *technology,
                                const char *bridge, connman_bool_t enabled);
+       int (*set_regdom) (struct connman_technology *technology,
+                                               const char *alpha2);
 };
 
 int connman_technology_driver_register(struct connman_technology_driver *driver);
index 7dbd7070c42588401b9603cbdaf329a559a51c07..a2ffe1091c1458d035c41944920026bf89021995 100644 (file)
@@ -318,6 +318,7 @@ void __connman_technology_remove_interface(enum connman_service_type type,
                                int index, const char *name, const char *ident);
 int __connman_technology_enable_tethering(const char *bridge);
 int __connman_technology_disable_tethering(const char *bridge);
+int __connman_technology_set_regdom(const char *alpha2);
 
 connman_bool_t __connman_technology_get_blocked(enum connman_service_type type);
 
index 98fcf8dd6737e40ac554fc4d14653f6e54a37c70..d698ee9811fb13bdc4080d5c435c0289689c67ca 100644 (file)
@@ -216,6 +216,23 @@ int __connman_technology_disable_tethering(const char *bridge)
        return set_tethering(bridge, FALSE);
 }
 
+int __connman_technology_set_regdom(const char *alpha2)
+{
+       GSList *list;
+
+       for (list = technology_list; list; list = list->next) {
+               struct connman_technology *technology = list->data;
+
+               if (technology->driver == NULL)
+                       continue;
+
+               if (technology->driver->set_regdom)
+                       technology->driver->set_regdom(technology, alpha2);
+       }
+
+       return 0;
+}
+
 static void free_rfkill(gpointer data)
 {
        struct connman_rfkill *rfkill = data;