コード例 #1
0
ファイル: HalHWImg8723A_MAC.c プロジェクト: Rumorbox33/wm8850
void
ODM_ReadAndConfig_MAC_REG_8723A(
 	IN   PDM_ODM_T  pDM_Odm
 	)
{
	u4Byte     hex         = 0;
	u4Byte     i           = 0;
	u1Byte     platform    = pDM_Odm->SupportPlatform;
	u1Byte     interface1Byte   = pDM_Odm->SupportInterface;
	u1Byte     board       = pDM_Odm->BoardType;  
	u4Byte     ArrayLen    = sizeof(Array_MAC_REG_8723A)/sizeof(u4Byte);
	pu4Byte    Array       = Array_MAC_REG_8723A;


	hex += board;
	hex += interface1Byte << 8;
	hex += platform << 16;
	hex += 0xFF000000;
	for (i = 0; i < ArrayLen; i += 2 )
	{
	    u4Byte v1 = Array[i];
	    u4Byte v2 = Array[i+1];
	
	    // This (offset, data) pair meets the condition.
	    if ( v1 < 0xCDCDCDCD )
	    {
	 		odm_ConfigMAC_8723A(pDM_Odm, v1, (u1Byte)v2);
		    continue;
	 	}
		else
		{ // This line is the start line of branch.
		    if ( !CheckCondition(Array[i], hex) )
		    { // Discard the following (offset, data) pairs.
		        i += 2;
		        v1 = Array[i];
		        v2 = Array[i+1];
		        while (v2 != 0xDEAD && 
	                   v2 != 0xCDEF && 
	                   v2 != 0xCDCD)
		        {
		            i += 2;
		            v1 = Array[i];
		            v2 = Array[i+1];
		        }
		    }
		}
	}

}
コード例 #2
0
void
ODM_ReadAndConfig_MAC_REG_8723A(
	PDM_ODM_T  pDM_Odm
	)
{
	#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)

	u32     hex         = 0;
	u32     i           = 0;
	u16     count       = 0;
	u32 *    ptr_array   = NULL;
	u8     platform    = pDM_Odm->SupportPlatform;
	u8     interfaceValue   = pDM_Odm->SupportInterface;
	u8     board       = pDM_Odm->BoardType;
	u32     ArrayLen    = sizeof(Array_MAC_REG_8723A)/sizeof(u32);
	u32 *    Array       = Array_MAC_REG_8723A;


	hex += board;
	hex += interfaceValue << 8;
	hex += platform << 16;
	hex += 0xFF000000;
	for (i = 0; i < ArrayLen; i += 2 )
	{
	    u32 v1 = Array[i];
	    u32 v2 = Array[i+1];

	    // This (offset, data) pair meets the condition.
	    if ( v1 < 0xCDCDCDCD )
	    {
			odm_ConfigMAC_8723A(pDM_Odm, v1, (u8)v2);
		    continue;
		}
		else
		{ // This line is the start line of branch.
		    if ( !CheckCondition(Array[i], hex) )
		    { // Discard the following (offset, data) pairs.
		        READ_NEXT_PAIR(v1, v2, i);
		        while (v2 != 0xDEAD &&
		               v2 != 0xCDEF &&
		               v2 != 0xCDCD && i < ArrayLen -2)
		        {
		            READ_NEXT_PAIR(v1, v2, i);
		        }
		        i -= 2; // prevent from for-loop += 2
		    }
		    else // Configure matched pairs and skip to end of if-else.
		    {
		        READ_NEXT_PAIR(v1, v2, i);
		        while (v2 != 0xDEAD &&
		               v2 != 0xCDEF &&
		               v2 != 0xCDCD && i < ArrayLen -2)
		        {
					odm_ConfigMAC_8723A(pDM_Odm, v1, (u8)v2);
		            READ_NEXT_PAIR(v1, v2, i);
		        }

		        while (v2 != 0xDEAD && i < ArrayLen -2)
		        {
		            READ_NEXT_PAIR(v1, v2, i);
		        }

		    }
		}
	}

}