diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-02-14 17:48:56 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2011-02-14 18:08:19 -0800 |
commit | 696ecacfc59e5a8e822afb6a8f92b35cfdcabb63 (patch) | |
tree | 0b49e924a4af17627270a917c0199b1e181eea42 /drivers/net | |
parent | 69fa8ccfb7878a9e4b016201c4ccf58a68261cd3 (diff) |
net: wireless: bcm4329: Get country translation from platform data
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/bcm4329/dhd_custom_gpio.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/bcm4329/dhd_linux.c | 11 |
2 files changed, 36 insertions, 11 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd_custom_gpio.c b/drivers/net/wireless/bcm4329/dhd_custom_gpio.c index 4739b97b48bc..aaca56cb7c25 100644 --- a/drivers/net/wireless/bcm4329/dhd_custom_gpio.c +++ b/drivers/net/wireless/bcm4329/dhd_custom_gpio.c @@ -47,6 +47,7 @@ int wifi_set_carddetect(int on); int wifi_set_power(int on, unsigned long msec); int wifi_get_irq_number(unsigned long *irq_flags_ptr); int wifi_get_mac_addr(unsigned char *buf); +void *wifi_get_country_code(char *ccode); #endif #if defined(OOB_INTR_ONLY) @@ -178,23 +179,22 @@ dhd_custom_get_mac_address(unsigned char *buf) } #endif /* GET_CUSTOM_MAC_ENABLE */ -#define EXAMPLE_TABLE /* Customized Locale table : OPTIONAL feature */ const struct cntry_locales_custom translate_custom_table[] = { /* Table should be filled out based on custom platform regulatory requirement */ #ifdef EXAMPLE_TABLE {"US", "US", 69}, /* input ISO "US" to : US regrev 69 */ {"CA", "US", 69}, /* input ISO "CA" to : US regrev 69 */ - {"EU", "EU", 05}, /* input ISO "EU" to : EU regrev 05 */ - {"FR", "EU", 05}, - {"DE", "EU", 05}, - {"IR", "EU", 05}, - {"UK", "EU", 05}, /* input ISO "UK" to : EU regrev 05 */ - {"KR", "XY", 03}, - {"AU", "XY", 03}, - {"CN", "XY", 03}, /* input ISO "CN" to : XY regrev 03 */ - {"TW", "XY", 03}, - {"AR", "XY", 03} + {"EU", "EU", 5}, /* input ISO "EU" to : EU regrev 05 */ + {"FR", "EU", 5}, + {"DE", "EU", 5}, + {"IR", "EU", 5}, + {"UK", "EU", 5}, /* input ISO "UK" to : EU regrev 05 */ + {"KR", "XY", 3}, + {"AU", "XY", 3}, + {"CN", "XY", 3}, /* input ISO "CN" to : XY regrev 03 */ + {"TW", "XY", 3}, + {"AR", "XY", 3} #endif /* EXAMPLE_TABLE */ }; @@ -205,6 +205,19 @@ const struct cntry_locales_custom translate_custom_table[] = { */ void get_customized_country_code(char *country_iso_code, wl_country_t *cspec) { +#ifdef CUSTOMER_HW2 + struct cntry_locales_custom *cloc_ptr; + + if (!cspec) + return; + + cloc_ptr = wifi_get_country_code(country_iso_code); + if (cloc_ptr) { + strlcpy(cspec->ccode, cloc_ptr->custom_locale, WLC_CNTRY_BUF_SZ); + cspec->rev = cloc_ptr->custom_locale_rev; + } + return; +#else int size, i; size = ARRAYSIZE(translate_custom_table); @@ -223,4 +236,5 @@ void get_customized_country_code(char *country_iso_code, wl_country_t *cspec) } } return; +#endif } diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c index 389a6ecc58a5..3bfdd6989fba 100644 --- a/drivers/net/wireless/bcm4329/dhd_linux.c +++ b/drivers/net/wireless/bcm4329/dhd_linux.c @@ -126,6 +126,17 @@ int wifi_get_mac_addr(unsigned char *buf) return -EOPNOTSUPP; } +void *wifi_get_country_code(char *ccode) +{ + DHD_TRACE(("%s\n", __FUNCTION__)); + if (!ccode) + return NULL; + if (wifi_control_data && wifi_control_data->get_country_code) { + return wifi_control_data->get_country_code(ccode); + } + return NULL; +} + static int wifi_probe(struct platform_device *pdev) { struct wifi_platform_data *wifi_ctrl = |