summaryrefslogtreecommitdiffstats
path: root/net/atm/common.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
commite47f00743fc4776491344f2c618cc8dc2c23bcbc (patch)
tree13e03a113a82a184c51c19c209867cfd3a59b3b9 /net/atm/common.c
parentb2ad5f821b1381492d792ca10b1eb7a107b48f14 (diff)
Merge with Linux 2.4.0.
Diffstat (limited to 'net/atm/common.c')
-rw-r--r--net/atm/common.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/net/atm/common.c b/net/atm/common.c
index ea0ad690a..b2bd5a624 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -5,6 +5,7 @@
#include <linux/config.h>
#include <linux/module.h>
+#include <linux/kmod.h>
#include <linux/net.h> /* struct socket, struct net_proto, struct
proto_ops */
#include <linux/atm.h> /* ATM stuff */
@@ -679,7 +680,7 @@ int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg)
goto done;
}
if (atm_lane_ops.lecd_attach == NULL)
- atm_lane_init();
+ atm_lane_init();
if (atm_lane_ops.lecd_attach == NULL) { /* try again */
ret_val = -ENOSYS;
goto done;
@@ -1086,3 +1087,61 @@ int atm_getsockopt(struct socket *sock,int level,int optname,
return -EINVAL;
return atm_do_getsockopt(sock,level,optname,optval,len);
}
+
+
+/*
+ * lane_mpoa_init.c: A couple of helper functions
+ * to make modular LANE and MPOA client easier to implement
+ */
+
+/*
+ * This is how it goes:
+ *
+ * if xxxx is not compiled as module, call atm_xxxx_init_ops()
+ * from here
+ * else call atm_mpoa_init_ops() from init_module() within
+ * the kernel when xxxx module is loaded
+ *
+ * In either case function pointers in struct atm_xxxx_ops
+ * are initialized to their correct values. Either they
+ * point to functions in the module or in the kernel
+ */
+
+extern struct atm_mpoa_ops atm_mpoa_ops; /* in common.c */
+extern struct atm_lane_ops atm_lane_ops; /* in common.c */
+
+#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE)
+void atm_mpoa_init(void)
+{
+#ifndef CONFIG_ATM_MPOA_MODULE /* not module */
+ atm_mpoa_init_ops(&atm_mpoa_ops);
+#else
+ request_module("mpoa");
+#endif
+
+ return;
+}
+#endif
+
+#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
+#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
+struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br,
+ unsigned char *addr) = NULL;
+void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent) = NULL;
+#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE)
+EXPORT_SYMBOL(br_fdb_get_hook);
+EXPORT_SYMBOL(br_fdb_put_hook);
+#endif /* defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE) */
+#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
+
+void atm_lane_init(void)
+{
+#ifndef CONFIG_ATM_LANE_MODULE /* not module */
+ atm_lane_init_ops(&atm_lane_ops);
+#else
+ request_module("lec");
+#endif
+
+ return;
+}
+#endif