Commit 282bef19 authored by Chas Williams's avatar Chas Williams Committed by David S. Miller

[ATM]: Allow ATM to be loaded as a module.

parent f958137c
...@@ -7,14 +7,14 @@ menu "ATM drivers" ...@@ -7,14 +7,14 @@ menu "ATM drivers"
config ATM_TCP config ATM_TCP
tristate "ATM over TCP" tristate "ATM over TCP"
depends on INET depends on INET && ATM
help help
ATM over TCP driver. Useful mainly for development and for ATM over TCP driver. Useful mainly for development and for
experiments. If unsure, say N. experiments. If unsure, say N.
config ATM_LANAI config ATM_LANAI
tristate "Efficient Networks Speedstream 3010" tristate "Efficient Networks Speedstream 3010"
depends on PCI depends on PCI && ATM
help help
Supports ATM cards based on the Efficient Networks "Lanai" Supports ATM cards based on the Efficient Networks "Lanai"
chipset such as the Speedstream 3010 and the ENI-25p. The chipset such as the Speedstream 3010 and the ENI-25p. The
...@@ -23,7 +23,7 @@ config ATM_LANAI ...@@ -23,7 +23,7 @@ config ATM_LANAI
config ATM_ENI config ATM_ENI
tristate "Efficient Networks ENI155P" tristate "Efficient Networks ENI155P"
depends on PCI depends on PCI && ATM
---help--- ---help---
Driver for the Efficient Networks ENI155p series and SMC ATM Driver for the Efficient Networks ENI155p series and SMC ATM
Power155 155 Mbps ATM adapters. Both, the versions with 512KB and Power155 155 Mbps ATM adapters. Both, the versions with 512KB and
...@@ -133,7 +133,7 @@ config ATM_ENI_BURST_RX_2W ...@@ -133,7 +133,7 @@ config ATM_ENI_BURST_RX_2W
config ATM_FIRESTREAM config ATM_FIRESTREAM
tristate "Fujitsu FireStream (FS50/FS155) " tristate "Fujitsu FireStream (FS50/FS155) "
depends on PCI depends on PCI && ATM
help help
Driver for the Fujitsu FireStream 155 (MB86697) and Driver for the Fujitsu FireStream 155 (MB86697) and
FireStream 50 (MB86695) ATM PCI chips. FireStream 50 (MB86695) ATM PCI chips.
...@@ -145,7 +145,7 @@ config ATM_FIRESTREAM ...@@ -145,7 +145,7 @@ config ATM_FIRESTREAM
config ATM_ZATM config ATM_ZATM
tristate "ZeitNet ZN1221/ZN1225" tristate "ZeitNet ZN1221/ZN1225"
depends on PCI depends on PCI && ATM
help help
Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM
adapters. adapters.
...@@ -182,7 +182,7 @@ config ATM_ZATM_EXACT_TS ...@@ -182,7 +182,7 @@ config ATM_ZATM_EXACT_TS
# fi # fi
config ATM_NICSTAR config ATM_NICSTAR
tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" tristate "IDT 77201 (NICStAR) (ForeRunnerLE)"
depends on PCI depends on PCI && ATM
help help
The NICStAR chipset family is used in a large number of ATM NICs for The NICStAR chipset family is used in a large number of ATM NICs for
25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE 25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE
...@@ -217,7 +217,7 @@ config ATM_NICSTAR_USE_IDT77105 ...@@ -217,7 +217,7 @@ config ATM_NICSTAR_USE_IDT77105
config ATM_IDT77252 config ATM_IDT77252
tristate "IDT 77252 (NICStAR II)" tristate "IDT 77252 (NICStAR II)"
depends on PCI depends on PCI && ATM
help help
Driver for the IDT 77252 ATM PCI chips. Driver for the IDT 77252 ATM PCI chips.
...@@ -253,7 +253,7 @@ config ATM_IDT77252_USE_SUNI ...@@ -253,7 +253,7 @@ config ATM_IDT77252_USE_SUNI
config ATM_AMBASSADOR config ATM_AMBASSADOR
tristate "Madge Ambassador (Collage PCI 155 Server)" tristate "Madge Ambassador (Collage PCI 155 Server)"
depends on PCI depends on PCI && ATM
help help
This is a driver for ATMizer based ATM card produced by Madge This is a driver for ATMizer based ATM card produced by Madge
Networks Ltd. Say Y (or M to compile as a module named ambassador) Networks Ltd. Say Y (or M to compile as a module named ambassador)
...@@ -277,7 +277,7 @@ config ATM_AMBASSADOR_DEBUG ...@@ -277,7 +277,7 @@ config ATM_AMBASSADOR_DEBUG
config ATM_HORIZON config ATM_HORIZON
tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)" tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)"
depends on PCI depends on PCI && ATM
help help
This is a driver for the Horizon chipset ATM adapter cards once This is a driver for the Horizon chipset ATM adapter cards once
produced by Madge Networks Ltd. Say Y (or M to compile as a module produced by Madge Networks Ltd. Say Y (or M to compile as a module
...@@ -301,7 +301,7 @@ config ATM_HORIZON_DEBUG ...@@ -301,7 +301,7 @@ config ATM_HORIZON_DEBUG
config ATM_IA config ATM_IA
tristate "Interphase ATM PCI x575/x525/x531" tristate "Interphase ATM PCI x575/x525/x531"
depends on PCI depends on PCI && ATM
---help--- ---help---
This is a driver for the Interphase (i)ChipSAR adapter cards This is a driver for the Interphase (i)ChipSAR adapter cards
which include a variety of variants in term of the size of the which include a variety of variants in term of the size of the
...@@ -334,7 +334,7 @@ config ATM_IA_DEBUG ...@@ -334,7 +334,7 @@ config ATM_IA_DEBUG
config ATM_FORE200E_MAYBE config ATM_FORE200E_MAYBE
tristate "FORE Systems 200E-series" tristate "FORE Systems 200E-series"
depends on PCI || SBUS depends on (PCI || SBUS) && ATM
---help--- ---help---
This is a driver for the FORE Systems 200E-series ATM adapter This is a driver for the FORE Systems 200E-series ATM adapter
cards. It simultaneously supports PCA-200E and SBA-200E models cards. It simultaneously supports PCA-200E and SBA-200E models
......
...@@ -213,7 +213,7 @@ source "net/xfrm/Kconfig" ...@@ -213,7 +213,7 @@ source "net/xfrm/Kconfig"
source "net/sctp/Kconfig" source "net/sctp/Kconfig"
config ATM config ATM
bool "Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)" tristate "Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)"
depends on EXPERIMENTAL depends on EXPERIMENTAL
---help--- ---help---
ATM is a high-speed networking technology for Local Area Networks ATM is a high-speed networking technology for Local Area Networks
......
...@@ -11,7 +11,7 @@ atm-$(subst m,y,$(CONFIG_ATM_CLIP)) += ipcommon.o ...@@ -11,7 +11,7 @@ atm-$(subst m,y,$(CONFIG_ATM_CLIP)) += ipcommon.o
obj-$(CONFIG_ATM_BR2684) += br2684.o obj-$(CONFIG_ATM_BR2684) += br2684.o
atm-$(subst m,y,$(CONFIG_ATM_BR2684)) += ipcommon.o atm-$(subst m,y,$(CONFIG_ATM_BR2684)) += ipcommon.o
atm-$(subst m,y,$CONFIG_NET_SCH_ATM)) += ipcommon.o atm-$(subst m,y,$CONFIG_NET_SCH_ATM)) += ipcommon.o
obj-$(CONFIG_PROC_FS) += proc.o atm-$(CONFIG_PROC_FS) += proc.o
obj-$(CONFIG_ATM_LANE) += lec.o obj-$(CONFIG_ATM_LANE) += lec.o
obj-$(CONFIG_ATM_MPOA) += mpoa.o obj-$(CONFIG_ATM_MPOA) += mpoa.o
......
...@@ -1209,3 +1209,43 @@ void atm_lane_init(void) ...@@ -1209,3 +1209,43 @@ void atm_lane_init(void)
return; return;
} }
#endif #endif
static int __init atm_init(void)
{
int error;
if ((error = atmpvc_init()) < 0) {
printk(KERN_ERR "atmpvc_init() failed with %d\n", error);
goto failure;
}
if ((error = atmsvc_init()) < 0) {
printk(KERN_ERR "atmsvc_init() failed with %d\n", error);
goto failure;
}
#ifdef CONFIG_PROC_FS
if ((error = atm_proc_init()) < 0) {
printk(KERN_ERR "atm_proc_init() failed with %d\n",error);
goto failure;
}
#endif
return 0;
failure:
atmsvc_exit();
atmpvc_exit();
return error;
}
static void __exit atm_exit(void)
{
#ifdef CONFIG_PROC_FS
atm_proc_exit();
#endif
atmsvc_exit();
atmpvc_exit();
}
module_init(atm_init);
module_exit(atm_exit);
MODULE_LICENSE("GPL");
...@@ -28,7 +28,12 @@ int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci); ...@@ -28,7 +28,12 @@ int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci);
void atm_release_vcc_sk(struct sock *sk,int free_sk); void atm_release_vcc_sk(struct sock *sk,int free_sk);
void atm_shutdown_dev(struct atm_dev *dev); void atm_shutdown_dev(struct atm_dev *dev);
int atmpvc_init(void);
void atmpvc_exit(void);
int atmsvc_init(void);
void atmsvc_exit(void);
int atm_proc_init(void); int atm_proc_init(void);
void atm_proc_exit(void);
/* SVC */ /* SVC */
......
...@@ -632,12 +632,28 @@ void atm_proc_dev_deregister(struct atm_dev *dev) ...@@ -632,12 +632,28 @@ void atm_proc_dev_deregister(struct atm_dev *dev)
name->proc_fops = &proc_spec_atm_operations; \ name->proc_fops = &proc_spec_atm_operations; \
name->owner = THIS_MODULE name->owner = THIS_MODULE
static struct proc_dir_entry *devices = NULL, *pvc = NULL,
*svc = NULL, *arp = NULL, *lec = NULL, *vc = NULL;
int __init atm_proc_init(void) static void atm_proc_cleanup(void)
{ {
struct proc_dir_entry *devices = NULL,*pvc = NULL,*svc = NULL; if (devices)
struct proc_dir_entry *arp = NULL,*lec = NULL,*vc = NULL; remove_proc_entry("devices",atm_proc_root);
if (pvc)
remove_proc_entry("pvc",atm_proc_root);
if (svc)
remove_proc_entry("svc",atm_proc_root);
if (arp)
remove_proc_entry("arp",atm_proc_root);
if (lec)
remove_proc_entry("lec",atm_proc_root);
if (vc)
remove_proc_entry("vc",atm_proc_root);
remove_proc_entry("net/atm",NULL);
}
int __init atm_proc_init(void)
{
atm_proc_root = proc_mkdir("net/atm",NULL); atm_proc_root = proc_mkdir("net/atm",NULL);
if (!atm_proc_root) if (!atm_proc_root)
return -ENOMEM; return -ENOMEM;
...@@ -654,12 +670,11 @@ int __init atm_proc_init(void) ...@@ -654,12 +670,11 @@ int __init atm_proc_init(void)
return 0; return 0;
cleanup: cleanup:
if (devices) remove_proc_entry("devices",atm_proc_root); atm_proc_cleanup();
if (pvc) remove_proc_entry("pvc",atm_proc_root);
if (svc) remove_proc_entry("svc",atm_proc_root);
if (arp) remove_proc_entry("arp",atm_proc_root);
if (lec) remove_proc_entry("lec",atm_proc_root);
if (vc) remove_proc_entry("vc",atm_proc_root);
remove_proc_entry("net/atm",NULL);
return -ENOMEM; return -ENOMEM;
} }
void __exit atm_proc_exit(void)
{
atm_proc_cleanup();
}
...@@ -116,20 +116,12 @@ static struct net_proto_family pvc_family_ops = { ...@@ -116,20 +116,12 @@ static struct net_proto_family pvc_family_ops = {
*/ */
static int __init atmpvc_init(void) int __init atmpvc_init(void)
{ {
int error; return sock_register(&pvc_family_ops);
error = sock_register(&pvc_family_ops);
if (error < 0) {
printk(KERN_ERR "ATMPVC: can't register (%d)",error);
return error;
}
#ifdef CONFIG_PROC_FS
error = atm_proc_init();
if (error) printk("atm_proc_init fails with %d\n",error);
#endif
return 0;
} }
module_init(atmpvc_init); void __exit atmpvc_exit(void)
{
sock_unregister(PF_ATMPVC);
}
...@@ -439,13 +439,12 @@ static struct net_proto_family svc_family_ops = { ...@@ -439,13 +439,12 @@ static struct net_proto_family svc_family_ops = {
* Initialize the ATM SVC protocol family * Initialize the ATM SVC protocol family
*/ */
static int __init atmsvc_init(void) int __init atmsvc_init(void)
{ {
if (sock_register(&svc_family_ops) < 0) { return sock_register(&svc_family_ops);
printk(KERN_ERR "ATMSVC: can't register");
return -1;
}
return 0;
} }
module_init(atmsvc_init); void __exit atmsvc_exit(void)
{
sock_unregister(PF_ATMSVC);
}
...@@ -63,7 +63,7 @@ config NET_SCH_CSZ ...@@ -63,7 +63,7 @@ config NET_SCH_CSZ
#tristate ' H-PFQ packet scheduler' CONFIG_NET_SCH_HPFQ #tristate ' H-PFQ packet scheduler' CONFIG_NET_SCH_HPFQ
#tristate ' H-FSC packet scheduler' CONFIG_NET_SCH_HFCS #tristate ' H-FSC packet scheduler' CONFIG_NET_SCH_HFCS
config NET_SCH_ATM config NET_SCH_ATM
bool "ATM pseudo-scheduler" tristate "ATM pseudo-scheduler"
depends on NET_SCHED && ATM depends on NET_SCHED && ATM
---help--- ---help---
Say Y here if you want to use the ATM pseudo-scheduler. This Say Y here if you want to use the ATM pseudo-scheduler. This
......
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