]> xenbits.xensource.com Git - people/ssmith/netchannel2-pvops.git/commitdiff
Get the backend working.
authorSteven Smith <ssmith@weybridge.uk.xensource.com>
Thu, 16 Apr 2009 15:32:24 +0000 (16:32 +0100)
committerSteven Smith <ssmith@weybridge.uk.xensource.com>
Tue, 19 May 2009 14:04:13 +0000 (15:04 +0100)
drivers/net/xen-netchannel2/Makefile
drivers/net/xen-netchannel2/chan.c
drivers/net/xen-netchannel2/netback2.c
drivers/net/xen-netchannel2/netchan2.c
drivers/net/xen-netchannel2/netchannel2_endpoint.h
drivers/net/xen-netchannel2/util.c

index eadd1adeb9092bd7d5f1696e6f5b243f95bcf266..7e9e4673ae4ed90ad9d005153b8a89543b998dd4 100644 (file)
@@ -20,9 +20,7 @@ endif
 
 netchannel2-objs += receiver_map.o
 
-ifeq ($(CONFIG_XEN_NETDEV2_BACKEND),y)
 netchannel2-objs += netback2.o
-endif
 
 netchannel2-objs += netfront2.o
 
index c2a88db507171464604617950a3a98cc4e2783a7..c4a222701e555596ff4e27bb2498e3869d046ffd 100644 (file)
@@ -927,7 +927,6 @@ static void _detach_rings(struct netchannel2_ring_pair *ncrp)
         spin_unlock_bh(&ncrp->lock);
 }
 
-#if defined(CONFIG_XEN_NETDEV2_BACKEND)
 /* Connect to an event channel port in a remote domain.  Returns 0 on
    success or <0 on error.  The port is automatically disconnected
    when the channel is released or if the rings are detached.  This
@@ -947,13 +946,12 @@ int nc2_connect_evtchn(struct netchannel2 *nc, domid_t domid,
                                                     &nc->rings);
         if (err >= 0) {
                 nc->rings.irq = err;
-                nc->rings.evtchn = irq_to_evtchn_port(err);
+                nc->rings.evtchn = -1;
                 return 0;
         } else {
                 return err;
         }
 }
-#endif
 
 /* Listen for incoming event channel connections from domain domid.
    Similar semantics to nc2_connect_evtchn(). */
index 532540045d530cb8750632d20325447cb03273a4..65d547d7c3b82ee103417d2d7db628acb692b605 100644 (file)
@@ -2,7 +2,8 @@
 #include <linux/gfp.h>
 #include <linux/vmalloc.h>
 #include <linux/miscdevice.h>
-#include <xen/gnttab.h>
+#include <linux/fs.h>
+#include <xen/grant_table.h>
 #include <xen/xenbus.h>
 #include <xen/interface/io/netchannel2.h>
 
@@ -275,19 +276,12 @@ static void frontend_changed(struct xenbus_device *xd,
         }
 }
 
-static int netback2_uevent(struct xenbus_device *xd, char **envp,
-                           int num_envp, char *buffer, int buffer_size)
+static int netback2_uevent(struct xenbus_device *xd,
+                          struct kobj_uevent_env *env)
 {
         struct netback2 *nb = xenbus_device_to_nb2(xd);
-        int i;
-        int length;
-
-        i = 0;
-        length = 0;
-        add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
-                      "vif=%s", nb->chan->net_device->name);
 
-       envp[i] = NULL;
+        add_uevent_var(env, "vif=%s", nb->chan->net_device->name);
 
        return 0;
 }
@@ -420,8 +414,6 @@ static struct xenbus_driver netback2 = {
        .probe = netback2_probe,
         .remove = netback2_remove,
        .otherend_changed = frontend_changed,
-        .run_otherend_changed_during_shutdown = 1,
-        .shutdown = netback2_shutdown,
         .uevent = netback2_uevent,
 };
 
index b4bdeb30f2b40cefc88f9a79e5101b0419abb763..919562f3e7233750a1ca38286bc92699197faa2c 100644 (file)
@@ -19,14 +19,4 @@ static int __init netchan2_init(void)
 }
 module_init(netchan2_init);
 
-/* We can't unload if we're acting as a backend. */
-#ifndef CONFIG_XEN_NETDEV2_BACKEND
-static void __exit netchan2_exit(void)
-{
-        netfront2_exit();
-        nc2_exit();
-}
-module_exit(netchan2_exit);
-#endif
-
 MODULE_LICENSE("GPL");
index ff38dd42e333eac346bff9ce7cb01a4b929db188..bdc4108029663e16ef34dd750e745f7f0843e0fe 100644 (file)
@@ -25,10 +25,8 @@ int nc2_attach_rings(struct netchannel2 *nc,
                      domid_t otherend_id);
 void nc2_detach_rings(struct netchannel2 *nc);
 int nc2_listen_evtchn(struct netchannel2 *nc, domid_t dom);
-#if defined(CONFIG_XEN_NETDEV2_BACKEND)
 int nc2_connect_evtchn(struct netchannel2 *nc, domid_t domid,
                        int evtchn);
-#endif
 int nc2_get_evtchn_port(struct netchannel2 *nc);
 void nc2_suspend(struct netchannel2 *nc);
 
@@ -37,14 +35,7 @@ void nc2_set_nr_tx_buffers(struct netchannel2 *nc, unsigned nr_buffers);
 /* Interface which the endpoints provide to the core. */
 int __init netfront2_init(void);
 void __exit netfront2_exit(void);
-#ifdef CONFIG_XEN_NETDEV2_BACKEND
 int __init netback2_init(void);
-#else
-static inline int netback2_init(void)
-{
-    return 0;
-}
-#endif
 int __init nc2_init(void);
 void __exit nc2_exit(void);
 
index edef7f6bb8acc9872bafe0b7286b487a2deebe6d..6f69a2e6ff745e1d1137db730b3c3085f5c49884 100644 (file)
@@ -2,14 +2,7 @@
 #include <linux/list.h>
 #include <linux/skbuff.h>
 #include <linux/version.h>
-#ifdef CONFIG_XEN_NETDEV2_BACKEND
-#include <xen/driver_util.h>
-#endif
-#ifdef CONFIG_PARAVIRT
 #include <xen/grant_table.h>
-#else
-#include <xen/gnttab.h>
-#endif
 #include "netchannel2_core.h"
 
 #ifdef DEBUG
@@ -415,8 +408,6 @@ void pull_through(struct sk_buff *skb, unsigned count)
                 skb_shinfo(skb)->nr_frags);
 }
 
-#ifdef CONFIG_XEN_NETDEV2_BACKEND
-
 /* Zap a grant_mapping structure, releasing all mappings and the
    reserved virtual address space.  Prepare the grant_mapping for
    re-use. */
@@ -487,4 +478,3 @@ int nc2_map_grants(struct grant_mapping *gm,
         *gm = work;
         return 0;
 }
-#endif