新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > Davicom公司DM9000A和DM9010 ISA NIC 以太網驅動分析

        Davicom公司DM9000A和DM9010 ISA NIC 以太網驅動分析

        作者: 時間:2012-11-02 來源:網絡 收藏

        /*

        本文引用地址:http://www.104case.com/article/148275.htm

        dm9ks.c: Version 2.03 2005/10/17

        A / fast 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 Semiconductor,Inc. All Rights Reserved.

        V1.00 10/13/2004 Add new function Early transmit IP/TCP/UDP Checksum

        offload enable flow control is default

        V1.1 12/29/2004 Add Two packet mode modify RX function

        V1.2 01/14/2005 Add Early transmit mode

        V1.3 03/02/2005 Support kernel 2.6

        v1.33 06/08/2005 #define DM9KS_MDRAL 0xf4

        #define DM9KS_MDRAH 0xf5

        V2.00 01/10/2005 Spenser

        - Modification for PXA270 MAINSTONE.

        - Modified dmfe_tx_done().

        - Add dmfe_timeout().

        V2.01 10/07/2005 Modified dmfe_timer()

        Dected network speed 10/100M

        V2.02 10/12/2005 Use link change to chage db->Speed

        dmfe_open() wait for Link OK

        V2.03 11/22/2005 Power-off and Power-on PHY in dmfe_init() support IOL

        */

        #if defined(MODVERSIONS)

        #include

        #endif

        #include

        #include

        #include

        #include

        #include

        #include

        #include

        #include

        #include

        #include

        #include

        #include

        #ifdef CONFIG_ARCH_MAINSTONE

        #include

        #include

        #include

        #endif

        /* Board/System/Debug information/definition ---------------- */

        #define DM9KS_ID 0x90000A46

        #define _ID 0x90100A46

        /*-------register name-----------------------*/

        #define DM9KS_NCR 0x00 /* Network control Reg.*/

        #define DM9KS_NSR 0x01 /* Network Status Reg.*/

        #define DM9KS_TCR 0x02 /* TX control Reg.*/

        #define DM9KS_RXCR 0x05 /* RX control Reg.*/

        #define DM9KS_BPTR 0x08

        #define DM9KS_EPCR 0x0b

        #define DM9KS_EPAR 0x0c

        #define DM9KS_EPDRL 0x0d

        #define DM9KS_EPDRH 0x0e

        #define DM9KS_GPR 0x1f /* General purpose register */

        #define DM9KS_TCR2 0x2d

        #define DM9KS_SMCR 0x2f /* Special Mode Control Reg.*/

        #define DM9KS_ETXCSR 0x30 /* Early Transmit control/status Reg.*/

        #define DM9KS_TCCR 0x31 /* Checksum cntrol Reg. */

        #define DM9KS_RCSR 0x32 /* Receive Checksum status Reg.*/

        #define DM9KS_MRCMDX 0xf0

        #define DM9KS_MRCMD 0xf2

        #define DM9KS_MDRAL 0xf4

        #define DM9KS_MDRAH 0xf5

        #define DM9KS_MWCMD 0xf8

        #define DM9KS_TXPLL 0xfc

        #define DM9KS_TXPLH 0xfd

        #define DM9KS_ISR 0xfe

        #define DM9KS_IMR 0xff

        /*---------------------------------------------*/

        #define DM9KS_REG05 0x30 /* SKIP_CRC/SKIP_LONG */

        #define DM9KS_REGFF 0xA3 /* IMR */

        #define DM9KS_DISINTR 0x80

        #define DM9KS_PHY 0x40 /* PHY address 0x01 */

        #define DM9KS_PKT_RDY 0x01 /* Packet ready to receive */

        /* Added for PXA of MAINSTONE */

        #ifdef CONFIG_ARCH_MAINSTONE

        #include

        #define DM9KS_MIN_IO (MST_ETH_PHYS + 0x300)

        #define DM9KS_MAX_IO (MST_ETH_PHYS + 0x370)

        #define DM9K_IRQ MAINSTONE_IRQ(3)

        #else

        #define DM9KS_MIN_IO 0x300

        #define DM9KS_MAX_IO 0x370

        #define DM9K_IRQ 3

        #endif

        #define DM9KS_VID_L 0x28

        #define DM9KS_VID_H 0x29

        #define DM9KS_PID_L 0x2A

        #define DM9KS_PID_H 0x2B

        #define DM9KS_RX_INTR 0x01

        #define DM9KS_TX_INTR 0x02

        #define DM9KS_LINK_INTR 0x20

        #define DM9KS_DWORD_MODE 1

        #define DM9KS_BYTE_MODE 2

        #define DM9KS_WORD_MODE 0

        #define TRUE 1

        #define FALSE 0

        /* Number of continuous Rx packets */

        #define CONT_RX_PKT_CNT 10

        #define DMFE_TIMER_WUT jiffies+(HZ*5) /* timer wakeup time : 5 second */

        #if defined(DM9KS_DEBUG)

        #define DMFE_DBUG(dbug_now, msg, vaule)

        if (dmfe_debug||dbug_now) printk(KERN_ERR dmfe: %s %xn, msg, vaule)

        pid控制相關文章:pid控制原理



        上一頁 1 2 3 4 5 6 7 下一頁

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 湖北省| 渝中区| 滨海县| 饶阳县| 盘锦市| 拜城县| 来凤县| 商洛市| 樟树市| 吉隆县| 沁水县| 呼玛县| 长葛市| 广宁县| 庆城县| 军事| 新河县| 孙吴县| 汾阳市| 广平县| 农安县| 河北区| 若尔盖县| 彰化县| 铜梁县| 乐陵市| 三河市| 阿克苏市| 合川市| 新巴尔虎右旗| 嘉义市| 焦作市| 外汇| 和平县| 库尔勒市| 余姚市| 柘荣县| 广安市| 房产| 阿瓦提县| 石阡县|