Commit ce740771 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Un-virtualize D-channel access in hfc_2bds0.c

The D-channel access functions are only used in hfc_2bds0.c itself,
so no need to go through function pointers.
parent f0cfbae6
......@@ -23,12 +23,6 @@
#define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr)
static void
dummyf(struct IsdnCardState *cs, u_char * data, int size)
{
printk(KERN_WARNING "HiSax: hfcd dummy fifo called\n");
}
static inline u_char
ReadReg(struct IsdnCardState *cs, int data, u_char reg)
{
......@@ -64,21 +58,21 @@ WriteReg(struct IsdnCardState *cs, int data, u_char reg, u_char value)
#endif
}
static struct bc_hw_ops hfcs_ops = {
static struct bc_hw_ops hfcs_bc_ops = {
.read_reg = ReadReg,
.write_reg = WriteReg,
};
/* Interface functions */
static u_char
readreghfcd(struct IsdnCardState *cs, u_char offset)
static inline u8
hfcs_read_reg(struct IsdnCardState *cs, u8 offset)
{
return(ReadReg(cs, HFCD_DATA, offset));
return ReadReg(cs, HFCD_DATA, offset);
}
static void
writereghfcd(struct IsdnCardState *cs, u_char offset, u_char value)
static inline void
hfcs_write_reg(struct IsdnCardState *cs, u8 offset, u8 value)
{
WriteReg(cs, HFCD_DATA, offset, value);
}
......@@ -86,11 +80,7 @@ writereghfcd(struct IsdnCardState *cs, u_char offset, u_char value)
void
set_cs_func(struct IsdnCardState *cs)
{
cs->readisac = &readreghfcd;
cs->writeisac = &writereghfcd;
cs->readisacfifo = &dummyf;
cs->writeisacfifo = &dummyf;
cs->bc_hw_ops = &hfcs_ops;
cs->bc_hw_ops = &hfcs_bc_ops;
}
static inline int
......@@ -560,10 +550,10 @@ int receive_dmsg(struct IsdnCardState *cs)
SelFiFo(cs, 4 | HFCD_REC);
cip = HFCD_FIFO | HFCD_F1 | HFCD_REC;
WaitNoBusy(cs);
f1 = cs->readisac(cs, cip) & 0xf;
f1 = hfcs_read_reg(cs, cip) & 0xf;
cip = HFCD_FIFO | HFCD_F2 | HFCD_REC;
WaitNoBusy(cs);
f2 = cs->readisac(cs, cip) & 0xf;
f2 = hfcs_read_reg(cs, cip) & 0xf;
while ((f1 != f2) && count--) {
z1 = ReadZReg(cs, HFCD_FIFO | HFCD_Z1 | HFCD_REC);
z2 = ReadZReg(cs, HFCD_FIFO | HFCD_Z2 | HFCD_REC);
......@@ -638,7 +628,7 @@ int receive_dmsg(struct IsdnCardState *cs)
WaitForBusy(cs);
cip = HFCD_FIFO | HFCD_F2 | HFCD_REC;
WaitNoBusy(cs);
f2 = cs->readisac(cs, cip) & 0xf;
f2 = hfcs_read_reg(cs, cip) & 0xf;
}
return(1);
}
......@@ -731,7 +721,7 @@ hfc2bds0_interrupt(struct IsdnCardState *cs, u_char val)
val &= cs->hw.hfcD.int_m1;
if (val & 0x40) { /* TE state machine irq */
exval = cs->readisac(cs, HFCD_STATES) & 0xf;
exval = hfcs_read_reg(cs, HFCD_STATES) & 0xf;
if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "ph_state chg %d->%d", cs->dc.hfcd.ph_state,
exval);
......@@ -808,24 +798,24 @@ HFCD_l1hw(struct PStack *st, int pr, void *arg)
xmit_pull_req_d(st);
break;
case (HW_RESET | REQUEST):
cs->writeisac(cs, HFCD_STATES, HFCD_LOAD_STATE | 3); /* HFC ST 3 */
hfcs_write_reg(cs, HFCD_STATES, HFCD_LOAD_STATE | 3); /* HFC ST 3 */
udelay(6);
cs->writeisac(cs, HFCD_STATES, 3); /* HFC ST 2 */
hfcs_write_reg(cs, HFCD_STATES, 3); /* HFC ST 2 */
cs->hw.hfcD.mst_m |= HFCD_MASTER;
cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
cs->writeisac(cs, HFCD_STATES, HFCD_ACTIVATE | HFCD_DO_ACTION);
hfcs_write_reg(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
hfcs_write_reg(cs, HFCD_STATES, HFCD_ACTIVATE | HFCD_DO_ACTION);
l1_msg(cs, HW_POWERUP | CONFIRM, NULL);
break;
case (HW_ENABLE | REQUEST):
cs->writeisac(cs, HFCD_STATES, HFCD_ACTIVATE | HFCD_DO_ACTION);
hfcs_write_reg(cs, HFCD_STATES, HFCD_ACTIVATE | HFCD_DO_ACTION);
break;
case (HW_DEACTIVATE | REQUEST):
cs->hw.hfcD.mst_m &= ~HFCD_MASTER;
cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
hfcs_write_reg(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
break;
case (HW_INFO3 | REQUEST):
cs->hw.hfcD.mst_m |= HFCD_MASTER;
cs->writeisac(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
hfcs_write_reg(cs, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
break;
default:
if (cs->debug & L1_DEB_WARN)
......
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