Lines Matching refs:buf
65 int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len);
66 int (*send) (struct tpm_chip *chip, u8 *buf, size_t len);
314 static inline void tpm_buf_reset(struct tpm_buf *buf, u16 tag, u32 ordinal) in tpm_buf_reset() argument
316 struct tpm_header *head = (struct tpm_header *)buf->data; in tpm_buf_reset()
323 static inline int tpm_buf_init(struct tpm_buf *buf, u16 tag, u32 ordinal) in tpm_buf_init() argument
325 buf->data = (u8 *)__get_free_page(GFP_KERNEL); in tpm_buf_init()
326 if (!buf->data) in tpm_buf_init()
329 buf->flags = 0; in tpm_buf_init()
330 tpm_buf_reset(buf, tag, ordinal); in tpm_buf_init()
334 static inline void tpm_buf_destroy(struct tpm_buf *buf) in tpm_buf_destroy() argument
336 free_page((unsigned long)buf->data); in tpm_buf_destroy()
339 static inline u32 tpm_buf_length(struct tpm_buf *buf) in tpm_buf_length() argument
341 struct tpm_header *head = (struct tpm_header *)buf->data; in tpm_buf_length()
346 static inline u16 tpm_buf_tag(struct tpm_buf *buf) in tpm_buf_tag() argument
348 struct tpm_header *head = (struct tpm_header *)buf->data; in tpm_buf_tag()
353 static inline void tpm_buf_append(struct tpm_buf *buf, in tpm_buf_append() argument
357 struct tpm_header *head = (struct tpm_header *)buf->data; in tpm_buf_append()
358 u32 len = tpm_buf_length(buf); in tpm_buf_append()
361 if (buf->flags & TPM_BUF_OVERFLOW) in tpm_buf_append()
366 buf->flags |= TPM_BUF_OVERFLOW; in tpm_buf_append()
370 memcpy(&buf->data[len], new_data, new_len); in tpm_buf_append()
374 static inline void tpm_buf_append_u8(struct tpm_buf *buf, const u8 value) in tpm_buf_append_u8() argument
376 tpm_buf_append(buf, &value, 1); in tpm_buf_append_u8()
379 static inline void tpm_buf_append_u16(struct tpm_buf *buf, const u16 value) in tpm_buf_append_u16() argument
383 tpm_buf_append(buf, (u8 *) &value2, 2); in tpm_buf_append_u16()
386 static inline void tpm_buf_append_u32(struct tpm_buf *buf, const u32 value) in tpm_buf_append_u32() argument
390 tpm_buf_append(buf, (u8 *) &value2, 4); in tpm_buf_append_u32()
403 extern ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_buf *buf,