All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] various mac80211 / cfg80211 patches
@ 2014-09-03 12:24 Emmanuel Grumbach
  2014-09-03 12:24 ` [PATCH 01/10] mac80211: add Intel Mobile Communications copyright Emmanuel Grumbach
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:24 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

Hi Johannes,

here are a few patches from our internal tree. You have already seen
most of them.

Assaf Krauss (3):
  nl80211: Allow declaring RRM-related features
  nl80211: Add flag attribute for RRM connections
  mac80211: Add RRM support to assoc request

Eliad Peller (3):
  cfg80211: avoid duplicate entries on regdomain intersection
  mac80211: adjust roc duration when combining ROCs
  mac80211: combine roc with the "next roc" if possible

Emmanuel Grumbach (1):
  mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period

Johannes Berg (2):
  mac80211: add Intel Mobile Communications copyright
  cfg80211: add Intel Mobile Communications copyright

Liad Kaufman (1):
  mac80211: fix description comment of ieee80211_subif_start_xmit

 include/linux/ieee80211.h    |  1 +
 include/net/cfg80211.h       |  3 ++
 include/net/mac80211.h       |  1 +
 include/uapi/linux/nl80211.h | 27 +++++++++++++++
 net/mac80211/cfg.c           | 77 ++++++++++++++++++++++++++++-------------
 net/mac80211/debugfs.c       |  1 +
 net/mac80211/debugfs_sta.c   |  1 +
 net/mac80211/ibss.c          |  1 +
 net/mac80211/ieee80211_i.h   |  2 ++
 net/mac80211/iface.c         |  1 +
 net/mac80211/key.c           |  1 +
 net/mac80211/main.c          |  1 +
 net/mac80211/mlme.c          | 16 +++++++--
 net/mac80211/rx.c            |  1 +
 net/mac80211/scan.c          |  1 +
 net/mac80211/sta_info.c      |  3 +-
 net/mac80211/sta_info.h      |  1 +
 net/mac80211/status.c        |  1 +
 net/mac80211/tdls.c          |  1 +
 net/mac80211/tx.c            |  6 ++--
 net/mac80211/util.c          |  1 +
 net/mac80211/wme.c           |  1 +
 net/wireless/chan.c          |  1 +
 net/wireless/core.c          |  1 +
 net/wireless/nl80211.c       | 18 ++++++++++
 net/wireless/reg.c           | 82 ++++++++++++++++++++++++++++++++------------
 net/wireless/scan.c          |  1 +
 net/wireless/util.c          |  1 +
 28 files changed, 202 insertions(+), 51 deletions(-)

-- 
1.9.1


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

* [PATCH 01/10] mac80211: add Intel Mobile Communications copyright
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
@ 2014-09-03 12:24 ` Emmanuel Grumbach
  2014-09-03 12:24 ` [PATCH 02/10] cfg80211: " Emmanuel Grumbach
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:24 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Emmanuel Grumbach

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

Our legal structure changed at some point (see wikipedia), but
we forgot to immediately switch over to the new copyright
notice.

For files that we have modified in the time since the change,
add the proper copyright notice now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/net/mac80211.h     | 1 +
 net/mac80211/cfg.c         | 1 +
 net/mac80211/debugfs.c     | 1 +
 net/mac80211/debugfs_sta.c | 1 +
 net/mac80211/ibss.c        | 1 +
 net/mac80211/ieee80211_i.h | 1 +
 net/mac80211/iface.c       | 1 +
 net/mac80211/key.c         | 1 +
 net/mac80211/main.c        | 1 +
 net/mac80211/mlme.c        | 1 +
 net/mac80211/rx.c          | 1 +
 net/mac80211/scan.c        | 1 +
 net/mac80211/sta_info.c    | 1 +
 net/mac80211/sta_info.h    | 1 +
 net/mac80211/status.c      | 1 +
 net/mac80211/tdls.c        | 1 +
 net/mac80211/tx.c          | 1 +
 net/mac80211/util.c        | 1 +
 net/mac80211/wme.c         | 1 +
 19 files changed, 19 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index dae2e24..dee3edd 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4,6 +4,7 @@
  * Copyright 2002-2005, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 927b4ea..6cd0a59e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2,6 +2,7 @@
  * mac80211 configuration hooks for cfg80211
  *
  * Copyright 2006-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This file is GPLv2 as found in COPYING.
  */
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 0e963bc..5746561 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -3,6 +3,7 @@
  * mac80211 debugfs for wireless PHYs
  *
  * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * GPLv2
  *
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 3db9664..619f00b 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -2,6 +2,7 @@
  * Copyright 2003-2005	Devicescape Software, Inc.
  * Copyright (c) 2006	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 9713dc5..5e0da74 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -6,6 +6,7 @@
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  * Copyright 2009, Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ef7a089..a0b89da 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -3,6 +3,7 @@
  * Copyright 2005, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 01eede7..3dc63aa 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -5,6 +5,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz>
  * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index d808cff..0102b30 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -3,6 +3,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007-2008	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e0ab432..0de7c93 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -2,6 +2,7 @@
  * Copyright 2002-2005, Instant802 Networks, Inc.
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 31a8afa..2b38968 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -5,6 +5,7 @@
  * Copyright 2005, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index bd2c9b2..0479b70 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3,6 +3,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index a0a9381..2d18652 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -6,6 +6,7 @@
  * Copyright 2005, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index c6ee213..6274cd7 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1,6 +1,7 @@
 /*
  * Copyright 2002-2005, Instant802 Networks, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index d411bcc..edd6b88 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -1,5 +1,6 @@
 /*
  * Copyright 2002-2005, Devicescape Software, Inc.
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index aa06dca..2800e1c 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -3,6 +3,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2008-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index 1b21050..32221fa 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -3,6 +3,7 @@
  *
  * Copyright 2006-2010	Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2014, Intel Corporation
+ * Copyright 2014  Intel Mobile Communications GmbH
  *
  * This file is GPLv2 as found in COPYING.
  */
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 464106c..6269a3e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3,6 +3,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 725af7a..b444f27 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3,6 +3,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2006-2007	Jiri Benc <jbenc@suse.cz>
  * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index d51422c..af48119 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -1,5 +1,6 @@
 /*
  * Copyright 2004, Instant802 Networks, Inc.
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
-- 
1.9.1


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

* [PATCH 02/10] cfg80211: add Intel Mobile Communications copyright
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
  2014-09-03 12:24 ` [PATCH 01/10] mac80211: add Intel Mobile Communications copyright Emmanuel Grumbach
