[OPW,kernel,02/11] staging: rtl8187se: Delete commented code in ieee80211/ieee80211_softmac.c
diff mbox

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

Commit Message

Ana Rey March 7, 2014, 12:33 p.m. UTC
This patch deletes all commented code and whitelines in
eee80211/ieee80211_softmac.c that are not necessary.

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

Comments

Sarah Sharp March 8, 2014, 8:37 p.m. UTC | #1
On Fri, Mar 07, 2014 at 01:33:02PM +0100, Ana Rey wrote:
> This patch deletes all commented code and whitelines in
> eee80211/ieee80211_softmac.c that are not necessary.

You also re-indent some lines of code.  That should be in a separate
patch.

Also, could you make a separate patch that removes comments that only
say "by amy" or have other authorship attribution (I think there was a
"change by thomas" comment as well).  We don't need those, since git
tracks who added what lines.

Comments below.

> 
> Signed-off-by: Ana Rey <anarey@gmail.com>
> ---
>  .../rtl8187se/ieee80211/ieee80211_softmac.c        | 243 +--------------------
>  1 file changed, 7 insertions(+), 236 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> index 3d33b7e..15017ff 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> @@ -13,7 +13,6 @@
>   * released under the GPL
>   */
>  
> -
>  #include "ieee80211.h"
>  
>  #include <linux/random.h>
> @@ -77,7 +76,6 @@ static void ieee80211_MFIE_Brate(struct ieee80211_device *ieee, u8 **tag_p)
>  		*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB;
>  		*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB;
>  	}
> -
>  	/* We may add an option for custom rates that specific HW might support */
>  	*tag_p = tag;
>  }
> @@ -100,7 +98,6 @@ static void ieee80211_MFIE_Grate(struct ieee80211_device *ieee, u8 **tag_p)
>  		*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB;
>  
>  	}
> -
>  	/* We may add an option for custom rates that specific HW might support */
>  	*tag_p = tag;
>  }
> @@ -150,17 +147,8 @@ static void enqueue_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb)
>  	int nh;
>  	nh = (ieee->mgmt_queue_head + 1) % MGMT_QUEUE_NUM;
>  
> -/*
> - * if the queue is full but we have newer frames then
> - * just overwrites the oldest.
> - *
> - * if (nh == ieee->mgmt_queue_tail)
> - *		return -1;
> - */
>  	ieee->mgmt_queue_head = nh;
>  	ieee->mgmt_queue_ring[nh] = skb;
> -
> -	//return 0;
>  }
>  
>  static struct sk_buff *dequeue_mgmt(struct ieee80211_device *ieee)
> @@ -194,7 +182,6 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb,
>  	struct ieee80211_hdr_3addr  *header =
>  		(struct ieee80211_hdr_3addr  *) skb->data;
>  
> -
>  	spin_lock_irqsave(&ieee->lock, flags);
>  
>  	/* called with 2nd param 0, no mgmt lock required */
> @@ -238,16 +225,13 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb,
>  	}
>  }
>  
> -
>  inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
>  				 struct ieee80211_device *ieee)
>  {
> -
>  	short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
>  	struct ieee80211_hdr_3addr  *header =
>  		(struct ieee80211_hdr_3addr  *) skb->data;
>  
> -
>  	if (single) {
>  
>  		header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
> @@ -261,7 +245,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
>  		ieee->dev->trans_start = jiffies;
>  		ieee->softmac_data_hard_start_xmit(skb, ieee->dev,
>  						   ieee->basic_rate);
> -
>  	} else {
>  
>  		header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
> @@ -274,9 +257,7 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
>  		/* avoid watchdog triggers */
>  		ieee->dev->trans_start = jiffies;
>  		ieee->softmac_hard_start_xmit(skb, ieee->dev);
> -
>  	}
> -//	dev_kfree_skb_any(skb);//edit by thomas
>  }
>  //by amy for power save
>  inline struct sk_buff *
> @@ -307,10 +288,8 @@ void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn)
>  	struct ieee80211_network *beacon = &ieee->current_network;
>  	struct sk_buff *skb;
>  	skb = ieee80211_disassociate_skb(beacon, ieee, asRsn);
> -	if (skb) {
> +	if (skb)
>  		softmac_mgmt_xmit(skb, ieee);
> -		//dev_kfree_skb_any(skb);//edit by thomas
> -	}
>  }
>  
>  //by amy for power save
> @@ -357,8 +336,6 @@ void ext_ieee80211_send_beacon_wq(struct ieee80211_device *ieee)
>  {
>  	struct sk_buff *skb;
>  
> -	//unsigned long flags;
> -
>  	skb = ieee80211_get_beacon_(ieee);
>  
>  	if (skb) {
> @@ -367,23 +344,17 @@ void ext_ieee80211_send_beacon_wq(struct ieee80211_device *ieee)
>  		dev_kfree_skb_any(skb);//edit by thomas
>  	}
>  
> -
> -	//printk(KERN_WARNING "[1] beacon sending!\n");
>  	ieee->beacon_timer.expires = jiffies +
>  		(MSECS(ieee->current_network.beacon_interval - 5));
>  
> -	//spin_lock_irqsave(&ieee->beacon_lock,flags);
>  	if (ieee->beacon_txing)
>  		add_timer(&ieee->beacon_timer);
> -	//spin_unlock_irqrestore(&ieee->beacon_lock,flags);
>  }
>  
>  static void ieee80211_send_beacon(struct ieee80211_device *ieee)
>  {
>  	struct sk_buff *skb;
>  
> -	//unsigned long flags;
> -
>  	skb = ieee80211_get_beacon_(ieee);
>  
>  	if (skb) {
> @@ -392,17 +363,13 @@ static void ieee80211_send_beacon(struct ieee80211_device *ieee)
>  		dev_kfree_skb_any(skb);//edit by thomas
>  	}
>  
> -	//printk(KERN_WARNING "[1] beacon sending!\n");
>  	ieee->beacon_timer.expires = jiffies +
>  		(MSECS(ieee->current_network.beacon_interval - 5));
>  
> -	//spin_lock_irqsave(&ieee->beacon_lock,flags);
>  	if (ieee->beacon_txing)
>  		add_timer(&ieee->beacon_timer);
> -	//spin_unlock_irqrestore(&ieee->beacon_lock,flags);
>  }
>  
> -
>  static void ieee80211_send_beacon_cb(unsigned long _ieee)
>  {
>  	struct ieee80211_device *ieee =
> @@ -422,7 +389,6 @@ static void ieee80211_send_probe(struct ieee80211_device *ieee)
>  	if (skb) {
>  		softmac_mgmt_xmit(skb, ieee);
>  		ieee->softmac_stats.tx_probe_rq++;
> -		//dev_kfree_skb_any(skb);//edit by thomas
>  	}
>  }
>  
> @@ -443,16 +409,13 @@ static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
>  	u8 channel_map[MAX_CHANNEL_NUMBER+1];
>  	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
>  	down(&ieee->scan_sem);
> -//	printk("==================> Sync scan\n");
>  
>  	while (1)
>  	{
> -
>  		do {
>  			ch++;
>  			if (ch > MAX_CHANNEL_NUMBER)
>  				goto out; /* scan completed */
> -
>  		} while (!channel_map[ch]);
>  		/* this function can be called in two situations
>  		 * 1- We have switched to ad-hoc mode and we are
> @@ -477,10 +440,8 @@ static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
>  			goto out;
>  
>  		ieee->set_chan(ieee->dev, ch);
> -//		printk("=====>channel=%d   ",ch);
>  		if (channel_map[ch] == 1)
>  		{
> -//			printk("====send probe request\n");
>  			ieee80211_send_probe_requests(ieee);
>  		}
>  		/* this prevent excessive time wait when we
> @@ -489,9 +450,7 @@ static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
>  		if (ieee->sync_scan_hurryup)
>  			goto out;
>  
> -
>  		msleep_interruptible_rtl(IEEE80211_SOFTMAC_SCAN_TIME);
> -
>  	}
>  out:
>  	ieee->sync_scan_hurryup = 0;
> @@ -508,13 +467,6 @@ void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
>  	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
>  	down(&ieee->scan_sem);
>  	ch = ieee->current_network.channel;
> -//		if(ieee->sync_scan_hurryup)
> -//	{
> -
> -//		printk("stop scan sync\n");
> -//		goto out;
> -//	}
> -//	printk("=======hh===============>ips scan\n");
>  	while (1)
>  	{
>                  /* this function can be called in two situations
> @@ -540,35 +492,21 @@ void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
>  			goto out;
>  		}
>  		if (channel_map[ieee->current_network.channel] > 0)
> -		{
>  			ieee->set_chan(ieee->dev, ieee->current_network.channel);
> -//			printk("======>channel=%d  ",ieee->current_network.channel);
> -		}
> +
>  		if (channel_map[ieee->current_network.channel] == 1)
> -		{
> -//			printk("====send probe request\n");
>  			ieee80211_send_probe_requests(ieee);
> -		}
> -		/* this prevent excessive time wait when we
> -                 * need to wait for a syncro scan to end..
> -                 */
> -//                if (ieee->sync_scan_hurryup)
> -//                        goto out;
>  
>  		msleep_interruptible_rtl(IEEE80211_SOFTMAC_SCAN_TIME);
>  
>  		do {
>  			if (watch_dog++ >= MAX_CHANNEL_NUMBER)
> -		//	if (++watch_dog >= 15);//MAX_CHANNEL_NUMBER)  //YJ,modified,080630
>  				goto out; /* scan completed */
>  
>  			ieee->current_network.channel = (ieee->current_network.channel + 1)%MAX_CHANNEL_NUMBER;
>  		} while (!channel_map[ieee->current_network.channel]);
>  	}
>  out:
> -	//ieee->sync_scan_hurryup = 0;
> -	//ieee->set_chan(ieee->dev, ch);
> -	//ieee->current_network.channel = ch;
>  	ieee->actscanning = false;
>  	up(&ieee->scan_sem);
>  	if (IS_DOT11D_ENABLE(ieee))
> @@ -582,8 +520,6 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work)
>  	static short watchdog = 0;
>  	u8 channel_map[MAX_CHANNEL_NUMBER+1];
>  	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
> -//	printk("ieee80211_softmac_scan_wq ENABLE_IPS\n");
> -//	printk("in %s\n",__func__);
>  	down(&ieee->scan_sem);
>  
>  	do {
> @@ -591,10 +527,8 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work)
>  			(ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER;
>  		if (watchdog++ > MAX_CHANNEL_NUMBER)
>  				goto out; /* no good chans */
> -
>  	} while (!channel_map[ieee->current_network.channel]);
>  
> -	//printk("current_network.channel:%d\n", ieee->current_network.channel);
>  	if (ieee->scanning == 0)
>  	{
>  		printk("error out, scanning = 0\n");
> @@ -640,10 +574,8 @@ static void ieee80211_beacons_stop(struct ieee80211_device *ieee)
>  	del_timer_sync(&ieee->beacon_timer);
>  
>  	spin_unlock_irqrestore(&ieee->beacon_lock, flags);
> -
>  }
>  
> -
>  void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
>  {
>  	if (ieee->stop_send_beacons)
> @@ -652,7 +584,6 @@ void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
>  		ieee80211_beacons_stop(ieee);
>  }
>  
> -
>  void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
>  {
>  	if (ieee->start_send_beacons)
> @@ -661,23 +592,16 @@ void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
>  		ieee80211_beacons_start(ieee);
>  }
>  
> -
>  static void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee)
>  {
> -//	unsigned long flags;
> -
> -	//ieee->sync_scan_hurryup = 1;
>  
>  	down(&ieee->scan_sem);
> -//	spin_lock_irqsave(&ieee->lock, flags);
>  
>  	if (ieee->scanning == 1) {
>  		ieee->scanning = 0;
> -		//del_timer_sync(&ieee->scan_timer);
>  		cancel_delayed_work(&ieee->softmac_scan_wq);
>  	}
>  
> -//	spin_unlock_irqrestore(&ieee->lock, flags);
>  	up(&ieee->scan_sem);
>  }
>  
> @@ -703,16 +627,12 @@ void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
>  		if (ieee->scanning == 0)
>  		{
>  			ieee->scanning = 1;
> -			//ieee80211_softmac_scan(ieee);
> -		//	queue_work(ieee->wq, &ieee->softmac_scan_wq);
> -		//care this,1203,2007,by lawrence
>  #if 1
>  			queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0);
>  #endif

