diff options
Diffstat (limited to 'drivers/isdn/hisax/nj_u.c')
-rw-r--r-- | drivers/isdn/hisax/nj_u.c | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/drivers/isdn/hisax/nj_u.c b/drivers/isdn/hisax/nj_u.c index 57de4b44b..a98724bd1 100644 --- a/drivers/isdn/hisax/nj_u.c +++ b/drivers/isdn/hisax/nj_u.c @@ -1,10 +1,12 @@ -/* $Id: nj_u.c,v 2.4 2000/06/26 11:42:16 keil Exp $ +/* $Id: nj_u.c,v 2.8.6.1 2000/11/29 16:00:14 kai Exp $ * * This file is (c) under GNU PUBLIC LICENSE * */ + #define __NO_VERSION__ #include <linux/config.h> +#include <linux/init.h> #include "hisax.h" #include "icc.h" #include "isdnl1.h" @@ -13,7 +15,7 @@ #include <linux/ppp_defs.h> #include "netjet.h" -const char *NETjet_U_revision = "$Revision: 2.4 $"; +const char *NETjet_U_revision = "$Revision: 2.8.6.1 $"; static u_char dummyrr(struct IsdnCardState *cs, int chan, u_char off) { @@ -48,28 +50,37 @@ netjet_u_interrupt(int intno, void *dev_id, struct pt_regs *regs) } save_flags(flags); cli(); - if ((sval = bytein(cs->hw.njet.base + NETJET_IRQSTAT0))) { + /* start new code 13/07/00 GE */ + /* set bits in sval to indicate which page is free */ + if (inl(cs->hw.njet.base + NETJET_DMA_WRITE_ADR) < + inl(cs->hw.njet.base + NETJET_DMA_WRITE_IRQ)) + /* the 2nd write page is free */ + sval = 0x08; + else /* the 1st write page is free */ + sval = 0x04; + if (inl(cs->hw.njet.base + NETJET_DMA_READ_ADR) < + inl(cs->hw.njet.base + NETJET_DMA_READ_IRQ)) + /* the 2nd read page is free */ + sval = sval | 0x02; + else /* the 1st read page is free */ + sval = sval | 0x01; + if (sval != cs->hw.njet.last_is0) /* we have a DMA interrupt */ + { if (test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) { restore_flags(flags); return; } cs->hw.njet.irqstat0 = sval; restore_flags(flags); -/* debugl1(cs, "tiger: ist0 %x %x %x %x/%x pulse=%d", - sval, - bytein(cs->hw.njet.base + NETJET_DMACTRL), - bytein(cs->hw.njet.base + NETJET_IRQMASK0), - inl(cs->hw.njet.base + NETJET_DMA_READ_ADR), - inl(cs->hw.njet.base + NETJET_DMA_WRITE_ADR), - bytein(cs->hw.njet.base + NETJET_PULSE_CNT)); -*/ -/* cs->hw.njet.irqmask0 = ((0x0f & cs->hw.njet.irqstat0) ^ 0x0f) | 0x30; -*/ byteout(cs->hw.njet.base + NETJET_IRQSTAT0, cs->hw.njet.irqstat0); -/* byteout(cs->hw.njet.base + NETJET_IRQMASK0, cs->hw.njet.irqmask0); -*/ if (cs->hw.njet.irqstat0 & NETJET_IRQM0_READ) + if ((cs->hw.njet.irqstat0 & NETJET_IRQM0_READ) != + (cs->hw.njet.last_is0 & NETJET_IRQM0_READ)) + /* we have a read dma int */ read_tiger(cs); - if (cs->hw.njet.irqstat0 & NETJET_IRQM0_WRITE) + if ((cs->hw.njet.irqstat0 & NETJET_IRQM0_WRITE) != + (cs->hw.njet.last_is0 & NETJET_IRQM0_WRITE)) + /* we have a write dma int */ write_tiger(cs); + /* end new code 13/07/00 GE */ test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags); } else restore_flags(flags); @@ -94,7 +105,8 @@ reset_netjet_u(struct IsdnCardState *cs) byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout((10*HZ)/1000); /* Timeout 10ms */ - cs->hw.njet.ctrl_reg = 0x00; /* Reset Off and status read clear */ + cs->hw.njet.ctrl_reg = 0x40; /* Reset Off and status read clear */ + /* now edge triggered for TJ320 GE 13/07/00 */ byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout((10*HZ)/1000); /* Timeout 10ms */ @@ -130,10 +142,10 @@ NETjet_U_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_netjet __initdata = NULL; +static struct pci_dev *dev_netjet __initdata = NULL; -__initfunc(int -setup_netjet_u(struct IsdnCard *card)) +int __init +setup_netjet_u(struct IsdnCard *card) { int bytecnt; struct IsdnCardState *cs = card->cs; @@ -155,7 +167,7 @@ setup_netjet_u(struct IsdnCard *card)) for ( ;; ) { if (!pci_present()) { - printk(KERN_ERR "NETspider-U: no PCI bus present\n"); + printk(KERN_ERR "Netjet: no PCI bus present\n"); return(0); } if ((dev_netjet = pci_find_device(PCI_VENDOR_ID_TIGERJET, @@ -241,7 +253,7 @@ setup_netjet_u(struct IsdnCard *card)) cs->hw.njet.base + bytecnt); return (0); } else { - request_region(cs->hw.njet.base, bytecnt, "netjet-u isdn"); + request_region(cs->hw.njet.base, bytecnt, "netspider-u isdn"); } reset_netjet_u(cs); cs->readisac = &NETjet_ReadIC; |