All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Staging: rtl8192u: Refactor code and cleanup
@ 2015-03-09 18:37 Cristina Opriceana
  2015-03-09 18:38 ` [PATCH 1/2] Staging: rtl8192u: Add function to improve code quality Cristina Opriceana
  2015-03-09 18:39 ` [PATCH 2/2] Staging: rtl8192u: Replace printk() with netdev_dbg() Cristina Opriceana
  0 siblings, 2 replies; 3+ messages in thread
From: Cristina Opriceana @ 2015-03-09 18:37 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patchset inserts a new function to fix multiple tab indentaton
problems and cleans up other style errors.

Cristina Opriceana (2):
  Staging: rtl8192u: Add function to improve code quality
  Staging: rtl8192u: Replace printk() with netdev_dbg()

 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 129 +++++++++++----------
 1 file changed, 67 insertions(+), 62 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Staging: rtl8192u: Add function to improve code quality
  2015-03-09 18:37 [PATCH 0/2] Staging: rtl8192u: Refactor code and cleanup Cristina Opriceana
@ 2015-03-09 18:38 ` Cristina Opriceana
  2015-03-09 18:39 ` [PATCH 2/2] Staging: rtl8192u: Replace printk() with netdev_dbg() Cristina Opriceana
  1 sibling, 0 replies; 3+ messages in thread
From: Cristina Opriceana @ 2015-03-09 18:38 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch introduces a new function for the authentication response
error check in the  ieee80211_rx_frame_softmac() function to fix the
indentation problem. It also adds the iotAction variable in the new
function to fix the "more than 80 characters per line" warning.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 129 +++++++++++----------
 1 file changed, 67 insertions(+), 62 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 878086a..f7aa9df 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1920,6 +1920,66 @@ static void ieee80211_process_action(struct ieee80211_device *ieee,
 	return;
 
 }
+
+void ieee80211_check_auth_response(struct ieee80211_device *ieee,
+				   struct sk_buff *skb)
+{
+	/* default support N mode, disable halfNmode */
+	bool bSupportNmode = true, bHalfSupportNmode = false;
+	u16 errcode;
+	u8 *challenge;
+	int chlen = 0;
+	u32 iotAction;
+
+	errcode = auth_parse(skb, &challenge, &chlen);
+	if (!errcode) {
+		if (ieee->open_wep || !challenge) {
+			ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED;
+			ieee->softmac_stats.rx_auth_rs_ok++;
+			iotAction = ieee->pHTInfo->IOTAction;
+			if (!(iotAction & HT_IOT_ACT_PURE_N_MODE)) {
+				if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) {
+					/* WEP or TKIP encryption */
+					if (IsHTHalfNmodeAPs(ieee)) {
+						bSupportNmode = true;
+						bHalfSupportNmode = true;
+					} else {
+						bSupportNmode = false;
+						bHalfSupportNmode = false;
+					}
+					printk("==========>to link with AP using SEC(%d, %d)",
+						bSupportNmode,
+						bHalfSupportNmode);
+				}
+			}
+			/* Dummy wirless mode setting- avoid encryption issue */
+			if (bSupportNmode) {
+				/* N mode setting */
+				ieee->SetWirelessMode(ieee->dev,
+						ieee->current_network.mode);
+			} else {
+				/* b/g mode setting - TODO */
+				ieee->SetWirelessMode(ieee->dev, IEEE_G);
+			}
+
+			if (ieee->current_network.mode == IEEE_N_24G &&
+					bHalfSupportNmode == true) {
+				printk("===============>entern half N mode\n");
+				ieee->bHalfWirelessN24GMode = true;
+			} else
+				ieee->bHalfWirelessN24GMode = false;
+
+			ieee80211_associate_step2(ieee);
+		} else {
+			ieee80211_auth_challenge(ieee, challenge, chlen);
+		}
+	} else {
+		ieee->softmac_stats.rx_auth_rs_err++;
+		IEEE80211_DEBUG_MGMT("Auth response status code 0x%x", errcode);
+		ieee80211_associate_abort(ieee);
+	}
+}
+
 inline int
 ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
 			struct ieee80211_rx_stats *rx_stats, u16 type,
