linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: initialize RC data for all mesh links upon allocation
@ 2008-12-27 21:19 Christian Lamparter
  2008-12-29 11:14 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Lamparter @ 2008-12-27 21:19 UTC (permalink / raw)
  To: wireless; +Cc: Johannes Berg, andrey, John W Linville

This patch fixes a panic that might occur, if the device is part of a mesh
and tries to send with a higher rate index than "0".

kernel BUG at net/mac80211/rate.c:239! 
invalid opcode: 0000 [#1] SMP 
[...]
 Call Trace:
 <IRQ> <0> ? invoke_tx_handlers+0x474/0xb57 [mac80211]
 ? __ieee80211_tx_prepare+0x260/0x2a8 [mac80211]
 ? ieee80211_master_start_xmit+0x300/0x43a [mac80211]
 ? __qdisc_run+0xde/0x1da
 ? net_tx_action+0xb4/0x102
 Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Christian Lamparter <chunkeey@web.de>
---
I'm not sure if we need a rate_control_rate_init in mesh_neighbour_update as well.
So, there's one patch[1] with and another one[2] without rate_control_rate_init in
mesh_neighbour_update...
---
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index faac101..1c1474d 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -107,6 +107,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
 
 	sta->flags = WLAN_STA_AUTHORIZED;
 	sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
+	rate_control_rate_init(sta);
 
 	return sta;
 }
@@ -244,6 +245,7 @@ void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct ieee80211_sub_if_data
 
 	sta->last_rx = jiffies;
 	sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
+	rate_control_rate_init(sta);
 	if (peer_accepting_plinks && sta->plink_state == PLINK_LISTEN &&
 			sdata->u.mesh.accepting_plinks &&
 			sdata->u.mesh.mshcfg.auto_open_plinks)
---
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index faac101..a540ab8 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -107,6 +107,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
 
 	sta->flags = WLAN_STA_AUTHORIZED;
 	sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
+	rate_control_rate_init(sta);
 
 	return sta;
 }

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

* Re: [PATCH] mac80211: initialize RC data for all mesh links upon allocation
  2008-12-27 21:19 [PATCH] mac80211: initialize RC data for all mesh links upon allocation Christian Lamparter
@ 2008-12-29 11:14 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-12-29 11:14 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: wireless, andrey, John W Linville

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

On Sat, 2008-12-27 at 22:19 +0100, Christian Lamparter wrote:
> This patch fixes a panic that might occur, if the device is part of a mesh
> and tries to send with a higher rate index than "0".

I think we really should try to move this into sta_info_alloc() at some
point ...

> kernel BUG at net/mac80211/rate.c:239! 
> invalid opcode: 0000 [#1] SMP 
> [...]
>  Call Trace:
>  <IRQ> <0> ? invoke_tx_handlers+0x474/0xb57 [mac80211]
>  ? __ieee80211_tx_prepare+0x260/0x2a8 [mac80211]
>  ? ieee80211_master_start_xmit+0x300/0x43a [mac80211]
>  ? __qdisc_run+0xde/0x1da
>  ? net_tx_action+0xb4/0x102
>  Kernel panic - not syncing: Fatal exception in interrupt
> 
> Signed-off-by: Christian Lamparter <chunkeey@web.de>
> ---
> I'm not sure if we need a rate_control_rate_init in mesh_neighbour_update as well.
> So, there's one patch[1] with and another one[2] without rate_control_rate_init in
> mesh_neighbour_update...

Hard to tell.

> ---
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index faac101..1c1474d 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -107,6 +107,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
>  
>  	sta->flags = WLAN_STA_AUTHORIZED;
>  	sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
> +	rate_control_rate_init(sta);
>  
>  	return sta;
>  }
> @@ -244,6 +245,7 @@ void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct ieee80211_sub_if_data
>  
>  	sta->last_rx = jiffies;
>  	sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
> +	rate_control_rate_init(sta);
>  	if (peer_accepting_plinks && sta->plink_state == PLINK_LISTEN &&
>  			sdata->u.mesh.accepting_plinks &&
>  			sdata->u.mesh.mshcfg.auto_open_plinks)
> ---
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index faac101..a540ab8 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -107,6 +107,7 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
>  
>  	sta->flags = WLAN_STA_AUTHORIZED;
>  	sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
> +	rate_control_rate_init(sta);
>  
>  	return sta;
>  }
> 

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

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

end of thread, other threads:[~2008-12-29 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-27 21:19 [PATCH] mac80211: initialize RC data for all mesh links upon allocation Christian Lamparter
2008-12-29 11:14 ` Johannes Berg

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).