/* It also takes messages from the locking layer, formats them into packets and sends them to the comms layer.  */
static void copy_from_cb(void *dst, const void *base, unsigned offset, unsigned len, unsigned limit)
/* It also takes messages from the locking layer, formats them into packets and sends them to the comms layer.  */
static void copy_from_cb(void *dst, const void *base, unsigned offset, unsigned len, unsigned limit)
{
	unsigned copy = len;
	if ((copy + offset) > limit)
		copy = limit - offset;
	memcpy(dst, base + offset, copy);
	len -= copy;
	if (len)
		memcpy(dst + copy, base, len);
}