1
2
3
4
5
6
7
8
9
10
11
12 #define MAC_IOSIZE 0x10000
13 #define NUM_RX_DMA 4
14 #define NUM_TX_DMA 4
15
16 #define NUM_RX_BUFFS 4
17 #define NUM_TX_BUFFS 4
18 #define MAX_BUF_SIZE 2048
19
20 #define ETH_TX_TIMEOUT (HZ/4)
21 #define MAC_MIN_PKT_SIZE 64
22
23 #define MULTICAST_FILTER_LIMIT 64
24
25
26
27
28
29 struct db_dest {
30 struct db_dest *pnext;
31 u32 *vaddr;
32 dma_addr_t dma_addr;
33 };
34
35
36
37
38
39 struct tx_dma {
40 u32 status;
41 u32 buff_stat;
42 u32 len;
43 u32 pad;
44 };
45
46 struct rx_dma {
47 u32 status;
48 u32 buff_stat;
49 u32 pad[2];
50 };
51
52
53
54
55
56 struct mac_reg {
57 u32 control;
58 u32 mac_addr_high;
59 u32 mac_addr_low;
60 u32 multi_hash_high;
61 u32 multi_hash_low;
62 u32 mii_control;
63 u32 mii_data;
64 u32 flow_control;
65 u32 vlan1_tag;
66 u32 vlan2_tag;
67 };
68
69
70 struct au1000_private {
71 struct db_dest *pDBfree;
72 struct db_dest db[NUM_RX_BUFFS+NUM_TX_BUFFS];
73 struct rx_dma *rx_dma_ring[NUM_RX_DMA];
74 struct tx_dma *tx_dma_ring[NUM_TX_DMA];
75 struct db_dest *rx_db_inuse[NUM_RX_DMA];
76 struct db_dest *tx_db_inuse[NUM_TX_DMA];
77 u32 rx_head;
78 u32 tx_head;
79 u32 tx_tail;
80 u32 tx_full;
81
82 int mac_id;
83
84 int mac_enabled;
85
86
87
88 int old_link;
89 int old_speed;
90 int old_duplex;
91
92 struct mii_bus *mii_bus;
93
94
95 int phy_static_config;
96 int phy_search_highest_addr;
97 int phy1_search_mac0;
98
99 int phy_addr;
100 int phy_busid;
101 int phy_irq;
102
103
104
105
106 struct mac_reg *mac;
107 u32 *enable;
108 void __iomem *macdma;
109 u32 vaddr;
110 dma_addr_t dma_addr;
111
112 spinlock_t lock;
113
114 u32 msg_enable;
115 };