Revert "crypto: remove CONFIG_CRYPTO_STATS"
[linux-2.6-microblaze.git] / include / crypto / skcipher.h
index 74d47e2..c8857d7 100644 (file)
@@ -64,6 +64,28 @@ struct crypto_lskcipher {
        struct crypto_tfm base;
 };
 
+/*
+ * struct crypto_istat_cipher - statistics for cipher algorithm
+ * @encrypt_cnt:       number of encrypt requests
+ * @encrypt_tlen:      total data size handled by encrypt requests
+ * @decrypt_cnt:       number of decrypt requests
+ * @decrypt_tlen:      total data size handled by decrypt requests
+ * @err_cnt:           number of error for cipher requests
+ */
+struct crypto_istat_cipher {
+       atomic64_t encrypt_cnt;
+       atomic64_t encrypt_tlen;
+       atomic64_t decrypt_cnt;
+       atomic64_t decrypt_tlen;
+       atomic64_t err_cnt;
+};
+
+#ifdef CONFIG_CRYPTO_STATS
+#define SKCIPHER_ALG_COMMON_STAT struct crypto_istat_cipher stat;
+#else
+#define SKCIPHER_ALG_COMMON_STAT
+#endif
+
 /*
  * struct skcipher_alg_common - common properties of skcipher_alg
  * @min_keysize: Minimum key size supported by the transformation. This is the
@@ -81,6 +103,7 @@ struct crypto_lskcipher {
  * @chunksize: Equal to the block size except for stream ciphers such as
  *            CTR where it is set to the underlying block size.
  * @statesize: Size of the internal state for the algorithm.
+ * @stat: Statistics for cipher algorithm
  * @base: Definition of a generic crypto algorithm.
  */
 #define SKCIPHER_ALG_COMMON {          \
@@ -90,6 +113,8 @@ struct crypto_lskcipher {
        unsigned int chunksize;         \
        unsigned int statesize;         \
                                        \
+       SKCIPHER_ALG_COMMON_STAT        \
+                                       \
        struct crypto_alg base;         \
 }
 struct skcipher_alg_common SKCIPHER_ALG_COMMON;