* [PATCH] mac80211: set carrier_on for ibss vifs only while joined
@ 2011-11-08 13:36 Eliad Peller
2011-11-08 15:27 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Eliad Peller @ 2011-11-08 13:36 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
mac80211 should set carrier_on for ibss vifs
only while they are joined (similar to sta vifs)
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
net/mac80211/ibss.c | 3 +++
net/mac80211/iface.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 2da3040..ecf24ec 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -97,6 +97,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
/* if merging, indicate to driver that we leave the old IBSS */
if (sdata->vif.bss_conf.ibss_joined) {
sdata->vif.bss_conf.ibss_joined = false;
+ netif_carrier_off(sdata->dev);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS);
}
@@ -207,6 +208,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
mgmt, skb->len, 0, GFP_KERNEL);
cfg80211_put_bss(bss);
+ netif_carrier_on(sdata->dev);
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
}
@@ -990,6 +992,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
}
sta_info_flush(sdata->local, sdata);
+ netif_carrier_off(sdata->dev);
/* remove beacon */
kfree(sdata->u.ibss.ie);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index ef741e8..ce372ea 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -282,7 +282,8 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
changed |= ieee80211_reset_erp_info(sdata);
ieee80211_bss_info_change_notify(sdata, changed);
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
+ if (sdata->vif.type == NL80211_IFTYPE_STATION ||
+ sdata->vif.type == NL80211_IFTYPE_ADHOC)
netif_carrier_off(dev);
else
netif_carrier_on(dev);
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mac80211: set carrier_on for ibss vifs only while joined
2011-11-08 13:36 [PATCH] mac80211: set carrier_on for ibss vifs only while joined Eliad Peller
@ 2011-11-08 15:27 ` Johannes Berg
2011-11-08 15:42 ` Eliad Peller
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2011-11-08 15:27 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Tue, 2011-11-08 at 15:36 +0200, Eliad Peller wrote:
> mac80211 should set carrier_on for ibss vifs
> only while they are joined (similar to sta vifs)
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -97,6 +97,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
> /* if merging, indicate to driver that we leave the old IBSS */
> if (sdata->vif.bss_conf.ibss_joined) {
> sdata->vif.bss_conf.ibss_joined = false;
> + netif_carrier_off(sdata->dev);
> ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS);
> }
>
> @@ -207,6 +208,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
> bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
> mgmt, skb->len, 0, GFP_KERNEL);
> cfg80211_put_bss(bss);
> + netif_carrier_on(sdata->dev);
> cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
Do we really need to toggle the carrier here? While we merge, shouldn't
we just keep it up, just maybe stop the queues?
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mac80211: set carrier_on for ibss vifs only while joined
2011-11-08 15:27 ` Johannes Berg
@ 2011-11-08 15:42 ` Eliad Peller
2011-11-08 15:57 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Eliad Peller @ 2011-11-08 15:42 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On Tue, Nov 8, 2011 at 5:27 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Tue, 2011-11-08 at 15:36 +0200, Eliad Peller wrote:
>> mac80211 should set carrier_on for ibss vifs
>> only while they are joined (similar to sta vifs)
>
>> --- a/net/mac80211/ibss.c
>> +++ b/net/mac80211/ibss.c
>> @@ -97,6 +97,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
>> /* if merging, indicate to driver that we leave the old IBSS */
>> if (sdata->vif.bss_conf.ibss_joined) {
>> sdata->vif.bss_conf.ibss_joined = false;
>> + netif_carrier_off(sdata->dev);
>> ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS);
>> }
>>
>> @@ -207,6 +208,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
>> bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
>> mgmt, skb->len, 0, GFP_KERNEL);
>> cfg80211_put_bss(bss);
>> + netif_carrier_on(sdata->dev);
>> cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
>
> Do we really need to toggle the carrier here? While we merge, shouldn't
> we just keep it up, just maybe stop the queues?
>
technically, we leave the ibss and then rejoin (unlike roaming). so i
guess setting the carrier on/off makes sense as well.
do you prefer stopping the queues instead?
Eliad.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mac80211: set carrier_on for ibss vifs only while joined
2011-11-08 15:42 ` Eliad Peller
@ 2011-11-08 15:57 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2011-11-08 15:57 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Tue, 2011-11-08 at 17:42 +0200, Eliad Peller wrote:
> On Tue, Nov 8, 2011 at 5:27 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > On Tue, 2011-11-08 at 15:36 +0200, Eliad Peller wrote:
> >> mac80211 should set carrier_on for ibss vifs
> >> only while they are joined (similar to sta vifs)
> >
> >> --- a/net/mac80211/ibss.c
> >> +++ b/net/mac80211/ibss.c
> >> @@ -97,6 +97,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
> >> /* if merging, indicate to driver that we leave the old IBSS */
> >> if (sdata->vif.bss_conf.ibss_joined) {
> >> sdata->vif.bss_conf.ibss_joined = false;
> >> + netif_carrier_off(sdata->dev);
> >> ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS);
> >> }
> >>
> >> @@ -207,6 +208,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
> >> bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
> >> mgmt, skb->len, 0, GFP_KERNEL);
> >> cfg80211_put_bss(bss);
> >> + netif_carrier_on(sdata->dev);
> >> cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
> >
> > Do we really need to toggle the carrier here? While we merge, shouldn't
> > we just keep it up, just maybe stop the queues?
> >
> technically, we leave the ibss and then rejoin (unlike roaming). so i
> guess setting the carrier on/off makes sense as well.
> do you prefer stopping the queues instead?
No, I don't really know :)
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-08 15:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 13:36 [PATCH] mac80211: set carrier_on for ibss vifs only while joined Eliad Peller
2011-11-08 15:27 ` Johannes Berg
2011-11-08 15:42 ` Eliad Peller
2011-11-08 15:57 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox