3 * ===================================
4 * HARP | Host ATM Research Platform
5 * ===================================
8 * This Host ATM Research Platform ("HARP") file (the "Software") is
9 * made available by Network Computing Services, Inc. ("NetworkCS")
10 * "AS IS". NetworkCS does not provide maintenance, improvements or
11 * support of any kind.
13 * NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
14 * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
15 * AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
16 * SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
17 * In no event shall NetworkCS be responsible for any damages, including
18 * but not limited to consequential damages, arising from or relating to
19 * any use of the Software or related support.
21 * Copyright 1994-1998 Network Computing Services, Inc.
23 * Copies of this Software may be made, however, the above copyright
24 * notice must be reproduced on all copies.
26 * @(#) $FreeBSD: src/sys/netatm/uni/uni_load.c,v 1.4 2000/01/17 20:49:54 mks Exp $
27 * @(#) $DragonFly: src/sys/netproto/atm/uni/uni_load.c,v 1.8 2006/01/14 13:36:39 swildner Exp $
31 * ATM Forum UNI Support
32 * ---------------------
34 * Loadable kernel module support
38 #ifndef ATM_UNI_MODULE
42 #include <netproto/atm/kern_include.h>
47 int sscop_start (void);
48 int sscop_stop (void);
49 int sscf_uni_start (void);
50 int sscf_uni_stop (void);
51 int uniip_start (void);
52 int uniip_stop (void);
53 int unisig_start (void);
54 int unisig_stop (void);
59 static int uni_start (void);
60 static int uni_stop (void);
64 * Initialize uni processing
66 * This will be called during module loading. We just notify all of our
67 * sub-services to initialize.
73 * 0 startup was successful
74 * errno startup failed - reason indicated
83 * Verify software version
85 if (atm_version != ATM_VERSION) {
86 log(LOG_ERR, "version mismatch: uni=%d.%d kernel=%d.%d\n",
87 ATM_VERS_MAJ(ATM_VERSION), ATM_VERS_MIN(ATM_VERSION),
88 ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version));
93 * Initialize uni sub-services
99 err = sscf_uni_start();
103 err = unisig_start();
117 * Halt uni processing
119 * This will be called just prior to unloading the module from
120 * memory. All sub-services will be notified of the termination.
126 * 0 shutdown was successful
127 * errno shutdown failed - reason indicated
137 * Terminate uni sub-services
147 err = sscf_uni_stop();
161 #ifdef ATM_UNI_MODULE
163 *******************************************************************
165 * Loadable Module Support
167 *******************************************************************
169 static int uni_doload (void);
170 static int uni_dounload (void);
173 * Generic module load processing
175 * This function is called by an OS-specific function when this
176 * module is being loaded.
182 * 0 load was successful
183 * errno load failed - reason indicated
196 /* Problems, clean up */
204 * Generic module unload processing
206 * This function is called by an OS-specific function when this
207 * module is being unloaded.
213 * 0 unload was successful
214 * errno unload failed - reason indicated
223 * OK, try to clean up our mess
230 #include <sys/exec.h>
231 #include <sys/sysent.h>
235 * Loadable miscellaneous module description
241 * Loadable module support "load" entry point
243 * This is the routine called by the lkm driver whenever the
244 * modload(1) command is issued for this module.
247 * lkmtp pointer to lkm drivers's structure
248 * cmd lkm command code
251 * 0 command was successful
252 * errno command failed - reason indicated
256 uni_load(struct lkm_table *lkmtp, int cmd)
258 return(uni_doload());
263 * Loadable module support "unload" entry point
265 * This is the routine called by the lkm driver whenever the
266 * modunload(1) command is issued for this module.
269 * lkmtp pointer to lkm drivers's structure
270 * cmd lkm command code
273 * 0 command was successful
274 * errno command failed - reason indicated
278 uni_unload(struct lkm_table *lkmtp, int cmd)
280 return(uni_dounload());
285 * Loadable module support entry point
287 * This is the routine called by the lkm driver for all loadable module
288 * functions for this driver. This routine name must be specified
289 * on the modload(1) command. This routine will be called whenever the
290 * modload(1), modunload(1) or modstat(1) commands are issued for this
294 * lkmtp pointer to lkm drivers's structure
295 * cmd lkm command code
299 * 0 command was successful
300 * errno command failed - reason indicated
304 uni_mod(struct lkm_table *lkmtp, int cmd, int ver)
306 MOD_DISPATCH(uni, lkmtp, cmd, ver,
307 uni_load, uni_unload, lkm_nullcmd);
310 #else /* !ATM_UNI_MODULE */
313 *******************************************************************
315 * Kernel Compiled Module Support
317 *******************************************************************
319 static void uni_doload (void *);
321 SYSINIT(atmuni, SI_SUB_PROTO_END, SI_ORDER_ANY, uni_doload, NULL)
324 * Kernel initialization
334 uni_doload(void *arg)
343 /* Problems, clean up */
346 log(LOG_ERR, "ATM UNI unable to initialize (%d)!!\n", err);
350 #endif /* ATM_UNI_MODULE */