1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright(c) 2021 Intel Corporation
4  */
5 #ifndef __iwl_fw_uefi__
6 #define __iwl_fw_uefi__
7 
8 #define IWL_UEFI_OEM_PNVM_NAME		L"UefiCnvWlanOemSignedPnvm"
9 #define IWL_UEFI_REDUCED_POWER_NAME	L"UefiCnvWlanReducedPower"
10 
11 /*
12  * TODO: we have these hardcoded values that the caller must pass,
13  * because reading from the UEFI is not working.  To implement this
14  * properly, we have to change iwl_pnvm_get_from_uefi() to call
15  * efivar_entry_size() and return the value to the caller instead.
16  */
17 #define IWL_HARDCODED_PNVM_SIZE		4096
18 #define IWL_HARDCODED_REDUCE_POWER_SIZE	32768
19 
20 struct pnvm_sku_package {
21 	u8 rev;
22 	u32 total_size;
23 	u8 n_skus;
24 	u32 reserved[2];
25 	u8 data[];
26 } __packed;
27 
28 #ifdef CONFIG_EFI
29 void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len);
30 void *iwl_uefi_get_reduced_power(struct iwl_trans *trans, size_t *len);
31 #else /* CONFIG_EFI */
32 static inline
33 void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
34 {
35 	return ERR_PTR(-EOPNOTSUPP);
36 }
37 
38 static inline
39 void *iwl_uefi_get_reduced_power(struct iwl_trans *trans, size_t *len)
40 {
41 	return ERR_PTR(-EOPNOTSUPP);
42 }
43 #endif /* CONFIG_EFI */
44 
45 #endif /* __iwl_fw_uefi__ */
46