[OPW,kernel,03/11] staging: rtl8187se: Clean-up comment line style in ieee80211/ieee80211_softmac.c
diff mbox

Message ID cfb2acc7f54c8de40e5918facb90e147bc4398b6.1394195021.git.anarey@gmail.com
State New, archived
Headers show

Commit Message

Ana Rey March 7, 2014, 12:33 p.m. UTC
Converted style of comments from C99-style to C89 as the CodingStyle
recommends.

Signed-off-by: Ana Rey <anarey@gmail.com>
---
 .../rtl8187se/ieee80211/ieee80211_softmac.c        | 275 ++++++++++-----------
 1 file changed, 137 insertions(+), 138 deletions(-)

Comments

Sarah Sharp March 8, 2014, 8:55 p.m. UTC | #1
On Fri, Mar 07, 2014 at 01:33:03PM +0100, Ana Rey wrote:
> Converted style of comments from C99-style to C89 as the CodingStyle
> recommends.

Can you get rid of the "by amy" lines, the "by thomas" lines, and any
comments with just a name and date in a patch before this patch?  It
doesn't make sense to clean them up when they should just be removed.

Couple more comments below.

> Signed-off-by: Ana Rey <anarey@gmail.com>
> ---
>  .../rtl8187se/ieee80211/ieee80211_softmac.c        | 275 ++++++++++-----------
>  1 file changed, 137 insertions(+), 138 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> index 15017ff..c027b73 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> @@ -24,12 +24,12 @@
>  
>  #include "dot11d.h"
>  u8 rsn_authen_cipher_suite[16][4] = {
> -	{0x00, 0x0F, 0xAC, 0x00}, //Use group key, //Reserved
> -	{0x00, 0x0F, 0xAC, 0x01}, //WEP-40         //RSNA default
> -	{0x00, 0x0F, 0xAC, 0x02}, //TKIP           //NONE		//{used just as default}
> -	{0x00, 0x0F, 0xAC, 0x03}, //WRAP-historical
> -	{0x00, 0x0F, 0xAC, 0x04}, //CCMP
> -	{0x00, 0x0F, 0xAC, 0x05}, //WEP-104
> +	{0x00, 0x0F, 0xAC, 0x00}, /* Use group key, */ /* Reserved */
> +	{0x00, 0x0F, 0xAC, 0x01}, /* WEP-40 */ /* RSNA default */
> +	{0x00, 0x0F, 0xAC, 0x02}, /* TKIP */ /* NONE */ /* {used just as default} */
> +	{0x00, 0x0F, 0xAC, 0x03}, /* WRAP-historical */
> +	{0x00, 0x0F, 0xAC, 0x04}, /* CCMP */
> +	{0x00, 0x0F, 0xAC, 0x05}, /* WEP-104 */
>  };
>  
>  short ieee80211_is_54g(const struct ieee80211_network *net)
> @@ -61,8 +61,7 @@ static unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee)
>  }
>  
>  /* place the MFIE rate, tag to the memory (double) poised.
> - * Then it updates the pointer so that
> - * it points after the new MFIE tag added.
> + * Then it updates the pointer so that it points after the new MFIE tag added.
>   */
>  static void ieee80211_MFIE_Brate(struct ieee80211_device *ieee, u8 **tag_p)
>  {
> @@ -107,12 +106,12 @@ static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p)
>  {
>  	u8 *tag = *tag_p;
>  
> -	*tag++ = MFIE_TYPE_GENERIC; //0
> +	*tag++ = MFIE_TYPE_GENERIC; /* 0 */
>  	*tag++ = 7;
>  	*tag++ = 0x00;
>  	*tag++ = 0x50;
>  	*tag++ = 0xf2;
> -	*tag++ = 0x02;//5
> +	*tag++ = 0x02; /* 5 */
>  	*tag++ = 0x00;
>  	*tag++ = 0x01;
>  #ifdef SUPPORT_USPD
> @@ -259,7 +258,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
>  		ieee->softmac_hard_start_xmit(skb, ieee->dev);
>  	}
>  }
> -//by amy for power save
> +/* by amy for power save */
>  inline struct sk_buff *
>  ieee80211_disassociate_skb(struct ieee80211_network *beacon,
>  			   struct ieee80211_device *ieee, u8 asRsn)
> @@ -292,7 +291,7 @@ void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn)
>  		softmac_mgmt_xmit(skb, ieee);
>  }
>  
> -//by amy for power save
> +/* by amy for power save */
>  inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee)
>  {
>  	unsigned int len, rate_len;
> @@ -312,7 +311,7 @@ inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee)
>  	req = (struct ieee80211_probe_request *)
>  		skb_put(skb, sizeof(struct ieee80211_probe_request));
>  	req->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
> -	req->header.duration_id = 0; //FIXME: is this OK ?
> +	req->header.duration_id = 0; /* FIXME: is this OK ? */
>  
>  	memset(req->header.addr1, 0xff, ETH_ALEN);
>  	memcpy(req->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
> @@ -341,7 +340,7 @@ void ext_ieee80211_send_beacon_wq(struct ieee80211_device *ieee)
>  	if (skb) {
>  		softmac_mgmt_xmit(skb, ieee);
>  		ieee->softmac_stats.tx_beacons++;
> -		dev_kfree_skb_any(skb);//edit by thomas
> +		dev_kfree_skb_any(skb); /* edit by thomas */
>  	}
>  
>  	ieee->beacon_timer.expires = jiffies +
> @@ -360,7 +359,7 @@ static void ieee80211_send_beacon(struct ieee80211_device *ieee)
>  	if (skb) {
>  		softmac_mgmt_xmit(skb, ieee);
>  		ieee->softmac_stats.tx_beacons++;
> -		dev_kfree_skb_any(skb);//edit by thomas
> +		dev_kfree_skb_any(skb); /* edit by thomas */
>  	}
>  
>  	ieee->beacon_timer.expires = jiffies +
> @@ -469,24 +468,24 @@ void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
>  	ch = ieee->current_network.channel;
>  	while (1)
>  	{
> -                /* this function can be called in two situations
> -                 * 1- We have switched to ad-hoc mode and we are
> -                 *    performing a complete syncro scan before conclude
> -                 *    there are no interesting cell and to create a
> -                 *    new one. In this case the link state is
> -                 *    IEEE80211_NOLINK until we found an interesting cell.
> -                 *    If so the ieee8021_new_net, called by the RX path
> -                 *    will set the state to IEEE80211_LINKED, so we stop
> -                 *    scanning
> -                 * 2- We are linked and the root uses run iwlist scan.
> -                 *    So we switch to IEEE80211_LINKED_SCANNING to remember
> -                 *    that we are still logically linked (not interested in
> -                 *    new network events, despite for updating the net list,
> -                 *    but we are temporarily 'unlinked' as the driver shall
> -                 *    not filter RX frames and the channel is changing.
> -                 * So the only situation in witch are interested is to check
> -                 * if the state become LINKED because of the #1 situation
> -                 */
> +		/* this function can be called in two situations
> +		 * 1- We have switched to ad-hoc mode and we are
> +		 *    performing a complete syncro scan before conclude
> +		 *    there are no interesting cell and to create a
> +		 *    new one. In this case the link state is
> +		 *    IEEE80211_NOLINK until we found an interesting cell.
> +		 *    If so the ieee8021_new_net, called by the RX path
> +		 *    will set the state to IEEE80211_LINKED, so we stop
> +		 *    scanning
> +		 * 2- We are linked and the root uses run iwlist scan.
> +		 *    So we switch to IEEE80211_LINKED_SCANNING to remember
> +		 *    that we are still logically linked (not interested in
> +		 *    new network events, despite for updating the net list,
> +		 *    but we are temporarily 'unlinked' as the driver shall
> +		 *    not filter RX frames and the channel is changing.
> +		 * So the only situation in witch are interested is to check
> +		 * if the state become LINKED because of the #1 situation
> +		 */
>  		if (ieee->state == IEEE80211_LINKED)
>  		{
>  			goto out;
> @@ -670,7 +669,7 @@ ieee80211_authentication_req(struct ieee80211_network *beacon,
>  	auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
>  	if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
>  
> -	auth->header.duration_id = 0x013a; //FIXME
> +	auth->header.duration_id = 0x013a; /* FIXME */
>  
>  	memcpy(auth->header.addr1, beacon->bssid, ETH_ALEN);
>  	memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
> @@ -716,7 +715,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
>  
>  	beacon_size = sizeof(struct ieee80211_probe_response)+
>  		ssid_len
> -		+3 //channel
> +		+3 /* channel */
>  		+rate_len
>  		+rate_ex_len
>  		+atim_len
> @@ -734,7 +733,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
>  	memcpy(beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
>  	memcpy(beacon_buf->header.addr3, ieee->current_network.bssid, ETH_ALEN);
>  
> -	beacon_buf->header.duration_id = 0; //FIXME
> +	beacon_buf->header.duration_id = 0; /* FIXME */
>  	beacon_buf->beacon_interval =
>  		cpu_to_le16(ieee->current_network.beacon_interval);
>  	beacon_buf->capability =
> @@ -795,7 +794,9 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
>  	if (wpa_ie_len)
>  	{
>  		if (ieee->iw_mode == IW_MODE_ADHOC)
> -		{//as Windows will set pairwise key same as the group key which is not allowed in Linux, so set this for IOT issue. WB 2008.07.07
> +		{ /* as Windows will set pairwise key same as the group key
> +		   * which is not allowed in Linux, so set this for IOT issue.
> +		   * WB 2008.07.07 */

This comment style isn't correct.  Please do:

> +		{
> +			/* as Windows will set pairwise key same as the group key
> +			 * which is not allowed in Linux, so set this for IOT issue.
> +			 * WB 2008.07.07
> + 			 */

>  			memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4);
>  		}
>  
> @@ -914,7 +915,7 @@ static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
>  
>  	if (buf) {
>  		softmac_mgmt_xmit(buf, ieee);
> -		dev_kfree_skb_any(buf);//edit by thomas
> +		dev_kfree_skb_any(buf); /* edit by thomas */
>  	}
>  }
>  
> @@ -924,7 +925,7 @@ static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *des
>  
>  	if (buf) {
>  		softmac_mgmt_xmit(buf, ieee);
> -		dev_kfree_skb_any(buf);//edit by thomas
> +		dev_kfree_skb_any(buf); /* edit by thomas */
>  	}
>  }
>  
> @@ -934,7 +935,7 @@ static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
>  
>  	if (buf) {
>  		softmac_mgmt_xmit(buf, ieee);
> -		dev_kfree_skb_any(buf);//edit by thomas
> +		dev_kfree_skb_any(buf); /* edit by thomas */
>  	}
>  }
>  
> @@ -948,7 +949,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  	u8 *tag;
>  	unsigned int wpa_len = beacon->wpa_ie_len;
>  #if 1
> -	// for testing purpose
> +	/* for testing purpose */
>  	unsigned int rsn_len = beacon->rsn_ie_len;
>  #endif
>  	unsigned int rate_len = ieee80211_MFIE_rate_len(ieee);
> @@ -959,9 +960,10 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  
>  	int len = 0;
>  
> -	//[0] Notify type of encryption: WPA/WPA2
> -	//[1] pair wise type
> -	//[2] authen type
> +	/* [0] Notify type of encryption: WPA/WPA2
> +	 * [1] pair wise type
> +	 * [2] authen type
> +	 */
>  	if (ieee->wpax_type_set) {
>  		if (IEEE_PROTO_WPA == encry_proto) {
>  			rsn_len = 0;
> @@ -970,8 +972,8 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  		}
>  	}
>  	len = sizeof(struct ieee80211_assoc_request_frame)+
> -		+ beacon->ssid_len//essid tagged val
> -		+ rate_len//rates tagged val
> +		+ beacon->ssid_len /* essid tagged val */
> +		+ rate_len /* rates tagged val */
>  		+ wpa_len
>  		+ rsn_len
>  		+ wmm_info_len
> @@ -987,11 +989,12 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  
>  
>  	hdr->header.frame_control = IEEE80211_STYPE_ASSOC_REQ;
> -	hdr->header.duration_id = 37; //FIXME
> +	hdr->header.duration_id = 37; /* FIXME */
>  	memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN);
>  	memcpy(hdr->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
>  	memcpy(hdr->header.addr3, beacon->bssid, ETH_ALEN);
> -	memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN);//for HW security, John
> +	/* for HW security, John */
> +	memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN);
>  
>  	hdr->capability = cpu_to_le16(WLAN_CAPABILITY_BSS);
>  	if (beacon->capability & WLAN_CAPABILITY_PRIVACY)
> @@ -1002,7 +1005,7 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  	if (ieee->short_slot)
>  		hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
>  
> -	hdr->listen_interval = 0xa; //FIXME
> +	hdr->listen_interval = 0xa; /* FIXME */
>  
>  	hdr->info_element.id = MFIE_TYPE_SSID;
>  
> @@ -1015,8 +1018,9 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  	ieee80211_MFIE_Brate(ieee, &tag);
>  	ieee80211_MFIE_Grate(ieee, &tag);
>  
> -	//add rsn==0 condition for ap's mix security mode(wpa+wpa2), john2007.8.9
> -	//choose AES encryption as default algorithm while using mixed mode
> +	/* add rsn==0 condition for ap's mix security mode(wpa+wpa2),
> +	 * john2007.8.9 */

This is also not correct multi-line comment style, please run your patch
through checkpatch.pl before sending it off.  Please move the */ onto
its own line.

> +	/* choose AES encryption as default algorithm while using mixed mode */
>  
>  	tag = skb_put(skb, ieee->wpa_ie_len);
>  	memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
> @@ -1039,9 +1043,9 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee)
>  
>  	ieee->associate_seq++;
>  
> -	/* don't scan, and avoid to have the RX path possibly
> -	 * try again to associate. Even do not react to AUTH or
> -	 * ASSOC response. Just wait for the retry wq to be scheduled.
> +	/* don't scan, and avoid to have the RX path possibly try again to
> +	 * associate. Even do not react to AUTH or ASSOC response. Just wait
> +	 * for the retry wq to be scheduled.

You're re-flowing the paragraph text when the comment style was just
fine.   Please leave this alone.

>  	 * Here we will check if there are good nets to associate
>  	 * with, so we retry or just get back to NO_LINK and scanning
>  	 */
> @@ -1083,16 +1087,18 @@ static void ieee80211_associate_step1(struct ieee80211_device *ieee)
>  		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING;
>  		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
>  		softmac_mgmt_xmit(skb, ieee);
> -		//BUGON when you try to add_timer twice, using mod_timer may be better, john0709
> +		/* BUGON when you try to add_timer twice, using mod_timer may
> +		 * be better, john0709 */

Again, put the */ on its own line.

>  		if (!timer_pending(&ieee->associate_timer)) {
>  			ieee->associate_timer.expires = jiffies + (HZ / 2);
>  			add_timer(&ieee->associate_timer);
>  		}
> -		//If call dev_kfree_skb_any,a warning will ocur....
> -		//KERNEL: assertion (!atomic_read(&skb->users)) failed at net/core/dev.c (1708)
> -		//So ... 1204 by lawrence.
> -		//printk("\nIn %s,line %d call kfree skb.",__func__,__LINE__);
> -		//dev_kfree_skb_any(skb);//edit by thomas
> +		/* If call dev_kfree_skb_any,a warning will ocur....
> +		 * KERNEL: assertion (!atomic_read(&skb->users)) failed at net/core/dev.c (1708)
> +		 * So ... 1204 by lawrence.
> +		 * printk("\nIn %s,line %d call kfree skb.",__func__,__LINE__);
> +		 * dev_kfree_skb_any(skb);//edit by thomas
> +		 */
>  	}
>  }
>  
> @@ -1125,7 +1131,7 @@ static void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *chal
>  			ieee->associate_timer.expires = jiffies + (HZ / 2);
>  			add_timer(&ieee->associate_timer);
>  		}
> -		dev_kfree_skb_any(skb);//edit by thomas
> +		dev_kfree_skb_any(skb); /* edit by thomas */
>  	}
>  	kfree(challenge);
>  }
> @@ -1526,7 +1532,7 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  		ieee->iw_mode != IW_MODE_INFRA ||
>  		ieee->state != IEEE80211_LINKED)){
>  
> -		//#warning CHECK_LOCK_HERE
> +		/* #warning CHECK_LOCK_HERE */
>  		spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
>  
>  		ieee80211_sta_wakeup(ieee, 1);
> @@ -1556,7 +1562,7 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  			spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
>  		}
>  	} else if (sleep == 2) {
> -//#warning CHECK_LOCK_HERE
> +		/* #warning CHECK_LOCK_HERE */
>  		spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
>  
>  		ieee80211_sta_wakeup(ieee, 1);
> @@ -1657,7 +1663,7 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  					ieee->assoc_id = aid;
>  					ieee->softmac_stats.rx_ass_ok++;
>  
> -					if (1 == rx_stats->nic_type) //card type is 8187
> +					if (1 == rx_stats->nic_type) /* card type is 8187 */
>  					{
>  						goto associate_complete;
>  					}
> @@ -1679,25 +1685,25 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  							    info_element->data[2] == 0xf2 &&
>  							    info_element->data[3] == 0x02 &&
>  							    info_element->data[4] == 0x01) {
> -							    // Not care about version at present.
> -							    //WMM Parameter Element
> +							    /* Not care about version at present. */
> +							    /* WMM Parameter Element */

I would turn that into a multi-line comment instead of two one-line
comments.

>  							    memcpy(ieee->current_network.wmm_param, (u8*)(info_element->data\
>  										    + 8), (info_element->len - 8));
>  
>  						            if (((ieee->current_network.wmm_info^info_element->data[6])& \
>  										    0x0f) || (!ieee->init_wmmparam_flag)) {
> -							      // refresh parameter element for current network
> -							      // update the register parameter for hardware
> +							      /* refresh parameter element for current network */
> +							      /* update the register parameter for hardware */

Same here.

>  							      ieee->init_wmmparam_flag = 1;
>  							      queue_work(ieee->wq, &ieee->wmm_param_update_wq);
>  
>  						            }
> -						            //update info_element for current network
> +						            /* update info_element for current network */
>  						            ieee->current_network.wmm_info  = info_element->data[6];
>  							}
>  							break;
>  						  default:
> -							//nothing to do at present!!!
> +							/* nothing to do at present!!! */
>  							break;
>  						}
>  
> @@ -1706,10 +1712,10 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  						info_element = (struct ieee80211_info_element *)
>  							&info_element->data[info_element->len];
>  					}
> -					if (!ieee->init_wmmparam_flag) //legacy AP, reset the AC_xx_param register
> +					if (!ieee->init_wmmparam_flag) /* legacy AP, reset the AC_xx_param register */
>  					{
>  						queue_work(ieee->wq, &ieee->wmm_param_update_wq);
> -						ieee->init_wmmparam_flag = 1;//indicate AC_xx_param upated since last associate
> +						ieee->init_wmmparam_flag = 1; /* indicate AC_xx_param upated since last associate */
>  					}
>  associate_complete:
>  					ieee80211_associate_complete(ieee);
> @@ -1789,22 +1795,18 @@ associate_complete:
>  }
>  
>  /* following are for a simpler TX queue management.
> - * Instead of using netif_[stop/wake]_queue the driver
> - * will uses these two function (plus a reset one), that
> - * will internally uses the kernel netif_* and takes
> - * care of the ieee802.11 fragmentation.
> - * So the driver receives a fragment per time and might
> - * call the stop function when it want without take care
> - * to have enough room to TX an entire packet.
> - * This might be useful if each fragment need it's own
> - * descriptor, thus just keep a total free memory > than
> - * the max fragmentation threshold is not enough.. If the
> - * ieee802.11 stack passed a TXB struct then you needed
> - * to keep N free descriptors where
> - * N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
> - * In this way you need just one and the 802.11 stack
> - * will take care of buffering fragments and pass them to
> - * to the driver later, when it wakes the queue.
> + * Instead of using netif_[stop/wake]_queue the driver will uses these two
> + * function (plus a reset one), that will internally uses the kernel netif_*
> + * and takes care of the ieee802.11 fragmentation.
> + * So the driver receives a fragment per time and might call the stop function
> + * when it want without take care to have enough room to TX an entire packet.
> + * This might be useful if each fragment need it's own descriptor, thus just
> + * keep a total free memory > than the max fragmentation threshold is not
> + * enough.. If the ieee802.11 stack passed a TXB struct then you needed to
> + * keep N free descriptors where N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
> + * In this way you need just one and the 802.11 stack will take care of
> + * buffering fragments and pass them to the driver later, when it wakes the
> + * queue.
>   */

Does this make this chunk of comment any easier to read?  I don't think
so.  Leave it alone.

>  
>  void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
> @@ -1901,7 +1903,7 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
>  
>  			ieee->softmac_data_hard_start_xmit(skb, ieee->dev,
>  							   ieee->basic_rate);
> -			dev_kfree_skb_any(skb);//edit by thomas
> +			dev_kfree_skb_any(skb); /* edit by thomas */
>  		}
>  	}
>  	if (!ieee->queue_stop && ieee->tx_pending.txb)
> @@ -1974,12 +1976,11 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
>  	struct delayed_work *dwork = to_delayed_work(work);
>  	struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq);
>  
> -	/* iwconfig mode ad-hoc will schedule this and return
> -	 * on the other hand this will block further iwconfig SET
> -	 * operations because of the wx_sem hold.
> -	 * Anyway some most set operations set a flag to speed-up
> -	 * (abort) this wq (when syncro scanning) before sleeping
> -	 * on the semaphore
> +	/* iwconfig mode ad-hoc will schedule this and return on the other hand
> +	 * this will block further iwconfig SET operations because of the wx_sem
> +	 * hold.
> +	 * Anyway some most set operations set a flag to speed-up (abort) this
> +	 * wq (when syncro scanning) before sleeping on the semaphore
>  	 */

Why reflow this paragraph?  You don't change the number of lines used,
so it's an unnecessary change.

>  
>  	down(&ieee->wx_sem);
> @@ -2046,7 +2047,7 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
>  			ieee->rate = 110;
>  		}
>  
> -		// By default, WMM function will be disabled in IBSS mode
> +		/* By default, WMM function will be disabled in IBSS mode */
>  		ieee->current_network.QoS_Enable = 0;
>  
>  		ieee->current_network.atim_window = 0;
> @@ -2081,10 +2082,10 @@ inline void ieee80211_start_ibss(struct ieee80211_device *ieee)
>  void ieee80211_start_bss(struct ieee80211_device *ieee)
>  {
>  	unsigned long flags;
> -	//
> -	// Ref: 802.11d 11.1.3.3
> -	// STA shall not start a BSS unless properly formed Beacon frame including a Country IE.
> -	//
> +	/* Ref: 802.11d 11.1.3.3
> +	 * STA shall not start a BSS unless properly formed Beacon frame
> +	 * including a Country IE.
> +	 */
>  	if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
>  	{
>  		if (!ieee->bGlobalDomain)
> @@ -2145,19 +2146,18 @@ static void ieee80211_associate_retry_wq(struct work_struct *work)
>  		goto exit;
>  	if (ieee->state != IEEE80211_ASSOCIATING_RETRY)
>  		goto exit;
> -	/* until we do not set the state to IEEE80211_NOLINK
> -	* there are no possibility to have someone else trying
> -	* to start an association procedure (we get here with
> -	* ieee->state = IEEE80211_ASSOCIATING).
> -	* When we set the state to IEEE80211_NOLINK it is possible
> -	* that the RX path run an attempt to associate, but
> -	* both ieee80211_softmac_check_all_nets and the
> -	* RX path works with ieee->lock held so there are no
> -	* problems. If we are still disassociated then start a scan.
> -	* the lock here is necessary to ensure no one try to start
> -	* an association procedure when we have just checked the
> -	* state and we are going to start the scan.
> -	*/
> +	/* until we do not set the state to IEEE80211_NOLINK there are no
> +	 * possibility to have someone else trying to start an association
> +	 * procedure (we get here with ieee->state = IEEE80211_ASSOCIATING).
> +	 * When we set the state to IEEE80211_NOLINK it is possible that the RX
> +	 * path run an attempt to associate, but both
> +	 * ieee80211_softmac_check_all_nets and the RX path works with
> +	 * ieee->lock held so there are no problems. If we are still
> +	 * disassociated then start a scan.
> +	 * the lock here is necessary to ensure no one try to start an
> +	 * association procedure when we have just checked the state and we are
> +	 * going to start the scan.
> +	 */

You only save one line of code.  Leave this alone, since the comment
style is fine.

>  	ieee->state = IEEE80211_NOLINK;
>  	ieee->beinretry = true;
>  	ieee80211_softmac_check_all_nets(ieee);
> @@ -2169,12 +2169,12 @@ static void ieee80211_associate_retry_wq(struct work_struct *work)
>  		ieee->actscanning = true;
>  		ieee80211_rtl_start_scan(ieee);
>  	}
> -	//YJ,add,080828, notify os here
> +	/* YJ,add,080828, notify os here */
>  	if (ieee->state == IEEE80211_NOLINK)
>  	{
>  		notify_wx_assoc_event(ieee);
>  	}
> -	//YJ,add,080828,end
> +	/* YJ,add,080828,end */
>  	spin_unlock_irqrestore(&ieee->lock, flags);
>  
>  exit:
> @@ -2286,7 +2286,7 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
>  	  ieee->last_packet_time[i] = 0;
>  	}
>  
> -	ieee->init_wmmparam_flag = 0;//reinitialize AC_xx_PARAM registers.
> +	ieee->init_wmmparam_flag = 0; /* reinitialize AC_xx_PARAM registers. */
>  
>  	/* if the user set the MAC of the ad-hoc cell and then
>  	 * switch to managed mode, shall we  make sure that association
> @@ -2296,7 +2296,7 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
>  	switch (ieee->iw_mode) {
>  		case IW_MODE_AUTO:
>  			ieee->iw_mode = IW_MODE_INFRA;
> -			//not set break here intentionly
> +			/* not set break here intentionly */
>  		case IW_MODE_INFRA:
>  			ieee80211_start_bss(ieee);
>  			break;
> @@ -2331,7 +2331,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
>  	ieee->assoc_id = 0;
>  	ieee->queue_stop = 0;
>  	ieee->scanning = 0;
> -	ieee->softmac_features = 0; //so IEEE2100-like driver are happy
> +	ieee->softmac_features = 0; /* so IEEE2100-like driver are happy */
>  	ieee->wap_set = 0;
>  	ieee->ssid_set = 0;
>  	ieee->proto_started = 0;
> @@ -2339,17 +2339,17 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
>  	ieee->rate = 3;
>  	ieee->ps = IEEE80211_PS_MBCAST|IEEE80211_PS_UNICAST;
>  	ieee->sta_sleep = 0;
> -//by amy
> +	/* by amy */

Delete this in a separate commit.

>  	ieee->bInactivePs = false;
>  	ieee->actscanning = false;
>  	ieee->ListenInterval = 2;
> -	ieee->NumRxDataInPeriod = 0; //YJ,add,080828

I would actually delete comments like this as well,

> -	ieee->NumRxBcnInPeriod = 0; //YJ,add,080828
> -	ieee->NumRxOkTotal = 0;//+by amy 080312
> -	ieee->NumRxUnicast = 0;//YJ,add,080828,for keep alive

But perhaps keep comments like "for keep alive", but delete the
authorship attribution.

> +	ieee->NumRxDataInPeriod = 0; /* YJ,add,080828 */
> +	ieee->NumRxBcnInPeriod = 0; /* YJ,add,080828 */
> +	ieee->NumRxOkTotal = 0; /* +by amy 080312 */
> +	ieee->NumRxUnicast = 0;/* YJ,add,080828,for keep alive */
>  	ieee->beinretry = false;
>  	ieee->bHwRadioOff = false;
> -//by amy
> +	/* by amy */
>  
>  	init_mgmt_queue(ieee);
>  
> @@ -2392,7 +2392,7 @@ void ieee80211_softmac_free(struct ieee80211_device *ieee)
>  	cancel_delayed_work(&ieee->associate_retry_wq);
>  
>  
> -	//add for RF power on power of by lizhaoming 080512
> +	/* add for RF power on power of by lizhaoming 080512 */

And delete the name date from this comment as well, but keep the "add
for RF power on power of".  I assume they mean "power off"?

