net: wireless: bcm4329: Get country translation from platform data

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
Dmitry Shmidt
2011-02-14 17:48:56 -08:00
committed by Colin Cross
parent 51d4429a28
commit eb4a0fc0cf
2 changed files with 36 additions and 11 deletions

View File

@@ -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
}

View File

@@ -127,6 +127,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 =