Exemplo n.º 1
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);
}
Exemplo n.º 2
0
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);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 5
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);
}
Exemplo n.º 6
0
static int
isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
	int ret;

	if ((ic->command == ISDN_CMD_IOCTL) && (ic->arg == 9)) {
		ret = isar_auxcmd(cs, ic);
		if (!ret) {
			reset_isurf(cs, ISURF_ISAR_EA | ISURF_ISAC_RESET |
				ISURF_ARCOFI_RESET);
			initisac(cs);
			cs->writeisac(cs, ISAC_MASK, 0);
			cs->writeisac(cs, ISAC_CMDR, 0x41);
		}
		return(ret);
	}
	return(isar_auxcmd(cs, ic));
}
Exemplo n.º 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);
	}
}
Exemplo n.º 8
0
static int
isurf_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
	int ret;
	u_long flags;

	if ((ic->command == ISDN_CMD_IOCTL) && (ic->arg == 9)) {
		ret = isar_auxcmd(cs, ic);
		spin_lock_irqsave(&cs->lock, flags);
		if (!ret) {
			reset_isurf(cs, ISURF_ISAR_EA | ISURF_ISAC_RESET |
				ISURF_ARCOFI_RESET);
			initisac(cs);
			cs->writeisac(cs, ISAC_MASK, 0);
			cs->writeisac(cs, ISAC_CMDR, 0x41);
		}
		spin_unlock_irqrestore(&cs->lock, flags);
		return(ret);
	}
	return(isar_auxcmd(cs, ic));
}
Exemplo n.º 9
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);
}
Exemplo n.º 10
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);
}
Exemplo n.º 12
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);
}
Exemplo n.º 13
0
void
inithscxisac(struct IsdnCardState *cs)
{
	initisac(cs);
	inithscx(cs);
}
Exemplo n.º 14
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);
}