All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC:  v3: Support multiple STA on same AP with ath9k
@ 2010-09-10 20:07 ` Ben Greear
  0 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-10 20:07 UTC (permalink / raw)
  To: linux-wireless, ath9k-devel@lists.ath9k.org

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

The attached patch lets mac80111 create multiple STA on the same
AP, and the changes to ath9k let it function properly, at least for
un-encrypted traffic.  WPA does not work..no idea why yet.

It also consolidates some of the util.c iterator logic in
mac80211.

Please let me know if this is moving in the right direction.

Thanks,
Ben

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



[-- Attachment #2: wt-36-vsta-ok-c.patch --]
[-- Type: text/plain, Size: 10039 bytes --]

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..4ce4029 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,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
 #define	RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)
 
 	u32 rfilt;
+	int avifs = ieee80211_count_sta_atomic(sc->hw);
 
 	rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE)
 		| ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
@@ -448,7 +454,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 +473,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);
 
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f91fc33..e87396d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2320,6 +2320,35 @@ 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);
+
+/** Return a count of all station-like interfaces for
+ * this hardware.  Running/Stopped state has no affect.
+ */
+int ieee80211_count_sta_atomic(struct ieee80211_hw *hw);
 
 /**
  * ieee80211_queue_work - add work onto the mac80211 workqueue
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();
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index bd40b11..1096dac 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -461,37 +461,75 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw)
 }
 EXPORT_SYMBOL(ieee80211_wake_queues);
 
-void ieee80211_iterate_active_interfaces(
+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)
+{
+	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;
+	}
+	return 0;
+}
+
+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;
 
-	mutex_lock(&local->iflist_mtx);
+	if (do_atomic) {
+		rcu_read_lock();
 
-	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;
+		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);
+
 
-	mutex_unlock(&local->iflist_mtx);
+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);
 
@@ -501,33 +539,20 @@ void ieee80211_iterate_active_interfaces_atomic(
 			 struct ieee80211_vif *vif),
 	void *data)
 {
-	struct ieee80211_local *local = hw_to_local(hw);
-	struct ieee80211_sub_if_data *sdata;
+	ieee80211_iterate_interfaces_helper(hw, true, false, iterator, data);
+}
+EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_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;
-		}
-		if (ieee80211_sdata_running(sdata))
-			iterator(data, sdata->vif.addr,
-				 &sdata->vif);
-	}
 
-	rcu_read_unlock();
+/** Return a count of all station-like interfaces for
+ * this hardware.  Running/Stopped state has no affect.
+ */
+int ieee80211_count_sta_atomic(struct ieee80211_hw *hw)
+{
+	return ieee80211_iterate_interfaces_helper(hw, true, false, NULL, NULL);
 }
-EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
+EXPORT_SYMBOL_GPL(ieee80211_count_sta_atomic);
 
 /*
  * Nothing should have been stuffed into the workqueue during

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-10 20:07 ` Ben Greear
  0 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-10 20:07 UTC (permalink / raw)
  To: ath9k-devel

The attached patch lets mac80111 create multiple STA on the same
AP, and the changes to ath9k let it function properly, at least for
un-encrypted traffic.  WPA does not work..no idea why yet.

It also consolidates some of the util.c iterator logic in
mac80211.

Please let me know if this is moving in the right direction.

Thanks,
Ben

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


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: wt-36-vsta-ok-c.patch
Url: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20100910/2bb9cea1/attachment-0001.txt 

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-10 20:07 ` [ath9k-devel] " Ben Greear
@ 2010-09-10 21:12   ` Johannes Berg
  -1 siblings, 0 replies; 20+ messages in thread
From: Johannes Berg @ 2010-09-10 21:12 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org


On Fri, 10 Sep 2010 13:07:20 -0700, Ben Greear <greearb@candelatech.com>
wrote:
> It also consolidates some of the util.c iterator logic in
> mac80211.

That really ought to be a different patch.

And I don't think I like the counting in mac80211 -- it's just overhead
(EXPORT_SYMBOL etc) and a very simple implementation in the driver itself.

