Deleted Added
full compact
cryptodev.c (167755) cryptodev.c (168355)
1/* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */
2
3/*-
4 * Copyright (c) 2001 Theo de Raadt
5 * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * Effort sponsored in part by the Defense Advanced Research Projects
31 * Agency (DARPA) and Air Force Research Laboratory, Air Force
32 * Materiel Command, USAF, under agreement number F30602-01-2-0537.
33 */
34
35#include <sys/cdefs.h>
1/* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */
2
3/*-
4 * Copyright (c) 2001 Theo de Raadt
5 * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 *
30 * Effort sponsored in part by the Defense Advanced Research Projects
31 * Agency (DARPA) and Air Force Research Laboratory, Air Force
32 * Materiel Command, USAF, under agreement number F30602-01-2-0537.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/opencrypto/cryptodev.c 167755 2007-03-21 03:42:51Z sam $");
36__FBSDID("$FreeBSD: head/sys/opencrypto/cryptodev.c 168355 2007-04-04 09:11:34Z rwatson $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>
41#include <sys/mbuf.h>
42#include <sys/lock.h>
43#include <sys/mutex.h>
44#include <sys/sysctl.h>

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

829
830 error = falloc(td, &f, &fd);
831
832 if (error) {
833 FREE(fcr, M_XDATA);
834 return (error);
835 }
836 /* falloc automatically provides an extra reference to 'f'. */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>
41#include <sys/mbuf.h>
42#include <sys/lock.h>
43#include <sys/mutex.h>
44#include <sys/sysctl.h>

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

829
830 error = falloc(td, &f, &fd);
831
832 if (error) {
833 FREE(fcr, M_XDATA);
834 return (error);
835 }
836 /* falloc automatically provides an extra reference to 'f'. */
837 FILE_LOCK(f);
837 f->f_flag = FREAD | FWRITE;
838 f->f_type = DTYPE_CRYPTO;
838 f->f_flag = FREAD | FWRITE;
839 f->f_type = DTYPE_CRYPTO;
839 f->f_ops = &cryptofops;
840 f->f_data = fcr;
840 f->f_data = fcr;
841 f->f_ops = &cryptofops;
842 FILE_UNLOCK(f);
841 *(u_int32_t *)data = fd;
842 fdrop(f, td);
843 break;
844 case CRIOFINDDEV:
845 error = cryptodev_find((struct crypt_find_op *)data);
846 break;
847 case CRIOASYMFEAT:
848 error = crypto_getfeat((int *)data);

--- 50 unchanged lines hidden ---
843 *(u_int32_t *)data = fd;
844 fdrop(f, td);
845 break;
846 case CRIOFINDDEV:
847 error = cryptodev_find((struct crypt_find_op *)data);
848 break;
849 case CRIOASYMFEAT:
850 error = crypto_getfeat((int *)data);

--- 50 unchanged lines hidden ---