Deleted Added
full compact
aesni.c (230426) aesni.c (255187)
1/*-
2 * Copyright (c) 2005-2008 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005-2008 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * Copyright (c) 2010 Konstantin Belousov <kib@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/crypto/aesni/aesni.c 230426 2012-01-21 17:45:27Z kib $");
29__FBSDID("$FreeBSD: head/sys/crypto/aesni/aesni.c 255187 2013-09-03 18:31:23Z jmg $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/kobj.h>
35#include <sys/libkern.h>
36#include <sys/lock.h>
37#include <sys/module.h>
38#include <sys/malloc.h>
39#include <sys/rwlock.h>
40#include <sys/bus.h>
41#include <sys/uio.h>
42#include <crypto/aesni/aesni.h>
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/kobj.h>
35#include <sys/libkern.h>
36#include <sys/lock.h>
37#include <sys/module.h>
38#include <sys/malloc.h>
39#include <sys/rwlock.h>
40#include <sys/bus.h>
41#include <sys/uio.h>
42#include <crypto/aesni/aesni.h>
43#include "cryptodev_if.h"
43#include <cryptodev_if.h>
44
45struct aesni_softc {
46 int32_t cid;
47 uint32_t sid;
48 TAILQ_HEAD(aesni_sessions_head, aesni_session) sessions;
49 struct rwlock lock;
50};
51

--- 17 unchanged lines hidden (view full) ---

69static int
70aesni_probe(device_t dev)
71{
72
73 if ((cpu_feature2 & CPUID2_AESNI) == 0) {
74 device_printf(dev, "No AESNI support.\n");
75 return (EINVAL);
76 }
44
45struct aesni_softc {
46 int32_t cid;
47 uint32_t sid;
48 TAILQ_HEAD(aesni_sessions_head, aesni_session) sessions;
49 struct rwlock lock;
50};
51

--- 17 unchanged lines hidden (view full) ---

69static int
70aesni_probe(device_t dev)
71{
72
73 if ((cpu_feature2 & CPUID2_AESNI) == 0) {
74 device_printf(dev, "No AESNI support.\n");
75 return (EINVAL);
76 }
77
78 if ((cpu_feature & CPUID_SSE2) == 0) {
79 device_printf(dev, "No SSE2 support but AESNI!?!\n");
80 return (EINVAL);
81 }
82
77 device_set_desc_copy(dev, "AES-CBC,AES-XTS");
78 return (0);
79}
80
81static int
82aesni_attach(device_t dev)
83{
84 struct aesni_softc *sc;

--- 265 unchanged lines hidden ---
83 device_set_desc_copy(dev, "AES-CBC,AES-XTS");
84 return (0);
85}
86
87static int
88aesni_attach(device_t dev)
89{
90 struct aesni_softc *sc;

--- 265 unchanged lines hidden ---