aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-10-20 17:45:43 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-20 17:45:43 -0400
commit05bdd2f14351176d368e8ddc67993690a2d1bfb6 (patch)
tree06c00c0af56add8602fba296490b4c598418082f /include/net/sch_generic.h
parent20c4cb792de2b5839537a99a469f4529ef1047f5 (diff)
net: constify skbuff and Qdisc elements
Preliminary patch before tcp constification Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4fc88f3ccd5f..2eb207ea4eaf 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -46,14 +46,14 @@ struct qdisc_size_table {
46struct Qdisc { 46struct Qdisc {
47 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 47 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
48 struct sk_buff * (*dequeue)(struct Qdisc *dev); 48 struct sk_buff * (*dequeue)(struct Qdisc *dev);
49 unsigned flags; 49 unsigned int flags;
50#define TCQ_F_BUILTIN 1 50#define TCQ_F_BUILTIN 1
51#define TCQ_F_INGRESS 2 51#define TCQ_F_INGRESS 2
52#define TCQ_F_CAN_BYPASS 4 52#define TCQ_F_CAN_BYPASS 4
53#define TCQ_F_MQROOT 8 53#define TCQ_F_MQROOT 8
54#define TCQ_F_WARN_NONWC (1 << 16) 54#define TCQ_F_WARN_NONWC (1 << 16)
55 int padded; 55 int padded;
56 struct Qdisc_ops *ops; 56 const struct Qdisc_ops *ops;
57 struct qdisc_size_table __rcu *stab; 57 struct qdisc_size_table __rcu *stab;
58 struct list_head list; 58 struct list_head list;
59 u32 handle; 59 u32 handle;
@@ -224,7 +224,7 @@ struct qdisc_skb_cb {
224 long data[]; 224 long data[];
225}; 225};
226 226
227static inline int qdisc_qlen(struct Qdisc *q) 227static inline int qdisc_qlen(const struct Qdisc *q)
228{ 228{
229 return q->q.qlen; 229 return q->q.qlen;
230} 230}
@@ -239,12 +239,12 @@ static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
239 return &qdisc->q.lock; 239 return &qdisc->q.lock;
240} 240}
241 241
242static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) 242static inline struct Qdisc *qdisc_root(const struct Qdisc *qdisc)
243{ 243{
244 return qdisc->dev_queue->qdisc; 244 return qdisc->dev_queue->qdisc;
245} 245}
246 246
247static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) 247static inline struct Qdisc *qdisc_root_sleeping(const struct Qdisc *qdisc)
248{ 248{
249 return qdisc->dev_queue->qdisc_sleeping; 249 return qdisc->dev_queue->qdisc_sleeping;
250} 250}
@@ -260,7 +260,7 @@ static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc)
260 * root. This is enforced by holding the RTNL semaphore, which 260 * root. This is enforced by holding the RTNL semaphore, which
261 * all users of this lock accessor must do. 261 * all users of this lock accessor must do.
262 */ 262 */
263static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) 263static inline spinlock_t *qdisc_root_lock(const struct Qdisc *qdisc)
264{ 264{
265 struct Qdisc *root = qdisc_root(qdisc); 265 struct Qdisc *root = qdisc_root(qdisc);
266 266
@@ -268,7 +268,7 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
268 return qdisc_lock(root); 268 return qdisc_lock(root);
269} 269}
270 270
271static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc) 271static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc)
272{ 272{
273 struct Qdisc *root = qdisc_root_sleeping(qdisc); 273 struct Qdisc *root = qdisc_root_sleeping(qdisc);
274 274
@@ -276,17 +276,17 @@ static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
276 return qdisc_lock(root); 276 return qdisc_lock(root);
277} 277}
278 278
279static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) 279static inline struct net_device *qdisc_dev(const struct Qdisc *qdisc)
280{ 280{
281 return qdisc->dev_queue->dev; 281 return qdisc->dev_queue->dev;
282} 282}
283 283
284static inline void sch_tree_lock(struct Qdisc *q) 284static inline void sch_tree_lock(const struct Qdisc *q)
285{ 285{
286 spin_lock_bh(qdisc_root_sleeping_lock(q)); 286 spin_lock_bh(qdisc_root_sleeping_lock(q));
287} 287}
288 288
289static inline void sch_tree_unlock(struct Qdisc *q) 289static inline void sch_tree_unlock(const struct Qdisc *q)
290{ 290{
291 spin_unlock_bh(qdisc_root_sleeping_lock(q)); 291 spin_unlock_bh(qdisc_root_sleeping_lock(q));
292} 292}
@@ -319,7 +319,7 @@ static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
319} 319}
320 320
321static inline struct Qdisc_class_common * 321static inline struct Qdisc_class_common *
322qdisc_class_find(struct Qdisc_class_hash *hash, u32 id) 322qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
323{ 323{
324 struct Qdisc_class_common *cl; 324 struct Qdisc_class_common *cl;
325 struct hlist_node *n; 325 struct hlist_node *n;
@@ -393,7 +393,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev)
393} 393}
394 394
395/* Are any of the TX qdiscs changing? */ 395/* Are any of the TX qdiscs changing? */
396static inline bool qdisc_tx_changing(struct net_device *dev) 396static inline bool qdisc_tx_changing(const struct net_device *dev)
397{ 397{
398 unsigned int i; 398 unsigned int i;
399 for (i = 0; i < dev->num_tx_queues; i++) { 399 for (i = 0; i < dev->num_tx_queues; i++) {