| [2] | 1 | /***************************************************************************** |
|---|
| 2 | * sdladrv.h SDLA Support Module. Kernel API Definitions. |
|---|
| 3 | * |
|---|
| 4 | * Author: Gideon Hack |
|---|
| 5 | * |
|---|
| 6 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. |
|---|
| 7 | * |
|---|
| 8 | * This program is free software; you can redistribute it and/or |
|---|
| 9 | * modify it under the terms of the GNU General Public License |
|---|
| 10 | * as published by the Free Software Foundation; either version |
|---|
| 11 | * 2 of the License, or (at your option) any later version. |
|---|
| 12 | * ============================================================================ |
|---|
| 13 | * Jun 02, 1999 Gideon Hack Added support for the S514 PCI adapter. |
|---|
| 14 | * Dec 11, 1996 Gene Kozin Complete overhaul. |
|---|
| 15 | * Oct 17, 1996 Gene Kozin Minor bug fixes. |
|---|
| 16 | * Jun 12, 1996 Gene Kozin Added support for S503 card. |
|---|
| 17 | * Dec 06, 1995 Gene Kozin Initial version. |
|---|
| 18 | *****************************************************************************/ |
|---|
| 19 | #ifndef _SDLADRV_H |
|---|
| 20 | #define _SDLADRV_H |
|---|
| 21 | |
|---|
| 22 | #include <asm/types.h> |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | #define SDLA_MAXIORANGE 4 /* maximum I/O port range */ |
|---|
| 26 | #define SDLA_WINDOWSIZE 0x2000 /* default dual-port memory window size */ |
|---|
| 27 | /****** Data Structures *****************************************************/ |
|---|
| 28 | |
|---|
| 29 | /*---------------------------------------------------------------------------- |
|---|
| 30 | * Adapter hardware configuration. Pointer to this structure is passed to all |
|---|
| 31 | * APIs. |
|---|
| 32 | */ |
|---|
| 33 | typedef struct sdlahw |
|---|
| 34 | { |
|---|
| 35 | unsigned type; /* adapter type */ |
|---|
| 36 | unsigned fwid; /* firmware ID */ |
|---|
| 37 | unsigned port; /* adapter I/O port base */ |
|---|
| 38 | int irq; /* interrupt request level */ |
|---|
| 39 | char S514_cpu_no[1]; /* PCI CPU Number */ |
|---|
| 40 | unsigned char S514_slot_no; /* PCI Slot Number */ |
|---|
| 41 | char auto_pci_cfg; /* Autodetect PCI Slot */ |
|---|
| 42 | struct pci_dev *pci_dev; /* PCI device */ |
|---|
| 43 | void * dpmbase; /* dual-port memory base */ |
|---|
| 44 | unsigned dpmsize; /* dual-port memory size */ |
|---|
| 45 | unsigned pclk; /* CPU clock rate, kHz */ |
|---|
| 46 | unsigned long memory; /* memory size */ |
|---|
| 47 | unsigned long vector; /* local offset of the DPM window */ |
|---|
| 48 | unsigned io_range; /* I/O port range */ |
|---|
| 49 | unsigned char regs[SDLA_MAXIORANGE]; /* was written to registers */ |
|---|
| 50 | unsigned reserved[5]; |
|---|
| 51 | } sdlahw_t; |
|---|
| 52 | |
|---|
| 53 | /****** Function Prototypes *************************************************/ |
|---|
| 54 | |
|---|
| 55 | extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); |
|---|
| 56 | extern int sdla_down (sdlahw_t* hw); |
|---|
| 57 | extern int sdla_inten (sdlahw_t* hw); |
|---|
| 58 | extern int sdla_intde (sdlahw_t* hw); |
|---|
| 59 | extern int sdla_intack (sdlahw_t* hw); |
|---|
| 60 | extern void S514_intack (sdlahw_t* hw, __u32 int_status); |
|---|
| 61 | extern void read_S514_int_stat (sdlahw_t* hw, __u32* int_status); |
|---|
| 62 | extern int sdla_intr (sdlahw_t* hw); |
|---|
| 63 | extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); |
|---|
| 64 | extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, |
|---|
| 65 | unsigned len); |
|---|
| 66 | extern int sdla_poke (sdlahw_t* hw, unsigned long addr, void* buf, |
|---|
| 67 | unsigned len); |
|---|
| 68 | extern int sdla_exec (void* opflag); |
|---|
| 69 | |
|---|
| 70 | extern unsigned wanpipe_hw_probe(void); |
|---|
| 71 | |
|---|
| 72 | #endif /* _SDLADRV_H */ |
|---|