Skip to contentSkip to conversation

rt2x00: Configure type during add_interface

PATCH In review Ivo van Doorn 1 participant 1 message Jul 31, 2007 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 22/24 rt2x00: Configure type during add_interface

Quoted 1 line

From b10059fd3e2bbaef1f82ac60a177902bd19071dc Mon Sep 17 00:00:00 2001

From: Ivo van Doorn <[email protected]>
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.

---
 drivers/net/wireless/rt2x00mac.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
drivers/net/wireless/rt2x00mac.c +12 -7
index 9c6d043..205f10f 100644
@@ -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);
 
 	/*
Signature · 1 line
1.5.2.4