Path: blob/master/drivers/isdn/hardware/mISDN/isar.h
15111 views
/*1*2* isar.h ISAR (Siemens PSB 7110) specific defines3*4* Author Karsten Keil ([email protected])5*6* Copyright 2009 by Karsten Keil <[email protected]>7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License version 2 as10* published by the Free Software Foundation.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.20*21*/2223#include "iohelper.h"2425struct isar_hw;2627struct isar_ch {28struct bchannel bch;29struct isar_hw *is;30struct timer_list ftimer;31u8 nr;32u8 dpath;33u8 mml;34u8 state;35u8 cmd;36u8 mod;37u8 newcmd;38u8 newmod;39u8 try_mod;40u8 conmsg[16];41};4243struct isar_hw {44struct isar_ch ch[2];45void *hw;46spinlock_t *hwlock; /* lock HW access */47char *name;48struct module *owner;49read_reg_func *read_reg;50write_reg_func *write_reg;51fifo_func *read_fifo;52fifo_func *write_fifo;53int (*ctrl)(void *, u32, u_long);54void (*release)(struct isar_hw *);55int (*init)(struct isar_hw *);56int (*open)(struct isar_hw *, struct channel_req *);57int (*firmware)(struct isar_hw *, const u8 *, int);58unsigned long Flags;59int version;60u8 bstat;61u8 iis;62u8 cmsb;63u8 clsb;64u8 buf[256];65u8 log[256];66};6768#define ISAR_IRQMSK 0x0469#define ISAR_IRQSTA 0x0470#define ISAR_IRQBIT 0x7571#define ISAR_CTRL_H 0x6172#define ISAR_CTRL_L 0x6073#define ISAR_IIS 0x5874#define ISAR_IIA 0x5875#define ISAR_HIS 0x5076#define ISAR_HIA 0x5077#define ISAR_MBOX 0x4c78#define ISAR_WADR 0x4a79#define ISAR_RADR 0x488081#define ISAR_HIS_VNR 0x1482#define ISAR_HIS_DKEY 0x0283#define ISAR_HIS_FIRM 0x1e84#define ISAR_HIS_STDSP 0x0885#define ISAR_HIS_DIAG 0x0586#define ISAR_HIS_P0CFG 0x3c87#define ISAR_HIS_P12CFG 0x2488#define ISAR_HIS_SARTCFG 0x2589#define ISAR_HIS_PUMPCFG 0x2690#define ISAR_HIS_PUMPCTRL 0x2a91#define ISAR_HIS_IOM2CFG 0x2792#define ISAR_HIS_IOM2REQ 0x0793#define ISAR_HIS_IOM2CTRL 0x2b94#define ISAR_HIS_BSTREQ 0x0c95#define ISAR_HIS_PSTREQ 0x0e96#define ISAR_HIS_SDATA 0x2097#define ISAR_HIS_DPS1 0x4098#define ISAR_HIS_DPS2 0x8099#define SET_DPS(x) ((x<<6) & 0xc0)100101#define ISAR_IIS_MSCMSD 0x3f102#define ISAR_IIS_VNR 0x15103#define ISAR_IIS_DKEY 0x03104#define ISAR_IIS_FIRM 0x1f105#define ISAR_IIS_STDSP 0x09106#define ISAR_IIS_DIAG 0x25107#define ISAR_IIS_GSTEV 0x00108#define ISAR_IIS_BSTEV 0x28109#define ISAR_IIS_BSTRSP 0x2c110#define ISAR_IIS_PSTRSP 0x2e111#define ISAR_IIS_PSTEV 0x2a112#define ISAR_IIS_IOM2RSP 0x27113#define ISAR_IIS_RDATA 0x20114#define ISAR_IIS_INVMSG 0x3f115116#define ISAR_CTRL_SWVER 0x10117#define ISAR_CTRL_STST 0x40118119#define ISAR_MSG_HWVER 0x20120121#define ISAR_DP1_USE 1122#define ISAR_DP2_USE 2123#define ISAR_RATE_REQ 3124125#define PMOD_DISABLE 0126#define PMOD_FAX 1127#define PMOD_DATAMODEM 2128#define PMOD_HALFDUPLEX 3129#define PMOD_V110 4130#define PMOD_DTMF 5131#define PMOD_DTMF_TRANS 6132#define PMOD_BYPASS 7133134#define PCTRL_ORIG 0x80135#define PV32P2_V23R 0x40136#define PV32P2_V22A 0x20137#define PV32P2_V22B 0x10138#define PV32P2_V22C 0x08139#define PV32P2_V21 0x02140#define PV32P2_BEL 0x01141142/* LSB MSB in ISAR doc wrong !!! Arghhh */143#define PV32P3_AMOD 0x80144#define PV32P3_V32B 0x02145#define PV32P3_V23B 0x01146#define PV32P4_48 0x11147#define PV32P5_48 0x05148#define PV32P4_UT48 0x11149#define PV32P5_UT48 0x0d150#define PV32P4_96 0x11151#define PV32P5_96 0x03152#define PV32P4_UT96 0x11153#define PV32P5_UT96 0x0f154#define PV32P4_B96 0x91155#define PV32P5_B96 0x0b156#define PV32P4_UTB96 0xd1157#define PV32P5_UTB96 0x0f158#define PV32P4_120 0xb1159#define PV32P5_120 0x09160#define PV32P4_UT120 0xf1161#define PV32P5_UT120 0x0f162#define PV32P4_144 0x99163#define PV32P5_144 0x09164#define PV32P4_UT144 0xf9165#define PV32P5_UT144 0x0f166#define PV32P6_CTN 0x01167#define PV32P6_ATN 0x02168169#define PFAXP2_CTN 0x01170#define PFAXP2_ATN 0x04171172#define PSEV_10MS_TIMER 0x02173#define PSEV_CON_ON 0x18174#define PSEV_CON_OFF 0x19175#define PSEV_V24_OFF 0x20176#define PSEV_CTS_ON 0x21177#define PSEV_CTS_OFF 0x22178#define PSEV_DCD_ON 0x23179#define PSEV_DCD_OFF 0x24180#define PSEV_DSR_ON 0x25181#define PSEV_DSR_OFF 0x26182#define PSEV_REM_RET 0xcc183#define PSEV_REM_REN 0xcd184#define PSEV_GSTN_CLR 0xd4185186#define PSEV_RSP_READY 0xbc187#define PSEV_LINE_TX_H 0xb3188#define PSEV_LINE_TX_B 0xb2189#define PSEV_LINE_RX_H 0xb1190#define PSEV_LINE_RX_B 0xb0191#define PSEV_RSP_CONN 0xb5192#define PSEV_RSP_DISC 0xb7193#define PSEV_RSP_FCERR 0xb9194#define PSEV_RSP_SILDET 0xbe195#define PSEV_RSP_SILOFF 0xab196#define PSEV_FLAGS_DET 0xba197198#define PCTRL_CMD_TDTMF 0x5a199200#define PCTRL_CMD_FTH 0xa7201#define PCTRL_CMD_FRH 0xa5202#define PCTRL_CMD_FTM 0xa8203#define PCTRL_CMD_FRM 0xa6204#define PCTRL_CMD_SILON 0xac205#define PCTRL_CMD_CONT 0xa2206#define PCTRL_CMD_ESC 0xa4207#define PCTRL_CMD_SILOFF 0xab208#define PCTRL_CMD_HALT 0xa9209210#define PCTRL_LOC_RET 0xcf211#define PCTRL_LOC_REN 0xce212213#define SMODE_DISABLE 0214#define SMODE_V14 2215#define SMODE_HDLC 3216#define SMODE_BINARY 4217#define SMODE_FSK_V14 5218219#define SCTRL_HDMC_BOTH 0x00220#define SCTRL_HDMC_DTX 0x80221#define SCTRL_HDMC_DRX 0x40222#define S_P1_OVSP 0x40223#define S_P1_SNP 0x20224#define S_P1_EOP 0x10225#define S_P1_EDP 0x08226#define S_P1_NSB 0x04227#define S_P1_CHS_8 0x03228#define S_P1_CHS_7 0x02229#define S_P1_CHS_6 0x01230#define S_P1_CHS_5 0x00231232#define S_P2_BFT_DEF 0x10233234#define IOM_CTRL_ENA 0x80235#define IOM_CTRL_NOPCM 0x00236#define IOM_CTRL_ALAW 0x02237#define IOM_CTRL_ULAW 0x04238#define IOM_CTRL_RCV 0x01239240#define IOM_P1_TXD 0x10241242#define HDLC_FED 0x40243#define HDLC_FSD 0x20244#define HDLC_FST 0x20245#define HDLC_ERROR 0x1c246#define HDLC_ERR_FAD 0x10247#define HDLC_ERR_RER 0x08248#define HDLC_ERR_CER 0x04249#define SART_NMD 0x01250251#define BSTAT_RDM0 0x1252#define BSTAT_RDM1 0x2253#define BSTAT_RDM2 0x4254#define BSTAT_RDM3 0x8255#define BSTEV_TBO 0x1f256#define BSTEV_RBO 0x2f257258/* FAX State Machine */259#define STFAX_NULL 0260#define STFAX_READY 1261#define STFAX_LINE 2262#define STFAX_CONT 3263#define STFAX_ACTIV 4264#define STFAX_ESCAPE 5265#define STFAX_SILDET 6266267extern u32 mISDNisar_init(struct isar_hw *, void *);268extern void mISDNisar_irq(struct isar_hw *);269270271