2008-07-17 20:12:26

by Andrey Yurovsky

[permalink] [raw]
Subject: [PATCH] ath5k: add Mesh Point support

This enables draft-802.11s Mesh Point operation. For that we need mesh
beaconing. Tested with AR5212/AR5213 PCI card against Zydas and b43 mesh
nodes.

Signed-off-by: Andrey Yurovsky <[email protected]>
---
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 217d506..6d9f4e1 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1425,7 +1425,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
if (ret)
return ret;
- if (sc->opmode == IEEE80211_IF_TYPE_AP) {
+ if (sc->opmode == IEEE80211_IF_TYPE_AP ||
+ sc->opmode == IEEE80211_IF_TYPE_MESH_POINT) {
/*
* Always burst out beacon and CAB traffic
* (aifs = cwmin = cwmax = 0)
@@ -2911,6 +2912,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
if (sc->opmode != IEEE80211_IF_TYPE_STA)
rfilt |= AR5K_RX_FILTER_PROBEREQ;
if (sc->opmode != IEEE80211_IF_TYPE_AP &&
+ sc->opmode != IEEE80211_IF_TYPE_MESH_POINT &&
test_bit(ATH_STAT_PROMISC, sc->status))
rfilt |= AR5K_RX_FILTER_PROM;
if (sc->opmode == IEEE80211_IF_TYPE_STA ||
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index c6d12c5..8854820 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -2326,6 +2326,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
break;

case IEEE80211_IF_TYPE_AP:
+ case IEEE80211_IF_TYPE_MESH_POINT:
pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA |
(ah->ah_version == AR5K_AR5210 ?
AR5K_STA_ID1_NO_PSPOLL : 0);




2008-07-18 17:59:05

by Nick Kossifidis

[permalink] [raw]
Subject: Re: [PATCH] ath5k: add Mesh Point support

2008/7/17 Andrey Yurovsky <[email protected]>:
> This enables draft-802.11s Mesh Point operation. For that we need mesh
> beaconing. Tested with AR5212/AR5213 PCI card against Zydas and b43 mesh
> nodes.
>
> Signed-off-by: Andrey Yurovsky <[email protected]>
> ---
> diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
> index 217d506..6d9f4e1 100644
> --- a/drivers/net/wireless/ath5k/base.c
> +++ b/drivers/net/wireless/ath5k/base.c
> @@ -1425,7 +1425,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
> ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
> if (ret)
> return ret;
> - if (sc->opmode == IEEE80211_IF_TYPE_AP) {
> + if (sc->opmode == IEEE80211_IF_TYPE_AP ||
> + sc->opmode == IEEE80211_IF_TYPE_MESH_POINT) {
> /*
> * Always burst out beacon and CAB traffic
> * (aifs = cwmin = cwmax = 0)
> @@ -2911,6 +2912,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
> if (sc->opmode != IEEE80211_IF_TYPE_STA)
> rfilt |= AR5K_RX_FILTER_PROBEREQ;
> if (sc->opmode != IEEE80211_IF_TYPE_AP &&
> + sc->opmode != IEEE80211_IF_TYPE_MESH_POINT &&
> test_bit(ATH_STAT_PROMISC, sc->status))
> rfilt |= AR5K_RX_FILTER_PROM;
> if (sc->opmode == IEEE80211_IF_TYPE_STA ||
> diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
> index c6d12c5..8854820 100644
> --- a/drivers/net/wireless/ath5k/hw.c
> +++ b/drivers/net/wireless/ath5k/hw.c
> @@ -2326,6 +2326,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
> break;
>
> case IEEE80211_IF_TYPE_AP:
> + case IEEE80211_IF_TYPE_MESH_POINT:
> pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA |
> (ah->ah_version == AR5K_AR5210 ?
> AR5K_STA_ID1_NO_PSPOLL : 0);
>
>

Thanks ;-)

Acked-by: Nick Kossifidis <[email protected]>



--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick

2008-07-28 12:10:09

by Johannes Berg

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH] ath5k: add Mesh Point support


> I've been looking at this too. After the "revamp beacon configuration"
> patch, mesh no longer send beacons. If I revert it, beacons reappear and
> my two stations are found. I'm using both a b43 & zd1211rw.
>
> I believe the problem is in mac80211. It appears that the call to
> ieee80211_if_config that was previously in ieee80211_open never made it
> to the new start_mesh routine in the revision. The attached patch seems
> to revive beacons and both stations are now found. I'm not familiar with
> the code and wouldn't call this a fix.

Yeah, we talked about it yesterday or the day before, and this seems
like the right fix, except you say that AP is also broken.

I'll look into everything when I no longer feel hung over from
travelling for about 18 hours.

johannes


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

2008-07-30 19:27:43

by Luis Carlos Cobo

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH] ath5k: add Mesh Point support

On Mon, 2008-07-28 at 08:45 -0400, Steve Brown wrote:
> Although mesh path timeout seems to default to 5000ms, in my testing =
it=20
> takes about 50 min. Is this really the timeout that removes a node wh=
en=20
> it's beacon is off for this period?

=EF=BB=BF
When a mesh path timeouts it is marked accordingly and it is no longer
valid for routing. In a continuous traffic scenario this means that
every five seconds, the route are refreshed. Actually we start
refreshing one second before the route expires, so that we have a fresh
path before the current one times out.

Mesh path timeout does not _remove_ the path from the mesh path table,
so you will see it for a while, the table cleanup function which remove=
s
from the table paths that have expired long ago has a separate timing.

--=20
Luis Carlos Cobo Rus GnuPG ID: 44019B60
cozybit Inc.

2008-07-28 10:25:42

by Steve Brown

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH] ath5k: add Mesh Point support

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 8f51375..10f5d6a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3300,6 +3300,7 @@ void ieee80211_start_mesh(struct net_device *dev)
{
struct ieee80211_if_sta *ifsta;
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON);
ifsta = &sdata->u.sta;
ifsta->state = IEEE80211_MESH_UP;
ieee80211_sta_timer((unsigned long)sdata);


Attachments:
start_mesh.patch (475.00 B)

2008-07-28 12:48:38

by Steve Brown

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH] ath5k: add Mesh Point support

Johannes Berg wrote:
>> I've been looking at this too. After the "revamp beacon configuration"
>> patch, mesh no longer send beacons. If I revert it, beacons reappear and
>> my two stations are found. I'm using both a b43 & zd1211rw.
>>
>> I believe the problem is in mac80211. It appears that the call to
>> ieee80211_if_config that was previously in ieee80211_open never made it
>> to the new start_mesh routine in the revision. The attached patch seems
>> to revive beacons and both stations are now found. I'm not familiar with
>> the code and wouldn't call this a fix.
>>
>
> Yeah, we talked about it yesterday or the day before, and this seems
> like the right fix, except you say that AP is also broken.
>
> I'll look into everything when I no longer feel hung over from
> travelling for about 18 hours.
>
> johannes
>
I haven't tested AP, just mesh. So far, it's working w/ 3 nodes. In
rereading my post, it wasn't clear which beacons I meant.

Although mesh path timeout seems to default to 5000ms, in my testing it
takes about 50 min. Is this really the timeout that removes a node when
it's beacon is off for this period?

Steve


2008-07-28 09:10:00

by YanBo

[permalink] [raw]
Subject: Re: [ath5k-devel] [PATCH] ath5k: add Mesh Point support

On Fri, Jul 18, 2008 at 4:12 AM, Andrey Yurovsky <[email protected]> wrote:
> This enables draft-802.11s Mesh Point operation. For that we need mesh
> beaconing. Tested with AR5212/AR5213 PCI card against Zydas and b43 mesh
> nodes.
>
> Signed-off-by: Andrey Yurovsky <[email protected]>
> ---
> diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
> index 217d506..6d9f4e1 100644
> --- a/drivers/net/wireless/ath5k/base.c
> +++ b/drivers/net/wireless/ath5k/base.c
> @@ -1425,7 +1425,8 @@ ath5k_beaconq_config(struct ath5k_softc *sc)
> ret = ath5k_hw_get_tx_queueprops(ah, sc->bhalq, &qi);
> if (ret)
> return ret;
> - if (sc->opmode == IEEE80211_IF_TYPE_AP) {
> + if (sc->opmode == IEEE80211_IF_TYPE_AP ||
> + sc->opmode == IEEE80211_IF_TYPE_MESH_POINT) {
> /*
> * Always burst out beacon and CAB traffic
> * (aifs = cwmin = cwmax = 0)
> @@ -2911,6 +2912,7 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
> if (sc->opmode != IEEE80211_IF_TYPE_STA)
> rfilt |= AR5K_RX_FILTER_PROBEREQ;
> if (sc->opmode != IEEE80211_IF_TYPE_AP &&
> + sc->opmode != IEEE80211_IF_TYPE_MESH_POINT &&
> test_bit(ATH_STAT_PROMISC, sc->status))
> rfilt |= AR5K_RX_FILTER_PROM;
> if (sc->opmode == IEEE80211_IF_TYPE_STA ||
> diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
> index c6d12c5..8854820 100644
> --- a/drivers/net/wireless/ath5k/hw.c
> +++ b/drivers/net/wireless/ath5k/hw.c
> @@ -2326,6 +2326,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah)
> break;
>
> case IEEE80211_IF_TYPE_AP:
> + case IEEE80211_IF_TYPE_MESH_POINT:
> pcu_reg |= AR5K_STA_ID1_AP | AR5K_STA_ID1_RTS_DEF_ANTENNA |
> (ah->ah_version == AR5K_AR5210 ?
> AR5K_STA_ID1_NO_PSPOLL : 0);
>
>

Hi Andrey

First of all, Thanks for your works to enable the ath5k support
80211s. I just testing them with the newest wireless-testing tree and
meet some problems:

The Atheros chipset what I used is one AR2413 cardbus card and one
AR5414(the lspci show it as AR5413 but debug message show is as
AR5414) , after apply the patch, I waked the up them by follow
commands:

iw dev wmaster0 interface add mesh type mp mesh_id 12345
iwconfig mesh channel 1
ifconfig mesh 192.168.3.80/192.168.3.81

but there is no beacon was send from any of them, after input "iw dev
mesh station dump"
it also no station was found,(PS:the two PC are very close), ping each
other also no response.

After roughly browse the ath5k code and the patch, I have below questions:
1. From the patch, there is no any place to set the sc->opmode's
value to IEEE80211_IF_TYPE_MESH_POINT.
2. it also haven't found code to enable/trigger "beacon send" in
MESH_POINT mode.

So I think maybe this patch can make ath5k work in mesh mode if some
mesh point(with b43 or zd1211rw) has been waked up early. because it
can correctly deal with the RX mesh packet. but it can't work
independent in a pure ath5k mesh network, cause none can send beacon
correctly, and hence they can't set up link each other.

BR
yanbo