mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.401 (3f574c9elmWiO5WrYto-k7Z8DTde5A)
Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
This commit is contained in:
commit
0164019edf
4 files changed
+94
-7
No files matched your search
@@ -236,6 +236,7 @@
|
||||
3ddb79c0tWiE8xIFHszxipeVCGKTSA xen/drivers/net/Makefile
|
||||
3f0c4247730LYUgz3p5ziYqy-s_glw xen/drivers/net/SUPPORTED_CARDS
|
||||
3ddb79bfU-H1Hms4BuJEPPydjXUEaQ xen/drivers/net/Space.c
|
||||
3f574c95CQT9g-GDSJJ4YqiwCEQ72Q xen/drivers/net/dummy.c
|
||||
3f0c428e41JP96bh-J0jnX59vJyUeQ xen/drivers/net/e100/LICENSE
|
||||
3f0c428es_xrZnnZQXXHhjzuqj9CTg xen/drivers/net/e100/Makefile
|
||||
3f0c428eCEnifr-r6XCZKUkzIEHdYw xen/drivers/net/e100/e100.h
|
||||
|
||||
+3
-1
@@ -570,7 +570,9 @@ long do_console_write(char *str, unsigned int count)
|
||||
spin_unlock_irqrestore(&console_lock, flags);
|
||||
|
||||
exported_str[j++]='\0';
|
||||
console_export(exported_str, j);
|
||||
|
||||
if ( current->domain != 0 )
|
||||
console_export(exported_str, j);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/******************************************************************************
|
||||
* dummy.c
|
||||
*
|
||||
* A cut down version of Linux's dummy network driver. GPLed and all that.
|
||||
*/
|
||||
|
||||
#include <xeno/config.h>
|
||||
#include <xeno/module.h>
|
||||
#include <xeno/kernel.h>
|
||||
#include <xeno/netdevice.h>
|
||||
#include <xeno/init.h>
|
||||
|
||||
static int dummy_xmit(struct sk_buff *skb, struct net_device *dev);
|
||||
static struct net_device_stats *dummy_get_stats(struct net_device *dev);
|
||||
|
||||
static int __init dummy_init(struct net_device *dev)
|
||||
{
|
||||
dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
|
||||
if ( dev->priv == NULL )
|
||||
return -ENOMEM;
|
||||
memset(dev->priv, 0, sizeof(struct net_device_stats));
|
||||
|
||||
dev->get_stats = dummy_get_stats;
|
||||
dev->hard_start_xmit = dummy_xmit;
|
||||
|
||||
ether_setup(dev);
|
||||
dev->flags |= IFF_NOARP;
|
||||
dev->features = NETIF_F_SG | NETIF_F_HIGHDMA;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dummy_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct net_device_stats *stats = dev->priv;
|
||||
|
||||
stats->tx_packets++;
|
||||
stats->tx_bytes += skb->len;
|
||||
|
||||
dev_kfree_skb(skb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct net_device_stats *dummy_get_stats(struct net_device *dev)
|
||||
{
|
||||
return dev->priv;
|
||||
}
|
||||
|
||||
static struct net_device dev_dummy;
|
||||
|
||||
static int __init dummy_init_module(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
dev_dummy.init = dummy_init;
|
||||
SET_MODULE_OWNER(&dev_dummy);
|
||||
|
||||
if ( (err = dev_alloc_name(&dev_dummy,"dummy")) < 0 )
|
||||
return err;
|
||||
|
||||
if ( (err = register_netdev(&dev_dummy)) < 0 )
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit dummy_cleanup_module(void)
|
||||
{
|
||||
unregister_netdev(&dev_dummy);
|
||||
kfree(dev_dummy.priv);
|
||||
|
||||
memset(&dev_dummy, 0, sizeof(dev_dummy));
|
||||
dev_dummy.init = dummy_init;
|
||||
}
|
||||
|
||||
module_init(dummy_init_module);
|
||||
module_exit(dummy_cleanup_module);
|
||||
MODULE_LICENSE("GPL");
|
||||
+11
-6
@@ -2145,20 +2145,25 @@ int setup_network_devices(void)
|
||||
{
|
||||
int i, ret;
|
||||
extern char opt_ifname[];
|
||||
struct net_device *dev = dev_get_by_name(opt_ifname);
|
||||
struct net_device *dev;
|
||||
|
||||
if ( dev == NULL )
|
||||
if ( (dev = dev_get_by_name(opt_ifname)) == NULL )
|
||||
{
|
||||
printk("Could not find device %s\n", opt_ifname);
|
||||
return 0;
|
||||
printk("Could not find device %s: using dummy device\n", opt_ifname);
|
||||
strcpy(opt_ifname, "dummy");
|
||||
if ( (dev = dev_get_by_name(opt_ifname)) == NULL )
|
||||
{
|
||||
printk("Failed to find the dummy device!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ret = dev_open(dev);
|
||||
if ( ret != 0 )
|
||||
if ( (ret = dev_open(dev)) != 0 )
|
||||
{
|
||||
printk("Error opening device %s for use (%d)\n", opt_ifname, ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk("Device %s opened and ready for use.\n", opt_ifname);
|
||||
the_dev = dev;
|
||||
|
||||
|
||||