From: t_jeang Date: Tue, 6 Jan 2009 12:05:55 +0000 (+0000) Subject: imported patch revert-linux-2.6-xen-xennet-coordinate-arp-with-backend-network-status... X-Git-Tag: kernel-2.6.18-92.1.18.el5.patch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=602b7910bba50a167b159be6e15c09cc5f125d22;p=xenclient%2Fkernel.git imported patch revert-linux-2.6-xen-xennet-coordinate-arp-with-backend-network-status.patch --- diff --git a/drivers/xen/netback/common.h b/drivers/xen/netback/common.h index 90d1d542..10a1d58f 100644 --- a/drivers/xen/netback/common.h +++ b/drivers/xen/netback/common.h @@ -97,7 +97,6 @@ typedef struct netif_st { /* Miscellaneous private stuff. */ struct list_head list; /* scheduling list */ atomic_t refcnt; - struct xenbus_device *xendev; struct net_device *dev; struct net_device_stats stats; @@ -192,7 +191,6 @@ int netif_map(netif_t *netif, unsigned long tx_ring_ref, } while (0) void netif_xenbus_init(void); -void netif_interfaces_init(void); #define netif_schedulable(netif) \ (netif_running((netif)->dev) && netback_carrier_ok(netif)) diff --git a/drivers/xen/netback/interface.c b/drivers/xen/netback/interface.c index 61f94cce..610891fc 100644 --- a/drivers/xen/netback/interface.c +++ b/drivers/xen/netback/interface.c @@ -33,7 +33,6 @@ #include "common.h" #include #include -#include /* * Module parameter 'queue_length': @@ -335,31 +334,3 @@ void netif_disconnect(netif_t *netif) free_netdev(netif->dev); } - - -static int -netdev_notify(struct notifier_block *this, unsigned long event, void *ptr) -{ - struct net_device *dev = ptr; - - /* Carrier up event and is it one of our devices? */ - if (event == NETDEV_CHANGE && netif_carrier_ok(dev) && - dev->open == net_open) { - netif_t *netif = netdev_priv(dev); - - xenbus_switch_state(netif->xendev, XenbusStateConnected); - } - - return NOTIFY_DONE; -} - - -static struct notifier_block notifier_netdev = { - .notifier_call = netdev_notify, -}; - - -void netif_interfaces_init(void) -{ - (void)register_netdevice_notifier(¬ifier_netdev); -} diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c index 70aecf3f..145f67db 100644 --- a/drivers/xen/netback/netback.c +++ b/drivers/xen/netback/netback.c @@ -1613,7 +1613,6 @@ static int __init netback_init(void) netif_accel_init(); - netif_interfaces_init(); netif_xenbus_init(); #ifdef NETBE_DEBUG_INTERRUPT diff --git a/drivers/xen/netback/xenbus.c b/drivers/xen/netback/xenbus.c index 491596f6..d7faeb62 100644 --- a/drivers/xen/netback/xenbus.c +++ b/drivers/xen/netback/xenbus.c @@ -203,7 +203,6 @@ static void backend_create_netif(struct backend_info *be) return; } - be->netif->xendev = dev; kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); } @@ -329,6 +328,10 @@ static void connect(struct backend_info *be) int err; struct xenbus_device *dev = be->dev; + err = connect_rings(be); + if (err) + return; + err = xen_net_read_mac(dev, be->netif->fe_dev_addr); if (err) { xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename); @@ -339,9 +342,7 @@ static void connect(struct backend_info *be) &be->netif->credit_usec); be->netif->remaining_credit = be->netif->credit_bytes; - err = connect_rings(be); - if (err) - return; + xenbus_switch_state(dev, XenbusStateConnected); netif_wake_queue(be->netif->dev); }