1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2017 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 *****************************************************************************/ 15 16 #ifndef __PHYDMACS_H__ 17 #define __PHYDMACS_H__ 18 19 #define ACS_VERSION "1.1" /*20150729 by YuChen*/ 20 #define CLM_VERSION "1.0" 21 22 #define ODM_MAX_CHANNEL_2G 14 23 #define ODM_MAX_CHANNEL_5G 24 24 25 /* For phydm_auto_channel_select_setting_ap() */ 26 #define STORE_DEFAULT_NHM_SETTING 0 27 #define RESTORE_DEFAULT_NHM_SETTING 1 28 #define ACS_NHM_SETTING 2 29 30 struct _ACS_ { 31 boolean is_force_acs_result; 32 u8 clean_channel_2g; 33 u8 clean_channel_5g; 34 u16 channel_info_2g[2][ODM_MAX_CHANNEL_2G]; /* Channel_Info[1]: channel score, Channel_Info[2]:Channel_Scan_Times */ 35 u16 channel_info_5g[2][ODM_MAX_CHANNEL_5G]; 36 37 #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 38 u8 acs_step; 39 /* NHM count 0-11 */ 40 u8 nhm_cnt[14][11]; 41 42 /* AC-Series, for storing previous setting */ 43 u32 reg0x990; 44 u32 reg0x994; 45 u32 reg0x998; 46 u32 reg0x99c; 47 u8 reg0x9a0; /* u8 */ 48 49 /* N-Series, for storing previous setting */ 50 u32 reg0x890; 51 u32 reg0x894; 52 u32 reg0x898; 53 u32 reg0x89c; 54 u8 reg0xe28; /* u8 */ 55 #endif 56 57 }; 58 59 60 void 61 odm_auto_channel_select_init( 62 void *p_dm_void 63 ); 64 65 void 66 odm_auto_channel_select_reset( 67 void *p_dm_void 68 ); 69 70 void 71 odm_auto_channel_select( 72 void *p_dm_void, 73 u8 channel 74 ); 75 76 u8 77 odm_get_auto_channel_select_result( 78 void *p_dm_void, 79 u8 band 80 ); 81 82 boolean 83 phydm_acs_check( 84 void *p_dm_void 85 ); 86 87 #if (DM_ODM_SUPPORT_TYPE & ODM_AP) 88 89 void 90 phydm_auto_channel_select_setting_ap( 91 void *p_dm_void, 92 u32 setting, /* 0: STORE_DEFAULT_NHM_SETTING; 1: RESTORE_DEFAULT_NHM_SETTING, 2: ACS_NHM_SETTING */ 93 u32 acs_step 94 ); 95 96 void 97 phydm_get_nhm_statistics_ap( 98 void *p_dm_void, 99 u32 idx, /* @ 2G, Real channel number = idx+1 */ 100 u32 acs_step 101 ); 102 103 #endif /* #if ( DM_ODM_SUPPORT_TYPE & ODM_AP ) */ 104 105 #endif /* #ifndef __PHYDMACS_H__ */ 106