[10/many] acrypto: crypto_lb.h

Evgeniy Polyakov
2005-03-07T20:33:56Z

--- /tmp/empty/crypto_lb.h 1970-01-01 03:00:00.000000000 +0300
+++ ./acrypto/crypto_lb.h 2005-03-07 20:35:36.000000000 +0300
@@ -0,0 +1,63 @@
+/*
+ * crypto_lb.h
+ *
+ * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __CRYPTO_LB_H
+#define __CRYPTO_LB_H
+
+#include "acrypto.h"
+
+#define CRYPTO_LB_NAMELEN 32
+
+struct crypto_lb
+{
+ struct list_head lb_entry;
+
+ char name[CRYPTO_LB_NAMELEN];
+
+ void (*rehash)(struct crypto_lb *);
+ struct crypto_device * (*find_device) (struct crypto_lb *,
+ struct crypto_session_initializer *,
+ struct crypto_data *);
+
+ spinlock_t lock;
+
+ spinlock_t *crypto_device_lock;
+ struct list_head *crypto_device_list;
+
+ struct device_driver *driver;
+ struct device device;
+ struct class_device class_device;
+ struct completion dev_released;
+
+};
+
+int crypto_lb_register(struct crypto_lb *lb, int set_current, int set_default);
+void crypto_lb_unregister(struct crypto_lb *);
+
+inline void crypto_lb_rehash(void);
+struct crypto_device *crypto_lb_find_device(struct crypto_session_initializer *, struct crypto_data *);
+
+void crypto_wake_lb(void);
+
+int crypto_lb_init(void);
+void crypto_lb_fini(void);
+
+#endif /* __CRYPTO_LB_H */