dev->stop = &SkGeClose;
dev->hard_start_xmit = &SkGeXmit;
dev->get_stats = &SkGeStats;
- dev->last_stats = &SkGeStats;
dev->set_multicast_list = &SkGeSetRxMode;
dev->set_mac_address = &SkGeSetMacAddr;
dev->do_ioctl = &SkGeIoctl;
/* class/net/name entry */
struct class_device class_dev;
- struct net_device_stats* (*last_stats)(struct net_device *);
/* how much padding had been added by alloc_netdev() */
int padded;
};
}
-/*
- * Some old buggy device drivers change get_stats after registering
- * the device. Try and trap them here.
- * This can be elimnated when all devices are known fixed.
- */
-static inline int get_stats_changed(struct net_device *dev)
-{
- int changed = dev->last_stats != dev->get_stats;
- dev->last_stats = dev->get_stats;
- return changed;
-}
-
/**
* dev_open - prepare an interface for use.
* @dev: device to open
if (dev->flags & IFF_UP)
return 0;
- /*
- * Check for broken device drivers.
- */
- if (get_stats_changed(dev) && net_ratelimit()) {
- printk(KERN_ERR "%s: driver changed get_stats after register\n",
- dev->name);
- }
-
/*
* Is it even present?
*/
clear_bit(__LINK_STATE_START, &dev->state);
}
- /*
- * Check for more broken device drivers.
- */
- if (get_stats_changed(dev) && net_ratelimit()) {
- printk(KERN_ERR "%s: driver changed get_stats in open\n",
- dev->name);
- }
-
/*
* If it went open OK then:
*/
class_dev->class = &net_class;
class_dev->class_data = net;
- net->last_stats = net->get_stats;
strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE);
if ((ret = class_device_register(class_dev)))