blob: 78f634007fc6b88d09ddf1ffde90cea1e7c58f72 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*****************************************************************************
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
23#define SDLA_MAXIORANGE 4 /* maximum I/O port range */
24#define SDLA_WINDOWSIZE 0x2000 /* default dual-port memory window size */
25/****** Data Structures *****************************************************/
26
27/*----------------------------------------------------------------------------
28 * Adapter hardware configuration. Pointer to this structure is passed to all
29 * APIs.
30 */
31typedef struct sdlahw
32{
33 unsigned type; /* adapter type */
34 unsigned fwid; /* firmware ID */
35 unsigned port; /* adapter I/O port base */
36 int irq; /* interrupt request level */
37 char S514_cpu_no[1]; /* PCI CPU Number */
38 unsigned char S514_slot_no; /* PCI Slot Number */
39 char auto_pci_cfg; /* Autodetect PCI Slot */
40 struct pci_dev *pci_dev; /* PCI device */
41 void * dpmbase; /* dual-port memory base */
42 unsigned dpmsize; /* dual-port memory size */
43 unsigned pclk; /* CPU clock rate, kHz */
44 unsigned long memory; /* memory size */
45 unsigned long vector; /* local offset of the DPM window */
46 unsigned io_range; /* I/O port range */
47 unsigned char regs[SDLA_MAXIORANGE]; /* was written to registers */
48 unsigned reserved[5];
49} sdlahw_t;
50
51/****** Function Prototypes *************************************************/
52
53extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len);
54extern int sdla_down (sdlahw_t* hw);
55extern int sdla_inten (sdlahw_t* hw);
56extern int sdla_intde (sdlahw_t* hw);
57extern int sdla_intack (sdlahw_t* hw);
58extern void S514_intack (sdlahw_t* hw, u32 int_status);
59extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status);
60extern int sdla_intr (sdlahw_t* hw);
61extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr);
62extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf,
63 unsigned len);
64extern int sdla_poke (sdlahw_t* hw, unsigned long addr, void* buf,
65 unsigned len);
66extern int sdla_exec (void* opflag);
67
68extern unsigned wanpipe_hw_probe(void);
69
70#endif /* _SDLADRV_H */