linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] cfg80211: combine two nested ifs into a single condition
@ 2017-02-20 13:24 Johannes Berg
  2017-02-20 13:24 ` [PATCH 2/6] ieee80211: add FT-PSK AKM suite selector Johannes Berg
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-20 13:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Combine two instances of having two nested if statements
into a single one with a combined condition to reduce the
indentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/core.c | 12 ++++++------
 net/wireless/util.c | 10 +++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 04143df20f7f..76e664144c8e 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1216,12 +1216,12 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
 		 */
 		if ((wdev->iftype == NL80211_IFTYPE_STATION ||
 		     wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) &&
-		    rdev->ops->set_power_mgmt)
-			if (rdev_set_power_mgmt(rdev, dev, wdev->ps,
-						wdev->ps_timeout)) {
-				/* assume this means it's off */
-				wdev->ps = false;
-			}
+		    rdev->ops->set_power_mgmt &&
+		    rdev_set_power_mgmt(rdev, dev, wdev->ps,
+					wdev->ps_timeout)) {
+			/* assume this means it's off */
+			wdev->ps = false;
+		}
 		break;
 	case NETDEV_UNREGISTER:
 		/*
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 68e5f2ecee1a..daef500a7b64 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -914,11 +914,11 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)
 			netdev_err(dev, "failed to set key %d\n", i);
 			continue;
 		}
-		if (wdev->connect_keys->def == i)
-			if (rdev_set_default_key(rdev, dev, i, true, true)) {
-				netdev_err(dev, "failed to set defkey %d\n", i);
-				continue;
-			}
+		if (wdev->connect_keys->def == i &&
+		    rdev_set_default_key(rdev, dev, i, true, true)) {
+			netdev_err(dev, "failed to set defkey %d\n", i);
+			continue;
+		}
 	}
 
 	kzfree(wdev->connect_keys);
-- 
2.9.3

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

* [PATCH 2/6] ieee80211: add FT-PSK AKM suite selector
  2017-02-20 13:24 [PATCH 1/6] cfg80211: combine two nested ifs into a single condition Johannes Berg
@ 2017-02-20 13:24 ` Johannes Berg
  2017-02-20 13:24 ` [PATCH 3/6] mac80211: fix power saving clients handling in iwlwifi Johannes Berg
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-20 13:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Avraham Stern

From: Avraham Stern <avraham.stern@intel.com>

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/linux/ieee80211.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 0dd9498c694f..6ea381c98aae 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2347,6 +2347,7 @@ enum ieee80211_sa_query_action {
 /* AKM suite selectors */
 #define WLAN_AKM_SUITE_8021X		SUITE(0x000FAC, 1)
 #define WLAN_AKM_SUITE_PSK		SUITE(0x000FAC, 2)
+#define WLAN_AKM_SUITE_FT_PSK		SUITE(0x000FAC, 4)
 #define WLAN_AKM_SUITE_8021X_SHA256	SUITE(0x000FAC, 5)
 #define WLAN_AKM_SUITE_PSK_SHA256	SUITE(0x000FAC, 6)
 #define WLAN_AKM_SUITE_TDLS		SUITE(0x000FAC, 7)
-- 
2.9.3

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

* [PATCH 3/6] mac80211: fix power saving clients handling in iwlwifi
  2017-02-20 13:24 [PATCH 1/6] cfg80211: combine two nested ifs into a single condition Johannes Berg
  2017-02-20 13:24 ` [PATCH 2/6] ieee80211: add FT-PSK AKM suite selector Johannes Berg
@ 2017-02-20 13:24 ` Johannes Berg
  2017-02-20 13:24 ` [PATCH 4/6] mac80211: flush delayed work when enter suspend Johannes Berg
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-20 13:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Emmanuel Grumbach

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

iwlwifi now supports RSS and can't let mac80211 track the
PS state based on the Rx frames since they can come out of
order. iwlwifi is now advertising AP_LINK_PS, and uses
explicit notifications to teach mac80211 about the PS state
of the stations and the PS poll / uAPSD trigger frames
coming our way from the peers.

Because of that, the TIM stopped being maintained in
mac80211. I tried to fix this in commit c68df2e7be0c
("mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
but that was later reverted by Felix in commit 6c18a6b4e799
("Revert "mac80211: allow using AP_LINK_PS with mac80211-generated TIM IE")
since it broke drivers that do not implement set_tim.

Since none of the drivers that set AP_LINK_PS have the
set_tim() handler set besides iwlwifi, I can bail out in
__sta_info_recalc_tim if AP_LINK_PS AND .set_tim is not
implemented.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/sta_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 4774e663a411..8bb99d299cda 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -688,7 +688,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
 	}
 
 	/* No need to do anything if the driver does all */
-	if (ieee80211_hw_check(&local->hw, AP_LINK_PS))
+	if (ieee80211_hw_check(&local->hw, AP_LINK_PS) && !local->ops->set_tim)
 		return;
 
 	if (sta->dead)
-- 
2.9.3

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

* [PATCH 4/6] mac80211: flush delayed work when enter suspend
  2017-02-20 13:24 [PATCH 1/6] cfg80211: combine two nested ifs into a single condition Johannes Berg
  2017-02-20 13:24 ` [PATCH 2/6] ieee80211: add FT-PSK AKM suite selector Johannes Berg
  2017-02-20 13:24 ` [PATCH 3/6] mac80211: fix power saving clients handling in iwlwifi Johannes Berg
@ 2017-02-20 13:24 ` Johannes Berg
  2017-02-20 13:24 ` [PATCH 5/6] mac80211: fix typo in debug print Johannes Berg
  2017-02-20 13:24 ` [PATCH 6/6] mac80211: shorten debug message Johannes Berg
  4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-20 13:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Matt Chen

From: Matt Chen <matt.chen@intel.com>

The issue was found when entering suspend and resume.
It triggers a warning in:
mac80211/key.c: ieee80211_enable_keys()
...
WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt ||
             sdata->crypto_tx_tailroom_pending_dec);
...

It points out sdata->crypto_tx_tailroom_pending_dec isn't cleaned up successfully
in a delayed_work during suspend. Add a flush_delayed_work to fix it.

type=bugfix
fixes=unknown
bug=chrome-os-partner:62283

Change-Id: Iad6b1c86c8792aae81934e7c205f44add10f062b
Signed-off-by: Matt Chen <matt.chen@intel.com>
Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/88500
Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
Reviewed-by: Coelho, Luciano <luciano.coelho@intel.com>
---
 net/mac80211/pm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 28a3a0957c9e..76a8bcd8ef11 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -168,6 +168,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
 			break;
 		}
 
+		flush_delayed_work(&sdata->dec_tailroom_needed_wk);
 		drv_remove_interface(local, sdata);
 	}
 
-- 
2.9.3

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

* [PATCH 5/6] mac80211: fix typo in debug print
  2017-02-20 13:24 [PATCH 1/6] cfg80211: combine two nested ifs into a single condition Johannes Berg
                   ` (2 preceding siblings ...)
  2017-02-20 13:24 ` [PATCH 4/6] mac80211: flush delayed work when enter suspend Johannes Berg
@ 2017-02-20 13:24 ` Johannes Berg
  2017-02-20 13:24 ` [PATCH 6/6] mac80211: shorten debug message Johannes Berg
  4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-20 13:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Sara Sharon

From: Sara Sharon <sara.sharon@intel.com>

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/agg-rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 3b5fd4188f2a..4463c61d068e 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -85,7 +85,7 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
 	ht_dbg(sta->sdata,
 	       "Rx BA session stop requested for %pM tid %u %s reason: %d\n",
 	       sta->sta.addr, tid,
-	       initiator == WLAN_BACK_RECIPIENT ? "recipient" : "inititator",
+	       initiator == WLAN_BACK_RECIPIENT ? "recipient" : "initiator",
 	       (int)reason);
 
 	if (drv_ampdu_action(local, sta->sdata, &params))
-- 
2.9.3

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

* [PATCH 6/6] mac80211: shorten debug message
  2017-02-20 13:24 [PATCH 1/6] cfg80211: combine two nested ifs into a single condition Johannes Berg
                   ` (3 preceding siblings ...)
  2017-02-20 13:24 ` [PATCH 5/6] mac80211: fix typo in debug print Johannes Berg
@ 2017-02-20 13:24 ` Johannes Berg
  4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-02-20 13:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Sara Sharon

From: Sara Sharon <sara.sharon@intel.com>

Tracing is limited to 100 characters and this message passes
the limit when there are a few buffered frames. Shorten it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/sta_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 8bb99d299cda..3323a2fb289b 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1264,7 +1264,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
 	sta_info_recalc_tim(sta);
 
 	ps_dbg(sdata,
-	       "STA %pM aid %d sending %d filtered/%d PS frames since STA not sleeping anymore\n",
+	       "STA %pM aid %d sending %d filtered/%d PS frames since STA woke up\n",
 	       sta->sta.addr, sta->sta.aid, filtered, buffered);
 
 	ieee80211_check_fast_xmit(sta);
-- 
2.9.3

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

end of thread, other threads:[~2017-02-20 13:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-20 13:24 [PATCH 1/6] cfg80211: combine two nested ifs into a single condition Johannes Berg
2017-02-20 13:24 ` [PATCH 2/6] ieee80211: add FT-PSK AKM suite selector Johannes Berg
2017-02-20 13:24 ` [PATCH 3/6] mac80211: fix power saving clients handling in iwlwifi Johannes Berg
2017-02-20 13:24 ` [PATCH 4/6] mac80211: flush delayed work when enter suspend Johannes Berg
2017-02-20 13:24 ` [PATCH 5/6] mac80211: fix typo in debug print Johannes Berg
2017-02-20 13:24 ` [PATCH 6/6] mac80211: shorten debug message Johannes Berg

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