Lines Matching defs:buf
47 #define IS_START_OF_FRAME(buf) (buf[0] == ST21NFCA_SOF_EOF && \
48 buf[1] == 0)
252 static int get_frame_size(u8 *buf, int buflen)
256 if (buf[len + 1] == ST21NFCA_SOF_EOF)
259 for (len = 1; len < buflen && buf[len] != ST21NFCA_SOF_EOF; len++)
265 static int check_crc(u8 *buf, int buflen)
269 crc = crc_ccitt(0xffff, buf, buflen - 2);
272 if (buf[buflen - 2] != (crc & 0xff) || buf[buflen - 1] != (crc >> 8)) {
274 ": CRC error 0x%x != 0x%x 0x%x\n", crc, buf[buflen - 1],
275 buf[buflen - 2]);
279 16, 2, buf, buflen, false);
354 u8 buf[ST21NFCA_HCI_LLC_MAX_PAYLOAD];
368 r = i2c_master_recv(client, buf, len);
383 if (!phy->current_read_len && !IS_START_OF_FRAME(buf)) {
387 } else if (phy->current_read_len && IS_START_OF_FRAME(buf)) {
397 skb_put_data(skb, buf, len);