>  	cancel_delayed_work(&ieee->GPIOChangeRFWorkItem);
>  
>  	destroy_workqueue(ieee->wq);
> @@ -2400,11 +2400,10 @@ void ieee80211_softmac_free(struct ieee80211_device *ieee)
>  	up(&ieee->wx_sem);
>  }
>  
> -/********************************************************
> - * Start of WPA code.                                   *
> - * this is stolen from the ipw2200 driver               *
> - ********************************************************/
> -
> +/*
> + * Start of WPA code.
> + * this is stolen from the ipw2200 driver
> + */
>  
>  static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value)
>  {
> @@ -2434,7 +2433,7 @@ static int ieee80211_wpa_mlme(struct ieee80211_device *ieee, int command,
>  
>  	switch (command) {
>  	case IEEE_MLME_STA_DEAUTH:
> -		// silently ignore
> +		/* silently ignore */
>  		break;
>  
>  	case IEEE_MLME_STA_DISASSOC:
> @@ -2534,8 +2533,8 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
>  			.enabled = value,
>  		};
>  		ieee->drop_unencrypted = value;
> -		/* We only change SEC_LEVEL for open mode. Others
> -		 * are set by ipw_wpa_set_encryption.
> +		/* We only change SEC_LEVEL for open mode. Others are set by
> +		 * ipw_wpa_set_encryption.
>  		 */
>  		if (!value) {
>  			sec.flags |= SEC_LEVEL;
> @@ -2559,7 +2558,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
>  		ieee->ieee802_1x = value;
>  		break;
>  	case IEEE_PARAM_WPAX_SELECT:
> -		// added for WPA2 mixed mode
> +		/* added for WPA2 mixed mode */
>  		spin_lock_irqsave(&ieee->wpax_suitlist_lock, flags);
>  		ieee->wpax_type_set = 1;
>  		ieee->wpax_type_notify = value;
> @@ -2608,8 +2607,8 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
>  	if (strcmp(param->u.crypt.alg, "none") == 0) {
>  		if (crypt) {
>  			sec.enabled = 0;
> -			// FIXME FIXME
> -			//sec.encrypt = 0;
> +			/* FIXME FIXME */
> +			/* sec.encrypt = 0; */

The second statement should have been removed by your patch to remove
commented out code.

>  			sec.level = SEC_LEVEL_0;
>  			sec.flags |= SEC_ENABLED | SEC_LEVEL;
>  			ieee80211_crypt_delayed_deinit(ieee, crypt);
> @@ -2617,8 +2616,8 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
>  		goto done;
>  	}
>  	sec.enabled = 1;
> -// FIXME FIXME
> -//	sec.encrypt = 1;
> +	/* FIXME FIXME */
> +	/* sec.encrypt = 1; */

Same here.

Sarah Sharp

Patch
diff mbox

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index 15017ff..c027b73 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -24,12 +24,12 @@ 
 
 #include "dot11d.h"
 u8 rsn_authen_cipher_suite[16][4] = {
-	{0x00, 0x0F, 0xAC, 0x00}, //Use group key, //Reserved
-	{0x00, 0x0F, 0xAC, 0x01}, //WEP-40         //RSNA default
-	{0x00, 0x0F, 0xAC, 0x02}, //TKIP           //NONE		//{used just as default}
-	{0x00, 0x0F, 0xAC, 0x03}, //WRAP-historical
-	{0x00, 0x0F, 0xAC, 0x04}, //CCMP
-	{0x00, 0x0F, 0xAC, 0x05}, //WEP-104
+	{0x00, 0x0F, 0xAC, 0x00}, /* Use group key, */ /* Reserved */
+	{0x00, 0x0F, 0xAC, 0x01}, /* WEP-40 */ /* RSNA default */
+	{0x00, 0x0F, 0xAC, 0x02}, /* TKIP */ /* NONE */ /* {used just as default} */
+	{0x00, 0x0F, 0xAC, 0x03}, /* WRAP-historical */
+	{0x00, 0x0F, 0xAC, 0x04}, /* CCMP */
+	{0x00, 0x0F, 0xAC, 0x05}, /* WEP-104 */
 };
 
 short ieee80211_is_54g(const struct ieee80211_network *net)
@@ -61,8 +61,7 @@  static unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee)
 }
 
 /* place the MFIE rate, tag to the memory (double) poised.
- * Then it updates the pointer so that
- * it points after the new MFIE tag added.
+ * Then it updates the pointer so that it points after the new MFIE tag added.
  */
 static void ieee80211_MFIE_Brate(struct ieee80211_device *ieee, u8 **tag_p)
 {
@@ -107,12 +106,12 @@  static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p)
 {
 	u8 *tag = *tag_p;
 
-	*tag++ = MFIE_TYPE_GENERIC; //0
+	*tag++ = MFIE_TYPE_GENERIC; /* 0 */
 	*tag++ = 7;
 	*tag++ = 0x00;
 	*tag++ = 0x50;
 	*tag++ = 0xf2;
-	*tag++ = 0x02;//5
+	*tag++ = 0x02; /* 5 */
 	*tag++ = 0x00;
 	*tag++ = 0x01;
 #ifdef SUPPORT_USPD
@@ -259,7 +258,7 @@  inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
 		ieee->softmac_hard_start_xmit(skb, ieee->dev);
 	}
 }
-//by amy for power save
+/* by amy for power save */
 inline struct sk_buff *
 ieee80211_disassociate_skb(struct ieee80211_network *beacon,
 			   struct ieee80211_device *ieee, u8 asRsn)
@@ -292,7 +291,7 @@  void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn)
 		softmac_mgmt_xmit(skb, ieee);
 }
 
-//by amy for power save
+/* by amy for power save */
 inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee)
 {
 	unsigned int len, rate_len;
@@ -312,7 +311,7 @@  inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee)
 	req = (struct ieee80211_probe_request *)
 		skb_put(skb, sizeof(struct ieee80211_probe_request));
 	req->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_REQ);
-	req->header.duration_id = 0; //FIXME: is this OK ?
+	req->header.duration_id = 0; /* FIXME: is this OK ? */
 
 	memset(req->header.addr1, 0xff, ETH_ALEN);
 	memcpy(req->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
@@ -341,7 +340,7 @@  void ext_ieee80211_send_beacon_wq(struct ieee80211_device *ieee)
 	if (skb) {
 		softmac_mgmt_xmit(skb, ieee);
 		ieee->softmac_stats.tx_beacons++;
-		dev_kfree_skb_any(skb);//edit by thomas
+		dev_kfree_skb_any(skb); /* edit by thomas */
 	}
 
 	ieee->beacon_timer.expires = jiffies +
@@ -360,7 +359,7 @@  static void ieee80211_send_beacon(struct ieee80211_device *ieee)
 	if (skb) {
 		softmac_mgmt_xmit(skb, ieee);
 		ieee->softmac_stats.tx_beacons++;
-		dev_kfree_skb_any(skb);//edit by thomas
+		dev_kfree_skb_any(skb); /* edit by thomas */
 	}
 
 	ieee->beacon_timer.expires = jiffies +
@@ -469,24 +468,24 @@  void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
 	ch = ieee->current_network.channel;
 	while (1)
 	{
-                /* this function can be called in two situations
-                 * 1- We have switched to ad-hoc mode and we are
-                 *    performing a complete syncro scan before conclude
-                 *    there are no interesting cell and to create a
-                 *    new one. In this case the link state is
-                 *    IEEE80211_NOLINK until we found an interesting cell.
-                 *    If so the ieee8021_new_net, called by the RX path
-                 *    will set the state to IEEE80211_LINKED, so we stop
-                 *    scanning
-                 * 2- We are linked and the root uses run iwlist scan.
-                 *    So we switch to IEEE80211_LINKED_SCANNING to remember
-                 *    that we are still logically linked (not interested in
-                 *    new network events, despite for updating the net list,
-                 *    but we are temporarily 'unlinked' as the driver shall
-                 *    not filter RX frames and the channel is changing.
-                 * So the only situation in witch are interested is to check
-                 * if the state become LINKED because of the #1 situation
-                 */
+		/* this function can be called in two situations
+		 * 1- We have switched to ad-hoc mode and we are
+		 *    performing a complete syncro scan before conclude
+		 *    there are no interesting cell and to create a
+		 *    new one. In this case the link state is
+		 *    IEEE80211_NOLINK until we found an interesting cell.
+		 *    If so the ieee8021_new_net, called by the RX path
+		 *    will set the state to IEEE80211_LINKED, so we stop
+		 *    scanning
+		 * 2- We are linked and the root uses run iwlist scan.
+		 *    So we switch to IEEE80211_LINKED_SCANNING to remember
+		 *    that we are still logically linked (not interested in
+		 *    new network events, despite for updating the net list,
+		 *    but we are temporarily 'unlinked' as the driver shall
+		 *    not filter RX frames and the channel is changing.
+		 * So the only situation in witch are interested is to check
+		 * if the state become LINKED because of the #1 situation
+		 */
 		if (ieee->state == IEEE80211_LINKED)
 		{
 			goto out;
@@ -670,7 +669,7 @@  ieee80211_authentication_req(struct ieee80211_network *beacon,
 	auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
 	if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
 
-	auth->header.duration_id = 0x013a; //FIXME
+	auth->header.duration_id = 0x013a; /* FIXME */
 
 	memcpy(auth->header.addr1, beacon->bssid, ETH_ALEN);
 	memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
@@ -716,7 +715,7 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
 
 	beacon_size = sizeof(struct ieee80211_probe_response)+
 		ssid_len
-		+3 //channel
+		+3 /* channel */
 		+rate_len
 		+rate_ex_len
 		+atim_len
@@ -734,7 +733,7 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
 	memcpy(beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
 	memcpy(beacon_buf->header.addr3, ieee->current_network.bssid, ETH_ALEN);
 
-	beacon_buf->header.duration_id = 0; //FIXME
+	beacon_buf->header.duration_id = 0; /* FIXME */
 	beacon_buf->beacon_interval =
 		cpu_to_le16(ieee->current_network.beacon_interval);
 	beacon_buf->capability =
@@ -795,7 +794,9 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
 	if (wpa_ie_len)
 	{
 		if (ieee->iw_mode == IW_MODE_ADHOC)
-		{//as Windows will set pairwise key same as the group key which is not allowed in Linux, so set this for IOT issue. WB 2008.07.07
+		{ /* as Windows will set pairwise key same as the group key
+		   * which is not allowed in Linux, so set this for IOT issue.
+		   * WB 2008.07.07 */
 			memcpy(&ieee->wpa_ie[14], &ieee->wpa_ie[8], 4);
 		}
 
@@ -914,7 +915,7 @@  static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
 
 	if (buf) {
 		softmac_mgmt_xmit(buf, ieee);
-		dev_kfree_skb_any(buf);//edit by thomas
+		dev_kfree_skb_any(buf); /* edit by thomas */
 	}
 }
 
@@ -924,7 +925,7 @@  static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *des
 
 	if (buf) {
 		softmac_mgmt_xmit(buf, ieee);
-		dev_kfree_skb_any(buf);//edit by thomas
+		dev_kfree_skb_any(buf); /* edit by thomas */
 	}
 }
 
@@ -934,7 +935,7 @@  static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
 
 	if (buf) {
 		softmac_mgmt_xmit(buf, ieee);
-		dev_kfree_skb_any(buf);//edit by thomas
+		dev_kfree_skb_any(buf); /* edit by thomas */
 	}
 }
 
@@ -948,7 +949,7 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 	u8 *tag;
 	unsigned int wpa_len = beacon->wpa_ie_len;
 #if 1
-	// for testing purpose
+	/* for testing purpose */
 	unsigned int rsn_len = beacon->rsn_ie_len;
 #endif
 	unsigned int rate_len = ieee80211_MFIE_rate_len(ieee);
@@ -959,9 +960,10 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 
 	int len = 0;
 
-	//[0] Notify type of encryption: WPA/WPA2
-	//[1] pair wise type
-	//[2] authen type
+	/* [0] Notify type of encryption: WPA/WPA2
+	 * [1] pair wise type
+	 * [2] authen type
+	 */
 	if (ieee->wpax_type_set) {
 		if (IEEE_PROTO_WPA == encry_proto) {
 			rsn_len = 0;
@@ -970,8 +972,8 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 		}
 	}
 	len = sizeof(struct ieee80211_assoc_request_frame)+
-		+ beacon->ssid_len//essid tagged val
-		+ rate_len//rates tagged val
+		+ beacon->ssid_len /* essid tagged val */
+		+ rate_len /* rates tagged val */
 		+ wpa_len
 		+ rsn_len
 		+ wmm_info_len
@@ -987,11 +989,12 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 
 
 	hdr->header.frame_control = IEEE80211_STYPE_ASSOC_REQ;
-	hdr->header.duration_id = 37; //FIXME
+	hdr->header.duration_id = 37; /* FIXME */
 	memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN);
 	memcpy(hdr->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
 	memcpy(hdr->header.addr3, beacon->bssid, ETH_ALEN);
-	memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN);//for HW security, John
+	/* for HW security, John */
+	memcpy(ieee->ap_mac_addr, beacon->bssid, ETH_ALEN);
 
 	hdr->capability = cpu_to_le16(WLAN_CAPABILITY_BSS);
 	if (beacon->capability & WLAN_CAPABILITY_PRIVACY)
@@ -1002,7 +1005,7 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 	if (ieee->short_slot)
 		hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
 
-	hdr->listen_interval = 0xa; //FIXME
+	hdr->listen_interval = 0xa; /* FIXME */
 
 	hdr->info_element.id = MFIE_TYPE_SSID;
 
@@ -1015,8 +1018,9 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 	ieee80211_MFIE_Brate(ieee, &tag);
 	ieee80211_MFIE_Grate(ieee, &tag);
 
-	//add rsn==0 condition for ap's mix security mode(wpa+wpa2), john2007.8.9
-	//choose AES encryption as default algorithm while using mixed mode
+	/* add rsn==0 condition for ap's mix security mode(wpa+wpa2),
+	 * john2007.8.9 */
+	/* choose AES encryption as default algorithm while using mixed mode */
 
 	tag = skb_put(skb, ieee->wpa_ie_len);
 	memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
@@ -1039,9 +1043,9 @@  void ieee80211_associate_abort(struct ieee80211_device *ieee)
 
 	ieee->associate_seq++;
 
-	/* don't scan, and avoid to have the RX path possibly
-	 * try again to associate. Even do not react to AUTH or
-	 * ASSOC response. Just wait for the retry wq to be scheduled.
+	/* don't scan, and avoid to have the RX path possibly try again to
+	 * associate. Even do not react to AUTH or ASSOC response. Just wait
+	 * for the retry wq to be scheduled.
 	 * Here we will check if there are good nets to associate
 	 * with, so we retry or just get back to NO_LINK and scanning
 	 */
@@ -1083,16 +1087,18 @@  static void ieee80211_associate_step1(struct ieee80211_device *ieee)
 		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING;
 		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
 		softmac_mgmt_xmit(skb, ieee);
-		//BUGON when you try to add_timer twice, using mod_timer may be better, john0709
+		/* BUGON when you try to add_timer twice, using mod_timer may
+		 * be better, john0709 */
 		if (!timer_pending(&ieee->associate_timer)) {
 			ieee->associate_timer.expires = jiffies + (HZ / 2);
 			add_timer(&ieee->associate_timer);
 		}
-		//If call dev_kfree_skb_any,a warning will ocur....
-		//KERNEL: assertion (!atomic_read(&skb->users)) failed at net/core/dev.c (1708)
-		//So ... 1204 by lawrence.
-		//printk("\nIn %s,line %d call kfree skb.",__func__,__LINE__);
-		//dev_kfree_skb_any(skb);//edit by thomas
+		/* If call dev_kfree_skb_any,a warning will ocur....
+		 * KERNEL: assertion (!atomic_read(&skb->users)) failed at net/core/dev.c (1708)
+		 * So ... 1204 by lawrence.
+		 * printk("\nIn %s,line %d call kfree skb.",__func__,__LINE__);
+		 * dev_kfree_skb_any(skb);//edit by thomas
+		 */
 	}
 }
 
@@ -1125,7 +1131,7 @@  static void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *chal
 			ieee->associate_timer.expires = jiffies + (HZ / 2);
 			add_timer(&ieee->associate_timer);
 		}
-		dev_kfree_skb_any(skb);//edit by thomas
+		dev_kfree_skb_any(skb); /* edit by thomas */
 	}
 	kfree(challenge);
 }
@@ -1526,7 +1532,7 @@  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 		ieee->iw_mode != IW_MODE_INFRA ||
 		ieee->state != IEEE80211_LINKED)){
 
-		//#warning CHECK_LOCK_HERE
+		/* #warning CHECK_LOCK_HERE */
 		spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
 
 		ieee80211_sta_wakeup(ieee, 1);
@@ -1556,7 +1562,7 @@  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 			spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
 		}
 	} else if (sleep == 2) {
-//#warning CHECK_LOCK_HERE
+		/* #warning CHECK_LOCK_HERE */
 		spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
 
 		ieee80211_sta_wakeup(ieee, 1);
@@ -1657,7 +1663,7 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 					ieee->assoc_id = aid;
 					ieee->softmac_stats.rx_ass_ok++;
 
-					if (1 == rx_stats->nic_type) //card type is 8187
+					if (1 == rx_stats->nic_type) /* card type is 8187 */
 					{
 						goto associate_complete;
 					}
@@ -1679,25 +1685,25 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 							    info_element->data[2] == 0xf2 &&
 							    info_element->data[3] == 0x02 &&
 							    info_element->data[4] == 0x01) {
-							    // Not care about version at present.
-							    //WMM Parameter Element
+							    /* Not care about version at present. */
+							    /* WMM Parameter Element */
 							    memcpy(ieee->current_network.wmm_param, (u8*)(info_element->data\
 										    + 8), (info_element->len - 8));
 
 						            if (((ieee->current_network.wmm_info^info_element->data[6])& \
 										    0x0f) || (!ieee->init_wmmparam_flag)) {
-							      // refresh parameter element for current network
-							      // update the register parameter for hardware
+							      /* refresh parameter element for current network */
+							      /* update the register parameter for hardware */
 							      ieee->init_wmmparam_flag = 1;
 							      queue_work(ieee->wq, &ieee->wmm_param_update_wq);
 
 						            }
-						            //update info_element for current network
+						            /* update info_element for current network */
 						            ieee->current_network.wmm_info  = info_element->data[6];
 							}
 							break;
 						  default:
-							//nothing to do at present!!!
+							/* nothing to do at present!!! */
 							break;
 						}
 
@@ -1706,10 +1712,10 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 						info_element = (struct ieee80211_info_element *)
 							&info_element->data[info_element->len];
 					}
-					if (!ieee->init_wmmparam_flag) //legacy AP, reset the AC_xx_param register
+					if (!ieee->init_wmmparam_flag) /* legacy AP, reset the AC_xx_param register */
 					{
 						queue_work(ieee->wq, &ieee->wmm_param_update_wq);
-						ieee->init_wmmparam_flag = 1;//indicate AC_xx_param upated since last associate
+						ieee->init_wmmparam_flag = 1; /* indicate AC_xx_param upated since last associate */
 					}
 associate_complete:
 					ieee80211_associate_complete(ieee);
@@ -1789,22 +1795,18 @@  associate_complete:
 }
 
 /* following are for a simpler TX queue management.
- * Instead of using netif_[stop/wake]_queue the driver
- * will uses these two function (plus a reset one), that
- * will internally uses the kernel netif_* and takes
- * care of the ieee802.11 fragmentation.
- * So the driver receives a fragment per time and might
- * call the stop function when it want without take care
- * to have enough room to TX an entire packet.
- * This might be useful if each fragment need it's own
- * descriptor, thus just keep a total free memory > than
- * the max fragmentation threshold is not enough.. If the
- * ieee802.11 stack passed a TXB struct then you needed
- * to keep N free descriptors where
- * N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
- * In this way you need just one and the 802.11 stack
- * will take care of buffering fragments and pass them to
- * to the driver later, when it wakes the queue.
+ * Instead of using netif_[stop/wake]_queue the driver will uses these two
+ * function (plus a reset one), that will internally uses the kernel netif_*
+ * and takes care of the ieee802.11 fragmentation.
+ * So the driver receives a fragment per time and might call the stop function
+ * when it want without take care to have enough room to TX an entire packet.
+ * This might be useful if each fragment need it's own descriptor, thus just
+ * keep a total free memory > than the max fragmentation threshold is not
+ * enough.. If the ieee802.11 stack passed a TXB struct then you needed to
+ * keep N free descriptors where N = MAX_PACKET_SIZE / MIN_FRAG_TRESHOLD
+ * In this way you need just one and the 802.11 stack will take care of
+ * buffering fragments and pass them to the driver later, when it wakes the
+ * queue.
  */
 
 void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
@@ -1901,7 +1903,7 @@  void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
 
 			ieee->softmac_data_hard_start_xmit(skb, ieee->dev,
 							   ieee->basic_rate);
-			dev_kfree_skb_any(skb);//edit by thomas
+			dev_kfree_skb_any(skb); /* edit by thomas */
 		}
 	}
 	if (!ieee->queue_stop && ieee->tx_pending.txb)
@@ -1974,12 +1976,11 @@  static void ieee80211_start_ibss_wq(struct work_struct *work)
 	struct delayed_work *dwork = to_delayed_work(work);
 	struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq);
 
-	/* iwconfig mode ad-hoc will schedule this and return
-	 * on the other hand this will block further iwconfig SET
-	 * operations because of the wx_sem hold.
-	 * Anyway some most set operations set a flag to speed-up
-	 * (abort) this wq (when syncro scanning) before sleeping
-	 * on the semaphore
+	/* iwconfig mode ad-hoc will schedule this and return on the other hand
+	 * this will block further iwconfig SET operations because of the wx_sem
+	 * hold.
+	 * Anyway some most set operations set a flag to speed-up (abort) this
+	 * wq (when syncro scanning) before sleeping on the semaphore
 	 */
 
 	down(&ieee->wx_sem);
@@ -2046,7 +2047,7 @@  static void ieee80211_start_ibss_wq(struct work_struct *work)
 			ieee->rate = 110;
 		}
 
-		// By default, WMM function will be disabled in IBSS mode
+		/* By default, WMM function will be disabled in IBSS mode */
 		ieee->current_network.QoS_Enable = 0;
 
 		ieee->current_network.atim_window = 0;
