2007-09-17 13:42:22

by Tomas Winkler

[permalink] [raw]
Subject: [PATCH 1/1] mac80211: add sta_notify callback

This patch adds sta_notify callback and removes
sta_table_notification which was not used by any driver
This patch helps drivers such as iwlwifi that keeps notion of station
internaly about removal and addition of station or AP to BSS.

Currently iwlwifi have to parse internaly management frames to get this
information.

Signed-off-by: Tomas Winkler <[email protected]>
---
include/net/mac80211.h | 18 ++++++++++++++++--
net/mac80211/sta_info.c | 13 ++++++-------
2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a2c14f9..f762a95 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -497,6 +497,20 @@ typedef enum set_key_cmd {
} set_key_cmd;

/**
+ * enum sta_notify_cmd - sta notify command
+ *
+ * Used with the sta_notify() callback in &struct ieee80211_ops, this
+ * indicates whether a sta is being removed or added
+ *
+ * @STA_NOTIFY_ADD: a station is added
+ * @STA_NOTIFY_REMOVE: a station is removed
+ */
+typedef enum sta_notify_cmd {
+ STA_NOTIFY_ADD, STA_NOTIFY_REMOVE
+} sta_notify_cmd;
+
+
+/**
* struct ieee80211_hw - hardware information and state
* TODO: move documentation into kernel-doc format
*/
@@ -748,8 +762,8 @@ struct ieee80211_ops {

/* Number of STAs in STA table notification (NULL = disabled).
* Must be atomic. */
- void (*sta_table_notification)(struct ieee80211_hw *hw,
- int num_sta);
+ void (*sta_notify)(struct ieee80211_hw *hw,
+ sta_notify_cmd cmd, const u8 *addr);

/* Handle ERP IE change notifications. Must be atomic. */
void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes,
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index c17172a..892e0d5 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -158,9 +158,9 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
list_add(&sta->list, &local->sta_list);
local->num_sta++;
sta_info_hash_add(local, sta);
- if (local->ops->sta_table_notification)
- local->ops->sta_table_notification(local_to_hw(local),
- local->num_sta);
+ if (local->ops->sta_notify)
+ local->ops->sta_notify(local_to_hw(local),
+ STA_NOTIFY_ADD, addr);
write_unlock_bh(&local->sta_lock);

#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -197,10 +197,6 @@ void sta_info_remove(struct sta_info *sta)
}
local->num_sta--;
sta_info_remove_aid_ptr(sta);
-
- if (local->ops->sta_table_notification)
- local->ops->sta_table_notification(local_to_hw(local),
- local->num_sta);
}

void sta_info_free(struct sta_info *sta)
@@ -230,6 +226,9 @@ void sta_info_free(struct sta_info *sta)
ieee80211_key_free(sta->key);
sta->key = NULL;

+ if (local->ops->sta_notify)
+ local->ops->sta_notify(local_to_hw(local),
+ STA_NOTIFY_ADD, sta->addr);
rate_control_remove_sta_debugfs(sta);
ieee80211_sta_debugfs_remove(sta);

--
1.5.2.2
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


2007-09-24 08:33:13

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On Mon, 2007-09-24 at 02:47 +0200, Tomas Winkler wrote:

> git:// works fine but I need http because of the firewall.

Michael: poke: you need to run git-http-update or whatever it's called
from the commit hook.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-26 11:55:32

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/24/07, Johannes Berg <[email protected]> wrote:
> On Mon, 2007-09-24 at 02:47 +0200, Tomas Winkler wrote:
>
> > git:// works fine but I need http because of the firewall.
>
> Michael: poke: you need to run git-http-update or whatever it's called
> from the commit hook.
>
Actually the problem is in net-2.6.24.git which mac80211-misc references
Dave?

Thanks
Tomas

>
>

