aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cfp.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-04-09 23:06:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 15:10:28 -0400
commit9e04a7c6d45fd70be55fcb48ec49f55dad9928f7 (patch)
tree2cb4cf2ca4279b493fa92c3a9ee1cb226a64668b /drivers/net/wireless/mwifiex/cfp.c
parentd35ccaa4768ee39f7bb3c23394703d1da587c731 (diff)
mwifiex: set default regulatory domain
Driver gets region code from FW during initialisation. This patch makes use of it for settting default regulatory domain using regulatory_hint() API. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfp.c')
-rw-r--r--drivers/net/wireless/mwifiex/cfp.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c
index 2fe1c33765b8..560871b0e236 100644
--- a/drivers/net/wireless/mwifiex/cfp.c
+++ b/drivers/net/wireless/mwifiex/cfp.c
@@ -71,6 +71,37 @@ u16 region_code_index[MWIFIEX_MAX_REGION_CODE] = { 0x10, 0x20, 0x30,
71 71
72static u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 }; 72static u8 supported_rates_n[N_SUPPORTED_RATES] = { 0x02, 0x04, 0 };
73 73
74struct region_code_mapping {
75 u8 code;
76 u8 region[IEEE80211_COUNTRY_STRING_LEN];
77};
78
79static struct region_code_mapping region_code_mapping_t[] = {
80 { 0x10, "US " }, /* US FCC */
81 { 0x20, "CA " }, /* IC Canada */
82 { 0x30, "EU " }, /* ETSI */
83 { 0x31, "ES " }, /* Spain */
84 { 0x32, "FR " }, /* France */
85 { 0x40, "JP " }, /* Japan */
86 { 0x41, "JP " }, /* Japan */
87 { 0x50, "CN " }, /* China */
88};
89
90/* This function converts integer code to region string */
91u8 *mwifiex_11d_code_2_region(u8 code)
92{
93 u8 i;
94 u8 size = sizeof(region_code_mapping_t)/
95 sizeof(struct region_code_mapping);
96
97 /* Look for code in mapping table */
98 for (i = 0; i < size; i++)
99 if (region_code_mapping_t[i].code == code)
100 return region_code_mapping_t[i].region;
101
102 return NULL;
103}
104
74/* 105/*
75 * This function maps an index in supported rates table into 106 * This function maps an index in supported rates table into
76 * the corresponding data rate. 107 * the corresponding data rate.