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