FreeBSD/sys/dev/usb/usb_busdma.c
/*------------------------------------------------------------------------*
 *  usbd_copy_in - copy directly to DMA-able memory
 *------------------------------------------------------------------------*/
copy directly to DMA-able memory
copy directly to DMA - able memory
void
usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset,
    const void *ptr, usb_frlength_t len)
{
	struct usb_page_search buf_res;
	while (len != 0) {
		usbd_get_page(cache, offset, &buf_res);
		if (buf_res.length > len) {
			buf_res.length = len;
		}
		memcpy(buf_res.buffer, ptr, buf_res.length);
		offset += buf_res.length;
		len -= buf_res.length;
		ptr = USB_ADD_BYTES(ptr, buf_res.length);
	}
}
void usbd_copy_in ( struct usb_page_cache * cache , usb_frlength_t offset , const void * ptr , usb_frlength_t len ) { struct usb_page_search buf_res ; while ( len != 0 ) { usbd_get_page ( cache , offset , & buf_res ) ; if ( buf_res . length > len ) { buf_res . length = len ; } memcpy ( buf_res . buffer , ptr , buf_res . length ) ; offset += buf_res . length ; len -= buf_res . length ; ptr = USB_ADD_BYTES ( ptr , buf_res . length ) ; } }
usbd_copy_in - copy directly to DMA-able memory
usbd_copy_in - copy directly to DMA - able memory