linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] wl12xx: various patches
@ 2012-03-04  8:55 Eliad Peller
  2012-03-04  8:55 ` [PATCH 01/11] wl12xx: don't start dev role on ibss vifs Eliad Peller
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Some various patches pending in my queue. Mostly
address issues related to multi-vif and the
auth/assoc redesign.

Eliad Peller (11):
  wl12xx: don't start dev role on ibss vifs
  wl12xx: consider bss_conf->idle instead of hw->conf.flags
  wl12xx: implement sta_state callback
  wl12xx: set authorized AP on sta_state notification
  wl12xx: increment session_counter for device role as well
  wl12xx: set correct vif type in change_interface callback
  wl12xx: don't handle change_channel while associated
  wl12xx: don't allow scanning while device is in ROC
  wl12xx: configure the correct beacon_interval
  wl12xx: avoid bug_on_recovery during fw switch
  wl12xx: print the tx packet len

 drivers/net/wireless/wl12xx/cmd.c    |    2 +-
 drivers/net/wireless/wl12xx/main.c   |  321 ++++++++++++++--------------------
 drivers/net/wireless/wl12xx/wl12xx.h |    4 +-
 3 files changed, 134 insertions(+), 193 deletions(-)

-- 
1.7.6.401.g6a319


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

* [PATCH 01/11] wl12xx: don't start dev role on ibss vifs
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 02/11] wl12xx: consider bss_conf->idle instead of hw->conf.flags Eliad Peller
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

device role is used for scanning and sending packets
before connection. however, since we don't need to
send packets before ibss creation, there is no need
to start the device on idle-off.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 418b2b8..93636ea 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3746,10 +3746,8 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
 			ibss_joined = true;
 		} else {
 			if (test_and_clear_bit(WLVIF_FLAG_IBSS_JOINED,
-					       &wlvif->flags)) {
+					       &wlvif->flags))
 				wl1271_unjoin(wl, wlvif);
-				wl12xx_start_dev(wl, wlvif);
-			}
 		}
 	}
 
@@ -3767,7 +3765,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
 		do_join = true;
 	}
 
-	if (changed & BSS_CHANGED_IDLE) {
+	if (changed & BSS_CHANGED_IDLE && !is_ibss) {
 		ret = wl1271_sta_handle_idle(wl, wlvif, bss_conf->idle);
 		if (ret < 0)
 			wl1271_warning("idle mode change failed %d", ret);
-- 
1.7.6.401.g6a319


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

* [PATCH 02/11] wl12xx: consider bss_conf->idle instead of hw->conf.flags
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
  2012-03-04  8:55 ` [PATCH 01/11] wl12xx: don't start dev role on ibss vifs Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 03/11] wl12xx: implement sta_state callback Eliad Peller
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