@ 2014-09-03 12:24 ` Emmanuel Grumbach
  2014-09-03 12:24 ` [PATCH 03/10] mac80211: fix description comment of ieee80211_subif_start_xmit Emmanuel Grumbach
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:24 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Emmanuel Grumbach

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

Our legal structure changed at some point (see wikipedia), but
we forgot to immediately switch over to the new copyright
notice.

For files that we have modified in the time since the change,
add the proper copyright notice now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/linux/ieee80211.h | 1 +
 include/net/cfg80211.h    | 1 +
 net/wireless/chan.c       | 1 +
 net/wireless/core.c       | 1 +
 net/wireless/nl80211.c    | 1 +
 net/wireless/reg.c        | 1 +
 net/wireless/scan.c       | 1 +
 net/wireless/util.c       | 1 +
 8 files changed, 8 insertions(+)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 63ab3873..91d59d6 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -6,6 +6,7 @@
  * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
  * Copyright (c) 2005, Devicescape Software, Inc.
  * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
+ * Copyright (c) 2013 - 2014 Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0a080c4..42a990c 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4,6 +4,7 @@
  * 802.11 device and configuration interface
  *
  * Copyright 2006-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014 Intel Mobile Communications GmbH
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 992b340..72d81e2 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -4,6 +4,7 @@
  * any point in time.
  *
  * Copyright 2009	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  */
 
 #include <linux/export.h>
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 682babd..b32f85c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -2,6 +2,7 @@
  * This is the linux wireless configuration interface.
  *
  * Copyright 2006-2010		Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index df7b133..23f5ee7 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2,6 +2,7 @@
  * This is the new netlink-based wireless configuration interface.
  *
  * Copyright 2006-2010	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  */
 
 #include <linux/if.h>
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1afdf45..8bfc9b1 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -3,6 +3,7 @@
  * Copyright 2005-2006, Devicescape Software, Inc.
  * Copyright 2007	Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2008-2011	Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 0798c62..f74b61e 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2,6 +2,7 @@
  * cfg80211 scan result handling
  *
  * Copyright 2008 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  */
 #include <linux/kernel.h>
 #include <linux/slab.h>
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 728f1c0..a8b2816 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -2,6 +2,7 @@
  * Wireless utility functions
  *
  * Copyright 2007-2009	Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2013-2014  Intel Mobile Communications GmbH
  */
 #include <linux/export.h>
 #include <linux/bitops.h>
-- 
1.9.1


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

* [PATCH 03/10] mac80211: fix description comment of ieee80211_subif_start_xmit
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
  2014-09-03 12:24 ` [PATCH 01/10] mac80211: add Intel Mobile Communications copyright Emmanuel Grumbach
  2014-09-03 12:24 ` [PATCH 02/10] cfg80211: " Emmanuel Grumbach
@ 2014-09-03 12:24 ` Emmanuel Grumbach
  2014-09-03 12:25 ` [PATCH 04/10] nl80211: Allow declaring RRM-related features Emmanuel Grumbach
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:24 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Liad Kaufman, Emmanuel Grumbach

From: Liad Kaufman <liad.kaufman@intel.com>

The function description claimed that on error the skb isn't
freed even though it is, and stated return values that are
different than what really happens in the code.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/tx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6269a3e..56ae886 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1786,9 +1786,8 @@ static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local,
  * @skb: packet to be sent
  * @dev: incoming interface
  *
- * Returns: 0 on success (and frees skb in this case) or 1 on failure (skb will
- * not be freed, and caller is responsible for either retrying later or freeing
- * skb).
+ * Returns: NETDEV_TX_OK both on success and on failure. On failure skb will
+ *	be freed.
  *
  * This function takes in an Ethernet header and encapsulates it with suitable
  * IEEE 802.11 header based on which interface the packet is coming in. The
-- 
1.9.1


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

* [PATCH 04/10] nl80211: Allow declaring RRM-related features
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (2 preceding siblings ...)
  2014-09-03 12:24 ` [PATCH 03/10] mac80211: fix description comment of ieee80211_subif_start_xmit Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-03 12:25 ` [PATCH 05/10] nl80211: Add flag attribute for RRM connections Emmanuel Grumbach
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Assaf Krauss, Emmanuel Grumbach

From: Assaf Krauss <assaf.krauss@intel.com>

