]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/wireless/reg.c
cfg80211: add 6GHz UNII band definitions
[linux.git] / net / wireless / reg.c
index 298fe91557f7984e386b13afec6d9d438cb736c3..646107af9f411576ccbb5eefd6b110601d65ea0f 100644 (file)
@@ -741,7 +741,8 @@ static void __init load_keys_from_buffer(const u8 *p, unsigned int buflen)
 
                key = key_create_or_update(make_key_ref(builtin_regdb_keys, 1),
                                           "asymmetric", NULL, p, plen,
-                                          &internal_key_acl, 
+                                          ((KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                                           KEY_USR_VIEW | KEY_USR_READ),
                                           KEY_ALLOC_NOT_IN_QUOTA |
                                           KEY_ALLOC_BUILT_IN |
                                           KEY_ALLOC_BYPASS_RESTRICTION);
@@ -767,7 +768,8 @@ static int __init load_builtin_regdb_keys(void)
        builtin_regdb_keys =
                keyring_alloc(".builtin_regdb_keys",
                              KUIDT_INIT(0), KGIDT_INIT(0), current_cred(),
-                             &internal_keyring_acl, 
+                             ((KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                             KEY_USR_VIEW | KEY_USR_READ | KEY_USR_SEARCH),
                              KEY_ALLOC_NOT_IN_QUOTA, NULL, NULL);
        if (IS_ERR(builtin_regdb_keys))
                return PTR_ERR(builtin_regdb_keys);
@@ -3804,8 +3806,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
 }
 
 /*
- * See http://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii, for
- * UNII band definitions
+ * See FCC notices for UNII band definitions
+ *  5GHz: https://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii
+ *  6GHz: https://www.fcc.gov/document/fcc-proposes-more-spectrum-unlicensed-use-0
  */
 int cfg80211_get_unii(int freq)
 {
@@ -3829,6 +3832,22 @@ int cfg80211_get_unii(int freq)
        if (freq > 5725 && freq <= 5825)
                return 4;
 
+       /* UNII-5 */
+       if (freq > 5925 && freq <= 6425)
+               return 5;
+
+       /* UNII-6 */
+       if (freq > 6425 && freq <= 6525)
+               return 6;
+
+       /* UNII-7 */
+       if (freq > 6525 && freq <= 6875)
+               return 7;
+
+       /* UNII-8 */
+       if (freq > 6875 && freq <= 7125)
+               return 8;
+
        return -EINVAL;
 }