direct-io.hg

changeset 6463:70be155e9e9c

Update suspend/resume functions for xenbus.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Aug 29 17:15:56 2005 +0000 (2005-08-29)
parents b88e1417bd14
children b3785cbb723b
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Mon Aug 29 17:14:08 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Mon Aug 29 17:15:56 2005 +0000
     1.3 @@ -1272,25 +1272,24 @@ static int netfront_remove(struct xenbus
     1.4  
     1.5  static int netfront_suspend(struct xenbus_device *dev)
     1.6  {
     1.7 -    struct net_private *np = dev->data;
     1.8 -    /* Avoid having tx/rx stuff happen until we're ready. */
     1.9 -    unbind_evtchn_from_irqhandler(np->evtchn, np->netdev);
    1.10 -    return 0;
    1.11 +	struct netfront_info *info = dev->data;
    1.12 +
    1.13 +	unregister_xenbus_watch(&info->watch);
    1.14 +	kfree(info->backend);
    1.15 +	info->backend = NULL;
    1.16 +
    1.17 +	netif_free(info);
    1.18 +
    1.19 +	return 0;
    1.20  }
    1.21  
    1.22  static int netfront_resume(struct xenbus_device *dev)
    1.23  {
    1.24 -    struct net_private *np = dev->data;
    1.25 -    /*
    1.26 -     * Connect regardless of whether IFF_UP flag set.
    1.27 -     * Stop bad things from happening until we're back up.
    1.28 -     */
    1.29 -    np->backend_state = BEST_DISCONNECTED;
    1.30 -    memset(np->tx, 0, PAGE_SIZE);
    1.31 -    memset(np->rx, 0, PAGE_SIZE);
    1.32 -    
    1.33 -    // send_interface_connect(np);
    1.34 -    return 0;
    1.35 +	struct net_private *np = dev->data;
    1.36 +	int err;
    1.37 +
    1.38 +	err = talk_to_backend(dev, np);
    1.39 +	return err;
    1.40  }
    1.41  
    1.42  static struct xenbus_driver netfront = {