static int
BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	switch (mt) {
		case CARD_RESET:
			/* Disable ints */
			enable_bkm_int(cs, 0);
			reset_bkm(cs);
			return (0);
		case CARD_RELEASE:
			/* Sanity */
			enable_bkm_int(cs, 0);
			reset_bkm(cs);
			release_io_bkm(cs);
			return (0);
		case CARD_INIT:
			clear_pending_isac_ints(cs);
			clear_pending_jade_ints(cs);
			initisac(cs);
			initjade(cs);
			/* Enable ints */
			enable_bkm_int(cs, 1);
			return (0);
		case CARD_TEST:
			return (0);
	}
	return (0);
}
Beispiel #2
0
static int
NETjet_S_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	u_long flags;

	switch (mt) {
		case CARD_RESET:
			spin_lock_irqsave(&cs->lock, flags);
			reset_netjet_s(cs);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_RELEASE:
			release_io_netjet(cs);
			return(0);
		case CARD_INIT:
			reset_netjet_s(cs);
			inittiger(cs);
			spin_lock_irqsave(&cs->lock, flags);
			clear_pending_isac_ints(cs);
			initisac(cs);
			/* Reenable all IRQ */
			cs->writeisac(cs, ISAC_MASK, 0);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_TEST:
			return(0);
	}
	return(0);
}
Beispiel #3
0
static int
ISurf_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	u_long flags;

	switch (mt) {
		case CARD_RESET:
			spin_lock_irqsave(&cs->lock, flags);
			reset_isurf(cs, ISURF_RESET);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_RELEASE:
			release_io_isurf(cs);
			return(0);
		case CARD_INIT:
			spin_lock_irqsave(&cs->lock, flags);
			reset_isurf(cs, ISURF_RESET);
			clear_pending_isac_ints(cs);
			writeb(0, cs->hw.isurf.isar+ISAR_IRQBIT);mb();
			initisac(cs);
			initisar(cs);
			/* Reenable ISAC IRQ */
			cs->writeisac(cs, ISAC_MASK, 0);
			/* RESET Receiver and Transmitter */
			cs->writeisac(cs, ISAC_CMDR, 0x41);
			spin_unlock_irqrestore(&cs->lock, flags);
			return(0);
		case CARD_TEST:
			return(0);
	}
	return(0);
}
Beispiel #4
0
static int
TeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	switch (mt) {
		case CARD_RESET:
			reset_TeleInt(cs);
			return(0);
		case CARD_RELEASE:
			release_io_TeleInt(cs);
			return(0);
		case CARD_INIT:
			inithfc(cs);
			clear_pending_isac_ints(cs);
			initisac(cs);
			/* Reenable all IRQ */
			cs->writeisac(cs, ISAC_MASK, 0);
			cs->writeisac(cs, ISAC_CMDR, 0x41);
			cs->hw.hfc.timer.expires = jiffies + 1;
			add_timer(&cs->hw.hfc.timer);
			return(0);
		case CARD_TEST:
			return(0);
	}
	return(0);
}
Beispiel #5
0
static int
AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	switch (mt) {
		case CARD_RESET:
			byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00);
			HZDELAY(HZ / 5 + 1);
			byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,ASL0_W_RESET);
			HZDELAY(HZ / 5 + 1);
			byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00);
			return 0;

		case CARD_RELEASE:
			/* free_irq is done in HiSax_closecard(). */
		        /* free_irq(cs->irq, cs); */
			return 0;

		case CARD_INIT:
			byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,ASL0_W_TDISABLE|ASL0_W_TRESET|ASL0_W_IRQENABLE);
			clear_pending_isac_ints(cs);
			clear_pending_hscx_ints(cs);
			inithscxisac(cs, 1);
			inithscxisac(cs, 2);
			return 0;

		case CARD_TEST:
			/* we really don't need it for the PCMCIA Version */
			return 0;

		default:
			/* all card drivers ignore others, so we do the same */
			return 0;
	}
	return 0;
}
Beispiel #6
0
static int
Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	switch (mt) {
		case CARD_RESET:
			reset_sedlbauer(cs);
			return(0);
		case CARD_RELEASE:
			if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
				writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
					ISAR_IRQBIT, 0);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.isac,
					ISAC_MASK, 0xFF);
				reset_sedlbauer(cs);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
					ISAR_IRQBIT, 0);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.isac,
					ISAC_MASK, 0xFF);
			}
			release_io_sedlbauer(cs);
			return(0);
		case CARD_INIT:
			if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
				clear_pending_isac_ints(cs);
				writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
					ISAR_IRQBIT, 0);
				initisac(cs);
				initisar(cs);
				/* Reenable all IRQ */
				cs->writeisac(cs, ISAC_MASK, 0);
				/* RESET Receiver and Transmitter */
				cs->writeisac(cs, ISAC_CMDR, 0x41);
			} else {
				inithscxisac(cs, 3);
			}
			return(0);
		case CARD_TEST:
			return(0);
		case MDL_INFO_CONN:
			if (cs->subtyp != SEDL_SPEEDFAX_PYRAMID)
				return(0);
			if ((long) arg)
				cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED2;
			else
				cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED1;
			byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
			break;
		case MDL_INFO_REL:
			if (cs->subtyp != SEDL_SPEEDFAX_PYRAMID)
				return(0);
			if ((long) arg)
				cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED2;
			else
				cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED1;
			byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
			break;
	}
	return(0);
}
Beispiel #7
0
HISAX_INITFUNC(void
inithscxisac(struct IsdnCardState *cs, int part))
{
	if (part & 1) {
		clear_pending_isac_ints(cs);
		clear_pending_hscx_ints(cs);
		initisac(cs);
		inithscx(cs);
	}
	if (part & 2) {
		/* Reenable all IRQ */
		cs->writeisac(cs, ISAC_MASK, 0);
		cs->BC_Write_Reg(cs, 0, HSCX_MASK, 0);
		cs->BC_Write_Reg(cs, 1, HSCX_MASK, 0);
		/* RESET Receiver and Transmitter */
		cs->writeisac(cs, ISAC_CMDR, 0x41);
	}
}
Beispiel #8
0
static int
NETjet_S_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
    switch (mt) {
    case CARD_RESET:
        reset_netjet_s(cs);
        return(0);
    case CARD_RELEASE:
        release_io_netjet(cs);
        return(0);
    case CARD_INIT:
        inittiger(cs);
        clear_pending_isac_ints(cs);
        initisac(cs);
        /* Reenable all IRQ */
        cs->writeisac(cs, ISAC_MASK, 0);
        return(0);
    case CARD_TEST:
        return(0);
    }
    return(0);
}
Beispiel #9
0
static int
TeleInt_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
    u_long flags;
    int delay;

    switch (mt) {
        case CARD_RESET:
            spin_lock_irqsave(&cs->lock, flags);
            reset_TeleInt(cs);
            spin_unlock_irqrestore(&cs->lock, flags);
            return(0);
        case CARD_RELEASE:
            release_io_TeleInt(cs);
            return(0);
        case CARD_INIT:
            spin_lock_irqsave(&cs->lock, flags);
            reset_TeleInt(cs);
            inithfc(cs);
            clear_pending_isac_ints(cs);
            initisac(cs);
            /* Reenable all IRQ */
            cs->writeisac(cs, ISAC_MASK, 0);
            cs->writeisac(cs, ISAC_CMDR, 0x41);
            spin_unlock_irqrestore(&cs->lock, flags);
            delay = HZ/100;
            if (!delay)
                delay = 1;
            cs->hw.hfc.timer.expires = jiffies + delay;
            add_timer(&cs->hw.hfc.timer);
            return(0);
        case CARD_TEST:
            return(0);
    }
    return(0);
}
static int
BKM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
    u_long flags;

    switch (mt) {
    case CARD_RESET:
        /* Disable ints */
        spin_lock_irqsave(&cs->lock, flags);
        enable_bkm_int(cs, 0);
        reset_bkm(cs);
        spin_unlock_irqrestore(&cs->lock, flags);
        return (0);
    case CARD_RELEASE:
        /* Sanity */
        spin_lock_irqsave(&cs->lock, flags);
        enable_bkm_int(cs, 0);
        reset_bkm(cs);
        spin_unlock_irqrestore(&cs->lock, flags);
        release_io_bkm(cs);
        return (0);
    case CARD_INIT:
        spin_lock_irqsave(&cs->lock, flags);
        clear_pending_isac_ints(cs);
        clear_pending_jade_ints(cs);
        initisac(cs);
        initjade(cs);
        /* Enable ints */
        enable_bkm_int(cs, 1);
        spin_unlock_irqrestore(&cs->lock, flags);
        return (0);
    case CARD_TEST:
        return (0);
    }
    return (0);
}
Beispiel #11
0
static int
ix1_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	switch (mt) {
		case CARD_RESET:
			ix1_reset(cs);
			return(0);
		case CARD_RELEASE:
			release_io_ix1micro(cs);
			return(0);
		case CARD_SETIRQ:
			return(request_irq(cs->irq, &ix1micro_interrupt,
					I4L_IRQ_FLAG, "HiSax", cs));
		case CARD_INIT:
			clear_pending_isac_ints(cs);
			clear_pending_hscx_ints(cs);
			initisac(cs);
			inithscx(cs);
			return(0);
		case CARD_TEST:
			return(0);
	}
	return(0);
}
static int
Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{
	u_long flags;

	switch (mt) {
	case CARD_RESET:
		spin_lock_irqsave(&cs->lock, flags);
		reset_sedlbauer(cs);
		spin_unlock_irqrestore(&cs->lock, flags);
		return (0);
	case CARD_RELEASE:
		if (cs->hw.sedl.bus == SEDL_BUS_PCI)
			/*                 */
			byteout(cs->hw.sedl.cfg_reg + 5, 0);
		if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
			spin_lock_irqsave(&cs->lock, flags);
			writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
				 ISAR_IRQBIT, 0);
			writereg(cs->hw.sedl.adr, cs->hw.sedl.isac,
				 ISAC_MASK, 0xFF);
			reset_sedlbauer(cs);
			writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
				 ISAR_IRQBIT, 0);
			writereg(cs->hw.sedl.adr, cs->hw.sedl.isac,
				 ISAC_MASK, 0xFF);
			spin_unlock_irqrestore(&cs->lock, flags);
		}
		release_io_sedlbauer(cs);
		return (0);
	case CARD_INIT:
		spin_lock_irqsave(&cs->lock, flags);
		if (cs->hw.sedl.bus == SEDL_BUS_PCI)
			/*                */
			byteout(cs->hw.sedl.cfg_reg + 5, 0x02);
		reset_sedlbauer(cs);
		if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
			clear_pending_isac_ints(cs);
			writereg(cs->hw.sedl.adr, cs->hw.sedl.hscx,
				 ISAR_IRQBIT, 0);
			initisac(cs);
			initisar(cs);
			/*                  */
			cs->writeisac(cs, ISAC_MASK, 0);
			/*                                */
			cs->writeisac(cs, ISAC_CMDR, 0x41);
		} else {
			inithscxisac(cs, 3);
		}
		spin_unlock_irqrestore(&cs->lock, flags);
		return (0);
	case CARD_TEST:
		return (0);
	case MDL_INFO_CONN:
		if (cs->subtyp != SEDL_SPEEDFAX_PYRAMID)
			return (0);
		spin_lock_irqsave(&cs->lock, flags);
		if ((long) arg)
			cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED2;
		else
			cs->hw.sedl.reset_off &= ~SEDL_ISAR_PCI_LED1;
		byteout(cs->hw.sedl.cfg_reg + 3, cs->hw.sedl.reset_off);
		spin_unlock_irqrestore(&cs->lock, flags);
		break;
	case MDL_INFO_REL:
		if (cs->subtyp != SEDL_SPEEDFAX_PYRAMID)
			return (0);
		spin_lock_irqsave(&cs->lock, flags);
		if ((long) arg)
			cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED2;
		else
			cs->hw.sedl.reset_off |= SEDL_ISAR_PCI_LED1;
		byteout(cs->hw.sedl.cfg_reg + 3, cs->hw.sedl.reset_off);
		spin_unlock_irqrestore(&cs->lock, flags);
		break;
	}
	return (0);
}