19 #include <linux/slab.h>
21 static char *HSCXVer[] =
22 {
"A1",
"?1",
"A2",
"?3",
"A3",
"V2.1",
"?6",
"?7",
23 "?8",
"?9",
"?10",
"?11",
"?12",
"?13",
"?14",
"???"};
30 verA = cs->BC_Read_Reg(cs, 0,
HSCX_VSTR) & 0xf;
31 verB = cs->BC_Read_Reg(cs, 1,
HSCX_VSTR) & 0xf;
33 HSCXVer[verA], HSCXVer[verB]);
34 if ((verA == 0) | (verA == 0xf) | (verB == 0) | (verB == 0xf))
43 struct IsdnCardState *
cs = bcs->cs;
44 int hscx = bcs->hw.hscx.hscx;
46 if (cs->debug & L1_DEB_HSCX)
47 debugl1(cs,
"hscx %c mode %d ichan %d",
48 'A' + hscx, mode, bc);
51 cs->BC_Write_Reg(cs, hscx,
HSCX_XAD1, 0xFF);
52 cs->BC_Write_Reg(cs, hscx,
HSCX_XAD2, 0xFF);
53 cs->BC_Write_Reg(cs, hscx,
HSCX_RAH2, 0xFF);
54 cs->BC_Write_Reg(cs, hscx,
HSCX_XBCH, 0x0);
55 cs->BC_Write_Reg(cs, hscx,
HSCX_RLCR, 0x0);
57 test_bit(HW_IPAC, &cs->HW_Flags) ? 0x82 : 0x85);
58 cs->BC_Write_Reg(cs, hscx,
HSCX_CCR2, 0x30);
63 if (
test_bit(HW_IOM1, &cs->HW_Flags) && (hscx == 0))
68 test_bit(HW_IOM1, &cs->HW_Flags) ? 0x7 : bcs->hw.hscx.tsaxr0);
70 test_bit(HW_IOM1, &cs->HW_Flags) ? 0x7 : bcs->hw.hscx.tsaxr0);
72 cs->BC_Write_Reg(cs, hscx,
HSCX_TSAX, bcs->hw.hscx.tsaxr1);
73 cs->BC_Write_Reg(cs, hscx,
HSCX_TSAR, bcs->hw.hscx.tsaxr1);
77 cs->BC_Write_Reg(cs, hscx,
HSCX_TSAX, 0x1f);
78 cs->BC_Write_Reg(cs, hscx,
HSCX_TSAR, 0x1f);
79 cs->BC_Write_Reg(cs, hscx,
HSCX_MODE, 0x84);
82 cs->BC_Write_Reg(cs, hscx,
HSCX_MODE, 0xe4);
86 test_bit(HW_IPAC, &cs->HW_Flags) ? 0x8a : 0x8d);
87 cs->BC_Write_Reg(cs, hscx,
HSCX_MODE, 0x8c);
91 cs->BC_Write_Reg(cs, hscx,
HSCX_CMDR, 0x41);
92 cs->BC_Write_Reg(cs, hscx,
HSCX_ISTA, 0x00);
98 struct BCState *bcs = st->l1.bcs;
110 bcs->hw.hscx.count = 0;
111 bcs->cs->BC_Send_Data(bcs);
113 spin_unlock_irqrestore(&bcs->cs->lock, flags);
122 bcs->hw.hscx.count = 0;
123 bcs->cs->BC_Send_Data(bcs);
125 spin_unlock_irqrestore(&bcs->cs->lock, flags);
137 modehscx(bcs, st->l1.mode, st->l1.bc);
138 spin_unlock_irqrestore(&bcs->cs->lock, flags);
149 spin_unlock_irqrestore(&bcs->cs->lock, flags);
156 close_hscxstate(
struct BCState *bcs)
160 kfree(bcs->hw.hscx.rcvbuf);
161 bcs->hw.hscx.rcvbuf =
NULL;
180 "HiSax: No memory for hscx.rcvbuf\n");
186 "HiSax: No memory for bcs->blog\n");
188 kfree(bcs->hw.hscx.rcvbuf);
189 bcs->hw.hscx.rcvbuf =
NULL;
192 skb_queue_head_init(&bcs->rqueue);
193 skb_queue_head_init(&bcs->squeue);
198 bcs->hw.hscx.rcvidx = 0;
204 setstack_hscx(
struct PStack *
st,
struct BCState *bcs)
206 bcs->channel = st->l1.bc;
223 debugl1(cs,
"HSCX B ISTA %x", val);
225 eval = cs->BC_Read_Reg(cs, 1,
HSCX_EXIR);
226 debugl1(cs,
"HSCX B EXIR %x", eval);
229 eval = cs->BC_Read_Reg(cs, 0,
HSCX_EXIR);
230 debugl1(cs,
"HSCX A EXIR %x", eval);
233 debugl1(cs,
"HSCX A ISTA %x", val);
235 debugl1(cs,
"HSCX B STAR %x", val);
237 debugl1(cs,
"HSCX A STAR %x", val);
239 cs->BC_Write_Reg(cs, 0,
HSCX_MASK, 0xFF);
240 cs->BC_Write_Reg(cs, 1,
HSCX_MASK, 0xFF);
246 cs->bcs[0].BC_SetStack = setstack_hscx;
247 cs->bcs[1].BC_SetStack = setstack_hscx;
248 cs->bcs[0].BC_Close = close_hscxstate;
249 cs->bcs[1].BC_Close = close_hscxstate;
250 cs->bcs[0].hw.hscx.hscx = 0;
251 cs->bcs[1].hw.hscx.hscx = 1;
252 cs->bcs[0].hw.hscx.tsaxr0 = 0x2f;
253 cs->bcs[0].hw.hscx.tsaxr1 = 3;
254 cs->bcs[1].hw.hscx.tsaxr0 = 0x2f;
255 cs->bcs[1].hw.hscx.tsaxr1 = 3;