Lines Matching defs:buf
45 #define IS_START_OF_FRAME(buf) (buf[0] == ST21NFCA_SOF_EOF && \
46 buf[1] == 0)
250 static int get_frame_size(u8 *buf, int buflen)
254 if (buf[len + 1] == ST21NFCA_SOF_EOF)
257 for (len = 1; len < buflen && buf[len] != ST21NFCA_SOF_EOF; len++)
263 static int check_crc(u8 *buf, int buflen)
267 crc = crc_ccitt(0xffff, buf, buflen - 2);
270 if (buf[buflen - 2] != (crc & 0xff) || buf[buflen - 1] != (crc >> 8)) {
272 ": CRC error 0x%x != 0x%x 0x%x\n", crc, buf[buflen - 1],
273 buf[buflen - 2]);
277 16, 2, buf, buflen, false);
350 u8 buf[ST21NFCA_HCI_LLC_MAX_PAYLOAD];
364 r = i2c_master_recv(client, buf, len);
379 if (!phy->current_read_len && !IS_START_OF_FRAME(buf)) {
383 } else if (phy->current_read_len && IS_START_OF_FRAME(buf)) {
393 skb_put_data(skb, buf, len);