Skip to contentSkip to conversation

Fixing style errors in staging/drivers/rtl8192u

PATCH In review Christian Müller 3 participants 8 messages Jun 3, 2019 Staging

lore
Share & tools
lore
#0 lore raw

cover Fixing style errors in staging/drivers/rtl8192u

This series of patches fixes various style errors in the rtl8192u staging driver. These fixes contain reformatting of code comments, changing of indentations, cleaning up commented out code within the source-code and fixes for individual errors indicated by the checkpatch tool.

Christian Müller (1):
drivers/staging/rtl8192u: Fix of checkpatch-errors

Felix Trommer (2):
drivers/staging/rtl8192u: Reformat comments drivers/staging/rtl8192u: Remove comment-out code

 drivers/staging/rtl8192u/ieee80211/dot11d.c   |   6 +-
 drivers/staging/rtl8192u/ieee80211/dot11d.h   |   2 +-
 .../staging/rtl8192u/ieee80211/ieee80211.h    | 311 +++---
 .../rtl8192u/ieee80211/ieee80211_crypt.c      |   3 +-
 .../rtl8192u/ieee80211/ieee80211_crypt.h      |  15 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c |   7 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c |  13 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_wep.c  |   9 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |   6 +-
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 973 ++++++++----------
 .../rtl8192u/ieee80211/ieee80211_softmac.c    | 336 +++---
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c |  21 +-
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 311 +++---
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c | 115 +--
 .../staging/rtl8192u/ieee80211/rtl819x_BA.h   |   2 +-
 .../rtl8192u/ieee80211/rtl819x_BAProc.c       | 169 +--
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   | 111 +-
 .../rtl8192u/ieee80211/rtl819x_HTProc.c       | 264 ++---
 .../staging/rtl8192u/ieee80211/rtl819x_Qos.h  |  24 +-
 .../rtl8192u/ieee80211/rtl819x_TSProc.c       | 110 +-
 drivers/staging/rtl8192u/r8180_93cx6.c        |   3 +-
 drivers/staging/rtl8192u/r8180_93cx6.h        |   4 +-
 drivers/staging/rtl8192u/r8190_rtl8256.c      |  36 +-
 drivers/staging/rtl8192u/r8192U.h             |  47 +-
 drivers/staging/rtl8192u/r8192U_core.c        | 159 ++-
 drivers/staging/rtl8192u/r8192U_dm.c          | 232 ++---
 drivers/staging/rtl8192u/r8192U_dm.h          |  22 +-
 drivers/staging/rtl8192u/r8192U_hw.h          | 192 ++--
 drivers/staging/rtl8192u/r8192U_wx.c          |  17 +-
 drivers/staging/rtl8192u/r819xU_cmdpkt.c      |  77 +-
 drivers/staging/rtl8192u/r819xU_cmdpkt.h      |  14 +-
 drivers/staging/rtl8192u/r819xU_firmware.c    |  12 +-
 drivers/staging/rtl8192u/r819xU_phy.c         |  30 +-
 drivers/staging/rtl8192u/r819xU_phy.h         |   4 +-
 drivers/staging/rtl8192u/r819xU_phyreg.h      |   9 +-
 35 files changed, 1747 insertions(+), 1919 deletions(-)

--
2.17.1

#1 lore raw

PATCH 1/3 drivers/staging/rtl8192u: Reformat comments

From: Felix Trommer <[email protected]>

Replace C99-Style comments with C89-Style comments.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.c   |   6 +-
 .../staging/rtl8192u/ieee80211/ieee80211.h    | 276 ++++++++---------
 .../rtl8192u/ieee80211/ieee80211_crypt.c      |   3 +-
 .../rtl8192u/ieee80211/ieee80211_crypt.h      |  15 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c |   6 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c |  12 +-
 .../rtl8192u/ieee80211/ieee80211_crypt_wep.c  |   9 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |   3 +-
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 284 +++++++++++-------
 .../rtl8192u/ieee80211/ieee80211_softmac.c    | 197 ++++++------
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c |   8 +-
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 124 ++++----
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c |  45 +--
 .../staging/rtl8192u/ieee80211/rtl819x_BA.h   |   2 +-
 .../rtl8192u/ieee80211/rtl819x_BAProc.c       | 148 ++++-----
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   |  94 +++---
 .../rtl8192u/ieee80211/rtl819x_HTProc.c       | 196 ++++++------
 .../staging/rtl8192u/ieee80211/rtl819x_Qos.h  |  20 +-
 .../rtl8192u/ieee80211/rtl819x_TSProc.c       |  85 +++---
 drivers/staging/rtl8192u/r8180_93cx6.c        |   3 +-
 drivers/staging/rtl8192u/r8180_93cx6.h        |   4 +-
 drivers/staging/rtl8192u/r8190_rtl8256.c      |  33 +-
 drivers/staging/rtl8192u/r8192U.h             |  47 +--
 drivers/staging/rtl8192u/r8192U_core.c        | 154 ++++++----
 drivers/staging/rtl8192u/r8192U_dm.c          | 131 ++++----
 drivers/staging/rtl8192u/r8192U_dm.h          |  22 +-
 drivers/staging/rtl8192u/r8192U_hw.h          | 176 +++++------
 drivers/staging/rtl8192u/r8192U_wx.c          |  12 +-
 drivers/staging/rtl8192u/r819xU_cmdpkt.c      |  77 +++--
 drivers/staging/rtl8192u/r819xU_cmdpkt.h      |  14 +-
 drivers/staging/rtl8192u/r819xU_firmware.c    |   9 +-
 drivers/staging/rtl8192u/r819xU_phy.c         |  30 +-
 drivers/staging/rtl8192u/r819xU_phy.h         |   4 +-
 drivers/staging/rtl8192u/r819xU_phyreg.h      |   9 +-
 34 files changed, 1267 insertions(+), 991 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.c +4 -2
index 130ddfe9868f..bbb1014007a4 100644
@@ -63,14 +63,16 @@ void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr,
 	pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3);
 	for (i = 0; i < NumTriples; i++) {
 		if (MaxChnlNum >= pTriple->first_channel) {
-			/* It is not in a monotonically increasing order, so
+			/*
+			 * It is not in a monotonically increasing order, so
 			 * stop processing.
 			 */
 			netdev_err(dev->dev, "dot11d_update_country_ie(): Invalid country IE, skip it........1\n");
 			return;
 		}
 		if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + pTriple->num_channels)) {
-			/* It is not a valid set of channel id, so stop
+			/*
+			 * It is not a valid set of channel id, so stop
 			 * processing.
 			 */
 			netdev_err(dev->dev, "dot11d_update_country_ie(): Invalid country IE, skip it........2\n");
drivers/staging/rtl8192u/ieee80211/ieee80211.h +140 -136

680 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +2 -1
index 36987fccac5d..a47ba3607b78 100644
@@ -81,7 +81,8 @@ void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee,
 	tmp = *crypt;
 	*crypt = NULL;
 
-	/* must not run ops->deinit() while there may be pending encrypt or
+	/*
+	 * must not run ops->deinit() while there may be pending encrypt or
 	 * decrypt operations. Use a list of delayed deinits to avoid needing
 	 * locking.
 	 */
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h +10 -5
index d3bd5598b25b..4fbc5241f7b5 100644
@@ -24,7 +24,8 @@
 struct ieee80211_crypto_ops {
 	const char *name;
 
-	/* init new crypto context (e.g., allocate private data space,
+	/*
+	 * init new crypto context (e.g., allocate private data space,
 	 * select IV, etc.); returns NULL on failure or pointer to allocated
 	 * private data on success
 	 */
@@ -33,7 +34,8 @@ struct ieee80211_crypto_ops {
 	/* deinitialize crypto context and free allocated private data */
 	void (*deinit)(void *priv);
 
-	/* encrypt/decrypt return < 0 on error or >= 0 on success. The return
+	/*
+	 * encrypt/decrypt return < 0 on error or >= 0 on success. The return
 	 * value from decrypt_mpdu is passed as the keyidx value for
 	 * decrypt_msdu. skb must have enough head and tail room for the
 	 * encryption; if not, error will be returned; these functions are
@@ -42,7 +44,8 @@ struct ieee80211_crypto_ops {
 	int (*encrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv);
 	int (*decrypt_mpdu)(struct sk_buff *skb, int hdr_len, void *priv);
 
-	/* These functions are called for full MSDUs, i.e. full frames.
+	/*
+	 * These functions are called for full MSDUs, i.e. full frames.
 	 * These can be NULL if full MSDU operations are not needed.
 	 */
 	int (*encrypt_msdu)(struct sk_buff *skb, int hdr_len, void *priv);
@@ -52,12 +55,14 @@ struct ieee80211_crypto_ops {
 	int (*set_key)(void *key, int len, u8 *seq, void *priv);
 	int (*get_key)(void *key, int len, u8 *seq, void *priv);
 
-	/* procfs handler for printing out key information and possible
+	/*
+	 * procfs handler for printing out key information and possible
 	 * statistics
 	 */
 	char * (*print_stats)(char *p, void *priv);
 
-	/* maximum number of bytes added by encryption; encrypt buf is
+	/*
+	 * maximum number of bytes added by encryption; encrypt buf is
 	 * allocated with extra_prefix_len bytes, copy of in_buf, and
 	 * extra_postfix_len; encrypt need not use all this space, but
 	 * the result must start at the beginning of the buffer and correct
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +4 -2
index d7188b3f3190..ad0b918ecf0d 100644
@@ -133,7 +133,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
 		qc = *pos & 0x0f;
 		aad_len += 2;
 	}
-	/* CCM Initial Block:
+	/*
+	 * CCM Initial Block:
 	 * Flag (Include authentication header, M=3 (8-octet MIC),
 	 *       L=1 (2-octet Dlen))
 	 * Nonce: 0x00 | A2 | PN
@@ -146,7 +147,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
 	b0[14] = (dlen >> 8) & 0xff;
 	b0[15] = dlen & 0xff;
 
-	/* AAD:
+	/*
+	 * AAD:
 	 * FC with bits 4..6 and 11..13 masked to zero; 14 is always one
 	 * A1 | A2 | A3
 	 * SC with bits 4..15 (seq#) masked to zero
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +6 -6
index 0927b2b15151..db4b640d1d8c 100644
@@ -567,11 +567,11 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri
 
 	michael_mic_hdr(skb, tkey->tx_hdr);
 
-	// { david, 2006.9.1
-	// fix the wpa process with wmm enabled.
+	/* { david, 2006.9.1 */
+	/* fix the wpa process with wmm enabled. */
 	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl)))
 		tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
-	// }
+	/* } */
 	pos = skb_put(skb, 8);
 
 	if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr,
@@ -615,11 +615,11 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 		return -1;
 
 	michael_mic_hdr(skb, tkey->rx_hdr);
-	// { david, 2006.9.1
-	// fix the wpa process with wmm enabled.
+	/* { david, 2006.9.1 */
+	/* fix the wpa process with wmm enabled. */
 	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl)))
 		tkey->rx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
