netchannel2-objs += receiver_map.o
-ifeq ($(CONFIG_XEN_NETDEV2_BACKEND),y)
netchannel2-objs += netback2.o
-endif
netchannel2-objs += netfront2.o
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
&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(). */
#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>
}
}
-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;
}
.probe = netback2_probe,
.remove = netback2_remove,
.otherend_changed = frontend_changed,
- .run_otherend_changed_during_shutdown = 1,
- .shutdown = netback2_shutdown,
.uevent = netback2_uevent,
};
}
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");
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);
/* 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);
#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
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. */
*gm = work;
return 0;
}
-#endif