subsys/net/ip/l2/ieee802154/ieee802154_fragment.c
/* Helper function to write fragment data to Rx packet based on offset. */
Helper function to write fragment data to Rx packet based on offset.
Helper function to write fragment data to Rx packet based on offset .
static inline bool copy_frag(struct net_pkt *pkt,
			     struct net_buf *frag,
			     u16_t offset)
{
	struct net_buf *input = frag;
	struct net_buf *write;
	u16_t pos = offset;
	write = pkt->frags;
	while (input) {
		write = net_pkt_write(pkt, write, pos, &pos, input->len,
				       input->data, NET_6LO_RX_PKT_TIMEOUT);
		if (!write && pos == 0xffff) {
			net_pkt_frag_unref(pkt->frags);
			pkt->frags = NULL;
			return false;
		}
		input = input->frags;
	}
	net_pkt_frag_unref(frag);
	return true;
}
static inline bool copy_frag ( struct net_pkt * pkt , struct net_buf * frag , u16_t offset ) { struct net_buf * input = frag ; struct net_buf * write ; u16_t pos = offset ; write = pkt -> frags ; while ( input ) { write = net_pkt_write ( pkt , write , pos , & pos , input -> len , input -> data , NET_6LO_RX_PKT_TIMEOUT ) ; if ( ! write && pos == 0xffff ) { net_pkt_frag_unref ( pkt -> frags ) ; pkt -> frags = NULL ; return false ; } input = input -> frags ; } net_pkt_frag_unref ( frag ) ; return true ; }
Helper function to write fragment data to Rx packet based on offset.
Helper function to write fragment data to Rx packet based on offset .
/* Free the new bufs we tried to get, we need to discard
			 * the whole fragment chain.
			 */