Radio Resource Measurement (RRM) is a bundle of features which will
require the entire stack to participate.
In this patch, the driver is given the opportunity to advertise the
device's support for these RRM-related features, using feature flags:
1. Support for Quiet IEs.
2. Support for adding DS Parameter Set IE to probe requests.
3. Support for adding WFA TPC Report IE to probe requests.
4. Support for inserting tx power value to tx-ed packets at a fixed
   offset. This is used in action frames, such as RRM's Link
   Measurement Report, where the actual tx power should be reported
   in the frame.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/uapi/linux/nl80211.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f1db15b..375225f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3956,6 +3956,16 @@ enum nl80211_ap_sme_features {
  * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
  *	channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
  *	lifetime of a BSS.
+ * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter
+ *	Set IE to probe requests.
+ * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE
+ *	to probe requests.
+ * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period
+ *	requests sent to it by an AP.
+ * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the
+ *	current tx power value into the TPC Report IE in the spectrum
+ *	management TPC Report action frame, and in the Radio Measurement Link
+ *	Measurement Report action frame.
  */
 enum nl80211_feature_flags {
 	NL80211_FEATURE_SK_TX_STATUS			= 1 << 0,
@@ -3977,6 +3987,10 @@ enum nl80211_feature_flags {
 	NL80211_FEATURE_USERSPACE_MPM			= 1 << 16,
 	NL80211_FEATURE_ACTIVE_MONITOR			= 1 << 17,
 	NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE	= 1 << 18,
+	NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES	= 1 << 19,
+	NL80211_FEATURE_WFA_TPC_IE_IN_PROBES		= 1 << 20,
+	NL80211_FEATURE_QUIET				= 1 << 21,
+	NL80211_FEATURE_TX_POWER_INSERTION		= 1 << 22,
 };
 
 /**
-- 
1.9.1


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

* [PATCH 05/10] nl80211: Add flag attribute for RRM connections
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (3 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 04/10] nl80211: Allow declaring RRM-related features Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-03 12:25 ` [PATCH 06/10] mac80211: Add RRM support to assoc request Emmanuel Grumbach
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Assaf Krauss, Emmanuel Grumbach

From: Assaf Krauss <assaf.krauss@intel.com>

Add a flag attribute to use in associations, for tagging the target
connection as supporting RRM. It is the responsibility of upper
layers to set this flag only if both the underlying device, and the
target network indeed support RRM.
To be used in ASSOCIATE and CONNECT commands.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/net/cfg80211.h       |  2 ++
 include/uapi/linux/nl80211.h | 13 +++++++++++++
 net/wireless/nl80211.c       | 17 +++++++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 42a990c..dbd696d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1606,10 +1606,12 @@ struct cfg80211_auth_request {
  *
  * @ASSOC_REQ_DISABLE_HT:  Disable HT (802.11n)
  * @ASSOC_REQ_DISABLE_VHT:  Disable VHT
+ * @ASSOC_REQ_USE_RRM: Declare RRM capability in this association
  */
 enum cfg80211_assoc_req_flags {
 	ASSOC_REQ_DISABLE_HT		= BIT(0),
 	ASSOC_REQ_DISABLE_VHT		= BIT(1),
+	ASSOC_REQ_USE_RRM		= BIT(2),
 };
 
 /**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 375225f..8951c31 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1594,6 +1594,17 @@ enum nl80211_commands {
  * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
  *	the TDLS link initiator.
  *
+ * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection
+ *	shall support Radio Resource Measurements (11k). This attribute can be
+ *	used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests.
+ *	User space applications are expected to use this flag only if the
+ *	underlying device supports these minimal RRM features:
+ *		%NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
+ *		%NL80211_FEATURE_QUIET,
+ *	If this flag is used, driver must add the Power Capabilities IE to the
+ *	association request. In addition, it must also set the RRM capability
+ *	flag in the association request's Capability Info field.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1936,6 +1947,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_TDLS_INITIATOR,
 
+	NL80211_ATTR_USE_RRM,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 23f5ee7..55da200 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -389,6 +389,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
 	[NL80211_ATTR_IFACE_SOCKET_OWNER] = { .type = NLA_FLAG },
 	[NL80211_ATTR_CSA_C_OFFSETS_TX] = { .type = NLA_BINARY },
+	[NL80211_ATTR_USE_RRM] = { .type = NLA_FLAG },
 };
 
 /* policy for the key attributes */
@@ -6576,6 +6577,14 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
 		       sizeof(req.vht_capa));
 	}
 
+	if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) {
+		if (!(rdev->wiphy.features &
+		      NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) ||
+		    !(rdev->wiphy.features & NL80211_FEATURE_QUIET))
+			return -EINVAL;
+		req.flags |= ASSOC_REQ_USE_RRM;
+	}
+
 	err = nl80211_crypto_settings(rdev, info, &req.crypto, 1);
 	if (!err) {
 		wdev_lock(dev->ieee80211_ptr);
@@ -7233,6 +7242,14 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
 		       sizeof(connect.vht_capa));
 	}
 
+	if (nla_get_flag(info->attrs[NL80211_ATTR_USE_RRM])) {
+		if (!(rdev->wiphy.features &
+		      NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) ||
+		    !(rdev->wiphy.features & NL80211_FEATURE_QUIET))
+			return -EINVAL;
+		connect.flags |= ASSOC_REQ_USE_RRM;
+	}
+
 	wdev_lock(dev->ieee80211_ptr);
 	err = cfg80211_connect(rdev, dev, &connect, connkeys, NULL);
 	wdev_unlock(dev->ieee80211_ptr);
-- 
1.9.1


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

