All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtual-sta 1/3] mac80211:  Add more general interface iterator.
@ 2010-09-10 22:04 greearb
  2010-09-10 22:04 ` [virtual-sta 2/3] ath9k: Calculate bssid-mask and rxfilter for 2+ STAs greearb
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: greearb @ 2010-09-10 22:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

This allows callers to specify whether they want all
or just active interfaces, and whether their iterator
is atomic or not.  A count for the number of interfaces
is returned to remove need for similar logic in the
drivers.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 f91fc33... 53e5d5b... M	include/net/mac80211.h
:100644 100644 bd40b11... ad96d5f... M	net/mac80211/util.c
 include/net/mac80211.h |   24 +++++++++++
 net/mac80211/util.c    |  102 +++++++++++++++++++++++++++---------------------
 2 files changed, 82 insertions(+), 44 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f91fc33..53e5d5b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2320,6 +2320,30 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
 						    u8 *mac,
 						    struct ieee80211_vif *vif),
 						void *data);
+/**
+ * ieee80211_iterate_interfaces_helper - iterate interfaces
+ *
+ * This function iterates over the interfaces associated with a given
+ * hardware and calls the callback for them.  If do_atomic is true,
+ * this function requires the iterator callback function to be atomic,
+ * if that is not desired, set do_atomic to false.
+ * If you want only active interfaces, set active_only to true.
+ * See also: @ieee80211_iterate_active_interfaces
+ *           @ieee80211_iterate_active_interfaces_atomic
+ *
+ * Returns number of interfaces to be filtered.
+ * @hw: the hardware struct of which the interfaces should be iterated over
+ * @do_atomic:  Should iterator be treated as atomic or not.
+ * @active_only:  Should we only iterate over active interfaces.
+ * @iterator: the iterator function to call, cannot sleep
+ * @data: first argument of the iterator function
+ */
+int ieee80211_iterate_interfaces_helper(struct ieee80211_hw *hw,
+					bool do_atomic,
+					bool active_only,
+					void (*iterator)(void *data, u8 *mac,
+						struct ieee80211_vif *vif),
+					void *data);
 
 /**
  * ieee80211_queue_work - add work onto the mac80211 workqueue
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index bd40b11..ad96d5f 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -461,71 +461,85 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw)
 }
 EXPORT_SYMBOL(ieee80211_wake_queues);
 
-void ieee80211_iterate_active_interfaces(
-	struct ieee80211_hw *hw,
+static int _iter_loop_helper(
+	struct ieee80211_sub_if_data *sdata,
+	bool active_only,
 	void (*iterator)(void *data, u8 *mac,
 			 struct ieee80211_vif *vif),
 	void *data)
 {
-	struct ieee80211_local *local = hw_to_local(hw);
-	struct ieee80211_sub_if_data *sdata;
-
-	mutex_lock(&local->iflist_mtx);
-
-	list_for_each_entry(sdata, &local->interfaces, list) {
-		switch (sdata->vif.type) {
-		case NUM_NL80211_IFTYPES:
-		case NL80211_IFTYPE_UNSPECIFIED:
-		case NL80211_IFTYPE_MONITOR:
-		case NL80211_IFTYPE_AP_VLAN:
-			continue;
-		case NL80211_IFTYPE_AP:
-		case NL80211_IFTYPE_STATION:
-		case NL80211_IFTYPE_ADHOC:
-		case NL80211_IFTYPE_WDS:
-		case NL80211_IFTYPE_MESH_POINT:
-			break;
-		}
-		if (ieee80211_sdata_running(sdata))
+	switch (sdata->vif.type) {
+	case NUM_NL80211_IFTYPES:
+	case NL80211_IFTYPE_UNSPECIFIED:
+	case NL80211_IFTYPE_MONITOR:
+	case NL80211_IFTYPE_AP_VLAN:
+		return 0;
+	case NL80211_IFTYPE_AP:
+	case NL80211_IFTYPE_STATION:
+	case NL80211_IFTYPE_ADHOC:
+	case NL80211_IFTYPE_WDS:
+	case NL80211_IFTYPE_MESH_POINT:
+		break;
+	}
+	if (ieee80211_sdata_running(sdata) || !active_only) {
+		if (iterator)
 			iterator(data, sdata->vif.addr,
 				 &sdata->vif);
+		return 1;
 	}
-
-	mutex_unlock(&local->iflist_mtx);
+	return 0;
 }
-EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);
 
-void ieee80211_iterate_active_interfaces_atomic(
+int ieee80211_iterate_interfaces_helper(
 	struct ieee80211_hw *hw,
+	bool do_atomic,
+	bool active_only,
 	void (*iterator)(void *data, u8 *mac,
 			 struct ieee80211_vif *vif),
 	void *data)
 {
 	struct ieee80211_local *local = hw_to_local(hw);
 	struct ieee80211_sub_if_data *sdata;
+	int cnt = 0;
 
-	rcu_read_lock();
+	if (do_atomic) {
+		rcu_read_lock();
 
-	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		switch (sdata->vif.type) {
-		case NUM_NL80211_IFTYPES:
-		case NL80211_IFTYPE_UNSPECIFIED:
-		case NL80211_IFTYPE_MONITOR:
-		case NL80211_IFTYPE_AP_VLAN:
-			continue;
-		case NL80211_IFTYPE_AP:
-		case NL80211_IFTYPE_STATION:
-		case NL80211_IFTYPE_ADHOC:
-		case NL80211_IFTYPE_WDS:
-		case NL80211_IFTYPE_MESH_POINT:
-			break;
+		list_for_each_entry_rcu(sdata, &local->interfaces, list) {
+			cnt += _iter_loop_helper(sdata, active_only,
+						 iterator, data);
 		}
-		if (ieee80211_sdata_running(sdata))
-			iterator(data, sdata->vif.addr,
-				 &sdata->vif);
+		rcu_read_unlock();
+	} else {
+		mutex_lock(&local->iflist_mtx);
+		list_for_each_entry(sdata, &local->interfaces, list) {
+			cnt += _iter_loop_helper(sdata, active_only,
+						 iterator, data);
+		}
+		mutex_unlock(&local->iflist_mtx);
 	}
+	return cnt;
+}
+EXPORT_SYMBOL_GPL(ieee80211_iterate_interfaces_helper);
 
-	rcu_read_unlock();
+
+void ieee80211_iterate_active_interfaces(
+	struct ieee80211_hw *hw,
+	void (*iterator)(void *data, u8 *mac,
+			 struct ieee80211_vif *vif),
+	void *data)
+{
+	ieee80211_iterate_interfaces_helper(hw, false, false, iterator, data);
+}
+EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces);
+
+void ieee80211_iterate_active_interfaces_atomic(
+	struct ieee80211_hw *hw,
+	void (*iterator)(void *data, u8 *mac,
+			 struct ieee80211_vif *vif),
+	void *data)
+{
+	ieee80211_iterate_interfaces_helper(hw, true, false, iterator, data);
 }
 EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
 
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [virtual-sta 2/3] ath9k:  Calculate bssid-mask and rxfilter for 2+ STAs
  2010-09-10 22:04 [virtual-sta 1/3] mac80211: Add more general interface iterator greearb
@ 2010-09-10 22:04 ` greearb
  2010-09-10 22:04 ` [virtual-sta 3/3] mac80211: Allow multiple STA on same BSS greearb
  2010-09-14 12:59 ` [virtual-sta 1/3] mac80211: Add more general interface iterator Johannes Berg
  2 siblings, 0 replies; 12+ messages in thread
From: greearb @ 2010-09-10 22:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

The rx-filter wasn't taking multiple VIFs into account
when calculating the BEACON and OTHER_BSS filter.

Make sure that bssid-mask is set up properly if we have
more than 1 VIF.  The BSSID should be calculated over all
VIFs, not just running ones.  Otherwise, secondary VIFS
cannot receive enough packets to bring up their link.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 2a6e45a... 26fb322... M	drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
:100644 100644 b32c8f0... 6e1aee0... M	drivers/net/wireless/ath/ath9k/recv.c
:100644 100644 fd20241... 9c1d529... M	drivers/net/wireless/ath/ath9k/virtual.c
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c |    1 +
 drivers/net/wireless/ath/ath9k/recv.c         |   23 ++++++++++++++++-------
 drivers/net/wireless/ath/ath9k/virtual.c      |   12 +++++++-----
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 2a6e45a..26fb322 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -416,6 +416,7 @@ static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)
 
 	/* configure bssid mask */
 	if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
+		/* NOTE:  Maybe this should be ath9k_set_bssid_mask?? */
 		ath_hw_setbssidmask(common);
 
 	/* configure operational mode */
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index b32c8f0..6e1aee0 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -110,7 +110,6 @@ static void ath_setdefantenna(struct ath_softc *sc, u32 antenna)
 static void ath_opmode_init(struct ath_softc *sc)
 {
 	struct ath_hw *ah = sc->sc_ah;
-	struct ath_common *common = ath9k_hw_common(ah);
 
 	u32 rfilt, mfilt[2];
 
@@ -118,9 +117,15 @@ static void ath_opmode_init(struct ath_softc *sc)
 	rfilt = ath_calcrxfilter(sc);
 	ath9k_hw_setrxfilter(ah, rfilt);
 
-	/* configure bssid mask */
-	if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
-		ath_hw_setbssidmask(common);
+	/* configure bssid mask, if ah->hw is configured.
+	 * it is NOT configured when mac80211 is calling
+	 * ieee80211_do_open, but probably just as well since
+	 * this STA isn't in the list yet.
+	 */
+	if (ah->hw) {
+		if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
+			ath9k_set_bssid_mask(ah->hw);
+	}
 
 	/* configure operational mode */
 	ath9k_hw_setopmode(ah);
@@ -426,6 +431,8 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
 #define	RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)
 
 	u32 rfilt;
+	int avifs = ieee80211_iterate_interfaces_helper(sc->hw, true, false,
+							NULL, NULL);
 
 	rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
 		| ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
@@ -448,7 +455,11 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
 	if (sc->rx.rxfilter & FIF_CONTROL)
 		rfilt |= ATH9K_RX_FILTER_CONTROL;
 
+	/* If we have more than one active STA, then we need to
+	 * accept more than just MYBEACON.
+	 */
 	if ((sc->sc_ah->opmode == NL80211_IFTYPE_STATION) &&
+	    (avifs <= 1) &&
 	    !(sc->rx.rxfilter & FIF_BCN_PRBRESP_PROMISC))
 		rfilt |= ATH9K_RX_FILTER_MYBEACON;
 	else
@@ -463,9 +474,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
 	if (conf_is_ht(&sc->hw->conf))
 		rfilt |= ATH9K_RX_FILTER_COMP_BAR;
 
-	if (sc->sec_wiphy || (sc->rx.rxfilter & FIF_OTHER_BSS)) {
-		/* TODO: only needed if more than one BSSID is in use in
-		 * station/adhoc mode */
+	if (sc->sec_wiphy || (avifs > 1) || (sc->rx.rxfilter & FIF_OTHER_BSS)) {
 		/* The following may also be needed for other older chips */
 		if (sc->sc_ah->hw_version.macVersion == AR_SREV_VERSION_9160)
 			rfilt |= ATH9K_RX_FILTER_PROM;
diff --git a/drivers/net/wireless/ath/ath9k/virtual.c b/drivers/net/wireless/ath/ath9k/virtual.c
index fd20241..9c1d529 100644
--- a/drivers/net/wireless/ath/ath9k/virtual.c
+++ b/drivers/net/wireless/ath/ath9k/virtual.c
@@ -59,15 +59,17 @@ void ath9k_set_bssid_mask(struct ieee80211_hw *hw)
 	} else
 		iter_data.count = 0;
 
-	/* Get list of all active MAC addresses */
+	/* Get list of all MAC addresses for STA and ADHOC interfaces. */
 	spin_lock_bh(&sc->wiphy_lock);
-	ieee80211_iterate_active_interfaces_atomic(sc->hw, ath9k_vif_iter,
-						   &iter_data);
+	ieee80211_iterate_interfaces_helper(sc->hw, true, false,
+					    ath9k_vif_iter,
+					    &iter_data);
 	for (i = 0; i < sc->num_sec_wiphy; i++) {
 		if (sc->sec_wiphy[i] == NULL)
 			continue;
-		ieee80211_iterate_active_interfaces_atomic(
-			sc->sec_wiphy[i]->hw, ath9k_vif_iter, &iter_data);
+		ieee80211_iterate_interfaces_helper(
+			sc->sec_wiphy[i]->hw, true, false,
+			ath9k_vif_iter, &iter_data);
 	}
 	spin_unlock_bh(&sc->wiphy_lock);
 
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [virtual-sta 3/3] mac80211:  Allow multiple STA on same BSS.
  2010-09-10 22:04 [virtual-sta 1/3] mac80211: Add more general interface iterator greearb
  2010-09-10 22:04 ` [virtual-sta 2/3] ath9k: Calculate bssid-mask and rxfilter for 2+ STAs greearb
@ 2010-09-10 22:04 ` greearb
  2010-09-10 22:44   ` Felix Fietkau
  2010-09-14 12:57   ` Johannes Berg
  2010-09-14 12:59 ` [virtual-sta 1/3] mac80211: Add more general interface iterator Johannes Berg
  2 siblings, 2 replies; 12+ messages in thread
From: greearb @ 2010-09-10 22:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

When adding an STA, the old code checked if there was already
an STA with the same BSS.  Instead, check to see if there is
exactly the same STA in order to allow multiple STA to be
associated with the same AP.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 687077e... db751f1... M	net/mac80211/sta_info.c
 net/mac80211/sta_info.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 687077e..db751f1 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -440,7 +440,7 @@ int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU)
 
 	spin_lock_irqsave(&local->sta_lock, flags);
 	/* check if STA exists already */
-	if (sta_info_get_bss(sdata, sta->sta.addr)) {
+	if (sta_info_get(sdata, sta->sta.addr)) {
 		spin_unlock_irqrestore(&local->sta_lock, flags);
 		mutex_unlock(&local->sta_mtx);
 		rcu_read_lock();
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 3/3] mac80211:  Allow multiple STA on same BSS.
  2010-09-10 22:04 ` [virtual-sta 3/3] mac80211: Allow multiple STA on same BSS greearb
@ 2010-09-10 22:44   ` Felix Fietkau
  2010-09-10 22:49     ` Ben Greear
  2010-09-14 12:57   ` Johannes Berg
  1 sibling, 1 reply; 12+ messages in thread
From: Felix Fietkau @ 2010-09-10 22:44 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless

On 2010-09-10 3:04 PM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> When adding an STA, the old code checked if there was already
> an STA with the same BSS.  Instead, check to see if there is
> exactly the same STA in order to allow multiple STA to be
> associated with the same AP.
I think that's misleading. sta_info_get_bss does not check if there is a
STA with the same BSS. Like sta_info_get it looks for a STA with the
given address, but unlike sta_info_get, it also accepts it if it's on a
different interface than the provided sdata, but part of the same BSS as
the sdata's.
Because of that, this change seems bogus to me.

- Felix

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 3/3] mac80211:  Allow multiple STA on same BSS.
  2010-09-10 22:44   ` Felix Fietkau
@ 2010-09-10 22:49     ` Ben Greear
  2010-09-10 22:54       ` Felix Fietkau
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Greear @ 2010-09-10 22:49 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless

On 09/10/2010 03:44 PM, Felix Fietkau wrote:
> On 2010-09-10 3:04 PM, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> When adding an STA, the old code checked if there was already
>> an STA with the same BSS.  Instead, check to see if there is
>> exactly the same STA in order to allow multiple STA to be
>> associated with the same AP.
> I think that's misleading. sta_info_get_bss does not check if there is a
> STA with the same BSS. Like sta_info_get it looks for a STA with the
> given address, but unlike sta_info_get, it also accepts it if it's on a
> different interface than the provided sdata, but part of the same BSS as
> the sdata's.
> Because of that, this change seems bogus to me.

W/out this change, I cannot get a second STA to associate with
the AP because that code returns EBUSY, because the
first STA and second STA point to the same bss.

There could be a better way to do what I'm trying to do,
but that one-line patch made it work for me.  I'll be happy
to try alternative suggestions.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 3/3] mac80211:  Allow multiple STA on same BSS.
  2010-09-10 22:49     ` Ben Greear
@ 2010-09-10 22:54       ` Felix Fietkau
  0 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2010-09-10 22:54 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless

On 2010-09-10 3:49 PM, Ben Greear wrote:
> On 09/10/2010 03:44 PM, Felix Fietkau wrote:
>> On 2010-09-10 3:04 PM, greearb@candelatech.com wrote:
>>> From: Ben Greear<greearb@candelatech.com>
>>>
>>> When adding an STA, the old code checked if there was already
>>> an STA with the same BSS.  Instead, check to see if there is
>>> exactly the same STA in order to allow multiple STA to be
>>> associated with the same AP.
>> I think that's misleading. sta_info_get_bss does not check if there is a
>> STA with the same BSS. Like sta_info_get it looks for a STA with the
>> given address, but unlike sta_info_get, it also accepts it if it's on a
>> different interface than the provided sdata, but part of the same BSS as
>> the sdata's.
>> Because of that, this change seems bogus to me.
> 
> W/out this change, I cannot get a second STA to associate with
> the AP because that code returns EBUSY, because the
> first STA and second STA point to the same bss.
> 
> There could be a better way to do what I'm trying to do,
> but that one-line patch made it work for me.  I'll be happy
> to try alternative suggestions.
This patch will most likely break other stuff. the sta_info_get ->
sta_info_get_bss change was added for a reason. I can look into it later
to see what the reason was, but I don't think your change can go in
without further review.

- Felix

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 3/3] mac80211:  Allow multiple STA on same BSS.
  2010-09-10 22:04 ` [virtual-sta 3/3] mac80211: Allow multiple STA on same BSS greearb
  2010-09-10 22:44   ` Felix Fietkau