johannes

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-10 21:12   ` Johannes Berg
  0 siblings, 0 replies; 20+ messages in thread
From: Johannes Berg @ 2010-09-10 21:12 UTC (permalink / raw)
  To: ath9k-devel


On Fri, 10 Sep 2010 13:07:20 -0700, Ben Greear <greearb@candelatech.com>
wrote:
> It also consolidates some of the util.c iterator logic in
> mac80211.

That really ought to be a different patch.

And I don't think I like the counting in mac80211 -- it's just overhead
(EXPORT_SYMBOL etc) and a very simple implementation in the driver itself.

johannes

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-10 21:12   ` [ath9k-devel] " Johannes Berg
@ 2010-09-10 21:23     ` Ben Greear
  -1 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-10 21:23 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org

On 09/10/2010 02:12 PM, Johannes Berg wrote:
>
> On Fri, 10 Sep 2010 13:07:20 -0700, Ben Greear<greearb@candelatech.com>
> wrote:
>> It also consolidates some of the util.c iterator logic in
>> mac80211.
>
> That really ought to be a different patch.
>
> And I don't think I like the counting in mac80211 -- it's just overhead
> (EXPORT_SYMBOL etc) and a very simple implementation in the driver itself.

I can just use the helper method by itself if you don't want another
new method exposed to explicitly count interfaces.

As for counting, as far as I can tell, ath9k doesn't keep a list of
interfaces, but rather calls those iterator methods when it wants to
know them, so one way or another I need to call back into mac80211.

I'll break the patches apart for the next posting.

Did you get a chance to think more about this part of the patch?

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();

Thanks,
Ben


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


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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-10 21:23     ` Ben Greear
  0 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-10 21:23 UTC (permalink / raw)
  To: ath9k-devel

On 09/10/2010 02:12 PM, Johannes Berg wrote:
>
> On Fri, 10 Sep 2010 13:07:20 -0700, Ben Greear<greearb@candelatech.com>
> wrote:
>> It also consolidates some of the util.c iterator logic in
>> mac80211.
>
> That really ought to be a different patch.
>
> And I don't think I like the counting in mac80211 -- it's just overhead
> (EXPORT_SYMBOL etc) and a very simple implementation in the driver itself.

I can just use the helper method by itself if you don't want another
new method exposed to explicitly count interfaces.

As for counting, as far as I can tell, ath9k doesn't keep a list of
interfaces, but rather calls those iterator methods when it wants to
know them, so one way or another I need to call back into mac80211.

I'll break the patches apart for the next posting.

Did you get a chance to think more about this part of the patch?

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();

Thanks,
Ben


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

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-10 21:23     ` [ath9k-devel] " Ben Greear
@ 2010-09-10 21:27       ` Johannes Berg
  -1 siblings, 0 replies; 20+ messages in thread
From: Johannes Berg @ 2010-09-10 21:27 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org


On Fri, 10 Sep 2010 14:23:17 -0700, Ben Greear <greearb@candelatech.com>
wrote:
> As for counting, as far as I can tell, ath9k doesn't keep a list of
> interfaces, but rather calls those iterator methods when it wants to
> know them, so one way or another I need to call back into mac80211.

But it can just call the atomic iterator with a callback that
keeps the count.

> I'll break the patches apart for the next posting.
> 
> Did you get a chance to think more about this part of the patch?

No, I didn't, and since I'm at the wireless summit now it
seems unlikely that I'll get to it before I get/go back
home on Monday (US time morning).

