Skip to contentSkip to conversation

mac80211: initialize RC data for all mesh links upon allocation

PATCH In review Christian Lamparter 2 participants 2 messages Dec 27, 2008 – Dec 29, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: initialize RC data for all mesh links upon allocation

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

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

net/mac80211/mesh_plink.c +2 -0
index faac101..1c1474d 100644
@@ -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)

---

net/mac80211/mesh_plink.c +1 -0
index faac101..a540ab8 100644
@@ -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;
 }
maintainer
#1 lore raw
Quoted 2 lines · Christian Lamparter

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

Quoted 11 lines

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
Quoted 5 lines

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

Quoted 35 lines

---

net/mac80211/mesh_plink.c +2 -1
index faac101..1c1474d 100644
@@ -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)
---
net/mac80211/mesh_plink.c +1 -0
index faac101..a540ab8 100644
@@ -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;
 }