]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/bridge/br.c
bridge: Use STP demux
[linux-2.6-omap-h63xx.git] / net / bridge / br.c
index 848b8fa8bedd23ee09048ec87e096fc505b6fcb7..573acdf6f9ff1ca8469f0008ebcbe192a5907d22 100644 (file)
@@ -5,8 +5,6 @@
  *     Authors:
  *     Lennert Buytenhek               <buytenh@gnu.org>
  *
- *     $Id: br.c,v 1.47 2001/12/24 00:56:41 davem Exp $
- *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
  *     as published by the Free Software Foundation; either version
 #include <linux/init.h>
 #include <linux/llc.h>
 #include <net/llc.h>
+#include <net/stp.h>
 
 #include "br_private.h"
 
-int (*br_should_route_hook) (struct sk_buff **pskb) = NULL;
+int (*br_should_route_hook)(struct sk_buff *skb);
 
-static struct llc_sap *br_stp_sap;
+static const struct stp_proto br_stp_proto = {
+       .rcv    = br_stp_rcv,
+};
 
 static int __init br_init(void)
 {
        int err;
 
-       br_stp_sap = llc_sap_open(LLC_SAP_BSPAN, br_stp_rcv);
-       if (!br_stp_sap) {
+       err = stp_proto_register(&br_stp_proto);
+       if (err < 0) {
                printk(KERN_ERR "bridge: can't register sap for STP\n");
-               return -EADDRINUSE;
+               return err;
        }
 
        err = br_fdb_init();
        if (err)
-               goto err_out1;
+               goto err_out;
 
        err = br_netfilter_init();
        if (err)
@@ -65,16 +66,17 @@ err_out3:
 err_out2:
        br_netfilter_fini();
 err_out1:
-       llc_sap_put(br_stp_sap);
+       br_fdb_fini();
+err_out:
+       stp_proto_unregister(&br_stp_proto);
        return err;
 }
 
 static void __exit br_deinit(void)
 {
-       rcu_assign_pointer(br_stp_sap->rcv_func, NULL);
+       stp_proto_unregister(&br_stp_proto);
 
        br_netlink_fini();
-       br_netfilter_fini();
        unregister_netdevice_notifier(&br_device_notifier);
        brioctl_set(NULL);
 
@@ -82,7 +84,7 @@ static void __exit br_deinit(void)
 
        synchronize_net();
 
-       llc_sap_put(br_stp_sap);
+       br_netfilter_fini();
        br_fdb_get_hook = NULL;
        br_fdb_put_hook = NULL;