aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2007-03-22 14:55:50 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:27:09 -0400
commitbe577ddc2b4aca0849f701222f5bc13cf1b79c9a (patch)
tree39ea6dcd40885a79cb1e3172b3299069156993f4
parent63f3444fb9a54c024d55f1205f8b94e7d2786595 (diff)
[PKT_SCHED] qdisc: Use rtnl registration interface
Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sch_generic.h2
-rw-r--r--net/sched/sch_api.c27
2 files changed, 8 insertions, 21 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 82086392735a..a3f4ddd1d6a8 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -5,10 +5,10 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/rcupdate.h> 6#include <linux/rcupdate.h>
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/rtnetlink.h>
9#include <linux/pkt_sched.h> 8#include <linux/pkt_sched.h>
10#include <linux/pkt_cls.h> 9#include <linux/pkt_cls.h>
11#include <net/gen_stats.h> 10#include <net/gen_stats.h>
11#include <net/rtnetlink.h>
12 12
13struct Qdisc_ops; 13struct Qdisc_ops;
14struct qdisc_walker; 14struct qdisc_walker;
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 0b9abea68fd5..b06f20294ac0 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -27,7 +27,6 @@
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/netdevice.h> 28#include <linux/netdevice.h>
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <linux/rtnetlink.h>
31#include <linux/init.h> 30#include <linux/init.h>
32#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
33#include <linux/seq_file.h> 32#include <linux/seq_file.h>
@@ -1239,29 +1238,17 @@ static const struct file_operations psched_fops = {
1239 1238
1240static int __init pktsched_init(void) 1239static int __init pktsched_init(void)
1241{ 1240{
1242 struct rtnetlink_link *link_p;
1243
1244 link_p = rtnetlink_links[PF_UNSPEC];
1245
1246 /* Setup rtnetlink links. It is made here to avoid
1247 exporting large number of public symbols.
1248 */
1249
1250 if (link_p) {
1251 link_p[RTM_NEWQDISC-RTM_BASE].doit = tc_modify_qdisc;
1252 link_p[RTM_DELQDISC-RTM_BASE].doit = tc_get_qdisc;
1253 link_p[RTM_GETQDISC-RTM_BASE].doit = tc_get_qdisc;
1254 link_p[RTM_GETQDISC-RTM_BASE].dumpit = tc_dump_qdisc;
1255 link_p[RTM_NEWTCLASS-RTM_BASE].doit = tc_ctl_tclass;
1256 link_p[RTM_DELTCLASS-RTM_BASE].doit = tc_ctl_tclass;
1257 link_p[RTM_GETTCLASS-RTM_BASE].doit = tc_ctl_tclass;
1258 link_p[RTM_GETTCLASS-RTM_BASE].dumpit = tc_dump_tclass;
1259 }
1260
1261 register_qdisc(&pfifo_qdisc_ops); 1241 register_qdisc(&pfifo_qdisc_ops);
1262 register_qdisc(&bfifo_qdisc_ops); 1242 register_qdisc(&bfifo_qdisc_ops);
1263 proc_net_fops_create("psched", 0, &psched_fops); 1243 proc_net_fops_create("psched", 0, &psched_fops);
1264 1244
1245 rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL);
1246 rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL);
1247 rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc);
1248 rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL);
1249 rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL);
1250 rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass);
1251
1265 return 0; 1252 return 0;
1266} 1253}
1267 1254