1e3037485SYan-Hsuan Chuang /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2e3037485SYan-Hsuan Chuang /* Copyright(c) 2018-2019 Realtek Corporation 3e3037485SYan-Hsuan Chuang */ 4e3037485SYan-Hsuan Chuang 5e3037485SYan-Hsuan Chuang #ifndef __RTW_REGD_H_ 6e3037485SYan-Hsuan Chuang #define __RTW_REGD_H_ 7e3037485SYan-Hsuan Chuang 8e3037485SYan-Hsuan Chuang #define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR 9e3037485SYan-Hsuan Chuang #define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR 10e3037485SYan-Hsuan Chuang enum rtw_chplan_id { 11191c4257SZong-Zhe Yang RTW_CHPLAN_ETSI1_NULL = 0x21, 12e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI1 = 0x26, 13e3037485SYan-Hsuan Chuang RTW_CHPLAN_MKK1_MKK1 = 0x27, 14e3037485SYan-Hsuan Chuang RTW_CHPLAN_IC1_IC2 = 0x2B, 15e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_CHILE1 = 0x2D, 16e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_FCC3 = 0x30, 17e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_FCC5 = 0x32, 18e3037485SYan-Hsuan Chuang RTW_CHPLAN_FCC1_FCC7 = 0x34, 19191c4257SZong-Zhe Yang RTW_CHPLAN_WORLD_ETSI2 = 0x35, 20e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI3 = 0x36, 21e3037485SYan-Hsuan Chuang RTW_CHPLAN_ETSI1_ETSI12 = 0x3D, 22e3037485SYan-Hsuan Chuang RTW_CHPLAN_KCC1_KCC2 = 0x3E, 23e3037485SYan-Hsuan Chuang RTW_CHPLAN_ETSI1_ETSI4 = 0x42, 24e3037485SYan-Hsuan Chuang RTW_CHPLAN_FCC1_NCC3 = 0x44, 25e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ACMA1 = 0x45, 26e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI6 = 0x47, 27e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI7 = 0x48, 28e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI8 = 0x49, 29191c4257SZong-Zhe Yang RTW_CHPLAN_KCC1_KCC3 = 0x4B, 30e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI10 = 0x51, 31e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI14 = 0x59, 32e3037485SYan-Hsuan Chuang RTW_CHPLAN_FCC2_FCC7 = 0x61, 33e3037485SYan-Hsuan Chuang RTW_CHPLAN_FCC2_FCC1 = 0x62, 34191c4257SZong-Zhe Yang RTW_CHPLAN_WORLD_ETSI15 = 0x63, 35e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_FCC7 = 0x73, 36e3037485SYan-Hsuan Chuang RTW_CHPLAN_FCC2_FCC17 = 0x74, 37e3037485SYan-Hsuan Chuang RTW_CHPLAN_WORLD_ETSI20 = 0x75, 38e3037485SYan-Hsuan Chuang RTW_CHPLAN_FCC2_FCC11 = 0x76, 39e3037485SYan-Hsuan Chuang RTW_CHPLAN_REALTEK_DEFINE = 0x7f, 40e3037485SYan-Hsuan Chuang }; 41e3037485SYan-Hsuan Chuang 42e3037485SYan-Hsuan Chuang struct country_code_to_enum_rd { 43e3037485SYan-Hsuan Chuang u16 countrycode; 44e3037485SYan-Hsuan Chuang const char *iso_name; 45e3037485SYan-Hsuan Chuang }; 46e3037485SYan-Hsuan Chuang 47e3037485SYan-Hsuan Chuang enum country_code_type { 48e3037485SYan-Hsuan Chuang COUNTRY_CODE_FCC = 0, 49e3037485SYan-Hsuan Chuang COUNTRY_CODE_IC = 1, 50e3037485SYan-Hsuan Chuang COUNTRY_CODE_ETSI = 2, 51e3037485SYan-Hsuan Chuang COUNTRY_CODE_SPAIN = 3, 52e3037485SYan-Hsuan Chuang COUNTRY_CODE_FRANCE = 4, 53e3037485SYan-Hsuan Chuang COUNTRY_CODE_MKK = 5, 54e3037485SYan-Hsuan Chuang COUNTRY_CODE_MKK1 = 6, 55e3037485SYan-Hsuan Chuang COUNTRY_CODE_ISRAEL = 7, 56e3037485SYan-Hsuan Chuang COUNTRY_CODE_TELEC = 8, 57e3037485SYan-Hsuan Chuang COUNTRY_CODE_MIC = 9, 58e3037485SYan-Hsuan Chuang COUNTRY_CODE_GLOBAL_DOMAIN = 10, 59e3037485SYan-Hsuan Chuang COUNTRY_CODE_WORLD_WIDE_13 = 11, 60e3037485SYan-Hsuan Chuang COUNTRY_CODE_TELEC_NETGEAR = 12, 61e3037485SYan-Hsuan Chuang COUNTRY_CODE_WORLD_WIDE_13_5G_ALL = 13, 62e3037485SYan-Hsuan Chuang 63e3037485SYan-Hsuan Chuang /* new channel plan above this */ 64e3037485SYan-Hsuan Chuang COUNTRY_CODE_MAX 65e3037485SYan-Hsuan Chuang }; 66e3037485SYan-Hsuan Chuang 678d4fb399SZong-Zhe Yang int rtw_regd_init(struct rtw_dev *rtwdev); 688d4fb399SZong-Zhe Yang int rtw_regd_hint(struct rtw_dev *rtwdev); 69f8509c38SZong-Zhe Yang u8 rtw_regd_get(struct rtw_dev *rtwdev); 70f8509c38SZong-Zhe Yang bool rtw_regd_has_alt(u8 regd, u8 *regd_alt); 71*14a5b115SZong-Zhe Yang bool rtw_regd_srrc(struct rtw_dev *rtwdev); 72*14a5b115SZong-Zhe Yang 73e3037485SYan-Hsuan Chuang #endif 74