Lines Matching refs:hdlctx

205         } hdlctx;  member
382 if (bc->hdlctx.bufcnt > 0) in encode_hdlc()
389 wp = bc->hdlctx.buf; in encode_hdlc()
427 bc->hdlctx.bufptr = bc->hdlctx.buf; in encode_hdlc()
428 bc->hdlctx.bufcnt = wp - bc->hdlctx.buf; in encode_hdlc()
441 if (bc->hdlctx.state == tx_tail && !(stat & EPP_PTTBIT)) in transmit()
442 bc->hdlctx.state = tx_idle; in transmit()
443 if (bc->hdlctx.state == tx_idle && bc->hdlctx.calibrate <= 0) { in transmit()
444 if (bc->hdlctx.bufcnt <= 0) in transmit()
446 if (bc->hdlctx.bufcnt <= 0) in transmit()
450 bc->hdlctx.slotcnt = bc->ch_params.slottime; in transmit()
453 if ((--bc->hdlctx.slotcnt) > 0) in transmit()
455 bc->hdlctx.slotcnt = bc->ch_params.slottime; in transmit()
460 if (bc->hdlctx.state == tx_idle && bc->hdlctx.bufcnt > 0) { in transmit()
461 bc->hdlctx.state = tx_keyup; in transmit()
462 bc->hdlctx.flags = tenms_to_flags(bc, bc->ch_params.tx_delay); in transmit()
466 switch (bc->hdlctx.state) { in transmit()
468 i = min_t(int, cnt, bc->hdlctx.flags); in transmit()
470 bc->hdlctx.flags -= i; in transmit()
471 if (bc->hdlctx.flags <= 0) in transmit()
472 bc->hdlctx.state = tx_data; in transmit()
483 if (bc->hdlctx.bufcnt <= 0) { in transmit()
485 if (bc->hdlctx.bufcnt <= 0) { in transmit()
486 bc->hdlctx.state = tx_tail; in transmit()
487 bc->hdlctx.flags = tenms_to_flags(bc, bc->ch_params.tx_tail); in transmit()
491 i = min_t(int, cnt, bc->hdlctx.bufcnt); in transmit()
492 bc->hdlctx.bufcnt -= i; in transmit()
494 if (i != pp->ops->epp_write_data(pp, bc->hdlctx.bufptr, i, 0)) in transmit()
496 bc->hdlctx.bufptr += i; in transmit()
501 if (bc->hdlctx.bufcnt > 0) { in transmit()
502 bc->hdlctx.state = tx_data; in transmit()
505 i = min_t(int, cnt, bc->hdlctx.flags); in transmit()
508 bc->hdlctx.flags -= i; in transmit()
520 if (bc->hdlctx.calibrate <= 0) in transmit()
522 i = min_t(int, cnt, bc->hdlctx.calibrate); in transmit()
524 bc->hdlctx.calibrate -= i; in transmit()
945 bc->hdlctx.state = tx_idle; in epp_open()
946 bc->hdlctx.bufcnt = 0; in epp_open()
947 bc->hdlctx.slotcnt = bc->ch_params.slottime; in epp_open()
948 bc->hdlctx.calibrate = 0; in epp_open()
1053 bc->hdlctx.slotcnt = 1; in baycom_ioctl()
1093 bc->hdlctx.calibrate = hi.data.calibrate * bc->bitrate / 8; in baycom_ioctl()