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

staging: ks7010: indent ks7010_config.c

parent 5d7696bc
Loading
Loading
Loading
Loading
+184 −169
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@ static int wep_type;
#define	WEP_KEY_HEX	  1

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;
	unsigned char wep_key[26], key_length;
@@ -37,7 +38,8 @@ void analyze_character_wep_key(struct ks_wlan_parameter *param, int wep_key_inde
}

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;

@@ -53,7 +55,9 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, cha
					if (wep_end[i] == j + 0x30)
						wep_end[i] = j;
				} 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;
				}
			}
@@ -65,7 +69,9 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, cha
						wep_end[i] = j * 16;
					}
				} 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 * 16;
				}
			}
@@ -98,22 +104,18 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value)
	case '1':	/* 1M 11M 12M 18M */
		if (*(value + 1) == '8') {
			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;
		}
		else if(*(value+1) == '1'){
		} else if (*(value + 1) == '1') {
			priv->reg.rate_set.body[0] = TX_RATE_11M | BASIC_RATE;
		}
		else{
		} else {
			priv->reg.rate_set.body[0] = TX_RATE_1M | BASIC_RATE;
		}
		break;
	case '2':	/* 2M 24M */
		if (*(value + 1) == '4') {
			priv->reg.rate_set.body[0] = TX_RATE_24M | BASIC_RATE;
		}
		else{
		} else {
			priv->reg.rate_set.body[0] = TX_RATE_2M | BASIC_RATE;
		}
		break;
@@ -126,8 +128,7 @@ int rate_set_configuration(struct ks_wlan_private *priv, char *value)
	case '5':	/* 5.5M 54M */
		if (*(value + 1) == '4') {
			priv->reg.rate_set.body[0] = TX_RATE_54M;
		}
		else{
		} else {
			priv->reg.rate_set.body[0] = TX_RATE_5M | BASIC_RATE;
		}
		break;
@@ -257,7 +258,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
	if (request_firmware_direct(&fw_entry, cfg_file, dev))
		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;
	end_p = cur_p + fw_entry->size;
	*end_p = '\0';
@@ -298,7 +300,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
			}
			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] = '\0';
@@ -308,10 +311,12 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)

			switch (i) {
			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;
			case 1:	/* "Channel", "1" */
				priv->reg.channel = simple_strtol(wk_buff, NULL, 10);
				priv->reg.channel =
				    simple_strtol(wk_buff, NULL, 10);
				break;
			case 2:	/* "FragmentThreshold","2346" */
				j = simple_strtol(wk_buff, NULL, 10);
@@ -320,16 +325,19 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
			case 3:	/* "OperationMode","Infrastructure" */
				switch (*wk_buff) {
				case 'P':
					priv->reg.operation_mode = MODE_PSEUDO_ADHOC;
					priv->reg.operation_mode =
					    MODE_PSEUDO_ADHOC;
					break;
				case 'I':
					priv->reg.operation_mode = MODE_INFRASTRUCTURE;
					priv->reg.operation_mode =
					    MODE_INFRASTRUCTURE;
					break;
				case '8':
					priv->reg.operation_mode = MODE_ADHOC;
					break;
				default:
					priv->reg.operation_mode = MODE_INFRASTRUCTURE;
					priv->reg.operation_mode =
					    MODE_INFRASTRUCTURE;
				}
				break;
			case 4:	/* "PowerManagementMode","POWER_ACTIVE" */
@@ -365,10 +373,12 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
			case 8:	/* "AuthenticationAlgorithm","OPEN_SYSTEM" */
				switch (*wk_p) {
				case 'O':	/* Authenticate System : Open System */
					priv->reg.authenticate_type = AUTH_TYPE_OPEN_SYSTEM;
					priv->reg.authenticate_type =
					    AUTH_TYPE_OPEN_SYSTEM;
					break;
				case 'S':	/* Authenticate System : Shared Key */
					priv->reg.authenticate_type = AUTH_TYPE_SHARED_KEY;
					priv->reg.authenticate_type =
					    AUTH_TYPE_SHARED_KEY;
					break;
				}
				break;
@@ -379,16 +389,20 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
				if (wep_on_off != WEP_OFF) {
					switch (wep_type) {
					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;
					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;
			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;
			case 14:	/* "WepType","STRING" */
				if (!strncmp(wk_buff, "STRING", 6)) {
@@ -443,7 +457,8 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
				} else if (!strncmp(wk_buff, "G_MODE", 6)) {
					priv->reg.phy_type = D_11G_ONLY_MODE;
				} else {
					priv->reg.phy_type = D_11BG_COMPATIBLE_MODE;
					priv->reg.phy_type =
					    D_11BG_COMPATIBLE_MODE;
				}
				break;
			case 20:	/* "CtsMode", "FALSE" */
@@ -469,17 +484,17 @@ int ks_wlan_read_config_file(struct ks_wlan_private *priv)
	}
	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 \
   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.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.wep_index,
		&priv->reg.rom_file[0]
		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.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",
		priv->reg.phy_type,priv->reg.cts_mode,priv->reg.tx_rate,priv->reg.phy_info_timer );
	DPRINTK(3,
		"\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);
}