Commit eb2cbcc3 authored by John Whitmore's avatar John Whitmore Committed by Greg Kroah-Hartman
Browse files

staging:rtl8192u: Correct indentation and spacing for braces of code blocks



Simple style change to fix the indentaiton and spacing of the braces around
multiline code blocks.

Braces removed from code block with a single line.

Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent de6171cd
Loading
Loading
Loading
Loading
+107 −147
Original line number Diff line number Diff line
@@ -107,11 +107,10 @@ static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p)
	*tag++ = 0x00;
	*tag++ = 0x01;
#ifdef SUPPORT_USPD
	if (ieee->current_network.wmm_info & 0x80) {
	if (ieee->current_network.wmm_info & 0x80)
		*tag++ = 0x0f | MAX_SP_Len;
	} else {
	else
		*tag++ = MAX_SP_Len;
	}
#else
	*tag++ = MAX_SP_Len;
#endif
@@ -200,8 +199,7 @@ static u8 MgntQuery_MgntFrameTxRate(struct ieee80211_device *ieee)

	/*
	// Data rate of ProbeReq is already decided. Annie, 2005-03-31
	if( pMgntInfo->bScanInProgress || (pMgntInfo->bDualModeScanStep!=0) )
	{
	if( pMgntInfo->bScanInProgress || (pMgntInfo->bDualModeScanStep!=0) ) {
	if(pMgntInfo->dot11CurrentWirelessMode==WIRELESS_MODE_A)
	rate = 0x0c;
	else
@@ -420,8 +418,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER + 1);
	mutex_lock(&ieee->scan_mutex);

	while (1)
	{
	while (1) {
		do {
			ch++;
			if (ch > MAX_CHANNEL_NUMBER)
@@ -465,8 +462,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
	if (ieee->state < IEEE80211_LINKED) {
		ieee->actscanning = false;
		mutex_unlock(&ieee->scan_mutex);
	}
	else{
	} else {
		ieee->sync_scan_hurryup = 0;
		if (IS_DOT11D_ENABLE(ieee))
			DOT11D_ScanComplete(ieee);
@@ -489,8 +485,7 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work)
	do {
		ieee->current_network.channel =
			(ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER;
		if (watchdog++ > MAX_CHANNEL_NUMBER)
		{
		if (watchdog++ > MAX_CHANNEL_NUMBER) {
		//if current channel is not in channel map, set to default channel.
			if (!channel_map[ieee->current_network.channel]) {
				ieee->current_network.channel = 6;
@@ -589,32 +584,27 @@ EXPORT_SYMBOL(ieee80211_stop_scan);
/* called with ieee->lock held */
static void ieee80211_start_scan(struct ieee80211_device *ieee)
{
	if (IS_DOT11D_ENABLE(ieee) )
	{
	if (IS_DOT11D_ENABLE(ieee) ) {
		if (IS_COUNTRY_IE_VALID(ieee))
		{
			RESET_CIE_WATCHDOG(ieee);
	}
	}
	if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) {
		if (ieee->scanning == 0) {
			ieee->scanning = 1;
			schedule_delayed_work(&ieee->softmac_scan_wq, 0);
		}
	}else
	} else {
		ieee->start_scan(ieee->dev);
	}
}

/* called with wx_mutex held */
void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
{
	if (IS_DOT11D_ENABLE(ieee) )
	{
	if (IS_DOT11D_ENABLE(ieee) ) {
		if (IS_COUNTRY_IE_VALID(ieee))
		{
			RESET_CIE_WATCHDOG(ieee);
	}
	}
	ieee->sync_scan_hurryup = 0;
	if (ieee->softmac_features & IEEE_SOFTMAC_SCAN)
		ieee80211_softmac_scan_syncro(ieee);
@@ -714,8 +704,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
	HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, &tmp_ht_cap_len, encrypt);
	HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, encrypt);

	if (pHTInfo->bRegRT2RTAggregation)
	{
	if (pHTInfo->bRegRT2RTAggregation) {
		tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
		tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer);
		HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len);
@@ -798,10 +787,9 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
		tag += rate_ex_len - 2;
	}

	if (wpa_ie_len)
	{
		if (ieee->iw_mode == IW_MODE_ADHOC)
		{//as Windows will set pairwise key same as the group key which is not allowed in Linux, so set this for IOT issue. WB 2008.07.07
	if (wpa_ie_len) {
		if (ieee->iw_mode == IW_MODE_ADHOC) {
			//as Windows will set pairwise key same as the group key which is not allowed in Linux, so set this for IOT issue. WB 2008.07.07
			memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4);
		}
		memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
@@ -979,30 +967,25 @@ ieee80211_association_req(struct ieee80211_network *beacon,
	encrypt = ieee->host_encrypt && crypt && crypt->ops && ((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len));

	/* Include High Throuput capability && Realtek proprietary */
	if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT)
	{
	if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
		ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap);
		ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
		HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, encrypt);
		if (ieee->pHTInfo->bCurrentRT2RTAggregation)
		{
		if (ieee->pHTInfo->bCurrentRT2RTAggregation) {
			realtek_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
			realtek_ie_len = sizeof( ieee->pHTInfo->szRT2RTAggBuffer);
			HTConstructRT2RTAggElement(ieee, realtek_ie_buf, &realtek_ie_len);
		}
	}
	if (ieee->qos_support) {
	if (ieee->qos_support)
		wmm_info_len = beacon->qos_data.supported ? 9 : 0;
	}

	if (beacon->bCkipSupported)
	{
		ckip_ie_len = 30 + 2;
	}

	if (beacon->bCcxRmEnable)
	{
		ccxrm_ie_len = 6 + 2;
	}

	if (beacon->BssCcxVerNumber >= 2)
		cxvernum_ie_len = 5 + 2;

@@ -1098,8 +1081,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
		tag += osCcxAironetIE.Length;
	}

	if (beacon->bCcxRmEnable)
	{
	if (beacon->bCcxRmEnable) {
		static u8 CcxRmCapBuf[] = {0x00, 0x40, 0x96, 0x01, 0x01, 0x00};
		OCTET_STRING osCcxRmCap;

@@ -1126,8 +1108,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
	}
	//HT cap element
	if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
		if (ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC)
		{
		if (ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) {
			tag = skb_put(skb, ht_cap_len);
			*tag++ = MFIE_TYPE_HT_CAP;
			*tag++ = ht_cap_len - 2;
@@ -1137,9 +1118,8 @@ ieee80211_association_req(struct ieee80211_network *beacon,
	}

	//choose what wpa_supplicant gives to associate.
	if (wpa_ie_len) {
	if (wpa_ie_len)
		skb_put_data(skb, ieee->wpa_ie, wpa_ie_len);
	}

	if (wmm_info_len) {
		tag = skb_put(skb, wmm_info_len);
@@ -1153,8 +1133,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
#endif

	if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
		if (ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC)
		{
		if (ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC) {
			tag = skb_put(skb, ht_cap_len);
			*tag++ = MFIE_TYPE_GENERIC;
			*tag++ = ht_cap_len - 2;
@@ -1220,9 +1199,9 @@ static void ieee80211_associate_step1(struct ieee80211_device *ieee)
	ieee->softmac_stats.tx_auth_rq++;
	skb = ieee80211_authentication_req(beacon, ieee, 0);

	if (!skb)
	if (!skb) {
		ieee80211_associate_abort(ieee);
	else{
	} else {
		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING ;
		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
		softmac_mgmt_xmit(skb, ieee);
@@ -1248,9 +1227,9 @@ static void ieee80211_auth_challenge(struct ieee80211_device *ieee,
	ieee->softmac_stats.tx_auth_rq++;

	skb = ieee80211_authentication_req(beacon, ieee, chlen + 2);
	if (!skb)
	if (!skb) {
		ieee80211_associate_abort(ieee);
	else{
	} else {
		c = skb_put(skb, chlen + 2);
		*(c++) = MFIE_TYPE_CHALLENGE;
		*(c++) = chlen;
@@ -1278,9 +1257,9 @@ static void ieee80211_associate_step2(struct ieee80211_device *ieee)

	ieee->softmac_stats.tx_ass_rq++;
	skb = ieee80211_association_req(beacon, ieee);
	if (!skb)
	if (!skb) {
		ieee80211_associate_abort(ieee);
	else{
	} else {
		softmac_mgmt_xmit(skb, ieee);
		mod_timer(&ieee->associate_timer, jiffies + (HZ / 2));
		//dev_kfree_skb_any(skb);//edit by thomas
@@ -1298,21 +1277,17 @@ static void ieee80211_associate_complete_wq(struct work_struct *work)
		ieee->rate = 22;
		printk(KERN_INFO"Using B rates:%d\n", ieee->rate);
	}
	if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT)
	{
	if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) {
		printk("Successfully associated, ht enabled\n");
		HTOnAssocRsp(ieee);
	}
	else
	{
	} else {
		printk("Successfully associated, ht not enabled(%d, %d)\n", ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bEnableHT);
		memset(ieee->dot11HTOperationalRateSet, 0, 16);
		//HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
	}
	ieee->LinkDetectInfo.SlotNum = 2 * (1 + ieee->current_network.beacon_interval / 500);
	// To prevent the immediately calling watch_dog after association.
	if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || ieee->LinkDetectInfo.NumRecvDataInPeriod == 0 )
	{
	if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || ieee->LinkDetectInfo.NumRecvDataInPeriod == 0 ) {
		ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
		ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
	}
@@ -1430,14 +1405,11 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee
					//for HT by amy 080514
					if ((ieee->current_network.qos_data.supported == 1) &&
					    // (ieee->pHTInfo->bEnableHT && ieee->current_network.bssht.bdSupportHT))
					   ieee->current_network.bssht.bdSupportHT)
					    ieee->current_network.bssht.bdSupportHT) {
/*WB, 2008.09.09:bCurrentHTSupport and bEnableHT two flags are going to put together to check whether we are in HT now, so needn't to check bEnableHT flags here. That's is to say we will set to HT support whenever joined AP has the ability to support HT. And whether we are in HT or not, please check bCurrentHTSupport&&bEnableHT now please.*/
					{
					//	ieee->pHTInfo->bCurrentHTSupport = true;
						HTResetSelfAndSavePeerSetting(ieee, &(ieee->current_network));
					}
					else
					{
					} else {
						ieee->pHTInfo->bCurrentHTSupport = false;
					}

@@ -1631,9 +1603,8 @@ ieee80211_rx_auth_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
	ieee->softmac_stats.rx_auth_rq++;

	status = auth_rq_parse(skb, dest);
	if (status != -1) {
	if (status != -1)
		ieee80211_resp_to_auth(ieee, status, dest);
	}
	//DMESG("Dest is "MACSTR, MAC2STR(dest));
}

@@ -1644,9 +1615,8 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
	//unsigned long flags;

	ieee->softmac_stats.rx_ass_rq++;
	if (assoc_rq_parse(skb, dest) != -1) {
	if (assoc_rq_parse(skb, dest) != -1)
		ieee80211_resp_to_assoc_rq(ieee, dest);
	}

	printk(KERN_INFO"New client associated: %pM\n", dest);
	//FIXME
@@ -1735,10 +1705,9 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
		goto out;

	if (sleep == 1) {
		if (ieee->sta_sleep == 1)
		if (ieee->sta_sleep == 1) {
			ieee->enter_sleep_state(ieee->dev, th, tl);

		else if (ieee->sta_sleep == 0){
		} else if (ieee->sta_sleep == 0) {
		//	printk("send null 1\n");
			spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);

@@ -1803,9 +1772,8 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success)
		/* if the card report not success we can't be sure the AP
		 * has not RXed so we can't assume the AP believe us awake
		 */
	}
	} else {
		/* 21112005 - tx again null without PS bit if lost */
	else {
		if ((ieee->sta_sleep == 0) && !success) {
			spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
			ieee80211_sta_ps_send_null_frame(ieee, 0);
@@ -1823,8 +1791,7 @@ static void ieee80211_process_action(struct ieee80211_device *ieee,
	u8 *act = ieee80211_get_payload(header);
	u8 tmp = 0;
//	IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
	if (act == NULL)
	{
	if (act == NULL) {
		IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of action frame\n");
		return;
	}
@@ -1890,9 +1857,9 @@ static void ieee80211_check_auth_response(struct ieee80211_device *ieee,
					bHalfSupportNmode) {
				netdev_dbg(ieee->dev, "enter half N mode\n");
				ieee->bHalfWirelessN24GMode = true;
			} else
			} else {
				ieee->bHalfWirelessN24GMode = false;

			}
			ieee80211_associate_step2(ieee);
		} else {
			ieee80211_auth_challenge(ieee, challenge, chlen);
@@ -1952,9 +1919,8 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
								rx_stats->len - sizeof(*assoc_resp),\
								network, rx_stats)) {
						return 1;
					}
					else
					{	//filling the PeerHTCap. //maybe not necessary as we can get its info from current_network.
					} else {
						//filling the PeerHTCap. //maybe not necessary as we can get its info from current_network.
						memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, network->bssht.bdHTCapLen);
						memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen);
					}
@@ -1971,13 +1937,12 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
				IEEE80211_DEBUG_MGMT(
					"Association response status code 0x%x\n",
					errcode);
				if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) {
				if (ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT)
					schedule_work(&ieee->associate_procedure_wq);
				} else {
				else
					ieee80211_associate_abort(ieee);
			}
		}
		}
		break;

	case IEEE80211_STYPE_ASSOC_REQ:
@@ -2071,9 +2036,9 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device *
	ieee->stats.tx_bytes += le16_to_cpu(txb->payload_size);
	ieee->stats.tx_packets++;
	tcb_desc = (struct cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
	if (tcb_desc->bMulticast) {
	if (tcb_desc->bMulticast)
		ieee->stats.multicast++;
	}

	/* if xmit available, just xmit it immediately, else just insert it to the wait queue */
	for (i = 0; i < txb->nr_frags; i++) {
#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
@@ -2294,9 +2259,9 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
			ieee->current_network.rates[1] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB;
			ieee->current_network.rates[2] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB;
			ieee->current_network.rates[3] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB;
		}else
		} else {
			ieee->current_network.rates_len = 0;

		}
		if (ieee->modulation & IEEE80211_OFDM_MODULATION) {
			ieee->current_network.rates_ex_len = 8;

@@ -2353,13 +2318,10 @@ void ieee80211_start_bss(struct ieee80211_device *ieee)
	// Ref: 802.11d 11.1.3.3
	// STA shall not start a BSS unless properly formed Beacon frame including a Country IE.
	//
	if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
	{
	if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee)) {
		if (! ieee->bGlobalDomain)
		{
			return;
	}
	}
	/* check if we have already found the net we
	 * are interested in (if any).
	 * if not (we are disassociated and we are not
@@ -2575,9 +2537,9 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)

	ieee->state = IEEE80211_NOLINK;
	ieee->sync_scan_hurryup = 0;
	for (i = 0; i < 5; i++) {
	for (i = 0; i < 5; i++)
		ieee->seq_ctrl[i] = 0;
	}

	ieee->pDot11dInfo = kzalloc(sizeof(RT_DOT11D_INFO), GFP_KERNEL);
	if (!ieee->pDot11dInfo)
		IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for DOT11D\n");
@@ -2736,8 +2698,7 @@ static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value)
		sec.auth_mode = WLAN_AUTH_OPEN;
		ieee->open_wep = 1;
		ieee->auth_mode = 0;
	}
	else if (value & IW_AUTH_ALG_LEAP){
	} else if (value & IW_AUTH_ALG_LEAP) {
		sec.auth_mode = WLAN_AUTH_LEAP;
		ieee->open_wep = 1;
		ieee->auth_mode = 2;
@@ -2788,8 +2749,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v
		if (!value) {
			sec.flags |= SEC_LEVEL;
			sec.level = SEC_LEVEL_0;
		}
		else {
		} else {
			sec.flags |= SEC_LEVEL;
			sec.level = SEC_LEVEL_1;
		}
@@ -2935,9 +2895,9 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
		ieee->tx_keyidx = param->u.crypt.idx;
		sec.active_key = param->u.crypt.idx;
		sec.flags |= SEC_ACTIVE_KEY;
	} else
	} else {
		sec.flags &= ~SEC_ACTIVE_KEY;

	}
	memcpy(sec.keys[param->u.crypt.idx],
	       param->u.crypt.key,
	       param->u.crypt.key_len);