@ 2010-09-14 12:57   ` Johannes Berg
  2010-09-14 15:45     ` Ben Greear
  1 sibling, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2010-09-14 12:57 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless

On Fri, 2010-09-10 at 15:04 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> When adding an STA, the old code checked if there was already
> an STA with the same BSS.  Instead, check to see if there is
> exactly the same STA in order to allow multiple STA to be
> associated with the same AP.


You want this instead:

---
 net/mac80211/sta_info.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- wireless-testing.orig/net/mac80211/sta_info.c	2010-09-14 14:53:10.000000000 +0200
+++ wireless-testing/net/mac80211/sta_info.c	2010-09-14 14:55:44.000000000 +0200
@@ -125,7 +125,7 @@ struct sta_info *sta_info_get_bss(struct
 				    lockdep_is_held(&local->sta_mtx));
 	while (sta) {
 		if ((sta->sdata == sdata ||
-		     sta->sdata->bss == sdata->bss) &&
+		     (sta->sdata->bss && sta->sdata->bss == sdata->bss)) &&
 		    memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
 			break;
 		sta = rcu_dereference_check(sta->hnext,


johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 1/3] mac80211:  Add more general interface iterator.
  2010-09-10 22:04 [virtual-sta 1/3] mac80211: Add more general interface iterator greearb
  2010-09-10 22:04 ` [virtual-sta 2/3] ath9k: Calculate bssid-mask and rxfilter for 2+ STAs greearb
  2010-09-10 22:04 ` [virtual-sta 3/3] mac80211: Allow multiple STA on same BSS greearb
@ 2010-09-14 12:59 ` Johannes Berg
  2010-09-14 14:47   ` Ben Greear
  2 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2010-09-14 12:59 UTC (permalink / raw)
  To: greearb; +Cc: linux-wireless

On Fri, 2010-09-10 at 15:04 -0700, greearb@candelatech.com wrote:

> This allows callers to specify whether they want all
> or just active interfaces, 

I thought about this, and I don't want to allow drivers to get at
inactive interfaces. And with that, I don't think there's a need to
restructure the code here. Also, since what you wanted wasn't the count
but the STA interface count, you need your own iterator function anyway,
no?

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 1/3] mac80211:  Add more general interface iterator.
  2010-09-14 12:59 ` [virtual-sta 1/3] mac80211: Add more general interface iterator Johannes Berg
@ 2010-09-14 14:47   ` Ben Greear
  2010-09-14 14:53     ` Johannes Berg
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Greear @ 2010-09-14 14:47 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 09/14/2010 05:59 AM, Johannes Berg wrote:
> On Fri, 2010-09-10 at 15:04 -0700, greearb@candelatech.com wrote:
>
>> This allows callers to specify whether they want all
>> or just active interfaces,
>
> I thought about this, and I don't want to allow drivers to get at
> inactive interfaces. And with that, I don't think there's a need to
> restructure the code here. Also, since what you wanted wasn't the count
> but the STA interface count, you need your own iterator function anyway,
> no?

I'll see if I can get ath9k to use the normal iterator.  I didn't need my
own iterator, because I could just pass in NULL for iterator and pass
active_only as false.

I think you should consider returning the count for the number of times the
iterator was called because it's simple code, and it would save the same logic
in each driver's iterator methods (or at least, ath9k).

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 1/3] mac80211:  Add more general interface iterator.
  2010-09-14 14:47   ` Ben Greear