2007-09-18 16:51:43

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/17/07, Johannes Berg <[email protected]> wrote:
> On Mon, 2007-09-17 at 15:42 +0200, Tomas Winkler wrote:
>
> > + void (*sta_notify)(struct ieee80211_hw *hw,
> > + sta_notify_cmd cmd, const u8 *addr);
>
> I have plans to make the sta_info structs per-netdev so that we can
> support having the same station associate to multiple virtual APs and
> not hurting WDS links etc. This is not too hard, but needs some thought.
>
> However, for this callback to be correct when the same sta_info struct
> can be present for multiple virtual interfaces, we need to be able to
> distinguish somehow, so this callback should probably get an if_idx that
> allows a driver to map to the right interface because in add_interface
> it was given the same if_idx.
>
> I know this doesn't matter for iwlwifi because it only supports a single
> local MAC address and currently not even WDS/AP mode at the same time
> (nor AP mode at all? haven't checked).

Actually I'm interested in this feature 4965AGN HW supports multiple
MAC addresses.
Need to enabled it also in the driver but this is few month away till
I get there.

> And I wonder if there will ever

AP mode is functional yet not the whole code is published I want to
roll it in slowly and I need the patch I sent for it.
The legacy AP mode (not 11n) should be functional even on the current code base.

> be any hardware that cares and supports the configuration that would
> require it Should we just leave it and add a comment that when the
> driver supports multiple interfaces this callback is unusable?

It

> Thoughts? Do you have plans to, say, support combined WDS/AP modes?
Yes
If
> so, would the firmware be able to distinguish between the same STA
> sending WDS frames and trying to associate?
Yes it will

I don't know if any current
> software supports that but I see nothing precluding it either. Or say
> you have a WDS interface and also associate with a client interface to
> the same AP; we could easily do that with b43 by allowing WDS interfaces
> with the same MAC address in parallel all the time.
>
> johannes
>
>

2007-09-19 10:17:32

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On Tue, 2007-09-18 at 18:51 +0200, Tomas Winkler wrote:

> Actually I'm interested in this feature 4965AGN HW supports multiple
> MAC addresses.

> > so, would the firmware be able to distinguish between the same STA
> > sending WDS frames and trying to associate?

> Yes it will

So that means you should add the if_id to the sta callback, no?

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-24 00:47:48

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/24/07, Tomas Winkler <[email protected]> wrote:
> On 9/22/07, Tomas Winkler <[email protected]> wrote:
> > On 9/19/07, Johannes Berg <[email protected]> wrote:
> > > On Wed, 2007-09-19 at 17:05 +0200, Tomas Winkler wrote:
> > >
> > > > I will do this favor for you :) I will prepare another patch.
> > >
> > > Thanks :)
> > >
> > > You should probably base it against Michael's tree though:
> > > http://git.kernel.org/?p=linux/kernel/git/mwu/mac80211-misc.git;a=summary
> > > which basically consists of all the patches I had that we agreed on
> > > should go in.
> > >
> > > Oh and please also update the comment describing the callback.
> > >
> > I cannot clone the tree it gives me an error about wrong blob. I
> > cannot even get snapshot from gitweb.
>
>
> cg-clone http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
> Initialized empty Git repository in .git/
> Fetching head...
> Fetching objects...
> Getting alternates list for
> http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
> Also look at http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.24.git/
> Getting pack list for
> http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
> Getting index for pack 91b13e9181bb0f55aac736e33abdec5c2be3303f
> Getting index for pack a4dceed182e0ade8737e9c62ac789e58aa6f7655
> Getting pack 91b13e9181bb0f55aac736e33abdec5c2be3303f
> which contains 4cceb887147261d7fd9fe7ce3b6d6f236c8300bc
> Getting pack list for
> http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.24.git/
> error: Unable to find 27c3e839b54e9d81eb32a6cb7f28a1e71c05b8ef under
> http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
> Cannot obtain needed blob 27c3e839b54e9d81eb32a6cb7f28a1e71c05b8ef
> while processing commit 38e405f56478021531ad9eda5291474fe6d120d5.
> progress: 0 objects, 12873698 bytes
> cg-fetch: objects fetch failed
>
git:// works fine but I need http because of the firewall.

> > Thanks
> > Tomas
> >
>

