if (is_digit(conf->addr[0])) { 
if (isdigit(conf->addr[0])) { 
static int new_if(struct wan_device* wandev, struct net_device* dev,		  wanif_conf_t* conf){	sdla_t* card = wandev->private;	fr_channel_t* chan;	int dlci = 0;	int err = 0;		if ((conf->name[0] == '\0') || (strlen(conf->name) > WAN_IFNAME_SZ)) {				printk(KERN_INFO "%s: Invalid interface name!\n",			card->devname);		return -EINVAL;	}	/* allocate and initialize private data */	chan = kmalloc(sizeof(fr_channel_t), GFP_KERNEL);	if (chan == NULL)		return -ENOMEM;	memset(chan, 0, sizeof(fr_channel_t));	strcpy(chan->name, conf->name);	chan->card = card;	/* verify media address */	if (is_digit(conf->addr[0])) {		dlci = dec_to_uint(conf->addr, 0);		if (dlci && (dlci <= HIGHEST_VALID_DLCI)) {					chan->dlci = dlci;				} else {					printk(KERN_ERR				"%s: Invalid DLCI %u on interface %s!\n",				wandev->name, dlci, chan->name);			err = -EINVAL;		}	} else {		printk(KERN_ERR			"%s: Invalid media address on interface %s!\n",			wandev->name, chan->name);		err = -EINVAL;	}	if ((chan->true_if_encoding = conf->true_if_encoding) == WANOPT_YES){		printk(KERN_INFO 			"%s: Enabling, true interface type encoding.\n",			card->devname);	}	    /* Setup wanpipe as a router (WANPIPE) even if it is	 * a bridged DLCI, or as an API 	 */        if (strcmp(conf->usedby, "WANPIPE")  == 0  || 	    strcmp(conf->usedby, "BRIDGE")   == 0  ||	    strcmp(conf->usedby, "BRIDGE_N") == 0){				if(strcmp(conf->usedby, "WANPIPE") == 0){			chan->common.usedby = WANPIPE;				                printk(KERN_INFO "%s: Running in WANPIPE mode.\n", 					card->devname);					}else if(strcmp(conf->usedby, "BRIDGE") == 0){						chan->common.usedby = BRIDGE;						printk(KERN_INFO "%s: Running in WANPIPE (BRIDGE) mode.\n", 					card->devname);		}else if( strcmp(conf->usedby, "BRIDGE_N") == 0 ){						chan->common.usedby = BRIDGE_NODE;					printk(KERN_INFO "%s: Running in WANPIPE (BRIDGE_NODE) mode.\n", 					card->devname);		}		if (!err){			/* Dynamic interface configuration option.			 * On disconnect, if the options is selected,			 * the interface will be brought down */			if (conf->if_down == WANOPT_YES){ 				set_bit(DYN_OPT_ON,&chan->interface_down);				printk(KERN_INFO 				    "%s: Dynamic interface configuration enabled.\n",					card->devname);			}		}        } else if(strcmp(conf->usedby, "API") == 0){                chan->common.usedby = API;                printk(KERN_INFO "%s: Running in API mode.\n",			wandev->name);        }	if (err) {				kfree(chan);		return err;	}	/* place cir,be,bc and other channel specific information into the	 * chan structure          */	if (conf->cir) {		chan->cir = max_t(unsigned int, 1,				min_t(unsigned int, conf->cir, 512));		chan->cir_status = CIR_ENABLED; 				/* If CIR is enabled, force BC to equal CIR                 * this solves number of potential problems if CIR is                  * set and BC is not 		 */		chan->bc = chan->cir;		if (conf->be){			chan->be = max_t(unsigned int,				       0, min_t(unsigned int, conf->be, 511));		}else{				conf->be = 0;		}		printk (KERN_INFO "%s: CIR enabled for DLCI %i \n",				wandev->name,chan->dlci);		printk (KERN_INFO "%s:     CIR = %i ; BC = %i ; BE = %i\n",				wandev->name,chan->cir,chan->bc,chan->be);	}else{		chan->cir_status = CIR_DISABLED;		printk (KERN_INFO "%s: CIR disabled for DLCI %i\n",				wandev->name,chan->dlci);	}	chan->mc = conf->mc;	if (conf->inarp == WANOPT_YES){		printk(KERN_INFO "%s: Inverse ARP Support Enabled\n",card->devname);		chan->inarp = conf->inarp ? INARP_REQUEST : INARP_NONE;		chan->inarp_interval = conf->inarp_interval ? conf->inarp_interval : 10;	}else{		printk(KERN_INFO "%s: Inverse ARP Support Disabled\n",card->devname);		chan->inarp = INARP_NONE;		chan->inarp_interval = 10;	}	chan->dlci_configured = DLCI_NOT_CONFIGURED;		/*FIXME: IPX disabled in this WANPIPE version */	if (conf->enable_IPX == WANOPT_YES){		printk(KERN_INFO "%s: ERROR - This version of WANPIPE doesn't support IPX\n",				card->devname);		kfree(chan);		return -EINVAL;	}else{		chan->enable_IPX = WANOPT_NO;	}		if (conf->network_number){		chan->network_number = conf->network_number;	}else{		chan->network_number = 0xDEADBEEF;	}	chan->route_flag = NO_ROUTE;		init_chan_statistics(chan);	chan->transmit_length = 0;	/* prepare network device data space for registration */	strcpy(dev->name,chan->name);		dev->init = &if_init;	dev->priv = chan;	/* Initialize FR Polling Task Queue         * We need a poll routine for each network         * interface.          */	INIT_WORK(&chan->fr_poll_work, (void *)fr_poll, dev);	init_timer(&chan->fr_arp_timer);	chan->fr_arp_timer.data=(unsigned long)dev;	chan->fr_arp_timer.function = fr_arp;	wandev->new_if_cnt++;	/* Tells us that if this interface is a         * gateway or not */	if ((chan->gateway = conf->gateway) == WANOPT_YES){		printk(KERN_INFO "%s: Interface %s is set as a gateway.\n",			card->devname,dev->name);	}	/* M. Grant Patch Apr 28 2000          * Disallow duplicate dlci configurations. */	if (card->u.f.dlci_to_dev_map[chan->dlci] != NULL) {		kfree(chan);		return -EBUSY;	}	/* Configure this dlci at a later date, when         * the interface comes up. i.e. when if_open()          * executes */	set_bit(0,&chan->config_dlci);		printk(KERN_INFO "\n");	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8e18d1f9c9dcbf2de5b79cad771ed639983ab6cd/sdla_fr.c/clean/drivers/net/wan/sdla_fr.c