ia64/xen-unstable

changeset 885:784ff7081d81

bitkeeper revision 1.556 (3fa7b553guSnjbQHPSIHI8pvbUVpdg)

setup.c, network.c:
A couple more bug fixes in xenolinux suspend/resume code.
author kaf24@scramble.cl.cam.ac.uk
date Tue Nov 04 14:18:59 2003 +0000 (2003-11-04)
parents 615324cd0f00
children 2a289f47eb41
files xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c
line diff
     1.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c	Tue Nov 04 13:13:08 2003 +0000
     1.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/network/network.c	Tue Nov 04 14:18:59 2003 +0000
     1.3 @@ -83,10 +83,13 @@ struct net_private
     1.4      _id; })
     1.5  
     1.6  
     1.7 -static void dbg_network_int(int irq, void *dev_id, struct pt_regs *ptregs)
     1.8 +static void _dbg_network_int(struct net_device *dev)
     1.9  {
    1.10 -    struct net_device *dev = (struct net_device *)dev_id;
    1.11      struct net_private *np = dev->priv;
    1.12 +
    1.13 +    if ( np->state == STATE_CLOSED )
    1.14 +        return;
    1.15 +    
    1.16      printk(KERN_ALERT "tx_full = %d, tx_entries = %d, tx_resp_cons = %d,"
    1.17             " tx_req_prod = %d, tx_resp_prod = %d, tx_event = %d, state=%d\n",
    1.18             np->tx_full, atomic_read(&np->tx_entries), np->tx_resp_cons, 
    1.19 @@ -100,6 +103,18 @@ static void dbg_network_int(int irq, voi
    1.20  }
    1.21  
    1.22  
    1.23 +static void dbg_network_int(int irq, void *unused, struct pt_regs *ptregs)
    1.24 +{
    1.25 +    struct list_head *ent;
    1.26 +    struct net_private *np;
    1.27 +    list_for_each ( ent, &dev_list )
    1.28 +    {
    1.29 +        np = list_entry(ent, struct net_private, list);
    1.30 +        _dbg_network_int(np->dev);
    1.31 +    }
    1.32 +}
    1.33 +
    1.34 +
    1.35  static int network_open(struct net_device *dev)
    1.36  {
    1.37      struct net_private *np = dev->priv;
     2.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c	Tue Nov 04 13:13:08 2003 +0000
     2.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c	Tue Nov 04 14:18:59 2003 +0000
     2.3 @@ -46,6 +46,7 @@
     2.4  #include <asm/hypervisor.h>
     2.5  #include <asm/hypervisor-ifs/dom0_ops.h>
     2.6  #include <linux/netdevice.h>
     2.7 +#include <linux/rtnetlink.h>
     2.8  #include <linux/tqueue.h>
     2.9  
    2.10  /*
    2.11 @@ -1066,15 +1067,14 @@ static void stop_task(void *unused)
    2.12      char name[6];
    2.13      int i;
    2.14  
    2.15 -    /* Close down all Ethernet interfaces. */
    2.16 +    rtnl_lock();
    2.17      for ( i = 0; i < 10; i++ )
    2.18      {
    2.19          sprintf(name, "eth%d", i);
    2.20 -        if ( (dev = dev_get_by_name(name)) == NULL )
    2.21 -            continue;
    2.22 -        dev_close(dev);
    2.23 -        dev_put(dev);
    2.24 +        if ( (dev = __dev_get_by_name(name)) != NULL )
    2.25 +            dev_close(dev);
    2.26      }
    2.27 +    rtnl_unlock();
    2.28  
    2.29      blkdev_suspend();
    2.30  
    2.31 @@ -1093,15 +1093,14 @@ static void stop_task(void *unused)
    2.32  
    2.33      blkdev_resume();
    2.34  
    2.35 -    /* Bring up all Ethernet interfaces. */
    2.36 +    rtnl_lock();
    2.37      for ( i = 0; i < 10; i++ )
    2.38      {
    2.39          sprintf(name, "eth%d", i);
    2.40 -        if ( (dev = dev_get_by_name(name)) == NULL )
    2.41 -            continue;
    2.42 -        dev_open(dev);
    2.43 -        dev_put(dev);
    2.44 +        if ( (dev = __dev_get_by_name(name)) != NULL )
    2.45 +            dev_open(dev);
    2.46      }
    2.47 +    rtnl_unlock();
    2.48  }
    2.49  
    2.50  static struct tq_struct stop_tq;