mac80211: hold sta->lock across plink fsm switch()

Rather than unlock at the end of each case, do it once after
all is said and done.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: remove unused mesh_mgmt_ies_add() prototype

Said function was removed some time ago.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
mac80211: factor peering frame processing into own function

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: remove mysterious peering ie_len check

According to IEEE802.11-2012 (8.4.2.104), no peering
management element exists with length 7. This code seems
to have been part of the original implementation, but it's
purpose is now unknown, so remove it.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: factor out plink event gathering

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: consolidate rcu unlocks in plink frame rx

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: assign sta plid early

If we store the peer link ID right after initializing a
new neighbor, there is no need to do it later in the
peering FSM.

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

If the peer doesn't have an llid for us, the event
gathering function won't use it anyway (based on
frametype), but initialize it so gcc and coverity don't
complain.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: factor out peering FSM

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: consolidate calls to plink_frame_tx

sta->reason is always accurate, since it is really only
the close reason. Once the holding timer expires this
resets to 0.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: avoid txing peering close frame twice

Since peering frame transmission has been consolidated in
peering FSM, factor out the non-TX part of plink_close()
and just call that.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
mac80211: peering fsm formatting

Clean up whitespace.

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