53 #define RTL819x_2GHZ_CH01_11 \
54 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
60 #define RTL819x_2GHZ_CH12_13 \
61 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
62 NL80211_RRF_PASSIVE_SCAN)
64 #define RTL819x_2GHZ_CH14 \
65 REG_RULE(2484-10, 2484+10, 40, 0, 20, \
66 NL80211_RRF_PASSIVE_SCAN | \
70 #define RTL819x_5GHZ_5150_5350 \
71 REG_RULE(5150-10, 5350+10, 40, 0, 30, \
72 NL80211_RRF_PASSIVE_SCAN | \
76 #define RTL819x_5GHZ_5470_5850 \
77 REG_RULE(5470-10, 5850+10, 40, 0, 30, \
78 NL80211_RRF_PASSIVE_SCAN | \
82 #define RTL819x_5GHZ_5725_5850 \
83 REG_RULE(5725-10, 5850+10, 40, 0, 30, \
84 NL80211_RRF_PASSIVE_SCAN | \
87 #define RTL819x_5GHZ_ALL \
88 (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850)
148 static bool _rtl_is_radar_freq(
u16 center_freq)
150 return (center_freq >= 5260 && center_freq <= 5700);
153 static void _rtl_reg_apply_beaconing_flags(
struct wiphy *
wiphy,
166 if (!wiphy->
bands[band])
178 bandwidth, ®_rule);
207 static void _rtl_reg_apply_active_scan_flags(
struct wiphy *wiphy,
263 static void _rtl_reg_apply_radar_flags(
struct wiphy *wiphy)
297 static void _rtl_reg_apply_world_flags(
struct wiphy *wiphy,
301 _rtl_reg_apply_beaconing_flags(wiphy, initiator);
302 _rtl_reg_apply_active_scan_flags(wiphy, initiator);
306 static int _rtl_reg_notifier_apply(
struct wiphy *wiphy,
311 _rtl_reg_apply_radar_flags(wiphy);
319 _rtl_reg_apply_world_flags(wiphy, request->
initiator, reg);
331 return &rtl_regdom_no_midband;
333 return &rtl_regdom_11;
336 return &rtl_regdom_60_64;
341 return &rtl_regdom_12_13;
346 return &rtl_regdom_14_60_64;
348 return &rtl_regdom_14;
350 return &rtl_regdom_no_midband;
356 int (*reg_notifier) (
struct wiphy *wiphy,
368 regd = _rtl_regdomain_select(reg);
370 _rtl_reg_apply_radar_flags(wiphy);
379 for (i = 0; i <
ARRAY_SIZE(allCountries); i++) {
380 if (allCountries[i].countrycode == countrycode)
381 return &allCountries[
i];
387 int (*reg_notifier) (
struct wiphy *wiphy,
391 struct wiphy *wiphy = hw->
wiphy;
398 rtlpriv->
regd.country_code = rtlpriv->
efuse.channel_plan;
401 "rtl: EEPROM regdomain: 0x%0x\n", rtlpriv->
regd.country_code);
405 "rtl: EEPROM indicates invalid contry code, world wide 13 should be used\n");
410 country = _rtl_regd_find_country(rtlpriv->
regd.country_code);
416 rtlpriv->
regd.alpha2[0] =
'0';
417 rtlpriv->
regd.alpha2[1] =
'0';
421 "rtl: Country alpha2 being used: %c%c\n",
422 rtlpriv->
regd.alpha2[0], rtlpriv->
regd.alpha2[1]);
424 _rtl_regd_init_wiphy(&rtlpriv->
regd, wiphy, reg_notifier);
436 return _rtl_reg_notifier_apply(wiphy, request, &rtlpriv->
regd);