Commit 84e18a94 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

staging: ks7010: indent ks7010_config.c

Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d7696bc
...@@ -15,7 +15,8 @@ static int wep_type; ...@@ -15,7 +15,8 @@ static int wep_type;
#define WEP_KEY_HEX 1 #define WEP_KEY_HEX 1
static static
void analyze_character_wep_key(struct ks_wlan_parameter *param, int wep_key_index, char *value) void analyze_character_wep_key(struct ks_wlan_parameter *param,
int wep_key_index, char *value)
{ {
int i; int i;
unsigned char wep_key[26], key_length; unsigned char wep_key[26], key_length;
...@@ -23,64 +24,69 @@ void analyze_character_wep_key(struct ks_wlan_parameter *param, int wep_key_inde ...@@ -23,64 +24,69 @@ void analyze_character_wep_key(struct ks_wlan_parameter *param, int wep_key_inde
key_length = (wep_on_off == WEP_ON_64BIT) ? 5 : 13; key_length = (wep_on_off == WEP_ON_64BIT) ? 5 : 13;
/* 64bit key_length = 5; 128bit key_length = 13; */ /* 64bit key_length = 5; 128bit key_length = 13; */
for (i=0; i<key_length; i++) { for (i = 0; i < key_length; i++) {
wep_key[i] = value[i]; wep_key[i] = value[i];
} }
if(wep_key_index < 0 || wep_key_index > 3) if (wep_key_index < 0 || wep_key_index > 3)
return; return;
param->wep_key[wep_key_index].size = key_length; param->wep_key[wep_key_index].size = key_length;
for (i=0; i<(param->wep_key[wep_key_index].size); i++) { for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
param->wep_key[wep_key_index].val[i] = wep_key[i]; param->wep_key[wep_key_index].val[i] = wep_key[i];
} }
} }
static static
void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, char *value) void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index,
char *value)
{ {
unsigned char wep_end[26], i, j, key_length; unsigned char wep_end[26], i, j, key_length;
key_length = (wep_on_off == WEP_ON_64BIT) ? 10 : 26; key_length = (wep_on_off == WEP_ON_64BIT) ? 10 : 26;
/* 64bit key_length = 10; 128bit key_length = 26; */ /* 64bit key_length = 10; 128bit key_length = 26; */
for (i=0; i<key_length; i++) { for (i = 0; i < key_length; i++) {
wep_end[i] = value[i]; wep_end[i] = value[i];
if (i % 2) { if (i % 2) {
/* Odd */ /* Odd */
for (j=0x00; j<0x10; j++) { for (j = 0x00; j < 0x10; j++) {
if (j<0x0a) { if (j < 0x0a) {
if (wep_end[i] == j+0x30) if (wep_end[i] == j + 0x30)
wep_end[i] = j; wep_end[i] = j;
} else { } else {
if ((wep_end[i] == j+0x37) | (wep_end[i] == j+0x57)) if ((wep_end[i] ==
j + 0x37) | (wep_end[i] ==
j + 0x57))
wep_end[i] = j; wep_end[i] = j;
} }
} }
} else { } else {
/* Even */ /* Even */
for (j=0x00; j<0x10; j++) { for (j = 0x00; j < 0x10; j++) {
if (j<0x0a) { if (j < 0x0a) {
if (wep_end[i] == j+0x30) { if (wep_end[i] == j + 0x30) {
wep_end[i] = j*16; wep_end[i] = j * 16;
} }
} else { } else {
if ((wep_end[i] == j+0x37) | (wep_end[i] == j+0x57)) if ((wep_end[i] ==
wep_end[i] = j*16; j + 0x37) | (wep_end[i] ==
j + 0x57))
wep_end[i] = j * 16;
} }
} }
} }
} }
for (i=0; i<key_length/2; i++) { for (i = 0; i < key_length / 2; i++) {
wep_end[i] = wep_end[i*2] + wep_end[(i*2)+1]; wep_end[i] = wep_end[i * 2] + wep_end[(i * 2) + 1];
} }
if(wep_key_index < 0 || wep_key_index > 3) if (wep_key_index < 0 || wep_key_index > 3)
return ; return;
param->wep_key[wep_key_index].size = key_length/2; param->wep_key[wep_key_index].size = key_length / 2;
for (i=0; i<(param->wep_key[wep_key_index].size); i++) { for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
param->wep_key[wep_key_index].val[i] = wep_end[i]; param->wep_key[wep_key_index].val[i] = wep_end[i];
} }
...@@ -89,32 +95,28 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, cha ...@@ -89,32 +95,28 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, cha
static static
int rate_set_configuration(struct ks_wlan_private *priv, char *value) int rate_set_configuration(struct ks_wlan_private *priv, char *value)
{ {
int rc=0; int rc = 0;
priv->reg.tx_rate = TX_RATE_FIXED; priv->reg.tx_rate = TX_RATE_FIXED;
priv->reg.rate_set.size = 1; priv->reg.rate_set.size = 1;
switch(*value){ switch (*value) {
case '1': /* 1M 11M 12M 18M */ case '1': /* 1M 11M 12M 18M */
if(*(value+1) == '8'){ if (*(value + 1) == '8') {
priv->reg.rate_set.body[0] = TX_RATE_18M; priv->reg.rate_set.body[0] = TX_RATE_18M;
} } else if (*(value + 1) == '2') {
else if(*(value+1) == '2'){ priv->reg.rate_set.body[0] = TX_RATE_12M | BASIC_RATE;
priv->reg.rate_set.body[0] = TX_RATE_12M|BASIC_RATE; } else if (*(value + 1) == '1') {
} priv->reg.rate_set.body[0] = TX_RATE_11M | BASIC_RATE;
else if(*(value+1) == '1'){ } else {
priv->reg.rate_set.body[0] = TX_RATE_11M|BASIC_RATE; priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
}
else{
priv->reg.rate_set.body[0] = TX_RATE_1M|BASIC_RATE;
} }
break; break;
case '2': /* 2M 24M */ case '2': /* 2M 24M */
if(*(value+1) == '4'){ if (*(value + 1) == '4') {
priv->reg.rate_set.body[0] = TX_RATE_24M|BASIC_RATE; priv->reg.rate_set.body[0] = TX_RATE_24M | BASIC_RATE;
} } else {
else{ priv->reg.rate_set.body[0] = TX_RATE_2M | BASIC_RATE;
priv->reg.rate_set.body[0] = TX_RATE_2M|BASIC_RATE;
} }
break; break;
case '3': /* 36M */ case '3': /* 36M */
...@@ -124,15 +126,14 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value) ...@@ -124,15 +126,14 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value)
priv->reg.rate_set.body[0] = TX_RATE_48M; priv->reg.rate_set.body[0] = TX_RATE_48M;
break; break;
case '5': /* 5.5M 54M */ case '5': /* 5.5M 54M */
if(*(value+1) == '4'){ if (*(value + 1) == '4') {
priv->reg.rate_set.body[0] = TX_RATE_54M; priv->reg.rate_set.body[0] = TX_RATE_54M;
} } else {
else{ priv->reg.rate_set.body[0] = TX_RATE_5M | BASIC_RATE;
priv->reg.rate_set.body[0] = TX_RATE_5M|BASIC_RATE;
} }
break; break;
case '6': /* 6M */ case '6': /* 6M */
priv->reg.rate_set.body[0] = TX_RATE_6M|BASIC_RATE; priv->reg.rate_set.body[0] = TX_RATE_6M | BASIC_RATE;
break; break;
case '9': /* 9M */ case '9': /* 9M */
priv->reg.rate_set.body[0] = TX_RATE_9M; priv->reg.rate_set.body[0] = TX_RATE_9M;
...@@ -140,11 +141,11 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value) ...@@ -140,11 +141,11 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value)
case 'K': case 'K':
priv->reg.rate_set.body[6] = TX_RATE_36M; priv->reg.rate_set.body[6] = TX_RATE_36M;
priv->reg.rate_set.body[5] = TX_RATE_18M; priv->reg.rate_set.body[5] = TX_RATE_18M;
priv->reg.rate_set.body[4] = TX_RATE_24M|BASIC_RATE; priv->reg.rate_set.body[4] = TX_RATE_24M | BASIC_RATE;
priv->reg.rate_set.body[3] = TX_RATE_12M|BASIC_RATE; priv->reg.rate_set.body[3] = TX_RATE_12M | BASIC_RATE;
priv->reg.rate_set.body[2] = TX_RATE_6M|BASIC_RATE; priv->reg.rate_set.body[2] = TX_RATE_6M | BASIC_RATE;
priv->reg.rate_set.body[1] = TX_RATE_11M|BASIC_RATE; priv->reg.rate_set.body[1] = TX_RATE_11M | BASIC_RATE;
priv->reg.rate_set.body[0] = TX_RATE_2M|BASIC_RATE; priv->reg.rate_set.body[0] = TX_RATE_2M | BASIC_RATE;
priv->reg.tx_rate = TX_RATE_FULL_AUTO; priv->reg.tx_rate = TX_RATE_FULL_AUTO;
priv->reg.rate_set.size = 7; priv->reg.rate_set.size = 7;
break; break;
...@@ -154,13 +155,13 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value) ...@@ -154,13 +155,13 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value)
priv->reg.rate_set.body[9] = TX_RATE_36M; priv->reg.rate_set.body[9] = TX_RATE_36M;
priv->reg.rate_set.body[8] = TX_RATE_18M; priv->reg.rate_set.body[8] = TX_RATE_18M;
priv->reg.rate_set.body[7] = TX_RATE_9M; priv->reg.rate_set.body[7] = TX_RATE_9M;
priv->reg.rate_set.body[6] = TX_RATE_24M|BASIC_RATE; priv->reg.rate_set.body[6] = TX_RATE_24M | BASIC_RATE;
priv->reg.rate_set.body[5] = TX_RATE_12M|BASIC_RATE; priv->reg.rate_set.body[5] = TX_RATE_12M | BASIC_RATE;
priv->reg.rate_set.body[4] = TX_RATE_6M|BASIC_RATE; priv->reg.rate_set.body[4] = TX_RATE_6M | BASIC_RATE;
priv->reg.rate_set.body[3] = TX_RATE_11M|BASIC_RATE; priv->reg.rate_set.body[3] = TX_RATE_11M | BASIC_RATE;
priv->reg.rate_set.body[2] = TX_RATE_5M|BASIC_RATE; priv->reg.rate_set.body[2] = TX_RATE_5M | BASIC_RATE;
priv->reg.rate_set.body[1] = TX_RATE_2M|BASIC_RATE; priv->reg.rate_set.body[1] = TX_RATE_2M | BASIC_RATE;
priv->reg.rate_set.body[0] = TX_RATE_1M|BASIC_RATE; priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
priv->reg.tx_rate = TX_RATE_FULL_AUTO; priv->reg.tx_rate = TX_RATE_FULL_AUTO;
priv->reg.rate_set.size = 12; priv->reg.rate_set.size = 12;
break; break;
...@@ -176,34 +177,34 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -176,34 +177,34 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
const char *key; const char *key;
const char *val; const char *val;
} cfg_tbl[] = { } cfg_tbl[] = {
{15,"BeaconLostCount", "20"}, /* 0 */ {15, "BeaconLostCount", "20"}, /* 0 */
{7,"Channel", "1"}, /* 1 */ {7, "Channel", "1"}, /* 1 */
{17,"FragmentThreshold","2346"}, /* 2 */ {17, "FragmentThreshold", "2346"}, /* 2 */
{13,"OperationMode","Infrastructure"}, /* 3 */ {13, "OperationMode", "Infrastructure"}, /* 3 */
{19,"PowerManagementMode","ACTIVE"}, /* 4 */ {19, "PowerManagementMode", "ACTIVE"}, /* 4 */
{12,"RTSThreshold","2347"}, /* 5 */ {12, "RTSThreshold", "2347"}, /* 5 */
{4,"SSID","default"}, /* 6 */ {4, "SSID", "default"}, /* 6 */
{6,"TxRate","Auto"}, /* 7 */ {6, "TxRate", "Auto"}, /* 7 */
{23,"AuthenticationAlgorithm",""}, /* 8 */ {23, "AuthenticationAlgorithm", ""}, /* 8 */
{12,"WepKeyValue1",""}, /* 9 */ {12, "WepKeyValue1", ""}, /* 9 */
{12,"WepKeyValue2",""}, /* 10 */ {12, "WepKeyValue2", ""}, /* 10 */
{12,"WepKeyValue3",""}, /* 11 */ {12, "WepKeyValue3", ""}, /* 11 */
{12,"WepKeyValue4",""}, /* 12 */ {12, "WepKeyValue4", ""}, /* 12 */
{8,"WepIndex","1"}, /* 13 */ {8, "WepIndex", "1"}, /* 13 */
{7,"WepType","STRING"}, /* 14 */ {7, "WepType", "STRING"}, /* 14 */
{3,"Wep","OFF"}, /* 15 */ {3, "Wep", "OFF"}, /* 15 */
{13,"PREAMBLE_TYPE","LONG"}, /* 16 */ {13, "PREAMBLE_TYPE", "LONG"}, /* 16 */
{8,"ScanType","ACTIVE_SCAN"}, /* 17 */ {8, "ScanType", "ACTIVE_SCAN"}, /* 17 */
{8,"ROM_FILE", ROM_FILE}, /* 18 */ {8, "ROM_FILE", ROM_FILE}, /* 18 */
{7,"PhyType", "BG_MODE"}, /* 19 */ {7, "PhyType", "BG_MODE"}, /* 19 */
{7,"CtsMode", "FALSE"}, /* 20 */ {7, "CtsMode", "FALSE"}, /* 20 */
{19,"PhyInformationTimer", "0"}, /* 21 */ {19, "PhyInformationTimer", "0"}, /* 21 */
{0,"",""}, {0, "", ""},
}; };
const struct firmware *fw_entry; const struct firmware *fw_entry;
struct device *dev = NULL; struct device *dev = NULL;
char cfg_file[]=CFG_FILE; char cfg_file[] = CFG_FILE;
char *cur_p, *end_p; char *cur_p, *end_p;
char wk_buff[256], *wk_p; char wk_buff[256], *wk_p;
...@@ -228,11 +229,11 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -228,11 +229,11 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM; /* AuthenticationAlgorithm */ priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM; /* AuthenticationAlgorithm */
priv->reg.privacy_invoked = 0x00; /* WEP */ priv->reg.privacy_invoked = 0x00; /* WEP */
priv->reg.wep_index=0; priv->reg.wep_index = 0;
memset(&priv->reg.wep_key[0],0,sizeof(priv->reg.wep_key[0])); memset(&priv->reg.wep_key[0], 0, sizeof(priv->reg.wep_key[0]));
memset(&priv->reg.wep_key[1],0,sizeof(priv->reg.wep_key[0])); memset(&priv->reg.wep_key[1], 0, sizeof(priv->reg.wep_key[0]));
memset(&priv->reg.wep_key[2],0,sizeof(priv->reg.wep_key[0])); memset(&priv->reg.wep_key[2], 0, sizeof(priv->reg.wep_key[0]));
memset(&priv->reg.wep_key[3],0,sizeof(priv->reg.wep_key[0])); memset(&priv->reg.wep_key[3], 0, sizeof(priv->reg.wep_key[0]));
priv->reg.phy_type = D_11BG_COMPATIBLE_MODE; priv->reg.phy_type = D_11BG_COMPATIBLE_MODE;
priv->reg.cts_mode = CTS_MODE_FALSE; priv->reg.cts_mode = CTS_MODE_FALSE;
...@@ -242,13 +243,13 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -242,13 +243,13 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
priv->reg.rate_set.body[9] = TX_RATE_36M; priv->reg.rate_set.body[9] = TX_RATE_36M;
priv->reg.rate_set.body[8] = TX_RATE_18M; priv->reg.rate_set.body[8] = TX_RATE_18M;
priv->reg.rate_set.body[7] = TX_RATE_9M; priv->reg.rate_set.body[7] = TX_RATE_9M;
priv->reg.rate_set.body[6] = TX_RATE_24M|BASIC_RATE; priv->reg.rate_set.body[6] = TX_RATE_24M | BASIC_RATE;
priv->reg.rate_set.body[5] = TX_RATE_12M|BASIC_RATE; priv->reg.rate_set.body[5] = TX_RATE_12M | BASIC_RATE;
priv->reg.rate_set.body[4] = TX_RATE_6M|BASIC_RATE; priv->reg.rate_set.body[4] = TX_RATE_6M | BASIC_RATE;
priv->reg.rate_set.body[3] = TX_RATE_11M|BASIC_RATE; priv->reg.rate_set.body[3] = TX_RATE_11M | BASIC_RATE;
priv->reg.rate_set.body[2] = TX_RATE_5M|BASIC_RATE; priv->reg.rate_set.body[2] = TX_RATE_5M | BASIC_RATE;
priv->reg.rate_set.body[1] = TX_RATE_2M|BASIC_RATE; priv->reg.rate_set.body[1] = TX_RATE_2M | BASIC_RATE;
priv->reg.rate_set.body[0] = TX_RATE_1M|BASIC_RATE; priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
priv->reg.tx_rate = TX_RATE_FULL_AUTO; priv->reg.tx_rate = TX_RATE_FULL_AUTO;
priv->reg.rate_set.size = 12; priv->reg.rate_set.size = 12;
...@@ -257,7 +258,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -257,7 +258,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
if (request_firmware_direct(&fw_entry, cfg_file, dev)) if (request_firmware_direct(&fw_entry, cfg_file, dev))
return 0; return 0;
DPRINTK(4, "success request_firmware() file=%s size=%zu\n", cfg_file, fw_entry->size); DPRINTK(4, "success request_firmware() file=%s size=%zu\n", cfg_file,
fw_entry->size);
cur_p = fw_entry->data; cur_p = fw_entry->data;
end_p = cur_p + fw_entry->size; end_p = cur_p + fw_entry->size;
*end_p = '\0'; *end_p = '\0';
...@@ -266,7 +268,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -266,7 +268,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
int i, j, len; int i, j, len;
len = end_p - cur_p; len = end_p - cur_p;
for (i=0; cfg_tbl[i].key_len != 0; i++) { for (i = 0; cfg_tbl[i].key_len != 0; i++) {
if (*cur_p == '#') { if (*cur_p == '#') {
break; break;
} }
...@@ -298,20 +300,23 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -298,20 +300,23 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
} }
cur_p++; cur_p++;
for (j=0,wk_p=cur_p; *wk_p != '\n' && wk_p < end_p; j++,wk_p++) { for (j = 0, wk_p = cur_p; *wk_p != '\n' && wk_p < end_p;
j++, wk_p++) {
wk_buff[j] = *wk_p; wk_buff[j] = *wk_p;
} }
wk_buff[j] = '\0'; wk_buff[j] = '\0';
cur_p = wk_p; cur_p = wk_p;
DPRINTK(4,"%s=%s\n",cfg_tbl[i].key, wk_buff); DPRINTK(4, "%s=%s\n", cfg_tbl[i].key, wk_buff);
wk_p = wk_buff; wk_p = wk_buff;
switch (i) { switch (i) {
case 0: /* "BeaconLostCount", "10" */ case 0: /* "BeaconLostCount", "10" */
priv->reg.beacon_lost_count = simple_strtol(wk_buff, NULL, 10); priv->reg.beacon_lost_count =
simple_strtol(wk_buff, NULL, 10);
break; break;
case 1: /* "Channel", "1" */ case 1: /* "Channel", "1" */
priv->reg.channel = simple_strtol(wk_buff, NULL, 10); priv->reg.channel =
simple_strtol(wk_buff, NULL, 10);
break; break;
case 2: /* "FragmentThreshold","2346" */ case 2: /* "FragmentThreshold","2346" */
j = simple_strtol(wk_buff, NULL, 10); j = simple_strtol(wk_buff, NULL, 10);
...@@ -320,22 +325,25 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -320,22 +325,25 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
case 3: /* "OperationMode","Infrastructure" */ case 3: /* "OperationMode","Infrastructure" */
switch (*wk_buff) { switch (*wk_buff) {
case 'P': case 'P':
priv->reg.operation_mode = MODE_PSEUDO_ADHOC; priv->reg.operation_mode =
MODE_PSEUDO_ADHOC;
break; break;
case 'I': case 'I':
priv->reg.operation_mode = MODE_INFRASTRUCTURE; priv->reg.operation_mode =
MODE_INFRASTRUCTURE;
break; break;
case '8': case '8':
priv->reg.operation_mode = MODE_ADHOC; priv->reg.operation_mode = MODE_ADHOC;
break; break;
default: default:
priv->reg.operation_mode = MODE_INFRASTRUCTURE; priv->reg.operation_mode =
MODE_INFRASTRUCTURE;
} }
break; break;
case 4: /* "PowerManagementMode","POWER_ACTIVE" */ case 4: /* "PowerManagementMode","POWER_ACTIVE" */
if (!strncmp(wk_buff, "SAVE1", 5)) { if (!strncmp(wk_buff, "SAVE1", 5)) {
priv->reg.powermgt = POWMGT_SAVE1_MODE; priv->reg.powermgt = POWMGT_SAVE1_MODE;
} else if (!strncmp(wk_buff, "SAVE2", 5)){ } else if (!strncmp(wk_buff, "SAVE2", 5)) {
priv->reg.powermgt = POWMGT_SAVE2_MODE; priv->reg.powermgt = POWMGT_SAVE2_MODE;
} else { } else {
priv->reg.powermgt = POWMGT_ACTIVE_MODE; priv->reg.powermgt = POWMGT_ACTIVE_MODE;
...@@ -349,7 +357,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -349,7 +357,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
if (*wk_p != '"') if (*wk_p != '"')
break; break;
wk_p++; wk_p++;
for (j=0; *wk_p != '"'; j++) { for (j = 0; *wk_p != '"'; j++) {
if (wk_p == '\0') { if (wk_p == '\0') {
break; break;
} }
...@@ -365,10 +373,12 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -365,10 +373,12 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
case 8: /* "AuthenticationAlgorithm","OPEN_SYSTEM" */ case 8: /* "AuthenticationAlgorithm","OPEN_SYSTEM" */
switch (*wk_p) { switch (*wk_p) {
case 'O': /* Authenticate System : Open System */ case 'O': /* Authenticate System : Open System */
priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM; priv->reg.authenticate_type =
AUTH_TYPE_OPEN_SYSTEM;
break; break;
case 'S': /* Authenticate System : Shared Key */ case 'S': /* Authenticate System : Shared Key */
priv->reg.authenticate_type = AUTH_TYPE_SHARED_KEY; priv->reg.authenticate_type =
AUTH_TYPE_SHARED_KEY;
break; break;
} }
break; break;
...@@ -379,16 +389,20 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -379,16 +389,20 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
if (wep_on_off != WEP_OFF) { if (wep_on_off != WEP_OFF) {
switch (wep_type) { switch (wep_type) {
case WEP_KEY_CHARACTER: case WEP_KEY_CHARACTER:
analyze_character_wep_key(&priv->reg, (i-9), wk_p); analyze_character_wep_key
(&priv->reg, (i - 9), wk_p);
break; break;
case WEP_KEY_HEX: case WEP_KEY_HEX:
analyze_hex_wep_key(&priv->reg, (i-9), wk_p); analyze_hex_wep_key(&priv->reg,
(i - 9),
wk_p);
break; break;
} }
} }
break; break;
case 13: /* "WepIndex","1"->0 (So, Zero Origin) */ case 13: /* "WepIndex","1"->0 (So, Zero Origin) */
priv->reg.wep_index = simple_strtol(wk_buff, NULL, 10) - 1; priv->reg.wep_index =
simple_strtol(wk_buff, NULL, 10) - 1;
break; break;
case 14: /* "WepType","STRING" */ case 14: /* "WepType","STRING" */
if (!strncmp(wk_buff, "STRING", 6)) { if (!strncmp(wk_buff, "STRING", 6)) {
...@@ -428,7 +442,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -428,7 +442,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
if (*wk_p != '"') if (*wk_p != '"')
break; break;
wk_p++; wk_p++;
for (j=0; *wk_p != '"'; j++) { for (j = 0; *wk_p != '"'; j++) {
if (wk_p == '\0') { if (wk_p == '\0') {
break; break;
} }
...@@ -443,7 +457,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -443,7 +457,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
} else if (!strncmp(wk_buff, "G_MODE", 6)) { } else if (!strncmp(wk_buff, "G_MODE", 6)) {
priv->reg.phy_type = D_11G_ONLY_MODE; priv->reg.phy_type = D_11G_ONLY_MODE;
} else { } else {
priv->reg.phy_type = D_11BG_COMPATIBLE_MODE; priv->reg.phy_type =
D_11BG_COMPATIBLE_MODE;
} }
break; break;
case 20: /* "CtsMode", "FALSE" */ case 20: /* "CtsMode", "FALSE" */
...@@ -455,7 +470,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -455,7 +470,7 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
break; break;
case 21: /* "PhyInformationTimer", "0" */ case 21: /* "PhyInformationTimer", "0" */
j = simple_strtol(wk_buff, NULL, 10); j = simple_strtol(wk_buff, NULL, 10);
priv->reg.phy_info_timer = (uint16_t)j; priv->reg.phy_info_timer = (uint16_t) j;
break; break;
default: default:
break; break;
...@@ -469,17 +484,17 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv) ...@@ -469,17 +484,17 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
} }
release_firmware(fw_entry); release_firmware(fw_entry);
DPRINTK(3,"\n operation_mode = %d\n channel = %d\n ssid = %s\n tx_rate = %d\n \ DPRINTK(3,
"\n operation_mode = %d\n channel = %d\n ssid = %s\n tx_rate = %d\n \
preamble = %d\n powermgt = %d\n scan_type = %d\n beacon_lost_count = %d\n rts = %d\n \ preamble = %d\n powermgt = %d\n scan_type = %d\n beacon_lost_count = %d\n rts = %d\n \
fragment = %d\n privacy_invoked = %d\n wep_type = %d\n wep_on_off = %d\n wep_index = %d\n romfile = %s\n", fragment = %d\n privacy_invoked = %d\n wep_type = %d\n wep_on_off = %d\n wep_index = %d\n romfile = %s\n",
priv->reg.operation_mode,priv->reg.channel,&priv->reg.ssid.body[0],priv->reg.tx_rate, priv->reg.operation_mode, priv->reg.channel, &priv->reg.ssid.body[0], priv->reg.tx_rate, priv->reg.preamble, priv->reg.powermgt, priv->reg.scan_type, priv->reg.beacon_lost_count, priv->reg.rts, priv->reg.fragment, priv->reg.privacy_invoked, wep_type, wep_on_off,
priv->reg.preamble,priv->reg.powermgt,priv->reg.scan_type,priv->reg.beacon_lost_count, priv->reg.wep_index, &priv->reg.rom_file[0]
priv->reg.rts,priv->reg.fragment,priv->reg.privacy_invoked,wep_type,wep_on_off,priv->reg.wep_index,
&priv->reg.rom_file[0]
); );
DPRINTK(3,"\n phy_type = %d\n cts_mode = %d\n tx_rate = %d\n phy_info_timer = %d\n", DPRINTK(3,
priv->reg.phy_type,priv->reg.cts_mode,priv->reg.tx_rate,priv->reg.phy_info_timer ); "\n phy_type = %d\n cts_mode = %d\n tx_rate = %d\n phy_info_timer = %d\n",
priv->reg.phy_type, priv->reg.cts_mode, priv->reg.tx_rate,
priv->reg.phy_info_timer);
return(0); return (0);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment