Johannes Berg | 7 Oct 12:03
Favicon

[PATCH 0/8] mac80211 fixes/cleanups/updates

Here are a few mac80211 patches.

johannes

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

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 8/8] mac80211: fix short slot handling

This patch makes mac80211 handle short slot requests from
the AP properly.

Signed-off-by: Johannes Berg <johannes@...>
---
 include/net/mac80211.h |    8 +++--
 net/mac80211/main.c    |    9 +++--
 net/mac80211/mlme.c    |   74 ++++++++++++++++++++++++++-----------------------
 3 files changed, 52 insertions(+), 39 deletions(-)

--- everything.orig/net/mac80211/main.c	2008-10-07 11:27:04.000000000 +0200
+++ everything/net/mac80211/main.c	2008-10-07 11:51:31.000000000 +0200
@@ -346,9 +346,12 @@ void ieee80211_bss_info_change_notify(st

 u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
 {
-	sdata->bss_conf.use_cts_prot = 0;
-	sdata->bss_conf.use_short_preamble = 0;
-	return BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_ERP_PREAMBLE;
+	sdata->bss_conf.use_cts_prot = false;
+	sdata->bss_conf.use_short_preamble = false;
+	sdata->bss_conf.use_short_slot = false;
+	return BSS_CHANGED_ERP_CTS_PROT |
+	       BSS_CHANGED_ERP_PREAMBLE |
+	       BSS_CHANGED_ERP_SLOT;
 }

 void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
--- everything.orig/net/mac80211/mlme.c	2008-10-07 11:26:49.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-10-07 11:51:30.000000000 +0200
(Continue reading)

Johannes Berg | 8 Oct 10:55
Favicon

[PATCH 8/8 v2] mac80211: fix short slot handling

This patch makes mac80211 handle short slot requests from the AP
properly. Also warn about uses of IEEE80211_CONF_SHORT_SLOT_TIME
and optimise out the code since it cannot ever be hit anyway.

Signed-off-by: Johannes Berg <johannes@...>
---
 include/net/mac80211.h |   15 +++++++--
 net/mac80211/main.c    |    9 +++--
 net/mac80211/mlme.c    |   74 ++++++++++++++++++++++++++-----------------------
 3 files changed, 58 insertions(+), 40 deletions(-)

--- everything.orig/net/mac80211/main.c	2008-10-07 20:06:43.000000000 +0200
+++ everything/net/mac80211/main.c	2008-10-08 10:52:00.000000000 +0200
@@ -346,9 +346,12 @@ void ieee80211_bss_info_change_notify(st

 u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
 {
-	sdata->bss_conf.use_cts_prot = 0;
-	sdata->bss_conf.use_short_preamble = 0;
-	return BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_ERP_PREAMBLE;
+	sdata->bss_conf.use_cts_prot = false;
+	sdata->bss_conf.use_short_preamble = false;
+	sdata->bss_conf.use_short_slot = false;
+	return BSS_CHANGED_ERP_CTS_PROT |
+	       BSS_CHANGED_ERP_PREAMBLE |
+	       BSS_CHANGED_ERP_SLOT;
 }

 void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
--- everything.orig/net/mac80211/mlme.c	2008-10-07 20:05:49.000000000 +0200
(Continue reading)

Johannes Berg | 8 Oct 10:59
Favicon

[PATCH 8/8 v3] mac80211: fix short slot handling

This patch makes mac80211 handle short slot requests from the AP
properly. Also warn about uses of IEEE80211_CONF_SHORT_SLOT_TIME
and optimise out the code since it cannot ever be hit anyway.

Signed-off-by: Johannes Berg <johannes@...>
---
v3: fix comments

 include/net/mac80211.h |   28 ++++++++++--------
 net/mac80211/main.c    |    9 +++--
 net/mac80211/mlme.c    |   74 ++++++++++++++++++++++++++-----------------------
 3 files changed, 62 insertions(+), 49 deletions(-)

--- everything.orig/net/mac80211/main.c	2008-10-07 20:06:43.000000000 +0200
+++ everything/net/mac80211/main.c	2008-10-08 10:56:29.000000000 +0200
@@ -346,9 +346,12 @@ void ieee80211_bss_info_change_notify(st

 u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)
 {
-	sdata->bss_conf.use_cts_prot = 0;
-	sdata->bss_conf.use_short_preamble = 0;
-	return BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_ERP_PREAMBLE;
+	sdata->bss_conf.use_cts_prot = false;
+	sdata->bss_conf.use_short_preamble = false;
+	sdata->bss_conf.use_short_slot = false;
+	return BSS_CHANGED_ERP_CTS_PROT |
+	       BSS_CHANGED_ERP_PREAMBLE |
+	       BSS_CHANGED_ERP_SLOT;
 }

(Continue reading)

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 7/8] mac80211: remove max_antenna_gain config

The antenna gain isn't exactly configurable, despite the belief of
some unnamed individual who thinks that the EEPROM might influence
it.

Signed-off-by: Johannes Berg <johannes@...>
---
 include/net/mac80211.h |    2 --
 net/mac80211/main.c    |    2 --
 2 files changed, 4 deletions(-)

--- everything.orig/include/net/mac80211.h	2008-10-07 11:27:02.000000000 +0200
+++ everything/include/net/mac80211.h	2008-10-07 11:27:04.000000000 +0200
@@ -456,7 +456,6 @@ enum ieee80211_conf_flags {
  * @listen_interval: listen interval in units of beacon interval
  * @flags: configuration flags defined above
  * @power_level: requested transmit power (in dBm)
- * @max_antenna_gain: maximum antenna gain (in dBi)
  * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
  *	1/2: antenna 0/1
  * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
@@ -471,7 +470,6 @@ struct ieee80211_conf {
 	u16 listen_interval;
 	u32 flags;
 	int power_level;
-	int max_antenna_gain;
 	u8 antenna_sel_tx;
 	u8 antenna_sel_rx;

--- everything.orig/net/mac80211/main.c	2008-10-07 11:27:02.000000000 +0200
+++ everything/net/mac80211/main.c	2008-10-07 11:27:04.000000000 +0200
(Continue reading)

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 6/8] mac80211: clean up ieee80211_hw_config errors

Warn when ieee80211_hw_config returns an error, it shouldn't
happen; remove a number of printks that would happen in such
a case and one printk that is user-triggerable.

Signed-off-by: Johannes Berg <johannes@...>
---
 net/mac80211/cfg.c  |    3 +--
 net/mac80211/main.c |    8 +++++++-
 net/mac80211/scan.c |   16 +++-------------
 net/mac80211/util.c |    5 +----
 net/mac80211/wext.c |    6 +-----
 5 files changed, 13 insertions(+), 25 deletions(-)

--- everything.orig/net/mac80211/cfg.c	2008-10-07 11:27:02.000000000 +0200
+++ everything/net/mac80211/cfg.c	2008-10-07 11:27:02.000000000 +0200
@@ -396,8 +396,7 @@ static int ieee80211_config_beacon(struc
 	 */
 	if (params->interval) {
 		sdata->local->hw.conf.beacon_int = params->interval;
-		if (ieee80211_hw_config(sdata->local))
-			return -EINVAL;
+		ieee80211_hw_config(sdata->local);
 		/*
 		 * We updated some parameter so if below bails out
 		 * it's not an error.
--- everything.orig/net/mac80211/main.c	2008-10-07 11:27:00.000000000 +0200
+++ everything/net/mac80211/main.c	2008-10-07 11:27:02.000000000 +0200
@@ -222,8 +222,14 @@ int ieee80211_hw_config(struct ieee80211
 	       wiphy_name(local->hw.wiphy), chan->center_freq);
 #endif
(Continue reading)

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 2/8] mac80211: remove aggregation status write support from debugfs

This code uses static variables and thus cannot be kept.

Signed-off-by: Johannes Berg <johannes@...>
---
 net/mac80211/debugfs_sta.c |   73 ---------------------------------------------
 1 file changed, 1 insertion(+), 72 deletions(-)

--- everything.orig/net/mac80211/debugfs_sta.c	2008-10-07 11:26:58.000000000 +0200
+++ everything/net/mac80211/debugfs_sta.c	2008-10-07 11:26:59.000000000 +0200
@@ -39,13 +39,6 @@ static const struct file_operations sta_
 	.open = mac80211_open_file_generic,				\
 }

-#define STA_OPS_WR(name)						\
-static const struct file_operations sta_ ##name## _ops = {		\
-	.read = sta_##name##_read,					\
-	.write = sta_##name##_write,					\
-	.open = mac80211_open_file_generic,				\
-}
-
 #define STA_FILE(name, field, format)					\
 		STA_READ_##format(name, field)				\
 		STA_OPS(name)
@@ -168,71 +161,7 @@ static ssize_t sta_agg_status_read(struc

 	return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf);
 }
-
-static ssize_t sta_agg_status_write(struct file *file,
-		const char __user *user_buf, size_t count, loff_t *ppos)
(Continue reading)

Tomas Winkler | 7 Oct 23:24

Re: [PATCH 2/8] mac80211: remove aggregation status write support from debugfs

On Tue, Oct 7, 2008 at 12:04 PM, Johannes Berg
<johannes@...> wrote:
> This code uses static variables and thus cannot be kept.
NACK
Need something to debug this stuff
Tomas

> Signed-off-by: Johannes Berg <johannes@...>
> ---
>  net/mac80211/debugfs_sta.c |   73 ---------------------------------------------
>  1 file changed, 1 insertion(+), 72 deletions(-)
>
> --- everything.orig/net/mac80211/debugfs_sta.c  2008-10-07 11:26:58.000000000 +0200
> +++ everything/net/mac80211/debugfs_sta.c       2008-10-07 11:26:59.000000000 +0200
> @@ -39,13 +39,6 @@ static const struct file_operations sta_
>        .open = mac80211_open_file_generic,                             \
>  }
>
> -#define STA_OPS_WR(name)                                               \
> -static const struct file_operations sta_ ##name## _ops = {             \
> -       .read = sta_##name##_read,                                      \
> -       .write = sta_##name##_write,                                    \
> -       .open = mac80211_open_file_generic,                             \
> -}
> -
>  #define STA_FILE(name, field, format)                                  \
>                STA_READ_##format(name, field)                          \
>                STA_OPS(name)
> @@ -168,71 +161,7 @@ static ssize_t sta_agg_status_read(struc
>
(Continue reading)

Johannes Berg | 8 Oct 09:59
Favicon

Re: [PATCH 2/8] mac80211: remove aggregation status write support from debugfs

On Tue, 2008-10-07 at 23:24 +0200, Tomas Winkler wrote:
> On Tue, Oct 7, 2008 at 12:04 PM, Johannes Berg
> <johannes@...> wrote:
> > This code uses static variables and thus cannot be kept.
> NACK
> Need something to debug this stuff

Tough luck. Go write proper support in nl80211 then.

johannes
Luis R. Rodriguez | 10 Oct 20:22

Re: [PATCH 2/8] mac80211: remove aggregation status write support from debugfs

On Wed, Oct 8, 2008 at 12:59 AM, Johannes Berg
<johannes@...> wrote:
> On Tue, 2008-10-07 at 23:24 +0200, Tomas Winkler wrote:
>> On Tue, Oct 7, 2008 at 12:04 PM, Johannes Berg
>> <johannes@...> wrote:
>> > This code uses static variables and thus cannot be kept.
>> NACK
>> Need something to debug this stuff
>
> Tough luck. Go write proper support in nl80211 then.

Someone has some patch to use nl80211 for this BTW. *cough*

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

Johannes Berg | 10 Oct 20:37
Favicon

Re: [PATCH 2/8] mac80211: remove aggregation status write support from debugfs

On Fri, 2008-10-10 at 11:22 -0700, Luis R. Rodriguez wrote:
> On Wed, Oct 8, 2008 at 12:59 AM, Johannes Berg
> <johannes@...> wrote:
> > On Tue, 2008-10-07 at 23:24 +0200, Tomas Winkler wrote:
> >> On Tue, Oct 7, 2008 at 12:04 PM, Johannes Berg
> >> <johannes@...> wrote:
> >> > This code uses static variables and thus cannot be kept.
> >> NACK
> >> Need something to debug this stuff
> >
> > Tough luck. Go write proper support in nl80211 then.
> 
> Someone has some patch to use nl80211 for this BTW. *cough*

Who what where? Andrey said he was going to work on it?

johannes
Andrey Yurovsky | 10 Oct 20:39

Re: [PATCH 2/8] mac80211: remove aggregation status write support from debugfs

Yes, this adds two nl80211 commands (NEW_BA and DEL_BA)
https://cozybit1.dnsalias.org/~andrey/patches/001-add-ba-session-command-nl80211.patch
and this adds corresponding "station addba" and "station delba"
options for them to iw:
https://cozybit1.dnsalias.org/~andrey/patches/002-iw-add-nl80211-ba-commands.patch

With the current code, I am not sure if it's ever intended that user
space has the ability to initiate and tear down BA sessions, so this
may or may not be useful to others.  Right now I am using them to test
BA initiation and teardown and I suspect that they may be useful to,
for example, hostapd in the future.

Please let me know what you think.  Thanks,

  -Andrey

On Fri, Oct 10, 2008 at 11:22 AM, Luis R. Rodriguez <mcgrof@...> wrote:
> On Wed, Oct 8, 2008 at 12:59 AM, Johannes Berg
> <johannes@...> wrote:
>> On Tue, 2008-10-07 at 23:24 +0200, Tomas Winkler wrote:
>>> On Tue, Oct 7, 2008 at 12:04 PM, Johannes Berg
>>> <johannes@...> wrote:
>>> > This code uses static variables and thus cannot be kept.
>>> NACK
>>> Need something to debug this stuff
>>
>> Tough luck. Go write proper support in nl80211 then.
>
> Someone has some patch to use nl80211 for this BTW. *cough*
>
(Continue reading)

Johannes Berg | 10 Oct 20:42
Favicon

Re: [PATCH 2/8] mac80211: remove aggregation status write support from debugfs

On Fri, 2008-10-10 at 11:39 -0700, Andrey Yurovsky wrote:

> With the current code, I am not sure if it's ever intended that user
> space has the ability to initiate and tear down BA sessions, so this
> may or may not be useful to others.  Right now I am using them to test
> BA initiation and teardown and I suspect that they may be useful to,
> for example, hostapd in the future.
> 
> Please let me know what you think.  Thanks,

Without looking at the code, is this really useful for much except
debugging? Shouldn't the rate control algorithm be in a much better
position to make that decision?

johannes
Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 1/8] mac80211: fix debugfs lockup

When debugfs_create_dir fails, sta_info_debugfs_add_work will not
terminate because it will find the same station again and again.
This is possible whenever debugfs fails for whatever reason; one
reason is a race condition in mac80211, unfortunately we cannot
do much about it, so just document it, it just means some station
may be missing from debugfs.

Signed-off-by: Johannes Berg <johannes@...>
Cc: Robin Holt <holt@...>
---
 net/mac80211/debugfs_sta.c |   11 +++++++++++
 net/mac80211/sta_info.c    |    7 ++++++-
 net/mac80211/sta_info.h    |    1 +
 3 files changed, 18 insertions(+), 1 deletion(-)

--- everything.orig/net/mac80211/debugfs_sta.c	2008-10-07 11:26:52.000000000 +0200
+++ everything/net/mac80211/debugfs_sta.c	2008-10-07 11:26:58.000000000 +0200
@@ -249,11 +249,22 @@ void ieee80211_sta_debugfs_add(struct st
 	DECLARE_MAC_BUF(mbuf);
 	u8 *mac;

+	sta->debugfs.add_has_run = true;
+
 	if (!stations_dir)
 		return;

 	mac = print_mac(mbuf, sta->sta.addr);

+	/*
+	 * This might fail due to a race condition:
(Continue reading)

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 4/8] mac80211: minor code cleanups

Nothing very interesting, some checkpatch inspired stuff,
some other things.

Signed-off-by: Johannes Berg <johannes@...>
---
 net/mac80211/debugfs_sta.c |    6 +++---
 net/mac80211/main.c        |    2 +-
 net/mac80211/mesh.c        |    2 +-
 net/mac80211/rc80211_pid.h |    2 +-
 net/mac80211/rx.c          |   24 +++++++++++++-----------
 net/mac80211/sta_info.c    |    4 ++--
 net/mac80211/wep.c         |   26 +++++++++++++-------------
 net/mac80211/wep.h         |    2 +-
 net/mac80211/wpa.c         |   29 ++++++++++-------------------
 9 files changed, 45 insertions(+), 52 deletions(-)

--- everything.orig/net/mac80211/wep.c	2008-10-07 11:26:52.000000000 +0200
+++ everything/net/mac80211/wep.c	2008-10-07 11:27:00.000000000 +0200
@@ -49,17 +49,19 @@ void ieee80211_wep_free(struct ieee80211
 	crypto_free_blkcipher(local->wep_rx_tfm);
 }

-static inline int ieee80211_wep_weak_iv(u32 iv, int keylen)
+static inline bool ieee80211_wep_weak_iv(u32 iv, int keylen)
 {
-	/* Fluhrer, Mantin, and Shamir have reported weaknesses in the
+	/*
+	 * Fluhrer, Mantin, and Shamir have reported weaknesses in the
 	 * key scheduling algorithm of RC4. At least IVs (KeyByte + 3,
-	 * 0xff, N) can be used to speedup attacks, so avoid using them. */
(Continue reading)

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 3/8] mac80211: remove writable debugs mesh parameters

These parameters shouldn't be configurable via debugfs, if they
need to be configurable nl80211 support has to be added, if not
then they don't need to be writable here either.

Signed-off-by: Johannes Berg <johannes@...>
Cc: Javier Cardona <javier@...>
Cc: Luis Carlos Cobo <luisca@...>
---
 net/mac80211/debugfs_netdev.c |  112 +++++++++---------------------------------
 1 file changed, 24 insertions(+), 88 deletions(-)

--- everything.orig/net/mac80211/debugfs_netdev.c	2008-10-07 11:26:52.000000000 +0200
+++ everything/net/mac80211/debugfs_netdev.c	2008-10-07 11:27:00.000000000 +0200
@@ -41,29 +41,6 @@ static ssize_t ieee80211_if_read(
 	return ret;
 }

-#ifdef CONFIG_MAC80211_MESH
-static ssize_t ieee80211_if_write(
-	struct ieee80211_sub_if_data *sdata,
-	char const __user *userbuf,
-	size_t count, loff_t *ppos,
-	int (*format)(struct ieee80211_sub_if_data *, char *))
-{
-	char buf[10];
-	int buf_size;
-
-	memset(buf, 0x00, sizeof(buf));
-	buf_size = min(count, (sizeof(buf)-1));
-	if (copy_from_user(buf, userbuf, buf_size))
(Continue reading)

Javier Cardona | 7 Oct 19:45

Re: [PATCH 3/8] mac80211: remove writable debugs mesh parameters

Johannes,

On Tue, Oct 7, 2008 at 3:04 AM, Johannes Berg <johannes@...> wrote:
> These parameters shouldn't be configurable via debugfs, if they
> need to be configurable nl80211 support has to be added, if not
> then they don't need to be writable here either.

Ack (on behalf of Luisca as well, who is on sabbatical somewhere in Asia...)

Javier

> Signed-off-by: Johannes Berg <johannes@...>
> Cc: Javier Cardona <javier@...>
> Cc: Luis Carlos Cobo <luisca@...>
> ---
>  net/mac80211/debugfs_netdev.c |  112 +++++++++---------------------------------
>  1 file changed, 24 insertions(+), 88 deletions(-)
>
> --- everything.orig/net/mac80211/debugfs_netdev.c       2008-10-07 11:26:52.000000000 +0200
> +++ everything/net/mac80211/debugfs_netdev.c    2008-10-07 11:27:00.000000000 +0200
> @@ -41,29 +41,6 @@ static ssize_t ieee80211_if_read(
>        return ret;
>  }
>
> -#ifdef CONFIG_MAC80211_MESH
> -static ssize_t ieee80211_if_write(
> -       struct ieee80211_sub_if_data *sdata,
> -       char const __user *userbuf,
> -       size_t count, loff_t *ppos,
> -       int (*format)(struct ieee80211_sub_if_data *, char *))
(Continue reading)

Johannes Berg | 7 Oct 12:04
Favicon

[PATCH 5/8] mac80211: remove wiphy_to_hw

This isn't used by anyone, if we ever need it we can add
it back, until then it's useless.

Signed-off-by: Johannes Berg <johannes@...>
---
 include/net/mac80211.h |    2 --
 net/mac80211/cfg.c     |    7 -------
 2 files changed, 9 deletions(-)

--- everything.orig/include/net/mac80211.h	2008-10-07 11:26:51.000000000 +0200
+++ everything/include/net/mac80211.h	2008-10-07 11:27:02.000000000 +0200
@@ -846,8 +846,6 @@ struct ieee80211_hw {
 	s8 max_signal;
 };

-struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy);
-
 /**
  * SET_IEEE80211_DEV - set device for 802.11 hardware
  *
--- everything.orig/net/mac80211/cfg.c	2008-10-07 11:26:56.000000000 +0200
+++ everything/net/mac80211/cfg.c	2008-10-07 11:27:02.000000000 +0200
@@ -17,13 +17,6 @@
 #include "rate.h"
 #include "mesh.h"

-struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy)
-{
-	struct ieee80211_local *local = wiphy_priv(wiphy);
-	return &local->hw;
(Continue reading)


Gmane