Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13837
-gerrit
commit eae6de757e5d5e0e899bfdb59d273a544037df06 Author: Huang, Huki huki.huang@intel.com Date: Thu Jan 21 10:17:06 2016 +0800
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 --- src/vendorcode/google/chromeos/cros_vpd.h | 2 +- src/vendorcode/google/chromeos/wrdd.c | 11 +++++++++-- 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 ca9c320..96ca8af 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 ab27cc0..ad80992 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];