Path: blob/master/ALFA-W1F1/RTL8814AU/core/rtw_chplan.h
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2018 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13*****************************************************************************/14#ifndef __RTW_CHPLAN_H__15#define __RTW_CHPLAN_H__1617enum rtw_chplan_id {18/* ===== 0x00 ~ 0x1F, legacy channel plan ===== */19RTW_CHPLAN_FCC = 0x00,20RTW_CHPLAN_IC = 0x01,21RTW_CHPLAN_ETSI = 0x02,22RTW_CHPLAN_SPAIN = 0x03,23RTW_CHPLAN_FRANCE = 0x04,24RTW_CHPLAN_MKK = 0x05,25RTW_CHPLAN_MKK1 = 0x06,26RTW_CHPLAN_ISRAEL = 0x07,27RTW_CHPLAN_TELEC = 0x08,28RTW_CHPLAN_GLOBAL_DOAMIN = 0x09,29RTW_CHPLAN_WORLD_WIDE_13 = 0x0A,30RTW_CHPLAN_TAIWAN = 0x0B,31RTW_CHPLAN_CHINA = 0x0C,32RTW_CHPLAN_SINGAPORE_INDIA_MEXICO = 0x0D,33RTW_CHPLAN_KOREA = 0x0E,34RTW_CHPLAN_TURKEY = 0x0F,35RTW_CHPLAN_JAPAN = 0x10,36RTW_CHPLAN_FCC_NO_DFS = 0x11,37RTW_CHPLAN_JAPAN_NO_DFS = 0x12,38RTW_CHPLAN_WORLD_WIDE_5G = 0x13,39RTW_CHPLAN_TAIWAN_NO_DFS = 0x14,4041/* ===== 0x20 ~ 0x7F, new channel plan ===== */42RTW_CHPLAN_WORLD_NULL = 0x20,43RTW_CHPLAN_ETSI1_NULL = 0x21,44RTW_CHPLAN_FCC1_NULL = 0x22,45RTW_CHPLAN_MKK1_NULL = 0x23,46RTW_CHPLAN_ETSI2_NULL =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D_ETSI7 = 0x48,83RTW_CHPLAN_WORLD_ETSI8 = 0x49,84RTW_CHPLAN_IC2_IC2 = 0x4A,85RTW_CHPLAN_KCC1_KCC3 = 0x4B,86RTW_CHPLAN_FCC1_FCC15 = 0x4C,87RTW_CHPLAN_FCC2_MEX1 = 0x4D,88RTW_CHPLAN_ETSI1_ETSI22 = 0x4E,89RTW_CHPLAN_WORLD_ETSI9 = 0x50,90RTW_CHPLAN_WORLD_ETSI10 = 0x51,91RTW_CHPLAN_WORLD_ETSI11 = 0x52,92RTW_CHPLAN_FCC1_NCC4 = 0x53,93RTW_CHPLAN_WORLD_ETSI12 = 0x54,94RTW_CHPLAN_FCC1_FCC9 = 0x55,95RTW_CHPLAN_WORLD_ETSI13 = 0x56,96RTW_CHPLAN_FCC1_FCC10 = 0x57,97RTW_CHPLAN_MKK2_MKK4 = 0x58,98RTW_CHPLAN_WORLD_ETSI14 = 0x59,99RTW_CHPLAN_FCC1_FCC5 = 0x60,100RTW_CHPLAN_FCC2_FCC7 = 0x61,101RTW_CHPLAN_FCC2_FCC1 = 0x62,102RTW_CHPLAN_WORLD_ETSI15 = 0x63,103RTW_CHPLAN_MKK2_MKK5 = 0x64,104RTW_CHPLAN_ETSI1_ETSI16 = 0x65,105RTW_CHPLAN_FCC1_FCC14 = 0x66,106RTW_CHPLAN_FCC1_FCC12 = 0x67,107RTW_CHPLAN_FCC2_FCC14 = 0x68,108RTW_CHPLAN_FCC2_FCC12 = 0x69,109RTW_CHPLAN_ETSI1_ETSI17 = 0x6A,110RTW_CHPLAN_WORLD_FCC16 = 0x6B,111RTW_CHPLAN_WORLD_FCC13 = 0x6C,112RTW_CHPLAN_FCC2_FCC15 = 0x6D,113RTW_CHPLAN_WORLD_FCC12 = 0x6E,114RTW_CHPLAN_NULL_ETSI8 = 0x6F,115RTW_CHPLAN_NULL_ETSI18 = 0x70,116RTW_CHPLAN_NULL_ETSI17 = 0x71,117RTW_CHPLAN_NULL_ETSI19 = 0x72,118RTW_CHPLAN_WORLD_FCC7 = 0x73,119RTW_CHPLAN_FCC2_FCC17 = 0x74,120RTW_CHPLAN_WORLD_ETSI20 = 0x75,121RTW_CHPLAN_FCC2_FCC11 = 0x76,122RTW_CHPLAN_WORLD_ETSI21 = 0x77,123RTW_CHPLAN_FCC1_FCC18 = 0x78,124RTW_CHPLAN_MKK2_MKK1 = 0x79,125126RTW_CHPLAN_MAX,127RTW_CHPLAN_REALTEK_DEFINE = 0x7F,128RTW_CHPLAN_UNSPECIFIED = 0xFF,129};130131u8 rtw_chplan_get_default_regd(u8 id);132bool rtw_chplan_is_empty(u8 id);133#define rtw_is_channel_plan_valid(chplan) (((chplan) < RTW_CHPLAN_MAX || (chplan) == RTW_CHPLAN_REALTEK_DEFINE) && !rtw_chplan_is_empty(chplan))134#define rtw_is_legacy_channel_plan(chplan) ((chplan) < 0x20)135136struct _RT_CHANNEL_INFO;137u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, struct _RT_CHANNEL_INFO *channel_set);138139#define IS_ALPHA2_NO_SPECIFIED(_alpha2) ((*((u16 *)(_alpha2))) == 0xFFFF)140141#define RTW_MODULE_RTL8821AE_HMC_M2 BIT0 /* RTL8821AE(HMC + M.2) */142#define RTW_MODULE_RTL8821AU BIT1 /* RTL8821AU */143#define RTW_MODULE_RTL8812AENF_NGFF BIT2 /* RTL8812AENF(8812AE+8761)_NGFF */144#define RTW_MODULE_RTL8812AEBT_HMC BIT3 /* RTL8812AEBT(8812AE+8761)_HMC */145#define RTW_MODULE_RTL8188EE_HMC_M2 BIT4 /* RTL8188EE(HMC + M.2) */146#define RTW_MODULE_RTL8723BE_HMC_M2 BIT5 /* RTL8723BE(HMC + M.2) */147#define RTW_MODULE_RTL8723BS_NGFF1216 BIT6 /* RTL8723BS(NGFF1216) */148#define RTW_MODULE_RTL8192EEBT_HMC_M2 BIT7 /* RTL8192EEBT(8192EE+8761AU)_(HMC + M.2) */149#define RTW_MODULE_RTL8723DE_NGFF1630 BIT8 /* RTL8723DE(NGFF1630) */150#define RTW_MODULE_RTL8822BE BIT9 /* RTL8822BE */151#define RTW_MODULE_RTL8821CE BIT10 /* RTL8821CE */152153struct country_chplan {154char alpha2[2];155u8 chplan;156#ifdef CONFIG_80211AC_VHT157u8 en_11ac;158#endif159#if RTW_DEF_MODULE_REGULATORY_CERT160u16 def_module_flags; /* RTW_MODULE_RTLXXX */161#endif162};163164#ifdef CONFIG_80211AC_VHT165#define COUNTRY_CHPLAN_EN_11AC(_ent) ((_ent)->en_11ac)166#else167#define COUNTRY_CHPLAN_EN_11AC(_ent) 0168#endif169170#if RTW_DEF_MODULE_REGULATORY_CERT171#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) ((_ent)->def_module_flags)172#else173#define COUNTRY_CHPLAN_DEF_MODULE_FALGS(_ent) 0174#endif175176const struct country_chplan *rtw_get_chplan_from_country(const char *country_code);177178void dump_country_chplan(void *sel, const struct country_chplan *ent);179void dump_country_chplan_map(void *sel);180void dump_chplan_id_list(void *sel);181void dump_chplan_test(void *sel);182void dump_chplan_ver(void *sel);183184#endif /* __RTW_CHPLAN_H__ */185186187