On disassociation, check only whether the current vif
is idle, instead of checking whether the device is idle.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 93636ea..b771106 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3901,7 +3901,6 @@ sta_not_found:
 
 			/* restore the bssid filter and go to dummy bssid */
 			if (was_assoc) {
-				u32 conf_flags = wl->hw->conf.flags;
 				/*
 				 * we might have to disable roc, if there was
 				 * no IF_OPER_UP notification.
@@ -3924,7 +3923,7 @@ sta_not_found:
 				}
 
 				wl1271_unjoin(wl, wlvif);
-				if (!(conf_flags & IEEE80211_CONF_IDLE))
+				if (!bss_conf->idle)
 					wl12xx_start_dev(wl, wlvif);
 			}
 		}
-- 
1.7.6.401.g6a319


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

* [PATCH 03/11] wl12xx: implement sta_state callback
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
  2012-03-04  8:55 ` [PATCH 01/11] wl12xx: don't start dev role on ibss vifs Eliad Peller
  2012-03-04  8:55 ` [PATCH 02/11] wl12xx: consider bss_conf->idle instead of hw->conf.flags Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 04/11] wl12xx: set authorized AP on sta_state notification Eliad Peller
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Implement sta_state callback instead of the
sta_add/remove callbacks.

Update the fw regarding peer state and ht caps
only after the station was authorized. Otherwise,
the fw might try establishing BA session before
the sta is authorized.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |  137 +++++++++++++++++++++--------------
 1 files changed, 82 insertions(+), 55 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index b771106..8569ac3 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -4233,100 +4233,128 @@ void wl1271_free_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid)
 	wl->active_sta_count--;
 }
 
-static int wl1271_op_sta_add(struct ieee80211_hw *hw,
-			     struct ieee80211_vif *vif,
-			     struct ieee80211_sta *sta)
+static int wl12xx_sta_add(struct wl1271 *wl,
+			  struct wl12xx_vif *wlvif,
+			  struct ieee80211_sta *sta)
 {
-	struct wl1271 *wl = hw->priv;
-	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
 	struct wl1271_station *wl_sta;
 	int ret = 0;
 	u8 hlid;
 
-	mutex_lock(&wl->mutex);
-
-	if (unlikely(wl->state == WL1271_STATE_OFF))
-		goto out;
-
-	if (wlvif->bss_type != BSS_TYPE_AP_BSS)
-		goto out;
-
 	wl1271_debug(DEBUG_MAC80211, "mac80211 add sta %d", (int)sta->aid);
 
 	ret = wl1271_allocate_sta(wl, wlvif, sta);
 	if (ret < 0)
-		goto out;
+		return ret;
 
 	wl_sta = (struct wl1271_station *)sta->drv_priv;
 	hlid = wl_sta->hlid;
 
-	ret = wl1271_ps_elp_wakeup(wl);
-	if (ret < 0)
-		goto out_free_sta;
-
 	ret = wl12xx_cmd_add_peer(wl, wlvif, sta, hlid);
 	if (ret < 0)
-		goto out_sleep;
+		wl1271_free_sta(wl, wlvif, hlid);
 
-	ret = wl12xx_cmd_set_peer_state(wl, hlid);
-	if (ret < 0)
-		goto out_sleep;
+	return ret;
+}
 
-	ret = wl1271_acx_set_ht_capabilities(wl, &sta->ht_cap, true, hlid);
-	if (ret < 0)
-		goto out_sleep;
+static int wl12xx_sta_remove(struct wl1271 *wl,
+			     struct wl12xx_vif *wlvif,
+			     struct ieee80211_sta *sta)
+{
+	struct wl1271_station *wl_sta;
+	int ret = 0, id;
 
-out_sleep:
-	wl1271_ps_elp_sleep(wl);
+	wl1271_debug(DEBUG_MAC80211, "mac80211 remove sta %d", (int)sta->aid);
+
+	wl_sta = (struct wl1271_station *)sta->drv_priv;
+	id = wl_sta->hlid;
+	if (WARN_ON(!test_bit(id, wlvif->ap.sta_hlid_map)))
+		return -EINVAL;
 
-out_free_sta:
+	ret = wl12xx_cmd_remove_peer(wl, wl_sta->hlid);
 	if (ret < 0)
-		wl1271_free_sta(wl, wlvif, hlid);
+		return ret;
 
-out:
-	mutex_unlock(&wl->mutex);
+	wl1271_free_sta(wl, wlvif, wl_sta->hlid);
 	return ret;
 }
 
-static int wl1271_op_sta_remove(struct ieee80211_hw *hw,
-				struct ieee80211_vif *vif,
-				struct ieee80211_sta *sta)
+static int wl12xx_update_sta_state(struct wl1271 *wl,
+				   struct wl12xx_vif *wlvif,
+				   struct ieee80211_sta *sta,
+				   enum ieee80211_sta_state old_state,
+				   enum ieee80211_sta_state new_state)
 {
-	struct wl1271 *wl = hw->priv;
-	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
 	struct wl1271_station *wl_sta;
-	int ret = 0, id;
+	u8 hlid;
+	bool is_ap = wlvif->bss_type == BSS_TYPE_AP_BSS;
+	bool is_sta = wlvif->bss_type == BSS_TYPE_STA_BSS;
+	int ret;
 
-	mutex_lock(&wl->mutex);
+	wl_sta = (struct wl1271_station *)sta->drv_priv;
+	hlid = wl_sta->hlid;
 
-	if (unlikely(wl->state == WL1271_STATE_OFF))
-		goto out;
+	/* Add station (AP mode) */
+	if (is_ap &&
+	    old_state == IEEE80211_STA_NOTEXIST &&
+	    new_state == IEEE80211_STA_NONE)
+		return wl12xx_sta_add(wl, wlvif, sta);
+
+	/* Remove station (AP mode) */
+	if (is_ap &&
+	    old_state == IEEE80211_STA_NONE &&
+	    new_state == IEEE80211_STA_NOTEXIST) {
+		/* must not fail */
+		wl12xx_sta_remove(wl, wlvif, sta);
+		return 0;
+	}
 
-	if (wlvif->bss_type != BSS_TYPE_AP_BSS)
-		goto out;
+	/* Authorize station (AP mode) */
+	if (is_ap &&
+	    new_state == IEEE80211_STA_AUTHORIZED) {
+		ret = wl12xx_cmd_set_peer_state(wl, hlid);
+		if (ret < 0)
+			return ret;
 
-	wl1271_debug(DEBUG_MAC80211, "mac80211 remove sta %d", (int)sta->aid);
+		ret = wl1271_acx_set_ht_capabilities(wl, &sta->ht_cap, true,
+						     hlid);
+		return ret;
+	}
 
-	wl_sta = (struct wl1271_station *)sta->drv_priv;
-	id = wl_sta->hlid;
-	if (WARN_ON(!test_bit(id, wlvif->ap.sta_hlid_map)))
+	return 0;
+}
+
+static int wl12xx_op_sta_state(struct ieee80211_hw *hw,
+			       struct ieee80211_vif *vif,
+			       struct ieee80211_sta *sta,
+			       enum ieee80211_sta_state old_state,
+			       enum ieee80211_sta_state new_state)
+{
+	struct wl1271 *wl = hw->priv;
+	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
+	int ret;
+
+	wl1271_debug(DEBUG_MAC80211, "mac80211 sta %d state=%d->%d",
+		     sta->aid, old_state, new_state);
+
+	mutex_lock(&wl->mutex);
+
+	if (unlikely(wl->state == WL1271_STATE_OFF)) {
+		ret = -EBUSY;
 		goto out;
+	}
 
 	ret = wl1271_ps_elp_wakeup(wl);
 	if (ret < 0)
 		goto out;
 
-	ret = wl12xx_cmd_remove_peer(wl, wl_sta->hlid);
-	if (ret < 0)
-		goto out_sleep;
+	ret = wl12xx_update_sta_state(wl, wlvif, sta, old_state, new_state);
 
-	wl1271_free_sta(wl, wlvif, wl_sta->hlid);
-
-out_sleep:
 	wl1271_ps_elp_sleep(wl);
-
 out:
 	mutex_unlock(&wl->mutex);
+	if (new_state < old_state)
+		return 0;
 	return ret;
 }
 
@@ -4795,8 +4823,7 @@ static const struct ieee80211_ops wl1271_ops = {
 	.conf_tx = wl1271_op_conf_tx,
 	.get_tsf = wl1271_op_get_tsf,
 	.get_survey = wl1271_op_get_survey,
-	.sta_add = wl1271_op_sta_add,
-	.sta_remove = wl1271_op_sta_remove,
+	.sta_state = wl12xx_op_sta_state,
 	.ampdu_action = wl1271_op_ampdu_action,
 	.tx_frames_pending = wl1271_tx_frames_pending,
 	.set_bitrate_mask = wl12xx_set_bitrate_mask,
-- 
1.7.6.401.g6a319


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

* [PATCH 04/11] wl12xx: set authorized AP on sta_state notification
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (2 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 03/11] wl12xx: implement sta_state callback Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 05/11] wl12xx: increment session_counter for device role as well Eliad Peller
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

wl12xx currently looks for AP authorization by registering
a netdev notifier and waiting for the IF_OPER_UP notification,
which is quite cumbersome.

Use the newly introduced sta_state callback (waiting
for assoc -> auth notification) instead, in order to
simplify it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c   |  117 ++++++---------------------------
 drivers/net/wireless/wl12xx/wl12xx.h |    3 +-
 2 files changed, 23 insertions(+), 97 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 8569ac3..a330b0c 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -392,15 +392,15 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
 static void wl1271_op_stop(struct ieee80211_hw *hw);
 static void wl1271_free_ap_keys(struct wl1271 *wl, struct wl12xx_vif *wlvif);
 
