linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFA] iwl4965: support mesh networking
@ 2008-05-22  9:11 Johannes Berg
  2008-05-22 10:23 ` Stefanik Gábor
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johannes Berg @ 2008-05-22  9:11 UTC (permalink / raw)
  To: linux-wireless; +Cc: Zhu Yi, Tomas Winkler

This tries to make iwl4965 support mesh, but it doesn't actually work.

Here's my s-o-b so anyone else can try to make it work, I haven't
figured out yet what the bug is...

It seems that the iwlwifi card doesn't beacon, so the mesh state machine
gets stuck.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c  |    9 ++++++---
 drivers/net/wireless/iwlwifi/iwl-core.c     |    3 ++-
 drivers/net/wireless/iwlwifi/iwl-sta.c      |   10 +++++++---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   17 ++++++++++++-----
 4 files changed, 27 insertions(+), 12 deletions(-)

--- everything.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c	2008-05-22 10:42:27.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl4965-base.c	2008-05-22 10:44:59.000000000 +0200
@@ -584,7 +584,8 @@ unsigned int iwl4965_fill_beacon_frame(s
 
 	if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
 	    ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
-	     (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
+	     (priv->iw_mode != IEEE80211_IF_TYPE_AP) &&
+	     (priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT)))
 		return 0;
 
 	if (priv->ibss_beacon->len > left)
@@ -1158,6 +1159,7 @@ static void iwl4965_connection_init_rx_c
 		break;
 
 	case IEEE80211_IF_TYPE_IBSS:
+	case IEEE80211_IF_TYPE_MESH_POINT:
 		priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
 		priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
 		priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
@@ -1193,7 +1195,8 @@ static void iwl4965_connection_init_rx_c
 	 * in some case A channels are all non IBSS
 	 * in this case force B/G channel
 	 */
-	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
+	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	     priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
 	    !(is_channel_ibss(ch_info)))
 		ch_info = &priv->channel_info[0];
 
@@ -1218,7 +1221,8 @@ static void iwl4965_connection_init_rx_c
 
 static int iwl4965_set_mode(struct iwl_priv *priv, int mode)
 {
-	if (mode == IEEE80211_IF_TYPE_IBSS) {
+	if (mode == IEEE80211_IF_TYPE_IBSS ||
+	    mode == IEEE80211_IF_TYPE_MESH_POINT) {
 		const struct iwl_channel_info *ch_info;
 
 		ch_info = iwl_get_channel_info(priv,
@@ -3947,6 +3951,7 @@ static void iwl4965_post_associate(struc
 		break;
 
 	case IEEE80211_IF_TYPE_IBSS:
+	case IEEE80211_IF_TYPE_MESH_POINT:
 
 		/* clear out the station table */
 		iwlcore_clear_stations_table(priv);
@@ -3970,7 +3975,8 @@ static void iwl4965_post_associate(struc
 	iwl_chain_noise_reset(priv);
 	priv->start_calib = 1;
 
-	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
+	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	    priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT)
 		priv->assoc_station_added = 1;
 
 	iwl4965_activate_qos(priv, 0);
@@ -4960,7 +4966,8 @@ static int iwl4965_mac_beacon_update(str
 		return -EIO;
 	}
 
-	if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
+	if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS &&
+	    priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT) {
 		IWL_DEBUG_MAC80211("leave - not IBSS\n");
 		mutex_unlock(&priv->mutex);
 		return -EIO;
--- everything.orig/drivers/net/wireless/iwlwifi/iwl-sta.c	2008-05-22 10:42:27.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl-sta.c	2008-05-22 10:44:59.000000000 +0200
@@ -46,7 +46,8 @@ u8 iwl_find_station(struct iwl_priv *pri
 	DECLARE_MAC_BUF(mac);
 
 	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) ||
-	    (priv->iw_mode == IEEE80211_IF_TYPE_AP))
+	    (priv->iw_mode == IEEE80211_IF_TYPE_AP) ||
+	    (priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
 		start = IWL_STA_ID;
 
 	if (is_broadcast_ether_addr(addr))
@@ -229,7 +230,8 @@ u8 iwl_add_station_flags(struct iwl_priv
 
 	/* BCAST station and IBSS stations do not work in HT mode */
 	if (index != priv->hw_params.bcast_sta_id &&
-	    priv->iw_mode != IEEE80211_IF_TYPE_IBSS)
+	    priv->iw_mode != IEEE80211_IF_TYPE_IBSS &&
+	    priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT)
 		iwl_set_ht_add_station(priv, index, ht_info);
 
 	spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
@@ -575,7 +577,8 @@ int iwl_send_lq_cmd(struct iwl_priv *pri
 	};
 
 	if ((lq->sta_id == 0xFF) &&
-	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
+	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	     priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
 		return -EINVAL;
 
 	if (lq->sta_id == 0xFF)
@@ -712,6 +715,7 @@ int iwl_get_sta_id(struct iwl_priv *priv
 	/* If this frame is going out to an IBSS network, find the station,
 	 * or create a new station table entry */
 	case IEEE80211_IF_TYPE_IBSS:
+	case IEEE80211_IF_TYPE_MESH_POINT:
 		sta_id = iwl_find_station(priv, hdr->addr1);
 		if (sta_id != IWL_INVALID_STATION)
 			return sta_id;
--- everything.orig/drivers/net/wireless/iwlwifi/iwl-4965-rs.c	2008-05-22 10:42:27.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl-4965-rs.c	2008-05-22 10:44:59.000000000 +0200
@@ -835,7 +835,8 @@ static void rs_tx_status(void *priv_rate
 	if (!priv->lq_mngr.lq_ready)
 		goto out;
 
-	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
+	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	     priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
 	    !lq_sta->ibss_sta_added)
 		goto out;
 
@@ -2088,7 +2089,8 @@ static void rs_initialize_lq(struct iwl_
 	i = sta->last_txrate_idx;
 
 	if ((lq_sta->lq.sta_id == 0xff) &&
-	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
+	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	     priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
 		goto out;
 
 	valid_tx_ant = priv->hw_params.valid_tx_ant;
@@ -2158,7 +2160,8 @@ static void rs_get_rate(void *priv_rate,
 	lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv;
 	i = sta->last_txrate_idx;
 
-	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
+	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	     priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
 	    !lq_sta->ibss_sta_added) {
 		u8 sta_id = iwl_find_station(priv, hdr->addr1);
 		DECLARE_MAC_BUF(mac);
--- everything.orig/drivers/net/wireless/iwlwifi/iwl-core.c	2008-05-22 10:42:27.000000000 +0200
+++ everything/drivers/net/wireless/iwlwifi/iwl-core.c	2008-05-22 10:44:59.000000000 +0200
@@ -245,7 +245,8 @@ void iwl_reset_qos(struct iwl_priv *priv
 	spin_lock_irqsave(&priv->lock, flags);
 	priv->qos_data.qos_active = 0;
 
-	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) {
+	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
+	    priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) {
 		if (priv->qos_data.qos_enable)
 			priv->qos_data.qos_active = 1;
 		if (!(priv->active_rate & 0xfff0)) {



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

* Re: [RFA] iwl4965: support mesh networking
  2008-05-22  9:11 [RFA] iwl4965: support mesh networking Johannes Berg
@ 2008-05-22 10:23 ` Stefanik Gábor
  2008-05-22 11:09 ` Tomas Winkler
  2008-06-09 20:11 ` Richard Scherping
  2 siblings, 0 replies; 5+ messages in thread
