예제 #1
0
파일: elsa.c 프로젝트: sarnobat/knoppix
static int __init
elsa_probe(struct IsdnCardState *cs, struct IsdnCard *card)
{
	u8 val;
	int i, bytecnt = 8;
	unsigned int CARD_portlist[] = {0x160, 0x170, 0x260, 0x360, 0};

	cs->hw.elsa.base = card->para[0];
	printk(KERN_INFO "Elsa: Microlink IO probing\n");
	if (cs->hw.elsa.base) {
		cs->subtyp = probe_elsa_adr(cs->hw.elsa.base, cs->typ);
		if (!cs->subtyp) {
			printk(KERN_WARNING "Elsa: no Microlink at %#lx\n",
			       cs->hw.elsa.base);
			goto err;
		}
	} else {
		for (i = 0; CARD_portlist[i]; i++) {
			cs->subtyp = probe_elsa_adr(CARD_portlist[i], cs->typ);
			if (cs->subtyp)
				cs->hw.elsa.base = CARD_portlist[i];
			break;
		}
	}
	if (!cs->hw.elsa.base)
		goto err;
		
	cs->hw.elsa.cfg   = cs->hw.elsa.base + ELSA_CONFIG;
	cs->hw.elsa.ctrl  = cs->hw.elsa.base + ELSA_CONTROL;
	cs->hw.elsa.ale   = cs->hw.elsa.base + ELSA_ALE;
	cs->hw.elsa.isac  = cs->hw.elsa.base + ELSA_ISAC;
	cs->hw.elsa.itac  = cs->hw.elsa.base + ELSA_ITAC;
	cs->hw.elsa.hscx  = cs->hw.elsa.base + ELSA_HSCX;
	cs->hw.elsa.trig  = cs->hw.elsa.base + ELSA_TRIG_IRQ;
	cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER;
	val = bytein(cs->hw.elsa.cfg);
	if (cs->subtyp == ELSA_PC) {
		const u8 CARD_IrqTab[8] = {7, 3, 5, 9, 0, 0, 0, 0};
		cs->irq = CARD_IrqTab[(val & ELSA_IRQ_IDX_PC) >> 2];
	} else if (cs->subtyp == ELSA_PCC8) {
예제 #2
0
static unsigned int
probe_elsa(struct IsdnCardState *cs)
{
	int i;
	unsigned int CARD_portlist[] =
	{0x160, 0x170, 0x260, 0x360, 0};

	for (i = 0; CARD_portlist[i]; i++) {
		if ((cs->subtyp = probe_elsa_adr(CARD_portlist[i], cs->typ)))
			break;
	}
	return (CARD_portlist[i]);
}
예제 #3
0
static int __devinit
setup_elsa_isa(struct IsdnCard *card)
{
	struct IsdnCardState *cs = card->cs;
	u_char val;

	cs->hw.elsa.base = card->para[0];
#ifdef CONFIG_DEBUG_PRINTK
	printk(KERN_INFO "Elsa: Microlink IO probing\n");
#else
	;
#endif
	if (cs->hw.elsa.base) {
		if (!(cs->subtyp = probe_elsa_adr(cs->hw.elsa.base,
						  cs->typ))) {
#ifdef CONFIG_DEBUG_PRINTK
			printk(KERN_WARNING
			       "Elsa: no Elsa Microlink at %#lx\n",
			       cs->hw.elsa.base);
#else
			;
#endif
			return (0);
		}
	} else
		cs->hw.elsa.base = probe_elsa(cs);

	if (!cs->hw.elsa.base) {
#ifdef CONFIG_DEBUG_PRINTK
		printk(KERN_WARNING
		       "No Elsa Microlink found\n");
#else
		;
#endif
		return (0);
	}

	cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
	cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL;
	cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
	cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC;
	cs->hw.elsa.itac = cs->hw.elsa.base + ELSA_ITAC;
	cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX;
	cs->hw.elsa.trig = cs->hw.elsa.base + ELSA_TRIG_IRQ;
	cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER;
	val = bytein(cs->hw.elsa.cfg);
	if (cs->subtyp == ELSA_PC) {
		const u_char CARD_IrqTab[8] =
		{7, 3, 5, 9, 0, 0, 0, 0};
		cs->irq = CARD_IrqTab[(val & ELSA_IRQ_IDX_PC) >> 2];
	} else if (cs->subtyp == ELSA_PCC8) {
예제 #4
0
int __devinit
setup_elsa(struct IsdnCard *card)
{
	long flags;
	int bytecnt;
	u_char val;
	struct IsdnCardState *cs = card->cs;
	char tmp[64];

	strcpy(tmp, Elsa_revision);
	printk(KERN_INFO "HiSax: Elsa driver Rev. %s\n", HiSax_getrev(tmp));
	cs->hw.elsa.ctrl_reg = 0;
	cs->hw.elsa.status = 0;
	cs->hw.elsa.MFlag = 0;
	cs->subtyp = 0;
	if (cs->typ == ISDN_CTYPE_ELSA) {
		cs->hw.elsa.base = card->para[0];
		printk(KERN_INFO "Elsa: Microlink IO probing\n");
		if (cs->hw.elsa.base) {
			if (!(cs->subtyp = probe_elsa_adr(cs->hw.elsa.base,
							  cs->typ))) {
				printk(KERN_WARNING
				       "Elsa: no Elsa Microlink at %#lx\n",
				       cs->hw.elsa.base);
				return (0);
			}
		} else
			cs->hw.elsa.base = probe_elsa(cs);
		if (cs->hw.elsa.base) {
			cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
			cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL;
			cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
			cs->hw.elsa.isac = cs->hw.elsa.base + ELSA_ISAC;
			cs->hw.elsa.itac = cs->hw.elsa.base + ELSA_ITAC;
			cs->hw.elsa.hscx = cs->hw.elsa.base + ELSA_HSCX;
			cs->hw.elsa.trig = cs->hw.elsa.base + ELSA_TRIG_IRQ;
			cs->hw.elsa.timer = cs->hw.elsa.base + ELSA_START_TIMER;
			val = bytein(cs->hw.elsa.cfg);
			if (cs->subtyp == ELSA_PC) {
				const u_char CARD_IrqTab[8] =
				{7, 3, 5, 9, 0, 0, 0, 0};
				cs->irq = CARD_IrqTab[(val & ELSA_IRQ_IDX_PC) >> 2];
			} else if (cs->subtyp == ELSA_PCC8) {