intel/wifi: Add WGDS ACPI method for Geo Aware SAR

To comply with all relevant bodies throughout the world, SAR settings
take into account the lowest common denominator Tx power settings. This
setup may lead to non-optimal performance when the user location is in a
country that may allow higher power setting. The purpose of Wireless Geo
Delta Settings (WGDS) is to provide offset settings for FCC, Europe,
Japan and Rest of the world. These offsets would be added (by Intel wifi
driver) to the base SAR Tx Power as defined in WRDS and EWRD

BUG=b:65155728
BRANCH=none
TEST=WGDS ACPI table gets created as expected.

Change-Id: I4f602e3f95ff3545db6cc6e428beb9a36abd9296
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/21098
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/src/include/sar.h b/src/include/sar.h
index 4653dd3..e1e0fcb 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
- * Copyright (C) 2017 Intel Corp.
+ * Copyright (C) 2017-2018 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
@@ -15,22 +15,42 @@
 #ifndef _SAR_H_
 #define _SAR_H_
 
+#include <compiler.h>
 #include <stdint.h>
 
 #define NUM_SAR_LIMITS 4
 #define BYTES_PER_SAR_LIMIT 10
+enum {
+	SAR_FCC,
+	SAR_EUROPE_JAPAN,
+	SAR_REST_OF_WORLD,
+	SAR_NUM_WGDS_GROUPS
+};
+
+struct wifi_sar_delta_table {
+	uint8_t version;
+	struct {
+		uint8_t power_max_2400mhz;
+		uint8_t power_chain_a_2400mhz;
+		uint8_t power_chain_b_2400mhz;
+		uint8_t power_max_5200mhz;
+		uint8_t power_chain_a_5200mhz;
+		uint8_t power_chain_b_5200mhz;
+	} __packed group[SAR_NUM_WGDS_GROUPS];
+} __packed;
 
 /* 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];
-};
+	struct wifi_sar_delta_table wgds;
+} __packed;
 
 /*
  * 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
+ * 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);