Lines Matching refs:byte_cnt
74 static int pcp_io_op(void *buf, int byte_cnt, int io_op);
82 static int check_magic_byte_presence(int byte_cnt, uint8_t *byte_val,
89 static int pcp_update_read_area(int byte_cnt);
571 pcp_io_op(void *buf, int byte_cnt, int io_op) in pcp_io_op() argument
581 if ((buf == NULL) || (byte_cnt < 0)) { in pcp_io_op()
605 while (rv < byte_cnt) { in pcp_io_op()
606 io_sz = MIN((byte_cnt - rv), mtu_size); in pcp_io_op()
626 if (rv == byte_cnt) in pcp_io_op()
692 pcp_write(uint8_t *buf, int byte_cnt) in pcp_write() argument
698 if (buf == NULL || byte_cnt < 0 || byte_cnt > mtu_size) { in pcp_write()
705 if ((ret = write(chnl_fd, buf, byte_cnt)) < 0) { in pcp_write()
711 if ((ret = vldc_write(chnl_fd, buf, byte_cnt)) <= 0) { in pcp_write()
731 pcp_read(uint8_t *buf, int byte_cnt) in pcp_read() argument
736 if (byte_cnt < 0 || byte_cnt > mtu_size) { in pcp_read()
758 if (byte_cnt <= (read_tail - read_head)) { in pcp_read()
759 (void) memcpy(buf, read_head, byte_cnt); in pcp_read()
760 read_head += byte_cnt; in pcp_read()
761 return (byte_cnt); in pcp_read()
794 m = byte_cnt - (read_tail - read_head); in pcp_read()
805 n = MIN(byte_cnt, (read_tail - read_head)); in pcp_read()
819 pcp_update_read_area(int byte_cnt) in pcp_update_read_area() argument
824 if (byte_cnt < 0 || byte_cnt > mtu_size) { in pcp_update_read_area()
846 if (byte_cnt <= (read_tail - read_head)) { in pcp_update_read_area()
847 return (byte_cnt); in pcp_update_read_area()
860 n = byte_cnt - (read_tail - read_head); in pcp_update_read_area()
871 n = MIN(byte_cnt, (read_tail - read_head)); in pcp_update_read_area()
884 pcp_peek_read(uint8_t *buf, int byte_cnt) in pcp_peek_read() argument
888 if (byte_cnt < 0 || byte_cnt > mtu_size) { in pcp_peek_read()
909 if (byte_cnt <= (read_tail - read_head)) { in pcp_peek_read()
910 (void) memcpy(buf, read_head, byte_cnt); in pcp_peek_read()
911 return (byte_cnt); in pcp_peek_read()
937 n = MIN(byte_cnt, (peek_read_tail - peek_read_head)); in pcp_peek_read()
1249 check_magic_byte_presence(int byte_cnt, uint8_t *byte_seq, int *ispresent) in check_magic_byte_presence() argument
1254 if ((ret = pcp_peek_read(buf, byte_cnt)) < 0) { in check_magic_byte_presence()
1259 if (ret != byte_cnt) { in check_magic_byte_presence()
1264 for (i = 0; i < byte_cnt; ++i) { in check_magic_byte_presence()