* [PATCH] more sdla fixes
@ 2003-09-04 21:42 Stephen Hemminger
2003-09-05 9:46 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2003-09-04 21:42 UTC (permalink / raw)
To: Jeff Garzik, David S. Miller; +Cc: netdev
Since sdla.c now has locking instead of cli/sti, it shouldn't be
completely busted on SMP.
Also, the frad interface registration needed to be done once
(and check the result), and undone on module unload.
diff -Nru a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
--- a/drivers/net/wan/Kconfig Thu Sep 4 14:41:49 2003
+++ b/drivers/net/wan/Kconfig Thu Sep 4 14:41:49 2003
@@ -465,7 +465,7 @@
config SDLA
tristate "SDLA (Sangoma S502/S508) support"
- depends on DLCI && ISA && BROKEN_ON_SMP
+ depends on DLCI && ISA
help
Say Y here if you need a driver for the Sangoma S502A, S502E, and
S508 Frame Relay Access Devices. These are multi-protocol cards, but
diff -Nru a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
--- a/drivers/net/wan/sdla.c Thu Sep 4 14:41:49 2003
+++ b/drivers/net/wan/sdla.c Thu Sep 4 14:41:49 2003
@@ -1634,12 +1634,26 @@
dev->mtu = SDLA_MAX_MTU;
}
+static int frad_registered;
+
struct net_device * __init sdla_init(void)
{
struct net_device *dev;
struct frad_local *flp;
int err = -ENOMEM;
+ if (!frad_registered) {
+ err = register_frad(devname);
+ if (err) {
+ printk(KERN_ERR "%s: frad registration failed %d\n",
+ devname, err);
+ return ERR_PTR(err);
+ }
+ frad_registered = 1;
+ printk("%s.\n", version);
+ }
+
+
dev = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla);
if (!dev)
goto out;
@@ -1678,39 +1692,35 @@
return ERR_PTR(err);
}
-int __init sdla_c_setup(void)
-{
- printk("%s.\n", version);
- register_frad(devname);
- return 0;
-}
-
#ifdef MODULE
static struct net_device *sdla0;
-#endif /* MODULE */
static int __init init_sdla(void)
{
int result = 0;
- sdla_c_setup();
-#ifdef MODULE
sdla0 = sdla_init();
if (IS_ERR(sdla0))
result = PTR_ERR(sdla0);
-#endif
+
return result;
}
static void __exit exit_sdla(void)
{
-#ifdef MODULE
+ struct frad_local *flp;
+
unregister_netdev(sdla0);
if (sdla0->irq)
free_irq(sdla0->irq, sdla0);
+
+ flp = sdla0->priv;
+ del_timer_sync(&flp->timer);
free_netdev(sdla0);
-#endif
+
+ unregister_frad(devname);
}
+#endif
MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] more sdla fixes
2003-09-04 21:42 [PATCH] more sdla fixes Stephen Hemminger
@ 2003-09-05 9:46 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-09-05 9:46 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: jgarzik, netdev
On Thu, 4 Sep 2003 14:42:48 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:
> Since sdla.c now has locking instead of cli/sti, it shouldn't be
> completely busted on SMP.
>
> Also, the frad interface registration needed to be done once
> (and check the result), and undone on module unload.
Looks good, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-05 9:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-04 21:42 [PATCH] more sdla fixes Stephen Hemminger
2003-09-05 9:46 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).