mac80211: Fix initial hardware configuration
PATCH 1/1 mac80211: Fix initial hardware configuration
On the initial device-open we need to defer the hardware reconfiguration after we incremented the open_count, because the hw_config checks this flag and won't call the lowlevel driver in case it is zero.
Signed-off-by Michael Buesch <[email protected]>
---
John, this should also go to -stable once you applied it to the tree. Do you take care of this?
net/mac80211/ieee80211.c +4 -1
@@ -172,12 +172,13 @@ static inline int identical_mac_addr_allstatic int ieee80211_open (struct net_device *dev) {struct ieee80211_sub_if_data *sdata, *nsdata;struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr);struct ieee80211_if_init_conf conf;int res; +bool need_hw_reconfig =0 ; sdata =IEEE80211_DEV_TO_SUB_IF (dev);/* we hold the RTNL here so can safely walk the list */ list_for_each_entry (nsdata, &local->interfaces, list) {struct net_device *ndev = nsdata->dev;
@@ -225,13 +226,13 @@ static int ieee80211_open(struct net_devif (local->open_count ==0 ) { res =0 ;if (local->ops->start) res = local->ops->start (local_to_hw (local));if (res)return res; -ieee80211_hw_config (local); + need_hw_reconfig =1 ;ieee80211_led_radio (local, local->hw.conf.radio_enabled); }switch (sdata->vif.type) {case IEEE80211_IF_TYPE_VLAN :list_add (&sdata->u.vlan.list, &sdata->u.vlan.ap->u.ap.vlans);
@@ -302,12 +303,14 @@ static int ieee80211_open(struct net_devatomic_inc (&local->iff_allmultis);if (sdata->flags &IEEE80211_SDATA_PROMISC )atomic_inc (&local->iff_promiscs); local->open_count++; +if (need_hw_reconfig) +ieee80211_hw_config (local);netif_start_queue (dev);return 0 ; }
Quoted 3 lines · Michael Buesch
On the initial device-open we need to defer the hardware reconfiguration after we incremented the
open_count, because thehw_configchecks this flag and won't call the lowlevel driver in case it is zero.
Good catch.
Quoted 1 line
Signed-off-by Michael Buesch <[email protected]>
Acked-by Johannes Berg <[email protected]>
johannes