Merge branch 'e1000-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[pandora-kernel.git] / include / linux / netdevice.h
index 6be767c..e027a37 100644 (file)
@@ -42,6 +42,8 @@
 struct vlan_group;
 struct ethtool_ops;
 struct netpoll_info;
+/* 802.11 specific */
+struct wireless_dev;
                                        /* source back-compat hooks */
 #define SET_ETHTOOL_OPS(netdev,ops) \
        ( (netdev)->ethtool_ops = (ops) )
@@ -323,6 +325,7 @@ struct net_device
 #define NETIF_F_VLAN_CHALLENGED        1024    /* Device cannot handle VLAN packets */
 #define NETIF_F_GSO            2048    /* Enable software GSO. */
 #define NETIF_F_LLTX           4096    /* LockLess TX */
+#define NETIF_F_INTERNAL_STATS 8192    /* Use stats structure in net_device */
 
        /* Segmentation offload features */
 #define NETIF_F_GSO_SHIFT      16
@@ -347,13 +350,15 @@ struct net_device
 
 
        struct net_device_stats* (*get_stats)(struct net_device *dev);
+       struct net_device_stats stats;
 
+#ifdef CONFIG_WIRELESS_EXT
        /* List of functions to handle Wireless Extensions (instead of ioctl).
         * See <net/iw_handler.h> for details. Jean II */
        const struct iw_handler_def *   wireless_handlers;
        /* Instance data managed by the core of Wireless Extensions. */
        struct iw_public_data * wireless_data;
-
+#endif
        const struct ethtool_ops *ethtool_ops;
 
        /*
@@ -398,6 +403,8 @@ struct net_device
        void                    *ip6_ptr;       /* IPv6 specific data */
        void                    *ec_ptr;        /* Econet specific data */
        void                    *ax25_ptr;      /* AX.25 specific data */
+       struct wireless_dev     *ieee80211_ptr; /* IEEE 802.11 specific data,
+                                                  assign before registering */
 
 /*
  * Cache line mostly used on receive path (including eth_type_trans())
@@ -529,10 +536,11 @@ struct net_device
        struct net_bridge_port  *br_port;
 
        /* class/net/name entry */
-       struct class_device     class_dev;
+       struct device           dev;
        /* space for optional statistics and wireless sysfs groups */
        struct attribute_group  *sysfs_groups[3];
 };
+#define to_net_dev(d) container_of(d, struct net_device, dev)
 
 #define        NETDEV_ALIGN            32
 #define        NETDEV_ALIGN_CONST      (NETDEV_ALIGN - 1)
@@ -548,7 +556,7 @@ static inline void *netdev_priv(struct net_device *dev)
 /* Set the sysfs physical device reference for the network logical device
  * if set prior to registration will cause a symlink during initialization.
  */
-#define SET_NETDEV_DEV(net, pdev)      ((net)->class_dev.dev = (pdev))
+#define SET_NETDEV_DEV(net, pdev)      ((net)->dev.parent = (pdev))
 
 struct packet_type {
        __be16                  type;   /* This is really htons(ether_type). */
@@ -588,7 +596,7 @@ extern int          dev_open(struct net_device *dev);
 extern int             dev_close(struct net_device *dev);
 extern int             dev_queue_xmit(struct sk_buff *skb);
 extern int             register_netdevice(struct net_device *dev);
-extern int             unregister_netdevice(struct net_device *dev);
+extern void            unregister_netdevice(struct net_device *dev);
 extern void            free_netdev(struct net_device *dev);
 extern void            synchronize_net(void);
 extern int             register_netdevice_notifier(struct notifier_block *nb);
@@ -906,6 +914,7 @@ static inline void netif_poll_disable(struct net_device *dev)
 
 static inline void netif_poll_enable(struct net_device *dev)
 {
+       smp_mb__before_clear_bit();
        clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
 }