johannes

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-10 21:27       ` Johannes Berg
  0 siblings, 0 replies; 20+ messages in thread
From: Johannes Berg @ 2010-09-10 21:27 UTC (permalink / raw)
  To: ath9k-devel


On Fri, 10 Sep 2010 14:23:17 -0700, Ben Greear <greearb@candelatech.com>
wrote:
> As for counting, as far as I can tell, ath9k doesn't keep a list of
> interfaces, but rather calls those iterator methods when it wants to
> know them, so one way or another I need to call back into mac80211.

But it can just call the atomic iterator with a callback that
keeps the count.

> I'll break the patches apart for the next posting.
> 
> Did you get a chance to think more about this part of the patch?

No, I didn't, and since I'm at the wireless summit now it
seems unlikely that I'll get to it before I get/go back
home on Monday (US time morning).

johannes

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-10 20:07 ` [ath9k-devel] " Ben Greear
@ 2010-09-13 12:14   ` Vasanthakumar Thiagarajan
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-09-13 12:14 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org

>  	/* configure operational mode */
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index b32c8f0..4ce4029 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) {

This seems bogus. why a check for hw at this point??. IIRS hw of
ah is not initialized at all, in that case this would fail always.
Did you test with these code?

> +	int avifs = ieee80211_count_sta_atomic(sc->hw);

If your aim here is to get the number of virtual interfaces
associated to a hw, sc->nvifs should work.

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-13 12:14   ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 20+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-09-13 12:14 UTC (permalink / raw)
  To: ath9k-devel

>  	/* configure operational mode */
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index b32c8f0..4ce4029 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) {

This seems bogus. why a check for hw at this point??. IIRS hw of
ah is not initialized at all, in that case this would fail always.
Did you test with these code?

> +	int avifs = ieee80211_count_sta_atomic(sc->hw);

If your aim here is to get the number of virtual interfaces
associated to a hw, sc->nvifs should work.

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-13 12:14   ` [ath9k-devel] " Vasanthakumar Thiagarajan
@ 2010-09-13 14:36     ` Ben Greear
  -1 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-13 14:36 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org

On 09/13/2010 05:14 AM, Vasanthakumar Thiagarajan wrote:
>>   	/* configure operational mode */
>> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
>> index b32c8f0..4ce4029 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) {
>
> This seems bogus. why a check for hw at this point??. IIRS hw of
> ah is not initialized at all, in that case this would fail always.
> Did you test with these code?

I did test it, and it worked for me.  Maybe we just shouldn't configure
the bssid mask in that method?  When using multiple VIFs, we need to do
the mask properly, and from what I can tell, when this method is called,
we do not have enough information to do that properly.

>
>> +	int avifs = ieee80211_count_sta_atomic(sc->hw);
>
> If your aim here is to get the number of virtual interfaces
> associated to a hw, sc->nvifs should work.

I'll check to see if this will work.

Thanks,
Ben

> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-13 14:36     ` Ben Greear
  0 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-13 14:36 UTC (permalink / raw)
  To: ath9k-devel

