0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #define MAC_IOSIZE 0x10000
0013 #define NUM_RX_DMA 4
0014 #define NUM_TX_DMA 4
0015
0016 #define NUM_RX_BUFFS 4
0017 #define NUM_TX_BUFFS 4
0018 #define MAX_BUF_SIZE 2048
0019
0020 #define ETH_TX_TIMEOUT (HZ/4)
0021 #define MAC_MIN_PKT_SIZE 64
0022
0023 #define MULTICAST_FILTER_LIMIT 64
0024
0025
0026
0027
0028
0029 struct db_dest {
0030 struct db_dest *pnext;
0031 u32 *vaddr;
0032 dma_addr_t dma_addr;
0033 };
0034
0035
0036
0037
0038
0039 struct tx_dma {
0040 u32 status;
0041 u32 buff_stat;
0042 u32 len;
0043 u32 pad;
0044 };
0045
0046 struct rx_dma {
0047 u32 status;
0048 u32 buff_stat;
0049 u32 pad[2];
0050 };
0051
0052
0053
0054
0055
0056 struct mac_reg {
0057 u32 control;
0058 u32 mac_addr_high;
0059 u32 mac_addr_low;
0060 u32 multi_hash_high;
0061 u32 multi_hash_low;
0062 u32 mii_control;
0063 u32 mii_data;
0064 u32 flow_control;
0065 u32 vlan1_tag;
0066 u32 vlan2_tag;
0067 };
0068
0069
0070 struct au1000_private {
0071 struct db_dest *pDBfree;
0072 struct db_dest db[NUM_RX_BUFFS+NUM_TX_BUFFS];
0073 struct rx_dma *rx_dma_ring[NUM_RX_DMA];
0074 struct tx_dma *tx_dma_ring[NUM_TX_DMA];
0075 struct db_dest *rx_db_inuse[NUM_RX_DMA];
0076 struct db_dest *tx_db_inuse[NUM_TX_DMA];
0077 u32 rx_head;
0078 u32 tx_head;
0079 u32 tx_tail;
0080 u32 tx_full;
0081
0082 int mac_id;
0083
0084 int mac_enabled;
0085
0086
0087
0088 int old_link;
0089 int old_speed;
0090 int old_duplex;
0091
0092 struct mii_bus *mii_bus;
0093
0094
0095 int phy_static_config;
0096 int phy_search_highest_addr;
0097 int phy1_search_mac0;
0098
0099 int phy_addr;
0100 int phy_busid;
0101 int phy_irq;
0102
0103
0104
0105
0106 struct mac_reg *mac;
0107 u32 *enable;
0108 void __iomem *macdma;
0109 void *vaddr;
0110 dma_addr_t dma_addr;
0111
0112 spinlock_t lock;
0113
0114 u32 msg_enable;
0115 };