diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 17:25:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 17:25:41 -0500 |
commit | 5fbbf5f648a9c4ef99276854f05b2255d1b004d3 (patch) | |
tree | 59c9ae762c3df2800e894001b3de58c5f1972486 /drivers/net/tulip/xircom_cb.c | |
parent | ce279e6ec91c49f2c5f59f7492e19d39edbf8bbd (diff) | |
parent | 56cf391a9462a4897ea660a6af3662dda5ae8c84 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (84 commits)
wimax: fix kernel-doc for debufs_dentry member of struct wimax_dev
net: convert pegasus driver to net_device_ops
bnx2x: Prevent eeprom set when driver is down
net: switch kaweth driver to netdevops
pcnet32: round off carrier watch timer
i2400m/usb: wrap USB power saving in #ifdef CONFIG_PM
wimax: testing for rfkill support should also test for CONFIG_RFKILL_MODULE
wimax: fix kconfig interactions with rfkill and input layers
wimax: fix '#ifndef CONFIG_BUG' layout to avoid warning
r6040: bump release number to 0.20
r6040: warn about MAC address being unset
r6040: check PHY status when bringing interface up
r6040: make printks consistent with DRV_NAME
gianfar: Fixup use of BUS_ID_SIZE
mlx4_en: Returning real Max in get_ringparam
mlx4_en: Consider inline packets on completion
netdev: bfin_mac: enable bfin_mac net dev driver for BF51x
qeth: convert to net_device_ops
vlan: add neigh_setup
dm9601: warn on invalid mac address
...
Diffstat (limited to 'drivers/net/tulip/xircom_cb.c')
-rw-r--r-- | drivers/net/tulip/xircom_cb.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 13c8703ecb9f..c2ca9f40e40e 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -104,10 +104,8 @@ struct xircom_private { | |||
104 | */ | 104 | */ |
105 | spinlock_t lock; | 105 | spinlock_t lock; |
106 | 106 | ||
107 | |||
108 | struct pci_dev *pdev; | 107 | struct pci_dev *pdev; |
109 | struct net_device *dev; | 108 | struct net_device *dev; |
110 | struct net_device_stats stats; | ||
111 | }; | 109 | }; |
112 | 110 | ||
113 | 111 | ||
@@ -119,7 +117,6 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev); | |||
119 | static int xircom_open(struct net_device *dev); | 117 | static int xircom_open(struct net_device *dev); |
120 | static int xircom_close(struct net_device *dev); | 118 | static int xircom_close(struct net_device *dev); |
121 | static void xircom_up(struct xircom_private *card); | 119 | static void xircom_up(struct xircom_private *card); |
122 | static struct net_device_stats *xircom_get_stats(struct net_device *dev); | ||
123 | #ifdef CONFIG_NET_POLL_CONTROLLER | 120 | #ifdef CONFIG_NET_POLL_CONTROLLER |
124 | static void xircom_poll_controller(struct net_device *dev); | 121 | static void xircom_poll_controller(struct net_device *dev); |
125 | #endif | 122 | #endif |
@@ -194,6 +191,18 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
194 | .get_drvinfo = netdev_get_drvinfo, | 191 | .get_drvinfo = netdev_get_drvinfo, |
195 | }; | 192 | }; |
196 | 193 | ||
194 | static const struct net_device_ops netdev_ops = { | ||
195 | .ndo_open = xircom_open, | ||
196 | .ndo_stop = xircom_close, | ||
197 | .ndo_start_xmit = xircom_start_xmit, | ||
198 | .ndo_change_mtu = eth_change_mtu, | ||
199 | .ndo_set_mac_address = eth_mac_addr, | ||
200 | .ndo_validate_addr = eth_validate_addr, | ||
201 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
202 | .ndo_poll_controller = xircom_poll_controller, | ||
203 | #endif | ||
204 | }; | ||
205 | |||
197 | /* xircom_probe is the code that gets called on device insertion. | 206 | /* xircom_probe is the code that gets called on device insertion. |
198 | it sets up the hardware and registers the device to the networklayer. | 207 | it sets up the hardware and registers the device to the networklayer. |
199 | 208 | ||
@@ -266,13 +275,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
266 | read_mac_address(private); | 275 | read_mac_address(private); |
267 | setup_descriptors(private); | 276 | setup_descriptors(private); |
268 | 277 | ||
269 | dev->open = &xircom_open; | 278 | dev->netdev_ops = &netdev_ops; |
270 | dev->hard_start_xmit = &xircom_start_xmit; | ||
271 | dev->stop = &xircom_close; | ||
272 | dev->get_stats = &xircom_get_stats; | ||
273 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
274 | dev->poll_controller = &xircom_poll_controller; | ||
275 | #endif | ||
276 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 279 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
277 | pci_set_drvdata(pdev, dev); | 280 | pci_set_drvdata(pdev, dev); |
278 | 281 | ||
@@ -497,14 +500,6 @@ static int xircom_close(struct net_device *dev) | |||
497 | } | 500 | } |
498 | 501 | ||
499 | 502 | ||
500 | |||
501 | static struct net_device_stats *xircom_get_stats(struct net_device *dev) | ||
502 | { | ||
503 | struct xircom_private *card = netdev_priv(dev); | ||
504 | return &card->stats; | ||
505 | } | ||
506 | |||
507 | |||
508 | #ifdef CONFIG_NET_POLL_CONTROLLER | 503 | #ifdef CONFIG_NET_POLL_CONTROLLER |
509 | static void xircom_poll_controller(struct net_device *dev) | 504 | static void xircom_poll_controller(struct net_device *dev) |
510 | { | 505 | { |
@@ -1193,7 +1188,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri | |||
1193 | 1188 | ||
1194 | skb = dev_alloc_skb(pkt_len + 2); | 1189 | skb = dev_alloc_skb(pkt_len + 2); |
1195 | if (skb == NULL) { | 1190 | if (skb == NULL) { |
1196 | card->stats.rx_dropped++; | 1191 | dev->stats.rx_dropped++; |
1197 | goto out; | 1192 | goto out; |
1198 | } | 1193 | } |
1199 | skb_reserve(skb, 2); | 1194 | skb_reserve(skb, 2); |
@@ -1201,8 +1196,8 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri | |||
1201 | skb_put(skb, pkt_len); | 1196 | skb_put(skb, pkt_len); |
1202 | skb->protocol = eth_type_trans(skb, dev); | 1197 | skb->protocol = eth_type_trans(skb, dev); |
1203 | netif_rx(skb); | 1198 | netif_rx(skb); |
1204 | card->stats.rx_packets++; | 1199 | dev->stats.rx_packets++; |
1205 | card->stats.rx_bytes += pkt_len; | 1200 | dev->stats.rx_bytes += pkt_len; |
1206 | 1201 | ||
1207 | out: | 1202 | out: |
1208 | /* give the buffer back to the card */ | 1203 | /* give the buffer back to the card */ |
@@ -1232,16 +1227,16 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p | |||
1232 | #endif | 1227 | #endif |
1233 | if (status > 0) { /* bit 31 is 0 when done */ | 1228 | if (status > 0) { /* bit 31 is 0 when done */ |
1234 | if (card->tx_skb[descnr]!=NULL) { | 1229 | if (card->tx_skb[descnr]!=NULL) { |
1235 | card->stats.tx_bytes += card->tx_skb[descnr]->len; | 1230 | dev->stats.tx_bytes += card->tx_skb[descnr]->len; |
1236 | dev_kfree_skb_irq(card->tx_skb[descnr]); | 1231 | dev_kfree_skb_irq(card->tx_skb[descnr]); |
1237 | } | 1232 | } |
1238 | card->tx_skb[descnr] = NULL; | 1233 | card->tx_skb[descnr] = NULL; |
1239 | /* Bit 8 in the status field is 1 if there was a collision */ | 1234 | /* Bit 8 in the status field is 1 if there was a collision */ |
1240 | if (status&(1<<8)) | 1235 | if (status&(1<<8)) |
1241 | card->stats.collisions++; | 1236 | dev->stats.collisions++; |
1242 | card->tx_buffer[4*descnr] = 0; /* descriptor is free again */ | 1237 | card->tx_buffer[4*descnr] = 0; /* descriptor is free again */ |
1243 | netif_wake_queue (dev); | 1238 | netif_wake_queue (dev); |
1244 | card->stats.tx_packets++; | 1239 | dev->stats.tx_packets++; |
1245 | } | 1240 | } |
1246 | 1241 | ||
1247 | leave("investigate_write_descriptor"); | 1242 | leave("investigate_write_descriptor"); |