⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bkcompat.c

📁 开发Inetl IXP2400平台所必须的硬件诊断和测试程序。该软件包支持的功能包括CPU基本功能检测
💻 C
📖 第 1 页 / 共 4 页
字号:
/*
 *---------------------------------------------------------------------------
 *                                                                      
 *                  I N T E L   P R O P R I E T A R Y                   
 *                                                                      
 *     COPYRIGHT (c)  2001 BY  INTEL  CORPORATION.  ALL RIGHTS          
 *     RESERVED.   NO  PART  OF THIS PROGRAM  OR  PUBLICATION  MAY      
 *     BE  REPRODUCED,   TRANSMITTED,   TRANSCRIBED,   STORED  IN  A    
 *     RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER    
 *     LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,    
 *     MAGNETIC,  OPTICAL,  CHEMICAL, MANUAL, OR OTHERWISE,  WITHOUT    
 *     THE PRIOR WRITTEN PERMISSION OF :                                
 *                                                                      
 *                        INTEL  CORPORATION                            
 *                                                                     
 *                     2200 MISSION COLLEGE BLVD                        
 *                                                                      
 *               SANTA  CLARA,  CALIFORNIA  95052-8119                  
 *                                                                      
 *---------------------------------------------------------------------------
 */ 

#include "common_types.h"
#include "common_def.h"
#include "ixf_api_d.h"
#include "ixf_api_sonet_d.h"
#include "ixf6048d.h"
#include "hal.h"
#include "ixf6048f.h"
#include "ixf6048b.h"
#include "type.h"

#define ixf6048_GET_NUMB_WINSZ_32BIT(RegAddr_M,RegAddr_L) \
		  ((ulong) ((ulong)(RegAddr_M << 16)) | \
				   ((ulong)(RegAddr_L)))

#define ixf6048_GET_CHANNEL_FROM_SECTION_PARAM(section)		((uchar) (section->group.channel & 0xf))

#define SWAPNTOHS(x)	((((x) & 0x00ff) << 8) | \
			 (((x) & 0xff00) >> 8))

extern UINT32 silicon_rev;

#if 0
/******************************************************************
* Function : Ixf6048GetStatus
*-----------------------------------------------------------------
* Description  : Gets the Status.
*-----------------------------------------------------------------
* Inputs  : pChipData : Initialized Chip Data
*           section   : Determines the section(block) to get the
*  						status from.
*           selStatus : Type of Status: 
* Outputs : pStatus	: place to put Status.
*-----------------------------------------------------------------
* Returns : Status
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : None.
******************************************************************/
bb_Error_e 
Ixf6048GetStatus(bb_ChipData_t* pChipData, bb_ChipSegment_t *section,
				bb_SelStatus_e selStatus, void* pStatus)
				
{
	return ixf6048_GetStatus(pChipData, section->group.channel,
                             selStatus, pStatus);
}

/******************************************************************
* Function : Ixf6048GetOpMode
*-----------------------------------------------------------------
* Description  : Gets the operation mode of the chip.
*-----------------------------------------------------------------
* Inputs  : pChipData : Initialized Chip Data
*           section   : Determines the section(block) to get the
*  						status from.
*           opMode    : The mode of operation.
* Outputs : pModeCfg  : Place to put mode.
*-----------------------------------------------------------------
* Returns : Stst
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : None.
******************************************************************/
bb_Error_e 
Ixf6048GetOpMode(bb_ChipData_t* pChipData, bb_ChipSegment_t *section,
				bb_OperMode_e *opMode, void* pModeCfg)

{
    return ixf6048_GetChanOpMode(pChipData, section->group.channel,
                                 pModeCfg);
}
#endif

/******************************************************************
* Function : Ixf6048GetTrace
*-----------------------------------------------------------------
* Description  : Gets the Rx J0/J1/J2 Trace
*-----------------------------------------------------------------
* Inputs  : pChipData : Initialized Chip Data
*				section : Determines the section(block) to get the trace
*  						from.
*				TraceType : Type of Trace: Rx J0/J1/J2 for system and
*								line side.
* Outputs : pTrace	: place to return Rx Trace String.
*           pLength : The length of pTrace.
*-----------------------------------------------------------------
* Returns : 
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : Note: at least 65 bytes long for pTrace
******************************************************************/
bb_Error_e 
Ixf6048GetTrace(bb_ChipData_t* pChipData, bb_ChipSegment_t *section,
			   bb_TraceType_e TraceType, char* pTrace, ushort* pLength)
{
    return ixf6048_GetTrace(pChipData, section->group.channel,
                            TraceType, pTrace, pLength);
}

