libiwinfo: support txpwrlist(), freqlist() and countrylist() for radioX pseudodevices...
[project/luci.git] / contrib / package / iwinfo / src / iwinfo_lualib.c
index 29706e3..312a3da 100644 (file)
@@ -51,7 +51,7 @@ struct iwinfo_iso3166_label ISO3166_Names[] = {
        { 0x4248 /* BH */, "Bahrain" },
        { 0x4249 /* BI */, "Burundi" },
        { 0x424A /* BJ */, "Benin" },
-       { 0x424C /* BL */, "Saint Barthélemy" },
+       { 0x424C /* BL */, "Saint Barthelemy" },
        { 0x424D /* BM */, "Bermuda" },
        { 0x424E /* BN */, "Brunei Darussalam" },
        { 0x424F /* BO */, "Bolivia" },
@@ -308,6 +308,21 @@ static int iwinfo_L_type(lua_State *L)
        return 1;
 }
 
+/* Shutdown backends */
+static int iwinfo_L__gc(lua_State *L)
+{
+#ifdef USE_WL
+       wl_close();
+#endif
+#ifdef USE_MADWIFI
+       madwifi_close();
+#endif
+#ifdef USE_NL80211
+       nl80211_close();
+#endif
+       wext_close();
+}
+
 /*
  * Build a short textual description of the crypto info
  */
@@ -930,6 +945,7 @@ static const luaL_reg R_wext[] = {
 /* Common */
 static const luaL_reg R_common[] = {
        { "type", iwinfo_L_type },
+       { "__gc", iwinfo_L__gc  },
        { NULL, NULL }
 };