linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 22/24] rt2x00: Configure type during add_interface
@ 2007-07-31 18:37 Ivo van Doorn
  0 siblings, 0 replies; only message in thread
From: Ivo van Doorn @ 2007-07-31 18:37 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, rt2400-devel

>From b10059fd3e2bbaef1f82ac60a177902bd19071dc Mon Sep 17 00:00:00 2001
From: Ivo van Doorn <IvDoorn@gmail.com>
Date: Tue, 31 Jul 2007 17:09:15 +0200
Subject: [PATCH 22/24] rt2x00: Configure type during add_interface

When there was only 1 interface present which was configured
as monitor interface the interface would fail to configure
the device correctly. This resulted in too many frames to be dropped.

This patch will add the configure_type and configure_packet_filter
to the add_interface handler instead of the config_interface handler.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00mac.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/rt2x00mac.c b/drivers/net/wireless/rt2x00mac.c
index 9c6d043..205f10f 100644
--- a/drivers/net/wireless/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00mac.c
@@ -173,6 +173,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
 	struct interface *intf = &rt2x00dev->interface;
+	int retval;
 
 	/*
 	 * We only support 1 non-monitor interface.
@@ -195,7 +196,17 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 		intf->filter = 0;
 	}
 
-	return rt2x00lib_init_interface(rt2x00dev);
+	retval = rt2x00lib_init_interface(rt2x00dev);
+	if (retval)
+		return retval;
+
+	/*
+	 * Configure interface.
+	 */
+	rt2x00lib_config_type(rt2x00dev, conf->type);
+	rt2x00lib_config_packet_filter(rt2x00dev, intf->filter);
+
+	return 0;
 }
 EXPORT_SYMBOL_GPL(rt2x00mac_add_interface);
 
@@ -290,12 +301,6 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw, int if_id,
 	 */
 	if (conf->type != IEEE80211_IF_TYPE_AP)
 		memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
-
-	/*
-	 * Enable configuration.
-	 */
-	rt2x00lib_config_type(rt2x00dev, conf->type);
-	rt2x00lib_config_packet_filter(rt2x00dev, intf->filter);
 	rt2x00lib_config_bssid(rt2x00dev, intf->bssid);
 
 	/*
-- 
1.5.2.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-31 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 18:37 [PATCH 22/24] rt2x00: Configure type during add_interface Ivo van Doorn

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).