net: sched: constify tcf_proto and tc_action
[pandora-kernel.git] / include / net / sch_generic.h
index a9505b6..4fc88f3 100644 (file)
@@ -25,6 +25,7 @@ struct qdisc_rate_table {
 enum qdisc_state_t {
        __QDISC_STATE_SCHED,
        __QDISC_STATE_DEACTIVATED,
+       __QDISC_STATE_THROTTLED,
 };
 
 /*
@@ -32,7 +33,6 @@ enum qdisc_state_t {
  */
 enum qdisc___state_t {
        __QDISC___STATE_RUNNING = 1,
-       __QDISC___STATE_THROTTLED = 2,
 };
 
 struct qdisc_size_table {
@@ -106,17 +106,17 @@ static inline void qdisc_run_end(struct Qdisc *qdisc)
 
 static inline bool qdisc_is_throttled(const struct Qdisc *qdisc)
 {
-       return (qdisc->__state & __QDISC___STATE_THROTTLED) ? true : false;
+       return test_bit(__QDISC_STATE_THROTTLED, &qdisc->state) ? true : false;
 }
 
 static inline void qdisc_throttled(struct Qdisc *qdisc)
 {
-       qdisc->__state |= __QDISC___STATE_THROTTLED;
+       set_bit(__QDISC_STATE_THROTTLED, &qdisc->state);
 }
 
 static inline void qdisc_unthrottled(struct Qdisc *qdisc)
 {
-       qdisc->__state &= ~__QDISC___STATE_THROTTLED;
+       clear_bit(__QDISC_STATE_THROTTLED, &qdisc->state);
 }
 
 struct Qdisc_class_ops {
@@ -181,8 +181,9 @@ struct tcf_proto_ops {
        struct tcf_proto_ops    *next;
        char                    kind[IFNAMSIZ];
 
-       int                     (*classify)(struct sk_buff*, struct tcf_proto*,
-                                       struct tcf_result *);
+       int                     (*classify)(struct sk_buff *,
+                                           const struct tcf_proto *,
+                                           struct tcf_result *);
        int                     (*init)(struct tcf_proto*);
        void                    (*destroy)(struct tcf_proto*);
 
@@ -205,8 +206,9 @@ struct tcf_proto {
        /* Fast access part */
        struct tcf_proto        *next;
        void                    *root;
-       int                     (*classify)(struct sk_buff*, struct tcf_proto*,
-                                       struct tcf_result *);
+       int                     (*classify)(struct sk_buff *,
+                                           const struct tcf_proto *,
+                                           struct tcf_result *);
        __be16                  protocol;
 
        /* All the rest */
@@ -214,7 +216,7 @@ struct tcf_proto {
        u32                     classid;
        struct Qdisc            *q;
        void                    *data;
-       struct tcf_proto_ops    *ops;
+       const struct tcf_proto_ops      *ops;
 };
 
 struct qdisc_skb_cb {