资源简介
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
相关资源
- uCOSII源代码
- 9860GII计算器电脑驱动CESG502文件
- STM32F4读写SD2405实时时钟程序
- PIC单片机 IIC通信 proteus仿真文件图
- 百兆以太网MAC和MII的VHDL源码,我也是
- STM32F429的UCOSII工程
- Quartus II 12.1 32 64破解
- Quartus II 13.1 (64-bit)破解工具
- CC2530-ADXL345 IIC通信
- CC2530-HMC5883L通过I2C通信
- ISAPI_Rewrite3_0112_x64 iis10 下破解64位
- NSGA-II非支配排序算法
- i2c的verilog实现
- Ascgen2-2.0.0汉化版(图像ASCII生成器.
- Quartus ii 12.1 Crack 32位及64位破解文件
- Quartus II 13.0sp1破解license,几乎包含所
- STM32+SHT30(DS18B20)+0.96寸OLED(IIC)的
- UCOSIII外部中断和串口中断管理
- 字库文件HZK12 HZK16 ASC II
- 奇偶校验电路.doc
- Quartus_12.0_x64破解器.rar
- FY3、NPP VIIRS等常用卫星波段资料整理
- STM32F103通过模拟IIC读取LIS3DH 解析数据
- 软件模拟IIC主从机
- Tomcat与IIS整合笔记
- asciimath数学公式编辑器
- quartus ii 5.0 破解文件
- Band Math in ENVI
- mii转rmii接口
- IIC总线读写AT24C02BEEPROM源程序 有详细
评论
共有 条评论