ia64/xen-unstable

changeset 643:e09b8abaa2e3

bitkeeper revision 1.360 (3f16a592sBZzTeaBpHZg9hKSw2MNow)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@scramble.cl.cam.ac.uk
date Thu Jul 17 13:33:06 2003 +0000 (2003-07-17)
parents f635998b684b b344838eb409
children 7fb9fbf0919c
files tools/internal/xi_build.c tools/internal/xi_destroy.c tools/internal/xi_start.c tools/internal/xi_stop.c xenolinux-2.4.21-sparse/arch/xeno/drivers/network/network.c
line diff
     1.1 --- a/tools/internal/xi_build.c	Thu Jul 17 09:13:56 2003 +0000
     1.2 +++ b/tools/internal/xi_build.c	Thu Jul 17 13:33:06 2003 +0000
     1.3 @@ -361,7 +361,13 @@ int main(int argc, char **argv)
     1.4          return 1;
     1.5      }
     1.6  
     1.7 -    domain_id = atol(argv[1]);
     1.8 +    domain_id = atoi(argv[1]);
     1.9 +    if ( domain_id == 0 )
    1.10 +    {
    1.11 +        ERROR("Did you really mean domain 0?");
    1.12 +        return 1;
    1.13 +    }
    1.14 +
    1.15      if ( (tot_pages = get_tot_pages(domain_id)) < 0 )
    1.16      {
    1.17          PERROR("Could not find total pages for domain");
     2.1 --- a/tools/internal/xi_destroy.c	Thu Jul 17 09:13:56 2003 +0000
     2.2 +++ b/tools/internal/xi_destroy.c	Thu Jul 17 13:33:06 2003 +0000
     2.3 @@ -21,7 +21,7 @@ static int kill_domain(int dom_id, int f
     2.4  
     2.5  int main(int argc, char **argv)
     2.6  {
     2.7 -    int ret;
     2.8 +    int ret, dom;
     2.9      
    2.10      if ( argv[0] != NULL ) 
    2.11          argv0 = argv[0];
    2.12 @@ -37,7 +37,14 @@ int main(int argc, char **argv)
    2.13      if ( (argc == 3) && strcmp("-f", argv[1]) )
    2.14          goto usage;
    2.15      
    2.16 -    ret = kill_domain(atoi(argv[argc-1]), argc == 3);
    2.17 +    dom = atoi(argv[argc-1]);
    2.18 +    if ( dom == 0 )
    2.19 +    {
    2.20 +        ERROR("Did you really mean domain 0?");
    2.21 +        return 1;
    2.22 +    }
    2.23 +
    2.24 +    ret = kill_domain(dom, argc == 3);
    2.25      
    2.26      return (ret != 0) ? 1 : 0;
    2.27  }
     3.1 --- a/tools/internal/xi_start.c	Thu Jul 17 09:13:56 2003 +0000
     3.2 +++ b/tools/internal/xi_start.c	Thu Jul 17 13:33:06 2003 +0000
     3.3 @@ -20,7 +20,7 @@ static int start_domain(int id)
     3.4  
     3.5  int main(int argc, char **argv)
     3.6  {
     3.7 -    int rc;
     3.8 +    int rc, dom;
     3.9  
    3.10      if ( argv[0] != NULL ) 
    3.11          argv0 = argv[0];
    3.12 @@ -31,7 +31,14 @@ int main(int argc, char **argv)
    3.13          return 1;
    3.14      }
    3.15  
    3.16 -    rc = start_domain(atol(argv[1]));
    3.17 +    dom = atoi(argv[1]);
    3.18 +    if ( dom == 0 )
    3.19 +    {
    3.20 +        ERROR("Did you really mean domain 0?");
    3.21 +        return 1;
    3.22 +    }
    3.23 +
    3.24 +    rc = start_domain(dom);;
    3.25  
    3.26      return (rc != 0) ? 1 : 0;
    3.27  }
     4.1 --- a/tools/internal/xi_stop.c	Thu Jul 17 09:13:56 2003 +0000
     4.2 +++ b/tools/internal/xi_stop.c	Thu Jul 17 13:33:06 2003 +0000
     4.3 @@ -19,7 +19,7 @@ static int stop_domain(int id)
     4.4  
     4.5  int main(int argc, char **argv)
     4.6  {
     4.7 -    int rc;
     4.8 +    int rc, dom;
     4.9  
    4.10      if ( argv[0] != NULL ) 
    4.11          argv0 = argv[0];
    4.12 @@ -30,7 +30,14 @@ int main(int argc, char **argv)
    4.13          return 1;
    4.14      }
    4.15  
    4.16 -    rc = stop_domain(atol(argv[1]));
    4.17 +    dom = atoi(argv[1]);
    4.18 +    if ( dom == 0 )
    4.19 +    {
    4.20 +        ERROR("Did you really mean domain 0?");
    4.21 +        return 1;
    4.22 +    }
    4.23 +
    4.24 +    rc = stop_domain(dom);
    4.25  
    4.26      return (rc != 0) ? 1 : 0;
    4.27  }
     5.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/network/network.c	Thu Jul 17 09:13:56 2003 +0000
     5.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/network/network.c	Thu Jul 17 13:33:06 2003 +0000
     5.3 @@ -47,6 +47,12 @@ static void cleanup_module(void);
     5.4  
     5.5  static struct list_head dev_list;
     5.6  
     5.7 +/*
     5.8 + * Needed because network_close() is not properly implemented yet. So
     5.9 + * an open after a close needs to do much less than the initial open.
    5.10 + */
    5.11 +static int opened_once_already = 0;
    5.12 +
    5.13  struct net_private
    5.14  {
    5.15      struct list_head list;
    5.16 @@ -100,6 +106,13 @@ static int network_open(struct net_devic
    5.17      struct net_private *np = dev->priv;
    5.18      int i, error = 0;
    5.19  
    5.20 +    if ( opened_once_already )
    5.21 +    {
    5.22 +        memset(&np->stats, 0, sizeof(np->stats));
    5.23 +        netif_start_queue(dev);
    5.24 +        return 0;
    5.25 +    }
    5.26 +
    5.27      np->rx_resp_cons = np->tx_resp_cons = np->tx_full = 0;
    5.28      memset(&np->stats, 0, sizeof(np->stats));
    5.29      spin_lock_init(&np->tx_lock);
    5.30 @@ -150,6 +163,8 @@ static int network_open(struct net_devic
    5.31  
    5.32      MOD_INC_USE_COUNT;
    5.33  
    5.34 +    opened_once_already = 1;
    5.35 +
    5.36      return 0;
    5.37  
    5.38   fail:
    5.39 @@ -228,15 +243,16 @@ static void network_alloc_rx_buffers(str
    5.40              virt_to_machine(get_ppte(skb->head));
    5.41      }
    5.42  
    5.43 -    np->net_idx->rx_req_prod = i;
    5.44 -
    5.45 -    np->net_idx->rx_event = RX_RING_INC(np->rx_resp_cons);
    5.46 -
    5.47      /*
    5.48       * We may have allocated buffers which have entries outstanding in
    5.49       * the page update queue -- make sure we flush those first!
    5.50       */
    5.51      flush_page_update_queue();
    5.52 +
    5.53 +    np->net_idx->rx_req_prod = i;
    5.54 +
    5.55 +    np->net_idx->rx_event = RX_RING_INC(np->rx_resp_cons);
    5.56 +
    5.57      HYPERVISOR_net_update();
    5.58  }
    5.59  
    5.60 @@ -385,9 +401,6 @@ int network_close(struct net_device *dev
    5.61  {
    5.62      netif_stop_queue(dev);
    5.63  
    5.64 -    free_irq(NET_RX_IRQ, dev);
    5.65 -    free_irq(NET_TX_IRQ, dev);
    5.66 -
    5.67      /*
    5.68       * XXXX This cannot be done safely until be have a proper interface
    5.69       * for setting up and tearing down virtual interfaces on the fly.
    5.70 @@ -395,12 +408,15 @@ int network_close(struct net_device *dev
    5.71       * no sensible way of retrieving them.
    5.72       */
    5.73  #if 0
    5.74 +    free_irq(NET_RX_IRQ, dev);
    5.75 +    free_irq(NET_TX_IRQ, dev);
    5.76 +
    5.77      network_free_rx_buffers(dev);
    5.78      kfree(np->net_ring->rx_ring);
    5.79      kfree(np->net_ring->tx_ring);
    5.80 -#endif
    5.81  
    5.82      MOD_DEC_USE_COUNT;
    5.83 +#endif
    5.84  
    5.85      return 0;
    5.86  }