* [PATCH 06/10] mac80211: Add RRM support to assoc request
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (4 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 05/10] nl80211: Add flag attribute for RRM connections Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-03 12:25 ` [PATCH 07/10] cfg80211: avoid duplicate entries on regdomain intersection Emmanuel Grumbach
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Assaf Krauss, Emmanuel Grumbach

From: Assaf Krauss <assaf.krauss@intel.com>

In case of a RRM-supporting connection, in the association request
frame: set the RRM capability flag, and add the required IEs.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/ieee80211_i.h |  1 +
 net/mac80211/mlme.c        | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a0b89da..42a4c5c 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -355,6 +355,7 @@ enum ieee80211_sta_flags {
 	IEEE80211_STA_DISABLE_80P80MHZ	= BIT(12),
 	IEEE80211_STA_DISABLE_160MHZ	= BIT(13),
 	IEEE80211_STA_DISABLE_WMM	= BIT(14),
+	IEEE80211_STA_ENABLE_RRM	= BIT(15),
 };
 
 struct ieee80211_mgd_auth_data {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2b38968..5dbd4bc 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -664,6 +664,9 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
 	    (local->hw.flags & IEEE80211_HW_SPECTRUM_MGMT))
 		capab |= WLAN_CAPABILITY_SPECTRUM_MGMT;
 
+	if (ifmgd->flags & IEEE80211_STA_ENABLE_RRM)
+		capab |= WLAN_CAPABILITY_RADIO_MEASURE;
+
 	mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24);
 	memset(mgmt, 0, 24);
 	memcpy(mgmt->da, assoc_data->bss->bssid, ETH_ALEN);
@@ -729,16 +732,17 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
 		}
 	}
 
-	if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) {
-		/* 1. power capabilities */
+	if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT ||
+	    capab & WLAN_CAPABILITY_RADIO_MEASURE) {
 		pos = skb_put(skb, 4);
 		*pos++ = WLAN_EID_PWR_CAPABILITY;
 		*pos++ = 2;
 		*pos++ = 0; /* min tx power */
 		 /* max tx power */
 		*pos++ = ieee80211_chandef_max_power(&chanctx_conf->def);
+	}
 
-		/* 2. supported channels */
+	if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) {
 		/* TODO: get this in reg domain format */
 		pos = skb_put(skb, 2 * sband->n_channels + 2);
 		*pos++ = WLAN_EID_SUPPORTED_CHANNELS;
@@ -4397,6 +4401,11 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
 		ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED;
 	}
 
+	if (req->flags & ASSOC_REQ_USE_RRM)
+		ifmgd->flags |= IEEE80211_STA_ENABLE_RRM;
+	else
+		ifmgd->flags &= ~IEEE80211_STA_ENABLE_RRM;
+
 	if (req->crypto.control_port)
 		ifmgd->flags |= IEEE80211_STA_CONTROL_PORT;
 	else
-- 
1.9.1


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

* [PATCH 07/10] cfg80211: avoid duplicate entries on regdomain intersection
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (5 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 06/10] mac80211: Add RRM support to assoc request Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-03 12:25 ` [PATCH 08/10] mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period Emmanuel Grumbach
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Eliad Peller, Emmanuel Grumbach

From: Eliad Peller <eliad@wizery.com>

The regdom intersection code simply tries intersecting
each rule of the source with each rule of the target.

Since the resulting intersections are not observed
as a whole, this can result in multiple overlapping/duplicate
entries.

Make the rule addition a bit more smarter, by looking
for rules that can be contained within other rules,
and adding only extended ones.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/wireless/reg.c | 81 ++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 60 insertions(+), 21 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 8bfc9b1..b725a31 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -799,6 +799,57 @@ static int reg_rules_intersect(const struct ieee80211_regdomain *rd1,
 	return 0;
 }
 
