Commit 1aee09b8 authored by Stephen Brennan's avatar Stephen Brennan Committed by Greg Kroah-Hartman
Browse files

staging: rtl8192u: fix spacing errors



Used checkpatch's --fix-inplace option for types SPACING, OPEN_BRACE,
ELSE_AFTER_BRACE. Manually edited the resulting changes to correct for
mistaken fixes and complete fixes that were only partially applied.

Signed-off-by: default avatarStephen Brennan <stephen@brennan.io>
Link: https://lore.kernel.org/r/20190811225120.7308-1-stephen@brennan.io


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 70deda9d
Loading
Loading
Loading
Loading
+200 −255
Original line number Diff line number Diff line
@@ -281,11 +281,11 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,

/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
static unsigned char rfc1042_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
static unsigned char rfc1042_header[] = {
	0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static unsigned char bridge_tunnel_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
static unsigned char bridge_tunnel_header[] = {
	0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
/* No encapsulation header if EtherType < 0x600 (=length) */

/* Called by ieee80211_rx_frame_decrypt */
@@ -676,8 +676,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
				IEEE80211_DEBUG(IEEE80211_DL_REORDER,
					 "Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n", pTS->rx_indicate_seq, SeqNum);
			}
		}
		else {
		} else {
			/*
			 * Packets are dropped if there is not enough reorder entries.
			 * This part shall be modified!! We can just indicate all the
@@ -1002,9 +1001,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
		if (is_duplicate_packet(ieee, hdr))
		goto rx_dropped;

	}
	else
	{
	} else {
		struct rx_ts_record *pRxTS = NULL;
			//IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__func__, tid);
		if (GetTs(
@@ -1021,15 +1018,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
			    (frag == pRxTS->rx_last_frag_num) &&
			    (WLAN_GET_SEQ_SEQ(sc) == pRxTS->rx_last_seq_num)) {
				goto rx_dropped;
			}
			else
			{
			} else {
				pRxTS->rx_last_frag_num = frag;
				pRxTS->rx_last_seq_num = WLAN_GET_SEQ_SEQ(sc);
			}
		}
		else
		{
		} else {
			IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s(): No TS!! Skip the check!!\n", __func__);
			goto rx_dropped;
		}
@@ -1324,9 +1317,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
		kfree(rxb);
		rxb = NULL;

	}
	else
	{
	} else {
		IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): REORDER ENABLE AND PTS not NULL, and we will enter RxReorderIndicatePacket()\n", __func__);
		RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum);
	}
@@ -1407,10 +1398,9 @@ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info
/*
 * Parse a QoS information element
 */
static int ieee80211_read_qos_info_element(struct
					   ieee80211_qos_information_element
					   *element_info, struct ieee80211_info_element
					   *info_element)
static int ieee80211_read_qos_info_element(
		struct ieee80211_qos_information_element *element_info,
		struct ieee80211_info_element *info_element)
{
	int ret = 0;
	u16 size = sizeof(struct ieee80211_qos_information_element) - 2;
@@ -1438,11 +1428,9 @@ static int ieee80211_read_qos_info_element(struct
/*
 * Write QoS parameters from the ac parameters.
 */
static int ieee80211_qos_convert_ac_to_parameters(struct
						  ieee80211_qos_parameter_info
						  *param_elm, struct
						  ieee80211_qos_parameters
						  *qos_param)
static int ieee80211_qos_convert_ac_to_parameters(
		struct ieee80211_qos_parameter_info *param_elm,
		struct ieee80211_qos_parameters *qos_param)
{
	int i;
	struct ieee80211_qos_ac_parameter *ac_params;
@@ -1880,8 +1868,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
				info_element->data[2] == 0x43)
			{
				network->ralink_cap_exist = true;
			}
			else
			} else
				network->ralink_cap_exist = false;
			//added by amy for atheros AP
			if ((info_element->len >= 3 &&
@@ -1895,8 +1882,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
			{
				printk("========>%s(): athros AP is exist\n", __func__);
				network->atheros_cap_exist = true;
			}
			else
			} else
				network->atheros_cap_exist = false;

			if (info_element->len >= 3 &&
@@ -1905,8 +1891,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
				info_element->data[2] == 0x96)
			{
				network->cisco_cap_exist = true;
			}
			else
			} else
				network->cisco_cap_exist = false;
			//added by amy for LEAP of cisco
			if (info_element->len > 4 &&
@@ -1921,8 +1906,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
					if (network->CcxRmState[0] != 0)
					{
						network->bCcxRmEnable = true;
					}
					else
					} else
						network->bCcxRmEnable = false;
					//
					// CCXv4 Table 59-1 MBSSID Masks.
@@ -1934,14 +1918,10 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
						network->MBssidMask = 0xff << (network->MBssidMask);
						ether_addr_copy(network->MBssid, network->bssid);
						network->MBssid[5] &= network->MBssidMask;
					}
					else
					{
					} else {
						network->bMBssidValid = false;
					}
				}
				else
				{
				} else {
					network->bCcxRmEnable = false;
				}
			}
