linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 5/8] mac80211: clean up some things in the RX path
Date: Thu, 31 Jan 2008 19:48:24 +0100	[thread overview]
Message-ID: <20080131185053.674773000@sipsolutions.net> (raw)
In-Reply-To: 20080131184819.103174000@sipsolutions.net

Uninline ieee80211_invoke_rx_handlers to save .text space,
make the code more readable in some places and remove the
"optimisation" that is hit only very few times and unclear
to start with.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
I have a plan to add back such an optimisation but it is rather
involved requiring a scan handling change and per-sdata sta
structures.

 net/mac80211/rx.c |   37 ++++++++++---------------------------
 1 file changed, 10 insertions(+), 27 deletions(-)

--- everything.orig/net/mac80211/rx.c	2008-01-31 15:46:09.985793781 +0100
+++ everything/net/mac80211/rx.c	2008-01-31 15:46:12.415793891 +0100
@@ -1448,11 +1448,10 @@ ieee80211_rx_h_mgmt(struct ieee80211_txr
 	return RX_QUEUED;
 }
 
-static inline ieee80211_rx_result __ieee80211_invoke_rx_handlers(
-				struct ieee80211_local *local,
-				ieee80211_rx_handler *handlers,
-				struct ieee80211_txrx_data *rx,
-				struct sta_info *sta)
+static void ieee80211_invoke_rx_handlers(struct ieee80211_local *local,
+					 ieee80211_rx_handler *handlers,
+					 struct ieee80211_txrx_data *rx,
+					 struct sta_info *sta)
 {
 	ieee80211_rx_handler *handler;
 	ieee80211_rx_result res = RX_DROP_MONITOR;
@@ -1476,19 +1475,13 @@ static inline ieee80211_rx_result __ieee
 		break;
 	}
 
-	if (res == RX_DROP_UNUSABLE || res == RX_DROP_MONITOR)
-		dev_kfree_skb(rx->skb);
-	return res;
-}
-
-static inline void ieee80211_invoke_rx_handlers(struct ieee80211_local *local,
-						ieee80211_rx_handler *handlers,
-						struct ieee80211_txrx_data *rx,
-						struct sta_info *sta)
-{
-	if (__ieee80211_invoke_rx_handlers(local, handlers, rx, sta) ==
-	    RX_CONTINUE)
+	switch (res) {
+	case RX_DROP_MONITOR:
+	case RX_DROP_UNUSABLE:
+	case RX_CONTINUE:
 		dev_kfree_skb(rx->skb);
+		break;
+	}
 }
 
 static void ieee80211_rx_michael_mic_report(struct net_device *dev,
@@ -1718,16 +1711,6 @@ static void __ieee80211_rx_handle_packet
 
 	skb = rx.skb;
 
-	if (sta && !(sta->flags & (WLAN_STA_WDS | WLAN_STA_ASSOC_AP)) &&
-	    !atomic_read(&local->iff_promiscs) &&
-	    !is_multicast_ether_addr(hdr->addr1)) {
-		rx.flags |= IEEE80211_TXRXD_RXRA_MATCH;
-		ieee80211_invoke_rx_handlers(local, local->rx_handlers, &rx,
-					     rx.sta);
-		sta_info_put(sta);
-		return;
-	}
-
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 		if (!netif_running(sdata->dev))
 			continue;

-- 


  parent reply	other threads:[~2008-02-01 12:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 18:48 [PATCH 0/8] AP mode is coming Johannes Berg
2008-01-31 18:48 ` [PATCH 1/8] mac80211: split ieee80211_txrx_result Johannes Berg
2008-01-31 18:48 ` [PATCH 2/8] mac80211: split RX_DROP Johannes Berg
2008-01-31 18:48 ` [PATCH 3/8] nl80211: Add monitor interface configuration flags Johannes Berg
2008-01-31 18:48 ` [PATCH 4/8] mac80211: Use monitor " Johannes Berg
2008-01-31 18:48 ` Johannes Berg [this message]
2008-01-31 18:48 ` [PATCH 6/8] mac80211: remove "dynamic" RX/TX handlers Johannes Berg
2008-01-31 18:48 ` [PATCH 7/8] mac80211: move some code into ieee80211_invoke_rx_handlers Johannes Berg
2008-01-31 18:48 ` [PATCH 8/8] mac80211: Add cooked monitor mode support Johannes Berg

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=20080131185053.674773000@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).