linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	"Roland Vossen" <rvossen@broadcom.com>,
	"Arend van Spriel" <arend@broadcom.com>
Subject: [PATCH 14/22] brcm80211: fmac: fixed weird indentation
Date: Wed, 12 Oct 2011 20:51:24 +0200	[thread overview]
Message-ID: <1318445492-24207-15-git-send-email-arend@broadcom.com> (raw)
In-Reply-To: <1318445492-24207-1-git-send-email-arend@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

And changed function name to something more appropriate.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |   99 ++++++++++----------
 1 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 1b09be0..27a748e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1152,7 +1152,7 @@ brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
 }
 
 static s32
-brcmf_set_set_sharedkey(struct net_device *ndev,
+brcmf_set_wep_sharedkey(struct net_device *ndev,
 		     struct cfg80211_connect_params *sme)
 {
 	struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
@@ -1162,52 +1162,55 @@ brcmf_set_set_sharedkey(struct net_device *ndev,
 	s32 err = 0;
 
 	WL_CONN("key len (%d)\n", sme->key_len);
-	if (sme->key_len) {
-		sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
-		WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n",
-		       sec->wpa_versions, sec->cipher_pairwise);
-		if (!
-		    (sec->wpa_versions & (NL80211_WPA_VERSION_1 |
-					  NL80211_WPA_VERSION_2))
-&& (sec->cipher_pairwise & (WLAN_CIPHER_SUITE_WEP40 |
-			    WLAN_CIPHER_SUITE_WEP104))) {
-			memset(&key, 0, sizeof(key));
-			key.len = (u32) sme->key_len;
-			key.index = (u32) sme->key_idx;
-			if (key.len > sizeof(key.data)) {
-				WL_ERR("Too long key length (%u)\n", key.len);
-				return -EINVAL;
-			}
-			memcpy(key.data, sme->key, key.len);
-			key.flags = BRCMF_PRIMARY_KEY;
-			switch (sec->cipher_pairwise) {
-			case WLAN_CIPHER_SUITE_WEP40:
-				key.algo = CRYPTO_ALGO_WEP1;
-				break;
-			case WLAN_CIPHER_SUITE_WEP104:
-				key.algo = CRYPTO_ALGO_WEP128;
-				break;
-			default:
-				WL_ERR("Invalid algorithm (%d)\n",
-				       sme->crypto.ciphers_pairwise[0]);
-				return -EINVAL;
-			}
-			/* Set the new key/index */
-			WL_CONN("key length (%d) key index (%d) algo (%d)\n",
-			       key.len, key.index, key.algo);
-			WL_CONN("key \"%s\"\n", key.data);
-			err = send_key_to_dongle(ndev, &key);
-			if (err)
-				return err;
 
-			if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
-				WL_CONN("set auth_type to shared key\n");
-				val = 1;	/* shared key */
-				err = brcmf_dev_intvar_set(ndev, "auth", val);
-				if (err) {
-					WL_ERR("set auth failed (%d)\n", err);
-					return err;
-				}
+	if (sme->key_len == 0)
+		return 0;
+
+	sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
+	WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n",
+		sec->wpa_versions, sec->cipher_pairwise);
+
+	if (sec->wpa_versions & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2))
+		return 0;
+
+	if (sec->cipher_pairwise &
+	    (WLAN_CIPHER_SUITE_WEP40 | WLAN_CIPHER_SUITE_WEP104)) {
+		memset(&key, 0, sizeof(key));
+		key.len = (u32) sme->key_len;
+		key.index = (u32) sme->key_idx;
+		if (key.len > sizeof(key.data)) {
+			WL_ERR("Too long key length (%u)\n", key.len);
+			return -EINVAL;
+		}
+		memcpy(key.data, sme->key, key.len);
+		key.flags = BRCMF_PRIMARY_KEY;
+		switch (sec->cipher_pairwise) {
+		case WLAN_CIPHER_SUITE_WEP40:
+			key.algo = CRYPTO_ALGO_WEP1;
+			break;
+		case WLAN_CIPHER_SUITE_WEP104:
+			key.algo = CRYPTO_ALGO_WEP128;
+			break;
+		default:
+			WL_ERR("Invalid algorithm (%d)\n",
+			       sme->crypto.ciphers_pairwise[0]);
+			return -EINVAL;
+		}
+		/* Set the new key/index */
+		WL_CONN("key length (%d) key index (%d) algo (%d)\n",
+			key.len, key.index, key.algo);
+		WL_CONN("key \"%s\"\n", key.data);
+		err = send_key_to_dongle(ndev, &key);
+		if (err)
+			return err;
+
+		if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
+			WL_CONN("set auth_type to shared key\n");
+			val = 1;	/* shared key */
+			err = brcmf_dev_intvar_set(ndev, "auth", val);
+			if (err) {
+				WL_ERR("set auth failed (%d)\n", err);
+				return err;
 			}
 		}
 	}
@@ -1271,9 +1274,9 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
 		goto done;
 	}
 
