Neeraj Soni | 7b93926 | 2017-11-15 16:31:27 +0530 | [diff] [blame] | 1 | /* 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 | |
| 18 | struct ice_crypto_setting; |
| 19 | |
| 20 | #ifdef CONFIG_PFK |
| 21 | |
| 22 | int pfk_load_key_start(const struct bio *bio, |
| 23 | struct ice_crypto_setting *ice_setting, bool *is_pfe, bool); |
| 24 | int pfk_load_key_end(const struct bio *bio, bool *is_pfe); |
| 25 | int pfk_remove_key(const unsigned char *key, size_t key_size); |
| 26 | bool pfk_allow_merge_bio(const struct bio *bio1, const struct bio *bio2); |
| 27 | void pfk_clear_on_reset(void); |
| 28 | |
| 29 | #else |
| 30 | static 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 | |
| 36 | static inline int pfk_load_key_end(const struct bio *bio, bool *is_pfe) |
| 37 | { |
| 38 | return -ENODEV; |
| 39 | } |
| 40 | |
| 41 | static inline int pfk_remove_key(const unsigned char *key, size_t key_size) |
| 42 | { |
| 43 | return -ENODEV; |
| 44 | } |
| 45 | |
| 46 | static inline bool pfk_allow_merge_bio(const struct bio *bio1, |
| 47 | const struct bio *bio2) |
| 48 | { |
| 49 | return true; |
| 50 | } |
| 51 | |
| 52 | static inline void pfk_clear_on_reset(void) |
| 53 | {} |
| 54 | |
| 55 | #endif /* CONFIG_PFK */ |
| 56 | |
| 57 | #endif /* PFK_H */ |