资源简介
nios ii下Internet 接口LAN91C111驱动

代码片段和文件信息
/*
* FILENAME: smsc91x.c
*
* Copyright 2002 By InterNiche Technologies Inc. All rights reserved
*
*
* This file contains the portable portions fo the Interniche SMSC91c111
* ethernet chip family driver.
*
*
* MODULE: smsc91x
*
* ROUTINES: prep_s91() s91_init() s91_close()
* ROUTINES: s91_pkt_send() s91_low_send() s91_stats() s91_rcv()
* ROUTINES: s91_isr() s91_reset() s91_enable()
*
* PORTABLE: no
*/
#ifdef ALT_INICHE
#include “ipport.h“
#include “in_utils.h“
#include “netbuf.h“
#include “net.h“
#include “q.h“
#include “ether.h“
#include “altera_avalon_lan91c111_regs.h“
#include “smsc91x.h“
#include “unistd.h“
/* #define STATIC_TX 1 */
int SMSC_UP = FALSE;
struct smsc_parms smsc91s[S91_DEVICES];
#ifdef ALT_INICHE
#include
#include “alt_iniche_dev.h“
error_t alt_avalon_lan91c111_init(
alt_iniche_dev *p_dev)
{
extern int prep_s91(int index);
prep_s91(p_dev->if_num);
return (0);
}
#endif /* ALT_INICHE */
/* FUNCTION: prep_s91()
*
* PARAM1: int index
*
* RETURNS:
*/
int
prep_s91(int index)
{
int i;
unshort bank;
SMSC smsc;
NET ifp;
for (i = 0; i < S91_DEVICES; i++)
{
smsc = &smsc91s[i]; /* get pointer to device structure */
/* Call the per-port hardware setup. Speed settings should be
* set in smsc->req_speed by the application prior to starting
* the driver else it will default to autoneg.
*/
s91_port_prep(i); /* set up device parameters (IObase etc) */
/* make sure SMSC chip appears at IO base. The bank select register always
* has a “0x33“ in it‘s high byte so we use this as a rough test.
*/
bank = IORD_ALTERA_AVALON_LAN91C111_BSR(smsc->regbase);
if ( (bank & 0xff00) != 0x3300 )
{
dtrap(); /* programing or hardware setup error? */
continue;
}
ifp = nets[index];
ifp->n_mib->ifAdminStatus = 2; /* status = down */
ifp->n_mib->ifOperStatus = 2; /* will be set up in init() */
ifp->n_mib->ifLastChange = cticks * (100/TPS);
ifp->n_mib->ifPhysAddress = (u_char*)smsc->mac_addr;
ifp->n_mib->ifDescr = (u_char*)“SMSC 9100 series ethernet“;
ifp->n_lnh = ETHHDR_SIZE; /* ethernet header size */
ifp->n_hal = 6; /* hardware address length */
ifp->n_mib->ifType = ETHERNET; /* device type */
ifp->n_mtu = MTU; /* max frame size */
/* install our hardware driver routines */
ifp->n_init = s91_init;
ifp->pkt_send = s91_pkt_send;
ifp->n_close = s91_close;
ifp->n_stats = s91_stats;
#ifdef IP_V6
ifp->n_flags |= (NF_NBPROT | NF_IPV6);
#else
ifp->n_flags |= NF_NBPROT;
#endif
nets[index]->n_mib->ifPhysAddress = (u_char*)smsc->mac_addr; /* ptr to MAC address */
/* set cr
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 1782 2009-10-22 07:42 altera_avalon_lan91c111\altera_avalon_lan91c111_hal_sw.tcl
....... 1831 2009-10-22 07:42 altera_avalon_lan91c111\altera_avalon_lan91c111_ucosii_sw.tcl
....... 10423 2009-10-22 07:42 altera_avalon_lan91c111\class.ptf
....... 3380 2009-10-22 07:42 altera_avalon_lan91c111\HAL\inc\altera_avalon_lan91c111.h
....... 35807 2009-10-22 07:42 altera_avalon_lan91c111\inc\altera_avalon_lan91c111_regs.h
....... 3367 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\inc\altera_avalon_lan91c111.h
....... 4397 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\inc\iniche\altera_avalon_lan91c111_iniche.h
....... 1322 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\inc\iniche\s91_port.h
....... 9167 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\inc\iniche\smsc91x.h
....... 3104 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\src\component.mk
....... 18558 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\src\iniche\smsc91x.c
....... 14514 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\src\iniche\smsc_mem.c
....... 14155 2009-10-22 07:42 altera_avalon_lan91c111\UCOSII\src\iniche\smsc_phy.c
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\UCOSII\inc\iniche
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\UCOSII\src\iniche
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\HAL\inc
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\UCOSII\inc
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\UCOSII\src
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\HAL
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\inc
目录 0 2010-05-24 21:20 altera_avalon_lan91c111\UCOSII
目录 0 2010-05-24 21:20 altera_avalon_lan91c111
----------- --------- ---------- ----- ----
121807 22
相关资源
- Apolipoprotein E4 Impairs in vivo Hippocampal
- Quartus II 15.0中仿真Altera三速以太网I
- Quartus II 15.0中仿真Altera三速以太网I
- 3人表决器 QuartusII
- DAS1302蜂鸣 独立按键 闹钟设定 IIC存储
- 曼彻斯特编解码_同步QuartusII工程
- CPLD Verilog数字密码锁 源码
- 全自动多功能编码转换工具(URLASCI
- 基于VHDL的交通灯控制器设计
- II型逆向跷跷板机制及其在LHC和ILC的签
- 点阵字库 包含ACSII、字符、文字
- ucosII源代码 2.9版本全 Micrium-uCOS-II-V
- 51单片机中使用ucos ii的优缺点转
- 51单片机中使用ucos ii的优缺点
- 嵌入式实时操作系统ucos-II 第二版 源
- STM32 DS3231驱动.zip
- IIC proteus仿真实验
- Belle-II和ILC的马约拉纳中微子信号
- 鉴于DAMPE e + e-过剩,II型跷跷板模型在
- IIB超弦理论中的超杨格-米尔斯,陈恩
- Quartus II 15.0中仿真DDR2 IP核
- 嵌入式实时操作系统μC/OS-II与eCos的
- 基于STM32的嵌入式双目图像采集系统设
- 嵌入式实时操作系统μC/OS-II下通用驱
- 嵌入式实时操作系统μC/OS-II在ARM上的
- 用ARM7和UC/OS-II设计的信号采集系统
- 一种用ARM7+UC/OS-II设计的信号采集系统
- E5404E 4Gb FC-SATA-II RAID产品手册
- Investigation of the Lower Resistance Meridian
- labview ASCII_十六进制_十进制转换
评论
共有 条评论