Search Linux Wireless

Re: [PATCHv3 RESEND 10/11] mac80211: Add API to report nan function match

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

 



On Tue, 2016-03-29 at 12:35 +0300, Emmanuel Grumbach wrote:
> 
> +void ieee80211_nan_func_match(struct ieee80211_vif *vif,
> +			      struct cfg80211_nan_match_params
> *match,
> +			      gfp_t gfp)
> +{
> +	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> +	struct ieee80211_nan_func *func;
> +	struct wireless_dev *wdev;
> +
> +	if (WARN_ON(vif->type != NL80211_IFTYPE_NAN))
> +		return;
> +
> +	spin_lock_bh(&sdata->u.nan.func_lock);
> +
> +	func = ieee80211_find_nan_func(sdata, match->inst_id);
> +	if (WARN_ON(!func)) {
> +		spin_unlock_bh(&sdata->u.nan.func_lock);
> +		return;
> +	}
> +	match->cookie = func->func.cookie;
> 
Ok maybe this requires a spinlock - due to how drivers want to call it
- but could also use RCU? Particularly with IDR that shouldn't be
difficult.

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