net: spread __net_init, __net_exit
[safe/jmp/linux-2.6] / net / wireless / reg.c
index dc13c3f..87ea60d 100644 (file)
@@ -129,78 +129,6 @@ static char *ieee80211_regdom = "00";
 module_param(ieee80211_regdom, charp, 0444);
 MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain code");
 
-#ifdef CONFIG_WIRELESS_OLD_REGULATORY
-/*
- * We assume 40 MHz bandwidth for the old regulatory work.
- * We make emphasis we are using the exact same frequencies
- * as before
- */
-
-static const struct ieee80211_regdomain us_regdom = {
-       .n_reg_rules = 6,
-       .alpha2 =  "US",
-       .reg_rules = {
-               /* IEEE 802.11b/g, channels 1..11 */
-               REG_RULE(2412-10, 2462+10, 40, 6, 27, 0),
-               /* IEEE 802.11a, channel 36..48 */
-               REG_RULE(5180-10, 5240+10, 40, 6, 17, 0),
-               /* IEEE 802.11a, channels 48..64 */
-               REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_DFS),
-               /* IEEE 802.11a, channels 100..124 */
-               REG_RULE(5500-10, 5590+10, 40, 6, 20, NL80211_RRF_DFS),
-               /* IEEE 802.11a, channels 132..144 */
-               REG_RULE(5660-10, 5700+10, 40, 6, 20, NL80211_RRF_DFS),
-               /* IEEE 802.11a, channels 149..165, outdoor */
-               REG_RULE(5745-10, 5825+10, 40, 6, 30, 0),
-       }
-};
-
-static const struct ieee80211_regdomain jp_regdom = {
-       .n_reg_rules = 6,
-       .alpha2 =  "JP",
-       .reg_rules = {
-               /* IEEE 802.11b/g, channels 1..11 */
-               REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
-               /* IEEE 802.11b/g, channels 12..13 */
-               REG_RULE(2467-10, 2472+10, 20, 6, 20, 0),
-               /* IEEE 802.11b/g, channel 14 */
-               REG_RULE(2484-10, 2484+10, 20, 6, 20, NL80211_RRF_NO_OFDM),
-               /* IEEE 802.11a, channels 36..48 */
-               REG_RULE(5180-10, 5240+10, 40, 6, 20, 0),
-               /* IEEE 802.11a, channels 52..64 */
-               REG_RULE(5260-10, 5320+10, 40, 6, 20, NL80211_RRF_DFS),
-               /* IEEE 802.11a, channels 100..144 */
-               REG_RULE(5500-10, 5700+10, 40, 6, 23, NL80211_RRF_DFS),
-       }
-};
-
-static const struct ieee80211_regdomain *static_regdom(char *alpha2)
-{
-       if (alpha2[0] == 'U' && alpha2[1] == 'S')
-               return &us_regdom;
-       if (alpha2[0] == 'J' && alpha2[1] == 'P')
-               return &jp_regdom;
-       /* Use world roaming rules for "EU", since it was a pseudo
-          domain anyway... */
-       if (alpha2[0] == 'E' && alpha2[1] == 'U')
-               return &world_regdom;
-       /* Default, world roaming rules */
-       return &world_regdom;
-}
-
-static bool is_old_static_regdom(const struct ieee80211_regdomain *rd)
-{
-       if (rd == &us_regdom || rd == &jp_regdom || rd == &world_regdom)
-               return true;
-       return false;
-}
-#else
-static inline bool is_old_static_regdom(const struct ieee80211_regdomain *rd)
-{
-       return false;
-}
-#endif
-
 static void reset_regdomains(void)
 {
        /* avoid freeing static information or freeing something twice */
@@ -210,8 +138,6 @@ static void reset_regdomains(void)
                cfg80211_world_regdom = NULL;
        if (cfg80211_regdomain == &world_regdom)
                cfg80211_regdomain = NULL;
-       if (is_old_static_regdom(cfg80211_regdomain))
-               cfg80211_regdomain = NULL;
 
        kfree(cfg80211_regdomain);
        kfree(cfg80211_world_regdom);
@@ -1490,8 +1416,6 @@ static int ignore_request(struct wiphy *wiphy,
                return REG_INTERSECT;
        case NL80211_REGDOM_SET_BY_DRIVER:
                if (last_request->initiator == NL80211_REGDOM_SET_BY_CORE) {
-                       if (is_old_static_regdom(cfg80211_regdomain))
-                               return 0;
                        if (regdom_changes(pending_request->alpha2))
                                return 0;
                        return -EALREADY;
@@ -1528,8 +1452,7 @@ static int ignore_request(struct wiphy *wiphy,
                                return -EAGAIN;
                }
 
-               if (!is_old_static_regdom(cfg80211_regdomain) &&
-                   !regdom_changes(pending_request->alpha2))
+               if (!regdom_changes(pending_request->alpha2))
                        return -EALREADY;
 
                return 0;
@@ -2111,8 +2034,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
                 * If someone else asked us to change the rd lets only bother
                 * checking if the alpha2 changes if CRDA was already called
                 */
-               if (!is_old_static_regdom(cfg80211_regdomain) &&
-                   !regdom_changes(rd->alpha2))
+               if (!regdom_changes(rd->alpha2))
                        return -EINVAL;
        }
 
@@ -2311,15 +2233,8 @@ int regulatory_init(void)
        spin_lock_init(&reg_requests_lock);
        spin_lock_init(&reg_pending_beacons_lock);
 
-#ifdef CONFIG_WIRELESS_OLD_REGULATORY
-       cfg80211_regdomain = static_regdom(ieee80211_regdom);
-
-       printk(KERN_INFO "cfg80211: Using static regulatory domain info\n");
-       print_regdomain_info(cfg80211_regdomain);
-#else
        cfg80211_regdomain = cfg80211_world_regdom;
 
-#endif
        /* We always try to get an update for the static regdomain */
        err = regulatory_hint_core(cfg80211_regdomain->alpha2);
        if (err) {