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