2007-09-19 15:05:07

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/19/07, Johannes Berg <[email protected]> wrote:
> On Wed, 2007-09-19 at 13:38 +0200, Tomas Winkler wrote:
>
> > Yes, yet I'm not sure I want to deal with it right now.
>
> Well, my patch making sta_info be per-if isn't ready yet either.
> However, once I finish that patch I'll have to touch this callback to be
> correct, and then I will need to fix iwlwifi for using it which is not
> really nice. Hence, I would very much prefer if this callback was
> correctly defined in the first place and the driver simply ignored the
> extra information it currently doesn't need.
>

I will do this favor for you :) I will prepare another patch.
Tomas

> johannes
>
>

2007-09-18 10:08:28

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On Mon, 2007-09-17 at 15:42 +0200, Tomas Winkler wrote:

> + void (*sta_notify)(struct ieee80211_hw *hw,
> + sta_notify_cmd cmd, const u8 *addr);

I have plans to make the sta_info structs per-netdev so that we can
support having the same station associate to multiple virtual APs and
not hurting WDS links etc. This is not too hard, but needs some thought.

However, for this callback to be correct when the same sta_info struct
can be present for multiple virtual interfaces, we need to be able to
distinguish somehow, so this callback should probably get an if_idx that
allows a driver to map to the right interface because in add_interface
it was given the same if_idx.

I know this doesn't matter for iwlwifi because it only supports a single
local MAC address and currently not even WDS/AP mode at the same time
(nor AP mode at all? haven't checked). And I wonder if there will ever
be any hardware that cares and supports the configuration that would
require it. Should we just leave it and add a comment that when the
driver supports multiple interfaces this callback is unusable?

Thoughts? Do you have plans to, say, support combined WDS/AP modes? If
so, would the firmware be able to distinguish between the same STA
sending WDS frames and trying to associate? I don't know if any current
software supports that but I see nothing precluding it either. Or say
you have a WDS interface and also associate with a client interface to
the same AP; we could easily do that with b43 by allowing WDS interfaces
with the same MAC address in parallel all the time.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-24 01:24:53

by Ian Schram

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

from an *up to date* wireless-dev tree I appear to be able to fetch the
mwu/mac80211-misc.git

git remote add mwu http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc
git fetch mwu
git checkout mwu/master

This might work for you. I'm not a git master either though.

ian

Tomas Winkler wrote:
> On 9/24/07, Tomas Winkler <[email protected]> wrote:
>> On 9/22/07, Tomas Winkler <[email protected]> wrote:
>>> On 9/19/07, Johannes Berg <[email protected]> wrote:
>>>> On Wed, 2007-09-19 at 17:05 +0200, Tomas Winkler wrote:
>>>>
>>>>> I will do this favor for you :) I will prepare another patch.
>>>> Thanks :)
>>>>
>>>> You should probably base it against Michael's tree though:
>>>> http://git.kernel.org/?p=linux/kernel/git/mwu/mac80211-misc.git;a=summary
>>>> which basically consists of all the patches I had that we agreed on
>>>> should go in.
>>>>
>>>> Oh and please also update the comment describing the callback.
>>>>
>>> I cannot clone the tree it gives me an error about wrong blob. I
>>> cannot even get snapshot from gitweb.
>>
>> cg-clone http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
>> Initialized empty Git repository in .git/
>> Fetching head...
>> Fetching objects...
>> Getting alternates list for
>> http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
>> Also look at http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.24.git/
>> Getting pack list for
>> http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
>> Getting index for pack 91b13e9181bb0f55aac736e33abdec5c2be3303f
>> Getting index for pack a4dceed182e0ade8737e9c62ac789e58aa6f7655
>> Getting pack 91b13e9181bb0f55aac736e33abdec5c2be3303f
>> which contains 4cceb887147261d7fd9fe7ce3b6d6f236c8300bc
>> Getting pack list for
>> http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.24.git/
>> error: Unable to find 27c3e839b54e9d81eb32a6cb7f28a1e71c05b8ef under
>> http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
>> Cannot obtain needed blob 27c3e839b54e9d81eb32a6cb7f28a1e71c05b8ef
>> while processing commit 38e405f56478021531ad9eda5291474fe6d120d5.
>> progress: 0 objects, 12873698 bytes
>> cg-fetch: objects fetch failed
>>
> git:// works fine but I need http because of the firewall.
>
>>> Thanks
>>> Tomas
>>>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>

2007-09-19 12:27:42

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On Wed, 2007-09-19 at 13:38 +0200, Tomas Winkler wrote:

> Yes, yet I'm not sure I want to deal with it right now.

Well, my patch making sta_info be per-if isn't ready yet either.
However, once I finish that patch I'll have to touch this callback to be
correct, and then I will need to fix iwlwifi for using it which is not
really nice. Hence, I would very much prefer if this callback was
correctly defined in the first place and the driver simply ignored the
extra information it currently doesn't need.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-23 23:44:33

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/22/07, Tomas Winkler <[email protected]> wrote:
> On 9/19/07, Johannes Berg <[email protected]> wrote:
> > On Wed, 2007-09-19 at 17:05 +0200, Tomas Winkler wrote:
> >
> > > I will do this favor for you :) I will prepare another patch.
> >
> > Thanks :)
> >
> > You should probably base it against Michael's tree though:
> > http://git.kernel.org/?p=linux/kernel/git/mwu/mac80211-misc.git;a=summary
> > which basically consists of all the patches I had that we agreed on
> > should go in.
> >
> > Oh and please also update the comment describing the callback.
> >
> I cannot clone the tree it gives me an error about wrong blob. I
> cannot even get snapshot from gitweb.


cg-clone http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
Initialized empty Git repository in .git/
Fetching head...
Fetching objects...
Getting alternates list for
http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
Also look at http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.24.git/
Getting pack list for
http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
Getting index for pack 91b13e9181bb0f55aac736e33abdec5c2be3303f
Getting index for pack a4dceed182e0ade8737e9c62ac789e58aa6f7655
Getting pack 91b13e9181bb0f55aac736e33abdec5c2be3303f
which contains 4cceb887147261d7fd9fe7ce3b6d6f236c8300bc
Getting pack list for
http://www.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.24.git/
error: Unable to find 27c3e839b54e9d81eb32a6cb7f28a1e71c05b8ef under
http://www.kernel.org/pub/scm/linux/kernel/git/mwu/mac80211-misc.git
Cannot obtain needed blob 27c3e839b54e9d81eb32a6cb7f28a1e71c05b8ef
while processing commit 38e405f56478021531ad9eda5291474fe6d120d5.
progress: 0 objects, 12873698 bytes
cg-fetch: objects fetch failed

> Thanks
> Tomas
>

2007-09-19 15:09:54

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On Wed, 2007-09-19 at 17:05 +0200, Tomas Winkler wrote:

> I will do this favor for you :) I will prepare another patch.

Thanks :)

You should probably base it against Michael's tree though:
http://git.kernel.org/?p=linux/kernel/git/mwu/mac80211-misc.git;a=summary
which basically consists of all the patches I had that we agreed on
should go in.

Oh and please also update the comment describing the callback.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-09-19 11:38:40

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/19/07, Johannes Berg <[email protected]> wrote:
> On Tue, 2007-09-18 at 18:51 +0200, Tomas Winkler wrote:
>
> > Actually I'm interested in this feature 4965AGN HW supports multiple
> > MAC addresses.
>
> > > so, would the firmware be able to distinguish between the same STA
> > > sending WDS frames and trying to associate?
>
> > Yes it will
>
> So that means you should add the if_id to the sta callback, no?
>
Yes, yet I'm not sure I want to deal with it right now. I have no use
for it currently
I will add it in next stage there are no objections. I don't think
I'm breaking anything right now.

> johannes
>
>

2007-09-22 16:33:11

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 1/1] mac80211: add sta_notify callback

On 9/19/07, Johannes Berg <[email protected]> wrote:
> On Wed, 2007-09-19 at 17:05 +0200, Tomas Winkler wrote:
>
> > I will do this favor for you :) I will prepare another patch.
>
> Thanks :)
>
> You should probably base it against Michael's tree though:
> http://git.kernel.org/?p=linux/kernel/git/mwu/mac80211-misc.git;a=summary
> which basically consists of all the patches I had that we agreed on
> should go in.
>
> Oh and please also update the comment describing the callback.
>
I cannot clone the tree it gives me an error about wrong blob. I
cannot even get snapshot from gitweb.
Thanks
Tomas