• Home
  • Raw
  • Download

Lines Matching refs:bcs

437 	if (cs->bcs[0].mode && (cs->bcs[0].channel == channel))  in Sel_BCS()
438 return (&cs->bcs[0]); in Sel_BCS()
439 else if (cs->bcs[1].mode && (cs->bcs[1].channel == channel)) in Sel_BCS()
440 return (&cs->bcs[1]); in Sel_BCS()
476 main_rec_hfcsx(struct BCState *bcs) in main_rec_hfcsx() argument
478 struct IsdnCardState *cs = bcs->cs; in main_rec_hfcsx()
485 debugl1(cs, "rec_data %d blocked", bcs->channel); in main_rec_hfcsx()
488 skb = read_fifo(cs, ((bcs->channel) && (!cs->hw.hfcsx.bswapped)) ? in main_rec_hfcsx()
490 (bcs->mode == L1_MODE_TRANS) ? in main_rec_hfcsx()
494 skb_queue_tail(&bcs->rqueue, skb); in main_rec_hfcsx()
495 schedule_event(bcs, B_RCVBUFREADY); in main_rec_hfcsx()
526 hfcsx_fill_fifo(struct BCState *bcs) in hfcsx_fill_fifo() argument
528 struct IsdnCardState *cs = bcs->cs; in hfcsx_fill_fifo()
530 if (!bcs->tx_skb) in hfcsx_fill_fifo()
532 if (bcs->tx_skb->len <= 0) in hfcsx_fill_fifo()
535 if (write_fifo(cs, bcs->tx_skb, in hfcsx_fill_fifo()
536 ((bcs->channel) && (!cs->hw.hfcsx.bswapped)) ? in hfcsx_fill_fifo()
538 (bcs->mode == L1_MODE_TRANS) ? in hfcsx_fill_fifo()
541 bcs->tx_cnt -= bcs->tx_skb->len; in hfcsx_fill_fifo()
542 if (test_bit(FLG_LLI_L1WAKEUP, &bcs->st->lli.flag) && in hfcsx_fill_fifo()
543 (PACKET_NOACK != bcs->tx_skb->pkt_type)) { in hfcsx_fill_fifo()
545 spin_lock_irqsave(&bcs->aclock, flags); in hfcsx_fill_fifo()
546 bcs->ackcnt += bcs->tx_skb->len; in hfcsx_fill_fifo()
547 spin_unlock_irqrestore(&bcs->aclock, flags); in hfcsx_fill_fifo()
548 schedule_event(bcs, B_ACKPENDING); in hfcsx_fill_fifo()
550 dev_kfree_skb_any(bcs->tx_skb); in hfcsx_fill_fifo()
551 bcs->tx_skb = NULL; in hfcsx_fill_fifo()
552 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in hfcsx_fill_fifo()
698 struct BCState *bcs; in hfcsx_interrupt() local
749 if (!(bcs = Sel_BCS(cs, cs->hw.hfcsx.bswapped ? 1 : 0))) { in hfcsx_interrupt()
753 main_rec_hfcsx(bcs); in hfcsx_interrupt()
758 else if (!(bcs = Sel_BCS(cs, 1))) { in hfcsx_interrupt()
762 main_rec_hfcsx(bcs); in hfcsx_interrupt()
765 if (!(bcs = Sel_BCS(cs, cs->hw.hfcsx.bswapped ? 1 : 0))) { in hfcsx_interrupt()
769 if (bcs->tx_skb) { in hfcsx_interrupt()
771 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
774 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
776 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in hfcsx_interrupt()
778 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
781 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
783 schedule_event(bcs, B_XMTBUFREADY); in hfcsx_interrupt()
789 if (!(bcs = Sel_BCS(cs, 1))) { in hfcsx_interrupt()
793 if (bcs->tx_skb) { in hfcsx_interrupt()
795 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
798 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
800 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in hfcsx_interrupt()
802 hfcsx_fill_fifo(bcs); in hfcsx_interrupt()
805 debugl1(cs, "fill_data %d blocked", bcs->channel); in hfcsx_interrupt()
807 schedule_event(bcs, B_XMTBUFREADY); in hfcsx_interrupt()
1016 hfcsx_send_data(struct BCState *bcs) in hfcsx_send_data() argument
1018 struct IsdnCardState *cs = bcs->cs; in hfcsx_send_data()
1021 hfcsx_fill_fifo(bcs); in hfcsx_send_data()
1024 debugl1(cs, "send_data %d blocked", bcs->channel); in hfcsx_send_data()
1031 mode_hfcsx(struct BCState *bcs, int mode, int bc) in mode_hfcsx() argument
1033 struct IsdnCardState *cs = bcs->cs; in mode_hfcsx()
1038 mode, bc, bcs->channel); in mode_hfcsx()
1039 bcs->mode = mode; in mode_hfcsx()
1040 bcs->channel = bc; in mode_hfcsx()
1143 struct BCState *bcs = st->l1.bcs; in hfcsx_l2l1() local
1149 spin_lock_irqsave(&bcs->cs->lock, flags); in hfcsx_l2l1()
1150 if (bcs->tx_skb) { in hfcsx_l2l1()
1151 skb_queue_tail(&bcs->squeue, skb); in hfcsx_l2l1()
1153 bcs->tx_skb = skb; in hfcsx_l2l1()
1155 bcs->cs->BC_Send_Data(bcs); in hfcsx_l2l1()
1157 spin_unlock_irqrestore(&bcs->cs->lock, flags); in hfcsx_l2l1()
1160 spin_lock_irqsave(&bcs->cs->lock, flags); in hfcsx_l2l1()
1161 if (bcs->tx_skb) { in hfcsx_l2l1()
1166 bcs->tx_skb = skb; in hfcsx_l2l1()
1167 bcs->cs->BC_Send_Data(bcs); in hfcsx_l2l1()
1169 spin_unlock_irqrestore(&bcs->cs->lock, flags); in hfcsx_l2l1()
1172 if (!bcs->tx_skb) { in hfcsx_l2l1()
1179 spin_lock_irqsave(&bcs->cs->lock, flags); in hfcsx_l2l1()
1180 test_and_set_bit(BC_FLG_ACTIV, &bcs->Flag); in hfcsx_l2l1()
1181 mode_hfcsx(bcs, st->l1.mode, st->l1.bc); in hfcsx_l2l1()
1182 spin_unlock_irqrestore(&bcs->cs->lock, flags); in hfcsx_l2l1()
1189 spin_lock_irqsave(&bcs->cs->lock, flags); in hfcsx_l2l1()
1190 test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag); in hfcsx_l2l1()
1191 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in hfcsx_l2l1()
1192 mode_hfcsx(bcs, 0, st->l1.bc); in hfcsx_l2l1()
1193 spin_unlock_irqrestore(&bcs->cs->lock, flags); in hfcsx_l2l1()
1203 close_hfcsx(struct BCState *bcs) in close_hfcsx() argument
1205 mode_hfcsx(bcs, 0, bcs->channel); in close_hfcsx()
1206 if (test_and_clear_bit(BC_FLG_INIT, &bcs->Flag)) { in close_hfcsx()
1207 skb_queue_purge(&bcs->rqueue); in close_hfcsx()
1208 skb_queue_purge(&bcs->squeue); in close_hfcsx()
1209 if (bcs->tx_skb) { in close_hfcsx()
1210 dev_kfree_skb_any(bcs->tx_skb); in close_hfcsx()
1211 bcs->tx_skb = NULL; in close_hfcsx()
1212 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in close_hfcsx()
1221 open_hfcsxstate(struct IsdnCardState *cs, struct BCState *bcs) in open_hfcsxstate() argument
1223 if (!test_and_set_bit(BC_FLG_INIT, &bcs->Flag)) { in open_hfcsxstate()
1224 skb_queue_head_init(&bcs->rqueue); in open_hfcsxstate()
1225 skb_queue_head_init(&bcs->squeue); in open_hfcsxstate()
1227 bcs->tx_skb = NULL; in open_hfcsxstate()
1228 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in open_hfcsxstate()
1229 bcs->event = 0; in open_hfcsxstate()
1230 bcs->tx_cnt = 0; in open_hfcsxstate()
1238 setstack_2b(struct PStack *st, struct BCState *bcs) in setstack_2b() argument
1240 bcs->channel = st->l1.bc; in setstack_2b()
1241 if (open_hfcsxstate(st->l1.hardware, bcs)) in setstack_2b()
1243 st->l1.bcs = bcs; in setstack_2b()
1246 bcs->st = st; in setstack_2b()
1336 cs->bcs[0].BC_SetStack = setstack_2b; in inithfcsx()
1337 cs->bcs[1].BC_SetStack = setstack_2b; in inithfcsx()
1338 cs->bcs[0].BC_Close = close_hfcsx; in inithfcsx()
1339 cs->bcs[1].BC_Close = close_hfcsx; in inithfcsx()
1340 mode_hfcsx(cs->bcs, 0, 0); in inithfcsx()
1341 mode_hfcsx(cs->bcs + 1, 0, 1); in inithfcsx()