+/* check whether old rule contains new rule */
+static bool rule_contains(struct ieee80211_reg_rule *r1,
+			  struct ieee80211_reg_rule *r2)
+{
+	/* for simplicity, currently consider only same flags */
+	if (r1->flags != r2->flags)
+		return false;
+
+	/* verify r1 is more restrictive */
+	if ((r1->power_rule.max_antenna_gain >
+	     r2->power_rule.max_antenna_gain) ||
+	    r1->power_rule.max_eirp > r2->power_rule.max_eirp)
+		return false;
+
+	/* make sure r2's range is contained within r1 */
+	if (r1->freq_range.start_freq_khz > r2->freq_range.start_freq_khz ||
+	    r1->freq_range.end_freq_khz < r2->freq_range.end_freq_khz)
+		return false;
+
+	/* and finally verify that r1.max_bw >= r2.max_bw */
+	if (r1->freq_range.max_bandwidth_khz <
+	    r2->freq_range.max_bandwidth_khz)
+		return false;
+
+	return true;
+}
+
+/* add or extend current rules. do nothing if rule is already contained */
+static void add_rule(struct ieee80211_reg_rule *rule,
+		     struct ieee80211_reg_rule *reg_rules, u32 *n_rules)
+{
+	struct ieee80211_reg_rule *tmp_rule;
+	int i;
+
+	for (i = 0; i < *n_rules; i++) {
+		tmp_rule = &reg_rules[i];
+		/* rule is already contained - do nothing */
+		if (rule_contains(tmp_rule, rule))
+			return;
+
+		/* extend rule if possible */
+		if (rule_contains(rule, tmp_rule)) {
+			memcpy(tmp_rule, rule, sizeof(*rule));
+			return;
+		}
+	}
+
+	memcpy(&reg_rules[*n_rules], rule, sizeof(*rule));
+	(*n_rules)++;
+}
+
 /**
  * regdom_intersect - do the intersection between two regulatory domains
  * @rd1: first regulatory domain
@@ -818,12 +869,10 @@ regdom_intersect(const struct ieee80211_regdomain *rd1,
 {
 	int r, size_of_regd;
 	unsigned int x, y;
-	unsigned int num_rules = 0, rule_idx = 0;
+	unsigned int num_rules = 0;
 	const struct ieee80211_reg_rule *rule1, *rule2;
-	struct ieee80211_reg_rule *intersected_rule;
+	struct ieee80211_reg_rule intersected_rule;
 	struct ieee80211_regdomain *rd;
-	/* This is just a dummy holder to help us count */
-	struct ieee80211_reg_rule dummy_rule;
 
 	if (!rd1 || !rd2)
 		return NULL;
@@ -841,7 +890,7 @@ regdom_intersect(const struct ieee80211_regdomain *rd1,
 		for (y = 0; y < rd2->n_reg_rules; y++) {
 			rule2 = &rd2->reg_rules[y];
 			if (!reg_rules_intersect(rd1, rd2, rule1, rule2,
-						 &dummy_rule))
+						 &intersected_rule))
 				num_rules++;
 		}
 	}
@@ -856,34 +905,24 @@ regdom_intersect(const struct ieee80211_regdomain *rd1,
 	if (!rd)
 		return NULL;
 
-	for (x = 0; x < rd1->n_reg_rules && rule_idx < num_rules; x++) {
+	for (x = 0; x < rd1->n_reg_rules; x++) {
 		rule1 = &rd1->reg_rules[x];
-		for (y = 0; y < rd2->n_reg_rules && rule_idx < num_rules; y++) {
+		for (y = 0; y < rd2->n_reg_rules; y++) {
 			rule2 = &rd2->reg_rules[y];
-			/*
-			 * This time around instead of using the stack lets
-			 * write to the target rule directly saving ourselves
-			 * a memcpy()
-			 */
-			intersected_rule = &rd->reg_rules[rule_idx];
 			r = reg_rules_intersect(rd1, rd2, rule1, rule2,
-						intersected_rule);
+						&intersected_rule);
 			/*
 			 * No need to memset here the intersected rule here as
 			 * we're not using the stack anymore
 			 */
 			if (r)
 				continue;
-			rule_idx++;
-		}
-	}
 
-	if (rule_idx != num_rules) {
-		kfree(rd);
-		return NULL;
+			add_rule(&intersected_rule, rd->reg_rules,
+				 &rd->n_reg_rules);
+		}
 	}
 
-	rd->n_reg_rules = num_rules;
 	rd->alpha2[0] = '9';
 	rd->alpha2[1] = '8';
 	rd->dfs_region = reg_intersect_dfs_region(rd1->dfs_region,
-- 
1.9.1


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

* [PATCH 08/10] mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (6 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 07/10] cfg80211: avoid duplicate entries on regdomain intersection Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-05 11:42   ` Johannes Berg
  2014-09-03 12:25 ` [PATCH 09/10] mac80211: adjust roc duration when combining ROCs Emmanuel Grumbach
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

sta_set_sinfo is obviously takes data for specific station.
This specific station is attached to a specific virtual
interface. Hence we should use the dtim_period from this
virtual interface rather than the system wide dtim_period.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@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 6274cd7..50f2e31 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1820,7 +1820,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
 		sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE;
 	if (sdata->vif.bss_conf.use_short_slot)
 		sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
-	sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period;
+	sinfo->bss_param.dtim_period = sdata->vif.bss_conf.dtim_period;
 	sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
 
 	sinfo->sta_flags.set = 0;
-- 
1.9.1


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

* [PATCH 09/10] mac80211: adjust roc duration when combining ROCs
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (7 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 08/10] mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-03 12:25 ` [PATCH 10/10] mac80211: combine roc with the "next roc" if possible Emmanuel Grumbach
  2014-09-05 11:54 ` [PATCH 00/10] various mac80211 / cfg80211 patches Johannes Berg
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Eliad Peller, Eliad Peller, Emmanuel Grumbach

From: Eliad Peller <eliad@wizery.com>

The new duration (remaining duration after the current
ROC ends) was calculated but not used, making the
optimization worthless.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/cfg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 6cd0a59e..edeab09 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2503,6 +2503,7 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
 
 				if (new_dur > 0) {
 					/* add right after tmp */
+					roc->duration = new_dur;
 					list_add(&roc->list, &tmp->list);
 				} else {
 					list_add_tail(&roc->list,
-- 
1.9.1


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

* [PATCH 10/10] mac80211: combine roc with the "next roc" if possible
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (8 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 09/10] mac80211: adjust roc duration when combining ROCs Emmanuel Grumbach
@ 2014-09-03 12:25 ` Emmanuel Grumbach
  2014-09-05 11:54 ` [PATCH 00/10] various mac80211 / cfg80211 patches Johannes Berg
  10 siblings, 0 replies; 13+ messages in thread
From: Emmanuel Grumbach @ 2014-09-03 12:25 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Eliad Peller, Eliad Peller, Emmanuel Grumbach

From: Eliad Peller <eliad@wizery.com>

If the remaining time in the current roc is not long
enough, mac80211 adds the new roc right after it
(if they have similar params).

However, in case of multiple rocs, the "next roc"
is not considered, resulting in multiple rocs,
each one with its own duration.

Refactor the code a bit and consider the next roc,
so a single max roc will be used instead of
multiple rocs (which might last much longer).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 net/mac80211/cfg.c | 77 +++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 53 insertions(+), 24 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index edeab09..8eea032 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2359,6 +2359,58 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
 	return 0;
 }
 
+static bool ieee80211_coalesce_started_roc(struct ieee80211_local *local,
+					   struct ieee80211_roc_work *new_roc,
+					   struct ieee80211_roc_work *cur_roc)
+{
+	unsigned long j = jiffies;
+	unsigned long cur_roc_end = cur_roc->hw_start_time +
+				    msecs_to_jiffies(cur_roc->duration);
+	struct ieee80211_roc_work *next_roc;
+	int new_dur;
+
+	if (WARN_ON(!cur_roc->started || !cur_roc->hw_begun))
+		return false;
+
+	if (time_after(j + IEEE80211_ROC_MIN_LEFT, cur_roc_end))
+		return false;
+
+	ieee80211_handle_roc_started(new_roc);
+
+	new_dur = new_roc->duration - jiffies_to_msecs(cur_roc_end - j);
+
+	/* cur_roc is long enough - add new_roc to the dependents list. */
+	if (new_dur <= 0) {
+		list_add_tail(&new_roc->list, &cur_roc->dependents);
+		return true;
+	}
+
+	new_roc->duration = new_dur;
+
+	/*
+	 * if cur_roc was already coalesced before, we might
+	 * want to extend the next roc instead of adding
+	 * a new one.
+	 */
+	next_roc = list_entry(cur_roc->list.next,
+			      struct ieee80211_roc_work, list);
+	if (&next_roc->list != &local->roc_list &&
+	    next_roc->chan == new_roc->chan &&
+	    next_roc->sdata == new_roc->sdata &&
+	    !WARN_ON(next_roc->started)) {
+		list_add_tail(&new_roc->list, &next_roc->dependents);
+		next_roc->duration = max(next_roc->duration,
+					 new_roc->duration);
+		next_roc->type = max(next_roc->type, new_roc->type);
+		return true;
+	}
+
+	/* add right after cur_roc */
+	list_add(&new_roc->list, &cur_roc->list);
+
+	return true;
+}
+
 static int ieee80211_start_roc_work(struct ieee80211_local *local,
 				    struct ieee80211_sub_if_data *sdata,
 				    struct ieee80211_channel *channel,
@@ -2464,8 +2516,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
 
 		/* If it has already started, it's more difficult ... */
 		if (local->ops->remain_on_channel) {
-			unsigned long j = jiffies;
-
 			/*
 			 * In the offloaded ROC case, if it hasn't begun, add
 			 * this new one to the dependent list to be handled
@@ -2488,29 +2538,8 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
 				break;
 			}
 
-			if (time_before(j + IEEE80211_ROC_MIN_LEFT,
-					tmp->hw_start_time +
-					msecs_to_jiffies(tmp->duration))) {
-				int new_dur;
-
-				ieee80211_handle_roc_started(roc);
-
-				new_dur = roc->duration -
-					  jiffies_to_msecs(tmp->hw_start_time +
-							   msecs_to_jiffies(
-								tmp->duration) -
-							   j);
-
-				if (new_dur > 0) {
-					/* add right after tmp */
-					roc->duration = new_dur;
-					list_add(&roc->list, &tmp->list);
-				} else {
-					list_add_tail(&roc->list,
-						      &tmp->dependents);
-				}
+			if (ieee80211_coalesce_started_roc(local, roc, tmp))
 				queued = true;
-			}
 		} else if (del_timer_sync(&tmp->work.timer)) {
 			unsigned long new_end;
 
-- 
1.9.1


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

* Re: [PATCH 08/10] mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period
  2014-09-03 12:25 ` [PATCH 08/10] mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period Emmanuel Grumbach
@ 2014-09-05 11:42   ` Johannes Berg
  0 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2014-09-05 11:42 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless

On Wed, 2014-09-03 at 15:25 +0300, Emmanuel Grumbach wrote:
> sta_set_sinfo is obviously takes data for specific station.
> This specific station is attached to a specific virtual
> interface. Hence we should use the dtim_period from this
> virtual interface rather than the system wide dtim_period.

I'll apply this to mac80211.git

johannes


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

* Re: [PATCH 00/10] various mac80211 / cfg80211 patches
  2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
                   ` (9 preceding siblings ...)
  2014-09-03 12:25 ` [PATCH 10/10] mac80211: combine roc with the "next roc" if possible Emmanuel Grumbach
@ 2014-09-05 11:54 ` Johannes Berg
  10 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2014-09-05 11:54 UTC (permalink / raw)
  To: Emmanuel Grumbach; +Cc: linux-wireless

On Wed, 2014-09-03 at 15:24 +0300, Emmanuel Grumbach wrote:
> Hi Johannes,
> 
> here are a few patches from our internal tree. You have already seen
> most of them.

Applied all.

johannes


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

end of thread, other threads:[~2014-09-05 11:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03 12:24 [PATCH 00/10] various mac80211 / cfg80211 patches Emmanuel Grumbach
2014-09-03 12:24 ` [PATCH 01/10] mac80211: add Intel Mobile Communications copyright Emmanuel Grumbach
2014-09-03 12:24 ` [PATCH 02/10] cfg80211: " Emmanuel Grumbach
2014-09-03 12:24 ` [PATCH 03/10] mac80211: fix description comment of ieee80211_subif_start_xmit Emmanuel Grumbach
2014-09-03 12:25 ` [PATCH 04/10] nl80211: Allow declaring RRM-related features Emmanuel Grumbach
2014-09-03 12:25 ` [PATCH 05/10] nl80211: Add flag attribute for RRM connections Emmanuel Grumbach
2014-09-03 12:25 ` [PATCH 06/10] mac80211: Add RRM support to assoc request Emmanuel Grumbach
2014-09-03 12:25 ` [PATCH 07/10] cfg80211: avoid duplicate entries on regdomain intersection Emmanuel Grumbach
2014-09-03 12:25 ` [PATCH 08/10] mac80211: use bss_conf->dtim_period instead of conf.ps_dtim_period Emmanuel Grumbach
2014-09-05 11:42   ` Johannes Berg
2014-09-03 12:25 ` [PATCH 09/10] mac80211: adjust roc duration when combining ROCs Emmanuel Grumbach
2014-09-03 12:25 ` [PATCH 10/10] mac80211: combine roc with the "next roc" if possible Emmanuel Grumbach
2014-09-05 11:54 ` [PATCH 00/10] various mac80211 / cfg80211 patches Johannes Berg

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.