Date: Sun, 10 Dec 2006 23:51:42 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111417 for review Message-ID: <200612102351.kBANpgs6072173@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111417 Change 111417 by sam@sam_ebb on 2006/12/10 23:51:09 o move /dev/vulcanpk support under a HIFN_VULCANDEV option o nuke bar1fake stuff; #if 0 test code doesn't belong Affected files ... .. //depot/projects/crypto/sys/conf/options#4 edit .. //depot/projects/crypto/sys/dev/hifn/hifn7751.c#4 edit .. //depot/projects/crypto/sys/dev/hifn/hifn7751var.h#3 edit Differences ... ==== //depot/projects/crypto/sys/conf/options#4 (text+ko) ==== @@ -681,6 +681,7 @@ # options for hifn driver HIFN_DEBUG opt_hifn.h HIFN_RNDTEST opt_hifn.h +HIFN_VULCANDEV opt_hifn.h # options for safenet driver SAFE_DEBUG opt_safe.h ==== //depot/projects/crypto/sys/dev/hifn/hifn7751.c#4 (text+ko) ==== @@ -49,7 +49,6 @@ #include "opt_hifn.h" #include <sys/param.h> -#include <sys/conf.h> #include <sys/systm.h> #include <sys/proc.h> #include <sys/errno.h> @@ -61,8 +60,6 @@ #include <sys/mutex.h> #include <sys/sysctl.h> -#include <sys/uio.h> - #include <vm/vm.h> #include <vm/pmap.h> @@ -86,6 +83,13 @@ #include <dev/hifn/hifn7751reg.h> #include <dev/hifn/hifn7751var.h> +#ifdef HIFN_VULCANDEV +#include <sys/conf.h> +#include <sys/uio.h> + +static struct cdevsw vulcanpk_cdevsw; /* forward declaration */ +#endif + /* * Prototypes and count for the pci_device structure */ @@ -95,7 +99,6 @@ static int hifn_suspend(device_t); static int hifn_resume(device_t); static void hifn_shutdown(device_t); -static struct cdevsw vulcanpk_cdevsw; /* forward declaration */ static int hifn_newsession(device_t, u_int32_t *, struct cryptoini *); static int hifn_freesession(device_t, u_int64_t); @@ -461,11 +464,6 @@ sc->sc_sh1 = rman_get_bushandle(sc->sc_bar1res); sc->sc_bar1_lastreg = (bus_size_t) -1; -#if 0 - sc->sc_bar1fake = malloc(4096, M_DEVBUF, M_NOWAIT); - memset(sc->sc_bar1fake, 'X', 4096); -#endif - hifn_set_retry(sc); /* @@ -827,11 +825,12 @@ WRITE_REG_1(sc, HIFN_1_PUB_IEN, HIFN_PUBIEN_DONE); sc->sc_dmaier |= HIFN_DMAIER_PUBDONE; WRITE_REG_1(sc, HIFN_1_DMA_IER, sc->sc_dmaier); - +#ifdef HIFN_VULCANDEV sc->sc_pkdev = make_dev(&vulcanpk_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "vulcanpk"); sc->sc_pkdev->si_drv1 = sc; +#endif } return (0); @@ -2924,7 +2923,7 @@ bus_space_write_4(sc->sc_st1, sc->sc_sh1, reg, val); } - +#ifdef HIFN_VULCANDEV /* * this code provides support for mapping the PK engine's register * into a userspace program. @@ -2940,13 +2939,8 @@ sc = dev->si_drv1; -#if 0 - b = sc->sc_bar1fake; - pd = vtophys(b); -#else pd = rman_get_start(sc->sc_bar1res); b = rman_get_virtual(sc->sc_bar1res); -#endif #if 0 printf("vpk mmap: %p(%08x) offset=%d\n", b, pd, offset); @@ -2965,4 +2959,4 @@ .d_mmap = vulcanpk_mmap, .d_name = "vulcanpk", }; - +#endif /* HIFN_VULCANDEV */ ==== //depot/projects/crypto/sys/dev/hifn/hifn7751var.h#3 (text+ko) ==== @@ -183,10 +183,9 @@ int sc_needwakeup; /* ops q'd wating on resources */ int sc_curbatch; /* # ops submitted w/o int */ int sc_suspended; +#ifdef HIFN_VULCANDEV struct cdev *sc_pkdev; - - void *sc_bar1fake; - +#endif }; #define HIFN_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612102351.kBANpgs6072173>