Lines Matching refs:bcs
476 hfcsx_sched_event(struct BCState *bcs, int event) in hfcsx_sched_event() argument
478 bcs->event |= 1 << event; in hfcsx_sched_event()
479 queue_task(&bcs->tqueue, &tq_immediate); in hfcsx_sched_event()
490 if (cs->bcs[0].mode && (cs->bcs[0].channel == channel)) in Sel_BCS()
491 return (&cs->bcs[0]); in Sel_BCS()
492 else if (cs->bcs[1].mode && (cs->bcs[1].channel == channel)) in Sel_BCS()
493 return (&cs->bcs[1]); in Sel_BCS()
529 main_rec_hfcsx(struct BCState *bcs) in main_rec_hfcsx() argument
532 struct IsdnCardState *cs = bcs->cs; in main_rec_hfcsx()
542 debugl1(cs, "rec_data %d blocked", bcs->channel); in main_rec_hfcsx()
547 skb = read_fifo(cs, ((bcs->channel) && (!cs->hw.hfcsx.bswapped)) ? in main_rec_hfcsx()
549 (bcs->mode == L1_MODE_TRANS) ? in main_rec_hfcsx()
554 skb_queue_tail(&bcs->rqueue, skb); in main_rec_hfcsx()
556 hfcsx_sched_event(bcs, B_RCVBUFREADY); in main_rec_hfcsx()
588 hfcsx_fill_fifo(struct BCState *bcs) in hfcsx_fill_fifo() argument
590 struct IsdnCardState *cs = bcs->cs; in hfcsx_fill_fifo()
593 if (!bcs->tx_skb) in hfcsx_fill_fifo()
595 if (bcs->tx_skb->len <= 0) in hfcsx_fill_fifo()
601 if (write_fifo(cs, bcs->tx_skb, in hfcsx_fill_fifo()
602 ((bcs->channel) && (!cs->hw.hfcsx.bswapped)) ? in hfcsx_fill_fifo()
604 (bcs->mode == L1_MODE_TRANS) ? in hfcsx_fill_fifo()
607 bcs->tx_cnt -= bcs->tx_skb->len; in hfcsx_fill_fifo()
608 if (bcs->st->lli.l1writewakeup && in hfcsx_fill_fifo()
609 (PACKET_NOACK != bcs->tx_skb->pkt_type)) in hfcsx_fill_fifo()
610 bcs->st->lli.l1writewakeup(bcs->st, bcs->tx_skb->len); in hfcsx_fill_fifo()
611 dev_kfree_skb_any(bcs->tx_skb); in hfcsx_fill_fifo()
612 bcs->tx_skb = NULL; in hfcsx_fill_fifo()
613 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in hfcsx_fill_fifo()
773 struct BCState *bcs; in hfcsx_interrupt() local
828 if (!(bcs = Sel_BCS(cs, cs->hw.hfcsx.bswapped ? 1 : 0))) { in hfcsx_interrupt()
832 main_rec_hfcsx(bcs); in hfcsx_interrupt()
837 else if (!(bcs = Sel_BCS(cs, 1))) { in hfcsx_interrupt()
841 main_rec_hfcsx(bcs); in hfcsx_interrupt()
844 if (!(bcs = Sel_BCS(cs, cs->hw.hfcsx.bswapped ? 1 : 0))) { in hfcsx_interrupt()
848 if (bcs->tx_skb) { in hfcsx_interrupt()
850 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
853 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
855 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in hfcsx_interrupt()
857 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
860 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
862 hfcsx_sched_event(bcs, B_XMTBUFREADY); in hfcsx_interrupt()
868 if (!(bcs = Sel_BCS(cs, 1))) { in hfcsx_interrupt()
872 if (bcs->tx_skb) { in hfcsx_interrupt()
874 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
877 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
879 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in hfcsx_interrupt()
881 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
884 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
886 hfcsx_sched_event(bcs, B_XMTBUFREADY); in hfcsx_interrupt()
1089 hfcsx_send_data(struct BCState *bcs) in hfcsx_send_data() argument
1091 struct IsdnCardState *cs = bcs->cs; in hfcsx_send_data()
1094 hfcsx_fill_fifo(bcs); in hfcsx_send_data()
1097 debugl1(cs, "send_data %d blocked", bcs->channel); in hfcsx_send_data()
1104 mode_hfcsx(struct BCState *bcs, int mode, int bc) in mode_hfcsx() argument
1106 struct IsdnCardState *cs = bcs->cs; in mode_hfcsx()
1112 mode, bc, bcs->channel); in mode_hfcsx()
1113 bcs->mode = mode; in mode_hfcsx()
1114 bcs->channel = bc; in mode_hfcsx()
1227 if (st->l1.bcs->tx_skb) { in hfcsx_l2l1()
1228 skb_queue_tail(&st->l1.bcs->squeue, skb); in hfcsx_l2l1()
1231 st->l1.bcs->tx_skb = skb; in hfcsx_l2l1()
1233 */ st->l1.bcs->cs->BC_Send_Data(st->l1.bcs); in hfcsx_l2l1()
1238 if (st->l1.bcs->tx_skb) { in hfcsx_l2l1()
1245 */ st->l1.bcs->tx_skb = skb; in hfcsx_l2l1()
1246 st->l1.bcs->cs->BC_Send_Data(st->l1.bcs); in hfcsx_l2l1()
1250 if (!st->l1.bcs->tx_skb) { in hfcsx_l2l1()
1257 test_and_set_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); in hfcsx_l2l1()
1258 mode_hfcsx(st->l1.bcs, st->l1.mode, st->l1.bc); in hfcsx_l2l1()
1265 test_and_clear_bit(BC_FLG_ACTIV, &st->l1.bcs->Flag); in hfcsx_l2l1()
1266 test_and_clear_bit(BC_FLG_BUSY, &st->l1.bcs->Flag); in hfcsx_l2l1()
1267 mode_hfcsx(st->l1.bcs, 0, st->l1.bc); in hfcsx_l2l1()
1277 close_hfcsx(struct BCState *bcs) in close_hfcsx() argument
1279 mode_hfcsx(bcs, 0, bcs->channel); in close_hfcsx()
1280 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { in close_hfcsx()
1281 skb_queue_purge(&bcs->rqueue); in close_hfcsx()
1282 skb_queue_purge(&bcs->squeue); in close_hfcsx()
1283 if (bcs->tx_skb) { in close_hfcsx()
1284 dev_kfree_skb_any(bcs->tx_skb); in close_hfcsx()
1285 bcs->tx_skb = NULL; in close_hfcsx()
1286 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in close_hfcsx()
1295 open_hfcsxstate(struct IsdnCardState *cs, struct BCState *bcs) in open_hfcsxstate() argument
1297 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { in open_hfcsxstate()
1298 skb_queue_head_init(&bcs->rqueue); in open_hfcsxstate()
1299 skb_queue_head_init(&bcs->squeue); in open_hfcsxstate()
1301 bcs->tx_skb = NULL; in open_hfcsxstate()
1302 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in open_hfcsxstate()
1303 bcs->event = 0; in open_hfcsxstate()
1304 bcs->tx_cnt = 0; in open_hfcsxstate()
1312 setstack_2b(struct PStack *st, struct BCState *bcs) in setstack_2b() argument
1314 bcs->channel = st->l1.bc; in setstack_2b()
1315 if (open_hfcsxstate(st->l1.hardware, bcs)) in setstack_2b()
1317 st->l1.bcs = bcs; in setstack_2b()
1320 bcs->st = st; in setstack_2b()
1418 cs->bcs[0].BC_SetStack = setstack_2b; in inithfcsx()
1419 cs->bcs[1].BC_SetStack = setstack_2b; in inithfcsx()
1420 cs->bcs[0].BC_Close = close_hfcsx; in inithfcsx()
1421 cs->bcs[1].BC_Close = close_hfcsx; in inithfcsx()
1422 mode_hfcsx(cs->bcs, 0, 0); in inithfcsx()
1423 mode_hfcsx(cs->bcs + 1, 0, 1); in inithfcsx()