1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
21 #include "odm_precomp.h"
23 #if (RTL8723A_SUPPORT == 1)
26 const u4Byte Condition,
30 u4Byte _board = (Hex & 0x000000FF);
31 u4Byte _interface = (Hex & 0x0000FF00) >> 8;
32 u4Byte _platform = (Hex & 0x00FF0000) >> 16;
33 u4Byte cond = Condition;
35 if ( Condition == 0xCDCDCDCD )
38 cond = Condition & 0x000000FF;
39 if ( (_board == cond) && cond != 0x00)
42 cond = Condition & 0x0000FF00;
44 if ( (_interface & cond) == 0 && cond != 0x07)
47 cond = Condition & 0x00FF0000;
49 if ( (_platform & cond) == 0 && cond != 0x0F)
55 /******************************************************************************
57 ******************************************************************************/
59 u4Byte Array_RadioA_1T_8723A[] = {
220 ODM_ReadAndConfig_RadioA_1T_8723A(
224 #define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
229 pu4Byte ptr_array = NULL;
230 u1Byte platform = pDM_Odm->SupportPlatform;
231 u1Byte interfaceValue = pDM_Odm->SupportInterface;
232 u1Byte board = pDM_Odm->BoardType;
233 u4Byte ArrayLen = sizeof(Array_RadioA_1T_8723A)/sizeof(u4Byte);
234 pu4Byte Array = Array_RadioA_1T_8723A;
238 hex += interfaceValue << 8;
239 hex += platform << 16;
242 for (i = 0; i < ArrayLen; i += 2 )
244 u4Byte v1 = Array[i];
245 u4Byte v2 = Array[i+1];
247 // This (offset, data) pair meets the condition.
248 if ( v1 < 0xCDCDCDCD )
250 odm_ConfigRF_RadioA_8723A(pDM_Odm, v1, v2);
254 { // This line is the start line of branch.
255 if ( !CheckCondition(Array[i], hex) )
256 { // Discard the following (offset, data) pairs.
257 READ_NEXT_PAIR(v1, v2, i);
258 while (v2 != 0xDEAD &&
260 v2 != 0xCDCD && i < ArrayLen -2)
262 READ_NEXT_PAIR(v1, v2, i);
264 i -= 2; // prevent from for-loop += 2
266 else // Configure matched pairs and skip to end of if-else.
268 READ_NEXT_PAIR(v1, v2, i);
269 while (v2 != 0xDEAD &&
271 v2 != 0xCDCD && i < ArrayLen -2)
273 odm_ConfigRF_RadioA_8723A(pDM_Odm, v1, v2);
274 READ_NEXT_PAIR(v1, v2, i);
277 while (v2 != 0xDEAD && i < ArrayLen -2)
279 READ_NEXT_PAIR(v1, v2, i);
289 #endif // end of HWIMG_SUPPORT