diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-27 21:35:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-27 21:35:03 -0400 |
commit | 5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (patch) | |
tree | 357258d77e2153ef7409926773655c5f8775a1f3 /arch | |
parent | 7b616c8a2f5c8507b4aed6907336ec5b85803a39 (diff) | |
parent | 0870352bc6e0dee485c86a0c99dd60e7089c8917 (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: (166 commits)
Revert "ax25: zero length frame filtering in AX25"
Revert "netrom: zero length frame filtering in NetRom"
cfg80211: default CONFIG_WIRELESS_OLD_REGULATORY to n
mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi
mac80211: fix aggregation to not require queue stop
mac80211: add skb length sanity checking
mac80211: unify and fix TX aggregation start
mac80211: clean up __ieee80211_tx args
mac80211: rework the pending packets code
mac80211: fix A-MPDU queue assignment
mac80211: rewrite fragmentation
iwlwifi: show current driver status in user readable format
b43: Add BCM4307 PCI-ID
cfg80211: fix locking in nl80211_set_wiphy
mac80211: fix RX path
ath5k: properly drop packets from ops->tx
ar9170: single module build
ath9k: fix dma mapping leak of rx buffer upon rmmod
rt2x00: New USB ID for rt73usb
ath5k: warn and correct rate for unknown hw rate indexes
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/um/drivers/net_kern.c | 39 | ||||
-rw-r--r-- | arch/um/include/shared/net_kern.h | 2 |
2 files changed, 20 insertions, 21 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index fde510b664d3..434224e2229f 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -86,7 +86,7 @@ static int uml_net_rx(struct net_device *dev) | |||
86 | drop_skb->dev = dev; | 86 | drop_skb->dev = dev; |
87 | /* Read a packet into drop_skb and don't do anything with it. */ | 87 | /* Read a packet into drop_skb and don't do anything with it. */ |
88 | (*lp->read)(lp->fd, drop_skb, lp); | 88 | (*lp->read)(lp->fd, drop_skb, lp); |
89 | lp->stats.rx_dropped++; | 89 | dev->stats.rx_dropped++; |
90 | return 0; | 90 | return 0; |
91 | } | 91 | } |
92 | 92 | ||
@@ -99,8 +99,8 @@ static int uml_net_rx(struct net_device *dev) | |||
99 | skb_trim(skb, pkt_len); | 99 | skb_trim(skb, pkt_len); |
100 | skb->protocol = (*lp->protocol)(skb); | 100 | skb->protocol = (*lp->protocol)(skb); |
101 | 101 | ||
102 | lp->stats.rx_bytes += skb->len; | 102 | dev->stats.rx_bytes += skb->len; |
103 | lp->stats.rx_packets++; | 103 | dev->stats.rx_packets++; |
104 | netif_rx(skb); | 104 | netif_rx(skb); |
105 | return pkt_len; | 105 | return pkt_len; |
106 | } | 106 | } |
@@ -224,8 +224,8 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
224 | len = (*lp->write)(lp->fd, skb, lp); | 224 | len = (*lp->write)(lp->fd, skb, lp); |
225 | 225 | ||
226 | if (len == skb->len) { | 226 | if (len == skb->len) { |
227 | lp->stats.tx_packets++; | 227 | dev->stats.tx_packets++; |
228 | lp->stats.tx_bytes += skb->len; | 228 | dev->stats.tx_bytes += skb->len; |
229 | dev->trans_start = jiffies; | 229 | dev->trans_start = jiffies; |
230 | netif_start_queue(dev); | 230 | netif_start_queue(dev); |
231 | 231 | ||
@@ -234,7 +234,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
234 | } | 234 | } |
235 | else if (len == 0) { | 235 | else if (len == 0) { |
236 | netif_start_queue(dev); | 236 | netif_start_queue(dev); |
237 | lp->stats.tx_dropped++; | 237 | dev->stats.tx_dropped++; |
238 | } | 238 | } |
239 | else { | 239 | else { |
240 | netif_start_queue(dev); | 240 | netif_start_queue(dev); |
@@ -248,12 +248,6 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
250 | 250 | ||
251 | static struct net_device_stats *uml_net_get_stats(struct net_device *dev) | ||
252 | { | ||
253 | struct uml_net_private *lp = netdev_priv(dev); | ||
254 | return &lp->stats; | ||
255 | } | ||
256 | |||
257 | static void uml_net_set_multicast_list(struct net_device *dev) | 251 | static void uml_net_set_multicast_list(struct net_device *dev) |
258 | { | 252 | { |
259 | return; | 253 | return; |
@@ -377,6 +371,18 @@ static void net_device_release(struct device *dev) | |||
377 | free_netdev(netdev); | 371 | free_netdev(netdev); |
378 | } | 372 | } |
379 | 373 | ||
374 | static const struct net_device_ops uml_netdev_ops = { | ||
375 | .ndo_open = uml_net_open, | ||
376 | .ndo_stop = uml_net_close, | ||
377 | .ndo_start_xmit = uml_net_start_xmit, | ||
378 | .ndo_set_multicast_list = uml_net_set_multicast_list, | ||
379 | .ndo_tx_timeout = uml_net_tx_timeout, | ||
380 | .ndo_set_mac_address = uml_net_set_mac, | ||
381 | .ndo_change_mtu = uml_net_change_mtu, | ||
382 | .ndo_set_mac_address = eth_mac_addr, | ||
383 | .ndo_validate_addr = eth_validate_addr, | ||
384 | }; | ||
385 | |||
380 | /* | 386 | /* |
381 | * Ensures that platform_driver_register is called only once by | 387 | * Ensures that platform_driver_register is called only once by |
382 | * eth_configure. Will be set in an initcall. | 388 | * eth_configure. Will be set in an initcall. |
@@ -473,14 +479,7 @@ static void eth_configure(int n, void *init, char *mac, | |||
473 | 479 | ||
474 | set_ether_mac(dev, device->mac); | 480 | set_ether_mac(dev, device->mac); |
475 | dev->mtu = transport->user->mtu; | 481 | dev->mtu = transport->user->mtu; |
476 | dev->open = uml_net_open; | 482 | dev->netdev_ops = ¨_netdev_ops; |
477 | dev->hard_start_xmit = uml_net_start_xmit; | ||
478 | dev->stop = uml_net_close; | ||
479 | dev->get_stats = uml_net_get_stats; | ||
480 | dev->set_multicast_list = uml_net_set_multicast_list; | ||
481 | dev->tx_timeout = uml_net_tx_timeout; | ||
482 | dev->set_mac_address = uml_net_set_mac; | ||
483 | dev->change_mtu = uml_net_change_mtu; | ||
484 | dev->ethtool_ops = ¨_net_ethtool_ops; | 483 | dev->ethtool_ops = ¨_net_ethtool_ops; |
485 | dev->watchdog_timeo = (HZ >> 1); | 484 | dev->watchdog_timeo = (HZ >> 1); |
486 | dev->irq = UM_ETH_IRQ; | 485 | dev->irq = UM_ETH_IRQ; |
diff --git a/arch/um/include/shared/net_kern.h b/arch/um/include/shared/net_kern.h index d843c7924a7c..5c367f22595b 100644 --- a/arch/um/include/shared/net_kern.h +++ b/arch/um/include/shared/net_kern.h | |||
@@ -26,7 +26,7 @@ struct uml_net_private { | |||
26 | spinlock_t lock; | 26 | spinlock_t lock; |
27 | struct net_device *dev; | 27 | struct net_device *dev; |
28 | struct timer_list tl; | 28 | struct timer_list tl; |
29 | struct net_device_stats stats; | 29 | |
30 | struct work_struct work; | 30 | struct work_struct work; |
31 | int fd; | 31 | int fd; |
32 | unsigned char mac[ETH_ALEN]; | 32 | unsigned char mac[ETH_ALEN]; |