@@ -1951,13 +1931,10 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
				info_element->data[2] == 0x96 &&
				info_element->data[3] == 0x03)
			{
				if(info_element->len == 5)
				{
				if (info_element->len == 5) {
					network->bWithCcxVerNum = true;
					network->BssCcxVerNumber = info_element->data[4];
				}
				else
				{
				} else {
					network->bWithCcxVerNum = false;
					network->BssCcxVerNumber = 0;
				}
@@ -1988,8 +1965,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
				// windows driver will update WMM parameters each beacon received once connected
				// Linux driver is a bit different.
				network->bssht.bdSupportHT = true;
			}
			else
			} else
				network->bssht.bdSupportHT = false;
			break;

@@ -2020,14 +1996,10 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
					(info_element->data[IE_CISCO_FLAG_POSITION] & SUPPORT_CKIP_PK))
				{
					network->bCkipSupported = true;
				}
				else
				{
				} else {
					network->bCkipSupported = false;
				}
			}
			else
			{
			} else {
				network->bWithAironetIE = false;
				network->bCkipSupported = false;
			}
@@ -2058,12 +2030,9 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
	}

	if (!network->atheros_cap_exist && !network->broadcom_cap_exist &&
		!network->cisco_cap_exist && !network->ralink_cap_exist && !network->bssht.bdRT2RTAggregation)
	{
		!network->cisco_cap_exist && !network->ralink_cap_exist && !network->bssht.bdRT2RTAggregation) {
		network->unknown_cap_exist = true;
	}
	else
	{
	} else {
		network->unknown_cap_exist = false;
	}
	return 0;
@@ -2076,44 +2045,25 @@ static inline u8 ieee80211_SignalStrengthTranslate(
	u8 RetSS;

	// Step 1. Scale mapping.
	if(CurrSS >= 71 && CurrSS <= 100)
	{
	if (CurrSS >= 71 && CurrSS <= 100) {
		RetSS = 90 + ((CurrSS - 70) / 3);
	}
	else if(CurrSS >= 41 && CurrSS <= 70)
	{
	} else if (CurrSS >= 41 && CurrSS <= 70) {
		RetSS = 78 + ((CurrSS - 40) / 3);
	}
	else if(CurrSS >= 31 && CurrSS <= 40)
	{
	} else if (CurrSS >= 31 && CurrSS <= 40) {
		RetSS = 66 + (CurrSS - 30);
	}
	else if(CurrSS >= 21 && CurrSS <= 30)
	{
	} else if (CurrSS >= 21 && CurrSS <= 30) {
		RetSS = 54 + (CurrSS - 20);
	}
	else if(CurrSS >= 5 && CurrSS <= 20)
	{
	} else if (CurrSS >= 5 && CurrSS <= 20) {
		RetSS = 42 + (((CurrSS - 5) * 2) / 3);
	}
	else if(CurrSS == 4)
	{
	} else if (CurrSS == 4) {
		RetSS = 36;
	}
	else if(CurrSS == 3)
	{
	} else if (CurrSS == 3) {
		RetSS = 27;
	}
	else if(CurrSS == 2)
	{
	} else if (CurrSS == 2) {
		RetSS = 18;
	}
	else if(CurrSS == 1)
	{
	} else if (CurrSS == 1) {
		RetSS = 9;
	}
	else
	{
	} else {
		RetSS = CurrSS;
	}
	//RT_TRACE(COMP_DBG, DBG_LOUD, ("##### After Mapping:  LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS));
@@ -2434,8 +2384,7 @@ static inline void ieee80211_process_probe_response(
		if (fc == IEEE80211_STYPE_PROBE_RESP)
		{
			// Case 1: Country code
			if(IS_COUNTRY_IE_VALID(ieee) )
			{
			if (IS_COUNTRY_IE_VALID(ieee)) {
				if (!is_legal_channel(ieee, network->channel)) {
					printk("GetScanInfo(): For Country code, filter probe response at channel(%d).\n", network->channel);
					goto out;
@@ -2451,12 +2400,9 @@ static inline void ieee80211_process_probe_response(
					goto out;
				}
			}
		}
		else
		{
		} else {
			// Case 1: Country code
			if(IS_COUNTRY_IE_VALID(ieee) )
			{
			if (IS_COUNTRY_IE_VALID(ieee)) {
				if (!is_legal_channel(ieee, network->channel)) {
					printk("GetScanInfo(): For Country code, filter beacon at channel(%d).\n", network->channel);
					goto out;
@@ -2500,8 +2446,7 @@ static inline void ieee80211_process_probe_response(
		{
			if (ieee->state == IEEE80211_LINKED)
				ieee->LinkDetectInfo.NumRecvBcnInPeriod++;
		}
		else //hidden AP
		} else //hidden AP
			network->flags = (~NETWORK_EMPTY_ESSID & network->flags) | (NETWORK_EMPTY_ESSID & ieee->current_network.flags);
	}