3 * Alchemy Au1x00 ethernet driver include file
7 * Copyright 2001 MontaVista Software Inc.
9 * ########################################################################
11 * This program is free software; you can distribute it and/or modify it
12 * under the terms of the GNU General Public License (Version 2) as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, see <http://www.gnu.org/licenses/>.
23 * ########################################################################
29 #define MAC_IOSIZE 0x10000
30 #define NUM_RX_DMA 4 /* Au1x00 has 4 rx hardware descriptors */
31 #define NUM_TX_DMA 4 /* Au1x00 has 4 tx hardware descriptors */
33 #define NUM_RX_BUFFS 4
34 #define NUM_TX_BUFFS 4
35 #define MAX_BUF_SIZE 2048
37 #define ETH_TX_TIMEOUT (HZ/4)
38 #define MAC_MIN_PKT_SIZE 64
40 #define MULTICAST_FILTER_LIMIT 64
43 * Data Buffer Descriptor. Data buffers must be aligned on 32 byte
44 * boundary for both, receive and transmit.
47 struct db_dest *pnext;
53 * The transmit and receive descriptors are memory
71 * MAC control registers, memory mapped.
87 struct au1000_private {
88 struct db_dest *pDBfree;
89 struct db_dest db[NUM_RX_BUFFS+NUM_TX_BUFFS];
90 struct rx_dma *rx_dma_ring[NUM_RX_DMA];
91 struct tx_dma *tx_dma_ring[NUM_TX_DMA];
92 struct db_dest *rx_db_inuse[NUM_RX_DMA];
93 struct db_dest *tx_db_inuse[NUM_TX_DMA];
101 int mac_enabled; /* whether MAC is currently enabled and running
105 int old_link; /* used by au1000_adjust_link */
109 struct phy_device *phy_dev;
110 struct mii_bus *mii_bus;
112 /* PHY configuration */
113 int phy_static_config;
114 int phy_search_highest_addr;
115 int phy1_search_mac0;
121 /* These variables are just for quick access
122 * to certain regs addresses.
124 struct mac_reg *mac; /* mac registers */
125 u32 *enable; /* address of MAC Enable Register */
126 void __iomem *macdma; /* base of MAC DMA port */
127 u32 vaddr; /* virtual address of rx/tx buffers */
128 dma_addr_t dma_addr; /* dma address of rx/tx buffers */
130 spinlock_t lock; /* Serialise access to device */