-static DEFINE_MUTEX(wl_list_mutex);
-static LIST_HEAD(wl_list);
-
-static int wl1271_check_operstate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
-				  unsigned char operstate)
+static int wl12xx_set_authorized(struct wl1271 *wl,
+				 struct wl12xx_vif *wlvif)
 {
 	int ret;
 
-	if (operstate != IF_OPER_UP)
+	if (WARN_ON(wlvif->bss_type != BSS_TYPE_STA_BSS))
+		return -EINVAL;
+
+	if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
 		return 0;
 
 	if (test_and_set_bit(WLVIF_FLAG_STA_STATE_SENT, &wlvif->flags))
@@ -415,76 +415,6 @@ static int wl1271_check_operstate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 	wl1271_info("Association completed.");
 	return 0;
 }
-static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
-			     void *arg)
-{
-	struct net_device *dev = arg;
-	struct wireless_dev *wdev;
-	struct wiphy *wiphy;
-	struct ieee80211_hw *hw;
-	struct wl1271 *wl;
-	struct wl1271 *wl_temp;
-	struct wl12xx_vif *wlvif;
-	int ret = 0;
-
-	/* Check that this notification is for us. */
-	if (what != NETDEV_CHANGE)
-		return NOTIFY_DONE;
-
-	wdev = dev->ieee80211_ptr;
-	if (wdev == NULL)
-		return NOTIFY_DONE;
-
-	wiphy = wdev->wiphy;
-	if (wiphy == NULL)
-		return NOTIFY_DONE;
-
-	hw = wiphy_priv(wiphy);
-	if (hw == NULL)
-		return NOTIFY_DONE;
-
-	wl_temp = hw->priv;
-	mutex_lock(&wl_list_mutex);
-	list_for_each_entry(wl, &wl_list, list) {
-		if (wl == wl_temp)
-			break;
-	}
-	mutex_unlock(&wl_list_mutex);
-	if (wl != wl_temp)
-		return NOTIFY_DONE;
-
-	mutex_lock(&wl->mutex);
-
-	if (wl->state == WL1271_STATE_OFF)
-		goto out;
-
-	if (dev->operstate != IF_OPER_UP)
-		goto out;
-	/*
-	 * The correct behavior should be just getting the appropriate wlvif
-	 * from the given dev, but currently we don't have a mac80211
-	 * interface for it.
-	 */
-	wl12xx_for_each_wlvif_sta(wl, wlvif) {
-		struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
-
-		if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
-			continue;
-
-		ret = wl1271_ps_elp_wakeup(wl);
-		if (ret < 0)
-			goto out;
-
-		wl1271_check_operstate(wl, wlvif,
-				       ieee80211_get_operstate(vif));
-
-		wl1271_ps_elp_sleep(wl);
-	}
-out:
-	mutex_unlock(&wl->mutex);
-
-	return NOTIFY_OK;
-}
 
 static int wl1271_reg_notify(struct wiphy *wiphy,
 			     struct regulatory_request *request)
@@ -1626,10 +1556,6 @@ static struct sk_buff *wl12xx_alloc_dummy_packet(struct wl1271 *wl)
 }
 
 
-static struct notifier_block wl1271_dev_notifier = {
-	.notifier_call = wl1271_dev_notify,
-};
-
 #ifdef CONFIG_PM
 static int wl1271_configure_suspend_sta(struct wl1271 *wl,
 					struct wl12xx_vif *wlvif)
