Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sec/sec.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/random.h> | #include <sys/random.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <machine/_inttypes.h> | #include <machine/_inttypes.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <machine/resource.h> | #include <machine/resource.h> | ||||
#include <machine/vmparam.h> | |||||
#include <opencrypto/cryptodev.h> | #include <opencrypto/cryptodev.h> | ||||
#include <opencrypto/xform_auth.h> | #include <opencrypto/xform_auth.h> | ||||
#include "cryptodev_if.h" | #include "cryptodev_if.h" | ||||
#include <dev/ofw/ofw_bus_subr.h> | #include <dev/ofw/ofw_bus_subr.h> | ||||
#include <dev/sec/sec.h> | #include <dev/sec/sec.h> | ||||
▲ Show 20 Lines • Show All 786 Lines • ▼ Show 20 Lines | sec_desc_map_dma(struct sec_softc *sc, struct sec_dma_mem *dma_mem, | ||||
case CRYPTO_BUF_CONTIG: | case CRYPTO_BUF_CONTIG: | ||||
break; | break; | ||||
case CRYPTO_BUF_UIO: | case CRYPTO_BUF_UIO: | ||||
size = SEC_FREE_LT_CNT(sc) * SEC_MAX_DMA_BLOCK_SIZE; | size = SEC_FREE_LT_CNT(sc) * SEC_MAX_DMA_BLOCK_SIZE; | ||||
break; | break; | ||||
case CRYPTO_BUF_MBUF: | case CRYPTO_BUF_MBUF: | ||||
size = m_length(crp->crp_buf.cb_mbuf, NULL); | size = m_length(crp->crp_buf.cb_mbuf, NULL); | ||||
break; | break; | ||||
#if PMAP_HAS_DMAP | |||||
case CRYPTO_BUF_VMPAGE: | |||||
size = PAGE_SIZE - cb->cb_vm_page_offset; | |||||
break; | |||||
#endif /* PMAP_HAS_DMAP */ | |||||
default: | default: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
error = bus_dma_tag_create(NULL, /* parent */ | error = bus_dma_tag_create(NULL, /* parent */ | ||||
SEC_DMA_ALIGNMENT, 0, /* alignment, boundary */ | SEC_DMA_ALIGNMENT, 0, /* alignment, boundary */ | ||||
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ | BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ | ||||
BUS_SPACE_MAXADDR, /* highaddr */ | BUS_SPACE_MAXADDR, /* highaddr */ | ||||
▲ Show 20 Lines • Show All 723 Lines • Show Last 20 Lines |