[WIRELESS] cfg80211: New wireless config infrastructure.
[linux-2.6-block.git] / include / linux / netdevice.h
index 6be767c76b37df983084121cf9e2d21a448831c4..584c199ec2d57edd999a4f726e9791f73a8d900b 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,6 +350,7 @@ struct net_device
 
 
        struct net_device_stats* (*get_stats)(struct net_device *dev);
+       struct net_device_stats stats;
 
        /* List of functions to handle Wireless Extensions (instead of ioctl).
         * See <net/iw_handler.h> for details. Jean II */
@@ -398,6 +402,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 +535,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 +555,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 +595,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 +913,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);
 }