Lines Matching refs:clone
514 struct net_buf *clone; in net_buf_clone() local
520 clone = net_buf_alloc_len(pool, 0, timeout); in net_buf_clone()
521 if (!clone) { in net_buf_clone()
529 clone->__buf = buf->__buf ? data_ref(buf, buf->__buf) : NULL; in net_buf_clone()
530 clone->data = buf->data; in net_buf_clone()
531 clone->len = buf->len; in net_buf_clone()
532 clone->size = buf->size; in net_buf_clone()
538 clone->__buf = data_alloc(clone, &size, timeout); in net_buf_clone()
539 if (!clone->__buf || size < buf->size) { in net_buf_clone()
540 net_buf_destroy(clone); in net_buf_clone()
544 clone->size = size; in net_buf_clone()
545 clone->data = clone->__buf + net_buf_headroom(buf); in net_buf_clone()
546 net_buf_add_mem(clone, buf->data, buf->len); in net_buf_clone()
550 __ASSERT(buf->user_data_size == clone->user_data_size, "Unexpected user data size"); in net_buf_clone()
552 memcpy(clone->user_data, buf->user_data, clone->user_data_size); in net_buf_clone()
554 return clone; in net_buf_clone()