diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixp2000/enp2611.c | 18 | ||||
-rw-r--r-- | drivers/net/ixp2000/ixpdev.c | 11 |
2 files changed, 12 insertions, 17 deletions
diff --git a/drivers/net/ixp2000/enp2611.c b/drivers/net/ixp2000/enp2611.c index b02a981c87a8..34a6cfd17930 100644 --- a/drivers/net/ixp2000/enp2611.c +++ b/drivers/net/ixp2000/enp2611.c | |||
@@ -119,24 +119,9 @@ static struct ixp2400_msf_parameters enp2611_msf_parameters = | |||
119 | } | 119 | } |
120 | }; | 120 | }; |
121 | 121 | ||
122 | struct enp2611_ixpdev_priv | ||
123 | { | ||
124 | struct ixpdev_priv ixpdev_priv; | ||
125 | struct net_device_stats stats; | ||
126 | }; | ||
127 | |||
128 | static struct net_device *nds[3]; | 122 | static struct net_device *nds[3]; |
129 | static struct timer_list link_check_timer; | 123 | static struct timer_list link_check_timer; |
130 | 124 | ||
131 | static struct net_device_stats *enp2611_get_stats(struct net_device *dev) | ||
132 | { | ||
133 | struct enp2611_ixpdev_priv *ip = netdev_priv(dev); | ||
134 | |||
135 | pm3386_get_stats(ip->ixpdev_priv.channel, &(ip->stats)); | ||
136 | |||
137 | return &(ip->stats); | ||
138 | } | ||
139 | |||
140 | /* @@@ Poll the SFP moddef0 line too. */ | 125 | /* @@@ Poll the SFP moddef0 line too. */ |
141 | /* @@@ Try to use the pm3386 DOOL interrupt as well. */ | 126 | /* @@@ Try to use the pm3386 DOOL interrupt as well. */ |
142 | static void enp2611_check_link_status(unsigned long __dummy) | 127 | static void enp2611_check_link_status(unsigned long __dummy) |
@@ -203,14 +188,13 @@ static int __init enp2611_init_module(void) | |||
203 | 188 | ||
204 | ports = pm3386_port_count(); | 189 | ports = pm3386_port_count(); |
205 | for (i = 0; i < ports; i++) { | 190 | for (i = 0; i < ports; i++) { |
206 | nds[i] = ixpdev_alloc(i, sizeof(struct enp2611_ixpdev_priv)); | 191 | nds[i] = ixpdev_alloc(i, sizeof(struct ixpdev_priv)); |
207 | if (nds[i] == NULL) { | 192 | if (nds[i] == NULL) { |
208 | while (--i >= 0) | 193 | while (--i >= 0) |
209 | free_netdev(nds[i]); | 194 | free_netdev(nds[i]); |
210 | return -ENOMEM; | 195 | return -ENOMEM; |
211 | } | 196 | } |
212 | 197 | ||
213 | nds[i]->get_stats = enp2611_get_stats; | ||
214 | pm3386_init_port(i); | 198 | pm3386_init_port(i); |
215 | pm3386_get_mac(i, nds[i]->dev_addr); | 199 | pm3386_get_mac(i, nds[i]->dev_addr); |
216 | } | 200 | } |
diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c index 127243461a51..9aee0cc922c9 100644 --- a/drivers/net/ixp2000/ixpdev.c +++ b/drivers/net/ixp2000/ixpdev.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "ixp2400_tx.ucode" | 21 | #include "ixp2400_tx.ucode" |
22 | #include "ixpdev_priv.h" | 22 | #include "ixpdev_priv.h" |
23 | #include "ixpdev.h" | 23 | #include "ixpdev.h" |
24 | #include "pm3386.h" | ||
24 | 25 | ||
25 | #define DRV_MODULE_VERSION "0.2" | 26 | #define DRV_MODULE_VERSION "0.2" |
26 | 27 | ||
@@ -271,6 +272,15 @@ static int ixpdev_close(struct net_device *dev) | |||
271 | return 0; | 272 | return 0; |
272 | } | 273 | } |
273 | 274 | ||
275 | static struct net_device_stats *ixpdev_get_stats(struct net_device *dev) | ||
276 | { | ||
277 | struct ixpdev_priv *ip = netdev_priv(dev); | ||
278 | |||
279 | pm3386_get_stats(ip->channel, &(dev->stats)); | ||
280 | |||
281 | return &(dev->stats); | ||
282 | } | ||
283 | |||
274 | static const struct net_device_ops ixpdev_netdev_ops = { | 284 | static const struct net_device_ops ixpdev_netdev_ops = { |
275 | .ndo_open = ixpdev_open, | 285 | .ndo_open = ixpdev_open, |
276 | .ndo_stop = ixpdev_close, | 286 | .ndo_stop = ixpdev_close, |
@@ -278,6 +288,7 @@ static const struct net_device_ops ixpdev_netdev_ops = { | |||
278 | .ndo_change_mtu = eth_change_mtu, | 288 | .ndo_change_mtu = eth_change_mtu, |
279 | .ndo_validate_addr = eth_validate_addr, | 289 | .ndo_validate_addr = eth_validate_addr, |
280 | .ndo_set_mac_address = eth_mac_addr, | 290 | .ndo_set_mac_address = eth_mac_addr, |
291 | .ndo_get_stats = ixpdev_get_stats, | ||
281 | #ifdef CONFIG_NET_POLL_CONTROLLER | 292 | #ifdef CONFIG_NET_POLL_CONTROLLER |
282 | .ndo_poll_controller = ixpdev_poll_controller, | 293 | .ndo_poll_controller = ixpdev_poll_controller, |
283 | #endif | 294 | #endif |