资源简介
我现在做的项目就是用这个驱动。要根据具体的硬件对代码进行一些小的修改就可以。
代码片段和文件信息
/*
dm9k8c: Version 1.0 05/2005
A Davicom DM9008A 10M ONLY Ethernet driver for Linux.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License or (at your option) any later version.
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
(C)Copyright 1997-2005 DAVICOM SemiconductorInc. All Rights Reserved.
2005/05 Bill v1.0 Create
*/
#include
#include
#include
#include
#include
#include
#include /**/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#if defined(MODVERSIONS)
#include
#endif
#include
#include
#include
/* Board/System/Debug information/definition ---------------- */
#define DM9K8_ID 0x90000A46
/*-------register name-----------------------*/
#define DM9K8_NCR 0x00 /* Network control Reg.*/
#define DM9K8_NSR 0x01 /* Network Status Reg.*/
#define DM9K8_TCR 0x02 /* TX control Reg.*/
#define DM9K8_RXCR 0x05 /* RX control Reg.*/
#define DM9K8_BPTR 0x08
#define DM9K8_EPCR 0x0b
#define DM9K8_EPAR 0x0c
#define DM9K8_EPDRL 0x0d
#define DM9K8_EPDRH 0x0e
#define DM9K8_GPR 0x1f /* General purpose register */
#define DM9K8_TCR2 0x2d
#define DM9K8_SMCR 0x2f /* Special Mode Control Reg.*/
#define DM9K8_ETXCSR 0x30 /* Early Transmit control/status Reg.*/
#define DM9K8_TCCR 0x31 /* Checksum cntrol Reg. */
#define DM9K8_RCSR 0x32 /* Receive Checksum status Reg.*/
#define DM9K8_MRCMDX 0xf0
#define DM9K8_MRCMD 0xf2
#define DM9K8_MDRAH 0xf4
#define DM9K8_MDRAL 0xf5
#define DM9K8_MWCMD 0xf8
#define DM9K8_TXPLL 0xfc
#define DM9K8_TXPLH 0xfd
#define DM9K8_ISR 0xfe
#define DM9K8_IMR 0xff
/*---------------------------------------------*/
#define DM9K8_REG05 0x30 /* SKIP_CRC/SKIP_LONG */
#define DM9K8_REGFF 0xA3 /* IMR */
#define DM9K8_DISINTR 0x80
#define DM9K8_PHY 0x40 /* PHY address 0x01 */
#define DM9K8_PKT_RDY 0x01 /* Packet ready to receive */
#define DM9K8_MIN_IO 0x080000000 /* frank 原来为0x300. 网卡心片放在BANK1 因此起始地址为0X08000000*/
#define DM9K8_MAX_IO (DM9K8_MIN_IO + 0x70) /* frank 原来为0x370. */
#define DM9K8_VID_L 0x28
#define DM9K8_VID_H 0x29
#define DM9K8_PID_L 0x2A
#define DM9K8_PID_H 0x2B
#define DM9K8_RX_INTR 0x01
#define DM9K8_TX_INTR 0x02
#define DM9
评论
共有 条评论