Commit bcb254fc authored by Kai Germaschewski's avatar Kai Germaschewski

Merge linux-isdn@linux-isdn.bkbits.net:linux-2.5.isdn

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/linux-2.5.isdn
parents 7994321a 9f268b87
This diff is collapsed.
......@@ -185,7 +185,7 @@
typedef struct {
unsigned short z1; /* Z1 pointer 16 Bit */
unsigned short z2; /* Z2 pointer 16 Bit */
} z_type;
} __attribute__((packed)) z_type;
typedef struct {
u_char data[D_FIFO_SIZE]; /* FIFO data space */
......@@ -194,20 +194,20 @@ typedef struct {
u_char fill2[0x20C0-0x20A2]; /* reserved, do not use */
z_type za[MAX_D_FRAMES+1]; /* mask index with D_FREG_MASK for access */
u_char fill3[0x4000-0x2100]; /* align 16K */
} dfifo_type;
} __attribute__((packed)) dfifo_type;
typedef struct {
z_type za[MAX_B_FRAMES+1]; /* only range 0x0..0x1F allowed */
u_char f1,f2; /* f pointers */
u_char fill[0x2100-0x2082]; /* alignment */
} bzfifo_type;
} __attribute__((packed)) bzfifo_type;
typedef union {
struct {
dfifo_type d_tx; /* D-send channel */
dfifo_type d_rx; /* D-receive channel */
} d_chan;
} __attribute__((packed)) d_chan;
struct {
u_char fill1[0x200];
u_char txdat_b1[B_FIFO_SIZE];
......@@ -223,13 +223,15 @@ typedef union {
bzfifo_type rxbz_b2;
u_char rxdat_b2[B_FIFO_SIZE];
} b_chans;
} __attribute__((packed)) b_chans;
u_char fill[32768];
} fifo_area;
} __attribute__((packed)) fifo_area;
#define Write_hfc(a,b,c) (*(((u_char *)a->hw.hfcpci.pci_io)+b) = c)
#define Read_hfc(a,b) (*(((u_char *)a->hw.hfcpci.pci_io)+b))
//#define Write_hfc(a,b,c) (*(((u_char *)a->hw.hfcpci.pci_io)+b) = c)
//#define Read_hfc(a,b) (*(((u_char *)a->hw.hfcpci.pci_io)+b))
#define Write_hfc(a,b,c) writeb(c, ((u_char *)a->hw.hfcpci.pci_io)+b)
#define Read_hfc(a,b) readb(((u_char *)a->hw.hfcpci.pci_io)+b)
extern void main_irq_hcpci(struct BCState *bcs);
extern void inithfcpci(struct IsdnCardState *cs);
......
......@@ -422,10 +422,11 @@ struct hfcB_hw {
struct tiger_hw {
u_int *send;
u_int *s_irq;
dma_addr_t send_dma;
u_int *s_end;
u_int *sendp;
u_int *rec;
dma_addr_t rec_dma;
int free;
u_char *rcvbuf;
u_char *sendbuf;
......@@ -660,6 +661,7 @@ struct njet_hw {
unsigned char irqmask0;
unsigned char irqstat0;
unsigned char last_is0;
struct pci_dev *pdev;
};
struct hfcPCI_hw {
......@@ -683,8 +685,9 @@ struct hfcPCI_hw {
unsigned char pci_bus;
unsigned char pci_device_fn;
unsigned char *pci_io; /* start of PCI IO memory */
void *share_start; /* shared memory for Fifos start */
void *fifos; /* FIFO memory */
dma_addr_t fifos_dma;
struct pci_dev* pdev;
int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
struct timer_list timer;
};
......
......@@ -659,7 +659,9 @@ void netjet_fill_dma(struct BCState *bcs)
if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) {
write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free);
} 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;
if (p == bcs->hw.tiger.s_end)
p = bcs->hw.tiger.send -1;
......@@ -680,7 +682,9 @@ void netjet_fill_dma(struct BCState *bcs)
write_raw(bcs, p, bcs->hw.tiger.free - cnt);
}
} 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;
if (cnt < 2) {
p = bcs->hw.tiger.send + 1;
......@@ -935,29 +939,36 @@ setstack_tiger(struct PStack *st, struct BCState *bcs)
void __init
inittiger(struct IsdnCardState *cs)
{
if (!(cs->bcs[0].hw.tiger.send = kmalloc(NETJET_DMA_TXSIZE * sizeof(unsigned int),
GFP_KERNEL | GFP_DMA))) {
cs->bcs[0].hw.tiger.send =
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
"HiSax: No memory for tiger.send\n");
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[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;
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,
(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);
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);
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);
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
"HiSax: No memory for tiger.rec\n");
return;
......@@ -965,12 +976,13 @@ inittiger(struct IsdnCardState *cs)
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));
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));
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);
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);
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);
debugl1(cs, "tiger: dmacfg %x/%x pulse=%d",
inl(cs->hw.njet.base + NETJET_DMA_WRITE_ADR),
......@@ -987,14 +999,20 @@ void
releasetiger(struct IsdnCardState *cs)
{
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;
}
if (cs->bcs[1].hw.tiger.send) {
cs->bcs[1].hw.tiger.send = NULL;
}
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;
}
if (cs->bcs[1].hw.tiger.rec) {
......
......@@ -184,6 +184,7 @@ setup_netjet_s(struct IsdnCard *card)
printk(KERN_WARNING "NETjet-S: No IO-Adr for PCI card found\n");
return(0);
}
cs->hw.njet.pdev = dev_netjet;
} else {
printk(KERN_WARNING "NETjet-S: No PCI card found\n");
return(0);
......
......@@ -186,6 +186,7 @@ setup_netjet_u(struct IsdnCard *card)
printk(KERN_WARNING "NETspider-U: No IO-Adr for PCI card found\n");
return(0);
}
cs->hw.njet.pdev = dev_netjet;
} else {
printk(KERN_WARNING "NETspider-U: No PCI card found\n");
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