mac80211: don't call mgd_prepare_tx when associated

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:36 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8c7d857c4a4a552d8d3e1b2e24e1864ec2989285
Commit:     8c7d857c4a4a552d8d3e1b2e24e1864ec2989285
Parent:     7eeff74c29259e9cb7765e3845c0b74057f744da
Author:     Emmanuel Grumbach <emmanuel.grumbach at intel.com>
AuthorDate: Wed Jul 25 01:42:36 2012 +0300
Committer:  Johannes Berg <johannes.berg at intel.com>
CommitDate: Tue Jul 31 16:10:59 2012 +0200

    mac80211: don't call mgd_prepare_tx when associated
    
    This doesn't make any sense since we are expected to be on
    the medium or at least to Tx only when we are on the right
    channel and the AP/GO can hear us.
    
    Move the call to mgd_prepare_tx() for deauth to be only
    done in case we're sending a deauth while not associated.
    
    Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach at intel.com>
    Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 net/mac80211/mlme.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 81b2269..f0d6fa2 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -610,8 +610,6 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
 			IEEE80211_SKB_CB(skb)->flags |=
 				IEEE80211_TX_INTFL_DONT_ENCRYPT;
 
-		drv_mgd_prepare_tx(local, sdata);
-
 		ieee80211_tx_skb(sdata, skb);
 	}
 }
@@ -3504,14 +3502,17 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
 		   req->bssid, req->reason_code);
 
 	if (ifmgd->associated &&
-	    ether_addr_equal(ifmgd->associated->bssid, req->bssid))
+	    ether_addr_equal(ifmgd->associated->bssid, req->bssid)) {
 		ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
 				       req->reason_code, true, frame_buf);
-	else
+	} else {
+		drv_mgd_prepare_tx(sdata->local, sdata);
 		ieee80211_send_deauth_disassoc(sdata, req->bssid,
 					       IEEE80211_STYPE_DEAUTH,
 					       req->reason_code, true,
 					       frame_buf);
+	}
+
 	mutex_unlock(&ifmgd->mtx);
 
 	__cfg80211_send_deauth(sdata->dev, frame_buf, DEAUTH_DISASSOC_LEN);



More information about the linux-mtd-cvs mailing list