Commit c1c4b860 authored by Kai Germaschewski's avatar Kai Germaschewski

HiSax HFC PCI driver udpate

Move to PCI DMA API.
Make it work on big endian machines.

Contributed by Benjamin Herrenschmidt.
parent f5f896dd
This diff is collapsed.
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
typedef struct { typedef struct {
unsigned short z1; /* Z1 pointer 16 Bit */ unsigned short z1; /* Z1 pointer 16 Bit */
unsigned short z2; /* Z2 pointer 16 Bit */ unsigned short z2; /* Z2 pointer 16 Bit */
} z_type; } __attribute__((packed)) z_type;
typedef struct { typedef struct {
u_char data[D_FIFO_SIZE]; /* FIFO data space */ u_char data[D_FIFO_SIZE]; /* FIFO data space */
...@@ -194,20 +194,20 @@ typedef struct { ...@@ -194,20 +194,20 @@ typedef struct {
u_char fill2[0x20C0-0x20A2]; /* reserved, do not use */ u_char fill2[0x20C0-0x20A2]; /* reserved, do not use */
z_type za[MAX_D_FRAMES+1]; /* mask index with D_FREG_MASK for access */ z_type za[MAX_D_FRAMES+1]; /* mask index with D_FREG_MASK for access */
u_char fill3[0x4000-0x2100]; /* align 16K */ u_char fill3[0x4000-0x2100]; /* align 16K */
} dfifo_type; } __attribute__((packed)) dfifo_type;
typedef struct { typedef struct {
z_type za[MAX_B_FRAMES+1]; /* only range 0x0..0x1F allowed */ z_type za[MAX_B_FRAMES+1]; /* only range 0x0..0x1F allowed */
u_char f1,f2; /* f pointers */ u_char f1,f2; /* f pointers */
u_char fill[0x2100-0x2082]; /* alignment */ u_char fill[0x2100-0x2082]; /* alignment */
} bzfifo_type; } __attribute__((packed)) bzfifo_type;
typedef union { typedef union {
struct { struct {
dfifo_type d_tx; /* D-send channel */ dfifo_type d_tx; /* D-send channel */
dfifo_type d_rx; /* D-receive channel */ dfifo_type d_rx; /* D-receive channel */
} d_chan; } __attribute__((packed)) d_chan;
struct { struct {
u_char fill1[0x200]; u_char fill1[0x200];
u_char txdat_b1[B_FIFO_SIZE]; u_char txdat_b1[B_FIFO_SIZE];
...@@ -223,13 +223,15 @@ typedef union { ...@@ -223,13 +223,15 @@ typedef union {
bzfifo_type rxbz_b2; bzfifo_type rxbz_b2;
u_char rxdat_b2[B_FIFO_SIZE]; u_char rxdat_b2[B_FIFO_SIZE];
} b_chans; } __attribute__((packed)) b_chans;
u_char fill[32768]; 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 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 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 main_irq_hcpci(struct BCState *bcs);
extern void inithfcpci(struct IsdnCardState *cs); extern void inithfcpci(struct IsdnCardState *cs);
......
...@@ -683,8 +683,9 @@ struct hfcPCI_hw { ...@@ -683,8 +683,9 @@ struct hfcPCI_hw {
unsigned char pci_bus; unsigned char pci_bus;
unsigned char pci_device_fn; unsigned char pci_device_fn;
unsigned char *pci_io; /* start of PCI IO memory */ unsigned char *pci_io; /* start of PCI IO memory */
void *share_start; /* shared memory for Fifos start */
void *fifos; /* FIFO memory */ 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 */ int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
struct timer_list timer; struct timer_list timer;
}; };
......
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