Delete the #if 1 and #endif lines as well.

>  		}
>  	} else
>  		ieee->start_scan(ieee->dev);
> -
>  }
>  
>  /* called with wx_sem held */
> @@ -731,7 +651,6 @@ void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
>  		ieee80211_softmac_scan_syncro(ieee);
>  	else
>  		ieee->scan_syncro(ieee->dev);
> -
>  }
>  
>  inline struct sk_buff *
> @@ -765,7 +684,6 @@ ieee80211_authentication_req(struct ieee80211_network *beacon,
>  	auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS);
>  
>  	return skb;
> -
>  }
>  
>  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
> @@ -834,7 +752,6 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
>  	if (encrypt)
>  		beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
>  
> -
>  	beacon_buf->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_RESP);
>  
>  	beacon_buf->info_element.id = MFIE_TYPE_SSID;
> @@ -884,7 +801,6 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
>  
>  		memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
>  	}
> -
>  	skb->dev = ieee->dev;
>  	return skb;
>  }
> @@ -917,7 +833,6 @@ static struct sk_buff *ieee80211_assoc_resp(struct ieee80211_device *ieee,
>  	assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ?
>  		WLAN_CAPABILITY_BSS : WLAN_CAPABILITY_IBSS);
>  
> -
>  	if (ieee->short_slot)
>  		assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
>  
> @@ -967,8 +882,6 @@ static struct sk_buff *ieee80211_auth_resp(struct ieee80211_device *ieee,
>  	memcpy(auth->header.addr1, dest, ETH_ALEN);
>  	auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
>  	return skb;
> -
> -
>  }
>  
>  static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short pwr)
> @@ -993,11 +906,8 @@ static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short
>  		(pwr ? IEEE80211_FCTL_PM:0));
>  
>  	return skb;
> -
> -
>  }
>  
> -
>  static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
>  {
>  	struct sk_buff *buf = ieee80211_assoc_resp(ieee, dest);
> @@ -1008,7 +918,6 @@ static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
>  	}
>  }
>  
> -
>  static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *dest)
>  {
>  	struct sk_buff *buf = ieee80211_auth_resp(ieee, s, dest);
> @@ -1019,10 +928,8 @@ static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *des
>  	}
>  }
>  
> -
>  static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
>  {
> -
>  	struct sk_buff *buf = ieee80211_probe_resp(ieee, dest);
>  
>  	if (buf) {
> @@ -1031,38 +938,24 @@ static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
>  	}
>  }
>  
> -
>  inline struct sk_buff *
>  ieee80211_association_req(struct ieee80211_network *beacon,
>  			  struct ieee80211_device *ieee)
>  {
>  	struct sk_buff *skb;
> -	//unsigned long flags;
>  
>  	struct ieee80211_assoc_request_frame *hdr;
>  	u8 *tag;
> -	//short info_addr = 0;
> -	//int i;
> -	//u16 suite_count = 0;
> -	//u8 suit_select = 0;
>  	unsigned int wpa_len = beacon->wpa_ie_len;
> -	//struct net_device *dev = ieee->dev;
> -	//union iwreq_data wrqu;
> -	//u8 *buff;
> -	//u8 *p;
>  #if 1
>  	// for testing purpose
>  	unsigned int rsn_len = beacon->rsn_ie_len;
> -#else
> -	unsigned int rsn_len = beacon->rsn_ie_len - 4;
>  #endif

Delete the #if 1 and #endif lines here.

>  	unsigned int rate_len = ieee80211_MFIE_rate_len(ieee);
>  	unsigned int wmm_info_len = beacon->QoS_Enable?9:0;
>  	unsigned int turbo_info_len = beacon->Turbo_Enable?9:0;
>  
>  	u8  encry_proto = ieee->wpax_type_notify & 0xff;
> -	//u8  pairwise_type = (ieee->wpax_type_notify >> 8) & 0xff;
> -	//u8  authen_type = (ieee->wpax_type_notify >> 16) & 0xff;
>  
>  	int len = 0;
>  
> @@ -1136,13 +1029,11 @@ ieee80211_association_req(struct ieee80211_network *beacon,
>  	if (turbo_info_len) {
>  		ieee80211_TURBO_Info(ieee, &tag);
>  	}
> -
>  	return skb;
>  }
>  
>  void ieee80211_associate_abort(struct ieee80211_device *ieee)
>  {
> -
>  	unsigned long flags;
>  	spin_lock_irqsave(&ieee->lock, flags);
>  
> @@ -1191,7 +1082,6 @@ static void ieee80211_associate_step1(struct ieee80211_device *ieee)
>  	else {
>  		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING;
>  		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
> -		//printk("---Sending authentication request\n");
>  		softmac_mgmt_xmit(skb, ieee);
>  		//BUGON when you try to add_timer twice, using mod_timer may be better, john0709
>  		if (!timer_pending(&ieee->associate_timer)) {
> @@ -1212,7 +1102,6 @@ static void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *chal
>  	u8 *c;
>  	struct sk_buff *skb;
>  	struct ieee80211_network *beacon = &ieee->current_network;
> -//	int hlen = sizeof(struct ieee80211_authentication);
>  	del_timer_sync(&ieee->associate_timer);
>  	ieee->associate_seq++;
>  	ieee->softmac_stats.tx_auth_rq++;
> @@ -1233,9 +1122,8 @@ static void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *chal
>  
>  		softmac_mgmt_xmit(skb, ieee);
>  		if (!timer_pending(&ieee->associate_timer)) {
> -		//printk("=========>add timer again, to crash\n");
> -		ieee->associate_timer.expires = jiffies + (HZ / 2);
> -		add_timer(&ieee->associate_timer);
> +			ieee->associate_timer.expires = jiffies + (HZ / 2);
> +			add_timer(&ieee->associate_timer);

Re-indent this in a separate patch.  You can use `git add -p` and edit
the hunk to only include the removed printk line, if you're having
trouble separating the work out.

>  		}
>  		dev_kfree_skb_any(skb);//edit by thomas
>  	}
> @@ -1260,7 +1148,6 @@ static void ieee80211_associate_step2(struct ieee80211_device *ieee)
>  		ieee->associate_timer.expires = jiffies + (HZ / 2);
>  		add_timer(&ieee->associate_timer);
>  		}
> -		//dev_kfree_skb_any(skb);//edit by thomas
>  	}
>  }
>  
> @@ -1287,12 +1174,8 @@ static void ieee80211_associate_complete_wq(struct work_struct *work)
>  
>  static void ieee80211_associate_complete(struct ieee80211_device *ieee)
>  {
> -	int i;
>  	del_timer_sync(&ieee->associate_timer);
>  
> -	for (i = 0; i < 6; i++) {
> -	  //ieee->seq_ctrl[i] = 0;
> -	}

You should mention in your commit message that you got rid of variables
used in unused lines of code.

>  	ieee->state = IEEE80211_LINKED;
>  	IEEE80211_DEBUG_MGMT("Successfully associated\n");
>  
> @@ -1338,14 +1221,13 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
>  	if ((ieee->iw_mode == IW_MODE_ADHOC) && !(net->capability & WLAN_CAPABILITY_IBSS))
>  		return;
>  
> -
>  	if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) {
>  		/* if the user specified the AP MAC, we need also the essid
>  		 * This could be obtained by beacons or, if the network does not
>  		 * broadcast it, it can be put manually.
>  		 */
> -		apset = ieee->wap_set;//(memcmp(ieee->current_network.bssid, zero,ETH_ALEN)!=0 );
> -		ssidset = ieee->ssid_set;//ieee->current_network.ssid[0] != '\0';
> +		apset = ieee->wap_set;
> +		ssidset = ieee->ssid_set;
>  		ssidbroad =  !(net->ssid_len == 0 || net->ssid[0] == '\0');
>  		apmatch = (memcmp(ieee->current_network.bssid, net->bssid,
>  				  ETH_ALEN) == 0);
> @@ -1356,9 +1238,6 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
>  			ssidmatch = (0 == strncmp(ieee->current_network.ssid,
>  						  net->ssid, net->ssid_len));
>  
> -		//printk("cur: %s, %d, net:%s, %d\n", ieee->current_network.ssid, ieee->current_network.ssid_len, net->ssid, net->ssid_len);
> -		//printk("apset=%d apmatch=%d ssidset=%d ssidbroad=%d ssidmatch=%d\n",apset,apmatch,ssidset,ssidbroad,ssidmatch);
> -
>  		/* if the user set the AP check if match.
>  		 * if the network does not broadcast essid we check the user
>  		 * supplied ANY essid
> @@ -1411,10 +1290,8 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
>  				ieee->state = IEEE80211_LINKED;
>  				ieee->beinretry = false;
>  			}
> -
>  		}
>  	}
> -
>  }
>  
>  void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee)
> @@ -1428,19 +1305,15 @@ void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee)
>  		/* if the state become different that NOLINK means
>  		 * we had found what we are searching for
>  		 */
> -
>  		if (ieee->state != IEEE80211_NOLINK)
>  			break;
>  
>  		if (ieee->scan_age == 0 || time_after(target->last_scanned + ieee->scan_age, jiffies))
>  			ieee80211_softmac_new_net(ieee, target);
>  	}
> -
>  	spin_unlock_irqrestore(&ieee->lock, flags);
> -
>  }
>  
> -
>  static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
>  {
>  	struct ieee80211_authentication *a;
> @@ -1465,7 +1338,6 @@ static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
>  	return cpu_to_le16(a->status);
>  }
>  
> -
>  static int auth_rq_parse(struct sk_buff *skb, u8 *dest)
>  {
>  	struct ieee80211_authentication *a;
> @@ -1516,7 +1388,6 @@ static short probe_rq_parse(struct ieee80211_device *ieee, struct sk_buff *skb,
>  		tag++; /* point to the next tag */
>  	}
>  
> -	//IEEE80211DMESG("Card MAC address is "MACSTR, MAC2STR(src));
>  	if (ssidlen == 0) return 1;
>  
>  	if (!ssid) return 1; /* ssid not found in tagged param */
> @@ -1560,11 +1431,8 @@ static inline void ieee80211_rx_probe_rq(struct ieee80211_device *ieee,
>  {
>  	u8 dest[ETH_ALEN];
>  
> -	//IEEE80211DMESG("Rx probe");
>  	ieee->softmac_stats.rx_probe_rq++;
> -	//DMESG("Dest is "MACSTR, MAC2STR(dest));
>  	if (probe_rq_parse(ieee, skb, dest)) {
> -		//IEEE80211DMESG("Was for me!");
>  		ieee->softmac_stats.tx_probe_rs++;
>  		ieee80211_resp_to_probe(ieee, dest);
>  	}
> @@ -1575,15 +1443,12 @@ inline void ieee80211_rx_auth_rq(struct ieee80211_device *ieee,
>  {
>  	u8 dest[ETH_ALEN];
>  	int status;
> -	//IEEE80211DMESG("Rx probe");
>  	ieee->softmac_stats.rx_auth_rq++;
>  
>  	status = auth_rq_parse(skb, dest);
>  	if (status != -1) {
>  		ieee80211_resp_to_auth(ieee, status, dest);
>  	}
> -	//DMESG("Dest is "MACSTR, MAC2STR(dest));
> -
>  }
>  
>  inline void
> @@ -1591,18 +1456,14 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
>  {
>  
>  	u8 dest[ETH_ALEN];
> -	//unsigned long flags;
>  
>  	ieee->softmac_stats.rx_ass_rq++;
>  	if (assoc_rq_parse(skb, dest) != -1) {
>  		ieee80211_resp_to_assoc_rq(ieee, dest);
>  	}
> -
>  	printk(KERN_INFO"New client associated: %pM\n", dest);
>  }
>  
> -
> -
>  void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr)
>  {
>  
> @@ -1610,31 +1471,21 @@ void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr)
>  
>  	if (buf)
>  		softmac_ps_mgmt_xmit(buf, ieee);
> -
>  }
>  
> -
>  static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h,
>  			     u32 *time_l)
>  {
>  	int timeout = 0;
>  
>  	u8 dtim;
> -	/*if(ieee->ps == IEEE80211_PS_DISABLED ||
> -		ieee->iw_mode != IW_MODE_INFRA ||
> -		ieee->state != IEEE80211_LINKED)
> -
> -		return 0;
> -	*/
>  	dtim = ieee->current_network.dtim_data;
> -	//printk("DTIM\n");
>  
>  	if (!(dtim & IEEE80211_DTIM_VALID))
>  		return 0;
>  	else
>  		timeout = ieee->current_network.beacon_interval;
>  
> -	//printk("VALID\n");
>  	ieee->current_network.dtim_data = IEEE80211_DTIM_INVALID;
>  
>  	if (dtim & ((IEEE80211_DTIM_UCAST | IEEE80211_DTIM_MBCAST) & ieee->ps))
> @@ -1650,25 +1501,20 @@ static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h,
>  		(ieee->mgmt_queue_tail != ieee->mgmt_queue_head))
>  		return 0;
>  
> -	if (time_l) {
> +	if (time_l)
>  		*time_l = ieee->current_network.last_dtim_sta_time[0]
>  			+ MSECS((ieee->current_network.beacon_interval));
> -			//* ieee->current_network.dtim_period));
> -			//printk("beacon_interval:%x, dtim_period:%x, totol to Msecs:%x, HZ:%x\n", ieee->current_network.beacon_interval, ieee->current_network.dtim_period, MSECS(((ieee->current_network.beacon_interval * ieee->current_network.dtim_period))), HZ);
> -	}
>  
>  	if (time_h) {
>  		*time_h = ieee->current_network.last_dtim_sta_time[1];
>  		if (time_l && *time_l < ieee->current_network.last_dtim_sta_time[0])
>  			*time_h += 1;
>  	}
> -
>  	return 1;
>  }
>  
>  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  {
> -
>  	u32 th, tl;
>  	short sleep;
>  
> @@ -1677,7 +1523,6 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  	spin_lock_irqsave(&ieee->lock, flags);
>  
>  	if ((ieee->ps == IEEE80211_PS_DISABLED ||
> -
>  		ieee->iw_mode != IW_MODE_INFRA ||
>  		ieee->state != IEEE80211_LINKED)){
>  
> @@ -1690,7 +1535,6 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  	}
>  
>  	sleep = ieee80211_sta_ps_sleep(ieee, &th, &tl);
> -//	printk("===>%s,%d[2 wake, 1 sleep, 0 do nothing], ieee->sta_sleep = %d\n",__func__, sleep,ieee->sta_sleep);
>  	/* 2 wake, 1 sleep, 0 do nothing */
>  	if (sleep == 0)
>  		goto out;
> @@ -1700,7 +1544,6 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  			ieee->enter_sleep_state(ieee->dev, th, tl);
>  
>  		else if (ieee->sta_sleep == 0) {
> -	//		printk("send null 1\n");
>  			spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
>  
>  			if (ieee->ps_is_queue_empty(ieee->dev)) {
> @@ -1716,7 +1559,6 @@ static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
>  //#warning CHECK_LOCK_HERE
>  		spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
>  
> -	//	printk("send wakeup packet\n");
>  		ieee80211_sta_wakeup(ieee, 1);
>  
>  		spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
> @@ -1729,12 +1571,10 @@ void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl)
>  {
>  	if (ieee->sta_sleep == 0) {
>  		if (nl) {
> -		//	printk("Warning: driver is probably failing to report TX ps error\n");
>  			ieee->ps_request_tx_ack(ieee->dev);
>  			ieee80211_sta_ps_send_null_frame(ieee, 0);
>  		}
>  		return;
> -
>  	}
>  
>  	if (ieee->sta_sleep == 1)
> @@ -1756,8 +1596,6 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success)
>  	if (ieee->sta_sleep == 2) {
>  		/* Null frame with PS bit set */
>  		if (success) {
> -
> -		//	printk("==================> %s::enter sleep state\n",__func__);
>  			ieee->sta_sleep = 1;
>  			ieee->enter_sleep_state(ieee->dev, ieee->ps_th,
>  						ieee->ps_tl);
> @@ -1805,10 +1643,8 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  		ieee->last_rx_ps_time = jiffies;
>  
>  	switch (WLAN_FC_GET_STYPE(header->frame_control)) {
> -
>  		case IEEE80211_STYPE_ASSOC_RESP:
>  		case IEEE80211_STYPE_REASSOC_RESP:
> -
>  			IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n",
>  					WLAN_FC_GET_STYPE(header->frame_ctl));
>  			if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
> @@ -1821,7 +1657,6 @@ inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
>  					ieee->assoc_id = aid;
>  					ieee->softmac_stats.rx_ass_ok++;
>  
> -					//printk(KERN_WARNING "nic_type = %s", (rx_stats->nic_type == 1)?"rtl8187":"rtl8187B");
>  					if (1 == rx_stats->nic_type) //card type is 8187
>  					{
>  						goto associate_complete;
> @@ -1887,18 +1722,14 @@ associate_complete:
>  				}
>  			}
>  			break;
> -
>  		case IEEE80211_STYPE_ASSOC_REQ:
>  		case IEEE80211_STYPE_REASSOC_REQ:
> -
>  			if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
>  				ieee->iw_mode == IW_MODE_MASTER)
>  
>  				ieee80211_rx_assoc_rq(ieee, skb);
>  			break;
> -
>  		case IEEE80211_STYPE_AUTH:
> -
>  			if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) {
>  				if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING &&
>  				ieee->iw_mode == IW_MODE_INFRA){
> @@ -1925,7 +1756,6 @@ associate_complete:
>  					}
>  				}
>  			break;
> -
>  		case IEEE80211_STYPE_PROBE_REQ:
>  
>  			if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
> @@ -1935,7 +1765,6 @@ associate_complete:
>  
>  				ieee80211_rx_probe_rq(ieee, skb);
>  			break;
> -
>  		case IEEE80211_STYPE_DISASSOC:
>  		case IEEE80211_STYPE_DEAUTH:
>  			/* FIXME for now repeat all the association procedure
> @@ -1948,23 +1777,17 @@ associate_complete:
>  				ieee->state = IEEE80211_ASSOCIATING;
>  				ieee->softmac_stats.reassoc++;
>  
> -				//notify_wx_assoc_event(ieee);  //YJ,del,080828, do not notify os here
>  				queue_work(ieee->wq, &ieee->associate_procedure_wq);
>  			}
>  
>  			break;
> -
>  		default:
>  			return -1;
>  			break;
>  	}
> -
> -	//dev_kfree_skb_any(skb);
>  	return 0;
>  }
>  
> -
> -
>  /* 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
> @@ -1987,8 +1810,6 @@ associate_complete:
>  void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
>  			    struct ieee80211_device *ieee)
>  {
> -
> -
>  	unsigned long flags;
>  	int  i;
>  
> @@ -2007,7 +1828,6 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
>  			ieee->softmac_data_hard_start_xmit(
>  				txb->fragments[i],
>  				ieee->dev, ieee->rate);
> -				//(i+1)<txb->nr_frags);
>  			ieee->stats.tx_packets++;
>  			ieee->stats.tx_bytes += txb->fragments[i]->len;
>  			ieee->dev->trans_start = jiffies;
> @@ -2035,18 +1855,14 @@ static void ieee80211_resume_tx(struct ieee80211_device *ieee)
>  			ieee->softmac_data_hard_start_xmit(
>  				ieee->tx_pending.txb->fragments[i],
>  				ieee->dev, ieee->rate);
> -				//(i+1)<ieee->tx_pending.txb->nr_frags);
>  			ieee->stats.tx_packets++;
>  			ieee->dev->trans_start = jiffies;
>  		}
>  	}
> -
> -
>  	ieee80211_txb_free(ieee->tx_pending.txb);
>  	ieee->tx_pending.txb = NULL;
>  }
>  
> -
>  void ieee80211_reset_queue(struct ieee80211_device *ieee)
>  {
>  	unsigned long flags;
> @@ -2059,12 +1875,10 @@ void ieee80211_reset_queue(struct ieee80211_device *ieee)
>  	}
>  	ieee->queue_stop = 0;
>  	spin_unlock_irqrestore(&ieee->lock, flags);
> -
>  }
>  
>  void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
>  {
> -
>  	unsigned long flags;
>  	struct sk_buff *skb;
>  	struct ieee80211_hdr_3addr *header;
> @@ -2076,7 +1890,6 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
>  
>  	if (ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE) {
>  		while (!ieee->queue_stop && (skb = dequeue_mgmt(ieee))) {
> -
>  			header = (struct ieee80211_hdr_3addr *) skb->data;
>  
>  			header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
> @@ -2086,7 +1899,6 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
>  			else
>  				ieee->seq_ctrl[0]++;
>  
> -			//printk(KERN_ALERT "ieee80211_wake_queue \n");
>  			ieee->softmac_data_hard_start_xmit(skb, ieee->dev,
>  							   ieee->basic_rate);
>  			dev_kfree_skb_any(skb);//edit by thomas
> @@ -2104,22 +1916,16 @@ exit:
>  	spin_unlock_irqrestore(&ieee->lock, flags);
>  }
>  
> -
>  void ieee80211_rtl_stop_queue(struct ieee80211_device *ieee)
>  {
> -	//unsigned long flags;
> -	//spin_lock_irqsave(&ieee->lock,flags);
>  
>  	if (!netif_queue_stopped(ieee->dev)) {
>  		netif_stop_queue(ieee->dev);
>  		ieee->softmac_stats.swtxstop++;
>  	}
>  	ieee->queue_stop = 1;
> -	//spin_unlock_irqrestore(&ieee->lock,flags);
> -
>  }
>  
> -
>  inline void ieee80211_randomize_cell(struct ieee80211_device *ieee)
>  {
>  
> @@ -2156,7 +1962,6 @@ void ieee80211_start_master_bss(struct ieee80211_device *ieee)
>  static void ieee80211_start_monitor_mode(struct ieee80211_device *ieee)
>  {
>  	if (ieee->raw_tx) {
> -
>  		if (ieee->data_hard_resume)
>  			ieee->data_hard_resume(ieee->dev);
>  
> @@ -2179,7 +1984,6 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
>  
>  	down(&ieee->wx_sem);
>  
> -
>  	if (ieee->current_network.ssid_len == 0) {
>  		strcpy(ieee->current_network.ssid, IEEE80211_DEFAULT_TX_ESSID);
>  		ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID);
> @@ -2215,14 +2019,12 @@ static void ieee80211_start_ibss_wq(struct work_struct *work)
>  			ieee80211_randomize_cell(ieee);
>  
>  		if (ieee->modulation & IEEE80211_CCK_MODULATION) {
> -
>  			ieee->current_network.rates_len = 4;
>  
>  			ieee->current_network.rates[0] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB;
>  			ieee->current_network.rates[1] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB;
>  			ieee->current_network.rates[2] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB;
>  			ieee->current_network.rates[3] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB;
> -
>  		} else
>  			ieee->current_network.rates_len = 0;
>  
> @@ -2306,14 +2108,10 @@ void ieee80211_start_bss(struct ieee80211_device *ieee)
>  	 */
>  	spin_lock_irqsave(&ieee->lock, flags);
>  
> -//#ifdef ENABLE_IPS
> -//	printk("start bss ENABLE_IPS\n");
> -//#else
>  	if (ieee->state == IEEE80211_NOLINK) {
>  		ieee->actscanning = true;
>  		ieee80211_rtl_start_scan(ieee);
>  	}
> -//#endif
>  	spin_unlock_irqrestore(&ieee->lock, flags);
>  }
>  
> @@ -2398,7 +2196,6 @@ struct sk_buff *ieee80211_get_beacon_(struct ieee80211_device *ieee)
>  	b->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_BEACON);
>  
>  	return skb;
> -
>  }
>  
>  struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee)
> @@ -2429,7 +2226,6 @@ void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee)
>  	up(&ieee->wx_sem);
>  }
>  
> -
>  void ieee80211_stop_protocol(struct ieee80211_device *ieee)
>  {
>  	if (!ieee->proto_started)
> @@ -2492,7 +2288,6 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
>  
>  	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
>  	 * attempts does not fail just because the user provide the essid
> @@ -2505,19 +2300,15 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
>  		case IW_MODE_INFRA:
>  			ieee80211_start_bss(ieee);
>  			break;
> -
>  		case IW_MODE_ADHOC:
>  			ieee80211_start_ibss(ieee);
>  			break;
> -
>  		case IW_MODE_MASTER:
>  			ieee80211_start_master_bss(ieee);
>  		break;
> -
>  		case IW_MODE_MONITOR:
>  			ieee80211_start_monitor_mode(ieee);
>  			break;
> -
>  		default:
>  			ieee->iw_mode = IW_MODE_INFRA;
>  			ieee80211_start_bss(ieee);
> @@ -2525,7 +2316,6 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
>  	}
>  }
>  
> -
>  #define DRV_NAME  "Ieee80211"
>  void ieee80211_softmac_init(struct ieee80211_device *ieee)
>  {
> @@ -2547,11 +2337,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
>  	ieee->proto_started = 0;
>  	ieee->basic_rate = IEEE80211_DEFAULT_BASIC_RATE;
>  	ieee->rate = 3;
> -//#ifdef ENABLE_LPS
>  	ieee->ps = IEEE80211_PS_MBCAST|IEEE80211_PS_UNICAST;
> -//#else
> -//	ieee->ps = IEEE80211_PS_DISABLED;
> -//#endif
>  	ieee->sta_sleep = 0;
>  //by amy
>  	ieee->bInactivePs = false;
> @@ -2585,7 +2371,6 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
>  	INIT_DELAYED_WORK(&ieee->softmac_scan_wq, (void*) ieee80211_softmac_scan_wq);
>  	INIT_DELAYED_WORK(&ieee->associate_retry_wq, (void*) ieee80211_associate_retry_wq);
>  	INIT_WORK(&ieee->wx_sync_scan_wq, (void*) ieee80211_wx_sync_scan_wq);
> -//	INIT_WORK(&ieee->watch_dog_wq,(void*) ieee80211_watch_dog_wq);
>  
>  	sema_init(&ieee->wx_sem, 1);
>  	sema_init(&ieee->scan_sem, 1);
> @@ -2698,7 +2483,6 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
>  
>  static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value)
>  {
> -
>  	struct ieee80211_security sec = {
>  		.flags = SEC_AUTH_MODE,
>  	};
> @@ -2730,11 +2514,9 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
>  	case IEEE_PARAM_WPA_ENABLED:
>  		ret = ieee80211_wpa_enable(ieee, value);
>  		break;
> -
>  	case IEEE_PARAM_TKIP_COUNTERMEASURES:
>  		ieee->tkip_countermeasures = value;
>  		break;
> -
>  	case IEEE_PARAM_DROP_UNENCRYPTED: {
>  		/* HACK:
>  		 *
> @@ -2767,27 +2549,22 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
>  			ieee->set_security(ieee->dev, &sec);
>  		break;
>  	}
> -
>  	case IEEE_PARAM_PRIVACY_INVOKED:
>  		ieee->privacy_invoked = value;
>  		break;
> -
>  	case IEEE_PARAM_AUTH_ALGS:
>  		ret = ieee80211_wpa_set_auth_algs(ieee, value);
>  		break;
> -
>  	case IEEE_PARAM_IEEE_802_1X:
>  		ieee->ieee802_1x = value;
>  		break;
>  	case IEEE_PARAM_WPAX_SELECT:
>  		// added for WPA2 mixed mode
> -		//printk(KERN_WARNING "------------------------>wpax value = %x\n", value);
>  		spin_lock_irqsave(&ieee->wpax_suitlist_lock, flags);
>  		ieee->wpax_type_set = 1;
>  		ieee->wpax_type_notify = value;
>  		spin_unlock_irqrestore(&ieee->wpax_suitlist_lock, flags);
>  		break;
> -
>  	default:
>  		printk("Unknown WPA param: %d\n", name);
>  		ret = -EOPNOTSUPP;
> @@ -2942,7 +2719,6 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
>  		param->u.crypt.err = IEEE_CRYPT_ERR_CARD_CONF_FAILED;
>  		return -EINVAL;
>  	}
> -
>  	return ret;
>  }
>  
> @@ -2953,7 +2729,6 @@ int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee,
>  	int ret = 0;
>  
>  	down(&ieee->wx_sem);
> -	//IEEE_DEBUG_INFO("wpa_supplicant: len=%d\n", p->length);
>  
>  	if (p->length < sizeof(struct ieee_param) || !p->pointer) {
>  		ret = -EINVAL;
> @@ -2972,20 +2747,16 @@ int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee,
>  		ret = ieee80211_wpa_set_param(ieee, param->u.wpa_param.name,
>  					param->u.wpa_param.value);
>  		break;
> -
>  	case IEEE_CMD_SET_WPA_IE:
>  		ret = ieee80211_wpa_set_wpa_ie(ieee, param, p->length);
>  		break;
> -
>  	case IEEE_CMD_SET_ENCRYPTION:
>  		ret = ieee80211_wpa_set_encryption(ieee, param, p->length);
>  		break;
> -
>  	case IEEE_CMD_MLME:
>  		ret = ieee80211_wpa_mlme(ieee, param->u.mlme.command,
>  				   param->u.mlme.reason_code);
>  		break;
> -
>  	default:
>  		printk("Unknown WPA supplicant request: %d\n", param->cmd);
>  		ret = -EOPNOTSUPP;
> -- 
> 1.8.5.3
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Patch
diff mbox

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index 3d33b7e..15017ff 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -13,7 +13,6 @@ 
  * released under the GPL
  */
 
-
 #include "ieee80211.h"
 
 #include <linux/random.h>
@@ -77,7 +76,6 @@  static void ieee80211_MFIE_Brate(struct ieee80211_device *ieee, u8 **tag_p)
 		*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB;
 		*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB;
 	}
-
 	/* We may add an option for custom rates that specific HW might support */
 	*tag_p = tag;
 }