-	// }
+	/* } */
 
 	if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
 			skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +6 -3
index 805493a0870d..9cb386436377 100644
@@ -72,7 +72,8 @@ static void prism2_wep_deinit(void *priv)
 	kfree(priv);
 }
 
-/* Perform WEP encryption on given skb that has at least 4 bytes of headroom
+/*
+ * Perform WEP encryption on given skb that has at least 4 bytes of headroom
  * for IV and 4 bytes of tailroom for ICV. Both IV and ICV will be transmitted,
  * so the payload length increases with 8 bytes.
  *
@@ -103,7 +104,8 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
 	wep->iv++;
 
-	/* Fluhrer, Mantin, and Shamir have reported weaknesses in the key
+	/*
+	 * Fluhrer, Mantin, and Shamir have reported weaknesses in the key
 	 * scheduling algorithm of RC4. At least IVs (KeyByte + 3, 0xff, N)
 	 * can be used to speedup attacks, so avoid using them.
 	 */
@@ -150,7 +152,8 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 }
 
 
-/* Perform WEP decryption on given buffer. Buffer includes whole WEP part of
+/*
+ * Perform WEP decryption on given buffer. Buffer includes whole WEP part of
  * the frame: IV (4 bytes), encrypted payload (including SNAP header),
  * ICV (4 bytes). len includes both IV and ICV.
  *
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +2 -1
index d7975aa335b2..dd7ff7e84bd0 100644
@@ -158,7 +158,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
 	if (ieee->pHTInfo == NULL) {
 		IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n");
 
-		/* By this point in code ieee80211_networks_allocate() has been
+		/*
+		 * By this point in code ieee80211_networks_allocate() has been
 		 * successfully called so the memory allocated should be freed
 		 */
 		ieee80211_networks_free(ieee);
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +170 -114

700 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +113 -84

528 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +5 -3
index aab1586fe0dd..2bf333c12bbc 100644
@@ -112,7 +112,7 @@ int ieee80211_wx_get_wap(struct ieee80211_device *ieee,
 	if (ieee->iw_mode == IW_MODE_MONITOR)
 		return -1;
 
-	/* We want avoid to give to the user inconsistent infos*/
+	/* We want avoid to give to the user inconsistent infos */
 	spin_lock_irqsave(&ieee->lock, flags);
 
 	if (ieee->state != IEEE80211_LINKED &&
@@ -159,7 +159,8 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
 	if (ifup)
 		ieee80211_stop_protocol(ieee);
 
-	/* just to avoid to give inconsistent infos in the
+	/*
+	 * just to avoid to give inconsistent infos in the
 	 * get wx method. not really needed otherwise
 	 */
 	spin_lock_irqsave(&ieee->lock, flags);
@@ -408,7 +409,8 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
 		ieee80211_stop_protocol(ieee);
 
 
-	/* this is just to be sure that the GET wx callback
+	/*
+	 * this is just to be sure that the GET wx callback
 	 * has consisten infos. not needed otherwise
 	 */
 	spin_lock_irqsave(&ieee->lock, flags);
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +67 -57

304 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +28 -17

108 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/rtl819x_BA.h +1 -1
index 1a727856ba53..215748895c2d 100644
@@ -51,4 +51,4 @@ struct ba_record {
 	union sequence_control	start_seq_ctrl;
 };
 
-#endif //end _BATYPE_H_
+#endif /* end _BATYPE_H_ */
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +76 -72

349 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +47 -47

148 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +97 -99

196 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +10 -10
index 3052f53d2e7e..44418a284fe9 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +42 -43

85 lines not on this page · raw message

drivers/staging/rtl8192u/r8180_93cx6.c +2 -1
index de83daa0c9ed..e76f1b2ea2e0 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r8180_93cx6.h +2 -2
index 0cdd00a4f7b8..3dc3cdb2194e 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r8190_rtl8256.c +20 -13
index 92de92a3325a..716be24bace6 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r8192U.h +30 -17

47 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U_core.c +101 -53

154 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U_dm.c +80 -51

131 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U_dm.h +11 -11
index 0de0332906bd..d7ed0eb2fedb 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r8192U_hw.h +91 -85

176 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U_wx.c +8 -4
index 5822bb7984b9..adb9fe8a79da 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r819xU_cmdpkt.c +49 -28

77 lines not on this page · raw message

drivers/staging/rtl8192u/r819xU_cmdpkt.h +9 -5
index be45cd609d67..6498b4625254 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r819xU_firmware.c +6 -3
index 153d4ee0ec07..e9511b829b05 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r819xU_phy.c +20 -10
index 5f04afe53d69..5445ea092130 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r819xU_phy.h +2 -2
index 8c2933264407..b1974671fdc9 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rtl8192u/r819xU_phyreg.h +6 -3
index dc9ddf100eab..af7d9b8fee7f 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

--
2.17.1

Part of the diff is not shown here. View the raw message.

maintainer
#2 lore raw

Re: [PATCH 1/3] drivers/staging/rtl8192u: Reformat comments

Quoted 3 lines · Christian Müller

From: Felix Trommer <[email protected]>

Replace C99-Style comments with C89-Style comments.

What does that mean?

drivers/staging/rtl8192u/ieee80211/dot11d.c void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr, · line 69

Quoted 6 lines
drivers/staging/rtl8192u/ieee80211/dot11d.c +2 -1
 		if (MaxChnlNum >= pTriple->first_channel) {
-			/* It is not in a monotonically increasing order, so
+			/*
+			 * It is not in a monotonically increasing order, so
 			 * stop processing.
 			 */

Those are both /* */ style comments. Where in the C99 or C89 spec does it say anything about this type of change?

Are you sure you are not getting confused about // for a comment marker in C99 which is not in C89?

thanks,

greg k-h

#3 lore raw

PATCH 2/3 drivers/staging/rtl8192u: Remove comment-out code

In reply to Christian Müller

From: Felix Trommer <[email protected]>

Remove the majority of all commented-out code. Commented out code, that was adressed by a comment itself is not removed. The code that we left in as comments was mostly due to the "pseudo-code"-like nature of the code that helped to clarify certain functionalities.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.h   |  2 +-
 .../staging/rtl8192u/ieee80211/ieee80211.h    | 35 ++-----
 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c |  1 -
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c |  1 -
 .../rtl8192u/ieee80211/ieee80211_module.c     |  2 -
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 50 +---------
 .../rtl8192u/ieee80211/ieee80211_softmac.c    | 93 +++----------------
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c | 13 +--
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c |  3 +-
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c | 19 +---
 .../rtl8192u/ieee80211/rtl819x_BAProc.c       |  3 -
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   |  2 -
 .../rtl8192u/ieee80211/rtl819x_HTProc.c       | 54 ++---------
 .../staging/rtl8192u/ieee80211/rtl819x_Qos.h  |  4 +-
 .../rtl8192u/ieee80211/rtl819x_TSProc.c       | 11 ---
 drivers/staging/rtl8192u/r8190_rtl8256.c      |  3 -
 drivers/staging/rtl8192u/r8192U_core.c        |  5 +-
 drivers/staging/rtl8192u/r8192U_dm.c          | 60 ------------
 drivers/staging/rtl8192u/r8192U_wx.c          |  2 -
 drivers/staging/rtl8192u/r819xU_firmware.c    |  1 -
 20 files changed, 38 insertions(+), 326 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
index 8b485fa18089..f27267307b3f 100644
@@ -54,4 +54,4 @@ void dot11d_scan_complete(struct ieee80211_device *dev);
 int is_legal_channel(struct ieee80211_device *dev, u8 channel);
 int to_legal_channel(struct ieee80211_device *dev, u8 channel);
 
-#endif /* #ifndef __INC_DOT11D_H */
+#endif
drivers/staging/rtl8192u/ieee80211/ieee80211.h +8 -27
index 8be8a94a2253..d110e9333799 100644
@@ -106,17 +106,13 @@ struct cb_desc {
 	u8 bRTSUseShortGI:1;
 	u8 bMulticast:1;
 	u8 bBroadcast:1;
-	/* u8 reserved2:2; */
 	u8 drv_agg_enable:1;
 	u8 reserved2:1;
 
 	/* Tx Desc related element(12-19) */
 	u8 rata_index;
 	u8 queue_index;
-	/* u8 reserved3; */
-	/* u8 reserved4; */
 	u16 txbuf_size;
-	/* u8 reserved5; */
 	u8 RATRIndex;
 	u8 reserved6;
 	u8 reserved7;
@@ -127,9 +123,6 @@ struct cb_desc {
 	u8 rts_rate;
 	u8 ampdu_factor;
 	u8 ampdu_density;
-	/* u8 reserved9; */
-	/* u8 reserved10; */
-	/* u8 reserved11; */
 	u8 DrvAggrNum;
 	u16 pkt_size;
 	u8 reserved12;
@@ -883,7 +876,8 @@ enum ieee80211_mfie {
 	MFIE_TYPE_QOS_PARAMETER = 222,
 };
 
-/* Minimal header; can be used for passing 802.11 frames with sufficient
+/*
+ * Minimal header; can be used for passing 802.11 frames with sufficient
  * information to determine what type of underlying data type is actually
  * stored in the data.
  */
@@ -1144,7 +1138,6 @@ struct ieee80211_tim_parameters {
 	u8 tim_period;
 } __packed;
 
-//#else
 struct ieee80211_wmm_ts_info {
 	u8 ac_dir_tid;
 	u8 ac_up_psb;
@@ -1274,7 +1267,6 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
 #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
 
 /* added by David for QoS 2006/6/30 */
-//#define WMM_Hang_8187
 #ifdef WMM_Hang_8187
 #undef WMM_Hang_8187
 #endif
@@ -1290,7 +1282,6 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
 #define MAX_RECEIVE_BUFFER_SIZE 9100
 
 /* UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP */
-//#define UP2AC(up)	((up<3) ? ((up==0)?1:0) : (up>>1))
 #define UP2AC(up) (		   \
 	((up) < 1) ? WME_AC_BE : \
 	((up) < 3) ? WME_AC_BK : \
@@ -1392,7 +1383,6 @@ struct ieee80211_network {
 	bool atheros_cap_exist;
 	bool cisco_cap_exist;
 	bool unknown_cap_exist;
-//	u8	berp_info;
 	bool	berp_info_valid;
 	bool buseprotection;
 	/* put at the end of the structure. */
@@ -1607,7 +1597,7 @@ struct ieee80211_device {
 	struct ieee80211_security sec;
 
 	/* hw security related */
-//	u8 hwsec_support; //support?
+	/* u8 hwsec_support; //support? */
 	u8 hwsec_active;  /* hw security active. */
 	bool is_silent_reset;
 	bool ieee_up;
@@ -1623,8 +1613,6 @@ struct ieee80211_device {
 
 	/* 11n HT below */
 	PRT_HIGH_THROUGHPUT	pHTInfo;
-	//struct timer_list		SwBwTimer;
-//	spinlock_t chnlop_spinlock;
 	spinlock_t bw_spinlock;
 
 	spinlock_t reorder_spinlock;
@@ -1640,8 +1628,6 @@ struct ieee80211_device {
 	u8	bTxUseDriverAssingedRate;
 	atomic_t	atm_chnlop;
 	atomic_t	atm_swbw;
-//	u8	HTHighestOperaRate;
-//	u8	HTCurrentOperaRate;
 
 	/* 802.11e and WMM Traffic Stream Info (TX) */
 	struct list_head		Tx_TS_Admit_List;
@@ -1653,12 +1639,10 @@ struct ieee80211_device {
 	struct list_head		Rx_TS_Pending_List;
 	struct list_head		Rx_TS_Unused_List;
 	struct rx_ts_record		RxTsRecord[TOTAL_TS_NUM];
-//#ifdef TO_DO_LIST
 	struct rx_reorder_entry	RxReorderEntry[128];
 	struct list_head		RxReorder_Unused_List;
-//#endif
 	/* Qos related. Added by Annie, 2005-11-01. */
-//	PSTA_QOS			pStaQos;
+	/* PSTA_QOS			pStaQos; */
 	u8				ForcedPriority;		/* Force per-packet priority 1~7. (default: 0, not to force it.) */
 
 
@@ -1898,9 +1882,6 @@ struct ieee80211_device {
 	/* Qos related. Added by Annie, 2005-11-01. */
 	/* STA_QOS  StaQos; */
 
-	/* u32 STA_EDCA_PARAM[4]; */
-	/* CHANNEL_ACCESS_SETTING ChannelAccessSetting; */
-
 	struct ieee80211_rxb *stats_IndicateArray[REORDER_WIN_SIZE];
 
 	/* Callback functions */
@@ -2002,15 +1983,16 @@ struct ieee80211_device {
 	/* check whether Tx hw resource available */
 	short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
 	/* added by wb for HT related */
-//	void (*SwChnlByTimerHandler)(struct net_device *dev, int channel);
+	/* void (*SwChnlByTimerHandler)(struct net_device *dev, int channel); */
 	void (*SetBWModeHandler)(struct net_device *dev, enum ht_channel_width Bandwidth, enum ht_extension_chan_offset Offset);
-//	void (*UpdateHalRATRTableHandler)(struct net_device* dev, u8* pMcsRate);
+	/* void (*UpdateHalRATRTableHandler)(struct net_device* dev, u8* pMcsRate); */
 	bool (*GetNmodeSupportBySecCfg)(struct net_device *dev);
 	void (*SetWirelessMode)(struct net_device *dev, u8 wireless_mode);
 	bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev);
 	void (*InitialGainHandler)(struct net_device *dev, u8 Operation);
 
-	/* This must be the last item so that it points to the data
+	/*
+	 * This must be the last item so that it points to the data
 	 * allocated beyond this structure by alloc_ieee80211
 	 */
 	u8 priv[0];
@@ -2326,7 +2308,6 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 int ieee80211_debug_init(void);
 void ieee80211_debug_exit(void);
 
-//extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
 void ieee80211_wx_sync_scan_wq(struct work_struct *work);
 
 
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +0 -1
index ad0b918ecf0d..7ec24120d871 100644
@@ -201,7 +201,6 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	pos = skb_push(skb, CCMP_HDR_LEN);
 	memmove(pos, pos + CCMP_HDR_LEN, hdr_len);
 	pos += hdr_len;
-	/* mic = skb_put(skb, CCMP_MIC_LEN); */
 
 	i = CCMP_PN_LEN - 1;
 	while (i >= 0) {
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +0 -1
index db4b640d1d8c..564a6d67de88 100644
@@ -773,6 +773,5 @@ void __exit ieee80211_crypto_tkip_exit(void)
 
 void ieee80211_tkip_null(void)
 {
-//    printk("============>%s()\n", __func__);
 	return;
 }
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +0 -2
index dd7ff7e84bd0..954e43af494b 100644
@@ -194,8 +194,6 @@ void free_ieee80211(struct net_device *dev)
 {
 	struct ieee80211_device *ieee = netdev_priv(dev);
 	int i;
-	/* struct list_head *p, *q; */
-//	del_timer_sync(&ieee->SwBwTimer);
 	kfree(ieee->pHTInfo);
 	ieee->pHTInfo = NULL;
 	RemoveAllTS(ieee);
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +3 -47

247 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +13 -80

394 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +1 -12
index 2bf333c12bbc..2f25eae5e8c0 100644
@@ -94,8 +94,6 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee,
 	/* NM 0.7.0 will not accept channel any more. */
 	fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 100000;
 	fwrq->e = 1;
-	/* fwrq->m = ieee->current_network.channel; */
-	/* fwrq->e = 0; */
 
 	return 0;
 }
@@ -139,7 +137,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
 	int ret = 0;
 	unsigned long flags;
 
-	short ifup = ieee->proto_started; /* dev->flags & IFF_UP; */
+	short ifup = ieee->proto_started;
 	struct sockaddr *temp = (struct sockaddr *)awrq;
 
 	ieee->sync_scan_hurryup = 1;
@@ -522,16 +520,11 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
 		goto exit;
 	}
 	if (wrqu->power.flags & IW_POWER_TIMEOUT) {
-		/* ieee->ps_period = wrqu->power.value / 1000; */
 		ieee->ps_timeout = wrqu->power.value / 1000;
 	}
 
 	if (wrqu->power.flags & IW_POWER_PERIOD) {
-
-		/* ieee->ps_timeout = wrqu->power.value / 1000; */
 		ieee->ps_period = wrqu->power.value / 1000;
-		/* wrq->value / 1024; */
-
 	}
 	switch (wrqu->power.flags & IW_POWER_MODE) {
 	case IW_POWER_UNICAST_R:
@@ -545,7 +538,6 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee,
 		break;
 
 	case IW_POWER_ON:
-		/* ieee->ps = IEEE80211_PS_DISABLED; */
 		break;
 
 	default:
@@ -578,11 +570,8 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
 		wrqu->power.flags = IW_POWER_TIMEOUT;
 		wrqu->power.value = ieee->ps_timeout * 1000;
 	} else {
-		/* ret = -EOPNOTSUPP; */
-		/* goto exit; */
 		wrqu->power.flags = IW_POWER_PERIOD;
 		wrqu->power.value = ieee->ps_period * 1000;
-		/* ieee->current_network.dtim_period * ieee->current_network.beacon_interval * 1024; */
 	}
 
 	if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +1 -2
index f5c991f6d34f..320021752f28 100644
@@ -218,7 +218,6 @@ int ieee80211_encrypt_fragment(
 
 
 void ieee80211_txb_free(struct ieee80211_txb *txb) {
-	//int i;
 	if (unlikely(!txb))
 		return;
 	kfree(txb);
@@ -767,7 +766,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 			skb_frag = txb->fragments[i];
 			tcb_desc = (struct cb_desc *)(skb_frag->cb + MAX_DEV_ADDR_SIZE);
 			if(qos_actived){
-				skb_frag->priority = skb->priority;//UP2AC(skb->priority);
+				skb_frag->priority = skb->priority;
 				tcb_desc->queue_index =  UP2AC(skb->priority);
 			} else {
 				skb_frag->priority = WME_AC_BK;
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +2 -17
index 6cf9e25d6607..b09fd717b760 100644
@@ -60,7 +60,6 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
 	/* Add the ESSID */
 	iwe.cmd = SIOCGIWESSID;
 	iwe.u.data.flags = 1;
-//	if (network->flags & NETWORK_EMPTY_ESSID) {
 	if (network->ssid_len == 0) {
 		iwe.u.data.length = sizeof("<hidden>");
 		start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>");
@@ -92,8 +91,6 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
 
 	/* Add frequency/channel */
 	iwe.cmd = SIOCGIWFREQ;
-/*	iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode);
-	iwe.u.freq.e = 3; */
 	iwe.u.freq.m = network->channel;
 	iwe.u.freq.e = 0;
 	iwe.u.freq.i = 0;
@@ -182,7 +179,6 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
 
 	if (ieee->wpa_enabled && network->wpa_ie_len) {
 		char buf[MAX_WPA_IE_LEN * 2 + 30];
-	//	printk("WPA IE\n");
 		u8 *p = buf;
 		p += sprintf(p, "wpa_ie=");
 		for (i = 0; i < network->wpa_ie_len; i++) {
@@ -234,9 +230,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
 	unsigned long flags;
 
 	char *ev = extra;
-//	char *stop = ev + IW_SCAN_MAX_DATA;
 	char *stop = ev + wrqu->data.length;/* IW_SCAN_MAX_DATA; */
-	//char *stop = ev + IW_SCAN_MAX_DATA;
 	int i = 0;
 	int err = 0;
 	IEEE80211_DEBUG_WX("Getting scan\n");
@@ -541,7 +535,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
 			return -EINVAL;
 	}
 
-	sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT;
+	sec.flags |= SEC_ENABLED;
 	if ((encoding->flags & IW_ENCODE_DISABLED) ||
 	    ext->alg == IW_ENCODE_ALG_NONE) {
 		if (*crypt)
@@ -555,7 +549,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
 
 		if (i == WEP_KEYS) {
 			sec.enabled = 0;
-		      //  sec.encrypt = 0;
 			sec.level = SEC_LEVEL_0;
 			sec.flags |= SEC_LEVEL;
 		}
@@ -563,7 +556,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
 	}
 
 	sec.enabled = 1;
-    //    sec.encrypt = 1;
 	switch (ext->alg) {
 	case IW_ENCODE_ALG_WEP:
 		alg = "WEP";
@@ -631,19 +623,15 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
 	}
 
 	if (ext->alg != IW_ENCODE_ALG_NONE) {
-		//memcpy(sec.keys[idx], ext->key, ext->key_len);
 		sec.key_sizes[idx] = ext->key_len;
 		sec.flags |= BIT(idx);
 		if (ext->alg == IW_ENCODE_ALG_WEP) {
-		      //  sec.encode_alg[idx] = SEC_ALG_WEP;
 			sec.flags |= SEC_LEVEL;
 			sec.level = SEC_LEVEL_1;
 		} else if (ext->alg == IW_ENCODE_ALG_TKIP) {
-		      //  sec.encode_alg[idx] = SEC_ALG_TKIP;
 			sec.flags |= SEC_LEVEL;
 			sec.level = SEC_LEVEL_2;
 		} else if (ext->alg == IW_ENCODE_ALG_CCMP) {
-		       // sec.encode_alg[idx] = SEC_ALG_CCMP;
 			sec.flags |= SEC_LEVEL;
 			sec.level = SEC_LEVEL_3;
 		}
@@ -761,8 +749,6 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
 		break;
 
 	case IW_AUTH_80211_AUTH_ALG:
-		//printk("======>%s():data->value is %d\n",__func__,data->value);
-	//	ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM)?1:0;
 		if (data->value & IW_AUTH_ALG_SHARED_KEY) {
 			ieee->open_wep = 0;
 			ieee->auth_mode = 1;
@@ -800,8 +786,7 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
 
 	if (len>MAX_WPA_IE_LEN || (len && ie == NULL))
 	{
-	//	printk("return error out, len:%d\n", len);
-	return -EINVAL;
+		return -EINVAL;
 	}
 
 
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +0 -3
index adfe1878f36d..aed114573edb 100644
@@ -164,7 +164,6 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, s
 
 	IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
 	return skb;
-	//return NULL;
 }
 
 
@@ -205,7 +204,6 @@ static struct sk_buff *ieee80211_DELBA(
 	skb = dev_alloc_skb(len + sizeof(struct rtl_80211_hdr_3addr)); /* need to add something others? FIXME */
 	if (!skb)
 		return NULL;
-//	memset(skb->data, 0, len+sizeof( struct rtl_80211_hdr_3addr));
 	skb_reserve(skb, ieee->tx_headroom);
 
 	Delba = skb_put(skb, sizeof(struct rtl_80211_hdr_3addr));
@@ -598,7 +596,6 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb)
 		pTxTs->add_ba_req_in_progress = false;
 		pTxTs->add_ba_req_delayed = false;
 		del_timer_sync(&pTxTs->ts_add_ba_timer);
-		//PlatformCancelTimer(Adapter, &pTxTs->ts_add_ba_timer);
 		TxTsDeleteBA(ieee, pTxTs);
 	}
 	return 0;
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +0 -2
index 5691de03e740..71665b3da617 100644
@@ -233,8 +233,6 @@ typedef struct _BSS_HT {
 	u16					bdHTInfoLen;
 
 	HT_SPEC_VER				bdHTSpecVer;
-	//struct ht_capability_ele              bdHTCapEle;
-	//HT_INFORMATION_ELE		bdHTInfoEle;
 
 	u8					bdRT2RTAggregation;
 	u8					bdRT2RTLongSlotTime;
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +6 -48

181 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +2 -2
index 44418a284fe9..c5692e5414ec 100644
@@ -51,7 +51,7 @@ struct qos_tsinfo {
  * Note: sizeof 55 bytes
  */
 struct tspec_body {
-	struct qos_tsinfo	ts_info;	//u8	TSInfo[3];
+	struct qos_tsinfo	ts_info;
 	u16	nominal_msd_usize;
 	u16	max_msd_usize;
 	u32	min_service_itv;
@@ -79,4 +79,4 @@ struct octet_string {
 
 #define is_ac_valid(ac)			(((ac) <= 7) ? true : false)
 
-#endif // #ifndef __INC_QOS_TYPE_H
+#endif
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +0 -11
index 469d6ab3dc8e..903373769464 100644
@@ -30,7 +30,6 @@ static void RxPktPendingTimeout(struct timer_list *t)
 
 	struct rx_reorder_entry	*pReorderEntry = NULL;
 
-	//u32 flags = 0;
 	unsigned long flags = 0;
 	u8 index = 0;
 	bool bPktInBuf = false;
@@ -179,14 +178,12 @@ void TSInitialize(struct ieee80211_device *ieee)
 	}
 	/* Initialize unused Rx Reorder List. */
 	INIT_LIST_HEAD(&ieee->RxReorder_Unused_List);
-//#ifdef TO_DO_LIST
 	for (count = 0; count < REORDER_ENTRY_NUM; count++) {
 		list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List);
 		if (count == (REORDER_ENTRY_NUM-1))
 			break;
 		pRxReorderEntry = &ieee->RxReorderEntry[count+1];
 	}
-//#endif
 }
 
 static void AdmitTS(struct ieee80211_device *ieee,
@@ -205,7 +202,6 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee,
 						  u8 *Addr, u8 TID,
 						  enum tr_select TxRxSelect)
 {
-	//DIRECTION_VALUE	dir;
 	u8	dir;
 	bool				search_dir[4] = {0};
 	struct list_head		*psearch_list; /* FIXME */
@@ -240,16 +236,13 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee,
 	else
 		psearch_list = &ieee->Rx_TS_Admit_List;
 
-	//for(dir = DIR_UP; dir <= DIR_BI_DIR; dir++)
 	for (dir = 0; dir <= DIR_BI_DIR; dir++) {
 		if (!search_dir[dir])
 			continue;
 		list_for_each_entry(pRet, psearch_list, list) {
-	//		IEEE80211_DEBUG(IEEE80211_DL_TS, "ADD:%pM, TID:%d, dir:%d\n", pRet->Addr, pRet->TSpec.ts_info.ucTSID, pRet->TSpec.ts_info.ucDirection);
 			if (memcmp(pRet->addr, Addr, 6) == 0)
 				if (pRet->t_spec.ts_info.uc_tsid == TID)
 					if (pRet->t_spec.ts_info.uc_direction == dir) {
-	//					printk("Bingo! got it\n");
 						break;
 					}
 		}
@@ -409,14 +402,12 @@ bool GetTs(
 static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *pTs,
 			  enum tr_select TxRxSelect)
 {
-	//u32 flags = 0;
 	unsigned long flags = 0;
 	del_timer_sync(&pTs->setup_timer);
 	del_timer_sync(&pTs->inact_timer);
 	TsInitDelBA(ieee, pTs, TxRxSelect);
 
 	if (TxRxSelect == RX_DIR) {
-//#ifdef TO_DO_LIST
 		struct rx_reorder_entry	*pRxReorderEntry;
 		struct rx_ts_record     *pRxTS = (struct rx_ts_record *)pTs;
 		if (timer_pending(&pRxTS->rx_pkt_pending_timer))
@@ -424,7 +415,6 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 
 		while (!list_empty(&pRxTS->rx_pending_pkt_list)) {
 			spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
-			//pRxReorderEntry = list_entry(&pRxTS->rx_pending_pkt_list.prev,RX_REORDER_ENTRY,List);
 			pRxReorderEntry = list_entry(pRxTS->rx_pending_pkt_list.prev, struct rx_reorder_entry, List);
 			list_del_init(&pRxReorderEntry->List);
 			{
@@ -444,7 +434,6 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 			spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
 		}
 
-//#endif
 	} else {
 		struct tx_ts_record *pTxTS = (struct tx_ts_record *)pTs;
 		del_timer_sync(&pTxTS->ts_add_ba_timer);
drivers/staging/rtl8192u/r8190_rtl8256.c +0 -3
index 716be24bace6..f8790ab16c61 100644
@@ -34,9 +34,6 @@ void phy_set_rf8256_bandwidth(struct net_device *dev, enum ht_channel_width Band
 	u8	eRFPath;
 	struct r8192_priv *priv = ieee80211_priv(dev);
 
-	/* for(eRFPath = RF90_PATH_A; eRFPath <pHalData->NumTotalRFPath;
-	 *  eRFPath++)
-	 */
 	for (eRFPath = 0; eRFPath < RF90_PATH_MAX; eRFPath++) {
 		if (!rtl8192_phy_CheckIsLegalRFPath(dev, eRFPath))
 			continue;
drivers/staging/rtl8192u/r8192U_core.c +1 -4
index 410c8a3e56d7..85d476af0586 100644
@@ -458,8 +458,6 @@ int read_nic_dword(struct net_device *dev, int indx, u32 *data)
 	return 0;
 }
 
-/* u8 read_phy_cck(struct net_device *dev, u8 adr); */
-/* u8 read_phy_ofdm(struct net_device *dev, u8 adr); */
 /*
  * this might still called in what was the PHY rtl8185/rtl8192 common code
  * plans are to possibility turn it again in one common code...
@@ -4747,7 +4745,7 @@ static void rtl8192_rx_nomal(struct sk_buff *skb)
 		/* TODO */
 		/* hardware related info */
 		/* Process the MPDU received */
-		skb_trim(skb, skb->len - 4/*sCrcLng*/);
+		skb_trim(skb, skb->len - 4);
 
 		rx_pkt_len = skb->len;
 		ieee80211_hdr = (struct rtl_80211_hdr_1addr *)skb->data;
@@ -4846,7 +4844,6 @@ static void rtl8192_rx_cmd(struct sk_buff *skb)
 
 	if ((skb->len >= (20 + sizeof(struct rx_desc_819x_usb))) && (skb->len < RX_URB_SIZE)) {
 		query_rx_cmdpkt_desc_status(skb, &stats);
-		/* prfd->queue_id = 1; */
 
 		/* Process the command packet received. */
 
drivers/staging/rtl8192u/r8192U_dm.c +0 -60

332 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U_wx.c +0 -2
index adb9fe8a79da..839671cc7f96 100644
@@ -470,7 +470,6 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
 	int ret;
 	struct r8192_priv *priv = ieee80211_priv(dev);
-	/* struct sockaddr *temp = (struct sockaddr *)awrq; */
 	mutex_lock(&priv->wx_mutex);
 
 	ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
@@ -746,7 +745,6 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
 			/* none is not allowed to use hwsec WB 2008.07.01 */
 			goto end_hw_sec;
 
-		/* as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4; */
 		alg =  (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg;
 		idx = encoding->flags & IW_ENCODE_INDEX;
 		if (idx)
drivers/staging/rtl8192u/r819xU_firmware.c +0 -1
index e9511b829b05..0e47b5f75695 100644
@@ -296,7 +296,6 @@ bool init_firmware(struct net_device *dev)
 			 * will set polling bit when firmware code is also configured
 			 */
 			pfirmware->firmware_status = FW_STATUS_1_MOVE_BOOT_CODE;
-			/* mdelay(1000); */
 			/*
 			 * To initialize IMEM, CPU move code  from 0x80000080,
 			 * hence, we send 0x80 byte packet

--
2.17.1

maintainer
#4 lore raw

Re: [PATCH 2/3] drivers/staging/rtl8192u: Remove comment-out code

Quoted 37 lines · Christian Müller

From: Felix Trommer <[email protected]>

Remove the majority of all commented-out code. Commented out code, that was adressed by a comment itself is not removed. The code that we left in as comments was mostly due to the "pseudo-code"-like nature of the code that helped to clarify certain functionalities.

---
 drivers/staging/rtl8192u/ieee80211/dot11d.h   |  2 +-
 .../staging/rtl8192u/ieee80211/ieee80211.h    | 35 ++-----
 .../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c |  1 -
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c |  1 -
 .../rtl8192u/ieee80211/ieee80211_module.c     |  2 -
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 50 +---------
 .../rtl8192u/ieee80211/ieee80211_softmac.c    | 93 +++----------------
 .../rtl8192u/ieee80211/ieee80211_softmac_wx.c | 13 +--
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c |  3 +-
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c | 19 +---
 .../rtl8192u/ieee80211/rtl819x_BAProc.c       |  3 -
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   |  2 -
 .../rtl8192u/ieee80211/rtl819x_HTProc.c       | 54 ++---------
 .../staging/rtl8192u/ieee80211/rtl819x_Qos.h  |  4 +-
 .../rtl8192u/ieee80211/rtl819x_TSProc.c       | 11 ---
 drivers/staging/rtl8192u/r8190_rtl8256.c      |  3 -
 drivers/staging/rtl8192u/r8192U_core.c        |  5 +-
 drivers/staging/rtl8192u/r8192U_dm.c          | 60 ------------
 drivers/staging/rtl8192u/r8192U_wx.c          |  2 -
 drivers/staging/rtl8192u/r819xU_firmware.c    |  1 -
 20 files changed, 38 insertions(+), 326 deletions(-)
drivers/staging/rtl8192u/ieee80211/dot11d.h +0 -0
index 8b485fa18089..f27267307b3f 100644

drivers/staging/rtl8192u/ieee80211/dot11d.h void dot11d_scan_complete(struct ieee80211_device *dev); · line 57

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/dot11d.h +1 -1
@@ -54,4 +54,4 @@ void dot11d_scan_complete(struct ieee80211_device *dev);
 int is_legal_channel(struct ieee80211_device *dev, u8 channel);
 int to_legal_channel(struct ieee80211_device *dev, u8 channel);
 
-#endif /* #ifndef __INC_DOT11D_H */
+#endif

This type of comment is there for a good reason :(

Quoted 33 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -7
index 8be8a94a2253..d110e9333799 100644
@@ -106,17 +106,13 @@ struct cb_desc {
 	u8 bRTSUseShortGI:1;
 	u8 bMulticast:1;
 	u8 bBroadcast:1;
-	/* u8 reserved2:2; */
 	u8 drv_agg_enable:1;
 	u8 reserved2:1;
 
 	/* Tx Desc related element(12-19) */
 	u8 rata_index;
 	u8 queue_index;
-	/* u8 reserved3; */
-	/* u8 reserved4; */
 	u16 txbuf_size;
-	/* u8 reserved5; */
 	u8 RATRIndex;
 	u8 reserved6;
 	u8 reserved7;
@@ -127,9 +123,6 @@ struct cb_desc {
 	u8 rts_rate;
 	u8 ampdu_factor;
 	u8 ampdu_density;
-	/* u8 reserved9; */
-	/* u8 reserved10; */
-	/* u8 reserved11; */
 	u8 DrvAggrNum;
 	u16 pkt_size;
 	u8 reserved12;

drivers/staging/rtl8192u/ieee80211/ieee80211.h enum ieee80211_mfie { · line 883

Quoted 9 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +2 -1
@@ -883,7 +876,8 @@ enum ieee80211_mfie {
 	MFIE_TYPE_QOS_PARAMETER = 222,
 };
 
-/* Minimal header; can be used for passing 802.11 frames with sufficient
+/*
+ * Minimal header; can be used for passing 802.11 frames with sufficient
  * information to determine what type of underlying data type is actually
  * stored in the data.
  */

That change is not removing commented out code :(

Please be a lot more careful as to what you are doing in a patch when you submit it...

Quoted 9 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -1
@@ -1144,7 +1138,6 @@ struct ieee80211_tim_parameters {
 	u8 tim_period;
 } __packed;
 
-//#else
 struct ieee80211_wmm_ts_info {
 	u8 ac_dir_tid;
 	u8 ac_up_psb;

drivers/staging/rtl8192u/ieee80211/ieee80211.h enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame}; · line 1272

Quoted 7 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -1
@@ -1274,7 +1267,6 @@ enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};
 #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
 
 /* added by David for QoS 2006/6/30 */
-//#define WMM_Hang_8187
 #ifdef WMM_Hang_8187
 #undef WMM_Hang_8187
 #endif

Are you sure you should remove this commented out line?

thanks,

greg k-h

#5 lore raw

PATCH 3/3 drivers/staging/rtl8192u: Fix of checkpatch-errors

In reply to Christian Müller

Fix issues that lead to multiple checkpatch warnings and errors, most of them regarding formatting of code and comments.
Comments that contain only commented out code are removed as well.

---
 .../staging/rtl8192u/ieee80211/ieee80211.h    |  18 +-
 .../rtl8192u/ieee80211/ieee80211_module.c     |   1 +
 .../staging/rtl8192u/ieee80211/ieee80211_rx.c | 651 ++++++++----------
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |  48 +-
 .../staging/rtl8192u/ieee80211/ieee80211_tx.c | 206 +++---
 .../staging/rtl8192u/ieee80211/ieee80211_wx.c |  59 +-
 .../rtl8192u/ieee80211/rtl819x_BAProc.c       |  18 +-
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   |  15 +-
 .../rtl8192u/ieee80211/rtl819x_HTProc.c       |  16 +-
 .../rtl8192u/ieee80211/rtl819x_TSProc.c       |  14 +-
 drivers/staging/rtl8192u/r8192U_dm.c          |  53 +-
 drivers/staging/rtl8192u/r8192U_hw.h          |  16 +-
 drivers/staging/rtl8192u/r8192U_wx.c          |   3 +-
 drivers/staging/rtl8192u/r819xU_firmware.c    |   2 +-
 14 files changed, 480 insertions(+), 640 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211.h +9 -9
index d110e9333799..bab975f96a09 100644
@@ -446,26 +446,26 @@ typedef enum _InitialGainOpType {
 extern u32 ieee80211_debug_level;
 #define IEEE80211_DEBUG(level, fmt, args...) \
 do { if (ieee80211_debug_level & (level)) \
-  printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)
+	printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)
 /* wb added to debug out data buf */
 /* if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA */
 #define IEEE80211_DEBUG_DATA(level, data, datalen)	\
-	do { if ((ieee80211_debug_level & (level)) == (level))	\
-		{	\
+	do { \
+		if ((ieee80211_debug_level & (level)) == (level)) {	\
 			int i;					\
 			u8 *pdata = (u8 *) data;			\
 			printk(KERN_DEBUG "ieee80211: %s()\n", __func__);	\
-			for (i = 0; i < (int)(datalen); i++)			\
-			{						\
+			for (i = 0; i < (int)(datalen); i++) {		\
 				printk("%2x ", pdata[i]);		\
-				if ((i + 1) % 16 == 0) printk("\n");	\
+				if ((i + 1) % 16 == 0)	\
+					printk("\n");	\
 			}				\
 			printk("\n");			\
 		}					\
 	} while (0)
 #else
-#define IEEE80211_DEBUG (level, fmt, args...) do {} while (0)
-#define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while(0)
+#define IEEE80211_DEBUG ((level, fmt, args...) do {} while (0))
+#define IEEE80211_DEBUG_DATA ((level, data, datalen) do {} while (0))
 #endif	/* CONFIG_IEEE80211_DEBUG */
 
 /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
@@ -1876,7 +1876,7 @@ struct ieee80211_device {
 	struct work_struct associate_procedure_wq;
 	struct delayed_work softmac_scan_wq;
 	struct delayed_work associate_retry_wq;
-	 struct delayed_work start_ibss_wq;
+	struct delayed_work start_ibss_wq;
 	struct work_struct wx_sync_scan_wq;
 	struct workqueue_struct *wq;
 	/* Qos related. Added by Annie, 2005-11-01. */
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +1 -0
index 954e43af494b..7cad5278b862 100644
@@ -194,6 +194,7 @@ void free_ieee80211(struct net_device *dev)
 {
 	struct ieee80211_device *ieee = netdev_priv(dev);
 	int i;
+
 	kfree(ieee->pHTInfo);
 	ieee->pHTInfo = NULL;
 	RemoveAllTS(ieee);
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +279 -372

1,341 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +25 -23

173 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +87 -119

453 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +28 -31

176 lines not on this page · raw message

drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +13 -5
index aed114573edb..5faf19381c08 100644
@@ -140,7 +140,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, s
 	/* Dialog Token */
 	*tag++ = pBA->dialog_token;
 
-	if (ACT_ADDBARSP == type) {
+	if (type == ACT_ADDBARSP) {
 		/* Status Code */
 		netdev_info(ieee->dev, "=====>to send ADDBARSP\n");
 
@@ -156,7 +156,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, s
 	put_unaligned_le16(pBA->timeout_value, tag);
 	tag += 2;
 
-	if (ACT_ADDBAREQ == type) {
+	if (type == ACT_ADDBAREQ) {
 	/* BA Start SeqCtrl */
 		memcpy(tag, (u8 *)&(pBA->start_seq_ctrl), 2);
 		tag += 2;
@@ -245,6 +245,7 @@ static void ieee80211_send_ADDBAReq(struct ieee80211_device *ieee,
 				    u8 *dst, struct ba_record *pBA)
 {
 	struct sk_buff *skb;
+
 	skb = ieee80211_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); /* construct ACT_ADDBAREQ frames so set statuscode zero. */
 
 	if (skb) {
@@ -271,6 +272,7 @@ static void ieee80211_send_ADDBARsp(struct ieee80211_device *ieee, u8 *dst,
 				    struct ba_record *pBA, u16 StatusCode)
 {
 	struct sk_buff *skb;
+
 	skb = ieee80211_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); /* construct ACT_ADDBARSP frames */
 	if (skb) {
 		softmac_mgmt_xmit(skb, ieee);
@@ -297,6 +299,7 @@ static void ieee80211_send_DELBA(struct ieee80211_device *ieee, u8 *dst,
 				 u16 ReasonCode)
 {
 	struct sk_buff *skb;
+
 	skb = ieee80211_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode); /* construct ACT_ADDBARSP frames */
 	if (skb) {
 		softmac_mgmt_xmit(skb, ieee);
@@ -396,6 +399,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
 OnADDBAReq_Fail:
 	{
 		struct ba_record	BA;
+
 		BA.param_set = *pBaParamSet;
 		BA.timeout_value = *pBaTimeoutVal;
 		BA.dialog_token = *pDialogToken;
@@ -445,7 +449,8 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
 	if (ieee->current_network.qos_data.active == 0  ||
 	    !ieee->pHTInfo->bCurrentHTSupport ||
 	    !ieee->pHTInfo->bCurrentAMPDUEnable) {
-		IEEE80211_DEBUG(IEEE80211_DL_ERR, "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n", ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bCurrentAMPDUEnable);
+		IEEE80211_DEBUG(IEEE80211_DL_ERR, "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",
+			ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bCurrentAMPDUEnable);
 		ReasonCode = DELBA_REASON_UNKNOWN_BA;
 		goto OnADDBARsp_Reject;
 	}
@@ -478,10 +483,10 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
 	 */
 	if (pAdmittedBA->valid) {
 		/* Since BA is already setup, we ignore all other ADDBA Response. */
-		IEEE80211_DEBUG(IEEE80211_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. Drop because already admit it! \n");
+		IEEE80211_DEBUG(IEEE80211_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. Drop because already admit it!\n");
 		return -1;
 	} else if ((!pPendingBA->valid) || (*pDialogToken != pPendingBA->dialog_token)) {
-		IEEE80211_DEBUG(IEEE80211_DL_ERR,  "OnADDBARsp(): Recv ADDBA Rsp. BA invalid, DELBA! \n");
+		IEEE80211_DEBUG(IEEE80211_DL_ERR,  "OnADDBARsp(): Recv ADDBA Rsp. BA invalid, DELBA!\n");
 		ReasonCode = DELBA_REASON_UNKNOWN_BA;
 		goto OnADDBARsp_Reject;
 	} else {
@@ -525,6 +530,7 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
 OnADDBARsp_Reject:
 	{
 		struct ba_record	BA;
+
 		BA.param_set = *pBaParamSet;
 		ieee80211_send_DELBA(ieee, dst, &BA, TX_DIR, ReasonCode);
 		return 0;
@@ -649,6 +655,7 @@ TsInitDelBA(struct ieee80211_device *ieee, struct ts_common_info *pTsCommonInfo,
 				DELBA_REASON_END_BA);
 	} else if (TxRxSelect == RX_DIR) {
 		struct rx_ts_record *pRxTs = (struct rx_ts_record *)pTsCommonInfo;
+
 		if (RxTsDeleteBA(ieee, pRxTs))
 			ieee80211_send_DELBA(
 				ieee,
@@ -677,6 +684,7 @@ void TxBaInactTimeout(struct timer_list *t)
 {
 	struct tx_ts_record *pTxTs = from_timer(pTxTs, t, tx_admitted_ba_record.timer);
 	struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[pTxTs->num]);
+
 	TxTsDeleteBA(ieee, pTxTs);
 	ieee80211_send_DELBA(
 		ieee,
drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +7 -8
index 71665b3da617..177513c8d63b 100644
@@ -247,14 +247,14 @@ extern u8 MCS_FILTER_1SS[16];
  * to add a macro to judge wireless mode.
  */
 #define PICK_RATE(_nLegacyRate, _nMcsRate)	\
-		(_nMcsRate == 0) ? (_nLegacyRate & 0x7f) : (_nMcsRate)
+		((_nMcsRate == 0) ? (_nLegacyRate & 0x7f) : (_nMcsRate))
 /* 2007/07/12 MH We only define legacy and HT wireless mode now. */
 #define	LEGACY_WIRELESS_MODE	IEEE_MODE_MASK
 
 #define CURRENT_RATE(WirelessMode, LegacyRate, HTRate)	\
-					((WirelessMode & (LEGACY_WIRELESS_MODE)) != 0) ?\
+					(((WirelessMode & (LEGACY_WIRELESS_MODE)) != 0) ?\
 						(LegacyRate) :\
-						(PICK_RATE(LegacyRate, HTRate))
+						(PICK_RATE(LegacyRate, HTRate)))
 
 /* MCS Bw 40 {1~7, 12~15,32} */
 #define	RATE_ADPT_1SS_MASK		0xFF
@@ -268,11 +268,10 @@ typedef enum _HT_AGGRE_SIZE {
 	HT_AGG_SIZE_16K = 1,
 	HT_AGG_SIZE_32K = 2,
 	HT_AGG_SIZE_64K = 3,
-}HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E;
+} HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E;
 
 /* Indicate different AP vendor for IOT issue */
-typedef enum _HT_IOT_PEER
-{
+typedef enum _HT_IOT_PEER {
 	HT_IOT_PEER_UNKNOWN = 0,
 	HT_IOT_PEER_REALTEK = 1,
 	HT_IOT_PEER_BROADCOM = 2,
@@ -280,7 +279,7 @@ typedef enum _HT_IOT_PEER
 	HT_IOT_PEER_ATHEROS = 4,
 	HT_IOT_PEER_CISCO = 5,
 	HT_IOT_PEER_MAX = 6
-}HT_IOT_PEER_E, *PHTIOT_PEER_E;
+} HT_IOT_PEER_E, *PHTIOT_PEER_E;
 
 /*
  * IOT Action for different AP
@@ -296,6 +295,6 @@ typedef enum _HT_IOT_ACTION {
 	HT_IOT_ACT_CDD_FSYNC = 0x00000080,
 	HT_IOT_ACT_PURE_N_MODE = 0x00000100,
 	HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200,
-}HT_IOT_ACTION_E, *PHT_IOT_ACTION_E;
+} HT_IOT_ACTION_E, *PHT_IOT_ACTION_E;
 
 #endif /* _RTL819XU_HTTYPE_H_ */
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +8 -8
index c3b6687024cd..8476baaedf7f 100644
@@ -146,7 +146,7 @@ void HTDebugHTCapability(u8 *CapIE, u8 *TitleString)
 	IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk) ? "YES" : "NO");
 	IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor);
 	IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMPDU Density = %d\n", pCapELE->MPDUDensity);
-	IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
+	IEEE80211_DEBUG(IEEE80211_DL_HT,  "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],
 				pCapELE->MCS[1], pCapELE->MCS[2], pCapELE->MCS[3], pCapELE->MCS[4]);
 }
 
@@ -208,7 +208,7 @@ void HTDebugHTInfo(u8 *InfoIE, u8 *TitleString)
 		break;
 	}
 
-	IEEE80211_DEBUG(IEEE80211_DL_HT, "\tBasic MCS Rate Set = [%x][%x][%x][%x][%x]\n", pHTInfoEle->BasicMSC[0],\
+	IEEE80211_DEBUG(IEEE80211_DL_HT, "\tBasic MCS Rate Set = [%x][%x][%x][%x][%x]\n", pHTInfoEle->BasicMSC[0],
 				pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]);
 }
 
@@ -654,13 +654,13 @@ void HTConstructRT2RTAggElement(struct ieee80211_device *ieee, u8 *posRT2RTAgg,
 #ifdef TODO
 #if (HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE)
 	/*
-	//Emily. If it is required to Ask Realtek AP to send AMPDU during AES mode, enable this
-	   section of code.
-	if(IS_UNDER_11N_AES_MODE(Adapter))
-	{
+	 * Emily. If it is required to Ask Realtek AP to send AMPDU during AES mode, enable this
+	 * section of code.
+	 */
+	/*
+	if(IS_UNDER_11N_AES_MODE(Adapter)) {
 		posRT2RTAgg->octet[5] |= RT_HT_CAP_USE_AMPDU;
-	}else
-	{
+	} else {
 		posRT2RTAgg->octet[5] &= 0xfb;
 	}
 	*/
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +11 -3
index 903373769464..b2614669f2d2 100644
@@ -68,7 +68,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
 
 		/* Indicate packets */
 		if (index > REORDER_WIN_SIZE) {
-			IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorder buffer full!! \n");
+			IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorder buffer full!!\n");
 			spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
 			return;
 		}
@@ -96,7 +96,7 @@ static void TsAddBaProcess(struct timer_list *t)
 	struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[num]);
 
 	TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false);
-	IEEE80211_DEBUG(IEEE80211_DL_BA, "TsAddBaProcess(): ADDBA Req is started!! \n");
+	IEEE80211_DEBUG(IEEE80211_DL_BA, "TsAddBaProcess(): ADDBA Req is started!!\n");
 }
 
 
@@ -134,6 +134,7 @@ void TSInitialize(struct ieee80211_device *ieee)
 	struct rx_ts_record     *pRxTS  = ieee->RxTsRecord;
 	struct rx_reorder_entry	*pRxReorderEntry = ieee->RxReorderEntry;
 	u8				count = 0;
+
 	IEEE80211_DEBUG(IEEE80211_DL_TS, "==========>%s()\n", __func__);
 	/* Initialize Tx TS related info. */
 	INIT_LIST_HEAD(&ieee->Tx_TS_Admit_List);
@@ -206,6 +207,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee,
 	bool				search_dir[4] = {0};
 	struct list_head		*psearch_list; /* FIXME */
 	struct ts_common_info	*pRet = NULL;
+
 	if (ieee->iw_mode == IW_MODE_MASTER) { /* ap mode */
 		if (TxRxSelect == TX_DIR) {
 			search_dir[DIR_DOWN] = true;
@@ -251,7 +253,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee,
 	}
 
 	if (&pRet->list  != psearch_list)
-		return pRet ;
+		return pRet;
 	else
 		return NULL;
 }
@@ -367,9 +369,11 @@ bool GetTs(
 				list_del_init(&(*ppTS)->list);
 				if (TxRxSelect == TX_DIR) {
 					struct tx_ts_record *tmp = container_of(*ppTS, struct tx_ts_record, ts_common_info);
+
 					ResetTxTsEntry(tmp);
 				} else {
 					struct rx_ts_record *tmp = container_of(*ppTS, struct rx_ts_record, ts_common_info);
+
 					ResetRxTsEntry(tmp);
 				}
 
@@ -403,6 +407,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 			  enum tr_select TxRxSelect)
 {
 	unsigned long flags = 0;
+
 	del_timer_sync(&pTs->setup_timer);
 	del_timer_sync(&pTs->inact_timer);
 	TsInitDelBA(ieee, pTs, TxRxSelect);
@@ -410,6 +415,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 	if (TxRxSelect == RX_DIR) {
 		struct rx_reorder_entry	*pRxReorderEntry;
 		struct rx_ts_record     *pRxTS = (struct rx_ts_record *)pTs;
+
 		if (timer_pending(&pRxTS->rx_pkt_pending_timer))
 			del_timer_sync(&pRxTS->rx_pkt_pending_timer);
 
@@ -420,6 +426,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 			{
 				int i = 0;
 				struct ieee80211_rxb *prxb = pRxReorderEntry->prxb;
+
 				if (unlikely(!prxb)) {
 					spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
 					return;
@@ -436,6 +443,7 @@ static void RemoveTsEntry(struct ieee80211_device *ieee, struct ts_common_info *
 
 	} else {
 		struct tx_ts_record *pTxTS = (struct tx_ts_record *)pTs;
+
 		del_timer_sync(&pTxTS->ts_add_ba_timer);
 	}
 }
drivers/staging/rtl8192u/r8192U_dm.c +1 -52

125 lines not on this page · raw message

drivers/staging/rtl8192u/r8192U_hw.h +8 -8
index 79d462894f1d..1e5a9c81788a 100644
@@ -87,7 +87,7 @@ enum _RTL8192Usb_HW {
 #define RX_FIFO_THRESHOLD_MASK (BIT(13) | BIT(14) | BIT(15))
 #define RX_FIFO_THRESHOLD_SHIFT 13
 #define RX_FIFO_THRESHOLD_NONE 7
-#define MAX_RX_DMA_MASK 	(BIT(8) | BIT(9) | BIT(10))
+#define MAX_RX_DMA_MASK		(BIT(8) | BIT(9) | BIT(10))
 #define RCR_MXDMA_OFFSET	8
 #define RCR_FIFO_OFFSET		13
 #define RCR_ONLYERLPKT		BIT(31)			/* Early Receiving based on Packet Size. */
@@ -225,13 +225,13 @@ enum _RTL8192Usb_HW {
 #define	RATR_MCS14		0x04000000
 #define	RATR_MCS15		0x08000000
 /* ALL CCK Rate */
-#define RATE_ALL_CCK		RATR_1M|RATR_2M|RATR_55M|RATR_11M
-#define RATE_ALL_OFDM_AG	RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M\
-							|RATR_36M|RATR_48M|RATR_54M
-#define RATE_ALL_OFDM_1SS	RATR_MCS0|RATR_MCS1|RATR_MCS2|RATR_MCS3 | \
-							RATR_MCS4|RATR_MCS5|RATR_MCS6|RATR_MCS7
-#define RATE_ALL_OFDM_2SS	RATR_MCS8|RATR_MCS9	|RATR_MCS10|RATR_MCS11| \
-							RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15
+#define RATE_ALL_CCK		(RATR_1M|RATR_2M|RATR_55M|RATR_11M)
+#define RATE_ALL_OFDM_AG	(RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M\
+						|RATR_36M|RATR_48M|RATR_54M)
+#define RATE_ALL_OFDM_1SS	(RATR_MCS0|RATR_MCS1|RATR_MCS2|RATR_MCS3\
+						|RATR_MCS4|RATR_MCS5|RATR_MCS6|RATR_MCS7)
+#define RATE_ALL_OFDM_2SS	(RATR_MCS8|RATR_MCS9|RATR_MCS10|RATR_MCS11\
+						|RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15)
 
 	EPROM_CMD		= 0xfe58,
 #define Cmd9346CR_9356SEL	BIT(4)
drivers/staging/rtl8192u/r8192U_wx.c +2 -1
index 839671cc7f96..24c11976ea61 100644
@@ -470,6 +470,7 @@ static int r8192_wx_set_wap(struct net_device *dev,
 
 	int ret;
 	struct r8192_priv *priv = ieee80211_priv(dev);
+
 	mutex_lock(&priv->wx_mutex);
 
 	ret = ieee80211_wx_set_wap(priv->ieee80211, info, awrq, extra);
@@ -751,7 +752,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
 			idx--;
 		group = ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY;
 
-		if ((!group) || (IW_MODE_ADHOC == ieee->iw_mode) || (alg ==  KEY_TYPE_WEP40)) {
+		if ((!group) || (ieee->iw_mode == IW_MODE_ADHOC) || (alg ==  KEY_TYPE_WEP40)) {
 			if ((ext->key_len == 13) && (alg == KEY_TYPE_WEP40))
 				alg = KEY_TYPE_WEP104;
 			ieee->pairwise_key_type = alg;
drivers/staging/rtl8192u/r819xU_firmware.c +1 -1
index 0e47b5f75695..b16f1a102c89 100644
@@ -232,7 +232,7 @@ bool init_firmware(struct net_device *dev)
 		rst_opt = OPT_FIRMWARE_RESET;
 		starting_state = FW_INIT_STEP2_DATA;
 	} else {
-		 RT_TRACE(COMP_FIRMWARE, "PlatformInitFirmware: undefined firmware state\n");
+		RT_TRACE(COMP_FIRMWARE, "PlatformInitFirmware: undefined firmware state\n");
 	}
 
 	/*

--
2.17.1

maintainer
#6 lore raw

Re: [PATCH 3/3] drivers/staging/rtl8192u: Fix of checkpatch-errors

Quoted 6 lines · Christian Müller

Fix issues that lead to multiple checkpatch warnings and errors, most of them regarding formatting of code and comments.
Comments that contain only commented out code are removed as well.

- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.

- You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg, and everyone else, to know what this patch is all about. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what a proper Subject: line should look like.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot

#7 lore raw

Re: [PATCH 3/3] drivers/staging/rtl8192u: Fix of checkpatch-errors

In reply to Christian Müller
Quoted 3 lines · Christian Müller

Fix issues that lead to multiple checkpatch warnings and errors, most of them regarding formatting of code and comments.
Comments that contain only commented out code are removed as well.

Generally, the quantity of changes in this patch makes it impossible to review and apply.

It's better to do single issue fixes in separate patches.

All single line whitespace only changes can generally be done in one patch as long as you verify that the object files have pre and post the patch have not changed.

And the first block of this patch doesn't look like it could ever compile properly.

drivers/staging/rtl8192u/ieee80211/ieee80211.h

Quoted 1 line
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0

[]

drivers/staging/rtl8192u/ieee80211/ieee80211.h typedef enum _InitialGainOpType {

Quoted 1 line
drivers/staging/rtl8192u/ieee80211/ieee80211.h +0 -0
@@ -446,26 +446,26 @@ typedef enum _InitialGainOpType {

[]

drivers/staging/rtl8192u/ieee80211/ieee80211.h typedef enum _InitialGainOpType { · line 468

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/ieee80211.h +2 -2
 #else
-#define IEEE80211_DEBUG (level, fmt, args...) do {} while (0)
-#define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while(0)
+#define IEEE80211_DEBUG ((level, fmt, args...) do {} while (0))
+#define IEEE80211_DEBUG_DATA ((level, data, datalen) do {} while (0))

These need to have the space removed after the
macro identifier before the open parentheses and
another level of parentheses removed instead.

#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) #define IEEE80211_DEBUG_DATA(level, data, datalen) do {} while (0)

Given that it's never been compiled, it might as well be removed in another patch.

I didn't look at the rest.