@ 2010-09-14 14:53     ` Johannes Berg
  2010-09-14 15:26       ` Ben Greear
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2010-09-14 14:53 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless

On Tue, 2010-09-14 at 07:47 -0700, Ben Greear wrote:

> I'll see if I can get ath9k to use the normal iterator.  I didn't need my
> own iterator, because I could just pass in NULL for iterator and pass
> active_only as false.

active_only as false still doesn't seem right. Why would you care about
it before an interface is up?

> I think you should consider returning the count for the number of times the
> iterator was called because it's simple code, and it would save the same logic
> in each driver's iterator methods (or at least, ath9k).

Yeah, that seems like a good change, but I think we should probably get
to the bottom of it first (the sdata->bss change on the other hand seems
fine as is)

johannes


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 1/3] mac80211:  Add more general interface iterator.
  2010-09-14 14:53     ` Johannes Berg
@ 2010-09-14 15:26       ` Ben Greear
  0 siblings, 0 replies; 12+ messages in thread
From: Ben Greear @ 2010-09-14 15:26 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 09/14/2010 07:53 AM, Johannes Berg wrote:
> On Tue, 2010-09-14 at 07:47 -0700, Ben Greear wrote:
>
>> I'll see if I can get ath9k to use the normal iterator.  I didn't need my
>> own iterator, because I could just pass in NULL for iterator and pass
>> active_only as false.
>
> active_only as false still doesn't seem right. Why would you care about
> it before an interface is up?

