mac80211: ieee80211_queue_stopped returns reasons

Have ieee80211_queue_stopped() return a bitmap of enum
queue_stop_reasons while checking queue status. This is
handy when we care about the queue stop reason codes.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: limit mesh forwarding drops

In case of the HW asking mac80211 to back off, the queues
would be stopped with reason DRIVER.

Limit dropping forwarded mesh data frames by putting them
on the pending queue anyway if the outgoing HW queues
appear to be only momentarily stopped.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: track and share mesh BSSes among interfaces

Add a new global list of mesh BSSes for this host.  Each struct
mesh_local_bss contains parameters specific to a mesh instance,
as well as a list of interfaces participating in the MBSS.  This
will enable lookup of other interfaces on the host participating
in the same mesh.

Signed-off-by: Bob Copeland <bob@cozybit.com>
mac80211: mesh: add function to tx on all other mbss ifaces

Add a function to rebroadcast mcast/bcast frames on other
interfaces when multiple interfaces are shared in an mbss.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
nl80211: specify per-vif or shared MBSS

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: shared MBSS

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: iterate over all the shared interfaces in a bunch of places

This gets ARP reply generation happening, but the replies don't
cross the bridge.  Will revisit this sledgehammer approach once
things are working generally.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: mesh: use right outgoing interface

A forwarded frame may have a destination STA which resides
on a vif other than the RX interface. Have
mesh_nexthop_lookup() fill in the right outgoing sdata in
the skb control block.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: send unicast HWMP frame on right interface

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: fix mesh forwarding congestion detection

Now the outgoing interface may be different from the
incoming one in the forwarding path, don't check for
stopped queues until the outgoing interface has been
resolved.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
nl80211: MBSS sharing defaults to on

If the user joins two MBSSes with matching mesh IDs on the
same host, they would probably expect automatic
forwarding.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: assign outgoing interface with nexthop

When updated mpath routing info is found, the new route
may be on a different interface (in the case of MBSS
sharing).

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: hwmp: clear up mesh_path_lookup() API

mesh_path_lookup() would take an sdata, but really search
the sdata list attached to the MBSS, so pass the MBSS
instead to make it clear the resulting mpath is tied to an
unknown interface.

This patch should have no functional changes.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>

Conflicts:
	net/mac80211/cfg.c
	net/mac80211/mesh_hwmp.c
	net/mac80211/mesh_pathtbl.c
mac80211: forward mesh path error frames across MBSS

Some mesh path error frames might have a broadcast
destination, so transmit these out of any other local
interfaces which might be part of the same MBSS.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: forward local unicast on correct interface

When we resolve the next hop, the outgoing interface
might be different than the originator if the best
path is on a different channel.  Requeue such frames
for later on the correct interface's pending queue.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac08211: mesh: receive processing for mbss sharing

If a destination interface is participating in a shared mbss, then
we want to receive data frames on the correct interface (or all
for mcast) when passing frames to upper layers.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: notify bridge when leaving mesh

After turning carrier off, any parent bridge interface
needs to be notified. Otherwise we would see a panic when
attempting to transmit frames on a mesh interface which
hadn't yet been put down.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: hash mpath according to MBSS

Since the mpath->sdata might change over the lifetime of
an mpath, generate a hash bucket index from something
which doesn't: the mesh ID.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>

Conflicts:
	net/mac80211/mesh_pathtbl.c
{nl,mac}80211: allow mpath dump to span local MBSS

Allow the user to specify a flag
NL80211_ATTR_MPATH_DUMP_MBSS along with an mpath dump
request to dump all paths in the interface's mbss.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>

Conflicts:
	include/uapi/linux/nl80211.h
	net/mac80211/mesh_pathtbl.c
mac80211: make RMC per-mbss

The RMC was previously per-sdata, but it is sufficient for
one of the interfaces in a local mbss to receive a
multicast frame once.

Now that multiple interfaces can share the same mesh data
forwarding duties we may inadvertently create a multicast
routing loop and have a corner case where a multicast
frame is retransmitted a few times too many.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>