diff options
| author | David S. Miller <davem@davemloft.net> | 2009-10-13 15:55:20 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2009-10-13 15:55:20 -0400 |
| commit | 421355de876b9f3fcc7e4cb6026e416fb12a5068 (patch) | |
| tree | fb814456af86c75e1eb9e330994dda461fc5b4f7 /drivers/net/ixp2000 | |
| parent | aace495933a981274b6491d71b915165a61defdc (diff) | |
| parent | 0fe7463a35aadfaf22d1ca58325ab3851b8d757c (diff) | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'drivers/net/ixp2000')
| -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 b02a981c87a..34a6cfd1793 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 6baf3c94b3e..e9d9d595e1b 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 | ||
| @@ -270,6 +271,15 @@ static int ixpdev_close(struct net_device *dev) | |||
| 270 | return 0; | 271 | return 0; |
| 271 | } | 272 | } |
| 272 | 273 | ||
| 274 | static struct net_device_stats *ixpdev_get_stats(struct net_device *dev) | ||
| 275 | { | ||
| 276 | struct ixpdev_priv *ip = netdev_priv(dev); | ||
| 277 | |||
| 278 | pm3386_get_stats(ip->channel, &(dev->stats)); | ||
| 279 | |||
| 280 | return &(dev->stats); | ||
| 281 | } | ||
| 282 | |||
| 273 | static const struct net_device_ops ixpdev_netdev_ops = { | 283 | static const struct net_device_ops ixpdev_netdev_ops = { |
| 274 | .ndo_open = ixpdev_open, | 284 | .ndo_open = ixpdev_open, |
| 275 | .ndo_stop = ixpdev_close, | 285 | .ndo_stop = ixpdev_close, |
| @@ -277,6 +287,7 @@ static const struct net_device_ops ixpdev_netdev_ops = { | |||
| 277 | .ndo_change_mtu = eth_change_mtu, | 287 | .ndo_change_mtu = eth_change_mtu, |
| 278 | .ndo_validate_addr = eth_validate_addr, | 288 | .ndo_validate_addr = eth_validate_addr, |
| 279 | .ndo_set_mac_address = eth_mac_addr, | 289 | .ndo_set_mac_address = eth_mac_addr, |
| 290 | .ndo_get_stats = ixpdev_get_stats, | ||
| 280 | #ifdef CONFIG_NET_POLL_CONTROLLER | 291 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 281 | .ndo_poll_controller = ixpdev_poll_controller, | 292 | .ndo_poll_controller = ixpdev_poll_controller, |
| 282 | #endif | 293 | #endif |