@@ -1856,10 +1782,6 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
 	wl->state = WL1271_STATE_OFF;
 	mutex_unlock(&wl->mutex);
 
-	mutex_lock(&wl_list_mutex);
-	list_del(&wl->list);
-	mutex_unlock(&wl_list_mutex);
-
 	wl1271_flush_deferred_work(wl);
 	cancel_delayed_work_sync(&wl->scan_complete_work);
 	cancel_work_sync(&wl->netstack_work);
@@ -2270,11 +2192,6 @@ out:
 out_unlock:
 	mutex_unlock(&wl->mutex);
 
-	mutex_lock(&wl_list_mutex);
-	if (!ret)
-		list_add(&wl->list, &wl_list);
-	mutex_unlock(&wl_list_mutex);
-
 	return ret;
 }
 
@@ -3967,8 +3884,8 @@ sta_not_found:
 			if (ret < 0)
 				goto out;
 
-			wl1271_check_operstate(wl, wlvif,
-					       ieee80211_get_operstate(vif));
+			if (test_bit(WLVIF_FLAG_STA_AUTHORIZED, &wlvif->flags))
+				wl12xx_set_authorized(wl, wlvif);
 		}
 		/*
 		 * stop device role if started (we might already be in
@@ -4321,6 +4238,20 @@ static int wl12xx_update_sta_state(struct wl1271 *wl,
 		return ret;
 	}
 
+	/* Authorize station */
+	if (is_sta &&
+	    new_state == IEEE80211_STA_AUTHORIZED) {
+		set_bit(WLVIF_FLAG_STA_AUTHORIZED, &wlvif->flags);
+		return wl12xx_set_authorized(wl, wlvif);
+	}
+
+	if (is_sta &&
+	    old_state == IEEE80211_STA_AUTHORIZED &&
+	    new_state == IEEE80211_STA_ASSOC) {
+		clear_bit(WLVIF_FLAG_STA_AUTHORIZED, &wlvif->flags);
+		return 0;
+	}
+
 	return 0;
 }
 
@@ -5144,8 +5075,6 @@ static int wl1271_register_hw(struct wl1271 *wl)
 
 	wl1271_debugfs_init(wl);
 
-	register_netdevice_notifier(&wl1271_dev_notifier);
-
 	wl1271_notice("loaded");
 
 out:
@@ -5157,7 +5086,6 @@ static void wl1271_unregister_hw(struct wl1271 *wl)
 	if (wl->plt)
 		wl1271_plt_stop(wl);
 
-	unregister_netdevice_notifier(&wl1271_dev_notifier);
 	ieee80211_unregister_hw(wl->hw);
 	wl->mac80211_registered = false;
 
@@ -5278,7 +5206,6 @@ static struct ieee80211_hw *wl1271_alloc_hw(void)
 	wl = hw->priv;
 	memset(wl, 0, sizeof(*wl));
 
-	INIT_LIST_HEAD(&wl->list);
 	INIT_LIST_HEAD(&wl->wlvif_list);
 
 	wl->hw = hw;
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 9035241..b26b1be 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -265,6 +265,7 @@ enum wl12xx_flags {
 enum wl12xx_vif_flags {
 	WLVIF_FLAG_INITIALIZED,
 	WLVIF_FLAG_STA_ASSOCIATED,
+	WLVIF_FLAG_STA_AUTHORIZED,
 	WLVIF_FLAG_IBSS_JOINED,
 	WLVIF_FLAG_AP_STARTED,
 	WLVIF_FLAG_IN_PS,
@@ -452,8 +453,6 @@ struct wl1271 {
 
 	bool enable_11a;
 
-	struct list_head list;
-
 	/* Most recently reported noise in dBm */
 	s8 noise;
 
-- 
1.7.6.401.g6a319


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

* [PATCH 05/11] wl12xx: increment session_counter for device role as well
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (3 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 04/11] wl12xx: set authorized AP on sta_state notification Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 06/11] wl12xx: set correct vif type in change_interface callback Eliad Peller
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

The sesssion_counter has to be incremented each time
the dev is started (similar to sta role).

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/cmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index ae1f3d7..1ef212f 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -531,7 +531,7 @@ static int wl12xx_cmd_role_start_dev(struct wl1271 *wl,
 			goto out_free;
 	}
 	cmd->device.hlid = wlvif->dev_hlid;
-	cmd->device.session = wlvif->session_counter;
+	cmd->device.session = wl12xx_get_new_session_id(wl, wlvif);
 
 	wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d",
 		     cmd->role_id, cmd->device.hlid, cmd->device.session);
-- 
1.7.6.401.g6a319


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

* [PATCH 06/11] wl12xx: set correct vif type in change_interface callback
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (4 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 05/11] wl12xx: increment session_counter for device role as well Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 07/11] wl12xx: don't handle change_channel while associated Eliad Peller
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

