⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.c

📁 arm平台上的uclinux系统全部源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
		case ISDN_CTYPE_SEDLBAUER_FAX:			ret = setup_sedlbauer(card);			break;#endif#if CARD_SPORTSTER		case ISDN_CTYPE_SPORTSTER:			ret = setup_sportster(card);			break;#endif#if CARD_MIC		case ISDN_CTYPE_MIC:			ret = setup_mic(card);			break;#endif#if CARD_NETJET		case ISDN_CTYPE_NETJET:			ret = setup_netjet(card);			break;#endif#if CARD_TELES3C		case ISDN_CTYPE_TELES3C:			ret = setup_t163c(card);			break;#endif#if CARD_NICCY		case ISDN_CTYPE_NICCY:			ret = setup_niccy(card);			break;#endif#if CARD_AMD7930		case ISDN_CTYPE_AMD7930:			ret = setup_amd7930(card);			break;#endif		default:			printk(KERN_WARNING "HiSax: Unknown Card Typ %d\n",			       card->typ);			ll_unload(cs);			restore_flags(flags);			return (0);	}	if (!ret) {		ll_unload(cs);		restore_flags(flags);		return (0);	}	if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) {		printk(KERN_WARNING		       "HiSax: No memory for isac rcvbuf\n");		return (1);	}	cs->rcvidx = 0;	cs->tx_skb = NULL;	cs->tx_cnt = 0;	cs->event = 0;	cs->tqueue.next = 0;	cs->tqueue.sync = 0;	cs->tqueue.data = cs;	skb_queue_head_init(&cs->rq);	skb_queue_head_init(&cs->sq);	init_bcstate(cs, 0);	init_bcstate(cs, 1);	ret = init_card(cs);	if (ret) {		closecard(cardnr);		restore_flags(flags);		return (0);	}	init_tei(cs, cs->protocol);	CallcNewChan(cs);	/* ISAR needs firmware download first */	if (!test_bit(HW_ISAR, &cs->HW_Flags))		ll_run(cs);	restore_flags(flags);	return (1);}HISAX_INITFUNC(voidHiSax_shiftcards(int idx)){	int i;	for (i = idx; i < (HISAX_MAX_CARDS - 1); i++)		memcpy(&cards[i], &cards[i + 1], sizeof(cards[i]));}HISAX_INITFUNC(intHiSax_inithardware(int *busy_flag)){	int foundcards = 0;	int i = 0;	int t = ',';	int flg = 0;	char *id;	char *next_id = HiSax_id;	char ids[20];	if (strchr(HiSax_id, ','))		t = ',';	else if (strchr(HiSax_id, '%'))		t = '%';	while (i < nrcards) {		if (cards[i].typ < 1)			break;		id = next_id;		if ((next_id = strchr(id, t))) {			*next_id++ = 0;			strcpy(ids, id);			flg = i + 1;		} else {			next_id = id;			if (flg >= i)				strcpy(ids, id);			else				sprintf(ids, "%s%d", id, i);		}		if (checkcard(i, ids, busy_flag)) {			foundcards++;			i++;		} else {			printk(KERN_WARNING "HiSax: Card %s not installed !\n",			       CardType[cards[i].typ]);			if (cards[i].cs)				kfree((void *) cards[i].cs);			cards[i].cs = NULL;			HiSax_shiftcards(i);		}	}	return foundcards;}voidHiSax_closecard(int cardnr){	int 	i,last=nrcards - 1;	if (cardnr>last)		return;	if (cards[cardnr].cs) {		ll_stop(cards[cardnr].cs);		release_tei(cards[cardnr].cs);		closecard(cardnr);		free_irq(cards[cardnr].cs->irq, cards[cardnr].cs);		kfree((void *) cards[cardnr].cs);		cards[cardnr].cs = NULL;	}	i = cardnr;	while (i!=last) {		cards[i] = cards[i+1];		i++;	}	nrcards--;}voidHiSax_reportcard(int cardnr){	struct IsdnCardState *cs = cards[cardnr].cs;	struct PStack *stptr;	struct l3_process *pc;	int j, i = 1;	printk(KERN_DEBUG "HiSax: reportcard No %d\n", cardnr + 1);	printk(KERN_DEBUG "HiSax: Type %s\n", CardType[cs->typ]);	printk(KERN_DEBUG "HiSax: debuglevel %x\n", cs->debug);	printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%lX\n",		(ulong) & HiSax_reportcard);	printk(KERN_DEBUG "HiSax: cs 0x%lX\n", (ulong) cs);	printk(KERN_DEBUG "HiSax: HW_Flags %x bc0 flg %x bc0 flg %x\n",		cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);	printk(KERN_DEBUG "HiSax: bcs 0 mode %d ch%d\n",		cs->bcs[0].mode, cs->bcs[0].channel);	printk(KERN_DEBUG "HiSax: bcs 1 mode %d ch%d\n",		cs->bcs[1].mode, cs->bcs[1].channel);	printk(KERN_DEBUG "HiSax: cs stl 0x%lX\n", (ulong) & (cs->stlist));	stptr = cs->stlist;	while (stptr != NULL) {		printk(KERN_DEBUG "HiSax: dst%d 0x%lX\n", i, (ulong) stptr);		printk(KERN_DEBUG "HiSax: dst%d stp 0x%lX\n", i, (ulong) stptr->l1.stlistp);		printk(KERN_DEBUG "HiSax:   tei %d sapi %d\n",		       stptr->l2.tei, stptr->l2.sap);		printk(KERN_DEBUG "HiSax:      man 0x%lX\n", (ulong) stptr->ma.layer);		pc = stptr->l3.proc;		while (pc) {			printk(KERN_DEBUG "HiSax: l3proc %x 0x%lX\n", pc->callref,			       (ulong) pc);			printk(KERN_DEBUG "HiSax:    state %d  st 0x%lX chan 0x%lX\n",			    pc->state, (ulong) pc->st, (ulong) pc->chan);			pc = pc->next;		}		stptr = stptr->next;		i++;	}	for (j = 0; j < 2; j++) {		printk(KERN_DEBUG "HiSax: ch%d 0x%lX\n", j,		       (ulong) & cs->channel[j]);		stptr = cs->channel[j].b_st;		i = 1;		while (stptr != NULL) {			printk(KERN_DEBUG "HiSax:  b_st%d 0x%lX\n", i, (ulong) stptr);			printk(KERN_DEBUG "HiSax:    man 0x%lX\n", (ulong) stptr->ma.layer);			stptr = stptr->next;			i++;		}	}}__initfunc(intHiSax_init(void)){	int i;#ifdef MODULE	int nzproto = 0;#ifdef CONFIG_HISAX_ELSA	if (type[0] == ISDN_CTYPE_ELSA_PCMCIA) {		/* we have exported  and return in this case */		register_elsa_symbols();		return 0;	}#endif#ifdef CONFIG_HISAX_SEDLBAUER	if (type[0] == ISDN_CTYPE_SEDLBAUER_PCMCIA) {		/* we have to export  and return in this case */		register_symtab(&hisax_syms_sedl);		return 0;	}#endif#ifdef CONFIG_HISAX_AVM_A1_PCMCIA	if (type[0] == ISDN_CTYPE_A1_PCMCIA) {		/* we have to export  and return in this case */		register_avm_a1_symbols();		return 0;	}#endif#endif	nrcards = 0;	HiSaxVersion();#ifdef MODULE	if (id)			/* If id= string used */		HiSax_id = id;	for (i = 0; i < HISAX_MAX_CARDS; i++) {		cards[i].typ = type[i];		if (protocol[i]) {			cards[i].protocol = protocol[i];			nzproto++;		}		switch (type[i]) {			case ISDN_CTYPE_16_0:				cards[i].para[0] = irq[i];				cards[i].para[1] = mem[i];				cards[i].para[2] = io[i];				break;			case ISDN_CTYPE_8_0:				cards[i].para[0] = irq[i];				cards[i].para[1] = mem[i];				break;#ifdef IO0_IO1			case ISDN_CTYPE_PNP:			case ISDN_CTYPE_NICCY:				cards[i].para[0] = irq[i];				cards[i].para[1] = io0[i];				cards[i].para[2] = io1[i];				break;			case ISDN_CTYPE_COMPAQ_ISA:				cards[i].para[0] = irq[i];				cards[i].para[1] = io0[i];				cards[i].para[2] = io1[i];				cards[i].para[3] = io[i];				break;#endif			case ISDN_CTYPE_ELSA:				cards[i].para[0] = io[i];				break;			case ISDN_CTYPE_16_3:			case ISDN_CTYPE_TELESPCMCIA:			case ISDN_CTYPE_A1:			case ISDN_CTYPE_A1_PCMCIA:			case ISDN_CTYPE_ELSA_PNP:			case ISDN_CTYPE_ELSA_PCMCIA:			case ISDN_CTYPE_IX1MICROR2:			case ISDN_CTYPE_DIEHLDIVA:			case ISDN_CTYPE_ASUSCOM:			case ISDN_CTYPE_TELEINT:			case ISDN_CTYPE_SEDLBAUER:			case ISDN_CTYPE_SEDLBAUER_PCMCIA:			case ISDN_CTYPE_SEDLBAUER_FAX:			case ISDN_CTYPE_SPORTSTER:			case ISDN_CTYPE_MIC:			case ISDN_CTYPE_TELES3C:			case ISDN_CTYPE_S0BOX:			case ISDN_CTYPE_FRITZPCI:				cards[i].para[0] = irq[i];				cards[i].para[1] = io[i];				break;			case ISDN_CTYPE_ELSA_PCI:			case ISDN_CTYPE_NETJET:			case ISDN_CTYPE_AMD7930:			case ISDN_CTYPE_TELESPCI:				break;		}	}	if (!nzproto) {		printk(KERN_WARNING "HiSax: Warning - no protocol specified\n");		printk(KERN_WARNING "HiSax: Note! module load syntax has changed.\n");		printk(KERN_WARNING "HiSax: using protocol %s\n", DEFAULT_PROTO_NAME);	}#endif	if (!HiSax_id)		HiSax_id = HiSaxID;	if (!HiSaxID[0])		strcpy(HiSaxID, "HiSax");	for (i = 0; i < HISAX_MAX_CARDS; i++)		if (cards[i].typ > 0)			nrcards++;	printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",	       nrcards, (nrcards > 1) ? "s" : "");	CallcNew();	Isdnl3New();	Isdnl2New();	TeiNew();	Isdnl1New();	if (HiSax_inithardware(NULL)) {		/* Install only, if at least one card found */		/* No symbols to export, hide all symbols */#ifdef MODULE		register_symtab(NULL);		printk(KERN_INFO "HiSax: module installed\n");#endif		return (0);	} else {		Isdnl1Free();		TeiFree();		Isdnl2Free();		Isdnl3Free();		CallcFree();		return -EIO;	}}#ifdef MODULEvoidcleanup_module(void){	int cardnr = nrcards -1;	long flags;	save_flags(flags);	cli();	while(cardnr>=0)		HiSax_closecard(cardnr--);	Isdnl1Free();	TeiFree();	Isdnl2Free();	Isdnl3Free();	CallcFree();	restore_flags(flags);	printk(KERN_INFO "HiSax module removed\n");}#endif#ifdef CONFIG_HISAX_ELSAint elsa_init_pcmcia(void *pcm_iob, int pcm_irq, int *busy_flag, int prot){#ifdef MODULE	int i;	int nzproto = 0;	nrcards = 0;	HiSaxVersion();	if (id)			/* If id= string used */		HiSax_id = id;	/* Initialize all 8 structs, even though we only accept	   two pcmcia cards	   */	for (i = 0; i < HISAX_MAX_CARDS; i++) {		cards[i].para[0] = irq[i];		cards[i].para[1] = io[i];		cards[i].typ = type[i];		if (protocol[i]) {			cards[i].protocol = protocol[i];			nzproto++;		}	}	cards[0].para[0] = pcm_irq;	cards[0].para[1] = (int)pcm_iob;	cards[0].protocol = prot;	cards[0].typ = 10;	nzproto = 1;	if (!HiSax_id)		HiSax_id = HiSaxID;	if (!HiSaxID[0])		strcpy(HiSaxID, "HiSax");	for (i = 0; i < HISAX_MAX_CARDS; i++)		if (cards[i].typ > 0)			nrcards++;	printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",	       nrcards, (nrcards > 1) ? "s" : "");	Isdnl1New();	CallcNew();	Isdnl3New();	Isdnl2New();	TeiNew();	HiSax_inithardware(busy_flag);	printk(KERN_NOTICE "HiSax: module installed\n");#endif	return (0);}#endif#ifdef CONFIG_HISAX_SEDLBAUERint sedl_init_pcmcia(void *pcm_iob, int pcm_irq, int *busy_flag, int prot){#ifdef MODULE	int i;	int nzproto = 0;	nrcards = 0;	HiSaxVersion();	if (id)			/* If id= string used */		HiSax_id = id;	/* Initialize all 8 structs, even though we only accept	   two pcmcia cards	   */	for (i = 0; i < HISAX_MAX_CARDS; i++) {		cards[i].para[0] = irq[i];		cards[i].para[1] = io[i];		cards[i].typ = type[i];		if (protocol[i]) {			cards[i].protocol = protocol[i];			nzproto++;		}	}	cards[0].para[0] = pcm_irq;	cards[0].para[1] = (int)pcm_iob;	cards[0].protocol = prot;	cards[0].typ = ISDN_CTYPE_SEDLBAUER_PCMCIA;	nzproto = 1;	if (!HiSax_id)		HiSax_id = HiSaxID;	if (!HiSaxID[0])		strcpy(HiSaxID, "HiSax");	for (i = 0; i < HISAX_MAX_CARDS; i++)		if (cards[i].typ > 0)			nrcards++;	printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",	       nrcards, (nrcards > 1) ? "s" : "");	CallcNew();	Isdnl3New();	Isdnl2New();	Isdnl1New();	TeiNew();	HiSax_inithardware(busy_flag);	printk(KERN_NOTICE "HiSax: module installed\n");#endif	return (0);}#endif#ifdef CONFIG_HISAX_AVM_A1_PCMCIAint avm_a1_init_pcmcia(void *pcm_iob, int pcm_irq, int *busy_flag, int prot){#ifdef MODULE	int i;	int nzproto = 0;	nrcards = 0;	HiSaxVersion();	if (id)			/* If id= string used */		HiSax_id = id;	/* Initialize all 16 structs, even though we only accept	   two pcmcia cards	   */	for (i = 0; i < 16; i++) {		cards[i].para[0] = irq[i];		cards[i].para[1] = io[i];		cards[i].typ = type[i];		if (protocol[i]) {			cards[i].protocol = protocol[i];			nzproto++;		}	}	cards[0].para[0] = pcm_irq;	cards[0].para[1] = (int)pcm_iob;	cards[0].protocol = prot;	cards[0].typ = ISDN_CTYPE_A1_PCMCIA;	nzproto = 1;	if (!HiSax_id)		HiSax_id = HiSaxID;	if (!HiSaxID[0])		strcpy(HiSaxID, "HiSax");	for (i = 0; i < HISAX_MAX_CARDS; i++)		if (cards[i].typ > 0)			nrcards++;	printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",	       nrcards, (nrcards > 1) ? "s" : "");	Isdnl1New();	CallcNew();	Isdnl3New();	Isdnl2New();	TeiNew();	HiSax_inithardware(busy_flag);	printk(KERN_NOTICE "HiSax: module installed\n");#endif	return (0);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -