forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/realtek/rtlwifi/regd.c
....@@ -1,32 +1,10 @@
1
-/******************************************************************************
2
- *
3
- * Copyright(c) 2009-2012 Realtek Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of version 2 of the GNU General Public License as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * The full GNU General Public License is included in this distribution in the
15
- * file called LICENSE.
16
- *
17
- * Contact Information:
18
- * wlanfae <wlanfae@realtek.com>
19
- * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20
- * Hsinchu 300, Taiwan.
21
- *
22
- * Larry Finger <Larry.Finger@lwfinger.net>
23
- *
24
- *****************************************************************************/
1
+// SPDX-License-Identifier: GPL-2.0
2
+/* Copyright(c) 2009-2012 Realtek Corporation.*/
253
264 #include "wifi.h"
275 #include "regd.h"
286
29
-static struct country_code_to_enum_rd allCountries[] = {
7
+static struct country_code_to_enum_rd all_countries[] = {
308 {COUNTRY_CODE_FCC, "US"},
319 {COUNTRY_CODE_IC, "US"},
3210 {COUNTRY_CODE_ETSI, "EC"},
....@@ -62,7 +40,6 @@
6240 REG_RULE(2484-10, 2484+10, 40, 0, 20, \
6341 NL80211_RRF_PASSIVE_SCAN | \
6442 NL80211_RRF_NO_OFDM)
65
-
6643
6744 /* 5G chan 36 - chan 64*/
6845 #define RTL819x_5GHZ_5150_5350 \
....@@ -299,22 +276,6 @@
299276 return;
300277 }
301278
302
-static void _rtl_dump_channel_map(struct wiphy *wiphy)
303
-{
304
- enum nl80211_band band;
305
- struct ieee80211_supported_band *sband;
306
- struct ieee80211_channel *ch;
307
- unsigned int i;
308
-
309
- for (band = 0; band < NUM_NL80211_BANDS; band++) {
310
- if (!wiphy->bands[band])
311
- continue;
312
- sband = wiphy->bands[band];
313
- for (i = 0; i < sband->n_channels; i++)
314
- ch = &sband->channels[i];
315
- }
316
-}
317
-
318279 static int _rtl_reg_notifier_apply(struct wiphy *wiphy,
319280 struct regulatory_request *request,
320281 struct rtl_regulatory *reg)
....@@ -331,8 +292,6 @@
331292 _rtl_reg_apply_world_flags(wiphy, request->initiator, reg);
332293 break;
333294 }
334
-
335
- _rtl_dump_channel_map(wiphy);
336295
337296 return 0;
338297 }
....@@ -391,9 +350,9 @@
391350 {
392351 int i;
393352
394
- for (i = 0; i < ARRAY_SIZE(allCountries); i++) {
395
- if (allCountries[i].countrycode == countrycode)
396
- return &allCountries[i];
353
+ for (i = 0; i < ARRAY_SIZE(all_countries); i++) {
354
+ if (all_countries[i].countrycode == countrycode)
355
+ return &all_countries[i];
397356 }
398357 return NULL;
399358 }
....@@ -434,13 +393,13 @@
434393 rtlpriv->regd.country_code =
435394 channel_plan_to_country_code(rtlpriv->efuse.channel_plan);
436395
437
- RT_TRACE(rtlpriv, COMP_REGD, DBG_DMESG,
438
- "rtl: EEPROM regdomain: 0x%0x country code: %d\n",
439
- rtlpriv->efuse.channel_plan, rtlpriv->regd.country_code);
396
+ rtl_dbg(rtlpriv, COMP_REGD, DBG_DMESG,
397
+ "rtl: EEPROM regdomain: 0x%0x country code: %d\n",
398
+ rtlpriv->efuse.channel_plan, rtlpriv->regd.country_code);
440399
441400 if (rtlpriv->regd.country_code >= COUNTRY_CODE_MAX) {
442
- RT_TRACE(rtlpriv, COMP_REGD, DBG_DMESG,
443
- "rtl: EEPROM indicates invalid country code, world wide 13 should be used\n");
401
+ rtl_dbg(rtlpriv, COMP_REGD, DBG_DMESG,
402
+ "rtl: EEPROM indicates invalid country code, world wide 13 should be used\n");
444403
445404 rtlpriv->regd.country_code = COUNTRY_CODE_WORLD_WIDE_13;
446405 }
....@@ -455,9 +414,9 @@
455414 rtlpriv->regd.alpha2[1] = '0';
456415 }
457416
458
- RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE,
459
- "rtl: Country alpha2 being used: %c%c\n",
460
- rtlpriv->regd.alpha2[0], rtlpriv->regd.alpha2[1]);
417
+ rtl_dbg(rtlpriv, COMP_REGD, DBG_TRACE,
418
+ "rtl: Country alpha2 being used: %c%c\n",
419
+ rtlpriv->regd.alpha2[0], rtlpriv->regd.alpha2[1]);
461420
462421 _rtl_regd_init_wiphy(&rtlpriv->regd, wiphy, reg_notifier);
463422
....@@ -469,7 +428,7 @@
469428 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
470429 struct rtl_priv *rtlpriv = rtl_priv(hw);
471430
472
- RT_TRACE(rtlpriv, COMP_REGD, DBG_LOUD, "\n");
431
+ rtl_dbg(rtlpriv, COMP_REGD, DBG_LOUD, "\n");
473432
474433 _rtl_reg_notifier_apply(wiphy, request, &rtlpriv->regd);
475434 }