blob: 82ee74199752935869b64491e33ce40246131f06 [file] [log] [blame]
Neeraj Soni7b939262017-11-15 16:31:27 +05301/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef PFK_H_
14#define PFK_H_
15
16#include <linux/bio.h>
17
18struct ice_crypto_setting;
19
20#ifdef CONFIG_PFK
21
22int pfk_load_key_start(const struct bio *bio,
23 struct ice_crypto_setting *ice_setting, bool *is_pfe, bool);
24int pfk_load_key_end(const struct bio *bio, bool *is_pfe);
25int pfk_remove_key(const unsigned char *key, size_t key_size);
26bool pfk_allow_merge_bio(const struct bio *bio1, const struct bio *bio2);
27void pfk_clear_on_reset(void);
28
29#else
30static inline int pfk_load_key_start(const struct bio *bio,
31 struct ice_crypto_setting *ice_setting, bool *is_pfe, bool async)
32{
33 return -ENODEV;
34}
35
36static inline int pfk_load_key_end(const struct bio *bio, bool *is_pfe)
37{
38 return -ENODEV;
39}
40
41static inline int pfk_remove_key(const unsigned char *key, size_t key_size)
42{
43 return -ENODEV;
44}
45
46static inline bool pfk_allow_merge_bio(const struct bio *bio1,
47 const struct bio *bio2)
48{
49 return true;
50}
51
52static inline void pfk_clear_on_reset(void)
53{}
54
55#endif /* CONFIG_PFK */
56
57#endif /* PFK_H */