aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-01-04 14:45:52 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-01-04 14:45:52 +0100
commitff6e4be615cb8a299908c6c65d2d257a2104edb1 (patch)
tree8681303c1ad997b24f91237eb5f5daa8830a2939
parentb84e890ff3c7076a81971cf1535b26a7b5b4bbd7 (diff)
downloadxen-ff6e4be615cb8a299908c6c65d2d257a2104edb1.tar.gz
xen-ff6e4be615cb8a299908c6c65d2d257a2104edb1.tar.bz2
xen-ff6e4be615cb8a299908c6c65d2d257a2104edb1.zip
Fix split of duties between close_netdev() and
netif_disconnect_backend() in netif driver. Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
index eca6b4c888..2acba6b21d 100644
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
@@ -1218,22 +1218,14 @@ static int netfront_remove(struct xenbus_device *dev)
static void close_netdev(struct netfront_info *info)
{
- /* Stop old i/f to prevent errors whilst we rebuild the state. */
- spin_lock_irq(&info->tx_lock);
- spin_lock(&info->rx_lock);
+ spin_lock_irq(&info->netdev->xmit_lock);
netif_stop_queue(info->netdev);
- /* info->backend_state = BEST_DISCONNECTED; */
- spin_unlock(&info->rx_lock);
- spin_unlock_irq(&info->tx_lock);
+ spin_unlock_irq(&info->netdev->xmit_lock);
#ifdef CONFIG_PROC_FS
xennet_proc_delif(info->netdev);
#endif
- if (info->irq)
- unbind_from_irqhandler(info->irq, info->netdev);
- info->evtchn = info->irq = 0;
-
del_timer_sync(&info->rx_refill_timer);
unregister_netdev(info->netdev);
@@ -1242,6 +1234,17 @@ static void close_netdev(struct netfront_info *info)
static void netif_disconnect_backend(struct netfront_info *info)
{
+ /* Stop old i/f to prevent errors whilst we rebuild the state. */
+ spin_lock_irq(&info->tx_lock);
+ spin_lock(&info->rx_lock);
+ info->backend_state = BEST_DISCONNECTED;
+ spin_unlock(&info->rx_lock);
+ spin_unlock_irq(&info->tx_lock);
+
+ if (info->irq)
+ unbind_from_irqhandler(info->irq, info->netdev);
+ info->evtchn = info->irq = 0;
+
end_access(info->tx_ring_ref, info->tx.sring);
end_access(info->rx_ring_ref, info->rx.sring);
info->tx_ring_ref = GRANT_INVALID_REF;