diff options
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r-- | drivers/net/xen-netfront.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 6d017adc914a..cd6184ee08ee 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -196,7 +196,7 @@ static void rx_refill_timeout(unsigned long data) | |||
196 | { | 196 | { |
197 | struct net_device *dev = (struct net_device *)data; | 197 | struct net_device *dev = (struct net_device *)data; |
198 | struct netfront_info *np = netdev_priv(dev); | 198 | struct netfront_info *np = netdev_priv(dev); |
199 | netif_rx_schedule(dev, &np->napi); | 199 | netif_rx_schedule(&np->napi); |
200 | } | 200 | } |
201 | 201 | ||
202 | static int netfront_tx_slot_available(struct netfront_info *np) | 202 | static int netfront_tx_slot_available(struct netfront_info *np) |
@@ -328,7 +328,7 @@ static int xennet_open(struct net_device *dev) | |||
328 | xennet_alloc_rx_buffers(dev); | 328 | xennet_alloc_rx_buffers(dev); |
329 | np->rx.sring->rsp_event = np->rx.rsp_cons + 1; | 329 | np->rx.sring->rsp_event = np->rx.rsp_cons + 1; |
330 | if (RING_HAS_UNCONSUMED_RESPONSES(&np->rx)) | 330 | if (RING_HAS_UNCONSUMED_RESPONSES(&np->rx)) |
331 | netif_rx_schedule(dev, &np->napi); | 331 | netif_rx_schedule(&np->napi); |
332 | } | 332 | } |
333 | spin_unlock_bh(&np->rx_lock); | 333 | spin_unlock_bh(&np->rx_lock); |
334 | 334 | ||
@@ -841,7 +841,6 @@ static int handle_incoming_queue(struct net_device *dev, | |||
841 | 841 | ||
842 | /* Pass it up. */ | 842 | /* Pass it up. */ |
843 | netif_receive_skb(skb); | 843 | netif_receive_skb(skb); |
844 | dev->last_rx = jiffies; | ||
845 | } | 844 | } |
846 | 845 | ||
847 | return packets_dropped; | 846 | return packets_dropped; |
@@ -980,7 +979,7 @@ err: | |||
980 | 979 | ||
981 | RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do); | 980 | RING_FINAL_CHECK_FOR_RESPONSES(&np->rx, more_to_do); |
982 | if (!more_to_do) | 981 | if (!more_to_do) |
983 | __netif_rx_complete(dev, napi); | 982 | __netif_rx_complete(napi); |
984 | 983 | ||
985 | local_irq_restore(flags); | 984 | local_irq_restore(flags); |
986 | } | 985 | } |
@@ -1106,6 +1105,16 @@ static void xennet_uninit(struct net_device *dev) | |||
1106 | gnttab_free_grant_references(np->gref_rx_head); | 1105 | gnttab_free_grant_references(np->gref_rx_head); |
1107 | } | 1106 | } |
1108 | 1107 | ||
1108 | static const struct net_device_ops xennet_netdev_ops = { | ||
1109 | .ndo_open = xennet_open, | ||
1110 | .ndo_uninit = xennet_uninit, | ||
1111 | .ndo_stop = xennet_close, | ||
1112 | .ndo_start_xmit = xennet_start_xmit, | ||
1113 | .ndo_change_mtu = xennet_change_mtu, | ||
1114 | .ndo_set_mac_address = eth_mac_addr, | ||
1115 | .ndo_validate_addr = eth_validate_addr, | ||
1116 | }; | ||
1117 | |||
1109 | static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev) | 1118 | static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev) |
1110 | { | 1119 | { |
1111 | int i, err; | 1120 | int i, err; |
@@ -1162,12 +1171,9 @@ static struct net_device * __devinit xennet_create_dev(struct xenbus_device *dev | |||
1162 | goto exit_free_tx; | 1171 | goto exit_free_tx; |
1163 | } | 1172 | } |
1164 | 1173 | ||
1165 | netdev->open = xennet_open; | 1174 | netdev->netdev_ops = &xennet_netdev_ops; |
1166 | netdev->hard_start_xmit = xennet_start_xmit; | 1175 | |
1167 | netdev->stop = xennet_close; | ||
1168 | netif_napi_add(netdev, &np->napi, xennet_poll, 64); | 1176 | netif_napi_add(netdev, &np->napi, xennet_poll, 64); |
1169 | netdev->uninit = xennet_uninit; | ||
1170 | netdev->change_mtu = xennet_change_mtu; | ||
1171 | netdev->features = NETIF_F_IP_CSUM; | 1177 | netdev->features = NETIF_F_IP_CSUM; |
1172 | 1178 | ||
1173 | SET_ETHTOOL_OPS(netdev, &xennet_ethtool_ops); | 1179 | SET_ETHTOOL_OPS(netdev, &xennet_ethtool_ops); |
@@ -1311,7 +1317,7 @@ static irqreturn_t xennet_interrupt(int irq, void *dev_id) | |||
1311 | xennet_tx_buf_gc(dev); | 1317 | xennet_tx_buf_gc(dev); |
1312 | /* Under tx_lock: protects access to rx shared-ring indexes. */ | 1318 | /* Under tx_lock: protects access to rx shared-ring indexes. */ |
1313 | if (RING_HAS_UNCONSUMED_RESPONSES(&np->rx)) | 1319 | if (RING_HAS_UNCONSUMED_RESPONSES(&np->rx)) |
1314 | netif_rx_schedule(dev, &np->napi); | 1320 | netif_rx_schedule(&np->napi); |
1315 | } | 1321 | } |
1316 | 1322 | ||
1317 | spin_unlock_irqrestore(&np->tx_lock, flags); | 1323 | spin_unlock_irqrestore(&np->tx_lock, flags); |