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.
20 #define NUM_SAR_LIMITS 4
21 #define BYTES_PER_SAR_LIMIT 10
29 struct wifi_sar_delta_table
{
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
];
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
;
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
);