20 #include <linux/slab.h>
28 cs->BC_Write_Reg(cs, -1, 0x50, 0x19);
31 ver = cs->BC_Read_Reg(cs, -1, 0x60);
43 ver = cs->BC_Read_Reg(cs, -1, 0x60);
56 cs->BC_Write_Reg(cs, -1,
COMM_JADE + 1, value);
69 printk(
KERN_INFO "Can not see ready bit from JADE DSP (reg=0x%X, value=0x%X)\n", reg, value);
78 modejade(
struct BCState *bcs,
int mode,
int bc)
80 struct IsdnCardState *cs = bcs->cs;
81 int jade = bcs->hw.hscx.hscx;
83 if (cs->debug & L1_DEB_HSCX) {
85 sprintf(tmp,
"jade %c mode %d ichan %d",
86 'A' + jade, mode, bc);
134 jade_l2l1(
struct PStack *
st,
int pr,
void *
arg)
136 struct BCState *bcs = st->l1.bcs;
148 bcs->hw.hscx.count = 0;
149 bcs->cs->BC_Send_Data(bcs);
151 spin_unlock_irqrestore(&bcs->cs->lock, flags);
160 bcs->hw.hscx.count = 0;
161 bcs->cs->BC_Send_Data(bcs);
163 spin_unlock_irqrestore(&bcs->cs->lock, flags);
175 modejade(bcs, st->l1.mode, st->l1.bc);
176 spin_unlock_irqrestore(&bcs->cs->lock, flags);
186 modejade(bcs, 0, st->l1.bc);
187 spin_unlock_irqrestore(&bcs->cs->lock, flags);
194 close_jadestate(
struct BCState *bcs)
196 modejade(bcs, 0, bcs->channel);
198 kfree(bcs->hw.hscx.rcvbuf);
199 bcs->hw.hscx.rcvbuf =
NULL;
213 open_jadestate(
struct IsdnCardState *cs,
struct BCState *bcs)
218 "HiSax: No memory for hscx.rcvbuf\n");
224 "HiSax: No memory for bcs->blog\n");
226 kfree(bcs->hw.hscx.rcvbuf);
227 bcs->hw.hscx.rcvbuf =
NULL;
230 skb_queue_head_init(&bcs->rqueue);
231 skb_queue_head_init(&bcs->squeue);
236 bcs->hw.hscx.rcvidx = 0;
243 setstack_jade(
struct PStack *st,
struct BCState *bcs)
245 bcs->channel = st->l1.bc;
246 if (open_jadestate(st->l1.hardware, bcs))
249 st->l2.l2l1 = jade_l2l1;
266 sprintf(tmp,
"jade B ISTA %x", val);
269 sprintf(tmp,
"jade A ISTA %x", val);
272 sprintf(tmp,
"jade B STAR %x", val);
275 sprintf(tmp,
"jade A STAR %x", val);
285 cs->bcs[0].BC_SetStack = setstack_jade;
286 cs->bcs[1].BC_SetStack = setstack_jade;
287 cs->bcs[0].BC_Close = close_jadestate;
288 cs->bcs[1].BC_Close = close_jadestate;
289 cs->bcs[0].hw.hscx.hscx = 0;
290 cs->bcs[1].hw.hscx.hscx = 1;
293 jade_write_indirect(cs, 0x11, 0x0f);
294 jade_write_indirect(cs, 0x17, 0x2f);
311 modejade(cs->bcs, 0, 0);
312 modejade(cs->bcs + 1, 0, 0);