summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-08 01:01:14 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-09-08 01:01:14 -0300
commite5fd91f1ef340da553f7a79da9540c3db711c937 (patch)
treeb11842027dc6641da63f4bcc524f8678263304a3 /drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
parent2a9b0348e685a63d97486f6749622b61e9e3292f (diff)
Linux-libre 4.2-gnu
Diffstat (limited to 'drivers/staging/rtl8188eu/core/rtw_ioctl_set.c')
-rw-r--r--drivers/staging/rtl8188eu/core/rtw_ioctl_set.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 969150a48..8c05cb021 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -642,21 +642,18 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
*/
int rtw_set_country(struct adapter *adapter, const char *country_code)
{
+ int i;
int channel_plan = RT_CHANNEL_DOMAIN_WORLD_WIDE_5G;
DBG_88E("%s country_code:%s\n", __func__, country_code);
+ for (i = 0; i < ARRAY_SIZE(channel_table); i++) {
+ if (0 == strcmp(channel_table[i].name, country_code)) {
+ channel_plan = channel_table[i].channel_plan;
+ break;
+ }
+ }
- /* TODO: should have a table to match country code and RT_CHANNEL_DOMAIN */
- /* TODO: should consider 2-character and 3-character country code */
- if (0 == strcmp(country_code, "US"))
- channel_plan = RT_CHANNEL_DOMAIN_FCC;
- else if (0 == strcmp(country_code, "EU"))
- channel_plan = RT_CHANNEL_DOMAIN_ETSI;
- else if (0 == strcmp(country_code, "JP"))
- channel_plan = RT_CHANNEL_DOMAIN_MKK;
- else if (0 == strcmp(country_code, "CN"))
- channel_plan = RT_CHANNEL_DOMAIN_CHINA;
- else
+ if (i == ARRAY_SIZE(channel_table))
DBG_88E("%s unknown country_code:%s\n", __func__, country_code);
return rtw_set_chplan_cmd(adapter, channel_plan, 1);