It 'fixed' the bssid mask logic in ath9k, but based on feedback from ath9k
folks, there may be a better way to do that anyway.

I'm going to start integrating the new suggestions now to see if
they work.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [virtual-sta 3/3] mac80211:  Allow multiple STA on same BSS.
  2010-09-14 12:57   ` Johannes Berg
@ 2010-09-14 15:45     ` Ben Greear
  0 siblings, 0 replies; 12+ messages in thread
From: Ben Greear @ 2010-09-14 15:45 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 09/14/2010 05:57 AM, Johannes Berg wrote:
> On Fri, 2010-09-10 at 15:04 -0700, greearb@candelatech.com wrote:
>> From: Ben Greear<greearb@candelatech.com>
>>
>> When adding an STA, the old code checked if there was already
>> an STA with the same BSS.  Instead, check to see if there is
>> exactly the same STA in order to allow multiple STA to be
>> associated with the same AP.
>
>
> You want this instead:
>
> ---
>   net/mac80211/sta_info.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- wireless-testing.orig/net/mac80211/sta_info.c	2010-09-14 14:53:10.000000000 +0200
> +++ wireless-testing/net/mac80211/sta_info.c	2010-09-14 14:55:44.000000000 +0200
> @@ -125,7 +125,7 @@ struct sta_info *sta_info_get_bss(struct
>   				    lockdep_is_held(&local->sta_mtx));
>   	while (sta) {
>   		if ((sta->sdata == sdata ||
> -		     sta->sdata->bss == sdata->bss)&&
> +		     (sta->sdata->bss&&  sta->sdata->bss == sdata->bss))&&
>   		memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
>   			break;
>   		sta = rcu_dereference_check(sta->hnext,

This seems to work fine.  Do you want me to respin the patch, or will you push this
in?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-09-14 15:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 22:04 [virtual-sta 1/3] mac80211: Add more general interface iterator greearb
2010-09-10 22:04 ` [virtual-sta 2/3] ath9k: Calculate bssid-mask and rxfilter for 2+ STAs greearb
2010-09-10 22:04 ` [virtual-sta 3/3] mac80211: Allow multiple STA on same BSS greearb
2010-09-10 22:44   ` Felix Fietkau
2010-09-10 22:49     ` Ben Greear
2010-09-10 22:54       ` Felix Fietkau
2010-09-14 12:57   ` Johannes Berg
2010-09-14 15:45     ` Ben Greear
2010-09-14 12:59 ` [virtual-sta 1/3] mac80211: Add more general interface iterator Johannes Berg
2010-09-14 14:47   ` Ben Greear
2010-09-14 14:53     ` Johannes Berg
2010-09-14 15:26       ` Ben Greear

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.