Commit f0cfbae6 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Move BC_{Read,Write}_Reg into struct bc_hw_ops

Instead of having the B-Channel callbacks directly in struct
IsdnCardState, use an struct bc_hw_ops.
parent f7f26550
......@@ -149,6 +149,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.asus.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -388,8 +393,7 @@ setup_asuscom(struct IsdnCard *card)
}
printk(KERN_INFO "ISDNLink: defined at 0x%x IRQ %d\n",
cs->hw.asus.cfg_reg, cs->irq);
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Asus_card_msg;
val = readreg(cs->hw.asus.cfg_reg + ASUS_IPAC_ALE,
......
......@@ -89,6 +89,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
writereg(cs->hw.avm.hscx[hscx], offset, value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -293,8 +298,7 @@ setup_avm_a1(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &AVM_card_msg;
cs->irq_func = &avm_a1_interrupt;
......
......@@ -162,6 +162,11 @@ WriteHSCXfifo(struct IsdnCardState *cs, int hscx, u_char * data, int size)
spin_unlock_irqrestore(&avm_a1p_lock, flags);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -274,8 +279,7 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &AVM_card_msg;
cs->irq_func = &avm_a1p_interrupt;
......
......@@ -116,6 +116,11 @@ WriteJADE(struct IsdnCardState *cs, int jade, u_char offset, u_char value)
writereg(cs->hw.ax.jade_ale, cs->hw.ax.jade_adr, offset + (jade == -1 ? 0 : (jade ? 0xC0 : 0x80)), value);
}
static struct bc_hw_ops jade_ops = {
.read_reg = ReadJADE,
.write_reg = WriteJADE,
};
/*
* fast interrupt JADE stuff goes here
*/
......@@ -331,8 +336,7 @@ setup_bkm_a4t(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadJADE;
cs->BC_Write_Reg = &WriteJADE;
cs->bc_hw_ops = &jade_ops;
cs->BC_Send_Data = &jade_fill_fifo;
cs->cardmsg = &BKM_card_msg;
cs->irq_func = &bkm_interrupt;
......
......@@ -123,6 +123,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
writereg(cs->hw.ax.base, cs->hw.ax.data_adr, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/* Set the specific ipac to active */
static void
set_ipac_active(struct IsdnCardState *cs, u_int active)
......@@ -435,8 +440,7 @@ setup_sct_quadro(struct IsdnCard *card)
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &BKM_card_msg;
cs->irq_func = &bkm_interrupt_ipac;
......
......@@ -204,6 +204,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.diva.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
static u_char
MemReadISAC_IPAC(struct IsdnCardState *cs, u_char offset)
{
......@@ -242,6 +247,11 @@ MemWriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
memwritereg(cs->hw.diva.cfg_reg, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops mem_hscx_ops = {
.read_reg = MemReadHSCX,
.write_reg = MemWriteHSCX,
};
/* IO-Functions for IPACX type cards */
static u_char
MemReadISAC_IPACX(struct IsdnCardState *cs, u_char offset)
......@@ -283,6 +293,11 @@ MemWriteHSCX_IPACX(struct IsdnCardState *cs, int hscx, u_char offset, u_char val
(hscx ? IPACX_OFF_B2 : IPACX_OFF_B1), value);
}
static struct bc_hw_ops mem_ipacx_bc_ops = {
.read_reg = MemReadHSCX_IPACX,
.write_reg = MemWriteHSCX_IPACX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -1064,8 +1079,7 @@ setup_diva(struct IsdnCard *card)
}
}
reset_diva(cs);
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Diva_card_msg;
if (cs->subtyp == DIVA_IPAC_ISA) {
......@@ -1081,8 +1095,7 @@ setup_diva(struct IsdnCard *card)
cs->writeisac = &MemWriteISAC_IPAC;
cs->readisacfifo = &MemReadISACfifo_IPAC;
cs->writeisacfifo = &MemWriteISACfifo_IPAC;
cs->BC_Read_Reg = &MemReadHSCX;
cs->BC_Write_Reg = &MemWriteHSCX;
cs->bc_hw_ops = &mem_hscx_ops;
cs->BC_Send_Data = &Memhscx_fill_fifo;
cs->irq_func = &diva_irq_ipac_pci;
val = memreadreg(cs->hw.diva.cfg_reg, IPAC_ID);
......@@ -1092,8 +1105,7 @@ setup_diva(struct IsdnCard *card)
cs->writeisac = &MemWriteISAC_IPACX;
cs->readisacfifo = &MemReadISACfifo_IPACX;
cs->writeisacfifo = &MemWriteISACfifo_IPACX;
cs->BC_Read_Reg = &MemReadHSCX_IPACX;
cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
cs->bc_hw_ops = &mem_ipacx_bc_ops;
cs->BC_Send_Data = &ipacx_fill_fifo;
cs->irq_func = &diva_irq_ipacx_pci;
printk(KERN_INFO "Diva: IPACX Design Id: %x\n",
......
......@@ -248,6 +248,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.elsa.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
static inline u_char
readitac(struct IsdnCardState *cs, u_char off)
{
......@@ -1159,8 +1164,7 @@ setup_elsa(struct IsdnCard *card)
}
printk(KERN_INFO "Elsa: timer OK; resetting card\n");
}
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Elsa_card_msg;
reset_elsa(cs);
......
......@@ -240,6 +240,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
}
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -680,8 +685,7 @@ setup_gazel(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Gazel_card_msg;
......
......@@ -64,6 +64,11 @@ WriteReg(struct IsdnCardState *cs, int data, u_char reg, u_char value)
#endif
}
static struct bc_hw_ops hfcs_ops = {
.read_reg = ReadReg,
.write_reg = WriteReg,
};
/* Interface functions */
static u_char
......@@ -85,8 +90,7 @@ set_cs_func(struct IsdnCardState *cs)
cs->writeisac = &writereghfcd;
cs->readisacfifo = &dummyf;
cs->writeisacfifo = &dummyf;
cs->BC_Read_Reg = &ReadReg;
cs->BC_Write_Reg = &WriteReg;
cs->bc_hw_ops = &hfcs_ops;
}
static inline int
......
......@@ -20,13 +20,13 @@
static inline u8
hfc_read_reg(struct IsdnCardState *cs, int data, u8 reg)
{
return cs->BC_Read_Reg(cs, data, reg);
return cs->bc_hw_ops->read_reg(cs, data, reg);
}
static inline void
hfc_write_reg(struct IsdnCardState *cs, int data, u8 reg, u8 val)
{
cs->BC_Write_Reg(cs, data, reg, val);
cs->bc_hw_ops->write_reg(cs, data, reg, val);
}
static inline int
......
......@@ -23,13 +23,13 @@ static const char *hfcs_revision = "$Revision: 1.8.6.2 $";
static inline u8
hfcs_read_reg(struct IsdnCardState *cs, int data, u8 reg)
{
return cs->BC_Read_Reg(cs, data, reg);
return cs->bc_hw_ops->read_reg(cs, data, reg);
}
static inline void
hfcs_write_reg(struct IsdnCardState *cs, int data, u8 reg, u8 val)
{
cs->BC_Write_Reg(cs, data, reg, val);
cs->bc_hw_ops->write_reg(cs, data, reg, val);
}
static void
......
......@@ -348,6 +348,13 @@ struct l3_process {
} prot;
};
struct IsdnCardState;
struct bc_hw_ops {
u8 (*read_reg) (struct IsdnCardState *, int, u8);
void (*write_reg) (struct IsdnCardState *, int, u8, u8);
};
struct hscx_hw {
int hscx;
int rcvidx;
......@@ -919,8 +926,7 @@ struct IsdnCardState {
void (*writeisac) (struct IsdnCardState *, u_char, u_char);
void (*readisacfifo) (struct IsdnCardState *, u_char *, int);
void (*writeisacfifo) (struct IsdnCardState *, u_char *, int);
u_char (*BC_Read_Reg) (struct IsdnCardState *, int, u_char);
void (*BC_Write_Reg) (struct IsdnCardState *, int, u_char, u_char);
struct bc_hw_ops *bc_hw_ops;
void (*BC_Send_Data) (struct BCState *);
int (*cardmsg) (struct IsdnCardState *, int, void *);
void (*setstack_d) (struct PStack *, struct IsdnCardState *);
......
......@@ -27,7 +27,7 @@ hscx_read_reg(struct BCState *bcs, u8 addr)
struct IsdnCardState *cs = bcs->cs;
u8 hscx = bcs->hw.hscx.hscx;
return cs->BC_Read_Reg(cs, hscx, addr);
return cs->bc_hw_ops->read_reg(cs, hscx, addr);
}
static inline void
......@@ -36,7 +36,7 @@ hscx_write_reg(struct BCState *bcs, u8 addr, u8 val)
struct IsdnCardState *cs = bcs->cs;
u8 hscx = bcs->hw.hscx.hscx;
cs->BC_Write_Reg(cs, hscx, addr, val);
cs->bc_hw_ops->write_reg(cs, hscx, addr, val);
}
int __init
......@@ -44,8 +44,8 @@ HscxVersion(struct IsdnCardState *cs, char *s)
{
int verA, verB;
verA = cs->BC_Read_Reg(cs, 0, HSCX_VSTR) & 0xf;
verB = cs->BC_Read_Reg(cs, 1, HSCX_VSTR) & 0xf;
verA = cs->bc_hw_ops->read_reg(cs, 0, HSCX_VSTR) & 0xf;
verB = cs->bc_hw_ops->read_reg(cs, 1, HSCX_VSTR) & 0xf;
printk(KERN_INFO "%s HSCX version A: %s B: %s\n", s,
HSCXVer[verA], HSCXVer[verB]);
if ((verA == 0) | (verA == 0xf) | (verB == 0) | (verB == 0xf))
......
......@@ -59,7 +59,7 @@ ipacx_bc_read_reg(struct BCState *bcs, u8 addr)
struct IsdnCardState *cs = bcs->cs;
u8 hscx = bcs->hw.hscx.hscx;
return cs->BC_Read_Reg(cs, hscx, addr);
return cs->bc_hw_ops->read_reg(cs, hscx, addr);
}
static inline void
......@@ -68,7 +68,7 @@ ipacx_bc_write_reg(struct BCState *bcs, u8 addr, u8 val)
struct IsdnCardState *cs = bcs->cs;
u8 hscx = bcs->hw.hscx.hscx;
cs->BC_Write_Reg(cs, hscx, addr, val);
cs->bc_hw_ops->write_reg(cs, hscx, addr, val);
}
//----------------------------------------------------------
......@@ -787,12 +787,12 @@ clear_pending_ints(struct IsdnCardState *cs)
// all interrupts off
cs->writeisac(cs, IPACX_MASK, 0xff);
cs->writeisac(cs, IPACX_MASKD, 0xff);
cs->BC_Write_Reg(cs, 0, IPACX_MASKB, 0xff);
cs->BC_Write_Reg(cs, 1, IPACX_MASKB, 0xff);
cs->bc_hw_ops->write_reg(cs, 0, IPACX_MASKB, 0xff);
cs->bc_hw_ops->write_reg(cs, 1, IPACX_MASKB, 0xff);
ista = cs->readisac(cs, IPACX_ISTA);
if (ista &0x80) cs->BC_Read_Reg(cs, 0, IPACX_ISTAB);
if (ista &0x40) cs->BC_Read_Reg(cs, 1, IPACX_ISTAB);
if (ista &0x80) cs->bc_hw_ops->read_reg(cs, 0, IPACX_ISTAB);
if (ista &0x40) cs->bc_hw_ops->read_reg(cs, 1, IPACX_ISTAB);
if (ista &0x10) cs->readisac(cs, IPACX_CIR0);
if (ista &0x01) cs->readisac(cs, IPACX_ISTAD);
}
......@@ -811,15 +811,15 @@ init_ipacx(struct IsdnCardState *cs, int part)
dch_init(cs);
}
if (part &2) { // reenable all interrupts and start chip
cs->BC_Write_Reg(cs, 0, IPACX_MASKB, _MASKB_IMASK);
cs->BC_Write_Reg(cs, 1, IPACX_MASKB, _MASKB_IMASK);
cs->bc_hw_ops->write_reg(cs, 0, IPACX_MASKB, _MASKB_IMASK);
cs->bc_hw_ops->write_reg(cs, 1, IPACX_MASKB, _MASKB_IMASK);
cs->writeisac(cs, IPACX_MASKD, _MASKD_IMASK);
cs->writeisac(cs, IPACX_MASK, _MASK_IMASK); // global mask register
// reset HDLC Transmitters/receivers
cs->writeisac(cs, IPACX_CMDRD, 0x41);
cs->BC_Write_Reg(cs, 0, IPACX_CMDRB, 0x41);
cs->BC_Write_Reg(cs, 1, IPACX_CMDRB, 0x41);
cs->bc_hw_ops->write_reg(cs, 0, IPACX_CMDRB, 0x41);
cs->bc_hw_ops->write_reg(cs, 1, IPACX_CMDRB, 0x41);
ph_command(cs, IPACX_CMD_RES);
}
}
......
......@@ -33,13 +33,13 @@ static spinlock_t isar_lock = SPIN_LOCK_UNLOCKED;
static inline u8
isar_read_reg(struct IsdnCardState *cs, int mode, u8 addr)
{
return cs->BC_Read_Reg(cs, mode, addr);
return cs->bc_hw_ops->read_reg(cs, mode, addr);
}
static inline void
isar_write_reg(struct IsdnCardState *cs, int mode, u8 addr, u8 val)
{
cs->BC_Write_Reg(cs, mode, addr, val);
cs->bc_hw_ops->write_reg(cs, mode, addr, val);
}
static inline int
......
......@@ -82,6 +82,11 @@ WriteISAR(struct IsdnCardState *cs, int mode, u_char offset, u_char value)
writeb(value, cs->hw.isurf.isar + offset);mb();
}
static struct bc_hw_ops isar_ops = {
.read_reg = ReadISAR,
.write_reg = WriteISAR,
};
static void
isurf_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
......@@ -282,8 +287,7 @@ setup_isurf(struct IsdnCard *card)
reset_isurf(cs, ISURF_RESET);
test_and_set_bit(HW_ISAR, &cs->HW_Flags);
ISACVersion(cs, "ISurf:");
cs->BC_Read_Reg = &ReadISAR;
cs->BC_Write_Reg = &WriteISAR;
cs->bc_hw_ops = &isar_ops;
cs->BC_Send_Data = &isar_fill_fifo;
ver = ISARVersion(cs, "ISurf:");
if (ver < 0) {
......
......@@ -122,6 +122,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.ix1.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
#define READHSCX(cs, nr, reg) readreg(cs->hw.ix1.hscx_ale, \
cs->hw.ix1.hscx, reg + (nr ? 0x40 : 0))
#define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.ix1.hscx_ale, \
......@@ -304,8 +309,7 @@ setup_ix1micro(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &ix1_card_msg;
cs->irq_func = &ix1micro_interrupt;
......
......@@ -23,13 +23,13 @@ static spinlock_t jade_lock = SPIN_LOCK_UNLOCKED;
static inline u8
jade_read_reg(struct IsdnCardState *cs, int jade, u8 addr)
{
return cs->BC_Read_Reg(cs, jade, addr);
return cs->bc_hw_ops->read_reg(cs, jade, addr);
}
static inline void
jade_write_reg(struct IsdnCardState *cs, int jade, u8 addr, u8 val)
{
cs->BC_Write_Reg(cs, jade, addr, val);
cs->bc_hw_ops->write_reg(cs, jade, addr, val);
}
int __init
......
......@@ -114,6 +114,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.mic.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -232,8 +237,7 @@ setup_mic(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &mic_card_msg;
cs->irq_func = &mic_interrupt;
......
......@@ -129,6 +129,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.niccy.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
#define READHSCX(cs, nr, reg) readreg(cs->hw.niccy.hscx_ale, \
cs->hw.niccy.hscx, reg + (nr ? 0x40 : 0))
#define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.niccy.hscx_ale, \
......@@ -376,8 +381,7 @@ setup_niccy(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &niccy_card_msg;
cs->irq_func = &niccy_interrupt;
......
......@@ -137,6 +137,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
writereg(cs->hw.teles3.cfg_reg, cs->hw.teles3.hscx[hscx], offset, value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -252,8 +257,7 @@ setup_s0box(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &S0Box_card_msg;
cs->irq_func = &s0box_interrupt;
......
......@@ -114,6 +114,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
#define READHSCX(cs, nr, reg) readreg(cs->hw.saphir.ale, \
cs->hw.saphir.hscx, reg + (nr ? 0x40 : 0))
#define WRITEHSCX(cs, nr, reg, data) writereg(cs->hw.saphir.ale, \
......@@ -287,8 +292,7 @@ setup_saphir(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &saphir_card_msg;
cs->irq_func = &saphir_interrupt;
......
......@@ -224,6 +224,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
cs->hw.sedl.hscx, offset + (hscx ? 0x40 : 0), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/* ISAR access routines
* mode = 0 access with IRQ on
* mode = 1 access with IRQ off
......@@ -252,6 +257,11 @@ WriteISAR(struct IsdnCardState *cs, int mode, u_char offset, u_char value)
}
}
static struct bc_hw_ops isar_ops = {
.read_reg = ReadISAR,
.write_reg = WriteISAR,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -695,8 +705,7 @@ setup_sedlbauer(struct IsdnCard *card)
cs->hw.sedl.cfg_reg + bytecnt,
cs->irq);
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Sedl_card_msg;
......@@ -783,8 +792,7 @@ setup_sedlbauer(struct IsdnCard *card)
cs->irq_func = &sedlbauer_interrupt_isar;
cs->auxcmd = &isar_auxcmd;
ISACVersion(cs, "Sedlbauer:");
cs->BC_Read_Reg = &ReadISAR;
cs->BC_Write_Reg = &WriteISAR;
cs->bc_hw_ops = &isar_ops;
cs->BC_Send_Data = &isar_fill_fifo;
ver = ISARVersion(cs, "Sedlbauer:");
if (ver < 0) {
......
......@@ -87,6 +87,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
byteout(calc_off(cs->hw.spt.hscx[hscx], offset), value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -250,8 +255,7 @@ setup_sportster(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Sportster_card_msg;
cs->irq_func = &sportster_interrupt;
......
......@@ -166,6 +166,11 @@ WriteHFC(struct IsdnCardState *cs, int data, u_char reg, u_char value)
debugl1(cs, "hfc W%c %02x %02x", data ? 'D' : 'C', reg, value);
}
static struct bc_hw_ops hfc_ops = {
.read_reg = ReadHFC,
.write_reg = WriteHFC,
};
static void
TeleInt_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
......@@ -323,8 +328,7 @@ setup_TeleInt(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHFC;
cs->BC_Write_Reg = &WriteHFC;
cs->bc_hw_ops = &hfc_ops;
cs->cardmsg = &TeleInt_card_msg;
cs->irq_func = &TeleInt_interrupt;
ISACVersion(cs, "TeleInt:");
......
......@@ -132,6 +132,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
writehscx(cs->hw.teles0.membase, hscx, offset, value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -348,8 +353,7 @@ setup_teles0(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Teles_card_msg;
cs->irq_func = &teles0_interrupt;
......
......@@ -89,6 +89,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
writereg(cs->hw.teles3.hscx[hscx], offset, value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -470,8 +475,7 @@ setup_teles3(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &Teles_card_msg;
cs->irq_func = &teles3_interrupt;
......
......@@ -215,6 +215,11 @@ WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
writehscx(cs->hw.teles0.membase, hscx, offset, value);
}
static struct bc_hw_ops hscx_ops = {
.read_reg = ReadHSCX,
.write_reg = WriteHSCX,
};
/*
* fast interrupt HSCX stuff goes here
*/
......@@ -336,8 +341,7 @@ setup_telespci(struct IsdnCard *card)
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->bc_hw_ops = &hscx_ops;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &TelesPCI_card_msg;
cs->irq_func = &telespci_interrupt;
......
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