Commit e7d92548 authored by Stephen Hemminger's avatar Stephen Hemminger

[PATCH] (1/8) arlan -- merge arlan-proc with main code

The arlan driver tries to build it's /proc interface into a separate module,
which leads to circular dependencies and other ugliness.  This patch
moves arlan.c to arlan-main.c and changes initialization builds one module arlan.o

Patch is for 2.6.0-test5
parent 73cc0944
......@@ -3,7 +3,9 @@
#
obj-$(CONFIG_STRIP) += strip.o
obj-$(CONFIG_ARLAN) += arlan.o arlan-proc.o
obj-$(CONFIG_ARLAN) += arlan.o
arlan-objs := arlan-main.o arlan-proc.o
# Obsolete cards
obj-$(CONFIG_WAVELAN) += wavelan.o
......
......@@ -91,11 +91,6 @@ MODULE_PARM_DESC(arlan_exit_debug, "(ignored)");
MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)");
#endif
EXPORT_SYMBOL(arlan_device);
EXPORT_SYMBOL(arlan_conf);
EXPORT_SYMBOL(last_arlan);
// #warning kernel 2.1.110 tested
#define myATOMIC_INIT(a,b) atomic_set(&(a),b)
......@@ -127,8 +122,6 @@ static void arlan_process_interrupt (struct net_device * dev);
static void arlan_tx_timeout (struct net_device *dev);
int arlan_command(struct net_device * dev, int command);
EXPORT_SYMBOL(arlan_command);
static inline long long arlan_time(void)
{
struct timeval timev;
......@@ -1327,12 +1320,6 @@ static int arlan_open(struct net_device *dev)
mdelay(200);
add_timer(&priv->timer);
#ifdef CONFIG_PROC_FS
#ifndef MODULE
if (arlan_device[0])
init_arlan_proc();
#endif
#endif
ARLAN_DEBUG_EXIT("arlan_open");
return 0;
}
......@@ -2037,6 +2024,7 @@ int init_module(void)
arlan_probe_everywhere(arlan_device[i]);
// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN );
}
init_arlan_proc();
printk(KERN_INFO "Arlan driver %s\n", arlan_version);
ARLAN_DEBUG_EXIT("init_module");
return 0;
......@@ -2052,6 +2040,9 @@ void cleanup_module(void)
IFDEBUG(ARLAN_DEBUG_SHUTDOWN)
printk(KERN_INFO "arlan: unloading module\n");
cleanup_arlan_proc();
for (i = 0; i < MAX_ARLANS; i++)
{
if (arlan_device[i])
......
......@@ -1233,7 +1233,7 @@ static ctl_table arlan_root_table[] =
static struct ctl_table_header *arlan_device_sysctl_header;
int init_arlan_proc(void)
int __init init_arlan_proc(void)
{
int i = 0;
......@@ -1247,25 +1247,11 @@ int init_arlan_proc(void)
return 0;
};
#ifdef MODULE
int init_module(void)
{
return init_arlan_proc();
};
}
void cleanup_module(void)
void __exit cleanup_arlan_proc(void)
{
unregister_sysctl_table(arlan_device_sysctl_header);
arlan_device_sysctl_header = NULL;
return;
};
#endif // MODULE
MODULE_LICENSE("GPL");
}
......@@ -39,9 +39,12 @@
#define ARLAN_RCV_PROMISC 1
#define ARLAN_RCV_CONTROL 2
#ifdef CONFIG_PROC_FS
extern int init_arlan_proc(void);
extern int init_arlan_proc(void);
extern void cleanup_arlan_proc(void);
#else
#define init_arlan_proc() (0)
#define cleanup_arlan_proc() do { } while (0);
#endif
extern struct net_device *arlan_device[MAX_ARLANS];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment