Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Tomas Winkler <tomasw@gmail.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: [PATCH/RFT] iwlagn: remove pointless TX frame check
Date: Thu, 09 Oct 2008 12:22:13 +0200	[thread overview]
Message-ID: <1223547733.22490.43.camel@johannes.berg> (raw)

mac80211 will not send data frames on a STA mode interface
that is not associated because the queue for it is stopped,
and all remaining data frames that might be sent, e.g. by
packet injection, are accepted here anyway, so remove this
pointless check. Also hold the spinlock for less time.

This will with great probability improve performance in the
driver more than the proper descriptor layout can possibly
cost.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Haven't tested this so far, so RFT, but I'm fairly certain it's correct.

 drivers/net/wireless/iwlwifi/iwl-tx.c |   26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

--- everything.orig/drivers/net/wireless/iwlwifi/iwl-tx.c	2008-10-09 11:07:05.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl-tx.c	2008-10-09 11:08:45.000000000 +0200
@@ -787,17 +787,18 @@ int iwl_tx_skb(struct iwl_priv *priv, st
 	unsigned long flags;
 	int ret;
 
-	spin_lock_irqsave(&priv->lock, flags);
-	if (iwl_is_rfkill(priv)) {
-		IWL_DEBUG_DROP("Dropping - RF KILL\n");
-		goto drop_unlock;
-	}
-
 	if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) ==
 	     IWL_INVALID_RATE) {
 		IWL_ERROR("ERROR: No TX rate available.\n");
+		goto drop;
+	}
+
+	spin_lock_irqsave(&priv->lock, flags);
+	if (iwl_is_rfkill(priv)) {
+		IWL_DEBUG_DROP("Dropping - RF KILL\n");
 		goto drop_unlock;
 	}
+	spin_unlock_irqrestore(&priv->lock, flags);
 
 	unicast = !is_multicast_ether_addr(hdr->addr1);
 
@@ -812,19 +813,6 @@ int iwl_tx_skb(struct iwl_priv *priv, st
 		IWL_DEBUG_TX("Sending REASSOC frame\n");
 #endif
 
-	/* drop all data frame if we are not associated */
-	if (ieee80211_is_data(fc) &&
-	    (priv->iw_mode != NL80211_IFTYPE_MONITOR ||
-	    !(info->flags & IEEE80211_TX_CTL_INJECTED)) && /* packet injection */
-	    (!iwl_is_associated(priv) ||
-	     ((priv->iw_mode == NL80211_IFTYPE_STATION) && !priv->assoc_id) ||
-	     !priv->assoc_station_added)) {
-		IWL_DEBUG_DROP("Dropping - !iwl_is_associated\n");
-		goto drop_unlock;
-	}
-
-	spin_unlock_irqrestore(&priv->lock, flags);
-
 	hdr_len = ieee80211_hdrlen(fc);
 
 	/* Find (or create) index into station table for destination station */



             reply	other threads:[~2008-10-09 10:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 10:22 Johannes Berg [this message]
2008-10-09 20:08 ` [PATCH/RFT] iwlagn: remove pointless TX frame check Tomas Winkler
2008-10-10  9:14   ` Johannes Berg
2008-10-23 20:42     ` Johannes Berg
2008-11-06 12:30       ` Johannes Berg
2008-11-06 14:41         ` Tomas Winkler
2008-11-06 14:45           ` Johannes Berg
2008-11-06 14:53             ` Tomas Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1223547733.22490.43.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomasw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox