ia64/xen-unstable

changeset 6365:28e55fad651f

Update netfront for grant table interface changes.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Aug 23 13:18:45 2005 +0000 (2005-08-23)
parents 5b1ed5b39451
children b3eb952c04ee
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	Tue Aug 23 13:11:31 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Aug 23 13:18:45 2005 +0000
     1.3 @@ -102,12 +102,12 @@ dump_packet(int tag, void *addr, u32 ap)
     1.4  #endif
     1.5  
     1.6  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
     1.7 -static grant_ref_t gref_tx_head, gref_tx_terminal;
     1.8 +static grant_ref_t gref_tx_head;
     1.9  static grant_ref_t grant_tx_ref[NETIF_TX_RING_SIZE + 1];
    1.10  #endif
    1.11  
    1.12  #ifdef CONFIG_XEN_NETDEV_GRANT_RX
    1.13 -static grant_ref_t gref_rx_head, gref_rx_terminal;
    1.14 +static grant_ref_t gref_rx_head;
    1.15  static grant_ref_t grant_rx_ref[NETIF_RX_RING_SIZE + 1];
    1.16  #endif
    1.17  
    1.18 @@ -441,8 +441,8 @@ static void network_alloc_rx_buffers(str
    1.19          
    1.20          np->rx->ring[MASK_NETIF_RX_IDX(req_prod + i)].req.id = id;
    1.21  #ifdef CONFIG_XEN_NETDEV_GRANT_RX
    1.22 -        if (unlikely((ref = gnttab_claim_grant_reference(&gref_rx_head, 
    1.23 -                                                gref_rx_terminal)) < 0)) {
    1.24 +	ref = gnttab_claim_grant_reference(&gref_rx_head);
    1.25 +        if (unlikely(ref < 0)) {
    1.26              printk(KERN_ALERT "#### netfront can't claim rx reference\n");
    1.27              BUG();
    1.28          }
    1.29 @@ -537,8 +537,8 @@ static int network_start_xmit(struct sk_
    1.30  
    1.31      tx->id   = id;
    1.32  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.33 -    if (unlikely((ref = gnttab_claim_grant_reference(&gref_tx_head, 
    1.34 -                                                     gref_tx_terminal)) < 0)) {
    1.35 +    ref = gnttab_claim_grant_reference(&gref_tx_head);
    1.36 +    if (unlikely(ref < 0)) {
    1.37          printk(KERN_ALERT "#### netfront can't claim tx grant reference\n");
    1.38          BUG();
    1.39      }
    1.40 @@ -929,8 +929,7 @@ static void send_interface_connect(struc
    1.41      msg->handle = np->handle;
    1.42      msg->tx_shmem_frame = virt_to_mfn(np->tx);
    1.43  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.44 -    msg->tx_shmem_ref   = (u32)gnttab_claim_grant_reference(&gref_tx_head, 
    1.45 -                                                            gref_tx_terminal);
    1.46 +    msg->tx_shmem_ref   = (u32)gnttab_claim_grant_reference(&gref_tx_head);
    1.47      if(msg->tx_shmem_ref < 0) { 
    1.48          printk(KERN_ALERT "#### netfront can't claim tx_shmem reference\n");
    1.49          BUG();
    1.50 @@ -941,8 +940,7 @@ static void send_interface_connect(struc
    1.51  
    1.52      msg->rx_shmem_frame = virt_to_mfn(np->rx);
    1.53  #ifdef CONFIG_XEN_NETDEV_GRANT_RX
    1.54 -    msg->rx_shmem_ref   = (u32)gnttab_claim_grant_reference(&gref_rx_head, 
    1.55 -                                                            gref_rx_terminal);
    1.56 +    msg->rx_shmem_ref   = (u32)gnttab_claim_grant_reference(&gref_rx_head);
    1.57      if(msg->rx_shmem_ref < 0) {
    1.58          printk(KERN_ALERT "#### netfront can't claim rx_shmem reference\n");
    1.59          BUG();
    1.60 @@ -1420,7 +1418,7 @@ static int __init netif_init(void)
    1.61  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.62      /* A grant for every ring slot, plus one for the ring itself */
    1.63      if (gnttab_alloc_grant_references(NETIF_TX_RING_SIZE + 1,
    1.64 -                                      &gref_tx_head, &gref_tx_terminal) < 0) {
    1.65 +                                      &gref_tx_head) < 0) {
    1.66          printk(KERN_ALERT "#### netfront can't alloc tx grant refs\n");
    1.67          return 1;
    1.68      }
    1.69 @@ -1429,7 +1427,7 @@ static int __init netif_init(void)
    1.70  #ifdef CONFIG_XEN_NETDEV_GRANT_RX
    1.71      /* A grant for every ring slot, plus one for the ring itself */
    1.72      if (gnttab_alloc_grant_references(NETIF_RX_RING_SIZE + 1,
    1.73 -                                      &gref_rx_head, &gref_rx_terminal) < 0) {
    1.74 +                                      &gref_rx_head) < 0) {
    1.75          printk(KERN_ALERT "#### netfront can't alloc rx grant refs\n");
    1.76          return 1;
    1.77      }
    1.78 @@ -1457,10 +1455,10 @@ static int __init netif_init(void)
    1.79  static void netif_exit(void)
    1.80  {
    1.81  #ifdef CONFIG_XEN_NETDEV_GRANT_TX
    1.82 -    gnttab_free_grant_references(gref_tx_head, gref_tx_terminal);
    1.83 +    gnttab_free_grant_references(gref_tx_head);
    1.84  #endif
    1.85  #ifdef CONFIG_XEN_NETDEV_GRANT_RX
    1.86 -    gnttab_free_grant_references(gref_rx_head, gref_rx_terminal);
    1.87 +    gnttab_free_grant_references(gref_rx_head);
    1.88  #endif
    1.89  }
    1.90