From: Stefanik Gábor @ 2008-05-22 10:23 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

On Thu, May 22, 2008 at 11:11 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> This tries to make iwl4965 support mesh, but it doesn't actually work.
>
> Here's my s-o-b so anyone else can try to make it work, I haven't
> figured out yet what the bug is...
>
> It seems that the iwlwifi card doesn't beacon, so the mesh state machine
> gets stuck.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
>  drivers/net/wireless/iwlwifi/iwl-4965-rs.c  |    9 ++++++---
>  drivers/net/wireless/iwlwifi/iwl-core.c     |    3 ++-
>  drivers/net/wireless/iwlwifi/iwl-sta.c      |   10 +++++++---
>  drivers/net/wireless/iwlwifi/iwl4965-base.c |   17 ++++++++++++-----
>  4 files changed, 27 insertions(+), 12 deletions(-)
>
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c 2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl4965-base.c      2008-05-22 10:44:59.000000000 +0200
> @@ -584,7 +584,8 @@ unsigned int iwl4965_fill_beacon_frame(s
>
>        if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
>            ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
> -            (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
> +            (priv->iw_mode != IEEE80211_IF_TYPE_AP) &&
> +            (priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT)))
>                return 0;
>
>        if (priv->ibss_beacon->len > left)
> @@ -1158,6 +1159,7 @@ static void iwl4965_connection_init_rx_c
>                break;
>
>        case IEEE80211_IF_TYPE_IBSS:
> +       case IEEE80211_IF_TYPE_MESH_POINT:
>                priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
>                priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
>                priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
> @@ -1193,7 +1195,8 @@ static void iwl4965_connection_init_rx_c
>         * in some case A channels are all non IBSS
>         * in this case force B/G channel
>         */
> -       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
> +       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
>            !(is_channel_ibss(ch_info)))
>                ch_info = &priv->channel_info[0];
>
> @@ -1218,7 +1221,8 @@ static void iwl4965_connection_init_rx_c
>
>  static int iwl4965_set_mode(struct iwl_priv *priv, int mode)
>  {
> -       if (mode == IEEE80211_IF_TYPE_IBSS) {
> +       if (mode == IEEE80211_IF_TYPE_IBSS ||
> +           mode == IEEE80211_IF_TYPE_MESH_POINT) {
>                const struct iwl_channel_info *ch_info;
>
>                ch_info = iwl_get_channel_info(priv,
> @@ -3947,6 +3951,7 @@ static void iwl4965_post_associate(struc
>                break;
>
>        case IEEE80211_IF_TYPE_IBSS:
> +       case IEEE80211_IF_TYPE_MESH_POINT:
>
>                /* clear out the station table */
>                iwlcore_clear_stations_table(priv);
> @@ -3970,7 +3975,8 @@ static void iwl4965_post_associate(struc
>        iwl_chain_noise_reset(priv);
>        priv->start_calib = 1;
>
> -       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
> +       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +           priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT)
>                priv->assoc_station_added = 1;
>
>        iwl4965_activate_qos(priv, 0);
> @@ -4960,7 +4966,8 @@ static int iwl4965_mac_beacon_update(str
>                return -EIO;
>        }
>
> -       if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
> +       if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS &&
> +           priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT) {
>                IWL_DEBUG_MAC80211("leave - not IBSS\n");
>                mutex_unlock(&priv->mutex);
>                return -EIO;
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl-sta.c      2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl-sta.c   2008-05-22 10:44:59.000000000 +0200
> @@ -46,7 +46,8 @@ u8 iwl_find_station(struct iwl_priv *pri
>        DECLARE_MAC_BUF(mac);
>
>        if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) ||
> -           (priv->iw_mode == IEEE80211_IF_TYPE_AP))
> +           (priv->iw_mode == IEEE80211_IF_TYPE_AP) ||
> +           (priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
>                start = IWL_STA_ID;
>
>        if (is_broadcast_ether_addr(addr))
> @@ -229,7 +230,8 @@ u8 iwl_add_station_flags(struct iwl_priv
>
>        /* BCAST station and IBSS stations do not work in HT mode */
>        if (index != priv->hw_params.bcast_sta_id &&
> -           priv->iw_mode != IEEE80211_IF_TYPE_IBSS)
> +           priv->iw_mode != IEEE80211_IF_TYPE_IBSS &&
> +           priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT)
>                iwl_set_ht_add_station(priv, index, ht_info);
>
>        spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
> @@ -575,7 +577,8 @@ int iwl_send_lq_cmd(struct iwl_priv *pri
>        };
>
>        if ((lq->sta_id == 0xFF) &&
> -           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
> +           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
>                return -EINVAL;
>
>        if (lq->sta_id == 0xFF)
> @@ -712,6 +715,7 @@ int iwl_get_sta_id(struct iwl_priv *priv
>        /* If this frame is going out to an IBSS network, find the station,
>         * or create a new station table entry */
>        case IEEE80211_IF_TYPE_IBSS:
> +       case IEEE80211_IF_TYPE_MESH_POINT:
>                sta_id = iwl_find_station(priv, hdr->addr1);
>                if (sta_id != IWL_INVALID_STATION)
>                        return sta_id;
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl-4965-rs.c  2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl-4965-rs.c       2008-05-22 10:44:59.000000000 +0200
> @@ -835,7 +835,8 @@ static void rs_tx_status(void *priv_rate
>        if (!priv->lq_mngr.lq_ready)
>                goto out;
>
> -       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
> +       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
>            !lq_sta->ibss_sta_added)
>                goto out;
>
> @@ -2088,7 +2089,8 @@ static void rs_initialize_lq(struct iwl_
>        i = sta->last_txrate_idx;
>
>        if ((lq_sta->lq.sta_id == 0xff) &&
> -           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
> +           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
>                goto out;
>
>        valid_tx_ant = priv->hw_params.valid_tx_ant;
> @@ -2158,7 +2160,8 @@ static void rs_get_rate(void *priv_rate,
>        lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv;
>        i = sta->last_txrate_idx;
>
> -       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
> +       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
>            !lq_sta->ibss_sta_added) {
>                u8 sta_id = iwl_find_station(priv, hdr->addr1);
>                DECLARE_MAC_BUF(mac);
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl-core.c     2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl-core.c  2008-05-22 10:44:59.000000000 +0200
> @@ -245,7 +245,8 @@ void iwl_reset_qos(struct iwl_priv *priv
>        spin_lock_irqsave(&priv->lock, flags);
>        priv->qos_data.qos_active = 0;
>
> -       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) {
> +       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +           priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) {
>                if (priv->qos_data.qos_enable)
>                        priv->qos_data.qos_active = 1;
>                if (!(priv->active_rate & 0xfff0)) {
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

You also need to modify iwl4965-base.c's iwl4965_get_sta_id function
to generate proper station IDs for the packets being transmitted.
Possibly you might have better luck with this once my injection patch
lands. (Not sure if priv->vif is true in mesh mode, and without my
patch, everything is dropped if !priv->vif.)

-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

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

* Re: [RFA] iwl4965: support mesh networking
  2008-05-22  9:11 [RFA] iwl4965: support mesh networking Johannes Berg
  2008-05-22 10:23 ` Stefanik Gábor
@ 2008-05-22 11:09 ` Tomas Winkler
  2008-05-22 11:11   ` Johannes Berg
  2008-06-09 20:11 ` Richard Scherping
  2 siblings, 1 reply; 5+ messages in thread
From: Tomas Winkler @ 2008-05-22 11:09 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Zhu Yi

On Thu, May 22, 2008 at 12:11 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> This tries to make iwl4965 support mesh, but it doesn't actually work.
>
> Here's my s-o-b so anyone else can try to make it work, I haven't
> figured out yet what the bug is...
>
> It seems that the iwlwifi card doesn't beacon, so the mesh state machine
> gets stuck.
>

It does beaconing in general (we have working IBSS and AP)  the
dev_type must be  RXON_DEV_TYPE_IBSS or AP depends I'm just not
familiar with the MESH stuff.

Tomas


> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
>  drivers/net/wireless/iwlwifi/iwl-4965-rs.c  |    9 ++++++---
>  drivers/net/wireless/iwlwifi/iwl-core.c     |    3 ++-
>  drivers/net/wireless/iwlwifi/iwl-sta.c      |   10 +++++++---
>  drivers/net/wireless/iwlwifi/iwl4965-base.c |   17 ++++++++++++-----
>  4 files changed, 27 insertions(+), 12 deletions(-)
>
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl4965-base.c 2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl4965-base.c      2008-05-22 10:44:59.000000000 +0200
> @@ -584,7 +584,8 @@ unsigned int iwl4965_fill_beacon_frame(s
>
>        if (!iwl_is_associated(priv) || !priv->ibss_beacon ||
>            ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
> -            (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
> +            (priv->iw_mode != IEEE80211_IF_TYPE_AP) &&
> +            (priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT)))
>                return 0;
>
>        if (priv->ibss_beacon->len > left)
> @@ -1158,6 +1159,7 @@ static void iwl4965_connection_init_rx_c
>                break;
>
>        case IEEE80211_IF_TYPE_IBSS:
> +       case IEEE80211_IF_TYPE_MESH_POINT:
>                priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
>                priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
>                priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
> @@ -1193,7 +1195,8 @@ static void iwl4965_connection_init_rx_c
>         * in some case A channels are all non IBSS
>         * in this case force B/G channel
>         */
> -       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
> +       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
>            !(is_channel_ibss(ch_info)))
>                ch_info = &priv->channel_info[0];
>
> @@ -1218,7 +1221,8 @@ static void iwl4965_connection_init_rx_c
>
>  static int iwl4965_set_mode(struct iwl_priv *priv, int mode)
>  {
> -       if (mode == IEEE80211_IF_TYPE_IBSS) {
> +       if (mode == IEEE80211_IF_TYPE_IBSS ||
> +           mode == IEEE80211_IF_TYPE_MESH_POINT) {
>                const struct iwl_channel_info *ch_info;
>
>                ch_info = iwl_get_channel_info(priv,
> @@ -3947,6 +3951,7 @@ static void iwl4965_post_associate(struc
>                break;
>
>        case IEEE80211_IF_TYPE_IBSS:
> +       case IEEE80211_IF_TYPE_MESH_POINT:
>
>                /* clear out the station table */
>                iwlcore_clear_stations_table(priv);
> @@ -3970,7 +3975,8 @@ static void iwl4965_post_associate(struc
>        iwl_chain_noise_reset(priv);
>        priv->start_calib = 1;
>
> -       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
> +       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +           priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT)
>                priv->assoc_station_added = 1;
>
>        iwl4965_activate_qos(priv, 0);
> @@ -4960,7 +4966,8 @@ static int iwl4965_mac_beacon_update(str
>                return -EIO;
>        }
>
> -       if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS) {
> +       if (priv->iw_mode != IEEE80211_IF_TYPE_IBSS &&
> +           priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT) {
>                IWL_DEBUG_MAC80211("leave - not IBSS\n");
>                mutex_unlock(&priv->mutex);
>                return -EIO;
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl-sta.c      2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl-sta.c   2008-05-22 10:44:59.000000000 +0200
> @@ -46,7 +46,8 @@ u8 iwl_find_station(struct iwl_priv *pri
>        DECLARE_MAC_BUF(mac);
>
>        if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) ||
> -           (priv->iw_mode == IEEE80211_IF_TYPE_AP))
> +           (priv->iw_mode == IEEE80211_IF_TYPE_AP) ||
> +           (priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
>                start = IWL_STA_ID;
>
>        if (is_broadcast_ether_addr(addr))
> @@ -229,7 +230,8 @@ u8 iwl_add_station_flags(struct iwl_priv
>
>        /* BCAST station and IBSS stations do not work in HT mode */
>        if (index != priv->hw_params.bcast_sta_id &&
> -           priv->iw_mode != IEEE80211_IF_TYPE_IBSS)
> +           priv->iw_mode != IEEE80211_IF_TYPE_IBSS &&
> +           priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT)
>                iwl_set_ht_add_station(priv, index, ht_info);
>
>        spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
> @@ -575,7 +577,8 @@ int iwl_send_lq_cmd(struct iwl_priv *pri
>        };
>
>        if ((lq->sta_id == 0xFF) &&
> -           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
> +           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
>                return -EINVAL;
>
>        if (lq->sta_id == 0xFF)
> @@ -712,6 +715,7 @@ int iwl_get_sta_id(struct iwl_priv *priv
>        /* If this frame is going out to an IBSS network, find the station,
>         * or create a new station table entry */
>        case IEEE80211_IF_TYPE_IBSS:
> +       case IEEE80211_IF_TYPE_MESH_POINT:
>                sta_id = iwl_find_station(priv, hdr->addr1);
>                if (sta_id != IWL_INVALID_STATION)
>                        return sta_id;
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl-4965-rs.c  2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl-4965-rs.c       2008-05-22 10:44:59.000000000 +0200
> @@ -835,7 +835,8 @@ static void rs_tx_status(void *priv_rate
>        if (!priv->lq_mngr.lq_ready)
>                goto out;
>
> -       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
> +       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
>            !lq_sta->ibss_sta_added)
>                goto out;
>
> @@ -2088,7 +2089,8 @@ static void rs_initialize_lq(struct iwl_
>        i = sta->last_txrate_idx;
>
>        if ((lq_sta->lq.sta_id == 0xff) &&
> -           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
> +           (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
>                goto out;
>
>        valid_tx_ant = priv->hw_params.valid_tx_ant;
> @@ -2158,7 +2160,8 @@ static void rs_get_rate(void *priv_rate,
>        lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv;
>        i = sta->last_txrate_idx;
>
> -       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
> +       if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +            priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
>            !lq_sta->ibss_sta_added) {
>                u8 sta_id = iwl_find_station(priv, hdr->addr1);
>                DECLARE_MAC_BUF(mac);
> --- everything.orig/drivers/net/wireless/iwlwifi/iwl-core.c     2008-05-22 10:42:27.000000000 +0200
> +++ everything/drivers/net/wireless/iwlwifi/iwl-core.c  2008-05-22 10:44:59.000000000 +0200
> @@ -245,7 +245,8 @@ void iwl_reset_qos(struct iwl_priv *priv
>        spin_lock_irqsave(&priv->lock, flags);
>        priv->qos_data.qos_active = 0;
>
> -       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS) {
> +       if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS ||
> +           priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) {
>                if (priv->qos_data.qos_enable)
>                        priv->qos_data.qos_active = 1;
>                if (!(priv->active_rate & 0xfff0)) {
>
>
>

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

* Re: [RFA] iwl4965: support mesh networking
  2008-05-22 11:09 ` Tomas Winkler
@ 2008-05-22 11:11   ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-05-22 11:11 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: linux-wireless, Zhu Yi

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]


> It does beaconing in general (we have working IBSS and AP)  the
> dev_type must be  RXON_DEV_TYPE_IBSS or AP depends I'm just not
> familiar with the MESH stuff.

Yeah, that analysis might have been wrong anyway since my zd1211 was
beaconing all the time and both thought they had a zero-bssid mesh
going. Not sure. If you have a b43 or zd1211 you should be able to test
it, mesh just wants to be able to beacon and send action and wds frames.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* Re: [RFA] iwl4965: support mesh networking
  2008-05-22  9:11 [RFA] iwl4965: support mesh networking Johannes Berg
  2008-05-22 10:23 ` Stefanik Gábor
  2008-05-22 11:09 ` Tomas Winkler
@ 2008-06-09 20:11 ` Richard Scherping
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Scherping @ 2008-06-09 20:11 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Zhu Yi, Tomas Winkler

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

Johannes Berg schrieb:
> This tries to make iwl4965 support mesh, but it doesn't actually work.
> 
> Here's my s-o-b so anyone else can try to make it work, I haven't
> figured out yet what the bug is...
> 
> It seems that the iwlwifi card doesn't beacon, so the mesh state machine
> gets stuck.

I got o11s mesh to work with iwl4965 some time ago including beaconing and forwarding of packets. Changing channel did not work, though.
My patch against the wireless testing tree as of 2008-02-28 is attached, perhaps you find some useful hints in there.

Unfortunately, I did not have the time to rebase my work since then...

Richard

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: wireless-testing-20080228-o11s-iwlwifi.patch --]
[-- Type: text/x-diff; name="wireless-testing-20080228-o11s-iwlwifi.patch", Size: 6956 bytes --]

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 48a6a85..feabc48 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -255,7 +255,7 @@ static int rs_send_lq_cmd(struct iwl4965_priv *priv,
 	};
 
 	if ((lq->sta_id == 0xFF) &&
-	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
+	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS || priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
 		return -EINVAL;
 
 	if (lq->sta_id == 0xFF)
@@ -861,7 +861,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
 	if (!priv->lq_mngr.lq_ready)
 		return;
 
-	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
+	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS || priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
 	    !lq_sta->ibss_sta_added)
 		return;
 
@@ -2168,7 +2168,7 @@ static void rs_initialize_lq(struct iwl4965_priv *priv,
 	i = sta->last_txrate_idx;
 
 	if ((lq_sta->lq.sta_id == 0xff) &&
-	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS))
+	    (priv->iw_mode == IEEE80211_IF_TYPE_IBSS || priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT))
 		goto out;
 
 	if (!lq_sta->search_better_tbl)
@@ -2235,7 +2235,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
 	lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv;
 	i = sta->last_txrate_idx;
 
-	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) &&
+	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS || priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) &&
 	    !lq_sta->ibss_sta_added) {
 		u8 sta_id = iwl4965_hw_find_station(priv, hdr->addr1);
 		DECLARE_MAC_BUF(mac);
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index a9c30bc..bbc91b3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -191,6 +191,7 @@ u8 iwl4965_hw_find_station(struct iwl4965_priv *priv, const u8 *addr)
 	DECLARE_MAC_BUF(mac);
 
 	if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) ||
+	    (priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) ||
 	    (priv->iw_mode == IEEE80211_IF_TYPE_AP))
 		start = IWL_STA_ID;
 
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 20d012d..3633c1b 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -532,7 +532,6 @@ u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr,
 		return index;
 	}
 
-
 	IWL_DEBUG_ASSOC("Add STA ID %d: %s\n", index, print_mac(mac, addr));
 	station = &priv->stations[index];
 	station->used = 1;
@@ -548,7 +547,8 @@ u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr,
 #ifdef CONFIG_IWL4965_HT
 	/* BCAST station and IBSS stations do not work in HT mode */
 	if (index != priv->hw_setting.bcast_sta_id &&
-	    priv->iw_mode != IEEE80211_IF_TYPE_IBSS)
+	    (priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT) &&
+	    (priv->iw_mode != IEEE80211_IF_TYPE_IBSS))
 		iwl4965_set_ht_add_station(priv, index,
 				 (struct ieee80211_ht_info *) ht_data);
 #endif /*CONFIG_IWL4965_HT*/
@@ -1540,6 +1540,7 @@ unsigned int iwl4965_fill_beacon_frame(struct iwl4965_priv *priv,
 
 	if (!iwl4965_is_associated(priv) || !priv->ibss_beacon ||
 	    ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) &&
+	     (priv->iw_mode != IEEE80211_IF_TYPE_MESH_POINT) &&
 	     (priv->iw_mode != IEEE80211_IF_TYPE_AP)))
 		return 0;
 
@@ -2609,6 +2610,7 @@ static void iwl4965_connection_init_rx_config(struct iwl4965_priv *priv)
 		break;
 
 	case IEEE80211_IF_TYPE_IBSS:
+	case IEEE80211_IF_TYPE_MESH_POINT:
 		priv->staging_rxon.dev_type = RXON_DEV_TYPE_IBSS;
 		priv->staging_rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
 		priv->staging_rxon.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
@@ -2850,6 +2852,7 @@ static int iwl4965_get_sta_id(struct iwl4965_priv *priv,
 	/* If this frame is going out to an IBSS network, find the station,
 	 * or create a new station table entry */
 	case IEEE80211_IF_TYPE_IBSS:
+	case IEEE80211_IF_TYPE_MESH_POINT:
 		sta_id = iwl4965_hw_find_station(priv, hdr->addr1);
 		if (sta_id != IWL_INVALID_STATION)
 			return sta_id;
@@ -7170,6 +7177,7 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
 		break;
 
 	case IEEE80211_IF_TYPE_IBSS:
+	case IEEE80211_IF_TYPE_MESH_POINT:
 
 		/* clear out the station table */
 		iwl4965_clear_stations_table(priv);
@@ -7195,7 +7203,7 @@ static void iwl4965_bg_post_associate(struct work_struct *data)
 	priv->start_calib = 1;
 #endif /* CONFIG_IWL4965_SENSITIVITY */
 
-	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS)
+	if (priv->iw_mode == IEEE80211_IF_TYPE_IBSS || priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT)
 		priv->assoc_station_added = 1;
 
 	iwl4965_activate_qos(priv, 0);
@@ -7643,6 +7651,12 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
 		priv->ibss_beacon = conf->beacon;
 	}
 
+	if (priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) {
+		if (priv->ibss_beacon)
+			dev_kfree_skb(priv->ibss_beacon);
+		priv->ibss_beacon = conf->beacon;
+	}
+
 	if (iwl4965_is_rfkill(priv))
 		goto done;
 
@@ -7693,6 +7707,11 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
 	IWL_DEBUG_MAC80211("leave\n");
 	mutex_unlock(&priv->mutex);
 
+	if (priv->iw_mode == IEEE80211_IF_TYPE_MESH_POINT) {
+		iwl4965_reset_qos(priv);
+		queue_work(priv->workqueue, &priv->post_associate.work);
+	}
+
 	return 0;
 }
 
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 5ca576e..3c3f62f 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -83,7 +83,7 @@ endmenu
 
 config MAC80211_MESH
 	bool "Enable mac80211 mesh networking (pre-802.11s) support"
-	depends on MAC80211 && EXPERIMENTAL && BROKEN
+	depends on MAC80211 && EXPERIMENTAL
 	---help---
 	 This options enables support of Draft 802.11s mesh networking.
 	 The implementation is based on Draft 1.08 of the Mesh Networking
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 727af29..e9e6b8d 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -938,6 +938,7 @@ static int __ieee80211_if_config(struct net_device *dev,
 		conf.ssid_len = sdata->u.sta.ssid_len;
 	} else if (ieee80211_vif_is_mesh(&sdata->vif)) {
 		conf.beacon = beacon;
+		conf.beacon_control = control;
 		ieee80211_start_mesh(dev);
 	} else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) {
 		conf.ssid = sdata->u.ap.ssid;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 1ff1301..1aa99e6 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -316,7 +316,8 @@ static void ieee80211_verify_ip_alignment(struct ieee80211_txrx_data *rx)
 	hdrlen = ieee80211_get_hdrlen(rx->fc);
 	if (rx->flags & IEEE80211_TXRXD_RX_AMSDU)
 		hdrlen += ETH_HLEN;
-	WARN_ON_ONCE(((unsigned long)(rx->skb->data + hdrlen)) & 3);
+//	WARN_ON_ONCE(((unsigned long)(rx->skb->data + hdrlen)) & 3);
+// warning disabled, happens in MESH mode
 #endif
 }
 

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

end of thread, other threads:[~2008-06-09 20:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-22  9:11 [RFA] iwl4965: support mesh networking Johannes Berg
2008-05-22 10:23 ` Stefanik Gábor
2008-05-22 11:09 ` Tomas Winkler
2008-05-22 11:11   ` Johannes Berg
2008-06-09 20:11 ` Richard Scherping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).