From ed840023a84915ece4bc63edffef979926107d55 Mon Sep 17 00:00:00 2001 From: Robbie Zhang Date: Fri, 23 Dec 2016 11:43:07 -0800 Subject: chromeos: Implement locating and decoding wifi sar data from VPD A VPD entry "wifi_sar" needs to be created which contains a heximal encoded string in length of 40 bytes. get_wifi_sar_limits() function retrieves and decodes the data from the VPD entry, which would later be consumed by platform code. BUG=chrome-os-partner:60821 TEST=Build and boot lars and reef Change-Id: I923b58a63dc1f8a7fdd685cf1c618b2fdf4e7061 Signed-off-by: Robbie Zhang Reviewed-on: https://review.coreboot.org/17958 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/include/sar.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/include/sar.h (limited to 'src/include') diff --git a/src/include/sar.h b/src/include/sar.h new file mode 100644 index 0000000000..4653dd33ae --- /dev/null +++ b/src/include/sar.h @@ -0,0 +1,38 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2017 Intel Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#ifndef _SAR_H_ +#define _SAR_H_ + +#include + +#define NUM_SAR_LIMITS 4 +#define BYTES_PER_SAR_LIMIT 10 + +/* Wifi SAR limit table structure */ +struct wifi_sar_limits { + /* Total 4 SAR limit sets, each has 10 bytes */ + uint8_t sar_limit[NUM_SAR_LIMITS][BYTES_PER_SAR_LIMIT]; +}; + +/* + * Retrieve the SAR limits data from VPD and decode it. + * sar_limits: Pointer to wifi_sar_limits where the resulted data is stored + * + * Returns: 0 on success, -1 on errors (The VPD entry doesn't exist, or the + * VPD entry contains non-heximal value.) + */ +int get_wifi_sar_limits(struct wifi_sar_limits *sar_limits); + +#endif /* _SAR_H_ */ -- cgit v1.2.3