On 09/13/2010 05:14 AM, Vasanthakumar Thiagarajan wrote:
>>   	/* configure operational mode */
>> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
>> index b32c8f0..4ce4029 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) {
>
> This seems bogus. why a check for hw at this point??. IIRS hw of
> ah is not initialized at all, in that case this would fail always.
> Did you test with these code?

I did test it, and it worked for me.  Maybe we just shouldn't configure
the bssid mask in that method?  When using multiple VIFs, we need to do
the mask properly, and from what I can tell, when this method is called,
we do not have enough information to do that properly.

>
>> +	int avifs = ieee80211_count_sta_atomic(sc->hw);
>
> If your aim here is to get the number of virtual interfaces
> associated to a hw, sc->nvifs should work.

I'll check to see if this will work.

Thanks,
Ben

> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-13 12:14   ` [ath9k-devel] " Vasanthakumar Thiagarajan
@ 2010-09-13 19:23     ` Ben Greear
  -1 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-13 19:23 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linux-wireless, ath9k-devel@lists.ath9k.org

On 09/13/2010 05:14 AM, Vasanthakumar Thiagarajan wrote:

>> -	/* 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) {
>
> This seems bogus. why a check for hw at this point??. IIRS hw of
> ah is not initialized at all, in that case this would fail always.
> Did you test with these code?
>
>> +	int avifs = ieee80211_count_sta_atomic(sc->hw);
>
> If your aim here is to get the number of virtual interfaces
> associated to a hw, sc->nvifs should work.

Using nvifs seems to work fine.  I can respin that patch using
nvifs.

Any suggestions for fixing the bssid mask setting in ath_opmode_init?
My change, appears to work because it's set in ath9k_add_interface, even
if not in the ath_opmode_init method.

Thanks,
Ben


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


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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-13 19:23     ` Ben Greear
  0 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-13 19:23 UTC (permalink / raw)
  To: ath9k-devel

On 09/13/2010 05:14 AM, Vasanthakumar Thiagarajan wrote:

>> -	/* 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) {
>
> This seems bogus. why a check for hw at this point??. IIRS hw of
> ah is not initialized at all, in that case this would fail always.
> Did you test with these code?
>
>> +	int avifs = ieee80211_count_sta_atomic(sc->hw);
>
> If your aim here is to get the number of virtual interfaces
> associated to a hw, sc->nvifs should work.

Using nvifs seems to work fine.  I can respin that patch using
nvifs.

Any suggestions for fixing the bssid mask setting in ath_opmode_init?
My change, appears to work because it's set in ath9k_add_interface, even
if not in the ath_opmode_init method.

Thanks,
Ben


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

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-13 19:23     ` [ath9k-devel] " Ben Greear
@ 2010-09-14 13:46       ` Vasanthakumar Thiagarajan
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-09-14 13:46 UTC (permalink / raw)
  To: Ben Greear
  Cc: Vasanth Thiagarajan, linux-wireless, ath9k-devel@lists.ath9k.org

On Tue, Sep 14, 2010 at 12:53:29AM +0530, Ben Greear wrote:
> Any suggestions for fixing the bssid mask setting in ath_opmode_init?
> My change, appears to work because it's set in ath9k_add_interface, even
> if not in the ath_opmode_init method.

checking for ah->hw in ath_opmode_init() is buggy. bssid mask
configuration from ath9k_add_interface() may not work well when
some of the other vifs are in down state, may be this needs to
be in ath_opmode_init() without that incorrect check. 

Vasanth

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-14 13:46       ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 20+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-09-14 13:46 UTC (permalink / raw)
  To: ath9k-devel

On Tue, Sep 14, 2010 at 12:53:29AM +0530, Ben Greear wrote:
> Any suggestions for fixing the bssid mask setting in ath_opmode_init?
> My change, appears to work because it's set in ath9k_add_interface, even
> if not in the ath_opmode_init method.

checking for ah->hw in ath_opmode_init() is buggy. bssid mask
configuration from ath9k_add_interface() may not work well when
some of the other vifs are in down state, may be this needs to
be in ath_opmode_init() without that incorrect check. 

Vasanth

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-14 13:46       ` [ath9k-devel] " Vasanthakumar Thiagarajan
@ 2010-09-14 14:39         ` Ben Greear
  -1 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-14 14:39 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan
  Cc: Vasanth Thiagarajan, linux-wireless, ath9k-devel@lists.ath9k.org

On 09/14/2010 06:46 AM, Vasanthakumar Thiagarajan wrote:
> On Tue, Sep 14, 2010 at 12:53:29AM +0530, Ben Greear wrote:
>> Any suggestions for fixing the bssid mask setting in ath_opmode_init?
>> My change, appears to work because it's set in ath9k_add_interface, even
>> if not in the ath_opmode_init method.
>
> checking for ah->hw in ath_opmode_init() is buggy. bssid mask
> configuration from ath9k_add_interface() may not work well when
> some of the other vifs are in down state, may be this needs to
> be in ath_opmode_init() without that incorrect check.

It seems we need the ah->hw object to get the list of interfaces, but
ah->hw is NULL in ath_opmode_init.  Is there another way to get the
list of interfaces so we can iterate over them to build the ssid mask?

Thanks,
Ben

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

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-14 14:39         ` Ben Greear
  0 siblings, 0 replies; 20+ messages in thread
From: Ben Greear @ 2010-09-14 14:39 UTC (permalink / raw)
  To: ath9k-devel

On 09/14/2010 06:46 AM, Vasanthakumar Thiagarajan wrote:
> On Tue, Sep 14, 2010 at 12:53:29AM +0530, Ben Greear wrote:
>> Any suggestions for fixing the bssid mask setting in ath_opmode_init?
>> My change, appears to work because it's set in ath9k_add_interface, even
>> if not in the ath_opmode_init method.
>
> checking for ah->hw in ath_opmode_init() is buggy. bssid mask
> configuration from ath9k_add_interface() may not work well when
> some of the other vifs are in down state, may be this needs to
> be in ath_opmode_init() without that incorrect check.

It seems we need the ah->hw object to get the list of interfaces, but
ah->hw is NULL in ath_opmode_init.  Is there another way to get the
list of interfaces so we can iterate over them to build the ssid mask?

Thanks,
Ben

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

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

* Re: RFC:  v3: Support multiple STA on same AP with ath9k
  2010-09-14 14:39         ` [ath9k-devel] " Ben Greear
@ 2010-09-14 14:44           ` Vasanthakumar Thiagarajan
  -1 siblings, 0 replies; 20+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-09-14 14:44 UTC (permalink / raw)
  To: Ben Greear
  Cc: Vasanth Thiagarajan, linux-wireless, ath9k-devel@lists.ath9k.org

On Tue, Sep 14, 2010 at 08:09:54PM +0530, Ben Greear wrote:
> On 09/14/2010 06:46 AM, Vasanthakumar Thiagarajan wrote:
> > On Tue, Sep 14, 2010 at 12:53:29AM +0530, Ben Greear wrote:
> >> Any suggestions for fixing the bssid mask setting in ath_opmode_init?
> >> My change, appears to work because it's set in ath9k_add_interface, even
> >> if not in the ath_opmode_init method.
> >
> > checking for ah->hw in ath_opmode_init() is buggy. bssid mask
> > configuration from ath9k_add_interface() may not work well when
> > some of the other vifs are in down state, may be this needs to
> > be in ath_opmode_init() without that incorrect check.
> 
> It seems we need the ah->hw object to get the list of interfaces, but
> ah->hw is NULL in ath_opmode_init.  Is there another way to get the
> list of interfaces so we can iterate over them to build the ssid mask?

common->hw.

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

* [ath9k-devel] RFC: v3: Support multiple STA on same AP with ath9k
@ 2010-09-14 14:44           ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 20+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-09-14 14:44 UTC (permalink / raw)
  To: ath9k-devel

On Tue, Sep 14, 2010 at 08:09:54PM +0530, Ben Greear wrote:
> On 09/14/2010 06:46 AM, Vasanthakumar Thiagarajan wrote:
> > On Tue, Sep 14, 2010 at 12:53:29AM +0530, Ben Greear wrote:
> >> Any suggestions for fixing the bssid mask setting in ath_opmode_init?
> >> My change, appears to work because it's set in ath9k_add_interface, even
> >> if not in the ath_opmode_init method.
> >
> > checking for ah->hw in ath_opmode_init() is buggy. bssid mask
> > configuration from ath9k_add_interface() may not work well when
> > some of the other vifs are in down state, may be this needs to
> > be in ath_opmode_init() without that incorrect check.
> 
> It seems we need the ah->hw object to get the list of interfaces, but
> ah->hw is NULL in ath_opmode_init.  Is there another way to get the
> list of interfaces so we can iterate over them to build the ssid mask?

common->hw.

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

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

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10 20:07 RFC: v3: Support multiple STA on same AP with ath9k Ben Greear
2010-09-10 20:07 ` [ath9k-devel] " Ben Greear
2010-09-10 21:12 ` Johannes Berg
2010-09-10 21:12   ` [ath9k-devel] " Johannes Berg
2010-09-10 21:23   ` Ben Greear
2010-09-10 21:23     ` [ath9k-devel] " Ben Greear
2010-09-10 21:27     ` Johannes Berg
2010-09-10 21:27       ` [ath9k-devel] " Johannes Berg
2010-09-13 12:14 ` Vasanthakumar Thiagarajan
2010-09-13 12:14   ` [ath9k-devel] " Vasanthakumar Thiagarajan
2010-09-13 14:36   ` Ben Greear
2010-09-13 14:36     ` [ath9k-devel] " Ben Greear
2010-09-13 19:23   ` Ben Greear
2010-09-13 19:23     ` [ath9k-devel] " Ben Greear
2010-09-14 13:46     ` Vasanthakumar Thiagarajan
2010-09-14 13:46       ` [ath9k-devel] " Vasanthakumar Thiagarajan
2010-09-14 14:39       ` Ben Greear
2010-09-14 14:39         ` [ath9k-devel] " Ben Greear
2010-09-14 14:44         ` Vasanthakumar Thiagarajan
2010-09-14 14:44           ` [ath9k-devel] " Vasanthakumar Thiagarajan

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.