Search Linux Wireless

Re: [PATCH 2/2] mac80211: sync dtim_count to TSF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/12/19 Thomas Pedersen <twpedersen@xxxxxxxxx>:
> On starting a mesh, ad-hoc, or AP BSS, the interface
> dtim_count countdown should match that of the driver TSF.
>
...
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index ac18528..8211d30 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -951,6 +951,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
>                               struct cfg80211_ap_settings *params)
>  {
>         struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> +       struct ieee80211_local *local = sdata->local;
>         struct beacon_data *old;
>         struct ieee80211_sub_if_data *vlan;
>         u32 changed = BSS_CHANGED_BEACON_INT |
> @@ -1030,6 +1031,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
>                 return err;
>         }
>
> +       ieee80211_recalc_dtim(local, sdata);
>         ieee80211_bss_info_change_notify(sdata, changed);
>
>         netif_carrier_on(dev);
> diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
> index 04b5a14..89160f7 100644
> --- a/net/mac80211/debugfs_netdev.c
> +++ b/net/mac80211/debugfs_netdev.c
> @@ -468,6 +468,7 @@ static ssize_t ieee80211_if_parse_tsf(
>                 }
>         }
>
> +       ieee80211_recalc_dtim(local, sdata);
>         return buflen;
>  }
>  __IEEE80211_IF_FILE_W(tsf);
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index d6ba8414..a92c8a9 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -369,6 +369,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
>                 return;
>         }
>
> +       ieee80211_recalc_dtim(local, sdata);
>         ieee80211_bss_info_change_notify(sdata, bss_change);
>
>         ifibss->state = IEEE80211_IBSS_MLME_JOINED;
...
> diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
> index 5a74b24..5b919ca 100644
> --- a/net/mac80211/mesh.c
> +++ b/net/mac80211/mesh.c
> @@ -807,6 +807,7 @@ int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
>                 return -ENOMEM;
>         }
>
> +       ieee80211_recalc_dtim(local, sdata);
>         ieee80211_bss_info_change_notify(sdata, changed);
>
>         netif_carrier_on(sdata->dev);
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index 656648b..599cf37 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -2588,3 +2588,31 @@ int ieee80211_cs_headroom(struct ieee80211_local *local,
>
>         return headroom;
>  }
> +
> +void ieee80211_recalc_dtim(struct ieee80211_local *local,
> +                          struct ieee80211_sub_if_data *sdata)
> +{
...
> +       sdata->u.mesh.ps.dtim_count = dtim_count;
> +}

Apologize for my intrusiveness, but could this write operation lead to
unpredictable results for non-mesh interfaces?

-- 
BR,
Sergey
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux