summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang, Huki <huki.huang@intel.com>2016-01-21 10:17:06 +0800
committerPatrick Georgi <pgeorgi@google.com>2016-03-08 18:41:57 +0100
commit339886cff4f227d930c23e16db48f3cfc8eaccfc (patch)
treeb634badd00765d3c70cf29f140f8cff34b44d85d
parent7f761658a5b1ce6cdd48202cb1b0c5d7b3b59b91 (diff)
downloadcoreboot-339886cff4f227d930c23e16db48f3cfc8eaccfc.tar.xz
Chromeos: Modify wifi_regulatory_domain to use "region" key in VPD
In ChromeOS VPD spec the right name is "region". Signed-off-by: Hannah Williams <hannah.williams@intel.com> Reviewed-on: https://chromium-review.googlesource.com/322851 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: mukesh agrawal <quiche@chromium.org> (cherry picked from commit 21ea0663e7f3ffe3aaea6b6ce0e1216fcd9ca23e) BUG=chrome-os-partner:50516 BRANCH=glados TEST=build and boot on chell Change-Id: I4ba9a9c65af3732fa263030640495ab5bea91d1f Signed-off-by: Patrick Georgi <pgeorgi@google.com> Original-Commit-Id: 848f18e731eb11dd3037d12607d7364f95e64e34 Original-Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Original-Change-Id: Ib96036f9cd76449f170af5c3dd6ef6e8e91ded94 Original-Reviewed-on: https://chromium-review.googlesource.com/329293 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/13837 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r--src/vendorcode/google/chromeos/cros_vpd.h2
-rw-r--r--src/vendorcode/google/chromeos/wrdd.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/vendorcode/google/chromeos/cros_vpd.h b/src/vendorcode/google/chromeos/cros_vpd.h
index ca9c320d3f..96ca8af329 100644
--- a/src/vendorcode/google/chromeos/cros_vpd.h
+++ b/src/vendorcode/google/chromeos/cros_vpd.h
@@ -7,7 +7,7 @@
#ifndef __CROS_VPD_H__
#define __CROS_VPD_H__
-#define CROS_VPD_WIFI_DOMAINKEY "regions"
+#define CROS_VPD_REGION_NAME "region"
/*
* Reads VPD string value by key.
diff --git a/src/vendorcode/google/chromeos/wrdd.c b/src/vendorcode/google/chromeos/wrdd.c
index ab27cc01b3..ad8099247b 100644
--- a/src/vendorcode/google/chromeos/wrdd.c
+++ b/src/vendorcode/google/chromeos/wrdd.c
@@ -26,6 +26,7 @@
* The first part is the ISO 3166-1 alpha-2 code of the country;
* The second part is a string of up to three alphanumeric characters
*/
+#define VARIANT_SEPARATOR '.'
struct wrdd_code_value_pair {
const char *code;
u16 value;
@@ -50,21 +51,27 @@ uint16_t wifi_regulatory_domain(void)
.value = WRDD_REGULATORY_DOMAIN_INDONESIA
}
};
- const char *wrdd_domain_key = CROS_VPD_WIFI_DOMAINKEY;
+ const char *wrdd_domain_key = CROS_VPD_REGION_NAME;
int i;
struct wrdd_code_value_pair *p;
/* wrdd_domain_value is ISO 3166-2 */
char wrdd_domain_code[7];
+ char *separator;
/* If not found for any reason fall backto the default value */
if (!cros_vpd_gets(wrdd_domain_key, wrdd_domain_code,
- sizeof(wrdd_domain_code))) {
+ ARRAY_SIZE(wrdd_domain_code))) {
printk(BIOS_DEBUG,
"Error: Could not locate '%s' in VPD\n", wrdd_domain_key);
return WRDD_DEFAULT_REGULATORY_DOMAIN;
}
printk(BIOS_DEBUG, "Found '%s'='%s' in VPD\n",
wrdd_domain_key, wrdd_domain_code);
+ separator = memchr(wrdd_domain_code, VARIANT_SEPARATOR,
+ ARRAY_SIZE(wrdd_domain_code));
+ if (separator) {
+ *separator = '\0';
+ }
for (i = 0; i < ARRAY_SIZE(wrdd_table); i++) {
p = &wrdd_table[i];