@@ -1927,12 +1987,9 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
 {
 	struct ieee80211_hdr_3addr *header = (struct ieee80211_hdr_3addr *) skb->data;
 	u16 errcode;
-	u8 *challenge;
-	int chlen=0;
 	int aid;
 	struct ieee80211_assoc_response_frame *assoc_resp;
 //	struct ieee80211_info_element *info_element;
-	bool bSupportNmode = true, bHalfSupportNmode = false; //default support N mode, disable halfNmode
 
 	if(!ieee->proto_started)
 		return 0;
@@ -2014,67 +2071,15 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
 	case IEEE80211_STYPE_AUTH:
 
 		if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE){
-			if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING &&
-			ieee->iw_mode == IW_MODE_INFRA){
-
-					IEEE80211_DEBUG_MGMT("Received authentication response");
-
-					errcode = auth_parse(skb, &challenge, &chlen);
-					if (!errcode) {
-						if(ieee->open_wep || !challenge){
-							ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED;
-							ieee->softmac_stats.rx_auth_rs_ok++;
-							if(!(ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE))
-							{
-								if (!ieee->GetNmodeSupportBySecCfg(ieee->dev))
-								{
-											// WEP or TKIP encryption
-									if(IsHTHalfNmodeAPs(ieee))
-									{
-										bSupportNmode = true;
-										bHalfSupportNmode = true;
-									}
-									else
-									{
-										bSupportNmode = false;
-										bHalfSupportNmode = false;
-									}
-								printk("==========>to link with AP using SEC(%d, %d)", bSupportNmode, bHalfSupportNmode);
-								}
-							}
-							/* Dummy wirless mode setting to avoid encryption issue */
-							if(bSupportNmode) {
-								//N mode setting
-								ieee->SetWirelessMode(ieee->dev, \
-										ieee->current_network.mode);
-							}else{
-								//b/g mode setting
-								/*TODO*/
-								ieee->SetWirelessMode(ieee->dev, IEEE_G);
-							}
-
-							if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode == true)
-							{
-								printk("===============>entern half N mode\n");
-								ieee->bHalfWirelessN24GMode = true;
-							}
-							else
-								ieee->bHalfWirelessN24GMode = false;
-
-							ieee80211_associate_step2(ieee);
-						}else{
-							ieee80211_auth_challenge(ieee, challenge, chlen);
-						}
-					}else{
-						ieee->softmac_stats.rx_auth_rs_err++;
-						IEEE80211_DEBUG_MGMT("Authentication response status code 0x%x",errcode);
-						ieee80211_associate_abort(ieee);
-					}
+			if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING
+				&& ieee->iw_mode == IW_MODE_INFRA) {
 
-				}else if (ieee->iw_mode == IW_MODE_MASTER){
-					ieee80211_rx_auth_rq(ieee, skb);
-				}
+				IEEE80211_DEBUG_MGMT("Received auth response");
+				ieee80211_check_auth_response(ieee, skb);
+			} else if (ieee->iw_mode == IW_MODE_MASTER) {
+				ieee80211_rx_auth_rq(ieee, skb);
 			}
+		}
 		break;
 
 	case IEEE80211_STYPE_PROBE_REQ:
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Staging: rtl8192u: Replace printk() with netdev_dbg()
  2015-03-09 18:37 [PATCH 0/2] Staging: rtl8192u: Refactor code and cleanup Cristina Opriceana
  2015-03-09 18:38 ` [PATCH 1/2] Staging: rtl8192u: Add function to improve code quality Cristina Opriceana
@ 2015-03-09 18:39 ` Cristina Opriceana
  1 sibling, 0 replies; 3+ messages in thread
From: Cristina Opriceana @ 2015-03-09 18:39 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch replaces the printk() function with netdev_dbg() in order to
fix the following: "WARNING: printk() should include KERN_ facility level"
and "WARNING: line over 80 characters".

Issue found by checkpatch.pl

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index f7aa9df..d1cbddd 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -1947,9 +1947,9 @@ void ieee80211_check_auth_response(struct ieee80211_device *ieee,
 						bSupportNmode = false;
 						bHalfSupportNmode = false;
 					}
-					printk("==========>to link with AP using SEC(%d, %d)",
-						bSupportNmode,
-						bHalfSupportNmode);
+					netdev_dbg(ieee->dev, "SEC(%d, %d)\n",
+							bSupportNmode,
+							bHalfSupportNmode);
 				}
 			}
 			/* Dummy wirless mode setting- avoid encryption issue */
@@ -1964,7 +1964,7 @@ void ieee80211_check_auth_response(struct ieee80211_device *ieee,
 
 			if (ieee->current_network.mode == IEEE_N_24G &&
 					bHalfSupportNmode == true) {
-				printk("===============>entern half N mode\n");
+				netdev_dbg(ieee->dev, "enter half N mode\n");
 				ieee->bHalfWirelessN24GMode = true;
 			} else
 				ieee->bHalfWirelessN24GMode = false;
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-09 18:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 18:37 [PATCH 0/2] Staging: rtl8192u: Refactor code and cleanup Cristina Opriceana
2015-03-09 18:38 ` [PATCH 1/2] Staging: rtl8192u: Add function to improve code quality Cristina Opriceana
2015-03-09 18:39 ` [PATCH 2/2] Staging: rtl8192u: Replace printk() with netdev_dbg() Cristina Opriceana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.