@@ -100,7 +98,6 @@  static void ieee80211_MFIE_Grate(struct ieee80211_device *ieee, u8 **tag_p)
 		*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB;
 
 	}
-
 	/* We may add an option for custom rates that specific HW might support */
 	*tag_p = tag;
 }
@@ -150,17 +147,8 @@  static void enqueue_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb)
 	int nh;
 	nh = (ieee->mgmt_queue_head + 1) % MGMT_QUEUE_NUM;
 
-/*
- * if the queue is full but we have newer frames then
- * just overwrites the oldest.
- *
- * if (nh == ieee->mgmt_queue_tail)
- *		return -1;
- */
 	ieee->mgmt_queue_head = nh;
 	ieee->mgmt_queue_ring[nh] = skb;
-
-	//return 0;
 }
 
 static struct sk_buff *dequeue_mgmt(struct ieee80211_device *ieee)
@@ -194,7 +182,6 @@  inline void softmac_mgmt_xmit(struct sk_buff *skb,
 	struct ieee80211_hdr_3addr  *header =
 		(struct ieee80211_hdr_3addr  *) skb->data;
 
-
 	spin_lock_irqsave(&ieee->lock, flags);
 
 	/* called with 2nd param 0, no mgmt lock required */
@@ -238,16 +225,13 @@  inline void softmac_mgmt_xmit(struct sk_buff *skb,
 	}
 }
 
-
 inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
 				 struct ieee80211_device *ieee)
 {
-
 	short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
 	struct ieee80211_hdr_3addr  *header =
 		(struct ieee80211_hdr_3addr  *) skb->data;
 
-
 	if (single) {
 
 		header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -261,7 +245,6 @@  inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
 		ieee->dev->trans_start = jiffies;
 		ieee->softmac_data_hard_start_xmit(skb, ieee->dev,
 						   ieee->basic_rate);
-
 	} else {
 
 		header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -274,9 +257,7 @@  inline void softmac_ps_mgmt_xmit(struct sk_buff *skb,
 		/* avoid watchdog triggers */
 		ieee->dev->trans_start = jiffies;
 		ieee->softmac_hard_start_xmit(skb, ieee->dev);
-
 	}
-//	dev_kfree_skb_any(skb);//edit by thomas
 }
 //by amy for power save
 inline struct sk_buff *
@@ -307,10 +288,8 @@  void SendDisassociation(struct ieee80211_device *ieee, u8 *asSta, u8 asRsn)
 	struct ieee80211_network *beacon = &ieee->current_network;
 	struct sk_buff *skb;
 	skb = ieee80211_disassociate_skb(beacon, ieee, asRsn);
-	if (skb) {
+	if (skb)
 		softmac_mgmt_xmit(skb, ieee);
-		//dev_kfree_skb_any(skb);//edit by thomas
-	}
 }
 
 //by amy for power save
@@ -357,8 +336,6 @@  void ext_ieee80211_send_beacon_wq(struct ieee80211_device *ieee)
 {
 	struct sk_buff *skb;
 
-	//unsigned long flags;
-
 	skb = ieee80211_get_beacon_(ieee);
 
 	if (skb) {
@@ -367,23 +344,17 @@  void ext_ieee80211_send_beacon_wq(struct ieee80211_device *ieee)
 		dev_kfree_skb_any(skb);//edit by thomas
 	}
 
-
-	//printk(KERN_WARNING "[1] beacon sending!\n");
 	ieee->beacon_timer.expires = jiffies +
 		(MSECS(ieee->current_network.beacon_interval - 5));
 
-	//spin_lock_irqsave(&ieee->beacon_lock,flags);
 	if (ieee->beacon_txing)
 		add_timer(&ieee->beacon_timer);
-	//spin_unlock_irqrestore(&ieee->beacon_lock,flags);
 }
 
 static void ieee80211_send_beacon(struct ieee80211_device *ieee)
 {
 	struct sk_buff *skb;
 
-	//unsigned long flags;
-
 	skb = ieee80211_get_beacon_(ieee);
 
 	if (skb) {
@@ -392,17 +363,13 @@  static void ieee80211_send_beacon(struct ieee80211_device *ieee)
 		dev_kfree_skb_any(skb);//edit by thomas
 	}
 
-	//printk(KERN_WARNING "[1] beacon sending!\n");
 	ieee->beacon_timer.expires = jiffies +
 		(MSECS(ieee->current_network.beacon_interval - 5));
 
-	//spin_lock_irqsave(&ieee->beacon_lock,flags);
 	if (ieee->beacon_txing)
 		add_timer(&ieee->beacon_timer);
-	//spin_unlock_irqrestore(&ieee->beacon_lock,flags);
 }
 
-
 static void ieee80211_send_beacon_cb(unsigned long _ieee)
 {
 	struct ieee80211_device *ieee =
@@ -422,7 +389,6 @@  static void ieee80211_send_probe(struct ieee80211_device *ieee)
 	if (skb) {
 		softmac_mgmt_xmit(skb, ieee);
 		ieee->softmac_stats.tx_probe_rq++;
-		//dev_kfree_skb_any(skb);//edit by thomas
 	}
 }
 
@@ -443,16 +409,13 @@  static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
 	u8 channel_map[MAX_CHANNEL_NUMBER+1];
 	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
 	down(&ieee->scan_sem);
-//	printk("==================> Sync scan\n");
 
 	while (1)
 	{
-
 		do {
 			ch++;
 			if (ch > MAX_CHANNEL_NUMBER)
 				goto out; /* scan completed */
-
 		} while (!channel_map[ch]);
 		/* this function can be called in two situations
 		 * 1- We have switched to ad-hoc mode and we are
@@ -477,10 +440,8 @@  static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
 			goto out;
 
 		ieee->set_chan(ieee->dev, ch);
-//		printk("=====>channel=%d   ",ch);
 		if (channel_map[ch] == 1)
 		{
-//			printk("====send probe request\n");
 			ieee80211_send_probe_requests(ieee);
 		}
 		/* this prevent excessive time wait when we
@@ -489,9 +450,7 @@  static void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
 		if (ieee->sync_scan_hurryup)
 			goto out;
 
-
 		msleep_interruptible_rtl(IEEE80211_SOFTMAC_SCAN_TIME);
-
 	}
 out:
 	ieee->sync_scan_hurryup = 0;
@@ -508,13 +467,6 @@  void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
 	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
 	down(&ieee->scan_sem);
 	ch = ieee->current_network.channel;
-//		if(ieee->sync_scan_hurryup)
-//	{
-
-//		printk("stop scan sync\n");
-//		goto out;
-//	}
-//	printk("=======hh===============>ips scan\n");
 	while (1)
 	{
                 /* this function can be called in two situations
@@ -540,35 +492,21 @@  void ieee80211_softmac_ips_scan_syncro(struct ieee80211_device *ieee)
 			goto out;
 		}
 		if (channel_map[ieee->current_network.channel] > 0)
-		{
 			ieee->set_chan(ieee->dev, ieee->current_network.channel);
-//			printk("======>channel=%d  ",ieee->current_network.channel);
-		}
+
 		if (channel_map[ieee->current_network.channel] == 1)
-		{
-//			printk("====send probe request\n");
 			ieee80211_send_probe_requests(ieee);
-		}
-		/* this prevent excessive time wait when we
-                 * need to wait for a syncro scan to end..
-                 */
-//                if (ieee->sync_scan_hurryup)
-//                        goto out;
 
 		msleep_interruptible_rtl(IEEE80211_SOFTMAC_SCAN_TIME);
 
 		do {
 			if (watch_dog++ >= MAX_CHANNEL_NUMBER)
-		//	if (++watch_dog >= 15);//MAX_CHANNEL_NUMBER)  //YJ,modified,080630
 				goto out; /* scan completed */
 
 			ieee->current_network.channel = (ieee->current_network.channel + 1)%MAX_CHANNEL_NUMBER;
 		} while (!channel_map[ieee->current_network.channel]);
 	}
 out:
-	//ieee->sync_scan_hurryup = 0;
-	//ieee->set_chan(ieee->dev, ch);
-	//ieee->current_network.channel = ch;
 	ieee->actscanning = false;
 	up(&ieee->scan_sem);
 	if (IS_DOT11D_ENABLE(ieee))
@@ -582,8 +520,6 @@  static void ieee80211_softmac_scan_wq(struct work_struct *work)
 	static short watchdog = 0;
 	u8 channel_map[MAX_CHANNEL_NUMBER+1];
 	memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
-//	printk("ieee80211_softmac_scan_wq ENABLE_IPS\n");
-//	printk("in %s\n",__func__);
 	down(&ieee->scan_sem);
 
 	do {
@@ -591,10 +527,8 @@  static void ieee80211_softmac_scan_wq(struct work_struct *work)
 			(ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER;
 		if (watchdog++ > MAX_CHANNEL_NUMBER)
 				goto out; /* no good chans */
-
 	} while (!channel_map[ieee->current_network.channel]);
 
-	//printk("current_network.channel:%d\n", ieee->current_network.channel);
 	if (ieee->scanning == 0)
 	{
 		printk("error out, scanning = 0\n");
@@ -640,10 +574,8 @@  static void ieee80211_beacons_stop(struct ieee80211_device *ieee)
 	del_timer_sync(&ieee->beacon_timer);
 
 	spin_unlock_irqrestore(&ieee->beacon_lock, flags);
-
 }
 
-
 void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
 {
 	if (ieee->stop_send_beacons)
@@ -652,7 +584,6 @@  void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
 		ieee80211_beacons_stop(ieee);
 }
 
-
 void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
 {
 	if (ieee->start_send_beacons)
@@ -661,23 +592,16 @@  void ieee80211_start_send_beacons(struct ieee80211_device *ieee)
 		ieee80211_beacons_start(ieee);
 }
 
-
 static void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee)
 {
-//	unsigned long flags;
-
-	//ieee->sync_scan_hurryup = 1;
 
 	down(&ieee->scan_sem);
-//	spin_lock_irqsave(&ieee->lock, flags);
 
 	if (ieee->scanning == 1) {
 		ieee->scanning = 0;
-		//del_timer_sync(&ieee->scan_timer);
 		cancel_delayed_work(&ieee->softmac_scan_wq);
 	}
 
-//	spin_unlock_irqrestore(&ieee->lock, flags);
 	up(&ieee->scan_sem);
 }
 
@@ -703,16 +627,12 @@  void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
 		if (ieee->scanning == 0)
 		{
 			ieee->scanning = 1;
-			//ieee80211_softmac_scan(ieee);
-		//	queue_work(ieee->wq, &ieee->softmac_scan_wq);
-		//care this,1203,2007,by lawrence
 #if 1
 			queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0);
 #endif
 		}
 	} else
 		ieee->start_scan(ieee->dev);
-
 }
 
 /* called with wx_sem held */
@@ -731,7 +651,6 @@  void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
 		ieee80211_softmac_scan_syncro(ieee);
 	else
 		ieee->scan_syncro(ieee->dev);
-
 }
 
 inline struct sk_buff *
@@ -765,7 +684,6 @@  ieee80211_authentication_req(struct ieee80211_network *beacon,
 	auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS);
 
 	return skb;
-
 }
 
 static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
@@ -834,7 +752,6 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
 	if (encrypt)
 		beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY);
 
-
 	beacon_buf->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_PROBE_RESP);
 
 	beacon_buf->info_element.id = MFIE_TYPE_SSID;
@@ -884,7 +801,6 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee,
 
 		memcpy(tag, ieee->wpa_ie, ieee->wpa_ie_len);
 	}
-
 	skb->dev = ieee->dev;
 	return skb;
 }
@@ -917,7 +833,6 @@  static struct sk_buff *ieee80211_assoc_resp(struct ieee80211_device *ieee,
 	assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ?
 		WLAN_CAPABILITY_BSS : WLAN_CAPABILITY_IBSS);
 
-
 	if (ieee->short_slot)
 		assoc->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
 
@@ -967,8 +882,6 @@  static struct sk_buff *ieee80211_auth_resp(struct ieee80211_device *ieee,
 	memcpy(auth->header.addr1, dest, ETH_ALEN);
 	auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 	return skb;
-
-
 }
 
 static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short pwr)
@@ -993,11 +906,8 @@  static struct sk_buff *ieee80211_null_func(struct ieee80211_device *ieee, short
 		(pwr ? IEEE80211_FCTL_PM:0));
 
 	return skb;
-
-
 }
 
-
 static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
 {
 	struct sk_buff *buf = ieee80211_assoc_resp(ieee, dest);
@@ -1008,7 +918,6 @@  static void ieee80211_resp_to_assoc_rq(struct ieee80211_device *ieee, u8 *dest)
 	}
 }
 
-
 static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *dest)
 {
 	struct sk_buff *buf = ieee80211_auth_resp(ieee, s, dest);
@@ -1019,10 +928,8 @@  static void ieee80211_resp_to_auth(struct ieee80211_device *ieee, int s, u8 *des
 	}
 }
 
-
 static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
 {
-
 	struct sk_buff *buf = ieee80211_probe_resp(ieee, dest);
 
 	if (buf) {
@@ -1031,38 +938,24 @@  static void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest)
 	}
 }
 
-
 inline struct sk_buff *
 ieee80211_association_req(struct ieee80211_network *beacon,
 			  struct ieee80211_device *ieee)
 {
 	struct sk_buff *skb;
-	//unsigned long flags;
 
 	struct ieee80211_assoc_request_frame *hdr;
 	u8 *tag;
-	//short info_addr = 0;
-	//int i;
-	//u16 suite_count = 0;
-	//u8 suit_select = 0;
 	unsigned int wpa_len = beacon->wpa_ie_len;
-	//struct net_device *dev = ieee->dev;
-	//union iwreq_data wrqu;
-	//u8 *buff;
-	//u8 *p;
 #if 1
 	// for testing purpose
 	unsigned int rsn_len = beacon->rsn_ie_len;
-#else
-	unsigned int rsn_len = beacon->rsn_ie_len - 4;
 #endif
 	unsigned int rate_len = ieee80211_MFIE_rate_len(ieee);
 	unsigned int wmm_info_len = beacon->QoS_Enable?9:0;
 	unsigned int turbo_info_len = beacon->Turbo_Enable?9:0;
 
 	u8  encry_proto = ieee->wpax_type_notify & 0xff;
-	//u8  pairwise_type = (ieee->wpax_type_notify >> 8) & 0xff;
-	//u8  authen_type = (ieee->wpax_type_notify >> 16) & 0xff;
 
 	int len = 0;
 
@@ -1136,13 +1029,11 @@  ieee80211_association_req(struct ieee80211_network *beacon,
 	if (turbo_info_len) {
 		ieee80211_TURBO_Info(ieee, &tag);
 	}
-
 	return skb;
 }
 
 void ieee80211_associate_abort(struct ieee80211_device *ieee)
 {
-
 	unsigned long flags;
 	spin_lock_irqsave(&ieee->lock, flags);
 
@@ -1191,7 +1082,6 @@  static void ieee80211_associate_step1(struct ieee80211_device *ieee)
 	else {
 		ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATING;
 		IEEE80211_DEBUG_MGMT("Sending authentication request\n");
-		//printk("---Sending authentication request\n");
 		softmac_mgmt_xmit(skb, ieee);
 		//BUGON when you try to add_timer twice, using mod_timer may be better, john0709
 		if (!timer_pending(&ieee->associate_timer)) {
@@ -1212,7 +1102,6 @@  static void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *chal
 	u8 *c;
 	struct sk_buff *skb;
 	struct ieee80211_network *beacon = &ieee->current_network;
-//	int hlen = sizeof(struct ieee80211_authentication);
 	del_timer_sync(&ieee->associate_timer);
 	ieee->associate_seq++;
 	ieee->softmac_stats.tx_auth_rq++;
@@ -1233,9 +1122,8 @@  static void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *chal
 
 		softmac_mgmt_xmit(skb, ieee);
 		if (!timer_pending(&ieee->associate_timer)) {
-		//printk("=========>add timer again, to crash\n");
-		ieee->associate_timer.expires = jiffies + (HZ / 2);
-		add_timer(&ieee->associate_timer);
+			ieee->associate_timer.expires = jiffies + (HZ / 2);
+			add_timer(&ieee->associate_timer);
 		}
 		dev_kfree_skb_any(skb);//edit by thomas
 	}
@@ -1260,7 +1148,6 @@  static void ieee80211_associate_step2(struct ieee80211_device *ieee)
 		ieee->associate_timer.expires = jiffies + (HZ / 2);
 		add_timer(&ieee->associate_timer);
 		}
-		//dev_kfree_skb_any(skb);//edit by thomas
 	}
 }
 
@@ -1287,12 +1174,8 @@  static void ieee80211_associate_complete_wq(struct work_struct *work)
 
 static void ieee80211_associate_complete(struct ieee80211_device *ieee)
 {
-	int i;
 	del_timer_sync(&ieee->associate_timer);
 
-	for (i = 0; i < 6; i++) {
-	  //ieee->seq_ctrl[i] = 0;
-	}
 	ieee->state = IEEE80211_LINKED;
 	IEEE80211_DEBUG_MGMT("Successfully associated\n");
 
@@ -1338,14 +1221,13 @@  inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
 	if ((ieee->iw_mode == IW_MODE_ADHOC) && !(net->capability & WLAN_CAPABILITY_IBSS))
 		return;
 
-
 	if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) {
 		/* if the user specified the AP MAC, we need also the essid
 		 * This could be obtained by beacons or, if the network does not
 		 * broadcast it, it can be put manually.
 		 */
-		apset = ieee->wap_set;//(memcmp(ieee->current_network.bssid, zero,ETH_ALEN)!=0 );
-		ssidset = ieee->ssid_set;//ieee->current_network.ssid[0] != '\0';
+		apset = ieee->wap_set;
+		ssidset = ieee->ssid_set;
 		ssidbroad =  !(net->ssid_len == 0 || net->ssid[0] == '\0');
 		apmatch = (memcmp(ieee->current_network.bssid, net->bssid,
 				  ETH_ALEN) == 0);
@@ -1356,9 +1238,6 @@  inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
 			ssidmatch = (0 == strncmp(ieee->current_network.ssid,
 						  net->ssid, net->ssid_len));
 
-		//printk("cur: %s, %d, net:%s, %d\n", ieee->current_network.ssid, ieee->current_network.ssid_len, net->ssid, net->ssid_len);
-		//printk("apset=%d apmatch=%d ssidset=%d ssidbroad=%d ssidmatch=%d\n",apset,apmatch,ssidset,ssidbroad,ssidmatch);
-
 		/* if the user set the AP check if match.
 		 * if the network does not broadcast essid we check the user
 		 * supplied ANY essid
@@ -1411,10 +1290,8 @@  inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee,
 				ieee->state = IEEE80211_LINKED;
 				ieee->beinretry = false;
 			}
-
 		}
 	}
-
 }
 
 void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee)
@@ -1428,19 +1305,15 @@  void ieee80211_softmac_check_all_nets(struct ieee80211_device *ieee)
 		/* if the state become different that NOLINK means
 		 * we had found what we are searching for
 		 */
-
 		if (ieee->state != IEEE80211_NOLINK)
 			break;
 
 		if (ieee->scan_age == 0 || time_after(target->last_scanned + ieee->scan_age, jiffies))
 			ieee80211_softmac_new_net(ieee, target);
 	}
-
 	spin_unlock_irqrestore(&ieee->lock, flags);
-
 }
 
-
 static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
 {
 	struct ieee80211_authentication *a;
@@ -1465,7 +1338,6 @@  static inline u16 auth_parse(struct sk_buff *skb, u8 **challenge, int *chlen)
 	return cpu_to_le16(a->status);
 }
 
-
 static int auth_rq_parse(struct sk_buff *skb, u8 *dest)
 {
 	struct ieee80211_authentication *a;
@@ -1516,7 +1388,6 @@  static short probe_rq_parse(struct ieee80211_device *ieee, struct sk_buff *skb,
 		tag++; /* point to the next tag */
 	}
 
-	//IEEE80211DMESG("Card MAC address is "MACSTR, MAC2STR(src));
 	if (ssidlen == 0) return 1;
 
 	if (!ssid) return 1; /* ssid not found in tagged param */
@@ -1560,11 +1431,8 @@  static inline void ieee80211_rx_probe_rq(struct ieee80211_device *ieee,
 {
 	u8 dest[ETH_ALEN];
 
-	//IEEE80211DMESG("Rx probe");
 	ieee->softmac_stats.rx_probe_rq++;
-	//DMESG("Dest is "MACSTR, MAC2STR(dest));
 	if (probe_rq_parse(ieee, skb, dest)) {
-		//IEEE80211DMESG("Was for me!");
 		ieee->softmac_stats.tx_probe_rs++;
 		ieee80211_resp_to_probe(ieee, dest);
 	}
@@ -1575,15 +1443,12 @@  inline void ieee80211_rx_auth_rq(struct ieee80211_device *ieee,
 {
 	u8 dest[ETH_ALEN];
 	int status;
-	//IEEE80211DMESG("Rx probe");
 	ieee->softmac_stats.rx_auth_rq++;
 
 	status = auth_rq_parse(skb, dest);
 	if (status != -1) {
 		ieee80211_resp_to_auth(ieee, status, dest);
 	}
-	//DMESG("Dest is "MACSTR, MAC2STR(dest));
-
 }
 
 inline void
@@ -1591,18 +1456,14 @@  ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb)
 {
 
 	u8 dest[ETH_ALEN];
-	//unsigned long flags;
 
 	ieee->softmac_stats.rx_ass_rq++;
 	if (assoc_rq_parse(skb, dest) != -1) {
 		ieee80211_resp_to_assoc_rq(ieee, dest);
 	}
-
 	printk(KERN_INFO"New client associated: %pM\n", dest);
 }
 
-
-
 void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr)
 {
 
@@ -1610,31 +1471,21 @@  void ieee80211_sta_ps_send_null_frame(struct ieee80211_device *ieee, short pwr)
 
 	if (buf)
 		softmac_ps_mgmt_xmit(buf, ieee);
-
 }
 
-
 static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h,
 			     u32 *time_l)
 {
 	int timeout = 0;
 
 	u8 dtim;
-	/*if(ieee->ps == IEEE80211_PS_DISABLED ||
-		ieee->iw_mode != IW_MODE_INFRA ||
-		ieee->state != IEEE80211_LINKED)
-
-		return 0;
-	*/
 	dtim = ieee->current_network.dtim_data;
-	//printk("DTIM\n");
 
 	if (!(dtim & IEEE80211_DTIM_VALID))
 		return 0;
 	else
 		timeout = ieee->current_network.beacon_interval;
 
-	//printk("VALID\n");
 	ieee->current_network.dtim_data = IEEE80211_DTIM_INVALID;
 
 	if (dtim & ((IEEE80211_DTIM_UCAST | IEEE80211_DTIM_MBCAST) & ieee->ps))
@@ -1650,25 +1501,20 @@  static short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h,
 		(ieee->mgmt_queue_tail != ieee->mgmt_queue_head))
 		return 0;
 
-	if (time_l) {
+	if (time_l)
 		*time_l = ieee->current_network.last_dtim_sta_time[0]
 			+ MSECS((ieee->current_network.beacon_interval));
-			//* ieee->current_network.dtim_period));
-			//printk("beacon_interval:%x, dtim_period:%x, totol to Msecs:%x, HZ:%x\n", ieee->current_network.beacon_interval, ieee->current_network.dtim_period, MSECS(((ieee->current_network.beacon_interval * ieee->current_network.dtim_period))), HZ);
-	}
 
 	if (time_h) {
 		*time_h = ieee->current_network.last_dtim_sta_time[1];
 		if (time_l && *time_l < ieee->current_network.last_dtim_sta_time[0])
 			*time_h += 1;
 	}
-
 	return 1;
 }
 
 static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 {
-
 	u32 th, tl;
 	short sleep;
 
@@ -1677,7 +1523,6 @@  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 	spin_lock_irqsave(&ieee->lock, flags);
 
 	if ((ieee->ps == IEEE80211_PS_DISABLED ||
-
 		ieee->iw_mode != IW_MODE_INFRA ||
 		ieee->state != IEEE80211_LINKED)){
 
@@ -1690,7 +1535,6 @@  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 	}
 
 	sleep = ieee80211_sta_ps_sleep(ieee, &th, &tl);
-//	printk("===>%s,%d[2 wake, 1 sleep, 0 do nothing], ieee->sta_sleep = %d\n",__func__, sleep,ieee->sta_sleep);
 	/* 2 wake, 1 sleep, 0 do nothing */
 	if (sleep == 0)
 		goto out;
@@ -1700,7 +1544,6 @@  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 			ieee->enter_sleep_state(ieee->dev, th, tl);
 
 		else if (ieee->sta_sleep == 0) {
-	//		printk("send null 1\n");
 			spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
 
 			if (ieee->ps_is_queue_empty(ieee->dev)) {
@@ -1716,7 +1559,6 @@  static inline void ieee80211_sta_ps(struct ieee80211_device *ieee)
 //#warning CHECK_LOCK_HERE
 		spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2);
 
-	//	printk("send wakeup packet\n");
 		ieee80211_sta_wakeup(ieee, 1);
 
 		spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2);
@@ -1729,12 +1571,10 @@  void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl)
 {
 	if (ieee->sta_sleep == 0) {
 		if (nl) {
-		//	printk("Warning: driver is probably failing to report TX ps error\n");
 			ieee->ps_request_tx_ack(ieee->dev);
 			ieee80211_sta_ps_send_null_frame(ieee, 0);
 		}
 		return;
-
 	}
 
 	if (ieee->sta_sleep == 1)
@@ -1756,8 +1596,6 @@  void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, short success)
 	if (ieee->sta_sleep == 2) {
 		/* Null frame with PS bit set */
 		if (success) {
-
-		//	printk("==================> %s::enter sleep state\n",__func__);
 			ieee->sta_sleep = 1;
 			ieee->enter_sleep_state(ieee->dev, ieee->ps_th,
 						ieee->ps_tl);
@@ -1805,10 +1643,8 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 		ieee->last_rx_ps_time = jiffies;
 
 	switch (WLAN_FC_GET_STYPE(header->frame_control)) {
-
 		case IEEE80211_STYPE_ASSOC_RESP:
 		case IEEE80211_STYPE_REASSOC_RESP:
-
 			IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n",
 					WLAN_FC_GET_STYPE(header->frame_ctl));
 			if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
@@ -1821,7 +1657,6 @@  inline int ieee80211_rx_frame_softmac(struct ieee80211_device *ieee,
 					ieee->assoc_id = aid;
 					ieee->softmac_stats.rx_ass_ok++;
 
-					//printk(KERN_WARNING "nic_type = %s", (rx_stats->nic_type == 1)?"rtl8187":"rtl8187B");
 					if (1 == rx_stats->nic_type) //card type is 8187
 					{
 						goto associate_complete;
@@ -1887,18 +1722,14 @@  associate_complete:
 				}
 			}
 			break;
-
 		case IEEE80211_STYPE_ASSOC_REQ:
 		case IEEE80211_STYPE_REASSOC_REQ:
-
 			if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) &&
 				ieee->iw_mode == IW_MODE_MASTER)
 
 				ieee80211_rx_assoc_rq(ieee, skb);
 			break;
-
 		case IEEE80211_STYPE_AUTH:
-
 			if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) {
 				if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING &&
 				ieee->iw_mode == IW_MODE_INFRA){
@@ -1925,7 +1756,6 @@  associate_complete:
 					}
 				}
 			break;
-
 		case IEEE80211_STYPE_PROBE_REQ:
 
 			if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
@@ -1935,7 +1765,6 @@  associate_complete:
 
 				ieee80211_rx_probe_rq(ieee, skb);
 			break;
-
 		case IEEE80211_STYPE_DISASSOC:
 		case IEEE80211_STYPE_DEAUTH:
 			/* FIXME for now repeat all the association procedure
@@ -1948,23 +1777,17 @@  associate_complete:
 				ieee->state = IEEE80211_ASSOCIATING;
 				ieee->softmac_stats.reassoc++;
 
-				//notify_wx_assoc_event(ieee);  //YJ,del,080828, do not notify os here
 				queue_work(ieee->wq, &ieee->associate_procedure_wq);
 			}
 
 			break;
-
 		default:
 			return -1;
 			break;
 	}
-
-	//dev_kfree_skb_any(skb);
 	return 0;
 }
 
-
-
 /* 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
@@ -1987,8 +1810,6 @@  associate_complete:
 void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
 			    struct ieee80211_device *ieee)
 {
-
-
 	unsigned long flags;
 	int  i;
 
@@ -2007,7 +1828,6 @@  void ieee80211_softmac_xmit(struct ieee80211_txb *txb,
 			ieee->softmac_data_hard_start_xmit(
 				txb->fragments[i],
 				ieee->dev, ieee->rate);
-				//(i+1)<txb->nr_frags);
 			ieee->stats.tx_packets++;
 			ieee->stats.tx_bytes += txb->fragments[i]->len;
 			ieee->dev->trans_start = jiffies;
@@ -2035,18 +1855,14 @@  static void ieee80211_resume_tx(struct ieee80211_device *ieee)
 			ieee->softmac_data_hard_start_xmit(
 				ieee->tx_pending.txb->fragments[i],
 				ieee->dev, ieee->rate);
-				//(i+1)<ieee->tx_pending.txb->nr_frags);
 			ieee->stats.tx_packets++;
 			ieee->dev->trans_start = jiffies;
 		}
 	}
-
-
 	ieee80211_txb_free(ieee->tx_pending.txb);
 	ieee->tx_pending.txb = NULL;
 }
 
-
 void ieee80211_reset_queue(struct ieee80211_device *ieee)
 {
 	unsigned long flags;
@@ -2059,12 +1875,10 @@  void ieee80211_reset_queue(struct ieee80211_device *ieee)
 	}
 	ieee->queue_stop = 0;
 	spin_unlock_irqrestore(&ieee->lock, flags);
-
 }
 
 void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
 {
-
 	unsigned long flags;
 	struct sk_buff *skb;
 	struct ieee80211_hdr_3addr *header;
@@ -2076,7 +1890,6 @@  void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
 
 	if (ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE) {
 		while (!ieee->queue_stop && (skb = dequeue_mgmt(ieee))) {
-
 			header = (struct ieee80211_hdr_3addr *) skb->data;
 
 			header->seq_ctrl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -2086,7 +1899,6 @@  void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee)
 			else
 				ieee->seq_ctrl[0]++;
 
-			//printk(KERN_ALERT "ieee80211_wake_queue \n");
 			ieee->softmac_data_hard_start_xmit(skb, ieee->dev,
 							   ieee->basic_rate);
 			dev_kfree_skb_any(skb);//edit by thomas
@@ -2104,22 +1916,16 @@  exit:
 	spin_unlock_irqrestore(&ieee->lock, flags);
 }
 
-
 void ieee80211_rtl_stop_queue(struct ieee80211_device *ieee)
 {
-	//unsigned long flags;
-	//spin_lock_irqsave(&ieee->lock,flags);
 
 	if (!netif_queue_stopped(ieee->dev)) {
 		netif_stop_queue(ieee->dev);
 		ieee->softmac_stats.swtxstop++;
 	}
 	ieee->queue_stop = 1;
-	//spin_unlock_irqrestore(&ieee->lock,flags);
-
 }
 
-
 inline void ieee80211_randomize_cell(struct ieee80211_device *ieee)
 {
 
@@ -2156,7 +1962,6 @@  void ieee80211_start_master_bss(struct ieee80211_device *ieee)
 static void ieee80211_start_monitor_mode(struct ieee80211_device *ieee)
 {
 	if (ieee->raw_tx) {
-
 		if (ieee->data_hard_resume)
 			ieee->data_hard_resume(ieee->dev);
 
@@ -2179,7 +1984,6 @@  static void ieee80211_start_ibss_wq(struct work_struct *work)
 
 	down(&ieee->wx_sem);
 
-
 	if (ieee->current_network.ssid_len == 0) {
 		strcpy(ieee->current_network.ssid, IEEE80211_DEFAULT_TX_ESSID);
 		ieee->current_network.ssid_len = strlen(IEEE80211_DEFAULT_TX_ESSID);
@@ -2215,14 +2019,12 @@  static void ieee80211_start_ibss_wq(struct work_struct *work)
 			ieee80211_randomize_cell(ieee);
 
 		if (ieee->modulation & IEEE80211_CCK_MODULATION) {
-
 			ieee->current_network.rates_len = 4;
 
 			ieee->current_network.rates[0] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB;
 			ieee->current_network.rates[1] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB;
 			ieee->current_network.rates[2] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_5MB;
 			ieee->current_network.rates[3] = IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_11MB;
-
 		} else
 			ieee->current_network.rates_len = 0;
 
@@ -2306,14 +2108,10 @@  void ieee80211_start_bss(struct ieee80211_device *ieee)
 	 */
 	spin_lock_irqsave(&ieee->lock, flags);
 
-//#ifdef ENABLE_IPS
-//	printk("start bss ENABLE_IPS\n");
-//#else
 	if (ieee->state == IEEE80211_NOLINK) {
 		ieee->actscanning = true;
 		ieee80211_rtl_start_scan(ieee);
 	}
-//#endif
 	spin_unlock_irqrestore(&ieee->lock, flags);
 }
 
@@ -2398,7 +2196,6 @@  struct sk_buff *ieee80211_get_beacon_(struct ieee80211_device *ieee)
 	b->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_BEACON);
 
 	return skb;
-
 }
 
 struct sk_buff *ieee80211_get_beacon(struct ieee80211_device *ieee)
@@ -2429,7 +2226,6 @@  void ieee80211_softmac_stop_protocol(struct ieee80211_device *ieee)
 	up(&ieee->wx_sem);
 }
 
-
 void ieee80211_stop_protocol(struct ieee80211_device *ieee)
 {
 	if (!ieee->proto_started)
@@ -2492,7 +2288,6 @@  void ieee80211_start_protocol(struct ieee80211_device *ieee)
 
 	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
 	 * attempts does not fail just because the user provide the essid
@@ -2505,19 +2300,15 @@  void ieee80211_start_protocol(struct ieee80211_device *ieee)
 		case IW_MODE_INFRA:
 			ieee80211_start_bss(ieee);
 			break;
-
 		case IW_MODE_ADHOC:
 			ieee80211_start_ibss(ieee);
 			break;
-
 		case IW_MODE_MASTER:
 			ieee80211_start_master_bss(ieee);
 		break;
-
 		case IW_MODE_MONITOR:
 			ieee80211_start_monitor_mode(ieee);
 			break;
-
 		default:
 			ieee->iw_mode = IW_MODE_INFRA;
 			ieee80211_start_bss(ieee);
@@ -2525,7 +2316,6 @@  void ieee80211_start_protocol(struct ieee80211_device *ieee)
 	}
 }
 
-
 #define DRV_NAME  "Ieee80211"
 void ieee80211_softmac_init(struct ieee80211_device *ieee)
 {
@@ -2547,11 +2337,7 @@  void ieee80211_softmac_init(struct ieee80211_device *ieee)
 	ieee->proto_started = 0;
 	ieee->basic_rate = IEEE80211_DEFAULT_BASIC_RATE;
 	ieee->rate = 3;
-//#ifdef ENABLE_LPS
 	ieee->ps = IEEE80211_PS_MBCAST|IEEE80211_PS_UNICAST;
-//#else
-//	ieee->ps = IEEE80211_PS_DISABLED;
-//#endif
 	ieee->sta_sleep = 0;
 //by amy
 	ieee->bInactivePs = false;
@@ -2585,7 +2371,6 @@  void ieee80211_softmac_init(struct ieee80211_device *ieee)
 	INIT_DELAYED_WORK(&ieee->softmac_scan_wq, (void*) ieee80211_softmac_scan_wq);
 	INIT_DELAYED_WORK(&ieee->associate_retry_wq, (void*) ieee80211_associate_retry_wq);
 	INIT_WORK(&ieee->wx_sync_scan_wq, (void*) ieee80211_wx_sync_scan_wq);
-//	INIT_WORK(&ieee->watch_dog_wq,(void*) ieee80211_watch_dog_wq);
 
 	sema_init(&ieee->wx_sem, 1);
 	sema_init(&ieee->scan_sem, 1);
@@ -2698,7 +2483,6 @@  static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
 
 static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value)
 {
-
 	struct ieee80211_security sec = {
 		.flags = SEC_AUTH_MODE,
 	};
@@ -2730,11 +2514,9 @@  static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
 	case IEEE_PARAM_WPA_ENABLED:
 		ret = ieee80211_wpa_enable(ieee, value);
 		break;
-
 	case IEEE_PARAM_TKIP_COUNTERMEASURES:
 		ieee->tkip_countermeasures = value;
 		break;
-
 	case IEEE_PARAM_DROP_UNENCRYPTED: {
 		/* HACK:
 		 *
@@ -2767,27 +2549,22 @@  static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name,
 			ieee->set_security(ieee->dev, &sec);
 		break;
 	}
-
 	case IEEE_PARAM_PRIVACY_INVOKED:
 		ieee->privacy_invoked = value;
 		break;
-
 	case IEEE_PARAM_AUTH_ALGS:
 		ret = ieee80211_wpa_set_auth_algs(ieee, value);
 		break;
-
 	case IEEE_PARAM_IEEE_802_1X:
 		ieee->ieee802_1x = value;
 		break;
 	case IEEE_PARAM_WPAX_SELECT:
 		// added for WPA2 mixed mode
-		//printk(KERN_WARNING "------------------------>wpax value = %x\n", value);
 		spin_lock_irqsave(&ieee->wpax_suitlist_lock, flags);
 		ieee->wpax_type_set = 1;
 		ieee->wpax_type_notify = value;
 		spin_unlock_irqrestore(&ieee->wpax_suitlist_lock, flags);
 		break;
-
 	default:
 		printk("Unknown WPA param: %d\n", name);
 		ret = -EOPNOTSUPP;
@@ -2942,7 +2719,6 @@  static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
 		param->u.crypt.err = IEEE_CRYPT_ERR_CARD_CONF_FAILED;
 		return -EINVAL;
 	}
-
 	return ret;
 }
 
@@ -2953,7 +2729,6 @@  int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee,
 	int ret = 0;
 
 	down(&ieee->wx_sem);
-	//IEEE_DEBUG_INFO("wpa_supplicant: len=%d\n", p->length);
 
 	if (p->length < sizeof(struct ieee_param) || !p->pointer) {
 		ret = -EINVAL;
@@ -2972,20 +2747,16 @@  int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee,
 		ret = ieee80211_wpa_set_param(ieee, param->u.wpa_param.name,
 					param->u.wpa_param.value);
 		break;
-
 	case IEEE_CMD_SET_WPA_IE:
 		ret = ieee80211_wpa_set_wpa_ie(ieee, param, p->length);
 		break;
-
 	case IEEE_CMD_SET_ENCRYPTION:
 		ret = ieee80211_wpa_set_encryption(ieee, param, p->length);
 		break;
-
 	case IEEE_CMD_MLME:
 		ret = ieee80211_wpa_mlme(ieee, param->u.mlme.command,
 				   param->u.mlme.reason_code);
 		break;
-
 	default:
 		printk("Unknown WPA supplicant request: %d\n", param->cmd);
 		ret = -EOPNOTSUPP;