diff options
-rw-r--r-- | net/sched/sch_netem.c | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 3080bd6ee332..2ad09594c8bc 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -622,95 +622,8 @@ nla_put_failure: | |||
622 | return -1; | 622 | return -1; |
623 | } | 623 | } |
624 | 624 | ||
625 | static int netem_dump_class(struct Qdisc *sch, unsigned long cl, | ||
626 | struct sk_buff *skb, struct tcmsg *tcm) | ||
627 | { | ||
628 | struct netem_sched_data *q = qdisc_priv(sch); | ||
629 | |||
630 | if (cl != 1) /* only one class */ | ||
631 | return -ENOENT; | ||
632 | |||
633 | tcm->tcm_handle |= TC_H_MIN(1); | ||
634 | tcm->tcm_info = q->qdisc->handle; | ||
635 | |||
636 | return 0; | ||
637 | } | ||
638 | |||
639 | static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, | ||
640 | struct Qdisc **old) | ||
641 | { | ||
642 | struct netem_sched_data *q = qdisc_priv(sch); | ||
643 | |||
644 | if (new == NULL) | ||
645 | new = &noop_qdisc; | ||
646 | |||
647 | sch_tree_lock(sch); | ||
648 | *old = xchg(&q->qdisc, new); | ||
649 | qdisc_tree_decrease_qlen(*old, (*old)->q.qlen); | ||
650 | qdisc_reset(*old); | ||
651 | sch_tree_unlock(sch); | ||
652 | |||
653 | return 0; | ||
654 | } | ||
655 | |||
656 | static struct Qdisc *netem_leaf(struct Qdisc *sch, unsigned long arg) | ||
657 | { | ||
658 | struct netem_sched_data *q = qdisc_priv(sch); | ||
659 | return q->qdisc; | ||
660 | } | ||
661 | |||
662 | static unsigned long netem_get(struct Qdisc *sch, u32 classid) | ||
663 | { | ||
664 | return 1; | ||
665 | } | ||
666 | |||
667 | static void netem_put(struct Qdisc *sch, unsigned long arg) | ||
668 | { | ||
669 | } | ||
670 | |||
671 | static int netem_change_class(struct Qdisc *sch, u32 classid, u32 parentid, | ||
672 | struct nlattr **tca, unsigned long *arg) | ||
673 | { | ||
674 | return -ENOSYS; | ||
675 | } | ||
676 | |||
677 | static int netem_delete(struct Qdisc *sch, unsigned long arg) | ||
678 | { | ||
679 | return -ENOSYS; | ||
680 | } | ||
681 | |||
682 | static void netem_walk(struct Qdisc *sch, struct qdisc_walker *walker) | ||
683 | { | ||
684 | if (!walker->stop) { | ||
685 | if (walker->count >= walker->skip) | ||
686 | if (walker->fn(sch, 1, walker) < 0) { | ||
687 | walker->stop = 1; | ||
688 | return; | ||
689 | } | ||
690 | walker->count++; | ||
691 | } | ||
692 | } | ||
693 | |||
694 | static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl) | ||
695 | { | ||
696 | return NULL; | ||
697 | } | ||
698 | |||
699 | static const struct Qdisc_class_ops netem_class_ops = { | ||
700 | .graft = netem_graft, | ||
701 | .leaf = netem_leaf, | ||
702 | .get = netem_get, | ||
703 | .put = netem_put, | ||
704 | .change = netem_change_class, | ||
705 | .delete = netem_delete, | ||
706 | .walk = netem_walk, | ||
707 | .tcf_chain = netem_find_tcf, | ||
708 | .dump = netem_dump_class, | ||
709 | }; | ||
710 | |||
711 | static struct Qdisc_ops netem_qdisc_ops __read_mostly = { | 625 | static struct Qdisc_ops netem_qdisc_ops __read_mostly = { |
712 | .id = "netem", | 626 | .id = "netem", |
713 | .cl_ops = &netem_class_ops, | ||
714 | .priv_size = sizeof(struct netem_sched_data), | 627 | .priv_size = sizeof(struct netem_sched_data), |
715 | .enqueue = netem_enqueue, | 628 | .enqueue = netem_enqueue, |
716 | .dequeue = netem_dequeue, | 629 | .dequeue = netem_dequeue, |