ia64/xen-unstable

changeset 6020:60c4cd9ebaa1

Move more drivers to bind_evtchn_to_irqhandler() interface.
The most important ones are all done now.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Aug 03 16:11:32 2005 +0000 (2005-08-03)
parents 33bb0b41aa73
children f46bb706a38d
files linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6-xen-sparse/drivers/xen/blkback/interface.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h linux-2.6-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/interface.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/usbback/common.h linux-2.6-xen-sparse/drivers/xen/usbback/interface.c linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c linux-2.6-xen-sparse/drivers/xen/usbfront/xhci.h linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Wed Aug 03 14:44:19 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Wed Aug 03 16:11:32 2005 +0000
     1.3 @@ -116,9 +116,9 @@ extern asmlinkage unsigned int do_IRQ(st
     1.4  #elif defined (__x86_64__)
     1.5  #define IRQ_REG orig_rax
     1.6  #endif
     1.7 -#define do_IRQ(irq, regs) do {		\
     1.8 -    (regs)->IRQ_REG = (irq);		\
     1.9 -    do_IRQ((regs));			\
    1.10 +#define do_IRQ(irq, regs) do {                  \
    1.11 +    (regs)->IRQ_REG = (irq);                    \
    1.12 +    do_IRQ((regs));                             \
    1.13  } while (0)
    1.14  #endif
    1.15  
    1.16 @@ -137,7 +137,7 @@ void force_evtchn_callback(void)
    1.17  /* NB. Interrupts are disabled on entry. */
    1.18  asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
    1.19  {
    1.20 -    u32 	   l1, l2;
    1.21 +    u32     l1, l2;
    1.22      unsigned int   l1i, l2i, port;
    1.23      int            irq, cpu = smp_processor_id();
    1.24      shared_info_t *s = HYPERVISOR_shared_info;
    1.25 @@ -230,13 +230,13 @@ void unbind_virq_from_irq(int virq)
    1.26              panic("Failed to unbind virtual IRQ %d\n", virq);
    1.27  
    1.28          /*
    1.29 -	 * This is a slight hack. Interdomain ports can be allocated directly 
    1.30 -	 * by userspace, and at that point they get bound by Xen to vcpu 0. We 
    1.31 -	 * therefore need to make sure that if we get an event on an event 
    1.32 -	 * channel we don't know about vcpu 0 handles it. Binding channels to 
    1.33 -	 * vcpu 0 when closing them achieves this.
    1.34 +         * This is a slight hack. Interdomain ports can be allocated directly 
    1.35 +         * by userspace, and at that point they get bound by Xen to vcpu 0. We 
    1.36 +         * therefore need to make sure that if we get an event on an event 
    1.37 +         * channel we don't know about vcpu 0 handles it. Binding channels to 
    1.38 +         * vcpu 0 when closing them achieves this.
    1.39           */
    1.40 -	bind_evtchn_to_cpu(evtchn, 0);
    1.41 +        bind_evtchn_to_cpu(evtchn, 0);
    1.42          evtchn_to_irq[evtchn] = -1;
    1.43          irq_to_evtchn[irq]    = -1;
    1.44          per_cpu(virq_to_irq, cpu)[virq]     = -1;
    1.45 @@ -270,7 +270,7 @@ int bind_ipi_to_irq(int ipi)
    1.46      } 
    1.47      else
    1.48      {
    1.49 -	irq = evtchn_to_irq[evtchn];
    1.50 +        irq = evtchn_to_irq[evtchn];
    1.51      }
    1.52  
    1.53      irq_bindcount[irq]++;
    1.54 @@ -291,17 +291,17 @@ void unbind_ipi_from_irq(int ipi)
    1.55  
    1.56      if ( --irq_bindcount[irq] == 0 )
    1.57      {
    1.58 -	op.cmd          = EVTCHNOP_close;
    1.59 -	op.u.close.dom  = DOMID_SELF;
    1.60 -	op.u.close.port = evtchn;
    1.61 -	if ( HYPERVISOR_event_channel_op(&op) != 0 )
    1.62 -	    panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
    1.63 +        op.cmd          = EVTCHNOP_close;
    1.64 +        op.u.close.dom  = DOMID_SELF;
    1.65 +        op.u.close.port = evtchn;
    1.66 +        if ( HYPERVISOR_event_channel_op(&op) != 0 )
    1.67 +            panic("Failed to unbind virtual IPI %d on cpu %d\n", ipi, cpu);
    1.68  
    1.69 -	/* See comments in unbind_virq_from_irq */
    1.70 -	bind_evtchn_to_cpu(evtchn, 0);
    1.71 +        /* See comments in unbind_virq_from_irq */
    1.72 +        bind_evtchn_to_cpu(evtchn, 0);
    1.73          evtchn_to_irq[evtchn] = -1;
    1.74          irq_to_evtchn[irq]    = -1;
    1.75 -	per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
    1.76 +        per_cpu(ipi_to_evtchn, cpu)[ipi] = 0;
    1.77      }
    1.78  
    1.79      spin_unlock(&irq_mapping_update_lock);
    1.80 @@ -352,8 +352,6 @@ int bind_evtchn_to_irqhandler(
    1.81      unsigned int irq;
    1.82      int retval;
    1.83  
    1.84 -    BUG_ON((irqflags & ~SA_SAMPLE_RANDOM) != 0);
    1.85 -
    1.86      irq = bind_evtchn_to_irq(evtchn);
    1.87      retval = request_irq(irq, handler, irqflags, devname, dev_id);
    1.88      if ( retval != 0 )
    1.89 @@ -382,8 +380,8 @@ static void rebind_irq_to_cpu(unsigned i
    1.90      spin_lock(&irq_mapping_update_lock);
    1.91      evtchn = irq_to_evtchn[irq];
    1.92      if (!VALID_EVTCHN(evtchn)) {
    1.93 -	spin_unlock(&irq_mapping_update_lock);
    1.94 -	return;
    1.95 +        spin_unlock(&irq_mapping_update_lock);
    1.96 +        return;
    1.97      }
    1.98  
    1.99      /* Tell Xen to send future instances of this interrupt to other vcpu. */
   1.100 @@ -397,7 +395,7 @@ static void rebind_irq_to_cpu(unsigned i
   1.101       * but don't do the xenlinux-level rebind in that case.
   1.102       */
   1.103      if (HYPERVISOR_event_channel_op(&op) >= 0)
   1.104 -	bind_evtchn_to_cpu(evtchn, tcpu);
   1.105 +        bind_evtchn_to_cpu(evtchn, tcpu);
   1.106  
   1.107      spin_unlock(&irq_mapping_update_lock);
   1.108  
   1.109 @@ -412,7 +410,7 @@ static void rebind_irq_to_cpu(unsigned i
   1.110       * they start again. This is kind of a hack.
   1.111       */
   1.112      if (!irqs_disabled())
   1.113 -	smp_call_function(do_nothing_function, NULL, 0, 0);
   1.114 +        smp_call_function(do_nothing_function, NULL, 0, 0);
   1.115  }
   1.116  
   1.117  
   1.118 @@ -658,7 +656,7 @@ void irq_resume(void)
   1.119          evtchn = op.u.bind_virq.port;
   1.120          
   1.121          /* Record the new mapping. */
   1.122 -	bind_evtchn_to_cpu(evtchn, 0);
   1.123 +        bind_evtchn_to_cpu(evtchn, 0);
   1.124          evtchn_to_irq[evtchn] = irq;
   1.125          irq_to_evtchn[irq]    = evtchn;
   1.126  
   1.127 @@ -682,9 +680,9 @@ void __init init_IRQ(void)
   1.128  #endif
   1.129  
   1.130      for ( cpu = 0; cpu < NR_CPUS; cpu++ ) {
   1.131 -	/* No VIRQ -> IRQ mappings. */
   1.132 -	for ( i = 0; i < NR_VIRQS; i++ )
   1.133 -	    per_cpu(virq_to_irq, cpu)[i] = -1;
   1.134 +        /* No VIRQ -> IRQ mappings. */
   1.135 +        for ( i = 0; i < NR_VIRQS; i++ )
   1.136 +            per_cpu(virq_to_irq, cpu)[i] = -1;
   1.137      }
   1.138  
   1.139      /* No event-channel -> IRQ mappings. */
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Wed Aug 03 14:44:19 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Wed Aug 03 16:11:32 2005 +0000
     2.3 @@ -32,29 +32,20 @@ static void __blkif_disconnect_complete(
     2.4      blkif_t              *blkif = (blkif_t *)arg;
     2.5      ctrl_msg_t            cmsg;
     2.6      blkif_be_disconnect_t disc;
     2.7 +#ifdef CONFIG_XEN_BLKDEV_GRANT
     2.8 +    struct gnttab_unmap_grant_ref op;
     2.9 +#endif
    2.10  
    2.11      /*
    2.12       * These can't be done in blkif_disconnect() because at that point there
    2.13       * may be outstanding requests at the disc whose asynchronous responses
    2.14       * must still be notified to the remote driver.
    2.15       */
    2.16 -    unbind_evtchn_from_irqhandler(blkif->evtchn, blkif);
    2.17 -
    2.18  #ifdef CONFIG_XEN_BLKDEV_GRANT
    2.19 -    {
    2.20 -        /*
    2.21 -         * Release the shared memory page.
    2.22 -         */
    2.23 -        struct gnttab_unmap_grant_ref op;
    2.24 -
    2.25 -        op.host_virt_addr = blkif->shmem_vaddr;
    2.26 -        op.handle         = blkif->shmem_handle;
    2.27 -        op.dev_bus_addr   = 0;
    2.28 -
    2.29 -        if(unlikely(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1))) {
    2.30 -            BUG();
    2.31 -        }
    2.32 -    }
    2.33 +    op.host_virt_addr = blkif->shmem_vaddr;
    2.34 +    op.handle         = blkif->shmem_handle;
    2.35 +    op.dev_bus_addr   = 0;
    2.36 +    BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1));
    2.37  #endif
    2.38      vfree(blkif->blk_ring.sring);
    2.39  
    2.40 @@ -76,8 +67,7 @@ static void __blkif_disconnect_complete(
    2.41       * another CPU doesn't see the status change yet.
    2.42       */
    2.43      mb();
    2.44 -    if ( blkif->status != DISCONNECTING )
    2.45 -        BUG();
    2.46 +    BUG_ON(blkif->status != DISCONNECTING);
    2.47      blkif->status = DISCONNECTED;
    2.48      mb();
    2.49  
    2.50 @@ -277,6 +267,7 @@ int blkif_disconnect(blkif_be_disconnect
    2.51          blkif->status = DISCONNECTING;
    2.52          blkif->disconnect_rspid = rsp_id;
    2.53          wmb(); /* Let other CPUs see the status change. */
    2.54 +        unbind_evtchn_from_irqhandler(blkif->evtchn, blkif);
    2.55          blkif_deschedule(blkif);
    2.56          blkif_put(blkif);
    2.57          return 0; /* Caller should not send response message. */
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h	Wed Aug 03 14:44:19 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h	Wed Aug 03 16:11:32 2005 +0000
     3.3 @@ -71,7 +71,6 @@ typedef struct blkif_st {
     3.4      /* Physical parameters of the comms window. */
     3.5      unsigned long       shmem_frame;
     3.6      unsigned int        evtchn;
     3.7 -    int                 irq;
     3.8      /* Comms information. */
     3.9      blkif_back_ring_t   blk_ring;
    3.10      
     4.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c	Wed Aug 03 14:44:19 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c	Wed Aug 03 16:11:32 2005 +0000
     4.3 @@ -16,16 +16,15 @@ static char *blkif_state_name[] = {
     4.4      [BLKIF_STATE_CONNECTED]    = "connected",
     4.5  };
     4.6  
     4.7 -static char * blkif_status_name[] = {
     4.8 +static char *blkif_status_name[] = {
     4.9      [BLKIF_INTERFACE_STATUS_CLOSED]       = "closed",
    4.10      [BLKIF_INTERFACE_STATUS_DISCONNECTED] = "disconnected",
    4.11      [BLKIF_INTERFACE_STATUS_CONNECTED]    = "connected",
    4.12      [BLKIF_INTERFACE_STATUS_CHANGED]      = "changed",
    4.13  };
    4.14  
    4.15 -static unsigned blktap_be_irq;
    4.16 -unsigned int    blktap_be_state = BLKIF_STATE_CLOSED;
    4.17 -unsigned int    blktap_be_evtchn;
    4.18 +unsigned int blktap_be_state = BLKIF_STATE_CLOSED;
    4.19 +unsigned int blktap_be_evtchn;
    4.20  
    4.21  /*-----[ Control Messages to/from Frontend VMs ]--------------------------*/
    4.22  
    4.23 @@ -55,7 +54,6 @@ static void __blkif_disconnect_complete(
    4.24       * may be outstanding requests at the disc whose asynchronous responses
    4.25       * must still be notified to the remote driver.
    4.26       */
    4.27 -    unbind_evtchn_from_irq(blkif->evtchn);
    4.28      vfree(blkif->blk_ring.sring);
    4.29  
    4.30      /* Construct the deferred response message. */
    4.31 @@ -232,12 +230,12 @@ void blkif_ptfe_connect(blkif_be_connect
    4.32      BACK_RING_INIT(&blkif->blk_ring, sring, PAGE_SIZE);
    4.33      
    4.34      blkif->evtchn        = evtchn;
    4.35 -    blkif->irq           = bind_evtchn_to_irq(evtchn);
    4.36      blkif->shmem_frame   = shmem_frame;
    4.37      blkif->status        = CONNECTED;
    4.38      blkif_get(blkif);
    4.39  
    4.40 -    request_irq(blkif->irq, blkif_ptfe_int, 0, "blkif-pt-backend", blkif);
    4.41 +    bind_evtchn_to_irqhandler(
    4.42 +        evtchn, blkif_ptfe_int, 0, "blkif-pt-backend", blkif);
    4.43  
    4.44      connect->status = BLKIF_BE_STATUS_OKAY;
    4.45  }
    4.46 @@ -264,7 +262,7 @@ int blkif_ptfe_disconnect(blkif_be_disco
    4.47          blkif->status = DISCONNECTING;
    4.48          blkif->disconnect_rspid = rsp_id;
    4.49          wmb(); /* Let other CPUs see the status change. */
    4.50 -        free_irq(blkif->irq, blkif);
    4.51 +        unbind_evtchn_from_irqhandler(blkif->evtchn, blkif);
    4.52          blkif_deschedule(blkif);
    4.53          blkif_put(blkif);
    4.54          return 0; /* Caller should not send response message. */
    4.55 @@ -313,12 +311,11 @@ static void blkif_ptbe_connect(blkif_fe_
    4.56      int err = 0;
    4.57      
    4.58      blktap_be_evtchn = status->evtchn;
    4.59 -    blktap_be_irq    = bind_evtchn_to_irq(blktap_be_evtchn);
    4.60  
    4.61 -    err = request_irq(blktap_be_irq, blkif_ptbe_int, 
    4.62 -                      SA_SAMPLE_RANDOM, "blkif", NULL);
    4.63 +    err = bind_evtchn_to_irqhandler(
    4.64 +        blktap_be_evtchn, blkif_ptbe_int, SA_SAMPLE_RANDOM, "blkif", NULL);
    4.65      if ( err ) {
    4.66 -	WPRINTK("blkfront request_irq failed (%d)\n", err);
    4.67 +	WPRINTK("blkfront bind_evtchn_to_irqhandler failed (%d)\n", err);
    4.68          return;
    4.69      } else {
    4.70  	/* transtion to connected in case we need to do a 
     5.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Wed Aug 03 14:44:19 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/common.h	Wed Aug 03 16:11:32 2005 +0000
     5.3 @@ -42,7 +42,6 @@ typedef struct netif_st {
     5.4      unsigned long    tx_shmem_frame;
     5.5      unsigned long    rx_shmem_frame;
     5.6      unsigned int     evtchn;
     5.7 -    int              irq;
     5.8  
     5.9      /* The shared rings and indexes. */
    5.10      netif_tx_interface_t *tx;
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Wed Aug 03 14:44:19 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Wed Aug 03 16:11:32 2005 +0000
     6.3 @@ -33,7 +33,8 @@ static void __netif_up(netif_t *netif)
     6.4      spin_lock_bh(&dev->xmit_lock);
     6.5      netif->active = 1;
     6.6      spin_unlock_bh(&dev->xmit_lock);
     6.7 -    (void)request_irq(netif->irq, netif_be_int, 0, dev->name, netif);
     6.8 +    (void)bind_evtchn_to_irqhandler(
     6.9 +        netif->evtchn, netif_be_int, 0, dev->name, netif);
    6.10      netif_schedule_work(netif);
    6.11  }
    6.12  
    6.13 @@ -43,7 +44,7 @@ static void __netif_down(netif_t *netif)
    6.14      spin_lock_bh(&dev->xmit_lock);
    6.15      netif->active = 0;
    6.16      spin_unlock_bh(&dev->xmit_lock);
    6.17 -    free_irq(netif->irq, netif);
    6.18 +    unbind_evtchn_from_irqhandler(netif->evtchn, netif);
    6.19      netif_deschedule_work(netif);
    6.20  }
    6.21  
    6.22 @@ -76,7 +77,6 @@ static void __netif_disconnect_complete(
    6.23       * may be outstanding requests in the network stack whose asynchronous
    6.24       * responses must still be notified to the remote driver.
    6.25       */
    6.26 -    unbind_evtchn_from_irq(netif->evtchn);
    6.27      vfree(netif->tx); /* Frees netif->rx as well. */
    6.28  
    6.29      /* Construct the deferred response message. */
    6.30 @@ -322,7 +322,6 @@ void netif_connect(netif_be_connect_t *c
    6.31      }
    6.32  
    6.33      netif->evtchn         = evtchn;
    6.34 -    netif->irq            = bind_evtchn_to_irq(evtchn);
    6.35      netif->tx_shmem_frame = tx_shmem_frame;
    6.36      netif->rx_shmem_frame = rx_shmem_frame;
    6.37      netif->tx             = 
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Aug 03 14:44:19 2005 +0000
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Aug 03 16:11:32 2005 +0000
     7.3 @@ -152,7 +152,6 @@ struct net_private
     7.4  
     7.5      unsigned int handle;
     7.6      unsigned int evtchn;
     7.7 -    unsigned int irq;
     7.8  
     7.9      /* What is the status of our connection to the remote backend? */
    7.10  #define BEST_CLOSED       0
    7.11 @@ -887,12 +886,11 @@ static void vif_show(struct net_private 
    7.12  {
    7.13  #if DEBUG
    7.14      if (np) {
    7.15 -        IPRINTK("<vif handle=%u %s(%s) evtchn=%u irq=%u tx=%p rx=%p>\n",
    7.16 +        IPRINTK("<vif handle=%u %s(%s) evtchn=%u tx=%p rx=%p>\n",
    7.17                 np->handle,
    7.18                 be_state_name[np->backend_state],
    7.19                 np->user_state ? "open" : "closed",
    7.20                 np->evtchn,
    7.21 -               np->irq,
    7.22                 np->tx,
    7.23                 np->rx);
    7.24      } else {
    7.25 @@ -947,12 +945,11 @@ static void vif_release(struct net_priva
    7.26      spin_unlock_irq(&np->tx_lock);
    7.27      
    7.28      /* Free resources. */
    7.29 -    if(np->tx != NULL){
    7.30 -        free_irq(np->irq, np->dev);
    7.31 -        unbind_evtchn_from_irq(np->evtchn);
    7.32 +    if ( np->tx != NULL )
    7.33 +    {
    7.34 +        unbind_evtchn_from_irqhandler(np->evtchn, np->dev);
    7.35          free_page((unsigned long)np->tx);
    7.36          free_page((unsigned long)np->rx);
    7.37 -        np->irq = 0;
    7.38          np->evtchn = 0;
    7.39          np->tx = NULL;
    7.40          np->rx = NULL;
    7.41 @@ -1022,11 +1019,11 @@ vif_connect(struct net_private *np, neti
    7.42      memcpy(dev->dev_addr, status->mac, ETH_ALEN);
    7.43      network_connect(dev, status);
    7.44      np->evtchn = status->evtchn;
    7.45 -    np->irq = bind_evtchn_to_irq(np->evtchn);
    7.46  #if defined(CONFIG_XEN_NETDEV_GRANT_TX) || defined(CONFIG_XEN_NETDEV_GRANT_RX)
    7.47      rdomid = status->domid;
    7.48  #endif
    7.49 -    (void)request_irq(np->irq, netif_int, SA_SAMPLE_RANDOM, dev->name, dev);
    7.50 +    (void)bind_evtchn_to_irqhandler(
    7.51 +        np->evtchn, netif_int, SA_SAMPLE_RANDOM, dev->name, dev);
    7.52      netctrl_connected_count();
    7.53      (void)send_fake_arp(dev);
    7.54      vif_show(np);
    7.55 @@ -1430,8 +1427,7 @@ static void netif_exit(void)
    7.56  static void vif_suspend(struct net_private *np)
    7.57  {
    7.58      /* Avoid having tx/rx stuff happen until we're ready. */
    7.59 -    free_irq(np->irq, np->dev);
    7.60 -    unbind_evtchn_from_irq(np->evtchn);
    7.61 +    unbind_evtchn_from_irqhandler(np->evtchn, np->dev);
    7.62  }
    7.63  
    7.64  static void vif_resume(struct net_private *np)
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbback/common.h	Wed Aug 03 14:44:19 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbback/common.h	Wed Aug 03 16:11:32 2005 +0000
     8.3 @@ -37,7 +37,6 @@ struct usbif_priv_st {
     8.4      /* Physical parameters of the comms window. */
     8.5      unsigned long    shmem_frame;
     8.6      unsigned int     evtchn;
     8.7 -    int              irq;
     8.8      /* Comms Information */
     8.9      usbif_back_ring_t usb_ring;
    8.10      /* Private fields. */
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbback/interface.c	Wed Aug 03 14:44:19 2005 +0000
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbback/interface.c	Wed Aug 03 16:11:32 2005 +0000
     9.3 @@ -6,15 +6,6 @@
     9.4   * by Mark Williamson, Copyright (c) 2004
     9.5   */
     9.6  
     9.7 -
     9.8 -/******************************************************************************
     9.9 - * arch/xen/drivers/blkif/backend/interface.c
    9.10 - * 
    9.11 - * Block-device interface management.
    9.12 - * 
    9.13 - * Copyright (c) 2004, Keir Fraser
    9.14 - */
    9.15 -
    9.16  #include "common.h"
    9.17  
    9.18  #define USBIF_HASHSZ 1024
    9.19 @@ -42,7 +33,6 @@ static void __usbif_disconnect_complete(
    9.20       * may be outstanding requests at the device whose asynchronous responses
    9.21       * must still be notified to the remote driver.
    9.22       */
    9.23 -    unbind_evtchn_from_irq(usbif->evtchn);
    9.24      vfree(usbif->usb_ring.sring);
    9.25  
    9.26      /* Construct the deferred response message. */
    9.27 @@ -198,12 +188,12 @@ void usbif_connect(usbif_be_connect_t *c
    9.28      BACK_RING_INIT(&up->usb_ring, sring, PAGE_SIZE);
    9.29  
    9.30      up->evtchn        = evtchn;
    9.31 -    up->irq           = bind_evtchn_to_irq(evtchn);
    9.32      up->shmem_frame   = shmem_frame;
    9.33      up->status        = CONNECTED;
    9.34      usbif_get(up);
    9.35  
    9.36 -    request_irq(up->irq, usbif_be_int, 0, "usbif-backend", up);
    9.37 +    (void)bind_evtchn_to_irqhandler(
    9.38 +        evtchn, usbif_be_int, 0, "usbif-backend", up);
    9.39  
    9.40      connect->status = USBIF_BE_STATUS_OKAY;
    9.41  }
    9.42 @@ -233,7 +223,7 @@ int usbif_disconnect(usbif_be_disconnect
    9.43          up->status = DISCONNECTING;
    9.44          up->disconnect_rspid = rsp_id;
    9.45          wmb(); /* Let other CPUs see the status change. */
    9.46 -        free_irq(up->irq, up);
    9.47 +        unbind_evtchn_from_irqhandler(up->evtchn, up);
    9.48  	usbif_deschedule(up);
    9.49          usbif_put(up);
    9.50          return 0; /* Caller should not send response message. */
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c	Wed Aug 03 14:44:19 2005 +0000
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c	Wed Aug 03 16:11:32 2005 +0000
    10.3 @@ -1536,8 +1536,7 @@ static void usbif_status_change(usbif_fe
    10.4              
    10.5              /* Clean up resources. */
    10.6              free_page((unsigned long)xhci->usb_ring.sring);
    10.7 -            free_irq(xhci->irq, xhci);
    10.8 -            unbind_evtchn_from_irq(xhci->evtchn);
    10.9 +            unbind_evtchn_from_irqhandler(xhci->evtchn, xhci);
   10.10  
   10.11              /* Plug the ring. */
   10.12              xhci->recovery = 1;
   10.13 @@ -1572,7 +1571,6 @@ static void usbif_status_change(usbif_fe
   10.14          }
   10.15  
   10.16          xhci->evtchn = status->evtchn;
   10.17 -        xhci->irq = bind_evtchn_to_irq(xhci->evtchn);
   10.18  	xhci->bandwidth = status->bandwidth;
   10.19  	xhci->rh.numports = status->num_ports;
   10.20  
   10.21 @@ -1595,14 +1593,14 @@ static void usbif_status_change(usbif_fe
   10.22   	usb_claim_bandwidth(xhci->rh.dev, xhci->rh.urb,
   10.23   			    1000 - xhci->bandwidth, 0);
   10.24  
   10.25 -        if ( (rc = request_irq(xhci->irq, xhci_interrupt, 
   10.26 +        if ( (rc = bind_evtchn_to_irqhandler(xhci->evtchn, xhci_interrupt, 
   10.27                                 SA_SAMPLE_RANDOM, "usbif", xhci)) )
   10.28                  printk(KERN_ALERT"usbfront request_irq failed (%ld)\n",rc);
   10.29  
   10.30  	DPRINTK(KERN_INFO __FILE__
   10.31 -                ": USB XHCI: SHM at %p (0x%lx), EVTCHN %d IRQ %d\n",
   10.32 +                ": USB XHCI: SHM at %p (0x%lx), EVTCHN %d\n",
   10.33                  xhci->usb_ring.sring, virt_to_machine(xhci->usbif),
   10.34 -                xhci->evtchn, xhci->irq);
   10.35 +                xhci->evtchn);
   10.36  
   10.37          xhci->state = USBIF_STATE_CONNECTED;
   10.38  
    11.1 --- a/linux-2.6-xen-sparse/drivers/xen/usbfront/xhci.h	Wed Aug 03 14:44:19 2005 +0000
    11.2 +++ b/linux-2.6-xen-sparse/drivers/xen/usbfront/xhci.h	Wed Aug 03 16:11:32 2005 +0000
    11.3 @@ -54,7 +54,6 @@ struct xhci {
    11.4  #endif
    11.5  
    11.6          int evtchn;                        /* Interdom channel to backend */
    11.7 -        int irq;                           /* Bound to evtchn */
    11.8          enum { 
    11.9                  USBIF_STATE_CONNECTED    = 2,
   11.10                  USBIF_STATE_DISCONNECTED = 1,
    12.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Wed Aug 03 14:44:19 2005 +0000
    12.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Wed Aug 03 16:11:32 2005 +0000
    12.3 @@ -26,7 +26,6 @@
    12.4   * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    12.5   * IN THE SOFTWARE.
    12.6   */
    12.7 -//#define DEBUG
    12.8  
    12.9  #include <asm-xen/hypervisor.h>
   12.10  #include <asm-xen/evtchn.h>
   12.11 @@ -36,8 +35,6 @@
   12.12  #include <linux/err.h>
   12.13  #include "xenbus_comms.h"
   12.14  
   12.15 -static unsigned int xb_irq;
   12.16 -
   12.17  #define RINGBUF_DATASIZE ((PAGE_SIZE / 2) - sizeof(struct ringbuf_head))
   12.18  struct ringbuf_head
   12.19  {
   12.20 @@ -212,9 +209,9 @@ int xb_init_comms(void)
   12.21  	if (!xen_start_info.store_evtchn)
   12.22  		return 0;
   12.23  
   12.24 -	xb_irq = bind_evtchn_to_irq(xen_start_info.store_evtchn);
   12.25 -
   12.26 -	err = request_irq(xb_irq, wake_waiting, 0, "xenbus", &xb_waitq);
   12.27 +	err = bind_evtchn_to_irqhandler(
   12.28 +		xen_start_info.store_evtchn, wake_waiting,
   12.29 +		0, "xenbus", &xb_waitq);
   12.30  	if (err) {
   12.31  		printk(KERN_ERR "XENBUS request irq failed %i\n", err);
   12.32  		unbind_evtchn_from_irq(xen_start_info.store_evtchn);
   12.33 @@ -234,6 +231,5 @@ void xb_suspend_comms(void)
   12.34  	if (!xen_start_info.store_evtchn)
   12.35  		return;
   12.36  
   12.37 -	free_irq(xb_irq, &xb_waitq);
   12.38 -	unbind_evtchn_from_irq(xen_start_info.store_evtchn);
   12.39 +	unbind_evtchn_from_irqhandler(xen_start_info.store_evtchn, &xb_waitq);
   12.40  }