Lines Matching refs:bcs
83 modejade(struct BCState *bcs, int mode, int bc) in modejade() argument
85 struct IsdnCardState *cs = bcs->cs; in modejade()
86 int jade = bcs->hw.hscx.hscx; in modejade()
94 bcs->mode = mode; in modejade()
95 bcs->channel = bc; in modejade()
139 jade_sched_event(struct BCState *bcs, int event) in jade_sched_event() argument
141 bcs->event |= 1 << event; in jade_sched_event()
142 queue_task(&bcs->tqueue, &tq_immediate); in jade_sched_event()
156 if (st->l1.bcs->tx_skb) { in jade_l2l1()
157 skb_queue_tail(&st->l1.bcs->squeue, skb); in jade_l2l1()
160 st->l1.bcs->tx_skb = skb; in jade_l2l1()
161 test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); in jade_l2l1()
162 st->l1.bcs->hw.hscx.count = 0; in jade_l2l1()
164 st->l1.bcs->cs->BC_Send_Data(st->l1.bcs); in jade_l2l1()
168 if (st->l1.bcs->tx_skb) { in jade_l2l1()
172 test_and_set_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); in jade_l2l1()
173 st->l1.bcs->tx_skb = skb; in jade_l2l1()
174 st->l1.bcs->hw.hscx.count = 0; in jade_l2l1()
175 st->l1.bcs->cs->BC_Send_Data(st->l1.bcs); in jade_l2l1()
178 if (!st->l1.bcs->tx_skb) { in jade_l2l1()
185 test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); in jade_l2l1()
186 modejade(st->l1.bcs, st->l1.mode, st->l1.bc); in jade_l2l1()
193 test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); in jade_l2l1()
194 test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); in jade_l2l1()
195 modejade(st->l1.bcs, 0, st->l1.bc); in jade_l2l1()
202 close_jadestate(struct BCState *bcs) in close_jadestate() argument
204 modejade(bcs, 0, bcs->channel); in close_jadestate()
205 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { in close_jadestate()
206 if (bcs->hw.hscx.rcvbuf) { in close_jadestate()
207 kfree(bcs->hw.hscx.rcvbuf); in close_jadestate()
208 bcs->hw.hscx.rcvbuf = NULL; in close_jadestate()
210 if (bcs->blog) { in close_jadestate()
211 kfree(bcs->blog); in close_jadestate()
212 bcs->blog = NULL; in close_jadestate()
214 skb_queue_purge(&bcs->rqueue); in close_jadestate()
215 skb_queue_purge(&bcs->squeue); in close_jadestate()
216 if (bcs->tx_skb) { in close_jadestate()
217 dev_kfree_skb_any(bcs->tx_skb); in close_jadestate()
218 bcs->tx_skb = NULL; in close_jadestate()
219 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in close_jadestate()
225 open_jadestate(struct IsdnCardState *cs, struct BCState *bcs) in open_jadestate() argument
227 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { in open_jadestate()
228 if (!(bcs->hw.hscx.rcvbuf = kmalloc(HSCX_BUFMAX, GFP_ATOMIC))) { in open_jadestate()
231 test_and_clear_bit(BC_FLG_INIT, &bcs->Flag); in open_jadestate()
234 if (!(bcs->blog = kmalloc(MAX_BLOG_SPACE, GFP_ATOMIC))) { in open_jadestate()
237 test_and_clear_bit(BC_FLG_INIT, &bcs->Flag); in open_jadestate()
238 kfree(bcs->hw.hscx.rcvbuf); in open_jadestate()
239 bcs->hw.hscx.rcvbuf = NULL; in open_jadestate()
242 skb_queue_head_init(&bcs->rqueue); in open_jadestate()
243 skb_queue_head_init(&bcs->squeue); in open_jadestate()
245 bcs->tx_skb = NULL; in open_jadestate()
246 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in open_jadestate()
247 bcs->event = 0; in open_jadestate()
248 bcs->hw.hscx.rcvidx = 0; in open_jadestate()
249 bcs->tx_cnt = 0; in open_jadestate()
255 setstack_jade(struct PStack *st, struct BCState *bcs) in setstack_jade() argument
257 bcs->channel = st->l1.bc; in setstack_jade()
258 if (open_jadestate(st->l1.hardware, bcs)) in setstack_jade()
260 st->l1.bcs = bcs; in setstack_jade()
263 bcs->st = st; in setstack_jade()
297 cs->bcs[0].BC_SetStack = setstack_jade; in initjade()
298 cs->bcs[1].BC_SetStack = setstack_jade; in initjade()
299 cs->bcs[0].BC_Close = close_jadestate; in initjade()
300 cs->bcs[1].BC_Close = close_jadestate; in initjade()
301 cs->bcs[0].hw.hscx.hscx = 0; in initjade()
302 cs->bcs[1].hw.hscx.hscx = 1; in initjade()
323 modejade(cs->bcs, 0, 0); in initjade()
324 modejade(cs->bcs + 1, 0, 0); in initjade()