/* 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;
} while (0)
void netif_xenbus_init(void);
-void netif_interfaces_init(void);
#define netif_schedulable(netif) \
(netif_running((netif)->dev) && netback_carrier_ok(netif))
#include "common.h"
#include <linux/ethtool.h>
#include <linux/rtnetlink.h>
-#include <xen/xenbus.h>
/*
* Module parameter 'queue_length':
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);
-}
netif_accel_init();
- netif_interfaces_init();
netif_xenbus_init();
#ifdef NETBE_DEBUG_INTERRUPT
return;
}
- be->netif->xendev = dev;
kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
}
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);
&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);
}