diff options
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r-- | net/core/netpoll.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index dadac6281f20..755414cd49d1 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -58,6 +58,7 @@ static void queue_process(struct work_struct *work) | |||
58 | 58 | ||
59 | while ((skb = skb_dequeue(&npinfo->txq))) { | 59 | while ((skb = skb_dequeue(&npinfo->txq))) { |
60 | struct net_device *dev = skb->dev; | 60 | struct net_device *dev = skb->dev; |
61 | const struct net_device_ops *ops = dev->netdev_ops; | ||
61 | struct netdev_queue *txq; | 62 | struct netdev_queue *txq; |
62 | 63 | ||
63 | if (!netif_device_present(dev) || !netif_running(dev)) { | 64 | if (!netif_device_present(dev) || !netif_running(dev)) { |
@@ -71,7 +72,7 @@ static void queue_process(struct work_struct *work) | |||
71 | __netif_tx_lock(txq, smp_processor_id()); | 72 | __netif_tx_lock(txq, smp_processor_id()); |
72 | if (netif_tx_queue_stopped(txq) || | 73 | if (netif_tx_queue_stopped(txq) || |
73 | netif_tx_queue_frozen(txq) || | 74 | netif_tx_queue_frozen(txq) || |
74 | dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) { | 75 | ops->ndo_start_xmit(skb, dev) != NETDEV_TX_OK) { |
75 | skb_queue_head(&npinfo->txq, skb); | 76 | skb_queue_head(&npinfo->txq, skb); |
76 | __netif_tx_unlock(txq); | 77 | __netif_tx_unlock(txq); |
77 | local_irq_restore(flags); | 78 | local_irq_restore(flags); |
@@ -174,12 +175,13 @@ static void service_arp_queue(struct netpoll_info *npi) | |||
174 | void netpoll_poll(struct netpoll *np) | 175 | void netpoll_poll(struct netpoll *np) |
175 | { | 176 | { |
176 | struct net_device *dev = np->dev; | 177 | struct net_device *dev = np->dev; |
178 | const struct net_device_ops *ops = dev->netdev_ops; | ||
177 | 179 | ||
178 | if (!dev || !netif_running(dev) || !dev->poll_controller) | 180 | if (!dev || !netif_running(dev) || !ops->ndo_poll_controller) |
179 | return; | 181 | return; |
180 | 182 | ||
181 | /* Process pending work on NIC */ | 183 | /* Process pending work on NIC */ |
182 | dev->poll_controller(dev); | 184 | ops->ndo_poll_controller(dev); |
183 | 185 | ||
184 | poll_napi(dev); | 186 | poll_napi(dev); |
185 | 187 | ||
@@ -274,6 +276,7 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
274 | int status = NETDEV_TX_BUSY; | 276 | int status = NETDEV_TX_BUSY; |
275 | unsigned long tries; | 277 | unsigned long tries; |
276 | struct net_device *dev = np->dev; | 278 | struct net_device *dev = np->dev; |
279 | const struct net_device_ops *ops = dev->netdev_ops; | ||
277 | struct netpoll_info *npinfo = np->dev->npinfo; | 280 | struct netpoll_info *npinfo = np->dev->npinfo; |
278 | 281 | ||
279 | if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { | 282 | if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { |
@@ -294,7 +297,7 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | |||
294 | tries > 0; --tries) { | 297 | tries > 0; --tries) { |
295 | if (__netif_tx_trylock(txq)) { | 298 | if (__netif_tx_trylock(txq)) { |
296 | if (!netif_tx_queue_stopped(txq)) | 299 | if (!netif_tx_queue_stopped(txq)) |
297 | status = dev->hard_start_xmit(skb, dev); | 300 | status = ops->ndo_start_xmit(skb, dev); |
298 | __netif_tx_unlock(txq); | 301 | __netif_tx_unlock(txq); |
299 | 302 | ||
300 | if (status == NETDEV_TX_OK) | 303 | if (status == NETDEV_TX_OK) |
@@ -345,7 +348,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) | |||
345 | udph->check = csum_tcpudp_magic(htonl(np->local_ip), | 348 | udph->check = csum_tcpudp_magic(htonl(np->local_ip), |
346 | htonl(np->remote_ip), | 349 | htonl(np->remote_ip), |
347 | udp_len, IPPROTO_UDP, | 350 | udp_len, IPPROTO_UDP, |
348 | csum_partial((unsigned char *)udph, udp_len, 0)); | 351 | csum_partial(udph, udp_len, 0)); |
349 | if (udph->check == 0) | 352 | if (udph->check == 0) |
350 | udph->check = CSUM_MANGLED_0; | 353 | udph->check = CSUM_MANGLED_0; |
351 | 354 | ||
@@ -555,7 +558,6 @@ out: | |||
555 | 558 | ||
556 | void netpoll_print_options(struct netpoll *np) | 559 | void netpoll_print_options(struct netpoll *np) |
557 | { | 560 | { |
558 | DECLARE_MAC_BUF(mac); | ||
559 | printk(KERN_INFO "%s: local port %d\n", | 561 | printk(KERN_INFO "%s: local port %d\n", |
560 | np->name, np->local_port); | 562 | np->name, np->local_port); |
561 | printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", | 563 | printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", |
@@ -566,8 +568,8 @@ void netpoll_print_options(struct netpoll *np) | |||
566 | np->name, np->remote_port); | 568 | np->name, np->remote_port); |
567 | printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", | 569 | printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", |
568 | np->name, HIPQUAD(np->remote_ip)); | 570 | np->name, HIPQUAD(np->remote_ip)); |
569 | printk(KERN_INFO "%s: remote ethernet address %s\n", | 571 | printk(KERN_INFO "%s: remote ethernet address %pM\n", |
570 | np->name, print_mac(mac, np->remote_mac)); | 572 | np->name, np->remote_mac); |
571 | } | 573 | } |
572 | 574 | ||
573 | int netpoll_parse_options(struct netpoll *np, char *opt) | 575 | int netpoll_parse_options(struct netpoll *np, char *opt) |
@@ -697,7 +699,7 @@ int netpoll_setup(struct netpoll *np) | |||
697 | atomic_inc(&npinfo->refcnt); | 699 | atomic_inc(&npinfo->refcnt); |
698 | } | 700 | } |
699 | 701 | ||
700 | if (!ndev->poll_controller) { | 702 | if (!ndev->netdev_ops->ndo_poll_controller) { |
701 | printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n", | 703 | printk(KERN_ERR "%s: %s doesn't support polling, aborting.\n", |
702 | np->name, np->dev_name); | 704 | np->name, np->dev_name); |
703 | err = -ENOTSUPP; | 705 | err = -ENOTSUPP; |