@@ -2081,10 +2082,10 @@  inline void ieee80211_start_ibss(struct ieee80211_device *ieee)
 void ieee80211_start_bss(struct ieee80211_device *ieee)
 {
 	unsigned long flags;
-	//
-	// Ref: 802.11d 11.1.3.3
-	// STA shall not start a BSS unless properly formed Beacon frame including a Country IE.
-	//
+	/* Ref: 802.11d 11.1.3.3
+	 * STA shall not start a BSS unless properly formed Beacon frame
+	 * including a Country IE.
+	 */
 	if (IS_DOT11D_ENABLE(ieee) && !IS_COUNTRY_IE_VALID(ieee))
 	{
 		if (!ieee->bGlobalDomain)
@@ -2145,19 +2146,18 @@  static void ieee80211_associate_retry_wq(struct work_struct *work)
 		goto exit;
 	if (ieee->state != IEEE80211_ASSOCIATING_RETRY)
 		goto exit;
-	/* until we do not set the state to IEEE80211_NOLINK
-	* there are no possibility to have someone else trying
-	* to start an association procedure (we get here with
-	* ieee->state = IEEE80211_ASSOCIATING).
-	* When we set the state to IEEE80211_NOLINK it is possible
-	* that the RX path run an attempt to associate, but
-	* both ieee80211_softmac_check_all_nets and the
-	* RX path works with ieee->lock held so there are no
-	* problems. If we are still disassociated then start a scan.
-	* the lock here is necessary to ensure no one try to start
-	* an association procedure when we have just checked the
-	* state and we are going to start the scan.
-	*/
+	/* until we do not set the state to IEEE80211_NOLINK there are no
+	 * possibility to have someone else trying to start an association
+	 * procedure (we get here with ieee->state = IEEE80211_ASSOCIATING).
+	 * When we set the state to IEEE80211_NOLINK it is possible that the RX
+	 * path run an attempt to associate, but both
+	 * ieee80211_softmac_check_all_nets and the RX path works with
+	 * ieee->lock held so there are no problems. If we are still
+	 * disassociated then start a scan.
+	 * the lock here is necessary to ensure no one try to start an
+	 * association procedure when we have just checked the state and we are
+	 * going to start the scan.
+	 */
 	ieee->state = IEEE80211_NOLINK;
 	ieee->beinretry = true;
 	ieee80211_softmac_check_all_nets(ieee);
@@ -2169,12 +2169,12 @@  static void ieee80211_associate_retry_wq(struct work_struct *work)
 		ieee->actscanning = true;
 		ieee80211_rtl_start_scan(ieee);
 	}
-	//YJ,add,080828, notify os here
+	/* YJ,add,080828, notify os here */
 	if (ieee->state == IEEE80211_NOLINK)
 	{
 		notify_wx_assoc_event(ieee);
 	}
-	//YJ,add,080828,end
+	/* YJ,add,080828,end */
 	spin_unlock_irqrestore(&ieee->lock, flags);
 
 exit:
@@ -2286,7 +2286,7 @@  void ieee80211_start_protocol(struct ieee80211_device *ieee)
 	  ieee->last_packet_time[i] = 0;
 	}
 
-	ieee->init_wmmparam_flag = 0;//reinitialize AC_xx_PARAM registers.
+	ieee->init_wmmparam_flag = 0; /* reinitialize AC_xx_PARAM registers. */
 
 	/* if the user set the MAC of the ad-hoc cell and then
 	 * switch to managed mode, shall we  make sure that association
@@ -2296,7 +2296,7 @@  void ieee80211_start_protocol(struct ieee80211_device *ieee)
 	switch (ieee->iw_mode) {
 		case IW_MODE_AUTO:
 			ieee->iw_mode = IW_MODE_INFRA;
-			//not set break here intentionly
+			/* not set break here intentionly */
 		case IW_MODE_INFRA:
 			ieee80211_start_bss(ieee);
 			break;
@@ -2331,7 +2331,7 @@  void ieee80211_softmac_init(struct ieee80211_device *ieee)
 	ieee->assoc_id = 0;
 	ieee->queue_stop = 0;
 	ieee->scanning = 0;
-	ieee->softmac_features = 0; //so IEEE2100-like driver are happy
+	ieee->softmac_features = 0; /* so IEEE2100-like driver are happy */
 	ieee->wap_set = 0;
 	ieee->ssid_set = 0;
 	ieee->proto_started = 0;
@@ -2339,17 +2339,17 @@  void ieee80211_softmac_init(struct ieee80211_device *ieee)
 	ieee->rate = 3;
 	ieee->ps = IEEE80211_PS_MBCAST|IEEE80211_PS_UNICAST;
 	ieee->sta_sleep = 0;
-//by amy
+	/* by amy */
 	ieee->bInactivePs = false;
 	ieee->actscanning = false;
 	ieee->ListenInterval = 2;
-	ieee->NumRxDataInPeriod = 0; //YJ,add,080828
-	ieee->NumRxBcnInPeriod = 0; //YJ,add,080828
-	ieee->NumRxOkTotal = 0;//+by amy 080312
-	ieee->NumRxUnicast = 0;//YJ,add,080828,for keep alive
+	ieee->NumRxDataInPeriod = 0; /* YJ,add,080828 */
+	ieee->NumRxBcnInPeriod = 0; /* YJ,add,080828 */
+	ieee->NumRxOkTotal = 0; /* +by amy 080312 */
+	ieee->NumRxUnicast = 0;/* YJ,add,080828,for keep alive */
 	ieee->beinretry = false;
 	ieee->bHwRadioOff = false;
-//by amy
+	/* by amy */
 
 	init_mgmt_queue(ieee);
 
@@ -2392,7 +2392,7 @@  void ieee80211_softmac_free(struct ieee80211_device *ieee)
 	cancel_delayed_work(&ieee->associate_retry_wq);
 
 
-	//add for RF power on power of by lizhaoming 080512
+	/* add for RF power on power of by lizhaoming 080512 */
 	cancel_delayed_work(&ieee->GPIOChangeRFWorkItem);
 
 	destroy_workqueue(ieee->wq);
@@ -2400,11 +2400,10 @@  void ieee80211_softmac_free(struct ieee80211_device *ieee)
 	up(&ieee->wx_sem);
 }
 
-/********************************************************
- * Start of WPA code.                                   *
- * this is stolen from the ipw2200 driver               *
- ********************************************************/
-
+/*
+ * Start of WPA code.
+ * this is stolen from the ipw2200 driver
+ */
 
 static int ieee80211_wpa_enable(struct ieee80211_device *ieee, int value)
 {
@@ -2434,7 +2433,7 @@  static int ieee80211_wpa_mlme(struct ieee80211_device *ieee, int command,
 
 	switch (command) {
 	case IEEE_MLME_STA_DEAUTH:
-		// silently ignore
+		/* silently ignore */
 		break;
 
 	case IEEE_MLME_STA_DISASSOC:
@@ -2534,8 +2533,8 @@  static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
 			.enabled = value,
 		};
 		ieee->drop_unencrypted = value;
-		/* We only change SEC_LEVEL for open mode. Others
-		 * are set by ipw_wpa_set_encryption.
+		/* We only change SEC_LEVEL for open mode. Others are set by
+		 * ipw_wpa_set_encryption.
 		 */
 		if (!value) {
 			sec.flags |= SEC_LEVEL;
@@ -2559,7 +2558,7 @@  static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
 		ieee->ieee802_1x = value;
 		break;
 	case IEEE_PARAM_WPAX_SELECT:
-		// added for WPA2 mixed mode
+		/* added for WPA2 mixed mode */
 		spin_lock_irqsave(&ieee->wpax_suitlist_lock, flags);
 		ieee->wpax_type_set = 1;
 		ieee->wpax_type_notify = value;
@@ -2608,8 +2607,8 @@  static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
 	if (strcmp(param->u.crypt.alg, "none") == 0) {
 		if (crypt) {
 			sec.enabled = 0;
-			// FIXME FIXME
-			//sec.encrypt = 0;
+			/* FIXME FIXME */
+			/* sec.encrypt = 0; */
 			sec.level = SEC_LEVEL_0;
 			sec.flags |= SEC_ENABLED | SEC_LEVEL;
 			ieee80211_crypt_delayed_deinit(ieee, crypt);
@@ -2617,8 +2616,8 @@  static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
 		goto done;
 	}
 	sec.enabled = 1;
-// FIXME FIXME
-//	sec.encrypt = 1;
+	/* FIXME FIXME */
+	/* sec.encrypt = 1; */
 	sec.flags |= SEC_ENABLED;
 
 	/* IPW HW cannot build TKIP MIC, host decryption still needed. */