0001
0002
0003
0004
0005
0006
0007
0008 #ifndef LINUX_MMC_CQHCI_CRYPTO_H
0009 #define LINUX_MMC_CQHCI_CRYPTO_H
0010
0011 #include <linux/mmc/host.h>
0012
0013 #include "cqhci.h"
0014
0015 #ifdef CONFIG_MMC_CRYPTO
0016
0017 int cqhci_crypto_init(struct cqhci_host *host);
0018
0019
0020
0021
0022
0023 static inline u64 cqhci_crypto_prep_task_desc(struct mmc_request *mrq)
0024 {
0025 if (!mrq->crypto_ctx)
0026 return 0;
0027
0028
0029 WARN_ON_ONCE(mrq->crypto_ctx->bc_dun[0] > U32_MAX);
0030
0031 return CQHCI_CRYPTO_ENABLE_BIT |
0032 CQHCI_CRYPTO_KEYSLOT(mrq->crypto_key_slot) |
0033 mrq->crypto_ctx->bc_dun[0];
0034 }
0035
0036 #else
0037
0038 static inline int cqhci_crypto_init(struct cqhci_host *host)
0039 {
0040 return 0;
0041 }
0042
0043 static inline u64 cqhci_crypto_prep_task_desc(struct mmc_request *mrq)
0044 {
0045 return 0;
0046 }
0047
0048 #endif
0049
0050 #endif