netdevice: Consolidate to use existing macros where available.
[linux-2.6-block.git] / include / linux / netdevice.h
index 9ea8d6dfe54058ae95515de7f1b6bcdcb173142f..60d3aac49ed485ca9ac2657d11ccc87500cbd6c5 100644 (file)
@@ -72,10 +72,6 @@ struct wireless_dev;
 /* Backlog congestion levels */
 #define NET_RX_SUCCESS         0   /* keep 'em coming, baby */
 #define NET_RX_DROP            1  /* packet dropped */
-#define NET_RX_CN_LOW          2   /* storm alert, just in case */
-#define NET_RX_CN_MOD          3   /* Storm on its way! */
-#define NET_RX_CN_HIGH         4   /* The storm is here */
-#define NET_RX_BAD             5  /* packet dropped due to kernel error */
 
 /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
  * indicates that the device will soon be dropping packets, or already drops
@@ -224,6 +220,11 @@ struct netdev_hw_addr {
        struct rcu_head         rcu_head;
 };
 
+struct netdev_hw_addr_list {
+       struct list_head        list;
+       int                     count;
+};
+
 struct hh_cache
 {
        struct hh_cache *hh_next;       /* Next entry                        */
@@ -700,6 +701,7 @@ struct net_device
 /* the GSO_MASK reserves bits 16 through 23 */
 #define NETIF_F_FCOE_CRC       (1 << 24) /* FCoE CRC32 */
 #define NETIF_F_SCTP_CSUM      (1 << 25) /* SCTP checksum offload */
+#define NETIF_F_FCOE_MTU       (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
 
        /* Segmentation offload features */
 #define NETIF_F_GSO_SHIFT      16
@@ -776,9 +778,8 @@ struct net_device
        unsigned char           addr_len;       /* hardware address length      */
        unsigned short          dev_id;         /* for shared network cards */
 
-       struct list_head        uc_list;        /* Secondary unicast mac
-                                                  addresses */
-       int                     uc_count;       /* Number of installed ucasts   */
+       struct netdev_hw_addr_list      uc;     /* Secondary unicast
+                                                  mac addresses */
        int                     uc_promisc;
        spinlock_t              addr_list_lock;
        struct dev_addr_list    *mc_list;       /* Multicast mac addresses      */
@@ -810,7 +811,8 @@ struct net_device
                                                   because most packets are
                                                   unicast) */
 
-       struct list_head        dev_addr_list; /* list of device hw addresses */
+       struct netdev_hw_addr_list      dev_addrs; /* list of device
+                                                     hw addresses */
 
        unsigned char           broadcast[MAX_ADDR_LEN];        /* hw bcast add */
 
@@ -1255,7 +1257,7 @@ static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue)
 {
 #ifdef CONFIG_NETPOLL_TRAP
        if (netpoll_trap()) {
-               clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
+               netif_tx_start_queue(dev_queue);
                return;
        }
 #endif
@@ -1361,7 +1363,8 @@ static inline int netif_running(const struct net_device *dev)
 static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
 {
        struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
-       clear_bit(__QUEUE_STATE_XOFF, &txq->state);
+
+       netif_tx_start_queue(txq);
 }
 
 /**
@@ -1378,7 +1381,7 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
        if (netpoll_trap())
                return;
 #endif
-       set_bit(__QUEUE_STATE_XOFF, &txq->state);
+       netif_tx_stop_queue(txq);
 }
 
 /**
@@ -1392,7 +1395,8 @@ static inline int __netif_subqueue_stopped(const struct net_device *dev,
                                         u16 queue_index)
 {
        struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
-       return test_bit(__QUEUE_STATE_XOFF, &txq->state);
+
+       return netif_tx_queue_stopped(txq);
 }
 
 static inline int netif_subqueue_stopped(const struct net_device *dev,
@@ -1744,8 +1748,7 @@ static inline void netif_tx_unlock(struct net_device *dev)
                 * force a schedule.
                 */
                clear_bit(__QUEUE_STATE_FROZEN, &txq->state);
-               if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
-                       __netif_schedule(txq->qdisc);
+               netif_schedule_queue(txq);
        }
        spin_unlock(&dev->tx_global_lock);
 }
@@ -1806,11 +1809,11 @@ static inline void netif_addr_unlock_bh(struct net_device *dev)
 }
 
 /*
- * dev_addr_list walker. Should be used only for read access. Call with
+ * dev_addrs walker. Should be used only for read access. Call with
  * rcu_read_lock held.
  */
 #define for_each_dev_addr(dev, ha) \
-               list_for_each_entry_rcu(ha, &dev->dev_addr_list, list)
+               list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list)
 
 /* These functions live elsewhere (drivers/net/net_init.c, but related) */