📄 driverif.c
字号:
/*---------------------------------------------------------------------
*
* DriverIf.c - MPC8270 generic library for 39 series esthernet switch
* Copyright 2003-2006 ZTE, Inc.
* 2004-6-29 created by zhouyuhui
-----------------------------------------------------------------------
*/
#include <vxWorks.h>
#include "driverif.h"
#include "vxWorks.h"
#include "5906lib.h"
#include "meclib.h"
#if defined(PRJ_BUILD)
#include "ros_ex.h"
#include "rackinfo.h"
#endif
/*#ifdef UINT8
#undef UINT8
#endif
#define UINT8 unsigned char*/
extern void sysMsDelay(UINT32);
/*extern UINT32 Switch59Type;*/
/*hongtao:2006-7-20:GPON方案和5952的一样,都是双BCM56504堆叠,modify BEGIN*/
#if 0
UINT32 Switch59Type = 1;
#else
extern UINT32 Switch59Type;/*hongtao:2006-11-16:modify from UINT32 Switch59Type = 5952;放到统一 文件中存放,方便根据项目来修改*/
#endif
/*hongtao:2006-7-20:modify END*/
/*-------------------------
not used just for compile
--------------------------*/
/*lint -e129*/
/*lint -e19*/
IfCardAttTable *tableAttPtr;
/*lint +e129*/
/*lint +e19*/
int ifCardNumCnt;
STATUS b_ifCardHardInit()
{
return OK;
}
void b_tableAttPtrInit()
{
}
/*-----------------------------------------------------
system control interfaces of 59 project
these functions used to fill switch shelf map
writed by chenyibao
2005-11-17
changed by sun bei 2006-1-16
------------------------------------------------------*/
/**********************************
(type2~0=111,no online;
=00x,wan-xfp;
=01x, lan-xfp;
=100, cx4;
=101, cx4-drive;
=110,reserve)
ro
id2_type2->bit0(msb)
id2_type1->bit1
id2_type0->bit2
id3_type2->bit3
id3_type1->bit4
id3_type0->bit5
**********************************/
int b_physIsOnline(UINT8 slot)
{
return (boardOnLine(slot));
}
/**********************************
(type2~0=111,no online;
=00x,wan-xfp;
=01x, lan-xfp;
=100, cx4;
=101, cx4-drive;
=110,reserve)
ro
id2_type2->bit0(msb)
id2_type1->bit1
id2_type0->bit2
id3_type2->bit3
id3_type1->bit4
id3_type0->bit5
**********************************/
UINT16 b_physIfType(UINT8 slot)
{
/* lyf 060713 20:22 : ??? */
return 1;
}
/***********************************************************************
* get the portType of interface card
*changed by sunbei*/
UINT16 b_physPortType(UINT8 slot,UINT8 port)
{
return 1;
}
/*for shield port add by sunbei 2006-3-14*/
int b_port_Shield(unsigned int gport,int flag)
{
return 0;
}
/* Find if the port is link up or down
by jiang.jianfeng changed by sunbei
*/
BOOL b_physPortIsOnline(int slot, UINT32 port)
{
return 0;
}
/*************************************
1 -- elec port
2 -- fiber port
3 -- hybrid port
***************************************/
int drv_portProperty(UINT8 slot, UINT8 port)
{
return 0;
}
/*------------------system control end--------------*/
void resetSwitchAndPhy(void)
{
return ;
}
/*********************************
BIT3/4=01 IS5928F/5228F
BIT3/4=10 IS5928 /5228
BIT3/4=11 IS5952/5252
BIT3/4=00 IS5224
BIT5/6/7=101 MAC ISBCM56504
BIT5/6/7=001 MAC ISBCM56304
*********************************/
UINT32 getSwitchType()
{
/*indentify switch type chen.yibao*/
return 1;
}
/*---------------------------------------------------
add for 59 Project 2005-6-23 14:56 for compile
---------------------------------------------------*/
int Bsp_Delay(int num)
{
int rc = 0,i;
for(i=0;i<num;i++)
rc += i*0x12345678;
return rc;
}
STATUS sysTodSet
(
int year,
int month,
int day,
int hour,
int minute,
int sec
)
{
return OK;
}
UINT32 sysMeasureTimebase(void)
{
return 1;
}
int sysPciToRamClkGet()
{
return 1;
}
int sysRamToCpuClkGet()
{
return 1;
}
int sysIsCFM()
{
return 1;
}
UINT8 pldRegRead(int reg)
{
return (mecRegRead(reg));
}
int sysSlotIdGet (void)
{
return (physSlotNumber());
}
/*#define Switch59Type 59;*/
/******************************************************************************/
/* sysLib.c */
void RosConsoleReadCh (char * pCh)
{
}
void RosConsoleWriteCh (char Ch)
{
}
int AddaTimer (int frequence,void *phander,int para)/*hongtao:2006-11-03:modify from int AddaTimer (char num,int time,void *phander,int para)*/
{
return 0;
}
int sysToMonitorExcMessage = 1;
int sysToMonitorBacktrace = 1;
int sysToMonitorReboot = 1;
void (*sysToMonitorHook)(void);
void sysBacktracePpc(char *pfx, char *sfx, int direct)
{
}
UINT32 FlashCheckInit = 0;
BOOL FlashCheckStatus = TRUE;
BOOL FlashCheck (void)
{
FlashCheckInit = 1;
return TRUE;
}
/******************************************************************************/
/* 82xxLib.c */
void endPktFree(char* buff)
{
}
void sysReboot (void)
{
bsp_ResetBoard ();
}
STATUS b_updateBootrom (void)
{
return ERROR;
}
void Power_Led (BOOL light)
{
}
/* Fan_led
* The fan LED of LMB board */
void Fan_Led (BOOL light)
{
}
STATUS b_GetLMBTempture (INT8 * pTemp)
{
*pTemp = 20;
return OK;
}
/******************************************************************************/
/* flashfmt.c */
#include <tffs/tffsDrv.h>
#include "dosFsLib.h"
#include "stat.h"
/*#define TFFS_DISK_NAME "/flash/"*/
extern STATUS sysTffsFormat (void);
STATUS flashFormat
(
int tffsDriveNo, /* TrueFFS drive number (0 - DRIVES-1) */
int arg /* pointer to tffsDevFormatParams structure */
)
{
struct statfs DiskVol;
if (OK != sysTffsFormat())
return ERROR;
usrTffsConfig (0, 0, TFFS_DISK_NAME);
/* create a dir for image files */
if (OK != mkdir(TFFS_DISK_NAME"""img"))
return ERROR;
/* create a dir for config files */
if (OK != mkdir(TFFS_DISK_NAME"""cfg"))
return ERROR;
/* create a dir for database files */
if (OK != mkdir(TFFS_DISK_NAME"""data"))
return ERROR;
statfs(TFFS_DISK_NAME".", &DiskVol);
return OK;
}
/******************************************************************************/
/* wdbEndPktDrv.c */
#include "wdb/wdbMbufLib.h"
#include "netBufLib.h"
typedef int LL_HDR_INFO;
/*typedef int M_BLK_ID;*/
int wdbEndInt
(
void * pCookie,
long type,
M_BLK_ID pMblk,
LL_HDR_INFO * pLinkHdrInfo,
void * pMode
)
{
return 0;
}
const BOOL bufferedRtShow = 0;
const UINT rtMem = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -