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>
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: 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>
mac80211: mesh: forward received packets to other interfaces

Currently stubbed out the TX side but we may need it for locally
generated mcast packets (in which case RX probably isn't needed).
With this, at least ARP packets make it to the other channel and
are received at the destination, but destination doesn't try to
establish a path and reply.

Signed-off-by: Bob Copeland <me@bobcopeland.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>

Conflicts:
	net/mac80211/tx.c
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: stop device queues on leaving mesh

Do this before MBSS removal, so we don't race with
mesh_local_bss_forward().

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 matches_local_if

Clarify the API a bit by handing matches_local_if() the
MBSS to match against an address.

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>
mac80211: extract matches_local_if() and refactor into two functions

I would like to use this outside of mesh_hwmp, and in some cases
find the interface given the dest address.

Signed-off-by: Bob Copeland <me@bobcopeland.com>

Conflicts:
	net/mac80211/mesh_hwmp.c
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: drop mcast frames from us

Typically this is done already in wireless/util.c, but since we
may pass a different address to ieee80211_data_to_8023, the
check for self-generated frames may get missed.  For now just
drop them before sending them.

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>