Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7ba7b46 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'mac80211-for-davem-2015-05-04' of...

Merge tag 'mac80211-for-davem-2015-05-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211



Johannes Berg says:

====================
We have only a few fixes right now:
 * a fix for an issue with hash collision handling in the
   rhashtable conversion
 * a merge issue - rhashtable removed default shrinking
   just before mac80211 was converted, so enable it now
 * remove an invalid WARN that can trigger with legitimate
   userspace behaviour
 * add a struct member missing from kernel-doc that caused
   a lot of warnings
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0650c0b8 ff419b3f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1666,6 +1666,8 @@ struct ieee80211_tx_control {
 * @sta: station table entry, %NULL for per-vif queue
 * @tid: the TID for this queue (unused for per-vif queue)
 * @ac: the AC for this queue
 * @drv_priv: data area for driver use, will always be aligned to
 *	sizeof(void *).
 *
 * The driver can obtain packets from this queue by calling
 * ieee80211_tx_dequeue().
+7 −5
Original line number Diff line number Diff line
@@ -819,13 +819,15 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
	 * (because if we remove a STA after ops->remove_interface()
	 * the driver will have removed the vif info already!)
	 *
	 * This is relevant only in WDS mode, in all other modes we've
	 * already removed all stations when disconnecting or similar,
	 * so warn otherwise.
	 * In WDS mode a station must exist here and be flushed, for
	 * AP_VLANs stations may exist since there's nothing else that
	 * would have removed them, but in other modes there shouldn't
	 * be any stations.
	 */
	flushed = sta_info_flush(sdata);
	WARN_ON_ONCE((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) ||
		     (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1));
	WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
		     ((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) ||
		      (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1)));

	/* don't count this interface for promisc/allmulti while it is down */
	if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
+18 −1
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@

static const struct rhashtable_params sta_rht_params = {
	.nelem_hint = 3, /* start small */
	.automatic_shrinking = true,
	.head_offset = offsetof(struct sta_info, hash_node),
	.key_offset = offsetof(struct sta_info, sta.addr),
	.key_len = ETH_ALEN,
@@ -157,8 +158,24 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
			      const u8 *addr)
{
	struct ieee80211_local *local = sdata->local;
	struct sta_info *sta;
	struct rhash_head *tmp;
	const struct bucket_table *tbl;

	rcu_read_lock();
	tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash);

	return rhashtable_lookup_fast(&local->sta_hash, addr, sta_rht_params);
	for_each_sta_info(local, tbl, addr, sta, tmp) {
		if (sta->sdata == sdata) {
			rcu_read_unlock();
			/* this is safe as the caller must already hold
			 * another rcu read section or the mutex
			 */
			return sta;
		}
	}
	rcu_read_unlock();
	return NULL;
}

/*