direct-io.hg

changeset 179:2bfb4f917fea

bitkeeper revision 1.45 (3e4e6a86G4hu-Sevb5UwTWaaiHxKHw)

network.c:
It is not safe to destroy the net rx ring in xenolinux right now. That code has been disabled.
author kaf24@labyrinth.cl.cam.ac.uk
date Sat Feb 15 16:27:50 2003 +0000 (2003-02-15)
parents 9c0353a9fa74
children 14f0a9bd861d
files xenolinux-2.4.16-sparse/arch/xeno/drivers/network/network.c
line diff
     1.1 --- a/xenolinux-2.4.16-sparse/arch/xeno/drivers/network/network.c	Sat Feb 15 16:04:37 2003 +0000
     1.2 +++ b/xenolinux-2.4.16-sparse/arch/xeno/drivers/network/network.c	Sat Feb 15 16:27:50 2003 +0000
     1.3 @@ -63,7 +63,6 @@ struct net_private
     1.4      unsigned int rx_idx, tx_idx, tx_full;
     1.5      net_ring_t *net_ring;
     1.6      spinlock_t tx_lock;
     1.7 -    unsigned int id;
     1.8  };
     1.9  
    1.10   
    1.11 @@ -109,6 +108,7 @@ static int network_open(struct net_devic
    1.12      {
    1.13          printk(KERN_WARNING "%s: Could not allocate receive interrupt\n",
    1.14                 dev->name);
    1.15 +        network_free_rx_buffers(dev);
    1.16          goto fail;
    1.17      }
    1.18  
    1.19 @@ -119,6 +119,7 @@ static int network_open(struct net_devic
    1.20          printk(KERN_WARNING "%s: Could not allocate transmit interrupt\n",
    1.21                 dev->name);
    1.22          free_irq(NET_RX_IRQ, dev);
    1.23 +        network_free_rx_buffers(dev);
    1.24          goto fail;
    1.25      }
    1.26  
    1.27 @@ -189,8 +190,7 @@ static void network_alloc_rx_buffers(str
    1.28      unsigned int i;
    1.29      struct net_private *np = dev->priv;
    1.30      struct sk_buff *skb;
    1.31 -    unsigned int end = RX_RING_ADD(np->rx_idx, RX_MAX_ENTRIES);
    1.32 -    
    1.33 +    unsigned int end = RX_RING_ADD(np->rx_idx, RX_MAX_ENTRIES);    
    1.34  
    1.35      for ( i = np->net_ring->rx_prod; i != end; i = RX_RING_INC(i) )
    1.36      {
    1.37 @@ -213,6 +213,13 @@ static void network_alloc_rx_buffers(str
    1.38  
    1.39  static void network_free_rx_buffers(struct net_device *dev)
    1.40  {
    1.41 +    /*
    1.42 +     * XXXX This cannot be done safely until be have a proper interface
    1.43 +     * for setting up and tearing down virtual interfaces on the fly.
    1.44 +     * Currently the receive buffers are locked down by Xen and we have
    1.45 +     * no sensible way of retrieving them.
    1.46 +     */
    1.47 +#if 0
    1.48      unsigned int i;
    1.49      struct net_private *np = dev->priv;
    1.50      struct sk_buff *skb;    
    1.51 @@ -222,6 +229,7 @@ static void network_free_rx_buffers(stru
    1.52          skb = np->rx_skb_ring[i];
    1.53          dev_kfree_skb(skb);
    1.54      }
    1.55 +#endif
    1.56  }
    1.57  
    1.58  static int network_start_xmit(struct sk_buff *skb, struct net_device *dev)
    1.59 @@ -399,7 +407,6 @@ int __init init_module(void)
    1.60          }
    1.61  
    1.62          np->dev = dev;
    1.63 -        np->id = i;
    1.64          list_add(&np->list, &dev_list);
    1.65      }
    1.66