Search Linux Wireless

Re: [PATCH 1/3] mac80211: implement ieee80211_get_vif_by_addr

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

 



On Sun, 2013-11-24 at 17:56 +0100, Lorenzo Bianconi wrote:
> ieee80211_get_vif_by_addr allows low level drivers to get a reference to
> vif data structure which is not added to the driver as monitor interface.
> ieee80211_get_vif_by_addr will be used in ath9k tx99 code

Is that really better than having the driver use the iteration
functions?

> + */
> +struct ieee80211_vif *ieee80211_get_vif_by_addr(struct ieee80211_hw *hw,
> +						const u8 *mac)
> +{
> +	struct ieee80211_vif *vif = NULL;
> +	struct ieee80211_local *local = hw_to_local(hw);
> +	struct ieee80211_sub_if_data *sdata;
> +
> +	rcu_read_lock();
> +	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
> +		if (!compare_ether_addr(sdata->vif.addr, mac)) {
> +			vif = &sdata->vif;
> +			break;
> +		}
> +	}
> +	rcu_read_unlock();
> +
> +	return vif;

In any case, this is completely broken wrt. locking, so I'm not taking
it.

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