soc/intel/common/acpi: Fix ACPI Namespace lookup failure, AE_ALREADY_EXISTS issue
[coreboot.git] / src / include / sar.h
blob9da4dd943c2d2d7afab220d2c9eafa649efae1c7
1 /*
2 * This file is part of the coreboot project.
4 * Copyright (C) 2017-2018 Intel Corp.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 #ifndef _SAR_H_
16 #define _SAR_H_
18 #include <stdint.h>
20 #define NUM_SAR_LIMITS 4
21 #define BYTES_PER_SAR_LIMIT 10
22 enum {
23 SAR_FCC,
24 SAR_EUROPE_JAPAN,
25 SAR_REST_OF_WORLD,
26 SAR_NUM_WGDS_GROUPS
29 struct wifi_sar_delta_table {
30 uint8_t version;
31 struct {
32 uint8_t power_max_2400mhz;
33 uint8_t power_chain_a_2400mhz;
34 uint8_t power_chain_b_2400mhz;
35 uint8_t power_max_5200mhz;
36 uint8_t power_chain_a_5200mhz;
37 uint8_t power_chain_b_5200mhz;
38 } __packed group[SAR_NUM_WGDS_GROUPS];
39 } __packed;
41 /* Wifi SAR limit table structure */
42 struct wifi_sar_limits {
43 /* Total 4 SAR limit sets, each has 10 bytes */
44 uint8_t sar_limit[NUM_SAR_LIMITS][BYTES_PER_SAR_LIMIT];
45 struct wifi_sar_delta_table wgds;
46 } __packed;
49 * Retrieve the SAR limits data from VPD and decode it.
50 * sar_limits: Pointer to wifi_sar_limits where the resulted data is stored
52 * Returns: 0 on success, -1 on errors (The VPD entry doesn't exist, or the
53 * VPD entry contains non-heximal value.)
55 int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits);
57 #endif /* _SAR_H_ */