/******************************************************************
* Function : Ixf6048SetTrace
*-----------------------------------------------------------------
* Description  : Set Expected/Tx J0/J1 Trace
*-----------------------------------------------------------------
* Inputs  : pChipData : Initialized Chip Data
*			section : Determines the section(block) to get the trace
*  						from.
*			TraceType : Type of Trace: Expected/Tx J0/J1 for system
*						or line side.
*			TraceFormat : Specifies the Trace Format
*			pTrace	: null-terminated Trace String (data only)
*                     Driver adds CRC7, or LF/CR, if needed
* Outputs : None.
*-----------------------------------------------------------------
* Returns : 
*    Sets the new Trace String in the Associated Storage Structure 
*    Sets the new TraceFormat in the Associated Storage Structure
*    Error Condition if Unsuccessful
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : 
*   The bb_TraceType_e value for  
*          bb_RX_J0 and bb_RX_J1
*   must be Set to "Ignore Jn Trace (No Trace)". 
*   This Condition is Forced in this Function.
*    --> see R_Jn_ESTRA Registers
******************************************************************/
bb_Error_e 
Ixf6048SetTrace(bb_ChipData_t* pChipData, bb_ChipSegment_t *section, 
			   bb_TraceType_e TraceType, bb_TraceFormat_e TraceFormat,
			   char* pTrace)
{
    return ixf6048_SetTrace(pChipData, section->group.channel,
                            TraceType, TraceFormat, pTrace);
}

#if 0
/******************************************************************
* Function : Ixf6048GetCounters
*-----------------------------------------------------------------
* Description  : Retrieve a set of Counters
*-----------------------------------------------------------------
* Inputs  : pChipData : Validated Chip Data
*			section :	Determines the section(block) to get the
*						counters from.
*			SelCounters :  Selects the set of counters
* Outputs : pCounters : Place to put Counters
*-----------------------------------------------------------------
* Returns : 
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : 
******************************************************************/
bb_Error_e 
Ixf6048GetCounters(bb_ChipData_t* pChipData, bb_ChipSegment_t *section,
				  bb_SelCounters_e SelCounters, void* pCounters)
{
    return ixf6048_GetCounters(pChipData, section->group.channel,
                               SelCounters, pCounters);
}

/******************************************************************
* Function : Ixf6048InitAlarmCallback
*-----------------------------------------------------------------
* Description  : Initialize the Driver
*-----------------------------------------------------------------
* Inputs  : pChipData : Validated Chip Data
*				pAlarmCallback : Alarm Callback
* Outputs : None.
*-----------------------------------------------------------------
* Returns : 
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : 
******************************************************************/
bb_Error_e 
Ixf6048InitAlarmCallback(bb_ChipData_t* pChipData, void* pAlarmCallbackArg)
{
    return ixf6048_InitAlarmCallback((ixf6048_pAlarmCallback) pAlarmCallbackArg); 
}

/******************************************************************
* Function : Ixf6048ChipIsr
*-----------------------------------------------------------------
* Description  : Handle Interupts for Chip
*-----------------------------------------------------------------
* Inputs  : pChipData : Validated Chip Data
* Outputs : None.
*-----------------------------------------------------------------
* Returns : None.
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments:   Interrupts are reported through a Callback function.
*
*	 Transmit and receive Interrupts act independantly of each another.
*
*   Interrupts have been prioritized to be handled according to the severity 
*   of the effecting interupt. See the MasterInterruptHandler function for 
*	 specifics
******************************************************************/
void 
Ixf6048ChipIsr(bb_ChipData_t* pChipData)
{
    ixf6048_ChipIsr(pChipData);
}

/******************************************************************
* Function : Ixf6048GetChipInfo
*-----------------------------------------------------------------
* Description  : Get the chip information.
*-----------------------------------------------------------------
* Inputs  : pChipData : Validated Chip Data
* Outputs : pChipInfo : Place to return chip info
*-----------------------------------------------------------------
* Returns : 
*-----------------------------------------------------------------
* Access Globals : None.
*-----------------------------------------------------------------
* Comments : 
******************************************************************/
bb_Error_e 
Ixf6048GetChipInfo(bb_ChipData_t* pChipData, bb_ChipInfo_t* pChipInfo)
{
    ixf6048_ChipInfo_t tempChipInfo;
    bb_Error_e rc;
 
    /* Call Device Specific Driver */ 
    rc = ixf6048_GetChipInfo(pChipData, &tempChipInfo);

    pChipInfo->ChipVersion = tempChipInfo.ChipVersion;
    pChipInfo->ChipId = (ushort) tempChipInfo.ChipId;

    return rc;
}

/******************************************************************
* Function : Ixf6048SetChipOnline
*-----------------------------------------------------------------
* Description  : Puts some or all of the chip online.
*-----------------------------------------------------------------
* Inputs  : pChipData : Validated Chip Data
*				section	 :	Specifies which portion of the chip to 
*								put online.
Outputs : None.
*-----------------------------------------------------------------
* Returns : 
*-----------------------------------------------------------------
* Access Globals : None. 
*-----------------------------------------------------------------
* Comments : 
******************************************************************/
bb_Error_e 
Ixf6048SetChipOnline(bb_ChipData_t* pChipData, bb_ChipSegment_t *section)
{
    ixf6048_SetChipOnline(pChipData);
    return bb_NO_ERROR;
}

/******************************************************************
* Function : Ixf6048SetChipOffline
*-----------------------------------------------------------------
* Description  : Takes some or all of the chip offline.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -