[PATCH 6/7] staging: rtl8192u: Fix comments

Cristina Moraru cristina.moraru09 at gmail.com
Mon Oct 12 08:46:10 EEST 2015


Remove commented code, change C99 comments to regular ones
and move trailing */ to the following line

Signed-off-by: Cristina Moraru <cristina.moraru09 at gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 340 +++++++++-------------
 1 file changed, 143 insertions(+), 197 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 56aea881..445dd5f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -147,8 +147,9 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
 		memcpy(entry->src_addr, hdr->addr2, ETH_ALEN);
 		memcpy(entry->dst_addr, hdr->addr1, ETH_ALEN);
 	} else {
-		/* received a fragment of a frame for which the head fragment
-		 * should have already been received */
+		/* Received a fragment of a frame for which the head fragment
+		 * should have already been received
+		 */
 		entry = ieee80211_frag_cache_find(ieee, seq, frag, tid, hdr->addr2,
 						  hdr->addr1);
 		if (entry != NULL) {
@@ -207,7 +208,8 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
  *
  * Responsible for handling management control frames
  *
- * Called by ieee80211_rx */
+ * Called by ieee80211_rx
+ */
 static inline int
 ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
 			struct ieee80211_rx_stats *rx_stats, u16 type,
@@ -221,7 +223,6 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
 
 	rx_stats->len = skb->len;
 	ieee80211_rx_mgt(ieee, (struct rtl_80211_hdr_4addr *)skb->data, rx_stats);
-	/* if ((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, ieee->current_network.bssid, ETH_ALEN))) */
 	if ((memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN))) { /* use ADDR1 to perform address matching for Management frames */
 		dev_kfree_skb_any(skb);
 		return 0;
@@ -238,9 +239,6 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
 		printk(KERN_DEBUG "%s: Master mode not yet supported.\n",
 		       ieee->dev->name);
 		return 0;
-/*
-  hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *)
-  skb->data);*/
 	}
 
 	if (ieee->hostapd && type == IEEE80211_TYPE_MGMT) {
@@ -248,14 +246,14 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
 		    ieee->iw_mode == IW_MODE_MASTER) {
 			struct sk_buff *skb2;
 			/* Process beacon frames also in kernel driver to
-			 * update STA(AP) table statistics */
+			 * update STA(AP) table statistics
+			 */
 			skb2 = skb_clone(skb, GFP_ATOMIC);
 			if (skb2)
 				hostap_rx(skb2->dev, skb2, rx_stats);
 		}
 
-		/* send management frames to the user space daemon for
-		 * processing */
+		/* Send management frames to the user space daemon for processing */
 		ieee->apdevstats.rx_packets++;
 		ieee->apdevstats.rx_bytes += skb->len;
 		prism2_rx_80211(ieee->apdev, skb, rx_stats, PRISM2_RX_MGMT);
@@ -306,7 +304,7 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee,
 	hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 	fc = le16_to_cpu(hdr->frame_ctl);
 
-	/* check that the frame is unicast frame to us */
+	/* Check that the frame is unicast frame to us */
 	if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
 	    IEEE80211_FCTL_TODS &&
 	    memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0 &&
@@ -322,8 +320,7 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee,
 	if (skb->len < 24 + 8)
 		return 0;
 
-	/* check for port access entity Ethernet type */
-//	pos = skb->data + 24;
+	/* Check for port access entity Ethernet type */
 	pos = skb->data + hdrlen;
 	ethertype = (pos[6] << 8) | pos[7];
 	if (ethertype == ETH_P_PAE)
@@ -412,7 +409,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff *s
 }
 
 
-/* this function is stolen from ipw2200 driver*/
+/* This function is stolen from ipw2200 driver */
 #define IEEE_PACKET_RETRY_TIME (5*HZ)
 static int is_duplicate_packet(struct ieee80211_device *ieee,
 				      struct rtl_80211_hdr_4addr *header)
@@ -428,18 +425,18 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
 	u8 tid;
 
 
-	//TO2DS and QoS
+	/* TO2DS and QoS */
 	if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && IEEE80211_QOS_HAS_SEQ(fc)) {
 	  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)header;
 	  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
 	  tid = UP2AC(tid);
 	  tid++;
-	} else if (IEEE80211_QOS_HAS_SEQ(fc)) { //QoS
+	} else if (IEEE80211_QOS_HAS_SEQ(fc)) { /* QoS */
 	  hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)header;
 	  tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
 	  tid = UP2AC(tid);
 	  tid++;
-	} else { // no QoS
+	} else { /* no QoS */
 	  tid = 0;
 	}
 
@@ -456,7 +453,6 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
 			if (!memcmp(entry->mac, mac, ETH_ALEN))
 				break;
 		}
-	//	if (memcmp(entry->mac, mac, ETH_ALEN)) {
 		if (p == &ieee->ibss_mac_hash[index]) {
 			entry = kmalloc(sizeof(struct ieee_ibss_seq), GFP_ATOMIC);
 			if (!entry) {
@@ -486,19 +482,14 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
 		return 0;
 	}
 
-//	if (tid != 0) {
-//		printk(KERN_WARNING ":)))))))))))%x %x %x, fc(%x)\n", tid, *last_seq, seq, header->frame_ctl);
-//	}
 	if ((*last_seq == seq) &&
 	    time_after(*last_time + IEEE_PACKET_RETRY_TIME, jiffies)) {
 		if (*last_frag == frag) {
-			//printk(KERN_WARNING "[1] go drop!\n");
 			goto drop;
 
 		}
 		if (*last_frag + 1 != frag)
-			/* out-of-order fragment */
-			//printk(KERN_WARNING "[2] go drop!\n");
+			/* Out-of-order fragment */
 			goto drop;
 	} else
 		*last_seq = seq;
@@ -508,9 +499,6 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
 	return 0;
 
 drop:
-//	BUG_ON(!(fc & IEEE80211_FCTL_RETRY));
-//	printk("DUP\n");
-
 	return 1;
 }
 
