regd.c (3c3d7cb1db4af176dab843f22ea092a4ef1eb989) regd.c (ef8c00174a8738ea334197c0164143354644cb16)
1/*
2 * Copyright (c) 2008-2009 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 208 unchanged lines hidden (view full) ---

217{
218 /* this is the most restrictive */
219 return &ath_world_regdom_64;
220}
221
222static const struct
223ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
224{
1/*
2 * Copyright (c) 2008-2009 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 208 unchanged lines hidden (view full) ---

217{
218 /* this is the most restrictive */
219 return &ath_world_regdom_64;
220}
221
222static const struct
223ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
224{
225 switch (reg->regpair->regDmnEnum) {
225 switch (reg->regpair->reg_domain) {
226 case 0x60:
227 case 0x61:
228 case 0x62:
229 return &ath_world_regdom_60_61_62;
230 case 0x63:
231 case 0x65:
232 return &ath_world_regdom_63_65;
233 case 0x64:

--- 192 unchanged lines hidden (view full) ---

426 IEEE80211_CHAN_NO_IR;
427 }
428}
429
430static void ath_reg_apply_world_flags(struct wiphy *wiphy,
431 enum nl80211_reg_initiator initiator,
432 struct ath_regulatory *reg)
433{
226 case 0x60:
227 case 0x61:
228 case 0x62:
229 return &ath_world_regdom_60_61_62;
230 case 0x63:
231 case 0x65:
232 return &ath_world_regdom_63_65;
233 case 0x64:

--- 192 unchanged lines hidden (view full) ---

426 IEEE80211_CHAN_NO_IR;
427 }
428}
429
430static void ath_reg_apply_world_flags(struct wiphy *wiphy,
431 enum nl80211_reg_initiator initiator,
432 struct ath_regulatory *reg)
433{
434 switch (reg->regpair->regDmnEnum) {
434 switch (reg->regpair->reg_domain) {
435 case 0x60:
436 case 0x63:
437 case 0x66:
438 case 0x67:
439 case 0x6C:
440 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
441 break;
442 case 0x68:

--- 112 unchanged lines hidden (view full) ---

555 if (allCountries[i].countryCode == cc)
556 return true;
557 } else {
558 /* EEPROM value is a regpair value */
559 if (rd != CTRY_DEFAULT)
560 printk(KERN_DEBUG "ath: EEPROM indicates we "
561 "should expect a direct regpair map\n");
562 for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++)
435 case 0x60:
436 case 0x63:
437 case 0x66:
438 case 0x67:
439 case 0x6C:
440 ath_reg_apply_beaconing_flags(wiphy, reg, initiator);
441 break;
442 case 0x68:

--- 112 unchanged lines hidden (view full) ---

555 if (allCountries[i].countryCode == cc)
556 return true;
557 } else {
558 /* EEPROM value is a regpair value */
559 if (rd != CTRY_DEFAULT)
560 printk(KERN_DEBUG "ath: EEPROM indicates we "
561 "should expect a direct regpair map\n");
562 for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++)
563 if (regDomainPairs[i].regDmnEnum == rd)
563 if (regDomainPairs[i].reg_domain == rd)
564 return true;
565 }
566 printk(KERN_DEBUG
567 "ath: invalid regulatory domain/country code 0x%x\n", rd);
568 return false;
569}
570
571/* EEPROM country code to regpair mapping */

--- 40 unchanged lines hidden (view full) ---

612static struct reg_dmn_pair_mapping*
613ath_get_regpair(int regdmn)
614{
615 int i;
616
617 if (regdmn == NO_ENUMRD)
618 return NULL;
619 for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++) {
564 return true;
565 }
566 printk(KERN_DEBUG
567 "ath: invalid regulatory domain/country code 0x%x\n", rd);
568 return false;
569}
570
571/* EEPROM country code to regpair mapping */

--- 40 unchanged lines hidden (view full) ---

612static struct reg_dmn_pair_mapping*
613ath_get_regpair(int regdmn)
614{
615 int i;
616
617 if (regdmn == NO_ENUMRD)
618 return NULL;
619 for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++) {
620 if (regDomainPairs[i].regDmnEnum == regdmn)
620 if (regDomainPairs[i].reg_domain == regdmn)
621 return &regDomainPairs[i];
622 }
623 return NULL;
624}
625
626static int
627ath_regd_init_wiphy(struct ath_regulatory *reg,
628 struct wiphy *wiphy,

--- 107 unchanged lines hidden (view full) ---

736 } else {
737 reg->alpha2[0] = '0';
738 reg->alpha2[1] = '0';
739 }
740
741 printk(KERN_DEBUG "ath: Country alpha2 being used: %c%c\n",
742 reg->alpha2[0], reg->alpha2[1]);
743 printk(KERN_DEBUG "ath: Regpair used: 0x%0x\n",
621 return &regDomainPairs[i];
622 }
623 return NULL;
624}
625
626static int
627ath_regd_init_wiphy(struct ath_regulatory *reg,
628 struct wiphy *wiphy,

--- 107 unchanged lines hidden (view full) ---

736 } else {
737 reg->alpha2[0] = '0';
738 reg->alpha2[1] = '0';
739 }
740
741 printk(KERN_DEBUG "ath: Country alpha2 being used: %c%c\n",
742 reg->alpha2[0], reg->alpha2[1]);
743 printk(KERN_DEBUG "ath: Regpair used: 0x%0x\n",
744 reg->regpair->regDmnEnum);
744 reg->regpair->reg_domain);
745
746 return 0;
747}
748
749int
750ath_regd_init(struct ath_regulatory *reg,
751 struct wiphy *wiphy,
752 void (*reg_notifier)(struct wiphy *wiphy,

--- 39 unchanged lines hidden ---
745
746 return 0;
747}
748
749int
750ath_regd_init(struct ath_regulatory *reg,
751 struct wiphy *wiphy,
752 void (*reg_notifier)(struct wiphy *wiphy,

--- 39 unchanged lines hidden ---