In some cases, the wrong vif type was set in the
change_interface callback (P2P_CLIENT/P2P_GO instead
of STA/AP)

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a330b0c..65f91d7 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2336,7 +2336,7 @@ static int wl12xx_op_change_interface(struct ieee80211_hw *hw,
 	set_bit(WL1271_FLAG_VIF_CHANGE_IN_PROGRESS, &wl->flags);
 	wl1271_op_remove_interface(hw, vif);
 
-	vif->type = ieee80211_iftype_p2p(new_type, p2p);
+	vif->type = new_type;
 	vif->p2p = p2p;
 	ret = wl1271_op_add_interface(hw, vif);
 
-- 
1.7.6.401.g6a319


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

* [PATCH 07/11] wl12xx: don't handle change_channel while associated
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (5 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 06/11] wl12xx: set correct vif type in change_interface callback Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 08/11] wl12xx: don't allow scanning while device is in ROC Eliad Peller
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Currently, CHANGE_CHANNEL indication while
associated is considered as roaming attempt.

However, with the new auth/assoc redesign,
we no longer have to handle this case,
so remove it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |   43 ++++++++++++-----------------------
 1 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 65f91d7..85bbe7f 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2515,35 +2515,22 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 				wl1271_warning("rate policy for channel "
 					       "failed %d", ret);
 
-			if (test_bit(WLVIF_FLAG_STA_ASSOCIATED,
-				     &wlvif->flags)) {
-				if (wl12xx_dev_role_started(wlvif)) {
-					/* roaming */
-					ret = wl12xx_croc(wl,
-							  wlvif->dev_role_id);
-					if (ret < 0)
-						return ret;
-				}
-				ret = wl1271_join(wl, wlvif, false);
+			/*
+			 * change the ROC channel. do it only if we are
+			 * not idle. otherwise, CROC will be called
+			 * anyway.
+			 */
+			if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED,
+				      &wlvif->flags) &&
+			    wl12xx_dev_role_started(wlvif) &&
+			    !(conf->flags & IEEE80211_CONF_IDLE)) {
+				ret = wl12xx_stop_dev(wl, wlvif);
 				if (ret < 0)
-					wl1271_warning("cmd join on channel "
-						       "failed %d", ret);
-			} else {
-				/*
-				 * change the ROC channel. do it only if we are
-				 * not idle. otherwise, CROC will be called
-				 * anyway.
-				 */
-				if (wl12xx_dev_role_started(wlvif) &&
-				    !(conf->flags & IEEE80211_CONF_IDLE)) {
-					ret = wl12xx_stop_dev(wl, wlvif);
-					if (ret < 0)
-						return ret;
+					return ret;
 
-					ret = wl12xx_start_dev(wl, wlvif);
-					if (ret < 0)
-						return ret;
-				}
+				ret = wl12xx_start_dev(wl, wlvif);
+				if (ret < 0)
+					return ret;
 			}
 		}
 	}
-- 
1.7.6.401.g6a319


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

