aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fs_enet/fs_enet.h
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-10-02 11:55:58 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:03 -0400
commit976de6a8c304dcc43e38efcb8a0bace7866b6242 (patch)
treebae132693bbcfa65c03cf44c7db924fdebf13158 /drivers/net/fs_enet/fs_enet.h
parent0d0d9c150c046cbd3e507adcfa2d78db82f1f452 (diff)
fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.
The existing OF glue code was crufty and broken. Rather than fix it, it will be removed, and the ethernet driver now talks to the device tree directly. The old, non-CONFIG_PPC_CPM_NEW_BINDING code can go away once CPM platforms are dropped from arch/ppc (which will hopefully be soon), and existing arch/powerpc boards that I wasn't able to test on for this patchset get converted (which should be even sooner). Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/fs_enet/fs_enet.h')
-rw-r--r--drivers/net/fs_enet/fs_enet.h55
1 files changed, 3 insertions, 52 deletions
diff --git a/drivers/net/fs_enet/fs_enet.h b/drivers/net/fs_enet/fs_enet.h
index 85571e49ec72..5a5c9d18df2e 100644
--- a/drivers/net/fs_enet/fs_enet.h
+++ b/drivers/net/fs_enet/fs_enet.h
@@ -24,19 +24,6 @@ struct fec_info {
24#include <asm/cpm2.h> 24#include <asm/cpm2.h>
25#endif 25#endif
26 26
27/* This is used to operate with pins.
28 Note that the actual port size may
29 be different; cpm(s) handle it OK */
30struct bb_info {
31 u8 mdio_dat_msk;
32 u8 mdio_dir_msk;
33 u8 *mdio_dir;
34 u8 *mdio_dat;
35 u8 mdc_msk;
36 u8 *mdc_dat;
37 int delay;
38};
39
40/* hw driver ops */ 27/* hw driver ops */
41struct fs_ops { 28struct fs_ops {
42 int (*setup_data)(struct net_device *dev); 29 int (*setup_data)(struct net_device *dev);
@@ -85,48 +72,12 @@ struct phy_info {
85#define ENET_RX_ALIGN 16 72#define ENET_RX_ALIGN 16
86#define ENET_RX_FRSIZE L1_CACHE_ALIGN(PKT_MAXBUF_SIZE + ENET_RX_ALIGN - 1) 73#define ENET_RX_FRSIZE L1_CACHE_ALIGN(PKT_MAXBUF_SIZE + ENET_RX_ALIGN - 1)
87 74
88struct fs_enet_mii_bus {
89 struct list_head list;
90 spinlock_t mii_lock;
91 const struct fs_mii_bus_info *bus_info;
92 int refs;
93 u32 usage_map;
94
95 int (*mii_read)(struct fs_enet_mii_bus *bus,
96 int phy_id, int location);
97
98 void (*mii_write)(struct fs_enet_mii_bus *bus,
99 int phy_id, int location, int value);
100
101 union {
102 struct {
103 unsigned int mii_speed;
104 void *fecp;
105 } fec;
106
107 struct {
108 /* note that the actual port size may */
109 /* be different; cpm(s) handle it OK */
110 u8 mdio_msk;
111 u8 *mdio_dir;
112 u8 *mdio_dat;
113 u8 mdc_msk;
114 u8 *mdc_dir;
115 u8 *mdc_dat;
116 } bitbang;
117
118 struct {
119 u16 lpa;
120 } fixed;
121 };
122};
123
124struct fs_enet_private { 75struct fs_enet_private {
125 struct napi_struct napi; 76 struct napi_struct napi;
126 struct device *dev; /* pointer back to the device (must be initialized first) */ 77 struct device *dev; /* pointer back to the device (must be initialized first) */
127 spinlock_t lock; /* during all ops except TX pckt processing */ 78 spinlock_t lock; /* during all ops except TX pckt processing */
128 spinlock_t tx_lock; /* during fs_start_xmit and fs_tx */ 79 spinlock_t tx_lock; /* during fs_start_xmit and fs_tx */
129 const struct fs_platform_info *fpi; 80 struct fs_platform_info *fpi;
130 const struct fs_ops *ops; 81 const struct fs_ops *ops;
131 int rx_ring, tx_ring; 82 int rx_ring, tx_ring;
132 dma_addr_t ring_mem_addr; 83 dma_addr_t ring_mem_addr;
@@ -145,7 +96,6 @@ struct fs_enet_private {
145 u32 msg_enable; 96 u32 msg_enable;
146 struct mii_if_info mii_if; 97 struct mii_if_info mii_if;
147 unsigned int last_mii_status; 98 unsigned int last_mii_status;
148 struct fs_enet_mii_bus *mii_bus;
149 int interrupt; 99 int interrupt;
150 100
151 struct phy_device *phydev; 101 struct phy_device *phydev;
@@ -187,9 +137,10 @@ struct fs_enet_private {
187}; 137};
188 138
189/***************************************************************************/ 139/***************************************************************************/
140#ifndef CONFIG_PPC_CPM_NEW_BINDING
190int fs_enet_mdio_bb_init(void); 141int fs_enet_mdio_bb_init(void);
191int fs_mii_fixed_init(struct fs_enet_mii_bus *bus);
192int fs_enet_mdio_fec_init(void); 142int fs_enet_mdio_fec_init(void);
143#endif
193 144
194void fs_init_bds(struct net_device *dev); 145void fs_init_bds(struct net_device *dev);
195void fs_cleanup_bds(struct net_device *dev); 146void fs_cleanup_bds(struct net_device *dev);