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

📄 sysks8695end.c

📁 这是micrel公司宽带路由ARM9芯片的VXWORKS BSP 源代码
💻 C
字号:
/* sysKS8695End.c - KS8695/X/P System Enhanced network interface support library */

/* Copyright 1997-2002 Wind River Systems, Inc. */
/* LIQUN RUAN
 * Created for KS8695/X/P SOHO Router driver
 */
#include "copyright_wrs.h"

/*
modification history
--------------------
LIQUN RUAN (RLQ), 10/07/2003, first created for KS8695/X/P
*/

/*
DESCRIPTION
This file contains the board-specific routines for Ethernet adapter
initialisation of Micrel KS8695/KS8695P SOHO router chip-based board.

NOTE
At the time of writing, this module has only been tested with the following
Ethernet cards:
    KS8695P based board.
    KS8695  based board is not verified yet.

Refer to the BSP reference entry for any eventual limitations or
problems related to the BSP.

SEE ALSO: ifLib,
.I "Micrel Semiconductor KS8695/X/P SOHO Router Datasheet"
*/

#include "vxWorks.h"
#include "config.h"
#include "stdio.h"

#ifdef INCLUDE_END

/* defines */
#define	END_LD_STR_SIZE	80

/* END load strings */
LOCAL char	ks8695LoadStr[KS8695_MAX_END_DEVS][END_LD_STR_SIZE];

/* Index of devices */
LOCAL int	ks8695EndDevice = 0;

/* imports */
/* End device table - defined in configNet.h */
IMPORT END_TBL_ENTRY	endDevTbl[];

/* KS8695 specific imports */
IMPORT END_OBJ	*ks8695EndLoad(char *, void *);

/*******************************************************************************
*
* sysEndInit - prepare WAN/LAN (and EMAC if KS8695) driver for initialization
*
* This routine initialize WAN/LAN (and EMAC if KS8695) driver.
*
* RETURNS
*	OK		if successful
*	ERROR	otherwise
*/
STATUS sysEndInit(void)
{
    unsigned int	i;		/* counter */

	/*
	 * Update the END device table & dynamically create the load
	 * string we need for this device
	 */
	for (i = 0; i < KS8695_MAX_END_DEVS; i++) {
		sprintf(ks8695LoadStr[ks8695EndDevice],
			/* sounds that unit number is prefixed automatically */
#if 0
			"%#x:%#x:%#x:%#x:%#x:%#x:%#x:%#x",
			i,					/* unit */
#endif
			"%#x:%#x:%#x:%#x:%#x:%#x:%#x",
			/*i == 0 ? TXDESC_DEFAULT * 2 : TXDESC_DEFAULT,*/		/* Tx descriptors, now WAN tx will be 2 times of default */
			TXDESC_DEFAULT,		/* Tx descriptors */
			RXDESC_DEFAULT,		/* Rx descriptors */
			TXCHECKSUM_DEFAULT,	/* Tx checksum */
			RXCHECKSUM_DEFAULT,	/* Rx checksum */
			FLOWCONTROL_DEFAULT,	/* flow control */
			PBL_DEFAULT,		/* PBL */
			TRUE);			/* Phy Power Reset */

		endDevTbl[ks8695EndDevice].unit = i;
		endDevTbl[ks8695EndDevice].endLoadFunc = ks8695EndLoad;
		endDevTbl[ks8695EndDevice].endLoadString = ks8695LoadStr[ks8695EndDevice];
		endDevTbl[ks8695EndDevice].endLoan = RXDESC_LOAN_NUM;

		ks8695EndDevice++;
	}

    return OK;
}
#endif  /* INCLUDE_END */

⌨️ 快捷键说明

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