@@ -538,47 +526,41 @@ void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_
 {
 	u8 i = 0, j = 0;
 	u16 ethertype;
-//	if (index > 1)
-//		IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): hahahahhhh, We indicate packet from reorder list, index is %u\n", __func__,index);
 	for (j = 0; j < index; j++) {
-//added by amy for reorder
+		/* Added by amy for reorder */
 		struct ieee80211_rxb *prxb = prxbIndicateArray[j];
 
 		for (i = 0; i < prxb->nr_subframes; i++) {
 			struct sk_buff *sub_skb = prxb->subframes[i];
 
-		/* convert hdr + possible LLC headers into Ethernet header */
+			/* Convert hdr + possible LLC headers into Ethernet header */
 			ethertype = (sub_skb->data[6] << 8) | sub_skb->data[7];
 			if (sub_skb->len >= 8 &&
 				((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 &&
 				  ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
 				 memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
-			/* remove RFC1042 or Bridge-Tunnel encapsulation and
-			 * replace EtherType */
+				/* Remove RFC1042 or Bridge-Tunnel encapsulation and
+			 	 * replace EtherType
+			 	 */
 				skb_pull(sub_skb, SNAP_SIZE);
 				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
 				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
 			} else {
 				u16 len;
-			/* Leave Ethernet header part of hdr and full payload */
+				/* Leave Ethernet header part of hdr and full payload */
 				len = htons(sub_skb->len);
 				memcpy(skb_push(sub_skb, 2), &len, 2);
 				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, ETH_ALEN);
 				memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN);
 			}
-			//stats->rx_packets++;
-			//stats->rx_bytes += sub_skb->len;
 
-		/* Indicat the packets to upper layer */
+			/* Indicate the packets to upper layer */
 			if (sub_skb) {
-				//printk("0skb_len(%d)\n", skb->len);
 				sub_skb->protocol = eth_type_trans(sub_skb, ieee->dev);
 				memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
 				sub_skb->dev = ieee->dev;
 				sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */
-				//skb->ip_summed = CHECKSUM_UNNECESSARY; /* 802.11 crc not sufficient */
 				ieee->last_rx_ps_time = jiffies;
-				//printk("1skb_len(%d)\n", skb->len);
 				netif_rx(sub_skb);
 			}
 		}
@@ -651,11 +633,9 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 		IEEE80211_DEBUG(IEEE80211_DL_REORDER, "Packets indication!! IndicateSeq: %d, NewSeq: %d\n",\
 				pTS->RxIndicateSeq, SeqNum);
 		prxbIndicateArray[0] = prxb;
-//		printk("========================>%s(): SeqNum is %d\n", __func__, seqNum);
 		index = 1;
 	} else {
 		/* Current packet is going to be inserted into pending list.*/
-		//IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): We RX no ordered packed, insert to ordered list\n", __func__);
 		if (!list_empty(&ieee->RxReorder_Unused_List)) {
 			pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next, RX_REORDER_ENTRY, List);
 			list_del_init(&pReorderEntry->List);
@@ -663,7 +643,6 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 			/* Make a reorder entry and insert into a the packet list.*/
 			pReorderEntry->SeqNum = SeqNum;
 			pReorderEntry->prxb = prxb;
-	//		IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): pREorderEntry->SeqNum is %d\n", __func__,pReorderEntry->SeqNum);
 
 			if (!AddReorderEntry(pTS, pReorderEntry)) {
 				IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n",
@@ -719,7 +698,6 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 
 			IEEE80211_DEBUG(IEEE80211_DL_REORDER, "Packets indication!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum);
 			prxbIndicateArray[index] = pReorderEntry->prxb;
-		//	printk("========================>%s(): pReorderEntry->SeqNum is %d\n", __func__,pReorderEntry->SeqNum);
 			index++;
 
 			list_add_tail(&pReorderEntry->List, &ieee->RxReorder_Unused_List);
@@ -731,11 +709,10 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 
 	/* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/
 	if (index > 0) {
-		// Cancel previous pending timer.
-	//	del_timer_sync(&pTS->RxPktPendingTimer);
+		/* Cancel previous pending timer. */
 		pTS->RxTimeoutIndicateSeq = 0xffff;
 
-		// Indicate packets
+		/* Indicate packets */
 		if (index > REORDER_WIN_SIZE) {
 			IEEE80211_DEBUG(IEEE80211_DL_ERR, "RxReorderIndicatePacket(): Rx Reorer buffer full!!\n");
 			return;
@@ -744,7 +721,7 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
 	}
 
 	if (bPktInBuf && pTS->RxTimeoutIndicateSeq == 0xffff) {
-		// Set new pending timer.
+		/* Set new pending timer. */
 		IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): SET rx timeout timer\n", __func__);
 		pTS->RxTimeoutIndicateSeq = pTS->RxIndicateSeq;
 		if (timer_pending(&pTS->RxPktPendingTimer))
@@ -783,9 +760,8 @@ static u8 parse_subframe(struct sk_buff *skb,
 
 	if (rx_stats->bContainHTC)
 		LLCOffset += sHTCLng;
-	//printk("ChkLength = %d\n", LLCOffset);
-	// Null packet, don't indicate it to upper layer
-	ChkLength = LLCOffset;/* + (Frame_WEP(frame)!=0 ?Adapter->MgntInfo.SecurityInfo.EncryptionHeadOverhead:0);*/
+	/* Null packet, don't indicate it to upper layer */
+	ChkLength = LLCOffset;
 
 	if (skb->len <= ChkLength)
 		return 0;
@@ -802,7 +778,6 @@ static u8 parse_subframe(struct sk_buff *skb,
 
 		memcpy(rxb->src, src, ETH_ALEN);
 		memcpy(rxb->dst, dst, ETH_ALEN);
-		//IEEE80211_DEBUG_DATA(IEEE80211_DL_RX, skb->data, skb->len);
 		return 1;
 	} else {
 		rxb->nr_subframes = 0;
@@ -811,7 +786,7 @@ static u8 parse_subframe(struct sk_buff *skb,
 		while (skb->len > ETHERNET_HEADER_SIZE) {
 			/* Offset 12 denote 2 mac address */
 			nSubframe_Length = *((u16 *)(skb->data + 12));
-			//==m==>change the length order
+			/* ==m==>change the length order */
 			nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8);
 
 			if (skb->len < (ETHERNET_HEADER_SIZE + nSubframe_Length)) {
@@ -823,7 +798,7 @@ static u8 parse_subframe(struct sk_buff *skb,
 				return 0;
 			}
 
-			/* move the data point to data content */
+			/* Move the data point to data content */
 			skb_pull(skb, ETHERNET_HEADER_SIZE);
 
 #ifdef JOHN_NOCPY
@@ -860,22 +835,19 @@ static u8 parse_subframe(struct sk_buff *skb,
 #ifdef JOHN_NOCPY
 		dev_kfree_skb(skb);
 #endif
-		//{just for debug added by david
-		//printk("AMSDU::rxb->nr_subframes = %d\n",rxb->nr_subframes);
-		//}
 		return rxb->nr_subframes;
 	}
 }
 
 /* All received frames are sent to this function. @skb contains the frame in
  * IEEE 802.11 format, i.e., in the format it was sent over air.
- * This function is called only as a tasklet (software IRQ). */
+ * This function is called only as a tasklet (software IRQ).
+ */
 int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		 struct ieee80211_rx_stats *rx_stats)
 {
 	struct net_device *dev = ieee->dev;
 	struct rtl_80211_hdr_4addr *hdr;
-	//struct rtl_80211_hdr_3addrqos *hdr;
 
 	size_t hdrlen;
 	u16 fc, type, stype, sc;
@@ -883,12 +855,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 	unsigned int frag;
 	u8 *payload;
 	u16 ethertype;
-	//added by amy for reorder
+	/* Added by amy for reorder */
 	u8	TID = 0;
 	u16	SeqNum = 0;
 	PRX_TS_RECORD pTS = NULL;
-	//bool bIsAggregateFrame = false;
-	//added by amy for reorder
+	/* Added by amy for reorder */
 #ifdef NOT_YET
 	struct net_device *wds = NULL;
 	struct sk_buff *skb2 = NULL;
@@ -897,7 +868,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 	int from_assoc_ap = 0;
 	void *sta = NULL;
 #endif
-//	u16 qos_ctl = 0;
 	u8 dst[ETH_ALEN];
 	u8 src[ETH_ALEN];
 	u8 bssid[ETH_ALEN];
@@ -906,7 +876,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
 	int i;
 	struct ieee80211_rxb *rxb = NULL;
-	// cheat the the hdr type
+	/* Cheat the hdr type */
 	hdr = (struct rtl_80211_hdr_4addr *)skb->data;
 	stats = &ieee->stats;
 
@@ -931,10 +901,10 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		rx_stats->bContainHTC = true;
 	}
 
-	//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 #ifdef NOT_YET
 	/* Put this code here so that we avoid duplicating it in all
-	 * Rx paths. - Jean II */
+	 * Rx paths. - Jean II
+	 */
 #ifdef IW_WIRELESS_SPY		/* defined in iw_handler.h */
 	/* If spy monitoring on */
 	if (iface->spy_data.spy_number > 0) {
@@ -971,15 +941,17 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		 * bcrx_sta_key parameter is set, station specific key is used
 		 * even with broad/multicast targets (this is against IEEE
 		 * 802.11, but makes it easier to use different keys with
-		 * stations that do not support WEP key mapping). */
+		 * stations that do not support WEP key mapping).
+		 */
 
 		if (!(hdr->addr1[0] & 0x01) || local->bcrx_sta_key)
 			(void) hostap_handle_sta_crypto(local, hdr, &crypt,
 							&sta);
 #endif
 
-		/* allow NULL decrypt to indicate an station specific override
-		 * for default encryption */
+		/* Allow NULL decrypt to indicate an station specific override
+		 * for default encryption
+		 */
 		if (crypt && (crypt->ops == NULL ||
 			      crypt->ops->decrypt_mpdu == NULL))
 			crypt = NULL;
@@ -988,7 +960,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 			/* This seems to be triggered by some (multicast?)
 			 * frames from other than current BSS, so just drop the
 			 * frames silently instead of filling system log with
-			 * these reports. */
+			 * these reports.
+			 */
 			IEEE80211_DEBUG_DROP("Decryption failed (not set)"
 					     " (SA=%pM)\n",
 					     hdr->addr2);
@@ -1000,14 +973,13 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 	if (skb->len < IEEE80211_DATA_HDR3_LEN)
 		goto rx_dropped;
 
-	// if QoS enabled, should check the sequence for each of the AC
+	/* If QoS enabled, should check the sequence for each of the AC */
 	if ((!ieee->pHTInfo->bCurRxReorderEnable) || !ieee->current_network.qos_data.active || !IsDataFrame(skb->data) || IsLegacyDataFrame(skb->data)) {
 		if (is_duplicate_packet(ieee, hdr))
 		goto rx_dropped;
 
 	} else {
 		PRX_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(
 				ieee,
 				(PTS_COMMON_INFO *) &pRxTS,
@@ -1016,7 +988,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 				RX_DIR,
 				true)) {
 
-		//	IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): pRxTS->RxLastFragNum is %d,frag is %d,pRxTS->RxLastSeqNum is %d, seq is %d\n", __func__,pRxTS->RxLastFragNum,frag,pRxTS->RxLastSeqNum,WLAN_GET_SEQ_SEQ(sc));
 			if ((fc & (1<<11)) &&
 			    (frag == pRxTS->RxLastFragNum) &&
 			    (WLAN_GET_SEQ_SEQ(sc) == pRxTS->RxLastSeqNum)) {
@@ -1031,9 +1002,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		}
 	}
 	if (type == IEEE80211_FTYPE_MGMT) {
-
-
-	//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 		if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype))
 			goto rx_dropped;
 		else
@@ -1106,15 +1074,15 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		}
 	}
 #endif
-	//IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
 	/* Nullfunc frames may have PS-bit set, so they must be passed to
-	 * hostap_handle_sta_rx() before being dropped here. */
+	 * hostap_handle_sta_rx() before being dropped here.
+	 */
 	if (stype != IEEE80211_STYPE_DATA &&
 	    stype != IEEE80211_STYPE_DATA_CFACK &&
 	    stype != IEEE80211_STYPE_DATA_CFPOLL &&
 	    stype != IEEE80211_STYPE_DATA_CFACKPOLL &&
-	    stype != IEEE80211_STYPE_QOS_DATA//add by David,2006.8.4
-	  ) {
+	    /* add by David,2006.8.4 */
+	    stype != IEEE80211_STYPE_QOS_DATA) {
 		if (stype != IEEE80211_STYPE_NULLFUNC)
 			IEEE80211_DEBUG_DROP(
 				"RX: dropped data frame "
@@ -1126,8 +1094,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 	if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN))
 		goto rx_dropped;
 
-	/* skb: hdr + (possibly fragmented, possibly encrypted) payload */
-
 	if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
 	    (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
 		printk("decrypt frame error\n");
@@ -1137,9 +1103,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
 	hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
-	/* skb: hdr + (possibly fragmented) plaintext payload */
-	// PR: FIXME: hostap has additional conditions in the "if" below:
-	// ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
 	if ((frag != 0 || (fc & IEEE80211_FCTL_MOREFRAGS))) {
 		int flen;
 		struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr);
@@ -1167,12 +1130,14 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		}
 
 		if (frag == 0) {
-			/* copy first fragment (including full headers) into
-			 * beginning of the fragment cache skb */
+			/* Copy first fragment (including full headers) into
+			 * beginning of the fragment cache skb
+			 */
 			memcpy(skb_put(frag_skb, flen), skb->data, flen);
 		} else {
-			/* append frame payload to the end of the fragment
-			 * cache skb */
+			/* Append frame payload to the end of the fragment
+			 * cache skb
+			 */
 			memcpy(skb_put(frag_skb, flen), skb->data + hdrlen,
 			       flen);
 		}
@@ -1180,39 +1145,42 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		skb = NULL;
 
 		if (fc & IEEE80211_FCTL_MOREFRAGS) {
-			/* more fragments expected - leave the skb in fragment
+			/* More fragments expected - leave the skb in fragment
 			 * cache for now; it will be delivered to upper layers
-			 * after all fragments have been received */
+			 * after all fragments have been received
+			 */
 			goto rx_exit;
 		}
 
-		/* this was the last fragment and the frame will be
-		 * delivered, so remove skb from fragment cache */
+		/* This was the last fragment and the frame will be
+		 * delivered, so remove skb from fragment cache
+		 */
 		skb = frag_skb;
 		hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 		ieee80211_frag_cache_invalidate(ieee, hdr);
 	}
 
 	/* skb: hdr + (possible reassembled) full MSDU payload; possibly still
-	 * encrypted/authenticated */
+	 * encrypted/authenticated
+	 */
 	if (ieee->host_decrypt && (fc & IEEE80211_FCTL_WEP) &&
 	    ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) {
 		printk("==>decrypt msdu error\n");
 		goto rx_dropped;
 	}
 
-	//added by amy for AP roaming
+	/* Added by amy for AP roaming */
 	ieee->LinkDetectInfo.NumRecvDataInPeriod++;
 	ieee->LinkDetectInfo.NumRxOkInPeriod++;
 
 	hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 	if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) {
-		if (/*ieee->ieee802_1x &&*/
-		    ieee80211_is_eapol_frame(ieee, skb, hdrlen)) {
+		if (ieee80211_is_eapol_frame(ieee, skb, hdrlen)) {
 
 #ifdef CONFIG_IEEE80211_DEBUG
-			/* pass unencrypted EAPOL frames even if encryption is
-			 * configured */
+			/* Pass unencrypted EAPOL frames even if encryption is
+			 * configured
+			 */
 			struct eapol *eap = (struct eapol *)(skb->data +
 				24);
 			IEEE80211_DEBUG_EAP("RX: IEEE 802.1X EAPOL frame: %s\n",
@@ -1246,12 +1214,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 			hdr->addr2);
 		goto rx_dropped;
 	}
-/*
-	if (ieee80211_is_eapol_frame(ieee, skb, hdrlen)) {
-		printk(KERN_WARNING "RX: IEEE802.1X EPAOL frame!\n");
-	}
-*/
-//added by amy for reorder
+	/* Added by amy for reorder */
 	if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
 		&& !is_multicast_ether_addr(hdr->addr1)) {
 		TID = Frame_QoSTID(skb->data);
@@ -1260,19 +1223,17 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		if (TID != 0 && TID != 3)
 			ieee->bis_any_nonbepkts = true;
 	}
-//added by amy for reorder
-	/* skb: hdr + (possible reassembled) full plaintext payload */
+	/* Added by amy for reorder */
 	payload = skb->data + hdrlen;
-	//ethertype = (payload[6] << 8) | payload[7];
 	rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC);
 	if (rxb == NULL) {
 		IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s(): kmalloc rxb error\n", __func__);
 		goto rx_dropped;
 	}
-	/* to parse amsdu packets */
+	/* To parse amsdu packets */
 	/* qos data packets & reserved bit is 1 */
 	if (parse_subframe(skb, rx_stats, rxb, src, dst) == 0) {
-		/* only to free rxb, and not submit the packets to upper layer */
+		/* Only to free rxb, and not submit the packets to upper layer */
 		for (i = 0; i < rxb->nr_subframes; i++)
 			dev_kfree_skb(rxb->subframes[i]);
 		kfree(rxb);
@@ -1280,21 +1241,22 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 		goto rx_dropped;
 	}
 
-//added by amy for reorder
+	/* Added by amy for reorder */
 	if (!ieee->pHTInfo->bCurRxReorderEnable || pTS == NULL) {
-//added by amy for reorder
+	/* Added by amy for reorder */
 		for (i = 0; i < rxb->nr_subframes; i++) {
 			struct sk_buff *sub_skb = rxb->subframes[i];
 
 			if (sub_skb) {
-				/* convert hdr + possible LLC headers into Ethernet header */
+				/* Convert hdr + possible LLC headers into Ethernet header */
 				ethertype = (sub_skb->data[6] << 8) | sub_skb->data[7];
 				if (sub_skb->len >= 8 &&
 						((memcmp(sub_skb->data, rfc1042_header, SNAP_SIZE) == 0 &&
 						  ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
 						 memcmp(sub_skb->data, bridge_tunnel_header, SNAP_SIZE) == 0)) {
-					/* remove RFC1042 or Bridge-Tunnel encapsulation and
-					 * replace EtherType */
+					/* Remove RFC1042 or Bridge-Tunnel encapsulation and
+					 * replace EtherType
+					 */
 					skb_pull(sub_skb, SNAP_SIZE);
 					memcpy(skb_push(sub_skb, ETH_ALEN), src, ETH_ALEN);
 					memcpy(skb_push(sub_skb, ETH_ALEN), dst, ETH_ALEN);
@@ -1312,15 +1274,13 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 				if (is_multicast_ether_addr(dst))
 					stats->multicast++;
 
-				/* Indicat the packets to upper layer */
-				//printk("0skb_len(%d)\n", skb->len);
+				/* Indicate the packets to upper layer */
 				sub_skb->protocol = eth_type_trans(sub_skb, dev);
 				memset(sub_skb->cb, 0, sizeof(sub_skb->cb));
 				sub_skb->dev = dev;
-				sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */
-				//skb->ip_summed = CHECKSUM_UNNECESSARY; /* 802.11 crc not sufficient */
+				/* 802.11 crc not sufficient */
+				sub_skb->ip_summed = CHECKSUM_NONE;
 				ieee->last_rx_ps_time = jiffies;
-				//printk("1skb_len(%d)\n", skb->len);
 				netif_rx(sub_skb);
 			}
 		}
@@ -1349,7 +1309,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
 
 	/* Returning 0 indicates to caller that we have not handled the SKB--
 	 * so it is still allocated and can be used again by underlying
-	 * hardware as a DMA target */
+	 * hardware as a DMA target
+	 */
 	return 0;
 }
 EXPORT_SYMBOL(ieee80211_rx);
@@ -1448,8 +1409,6 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
 	int i;
 	struct ieee80211_qos_ac_parameter *ac_params;
 	u8 aci;
-	//u8 cw_min;
-	//u8 cw_max;
 
 	for (i = 0; i < QOS_QUEUE_NUM; i++) {
 		ac_params = &(param_elm->ac_params_record[i]);
@@ -1475,7 +1434,7 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
 }
 
 /*
- * we have a generic data element which it may contain QoS information or
+ * We have a generic data element which it may contain QoS information or
  * parameters element. check the information element length to decide
  * which type to read
  */
@@ -1542,7 +1501,6 @@ static const char *get_info_element_string(u16 id)
 		MFIE_STRING(MEASURE_REPORT);
 		MFIE_STRING(QUIET);
 		MFIE_STRING(IBSS_DFS);
-	       // MFIE_STRING(ERP_INFO);
 		MFIE_STRING(RSN);
 		MFIE_STRING(RATES_EX);
 		MFIE_STRING(GENERIC);
@@ -1569,11 +1527,10 @@ static inline void ieee80211_extract_country_ie(
 				Dot11d_UpdateCountryIe(ieee, addr2, info_element->len, info_element->data);
 		}
 
-		//
-		// 070305, rcnjko: I update country IE watch dog here because
-		// some AP (e.g. Cisco 1242) don't include country IE in their
-		// probe response frame.
-		//
+		/* 070305, rcnjko: I update country IE watch dog here because
+		 * some AP (e.g. Cisco 1242) don't include country IE in their
+		 * probe response frame.
+		 */
 		if (IS_EQUAL_CIE_SRC(ieee, addr2))
 			UPDATE_CIE_WATCHDOG(ieee);
 	}
@@ -1592,7 +1549,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 	u16	tmp_htinfo_len = 0;
 	u16 ht_realtek_agg_len = 0;
 	u8  ht_realtek_agg_buf[MAX_IE_LEN];
-//	u16 broadcom_len = 0;
 #ifdef CONFIG_IEEE80211_DEBUG
 	char rates_str[64];
 	char *p;
@@ -1608,7 +1564,8 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 					     length, info_element->id);
 			/* We stop processing but don't return an error here
 			 * because some misbehaviour APs break this rule. ie.
-			 * Orinoco AP1000. */
+			 * Orinoco AP1000.
+			 */
 			break;
 		}
 
@@ -1723,19 +1680,16 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 
 			offset = (info_element->data[2] >> 1)*2;
 
-			//printk("offset1:%x aid:%x\n",offset, ieee->assoc_id);
-
 			if (ieee->assoc_id < 8*offset ||
 				ieee->assoc_id > 8*(offset + info_element->len - 3))
 
 				break;
 
-			offset = (ieee->assoc_id / 8) - offset;// + ((aid % 8)? 0 : 1) ;
+			offset = (ieee->assoc_id / 8) - offset;
 
 			if (info_element->data[3+offset] & (1<<(ieee->assoc_id%8)))
 				network->dtim_data |= IEEE80211_DTIM_UCAST;
 
-			//IEEE80211_DEBUG_MGMT("MFIE_TYPE_TIM: partially ignored\n");
 			break;
 
 		case MFIE_TYPE_ERP:
@@ -1784,7 +1738,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 			}
 #endif
 
-			//for HTcap and HTinfo parameters
+			/* For HTcap and HTinfo parameters */
 			if (tmp_htcap_len == 0) {
 				if (info_element->len >= 4 &&
 				   info_element->data[0] == 0x00 &&
@@ -1850,7 +1804,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 
 			}
 
-			//if (tmp_htcap_len !=0  ||  tmp_htinfo_len != 0)
 			{
 				if ((info_element->len >= 3 &&
 					 info_element->data[0] == 0x00 &&
@@ -1876,7 +1829,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 				network->ralink_cap_exist = true;
 			} else
 				network->ralink_cap_exist = false;
-			//added by amy for atheros AP
+			/* Added by amy for atheros AP */
 			if ((info_element->len >= 3 &&
 				info_element->data[0] == 0x00 &&
 				info_element->data[1] == 0x03 &&
@@ -1897,7 +1850,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 				network->cisco_cap_exist = true;
 			} else
 				network->cisco_cap_exist = false;
-			//added by amy for LEAP of cisco
+			/* Added by amy for LEAP of cisco */
 			if (info_element->len > 4 &&
 				info_element->data[0] == 0x00 &&
 				info_element->data[1] == 0x40 &&
@@ -1909,9 +1862,9 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 						network->bCcxRmEnable = true;
 					else
 						network->bCcxRmEnable = false;
-					//
-					// CCXv4 Table 59-1 MBSSID Masks.
-					//
+					/*
+					 * CCXv4 Table 59-1 MBSSID Masks.
+					 */
 					network->MBssidMask = network->CcxRmState[1] & 0x07;
 					if (network->MBssidMask != 0) {
 						network->bMBssidValid = true;
@@ -1949,7 +1902,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 			       network->rsn_ie_len);
 			break;
 
-			//HT related element.
+			/* HT related element. */
 		case MFIE_TYPE_HT_CAP:
 			IEEE80211_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n",
 					     info_element->len);
@@ -1960,9 +1913,10 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 					sizeof(network->bssht.bdHTCapBuf):tmp_htcap_len;
 				memcpy(network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen);
 
-				//If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT()
-				// windows driver will update WMM parameters each beacon received once connected
-				// Linux driver is a bit different.
+				/* If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT()
+				 * windows driver will update WMM parameters each beacon received once connected
+				 * Linux driver is a bit different.
+				 */
 				network->bssht.bdSupportHT = true;
 			} else
 				network->bssht.bdSupportHT = false;
@@ -1987,9 +1941,10 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 			if (info_element->len > IE_CISCO_FLAG_POSITION) {
 				network->bWithAironetIE = true;
 
-				// CCX 1 spec v1.13, A01.1 CKIP Negotiation (page23):
-				// "A Cisco access point advertises support for CKIP in beacon and probe response packets,
-				//  by adding an Aironet element and setting one or both of the CKIP negotiation bits."
+				/* CCX 1 spec v1.13, A01.1 CKIP Negotiation (page23):
+				 * "A Cisco access point advertises support for CKIP in beacon and probe response packets,
+				 *  by adding an Aironet element and setting one or both of the CKIP negotiation bits."
+				 */
 				if ((info_element->data[IE_CISCO_FLAG_POSITION] & SUPPORT_CKIP_MIC)	||
 					(info_element->data[IE_CISCO_FLAG_POSITION] & SUPPORT_CKIP_PK)) {
 					network->bCkipSupported = true;
@@ -2009,10 +1964,10 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
 		case MFIE_TYPE_COUNTRY:
 			IEEE80211_DEBUG_SCAN("MFIE_TYPE_COUNTRY: %d bytes\n",
 					     info_element->len);
-			//printk("=====>Receive <%s> Country IE\n",network->ssid);
-			ieee80211_extract_country_ie(ieee, info_element, network, network->bssid);//addr2 is same as addr3 when from an AP
+			/* addr2 is same as addr3 when from an AP */
+			ieee80211_extract_country_ie(ieee, info_element, network, network->bssid);
 			break;
-/* TODO */
+		/* TODO */
 		default:
 			IEEE80211_DEBUG_MGMT
 			    ("Unsupported info element: %s (%d)\n",
@@ -2042,7 +1997,7 @@ static inline u8 ieee80211_SignalStrengthTranslate(
 {
 	u8 RetSS;
 
-	// Step 1. Scale mapping.
+	/* Step 1. Scale mapping. */
 	if (CurrSS >= 71 && CurrSS <= 100)
 		RetSS = 90 + ((CurrSS - 70) / 3);
 	else if (CurrSS >= 41 && CurrSS <= 70)
@@ -2063,11 +2018,6 @@ static inline u8 ieee80211_SignalStrengthTranslate(
 		RetSS = 9;
 	else
 		RetSS = CurrSS;
-	//RT_TRACE(COMP_DBG, DBG_LOUD, ("##### After Mapping:  LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS));
-
-	// Step 2. Smoothing.
-
-	//RT_TRACE(COMP_DBG, DBG_LOUD, ("$$$$$ After Smoothing:  LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS));
 
 	return RetSS;
 }
@@ -2075,9 +2025,9 @@ static inline u8 ieee80211_SignalStrengthTranslate(
 /* 0-100 index */
 static long ieee80211_translate_todbm(u8 signal_strength_index)
 {
-	long	signal_power; // in dBm.
+	long	signal_power; /* in dBm. */
 
-	// Translate to dBm (x=0.5y-95).
+	/* Translate to dBm (x=0.5y-95). */
 	signal_power = (long)((signal_strength_index + 1) >> 1);
 	signal_power -= 95;
 
@@ -2091,8 +2041,6 @@ static inline int ieee80211_network_init(
 	struct ieee80211_rx_stats *stats)
 {
 #ifdef CONFIG_IEEE80211_DEBUG
-	//char rates_str[64];
-	//char *p;
 #endif
 
 	network->qos_data.active = 0;
@@ -2127,11 +2075,10 @@ static inline int ieee80211_network_init(
 #endif
 	network->CountryIeLen = 0;
 	memset(network->CountryIeBuf, 0, MAX_IE_LEN);
-//Initialize HT parameters
-	//ieee80211_ht_initialize(&network->bssht);
+	/* Initialize HT parameters */
 	HTInitializeBssDesc(&network->bssht);
 	if (stats->freq == IEEE80211_52GHZ_BAND) {
-		/* for A band (No DS info) */
+		/* For A band (No DS info) */
 		network->channel = stats->received_channel;
 	} else
 		network->flags |= NETWORK_HAS_CCK;
@@ -2172,7 +2119,6 @@ static inline int ieee80211_network_init(
 		network->flags |= NETWORK_EMPTY_ESSID;
 
 	stats->signal = 30 + (stats->SignalStrength * 70) / 100;
-	//stats->signal = ieee80211_SignalStrengthTranslate(stats->signal);
 	stats->noise = ieee80211_translate_todbm((u8)(100 - stats->signal)) - 25;
 
 	memcpy(&network->stats, stats, sizeof(network->stats));
@@ -2186,12 +2132,12 @@ static inline int is_same_network(struct ieee80211_network *src,
 	/* A network is only a duplicate if the channel, BSSID, ESSID
 	 * and the capability field (in particular IBSS and BSS) all match.
 	 * We treat all <hidden> with the same BSSID and channel
-	 * as one network */
-	return //((src->ssid_len == dst->ssid_len) &&
+	 * as one network
+	 */
+	return
 		(((src->ssid_len == dst->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) &&
 		(src->channel == dst->channel) &&
 		!memcmp(src->bssid, dst->bssid, ETH_ALEN) &&
-		//!memcmp(src->ssid, dst->ssid, src->ssid_len) &&
 		(!memcmp(src->ssid, dst->ssid, src->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) &&
 		((src->capability & WLAN_CAPABILITY_IBSS) ==
 		(dst->capability & WLAN_CAPABILITY_IBSS)) &&
@@ -2253,9 +2199,7 @@ static inline void update_network(struct ieee80211_network *dst,
 
 	dst->last_scanned = jiffies;
 	/* qos related parameters */
-	//qos_active = src->qos_data.active;
 	qos_active = dst->qos_data.active;
-	//old_param = dst->qos_data.old_param_count;
 	old_param = dst->qos_data.param_count;
 	if (dst->flags & NETWORK_HAS_QOS_MASK)
 		memcpy(&dst->qos_data, &src->qos_data,
@@ -2279,14 +2223,14 @@ static inline void update_network(struct ieee80211_network *dst,
 	dst->qos_data.old_param_count = old_param;
 
 	/* dst->last_associate is not overwritten */
-	dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame.
+	/* Sure to exist in beacon or probe response frame. */
+	dst->wmm_info = src->wmm_info;
 	if (src->wmm_param[0].aci_aifsn || \
 	   src->wmm_param[1].aci_aifsn || \
 	   src->wmm_param[2].aci_aifsn || \
 	   src->wmm_param[3].aci_aifsn) {
 	  memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
 	}
-	//dst->QoS_Enable = src->QoS_Enable;
 #ifdef THOMAS_TURBO
 	dst->Turbo_Enable = src->Turbo_Enable;
 #endif
@@ -2294,7 +2238,7 @@ static inline void update_network(struct ieee80211_network *dst,
 	dst->CountryIeLen = src->CountryIeLen;
 	memcpy(dst->CountryIeBuf, src->CountryIeBuf, src->CountryIeLen);
 
-	//added by amy for LEAP
+	/* Added by amy for LEAP */
 	dst->bWithAironetIE = src->bWithAironetIE;
 	dst->bCkipSupported = src->bCkipSupported;
 	memcpy(dst->CcxRmState, src->CcxRmState, 2);
@@ -2325,7 +2269,6 @@ static inline void ieee80211_process_probe_response(
 #endif
 	unsigned long flags;
 	short renew;
-	//u8 wmm_info;
 
 	memset(&network, 0, sizeof(struct ieee80211_network));
 	IEEE80211_DEBUG_SCAN(
@@ -2360,43 +2303,44 @@ static inline void ieee80211_process_probe_response(
 		return;
 	}
 
-	// For Asus EeePc request,
-	// (1) if wireless adapter receive get any 802.11d country code in AP beacon,
-	//	   wireless adapter should follow the country code.
-	// (2)  If there is no any country code in beacon,
-	//       then wireless adapter should do active scan from ch1~11 and
-	//       passive scan from ch12~14
+	/* For Asus EeePc request,
+	 * (1) if wireless adapter receive get any 802.11d country code in AP beacon,
+	 *	   wireless adapter should follow the country code.
+	 * (2)  If there is no any country code in beacon,
+	 *       then wireless adapter should do active scan from ch1~11 and
+	 *       passive scan from ch12~14
+	 */
 
 	if (!IsLegalChannel(ieee, network.channel))
 		return;
 	if (ieee->bGlobalDomain) {
 		if (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == IEEE80211_STYPE_PROBE_RESP) {
-			// Case 1: Country code
+			/* Case 1: Country code */
 			if (IS_COUNTRY_IE_VALID(ieee)) {
 				if (!IsLegalChannel(ieee, network.channel)) {
 					printk("GetScanInfo(): For Country code, filter probe response at channel(%d).\n", network.channel);
 					return;
 				}
 			}
-			// Case 2: No any country code.
+			/* Case 2: No any country code. */
 			else {
-				// Filter over channel ch12~14
+				/* Filter over channel ch12~14 */
 				if (network.channel > 11) {
 					printk("GetScanInfo(): For Global Domain, filter probe response at channel(%d).\n", network.channel);
 					return;
 				}
 			}
 		} else {
-			// Case 1: Country code
+			/* Case 1: Country code */
 			if (IS_COUNTRY_IE_VALID(ieee)) {
 				if (!IsLegalChannel(ieee, network.channel)) {
 					printk("GetScanInfo(): For Country code, filter beacon at channel(%d).\n", network.channel);
 					return;
 				}
 			}
-			// Case 2: No any country code.
+			/* Case 2: No any country code. */
 			else {
-				// Filter over channel ch12~14
+				/* Filter over channel ch12~14 */
 				if (network.channel > 14) {
 					printk("GetScanInfo(): For Global Domain, filter beacon at channel(%d).\n", network.channel);
 					return;
@@ -2410,10 +2354,12 @@ static inline void ieee80211_process_probe_response(
 	 *
 	 * NOTE:  This search is definitely not optimized.  Once its doing
 	 *        the "right thing" we'll optimize it for efficiency if
-	 *        necessary */
+	 *        necessary
+	 */
 
 	/* Search for this entry in the list and update it if it is
-	 * already there. */
+	 * already there.
+	 */
 
 	spin_lock_irqsave(&ieee->lock, flags);
 
@@ -2429,7 +2375,8 @@ static inline void ieee80211_process_probe_response(
 		if (is_beacon(beacon->header.frame_ctl)) {
 			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);
 	}
 
@@ -2442,7 +2389,8 @@ static inline void ieee80211_process_probe_response(
 	}
 
 	/* If we didn't find a match, then get a new network slot to initialize
-	 * with this beacon's information */
+	 * with this beacon's information
+	 */
 	if (&target->list == &ieee->network_list) {
 		if (list_empty(&ieee->network_free_list)) {
 			/* If there are no more slots, expire the oldest */
@@ -2483,21 +2431,19 @@ static inline void ieee80211_process_probe_response(
 				     IEEE80211_STYPE_PROBE_RESP ?
 				     "PROBE RESPONSE" : "BEACON");
 
-		/* we have an entry and we are going to update it. But this entry may
+		/* We have an entry and we are going to update it. But this entry may
 		 * be already expired. In this case we do the same as we found a new
 		 * net and call the new_net handler
 		 */
 		renew = !time_after(target->last_scanned + ieee->scan_age, jiffies);
-		//YJ,add,080819,for hidden ap
+		/* YJ,add,080819,for hidden ap */
 		if (is_beacon(beacon->header.frame_ctl) == 0)
 			network.flags = (~NETWORK_EMPTY_ESSID & network.flags)|(NETWORK_EMPTY_ESSID & target->flags);
-		//if (strncmp(network.ssid, "linksys-c",9) == 0)
-		//	printk("====>2 network.ssid=%s FLAG=%d target.ssid=%s FLAG=%d\n", network.ssid, network.flags, target->ssid, target->flags);
 		if (((network.flags & NETWORK_EMPTY_ESSID) == NETWORK_EMPTY_ESSID) \
 		    && (((network.ssid_len > 0) && (strncmp(target->ssid, network.ssid, network.ssid_len)))\
 		    || ((ieee->current_network.ssid_len == network.ssid_len) && (strncmp(ieee->current_network.ssid, network.ssid, network.ssid_len) == 0) && (ieee->state == IEEE80211_NOLINK))))
 			renew = 1;
-		//YJ,add,080819,for hidden ap,end
+		/* YJ,add,080819,for hidden ap,end */
 
 		update_network(target, &network);
 		if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE))
-- 
1.9.1



More information about the firefly mailing list