From owner-p4-projects@FreeBSD.ORG Sun Dec 10 23:52:22 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A2BBF16A524; Sun, 10 Dec 2006 23:52:22 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FB8916A510 for ; Sun, 10 Dec 2006 23:52:22 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3578D43CC8 for ; Sun, 10 Dec 2006 23:50:33 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBANpgW7072177 for ; Sun, 10 Dec 2006 23:51:42 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBANpgs6072173 for perforce@freebsd.org; Sun, 10 Dec 2006 23:51:42 GMT (envelope-from sam@freebsd.org) Date: Sun, 10 Dec 2006 23:51:42 GMT Message-Id: <200612102351.kBANpgs6072173@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 111417 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Dec 2006 23:52:23 -0000 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 -#include #include #include #include @@ -61,8 +60,6 @@ #include #include -#include - #include #include @@ -86,6 +83,13 @@ #include #include +#ifdef HIFN_VULCANDEV +#include +#include + +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)