Commit 9f268b87 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/linux-2.5.isdn.hisax_netjet

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/linux-2.5.isdn
parents c1c4b860 90684e77
...@@ -422,10 +422,11 @@ struct hfcB_hw { ...@@ -422,10 +422,11 @@ struct hfcB_hw {
struct tiger_hw { struct tiger_hw {
u_int *send; u_int *send;
u_int *s_irq; dma_addr_t send_dma;
u_int *s_end; u_int *s_end;
u_int *sendp; u_int *sendp;
u_int *rec; u_int *rec;
dma_addr_t rec_dma;
int free; int free;
u_char *rcvbuf; u_char *rcvbuf;
u_char *sendbuf; u_char *sendbuf;
...@@ -660,6 +661,7 @@ struct njet_hw { ...@@ -660,6 +661,7 @@ struct njet_hw {
unsigned char irqmask0; unsigned char irqmask0;
unsigned char irqstat0; unsigned char irqstat0;
unsigned char last_is0; unsigned char last_is0;
struct pci_dev *pdev;
}; };
struct hfcPCI_hw { struct hfcPCI_hw {
......
...@@ -659,7 +659,9 @@ void netjet_fill_dma(struct BCState *bcs) ...@@ -659,7 +659,9 @@ void netjet_fill_dma(struct BCState *bcs)
if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) { if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) {
write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free); write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free);
} else if (test_and_clear_bit(BC_FLG_HALF, &bcs->Flag)) { } else if (test_and_clear_bit(BC_FLG_HALF, &bcs->Flag)) {
p = bus_to_virt(inl(bcs->cs->hw.njet.base + NETJET_DMA_READ_ADR)); p = inl(bcs->cs->hw.njet.base + NETJET_DMA_READ_ADR)
- bcs->hw.tiger.send_dma
+ bcs->hw.tiger.send;
sp = bcs->hw.tiger.sendp; sp = bcs->hw.tiger.sendp;
if (p == bcs->hw.tiger.s_end) if (p == bcs->hw.tiger.s_end)
p = bcs->hw.tiger.send -1; p = bcs->hw.tiger.send -1;
...@@ -680,7 +682,9 @@ void netjet_fill_dma(struct BCState *bcs) ...@@ -680,7 +682,9 @@ void netjet_fill_dma(struct BCState *bcs)
write_raw(bcs, p, bcs->hw.tiger.free - cnt); write_raw(bcs, p, bcs->hw.tiger.free - cnt);
} }
} else if (test_and_clear_bit(BC_FLG_EMPTY, &bcs->Flag)) { } else if (test_and_clear_bit(BC_FLG_EMPTY, &bcs->Flag)) {
p = bus_to_virt(inl(bcs->cs->hw.njet.base + NETJET_DMA_READ_ADR)); p = inl(bcs->cs->hw.njet.base + NETJET_DMA_READ_ADR)
- bcs->hw.tiger.send_dma
+ bcs->hw.tiger.send;
cnt = bcs->hw.tiger.s_end - p; cnt = bcs->hw.tiger.s_end - p;
if (cnt < 2) { if (cnt < 2) {
p = bcs->hw.tiger.send + 1; p = bcs->hw.tiger.send + 1;
...@@ -935,29 +939,36 @@ setstack_tiger(struct PStack *st, struct BCState *bcs) ...@@ -935,29 +939,36 @@ setstack_tiger(struct PStack *st, struct BCState *bcs)
void __init void __init
inittiger(struct IsdnCardState *cs) inittiger(struct IsdnCardState *cs)
{ {
if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_TXSIZE * sizeof(unsigned int), cs->bcs[0].hw.tiger.send =
GFP_KERNEL | GFP_DMA))) { pci_alloc_consistent(cs->hw.njet.pdev,
NETJET_DMA_TXSIZE * sizeof(unsigned int),
&cs->bcs[0].hw.tiger.send_dma);
if (!cs->bcs[0].hw.tiger.send) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: No memory for tiger.send\n"); "HiSax: No memory for tiger.send\n");
return; return;
} }
cs->bcs[0].hw.tiger.s_irq = cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE/2 - 1;
cs->bcs[0].hw.tiger.s_end = cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1; cs->bcs[0].hw.tiger.s_end = cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1;
cs->bcs[1].hw.tiger.send = cs->bcs[0].hw.tiger.send; cs->bcs[1].hw.tiger.send = cs->bcs[0].hw.tiger.send;
cs->bcs[1].hw.tiger.s_irq = cs->bcs[0].hw.tiger.s_irq; cs->bcs[1].hw.tiger.send_dma = cs->bcs[0].hw.tiger.send_dma;
cs->bcs[1].hw.tiger.s_end = cs->bcs[0].hw.tiger.s_end; cs->bcs[1].hw.tiger.s_end = cs->bcs[0].hw.tiger.s_end;
memset(cs->bcs[0].hw.tiger.send, 0xff, NETJET_DMA_TXSIZE * sizeof(unsigned int)); memset(cs->bcs[0].hw.tiger.send, 0xff, NETJET_DMA_TXSIZE * sizeof(unsigned int));
debugl1(cs, "tiger: send buf %x - %x", (u_int)cs->bcs[0].hw.tiger.send, debugl1(cs, "tiger: send buf %x - %x", (u_int)cs->bcs[0].hw.tiger.send,
(u_int)(cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1)); (u_int)(cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1));
outl(virt_to_bus(cs->bcs[0].hw.tiger.send), outl(cs->bcs[0].hw.tiger.send_dma,
cs->hw.njet.base + NETJET_DMA_READ_START); cs->hw.njet.base + NETJET_DMA_READ_START);
outl(virt_to_bus(cs->bcs[0].hw.tiger.s_irq), outl(cs->bcs[0].hw.tiger.send_dma + NETJET_DMA_TXSIZE/2 - 1,
cs->hw.njet.base + NETJET_DMA_READ_IRQ); cs->hw.njet.base + NETJET_DMA_READ_IRQ);
outl(virt_to_bus(cs->bcs[0].hw.tiger.s_end), outl(cs->bcs[0].hw.tiger.send_dma + NETJET_DMA_TXSIZE - 1,
cs->hw.njet.base + NETJET_DMA_READ_END); cs->hw.njet.base + NETJET_DMA_READ_END);
if (!(cs->bcs[0].hw.tiger.rec = kmalloc(NETJET_DMA_RXSIZE * sizeof(unsigned int),
GFP_KERNEL | GFP_DMA))) { cs->bcs[0].hw.tiger.rec =
pci_alloc_consistent(cs->hw.njet.pdev,
NETJET_DMA_RXSIZE * sizeof(unsigned int),
&cs->bcs[0].hw.tiger.rec_dma);
if (!cs->bcs[0].hw.tiger.rec) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: No memory for tiger.rec\n"); "HiSax: No memory for tiger.rec\n");
return; return;
...@@ -965,12 +976,13 @@ inittiger(struct IsdnCardState *cs) ...@@ -965,12 +976,13 @@ inittiger(struct IsdnCardState *cs)
debugl1(cs, "tiger: rec buf %x - %x", (u_int)cs->bcs[0].hw.tiger.rec, debugl1(cs, "tiger: rec buf %x - %x", (u_int)cs->bcs[0].hw.tiger.rec,
(u_int)(cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1)); (u_int)(cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1));
cs->bcs[1].hw.tiger.rec = cs->bcs[0].hw.tiger.rec; cs->bcs[1].hw.tiger.rec = cs->bcs[0].hw.tiger.rec;
cs->bcs[1].hw.tiger.rec_dma = cs->bcs[0].hw.tiger.rec_dma;
memset(cs->bcs[0].hw.tiger.rec, 0xff, NETJET_DMA_RXSIZE * sizeof(unsigned int)); memset(cs->bcs[0].hw.tiger.rec, 0xff, NETJET_DMA_RXSIZE * sizeof(unsigned int));
outl(virt_to_bus(cs->bcs[0].hw.tiger.rec), outl(cs->bcs[0].hw.tiger.rec_dma,
cs->hw.njet.base + NETJET_DMA_WRITE_START); cs->hw.njet.base + NETJET_DMA_WRITE_START);
outl(virt_to_bus(cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE/2 - 1), outl(cs->bcs[0].hw.tiger.rec_dma + NETJET_DMA_RXSIZE/2 - 1,
cs->hw.njet.base + NETJET_DMA_WRITE_IRQ); cs->hw.njet.base + NETJET_DMA_WRITE_IRQ);
outl(virt_to_bus(cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1), outl(cs->bcs[0].hw.tiger.rec_dma + NETJET_DMA_RXSIZE - 1,
cs->hw.njet.base + NETJET_DMA_WRITE_END); cs->hw.njet.base + NETJET_DMA_WRITE_END);
debugl1(cs, "tiger: dmacfg %x/%x pulse=%d", debugl1(cs, "tiger: dmacfg %x/%x pulse=%d",
inl(cs->hw.njet.base + NETJET_DMA_WRITE_ADR), inl(cs->hw.njet.base + NETJET_DMA_WRITE_ADR),
...@@ -987,14 +999,20 @@ void ...@@ -987,14 +999,20 @@ void
releasetiger(struct IsdnCardState *cs) releasetiger(struct IsdnCardState *cs)
{ {
if (cs->bcs[0].hw.tiger.send) { if (cs->bcs[0].hw.tiger.send) {
kfree(cs->bcs[0].hw.tiger.send); pci_free_consistent(cs->hw.njet.pdev,
NETJET_DMA_TXSIZE * sizeof(unsigned int),
cs->bcs[0].hw.tiger.send,
cs->bcs[0].hw.tiger.send_dma);
cs->bcs[0].hw.tiger.send = NULL; cs->bcs[0].hw.tiger.send = NULL;
} }
if (cs->bcs[1].hw.tiger.send) { if (cs->bcs[1].hw.tiger.send) {
cs->bcs[1].hw.tiger.send = NULL; cs->bcs[1].hw.tiger.send = NULL;
} }
if (cs->bcs[0].hw.tiger.rec) { if (cs->bcs[0].hw.tiger.rec) {
kfree(cs->bcs[0].hw.tiger.rec); pci_free_consistent(cs->hw.njet.pdev,
NETJET_DMA_RXSIZE * sizeof(unsigned int),
cs->bcs[0].hw.tiger.rec,
cs->bcs[0].hw.tiger.rec_dma);
cs->bcs[0].hw.tiger.rec = NULL; cs->bcs[0].hw.tiger.rec = NULL;
} }
if (cs->bcs[1].hw.tiger.rec) { if (cs->bcs[1].hw.tiger.rec) {
......
...@@ -184,6 +184,7 @@ setup_netjet_s(struct IsdnCard *card) ...@@ -184,6 +184,7 @@ setup_netjet_s(struct IsdnCard *card)
printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n"); printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
return(0); return(0);
} }
cs->hw.njet.pdev = dev_netjet;
} else { } else {
printk(KERN_WARNING "NETjet-S: No PCI card found\n"); printk(KERN_WARNING "NETjet-S: No PCI card found\n");
return(0); return(0);
......
...@@ -186,6 +186,7 @@ setup_netjet_u(struct IsdnCard *card) ...@@ -186,6 +186,7 @@ setup_netjet_u(struct IsdnCard *card)
printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n"); printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n");
return(0); return(0);
} }
cs->hw.njet.pdev = dev_netjet;
} else { } else {
printk(KERN_WARNING "NETspider-U: No PCI card found\n"); printk(KERN_WARNING "NETspider-U: No PCI card found\n");
return(0); return(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment