Lines Matching refs:bcs
48 jade_empty_fifo(struct BCState *bcs, int count) in jade_empty_fifo() argument
51 struct IsdnCardState *cs = bcs->cs; in jade_empty_fifo()
57 if (bcs->hw.hscx.rcvidx + count > HSCX_BUFMAX) { in jade_empty_fifo()
60 WriteJADECMDR(cs, bcs->hw.hscx.hscx, jade_HDLC_RCMD, jadeRCMD_RMC); in jade_empty_fifo()
61 bcs->hw.hscx.rcvidx = 0; in jade_empty_fifo()
64 ptr = bcs->hw.hscx.rcvbuf + bcs->hw.hscx.rcvidx; in jade_empty_fifo()
65 bcs->hw.hscx.rcvidx += count; in jade_empty_fifo()
68 READJADEFIFO(cs, bcs->hw.hscx.hscx, ptr, count); in jade_empty_fifo()
69 WriteJADECMDR(cs, bcs->hw.hscx.hscx, jade_HDLC_RCMD, jadeRCMD_RMC); in jade_empty_fifo()
72 char *t = bcs->blog; in jade_empty_fifo()
75 bcs->hw.hscx.hscx ? 'B' : 'A', count); in jade_empty_fifo()
77 debugl1(cs, bcs->blog); in jade_empty_fifo()
82 jade_fill_fifo(struct BCState *bcs) in jade_fill_fifo() argument
84 struct IsdnCardState *cs = bcs->cs; in jade_fill_fifo()
93 if (!bcs->tx_skb) in jade_fill_fifo()
95 if (bcs->tx_skb->len <= 0) in jade_fill_fifo()
98 more = (bcs->mode == L1_MODE_TRANS) ? 1 : 0; in jade_fill_fifo()
99 if (bcs->tx_skb->len > fifo_size) { in jade_fill_fifo()
103 count = bcs->tx_skb->len; in jade_fill_fifo()
105 waitforXFW(cs, bcs->hw.hscx.hscx); in jade_fill_fifo()
108 ptr = bcs->tx_skb->data; in jade_fill_fifo()
109 skb_pull(bcs->tx_skb, count); in jade_fill_fifo()
110 bcs->tx_cnt -= count; in jade_fill_fifo()
111 bcs->hw.hscx.count += count; in jade_fill_fifo()
112 WRITEJADEFIFO(cs, bcs->hw.hscx.hscx, ptr, count); in jade_fill_fifo()
113 …WriteJADECMDR(cs, bcs->hw.hscx.hscx, jade_HDLC_XCMD, more ? jadeXCMD_XF : (jadeXCMD_XF|jadeXCMD_XM… in jade_fill_fifo()
116 char *t = bcs->blog; in jade_fill_fifo()
119 bcs->hw.hscx.hscx ? 'B' : 'A', count); in jade_fill_fifo()
121 debugl1(cs, bcs->blog); in jade_fill_fifo()
130 struct BCState *bcs = cs->bcs + jade; in jade_interrupt() local
136 if (!test_bit(BC_FLG_INIT, &bcs->Flag)) in jade_interrupt()
145 if ((r & 0x40) && bcs->mode) in jade_interrupt()
147 debugl1(cs, "JADE %c RDO mode=%d", 'A'+jade, bcs->mode); in jade_interrupt()
156 jade_empty_fifo(bcs, count); in jade_interrupt()
157 if ((count = bcs->hw.hscx.rcvidx - 1) > 0) { in jade_interrupt()
163 memcpy(skb_put(skb, count), bcs->hw.hscx.rcvbuf, count); in jade_interrupt()
164 skb_queue_tail(&bcs->rqueue, skb); in jade_interrupt()
168 bcs->hw.hscx.rcvidx = 0; in jade_interrupt()
169 jade_sched_event(bcs, B_RCVBUFREADY); in jade_interrupt()
172 jade_empty_fifo(bcs, fifo_size); in jade_interrupt()
173 if (bcs->mode == L1_MODE_TRANS) { in jade_interrupt()
178 memcpy(skb_put(skb, fifo_size), bcs->hw.hscx.rcvbuf, fifo_size); in jade_interrupt()
179 skb_queue_tail(&bcs->rqueue, skb); in jade_interrupt()
181 bcs->hw.hscx.rcvidx = 0; in jade_interrupt()
182 jade_sched_event(bcs, B_RCVBUFREADY); in jade_interrupt()
186 if (bcs->tx_skb) { in jade_interrupt()
187 if (bcs->tx_skb->len) { in jade_interrupt()
188 jade_fill_fifo(bcs); in jade_interrupt()
191 if (bcs->st->lli.l1writewakeup && in jade_interrupt()
192 (PACKET_NOACK != bcs->tx_skb->pkt_type)) in jade_interrupt()
193 bcs->st->lli.l1writewakeup(bcs->st, bcs->hw.hscx.count); in jade_interrupt()
194 dev_kfree_skb_irq(bcs->tx_skb); in jade_interrupt()
195 bcs->hw.hscx.count = 0; in jade_interrupt()
196 bcs->tx_skb = NULL; in jade_interrupt()
199 if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) { in jade_interrupt()
200 bcs->hw.hscx.count = 0; in jade_interrupt()
201 test_and_set_bit(BC_FLG_BUSY, &bcs->Flag); in jade_interrupt()
202 jade_fill_fifo(bcs); in jade_interrupt()
204 test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag); in jade_interrupt()
205 jade_sched_event(bcs, B_XMTBUFREADY); in jade_interrupt()
213 struct BCState *bcs; in jade_int_main() local
214 bcs = cs->bcs + jade; in jade_int_main()
223 if (bcs->mode == 1) in jade_int_main()
224 jade_fill_fifo(bcs); in jade_int_main()
229 if (bcs->tx_skb) { in jade_int_main()
230 skb_push(bcs->tx_skb, bcs->hw.hscx.count); in jade_int_main()
231 bcs->tx_cnt += bcs->hw.hscx.count; in jade_int_main()
232 bcs->hw.hscx.count = 0; in jade_int_main()
234 WriteJADECMDR(cs, bcs->hw.hscx.hscx, jade_HDLC_XCMD, jadeXCMD_XRES); in jade_int_main()