Beispiel #1
0
/*
 * Initialize driver processing
 * 
 * This will be called during module loading.  Not much to do here, as
 * we must wait for our identify/attach routines to get called before
 * we know what we're in for.
 *
 * Arguments:
 *	none
 *
 * Returns:
 *	0 	startup was successful 
 *	errno	startup failed - reason indicated
 *
 */
static int
fore_start()
{

	/*
	 * Verify software version
	 */
	if (atm_version != ATM_VERSION) {
		log(LOG_ERR, "version mismatch: fore=%d.%d kernel=%d.%d\n",
			ATM_VERS_MAJ(ATM_VERSION), ATM_VERS_MIN(ATM_VERSION),
			ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version));
		return (EINVAL);
	}

	/*
	 * Initialize DMA mapping
	 */
	DMA_INIT();

	/*
	 * Start up watchdog timer
	 */
	atm_timeout(&fore_timer, ATM_HZ * FORE_TIME_TICK, fore_timeout);

	fore_inited = 1;

	return (0);
}
Beispiel #2
0
/*
 * Initialize sigpvc processing
 * 
 * This will be called during module loading.  We'll just register
 * the sigpvc protocol descriptor and wait for a SigPVC ATM interface 
 * to come online.
 *
 * Arguments:
 *	none
 *
 * Returns:
 *	0 	startup was successful 
 *	errno	startup failed - reason indicated
 *
 */
static int
sigpvc_start()
{
	int	err = 0;

	/*
	 * Verify software version
	 */
	if (atm_version != ATM_VERSION) {
		log(LOG_ERR, "version mismatch: sigpvc=%d.%d kernel=%d.%d\n",
			ATM_VERS_MAJ(ATM_VERSION), ATM_VERS_MIN(ATM_VERSION),
			ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version));
		return (EINVAL);
	}

	sigpvc_vc_zone = uma_zcreate("sigpvc vc", sizeof(struct sigpvc_vccb),
	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
	uma_zone_set_max(sigpvc_vc_zone, 50);		
 
	/*
	 * Register ourselves with system
	 */
	err = atm_sigmgr_register(&sigpvc_mgr);
	if (err == 0)
		sigpvc_registered = 1;

	return (err);
}
Beispiel #3
0
/*
 * Initialize UNISIG processing
 *
 * This will be called during module loading.  We'll just register
 * the UNISIG protocol descriptor and wait for a UNISIG ATM interface
 * to come online.
 *
 * Arguments:
 *	none
 *
 * Returns:
 *	0	startup was successful
 *	errno	startup failed - reason indicated
 *
 */
int
unisig_start()
{
	int	err = 0;

	/*      
	 * Verify software version
	 */     
	if (atm_version != ATM_VERSION) { 
		log(LOG_ERR, "version mismatch: unisig=%d.%d kernel=%d.%d\n", 
				ATM_VERS_MAJ(ATM_VERSION),
				ATM_VERS_MIN(ATM_VERSION),
				ATM_VERS_MAJ(atm_version),
				ATM_VERS_MIN(atm_version));
		return (EINVAL);
	}

	/*
	 * Atleast ensure the versioning prior to creating our
	 * UMA zone.
	 */
	unisig_vc_zone = uma_zcreate("unisig vcc", sizeof(struct unisig_vccb),
	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
	if (unisig_vc_zone == NULL)
		panic("unisig_start: uma_zcreate failed to create vcc zone");
	unisig_msg_zone = uma_zcreate("unisig msg", sizeof(struct unisig_msg),
	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
	if (unisig_msg_zone == NULL)
		panic("unisig_start: uma_zcreate failed to create msg zone");
	unisig_ie_zone = uma_zcreate("unisig ie", sizeof(struct ie_generic),
	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
	if (unisig_ie_zone == NULL)
		panic("unisig_start: uma_zcreate failed to create ie zone");
	
	uma_zone_set_max(unisig_vc_zone, 50);
	uma_zone_set_max(unisig_msg_zone, 50);
	uma_zone_set_max(unisig_ie_zone, 50);

	/*
	 * Register ourselves with system
	 */
	err = atm_sigmgr_register(&unisig_mgr30);
	if (err)
		goto done;

	err = atm_sigmgr_register(&unisig_mgr31);

done:
	return (err);
}
Beispiel #4
0
/*
 * Print network interface information
 * 
 * Arguments:
 *	ni	pointer to a struct air_int_rsp
 *
 * Returns:
 *	none
 *
 */
void
print_version_info(struct air_version_rsp *vi)
{
	char			version_str[80];

	/*
	 * Print a header
	 */
	if (!version_hdr) {
		version_hdr++;
		printf(VERSION_HDR);
	}

	/*
	 * Print the interface information
	 */
	sprintf(version_str, "%d.%d",
			ATM_VERS_MAJ(vi->avp_version),
			ATM_VERS_MIN(vi->avp_version));
	printf("%7s\n", version_str);
}