-	err = brcmf_set_set_sharedkey(ndev, sme);
+	err = brcmf_set_wep_sharedkey(ndev, sme);
 	if (err) {
-		WL_ERR("wl_set_set_sharedkey failed (%d)\n", err);
+		WL_ERR("brcmf_set_wep_sharedkey failed (%d)\n", err);
 		goto done;
 	}
 
-- 
1.7.4.1



  parent reply	other threads:[~2011-10-12 18:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 18:51 [PATCH 00/22] brcm80211: mainline patch related cleanup Arend van Spriel
2011-10-12 18:51 ` [PATCH 01/22] brcm80211: smac: removed redundant timer function parameters Arend van Spriel
2011-10-12 18:51 ` [PATCH 02/22] brcm80211: smac: decreased timer callback irq level Arend van Spriel
2011-10-12 18:51 ` [PATCH 03/22] brcm80211: cleanup function prototypes Arend van Spriel
2011-10-12 18:51 ` [PATCH 04/22] brcm80211: remove sparse warning in fullmac debug function Arend van Spriel
2011-10-12 18:51 ` [PATCH 05/22] brcm80211: fix sparse endianess error in mac80211_if.c Arend van Spriel
2011-10-12 18:51 ` [PATCH 06/22] brcm80211: add endian annotation to packet filter structures Arend van Spriel
2011-10-12 18:51 ` [PATCH 07/22] brcm80211: rename variable in _brcmf_set_multicast_list() Arend van Spriel
2011-10-12 18:51 ` [PATCH 08/22] brcm80211: fix annotations in TOE configuration functions Arend van Spriel
2011-10-12 18:51 ` [PATCH 09/22] brcm80211: use endian annotations in scan related function Arend van Spriel
2011-10-12 18:51 ` [PATCH 10/22] brcm80211: use endian annotation for pmk related structure Arend van Spriel
2011-10-12 18:51 ` [PATCH 11/22] brcm80211: use endian annotations for assoc ie length request Arend van Spriel
2011-10-12 18:51 ` [PATCH 12/22] brcm80211: use endian annotation for roaming related parameters Arend van Spriel
2011-10-12 18:51 ` [PATCH 13/22] brcm80211: use endian annotation for scan time configuration Arend van Spriel
2011-10-12 18:51 ` Arend van Spriel [this message]
2011-10-12 18:51 ` [PATCH 15/22] brcm80211: removed unused functions Arend van Spriel
2011-10-12 18:51 ` [PATCH 16/22] brcm80211: moved power conversion functions Arend van Spriel
2011-10-12 18:51 ` [PATCH 17/22] brcm80211: moved function brcmu_chipname Arend van Spriel
2011-10-12 18:51 ` [PATCH 18/22] brcm80211: moved function brcmu_parse_tlvs Arend van Spriel
2011-10-12 18:51 ` [PATCH 19/22] brcm80211: moved function brcmu_chspec_malformed Arend van Spriel
2011-10-12 18:51 ` [PATCH 20/22] brcm80211: moved function brcmu_mkiovar Arend van Spriel
2011-10-12 18:51 ` [PATCH 21/22] brcm80211: moved function brcmu_format_flags Arend van Spriel
2011-10-12 18:51 ` [PATCH 22/22] brcm80211: removed file wifi.c Arend van Spriel
2011-10-12 19:13   ` Johannes Berg
2011-10-12 19:20     ` Arend van Spriel
2011-10-12 19:28       ` Johannes Berg
2011-10-12 21:54   ` Luis R. Rodriguez
2011-10-13  8:51     ` Arend van Spriel
2011-10-13 18:08       ` Luis R. Rodriguez
2011-10-13 18:23         ` John W. Linville
2011-10-13 18:32           ` Arend van Spriel
2011-10-13 18:27         ` Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318445492-24207-15-git-send-email-arend@broadcom.com \
    --to=arend@broadcom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rvossen@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).