aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/au1000_eth.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/au1000_eth.h')
-rw-r--r--drivers/net/au1000_eth.h134
1 files changed, 9 insertions, 125 deletions
diff --git a/drivers/net/au1000_eth.h b/drivers/net/au1000_eth.h
index 7f9326e39cc0..41c2f848d2c4 100644
--- a/drivers/net/au1000_eth.h
+++ b/drivers/net/au1000_eth.h
@@ -40,120 +40,6 @@
40 40
41#define MULTICAST_FILTER_LIMIT 64 41#define MULTICAST_FILTER_LIMIT 64
42 42
43/* FIXME
44 * The PHY defines should be in a separate file.
45 */
46
47/* MII register offsets */
48#define MII_CONTROL 0x0000
49#define MII_STATUS 0x0001
50#define MII_PHY_ID0 0x0002
51#define MII_PHY_ID1 0x0003
52#define MII_ANADV 0x0004
53#define MII_ANLPAR 0x0005
54#define MII_AEXP 0x0006
55#define MII_ANEXT 0x0007
56#define MII_LSI_PHY_CONFIG 0x0011
57/* Status register */
58#define MII_LSI_PHY_STAT 0x0012
59#define MII_AMD_PHY_STAT MII_LSI_PHY_STAT
60#define MII_INTEL_PHY_STAT 0x0011
61
62#define MII_AUX_CNTRL 0x0018
63/* mii registers specific to AMD 79C901 */
64#define MII_STATUS_SUMMARY = 0x0018
65
66/* MII Control register bit definitions. */
67#define MII_CNTL_FDX 0x0100
68#define MII_CNTL_RST_AUTO 0x0200
69#define MII_CNTL_ISOLATE 0x0400
70#define MII_CNTL_PWRDWN 0x0800
71#define MII_CNTL_AUTO 0x1000
72#define MII_CNTL_F100 0x2000
73#define MII_CNTL_LPBK 0x4000
74#define MII_CNTL_RESET 0x8000
75
76/* MII Status register bit */
77#define MII_STAT_EXT 0x0001
78#define MII_STAT_JAB 0x0002
79#define MII_STAT_LINK 0x0004
80#define MII_STAT_CAN_AUTO 0x0008
81#define MII_STAT_FAULT 0x0010
82#define MII_STAT_AUTO_DONE 0x0020
83#define MII_STAT_CAN_T 0x0800
84#define MII_STAT_CAN_T_FDX 0x1000
85#define MII_STAT_CAN_TX 0x2000
86#define MII_STAT_CAN_TX_FDX 0x4000
87#define MII_STAT_CAN_T4 0x8000
88
89
90#define MII_ID1_OUI_LO 0xFC00 /* low bits of OUI mask */
91#define MII_ID1_MODEL 0x03F0 /* model number */
92#define MII_ID1_REV 0x000F /* model number */
93
94/* MII NWAY Register Bits ...
95 valid for the ANAR (Auto-Negotiation Advertisement) and
96 ANLPAR (Auto-Negotiation Link Partner) registers */
97#define MII_NWAY_NODE_SEL 0x001f
98#define MII_NWAY_CSMA_CD 0x0001
99#define MII_NWAY_T 0x0020
100#define MII_NWAY_T_FDX 0x0040
101#define MII_NWAY_TX 0x0080
102#define MII_NWAY_TX_FDX 0x0100
103#define MII_NWAY_T4 0x0200
104#define MII_NWAY_PAUSE 0x0400
105#define MII_NWAY_RF 0x2000 /* Remote Fault */
106#define MII_NWAY_ACK 0x4000 /* Remote Acknowledge */
107#define MII_NWAY_NP 0x8000 /* Next Page (Enable) */
108
109/* mii stsout register bits */
110#define MII_STSOUT_LINK_FAIL 0x4000
111#define MII_STSOUT_SPD 0x0080
112#define MII_STSOUT_DPLX 0x0040
113
114/* mii stsics register bits */
115#define MII_STSICS_SPD 0x8000
116#define MII_STSICS_DPLX 0x4000
117#define MII_STSICS_LINKSTS 0x0001
118
119/* mii stssum register bits */
120#define MII_STSSUM_LINK 0x0008
121#define MII_STSSUM_DPLX 0x0004
122#define MII_STSSUM_AUTO 0x0002
123#define MII_STSSUM_SPD 0x0001
124
125/* lsi phy status register */
126#define MII_LSI_PHY_STAT_FDX 0x0040
127#define MII_LSI_PHY_STAT_SPD 0x0080
128
129/* amd phy status register */
130#define MII_AMD_PHY_STAT_FDX 0x0800
131#define MII_AMD_PHY_STAT_SPD 0x0400
132
133/* intel phy status register */
134#define MII_INTEL_PHY_STAT_FDX 0x0200
135#define MII_INTEL_PHY_STAT_SPD 0x4000
136
137/* Auxilliary Control/Status Register */
138#define MII_AUX_FDX 0x0001
139#define MII_AUX_100 0x0002
140#define MII_AUX_F100 0x0004
141#define MII_AUX_ANEG 0x0008
142
143typedef struct mii_phy {
144 struct mii_phy * next;
145 struct mii_chip_info * chip_info;
146 u16 status;
147 u32 *mii_control_reg;
148 u32 *mii_data_reg;
149} mii_phy_t;
150
151struct phy_ops {
152 int (*phy_init) (struct net_device *, int);
153 int (*phy_reset) (struct net_device *, int);
154 int (*phy_status) (struct net_device *, int, u16 *, u16 *);
155};
156
157/* 43/*
158 * Data Buffer Descriptor. Data buffers must be aligned on 32 byte 44 * Data Buffer Descriptor. Data buffers must be aligned on 32 byte
159 * boundary for both, receive and transmit. 45 * boundary for both, receive and transmit.
@@ -200,7 +86,6 @@ typedef struct mac_reg {
200 86
201 87
202struct au1000_private { 88struct au1000_private {
203
204 db_dest_t *pDBfree; 89 db_dest_t *pDBfree;
205 db_dest_t db[NUM_RX_BUFFS+NUM_TX_BUFFS]; 90 db_dest_t db[NUM_RX_BUFFS+NUM_TX_BUFFS];
206 volatile rx_dma_t *rx_dma_ring[NUM_RX_DMA]; 91 volatile rx_dma_t *rx_dma_ring[NUM_RX_DMA];
@@ -213,8 +98,15 @@ struct au1000_private {
213 u32 tx_full; 98 u32 tx_full;
214 99
215 int mac_id; 100 int mac_id;
216 mii_phy_t *mii; 101
217 struct phy_ops *phy_ops; 102 int mac_enabled; /* whether MAC is currently enabled and running (req. for mdio) */
103
104 int old_link; /* used by au1000_adjust_link */
105 int old_speed;
106 int old_duplex;
107
108 struct phy_device *phy_dev;
109 struct mii_bus mii_bus;
218 110
219 /* These variables are just for quick access to certain regs addresses. */ 111 /* These variables are just for quick access to certain regs addresses. */
220 volatile mac_reg_t *mac; /* mac registers */ 112 volatile mac_reg_t *mac; /* mac registers */
@@ -223,14 +115,6 @@ struct au1000_private {
223 u32 vaddr; /* virtual address of rx/tx buffers */ 115 u32 vaddr; /* virtual address of rx/tx buffers */
224 dma_addr_t dma_addr; /* dma address of rx/tx buffers */ 116 dma_addr_t dma_addr; /* dma address of rx/tx buffers */
225 117
226 u8 *hash_table;
227 u32 hash_mode;
228 u32 intr_work_done; /* number of Rx and Tx pkts processed in the isr */
229 int phy_addr; /* phy address */
230 u32 options; /* User-settable misc. driver options. */
231 u32 drv_flags;
232 int want_autoneg;
233 struct net_device_stats stats; 118 struct net_device_stats stats;
234 struct timer_list timer;
235 spinlock_t lock; /* Serialise access to device */ 119 spinlock_t lock; /* Serialise access to device */
236}; 120};