brintos

brintos / linux-shallow public Read only

0
0
Text · 5.6 KiB · 36a9fa5 Raw
257 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 *4 * isar.h   ISAR (Siemens PSB 7110) specific defines5 *6 * Author Karsten Keil (keil@isdn4linux.de)7 *8 * Copyright 2009  by Karsten Keil <keil@isdn4linux.de>9 */10 11#include "iohelper.h"12 13struct isar_hw;14 15struct isar_ch {16	struct bchannel		bch;17	struct isar_hw		*is;18	struct timer_list	ftimer;19	u8			nr;20	u8			dpath;21	u8			mml;22	u8			state;23	u8			cmd;24	u8			mod;25	u8			newcmd;26	u8			newmod;27	u8			try_mod;28	u8			conmsg[16];29};30 31struct isar_hw {32	struct	isar_ch	ch[2];33	void		*hw;34	spinlock_t	*hwlock;	/* lock HW access */35	char		*name;36	struct module	*owner;37	read_reg_func	*read_reg;38	write_reg_func	*write_reg;39	fifo_func	*read_fifo;40	fifo_func	*write_fifo;41	int		(*ctrl)(void *, u32, u_long);42	void		(*release)(struct isar_hw *);43	int		(*init)(struct isar_hw *);44	int		(*open)(struct isar_hw *, struct channel_req *);45	int		(*firmware)(struct isar_hw *, const u8 *, int);46	unsigned long	Flags;47	int		version;48	u8		bstat;49	u8		iis;50	u8		cmsb;51	u8		clsb;52	u8		buf[256];53	u8		log[256];54};55 56#define ISAR_IRQMSK	0x0457#define ISAR_IRQSTA	0x0458#define ISAR_IRQBIT	0x7559#define ISAR_CTRL_H	0x6160#define ISAR_CTRL_L	0x6061#define ISAR_IIS	0x5862#define ISAR_IIA	0x5863#define ISAR_HIS	0x5064#define ISAR_HIA	0x5065#define ISAR_MBOX	0x4c66#define ISAR_WADR	0x4a67#define ISAR_RADR	0x4868 69#define ISAR_HIS_VNR		0x1470#define ISAR_HIS_DKEY		0x0271#define ISAR_HIS_FIRM		0x1e72#define ISAR_HIS_STDSP		0x0873#define ISAR_HIS_DIAG		0x0574#define ISAR_HIS_P0CFG		0x3c75#define ISAR_HIS_P12CFG		0x2476#define ISAR_HIS_SARTCFG	0x2577#define ISAR_HIS_PUMPCFG	0x2678#define ISAR_HIS_PUMPCTRL	0x2a79#define ISAR_HIS_IOM2CFG	0x2780#define ISAR_HIS_IOM2REQ	0x0781#define ISAR_HIS_IOM2CTRL	0x2b82#define ISAR_HIS_BSTREQ		0x0c83#define ISAR_HIS_PSTREQ		0x0e84#define ISAR_HIS_SDATA		0x2085#define ISAR_HIS_DPS1		0x4086#define ISAR_HIS_DPS2		0x8087#define SET_DPS(x)		((x << 6) & 0xc0)88 89#define ISAR_IIS_MSCMSD		0x3f90#define ISAR_IIS_VNR		0x1591#define ISAR_IIS_DKEY		0x0392#define ISAR_IIS_FIRM		0x1f93#define ISAR_IIS_STDSP		0x0994#define ISAR_IIS_DIAG		0x2595#define ISAR_IIS_GSTEV		0x0096#define ISAR_IIS_BSTEV		0x2897#define ISAR_IIS_BSTRSP		0x2c98#define ISAR_IIS_PSTRSP		0x2e99#define ISAR_IIS_PSTEV		0x2a100#define ISAR_IIS_IOM2RSP	0x27101#define ISAR_IIS_RDATA		0x20102#define ISAR_IIS_INVMSG		0x3f103 104#define ISAR_CTRL_SWVER	0x10105#define ISAR_CTRL_STST	0x40106 107#define ISAR_MSG_HWVER	0x20108 109#define ISAR_DP1_USE	1110#define ISAR_DP2_USE	2111#define ISAR_RATE_REQ	3112 113#define PMOD_DISABLE	0114#define PMOD_FAX	1115#define PMOD_DATAMODEM	2116#define PMOD_HALFDUPLEX	3117#define PMOD_V110	4118#define PMOD_DTMF	5119#define PMOD_DTMF_TRANS	6120#define PMOD_BYPASS	7121 122#define PCTRL_ORIG	0x80123#define PV32P2_V23R	0x40124#define PV32P2_V22A	0x20125#define PV32P2_V22B	0x10126#define PV32P2_V22C	0x08127#define PV32P2_V21	0x02128#define PV32P2_BEL	0x01129 130/* LSB MSB in ISAR doc wrong !!! Arghhh */131#define PV32P3_AMOD	0x80132#define PV32P3_V32B	0x02133#define PV32P3_V23B	0x01134#define PV32P4_48	0x11135#define PV32P5_48	0x05136#define PV32P4_UT48	0x11137#define PV32P5_UT48	0x0d138#define PV32P4_96	0x11139#define PV32P5_96	0x03140#define PV32P4_UT96	0x11141#define PV32P5_UT96	0x0f142#define PV32P4_B96	0x91143#define PV32P5_B96	0x0b144#define PV32P4_UTB96	0xd1145#define PV32P5_UTB96	0x0f146#define PV32P4_120	0xb1147#define PV32P5_120	0x09148#define PV32P4_UT120	0xf1149#define PV32P5_UT120	0x0f150#define PV32P4_144	0x99151#define PV32P5_144	0x09152#define PV32P4_UT144	0xf9153#define PV32P5_UT144	0x0f154#define PV32P6_CTN	0x01155#define PV32P6_ATN	0x02156 157#define PFAXP2_CTN	0x01158#define PFAXP2_ATN	0x04159 160#define PSEV_10MS_TIMER	0x02161#define PSEV_CON_ON	0x18162#define PSEV_CON_OFF	0x19163#define PSEV_V24_OFF	0x20164#define PSEV_CTS_ON	0x21165#define PSEV_CTS_OFF	0x22166#define PSEV_DCD_ON	0x23167#define PSEV_DCD_OFF	0x24168#define PSEV_DSR_ON	0x25169#define PSEV_DSR_OFF	0x26170#define PSEV_REM_RET	0xcc171#define PSEV_REM_REN	0xcd172#define PSEV_GSTN_CLR	0xd4173 174#define PSEV_RSP_READY	0xbc175#define PSEV_LINE_TX_H	0xb3176#define PSEV_LINE_TX_B	0xb2177#define PSEV_LINE_RX_H	0xb1178#define PSEV_LINE_RX_B	0xb0179#define PSEV_RSP_CONN	0xb5180#define PSEV_RSP_DISC	0xb7181#define PSEV_RSP_FCERR	0xb9182#define PSEV_RSP_SILDET	0xbe183#define PSEV_RSP_SILOFF	0xab184#define PSEV_FLAGS_DET	0xba185 186#define PCTRL_CMD_TDTMF	0x5a187 188#define PCTRL_CMD_FTH	0xa7189#define PCTRL_CMD_FRH	0xa5190#define PCTRL_CMD_FTM	0xa8191#define PCTRL_CMD_FRM	0xa6192#define PCTRL_CMD_SILON	0xac193#define PCTRL_CMD_CONT	0xa2194#define PCTRL_CMD_ESC	0xa4195#define PCTRL_CMD_SILOFF 0xab196#define PCTRL_CMD_HALT	0xa9197 198#define PCTRL_LOC_RET	0xcf199#define PCTRL_LOC_REN	0xce200 201#define SMODE_DISABLE	0202#define SMODE_V14	2203#define SMODE_HDLC	3204#define SMODE_BINARY	4205#define SMODE_FSK_V14	5206 207#define SCTRL_HDMC_BOTH	0x00208#define SCTRL_HDMC_DTX	0x80209#define SCTRL_HDMC_DRX	0x40210#define S_P1_OVSP	0x40211#define S_P1_SNP	0x20212#define S_P1_EOP	0x10213#define S_P1_EDP	0x08214#define S_P1_NSB	0x04215#define S_P1_CHS_8	0x03216#define S_P1_CHS_7	0x02217#define S_P1_CHS_6	0x01218#define S_P1_CHS_5	0x00219 220#define S_P2_BFT_DEF	0x10221 222#define IOM_CTRL_ENA	0x80223#define IOM_CTRL_NOPCM	0x00224#define IOM_CTRL_ALAW	0x02225#define IOM_CTRL_ULAW	0x04226#define IOM_CTRL_RCV	0x01227 228#define IOM_P1_TXD	0x10229 230#define HDLC_FED	0x40231#define HDLC_FSD	0x20232#define HDLC_FST	0x20233#define HDLC_ERROR	0x1c234#define HDLC_ERR_FAD	0x10235#define HDLC_ERR_RER	0x08236#define HDLC_ERR_CER	0x04237#define SART_NMD	0x01238 239#define BSTAT_RDM0	0x1240#define BSTAT_RDM1	0x2241#define BSTAT_RDM2	0x4242#define BSTAT_RDM3	0x8243#define BSTEV_TBO	0x1f244#define BSTEV_RBO	0x2f245 246/* FAX State Machine */247#define STFAX_NULL	0248#define STFAX_READY	1249#define STFAX_LINE	2250#define STFAX_CONT	3251#define STFAX_ACTIV	4252#define STFAX_ESCAPE	5253#define STFAX_SILDET	6254 255extern u32 mISDNisar_init(struct isar_hw *, void *);256extern void mISDNisar_irq(struct isar_hw *);257