* [PATCH 08/11] wl12xx: don't allow scanning while device is in ROC
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (6 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 07/11] wl12xx: don't handle change_channel while associated Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 09/11] wl12xx: configure the correct beacon_interval Eliad Peller
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

return EBUSY on scan when there is any role
in ROC (not necessarily the one we are going
to use)

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 85bbe7f..1d5f2d5 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3057,8 +3057,6 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
 			     struct cfg80211_scan_request *req)
 {
 	struct wl1271 *wl = hw->priv;
-	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
-
 	int ret;
 	u8 *ssid = NULL;
 	size_t len = 0;
@@ -3086,8 +3084,8 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
 	if (ret < 0)
 		goto out;
 
-	if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) &&
-	    test_bit(wlvif->role_id, wl->roc_map)) {
+	/* fail if there is any role in ROC */
+	if (find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) {
 		/* don't allow scanning right now */
 		ret = -EBUSY;
 		goto out_sleep;
-- 
1.7.6.401.g6a319


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

* [PATCH 09/11] wl12xx: configure the correct beacon_interval
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (7 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 08/11] wl12xx: don't allow scanning while device is in ROC Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 10/11] wl12xx: avoid bug_on_recovery during fw switch Eliad Peller
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

We didn't update the beacon interval on association
(or on a change notification when working as sta),
so the default interval (100ms) was always used.

Update the beacon interval according to the bss_conf
before starting the sta role (on association).

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 1d5f2d5..89bf9ea 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3723,6 +3723,7 @@ sta_not_found:
 			u32 rates;
 			int ieoffset;
 			wlvif->aid = bss_conf->aid;
+			wlvif->beacon_int = bss_conf->beacon_int;
 			set_assoc = true;
 
 			/*
-- 
1.7.6.401.g6a319


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

* [PATCH 10/11] wl12xx: avoid bug_on_recovery during fw switch
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (8 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 09/11] wl12xx: configure the correct beacon_interval Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-04  8:55 ` [PATCH 11/11] wl12xx: print the tx packet len Eliad Peller
  2012-03-05 14:28 ` [PATCH 00/11] wl12xx: various patches Luciano Coelho
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Add a flag to indicate we initiated a recovery work
on purpose, in order to avoid triggering BUG() (when
the bug_on_recovery module param was set).

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c   |    5 ++++-
 drivers/net/wireless/wl12xx/wl12xx.h |    1 +
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 89bf9ea..3c966f2 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1154,7 +1154,8 @@ static void wl1271_recovery_work(struct work_struct *work)
 	wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x",
 		    wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4));
 
-	BUG_ON(bug_on_recovery);
+	BUG_ON(bug_on_recovery &&
+	       !test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags));
 
 	/*
 	 * Advance security sequence number to overcome potential progress
@@ -2133,6 +2134,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 
 	if (wl12xx_need_fw_change(wl, vif_count, true)) {
 		wl12xx_force_active_psm(wl);
+		set_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags);
 		mutex_unlock(&wl->mutex);
 		wl1271_recovery_work(&wl->recovery_work);
 		return 0;
@@ -2317,6 +2319,7 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
 	WARN_ON(iter != wlvif);
 	if (wl12xx_need_fw_change(wl, vif_count, false)) {
 		wl12xx_force_active_psm(wl);
+		set_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags);
 		wl12xx_queue_recovery_work(wl);
 		cancel_recovery = false;
 	}
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index b26b1be..6e13a30 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -260,6 +260,7 @@ enum wl12xx_flags {
 	WL1271_FLAG_SOFT_GEMINI,
 	WL1271_FLAG_RECOVERY_IN_PROGRESS,
 	WL1271_FLAG_VIF_CHANGE_IN_PROGRESS,
+	WL1271_FLAG_INTENDED_FW_RECOVERY,
 };
 
 enum wl12xx_vif_flags {
-- 
1.7.6.401.g6a319


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

* [PATCH 11/11] wl12xx: print the tx packet len
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (9 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 10/11] wl12xx: avoid bug_on_recovery during fw switch Eliad Peller
@ 2012-03-04  8:55 ` Eliad Peller
  2012-03-05 14:28 ` [PATCH 00/11] wl12xx: various patches Luciano Coelho
  11 siblings, 0 replies; 13+ messages in thread
From: Eliad Peller @ 2012-03-04  8:55 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Add the packet length to the tx debug print.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 3c966f2..95a76a5 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1459,7 +1459,8 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 		goto out;
 	}
 
-	wl1271_debug(DEBUG_TX, "queue skb hlid %d q %d", hlid, q);
+	wl1271_debug(DEBUG_TX, "queue skb hlid %d q %d len %d",
+		     hlid, q, skb->len);
 	skb_queue_tail(&wl->links[hlid].tx_queue[q], skb);
 
 	wl->tx_queue_count[q]++;
-- 
1.7.6.401.g6a319


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

* Re: [PATCH 00/11] wl12xx: various patches
  2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
                   ` (10 preceding siblings ...)
  2012-03-04  8:55 ` [PATCH 11/11] wl12xx: print the tx packet len Eliad Peller
@ 2012-03-05 14:28 ` Luciano Coelho
  11 siblings, 0 replies; 13+ messages in thread
From: Luciano Coelho @ 2012-03-05 14:28 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On 03/04/2012 10:55 AM, Eliad Peller wrote:
> Some various patches pending in my queue. Mostly
> address issues related to multi-vif and the
> auth/assoc redesign.
>
> Eliad Peller (11):
>    wl12xx: don't start dev role on ibss vifs
>    wl12xx: consider bss_conf->idle instead of hw->conf.flags
>    wl12xx: implement sta_state callback
>    wl12xx: set authorized AP on sta_state notification
>    wl12xx: increment session_counter for device role as well
>    wl12xx: set correct vif type in change_interface callback
>    wl12xx: don't handle change_channel while associated
>    wl12xx: don't allow scanning while device is in ROC
>    wl12xx: configure the correct beacon_interval
>    wl12xx: avoid bug_on_recovery during fw switch
>    wl12xx: print the tx packet len
>
>   drivers/net/wireless/wl12xx/cmd.c    |    2 +-
>   drivers/net/wireless/wl12xx/main.c   |  321 ++++++++++++++--------------------
>   drivers/net/wireless/wl12xx/wl12xx.h |    4 +-
>   3 files changed, 134 insertions(+), 193 deletions(-)

Applied the series, thanks!

-- 
Cheers,
Luca.

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

end of thread, other threads:[~2012-03-05 14:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-04  8:55 [PATCH 00/11] wl12xx: various patches Eliad Peller
2012-03-04  8:55 ` [PATCH 01/11] wl12xx: don't start dev role on ibss vifs Eliad Peller
2012-03-04  8:55 ` [PATCH 02/11] wl12xx: consider bss_conf->idle instead of hw->conf.flags Eliad Peller
2012-03-04  8:55 ` [PATCH 03/11] wl12xx: implement sta_state callback Eliad Peller
2012-03-04  8:55 ` [PATCH 04/11] wl12xx: set authorized AP on sta_state notification Eliad Peller
2012-03-04  8:55 ` [PATCH 05/11] wl12xx: increment session_counter for device role as well Eliad Peller
2012-03-04  8:55 ` [PATCH 06/11] wl12xx: set correct vif type in change_interface callback Eliad Peller
2012-03-04  8:55 ` [PATCH 07/11] wl12xx: don't handle change_channel while associated Eliad Peller
2012-03-04  8:55 ` [PATCH 08/11] wl12xx: don't allow scanning while device is in ROC Eliad Peller
2012-03-04  8:55 ` [PATCH 09/11] wl12xx: configure the correct beacon_interval Eliad Peller
2012-03-04  8:55 ` [PATCH 10/11] wl12xx: avoid bug_on_recovery during fw switch Eliad Peller
2012-03-04  8:55 ` [PATCH 11/11] wl12xx: print the tx packet len Eliad Peller
2012-03-05 14:28 ` [PATCH 00/11] wl12xx: various patches Luciano Coelho

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