vsprintf: move local vars to block local vars and remove unneeded ones
[safe/jmp/linux-2.6] / net / mac80211 / mesh_plink.c
index 8a54bc8..0f7c6e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 open80211s Ltd.
+ * Copyright (c) 2008, 2009 open80211s Ltd.
  * Author:     Luis Carlos Cobo <luisca@cozybit.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -181,7 +181,8 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
                if (action == PLINK_CONFIRM) {
                        pos = skb_put(skb, 4);
                        /* two-byte status code followed by two-byte AID */
-                       memset(pos, 0, 4);
+                       memset(pos, 0, 2);
+                       memcpy(pos + 2, &plid, 2);
                }
                mesh_mgmt_ies_add(skb, sdata);
        }
@@ -221,7 +222,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
                memcpy(pos, &reason, 2);
        }
 
-       ieee80211_tx_skb(sdata, skb, 1);
+       ieee80211_tx_skb(sdata, skb);
        return 0;
 }
 
@@ -398,6 +399,17 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
        u8 ie_len;
        u8 *baseaddr;
        __le16 plid, llid, reason;
+#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
+       static const char *mplstates[] = {
+               [PLINK_LISTEN] = "LISTEN",
+               [PLINK_OPN_SNT] = "OPN-SNT",
+               [PLINK_OPN_RCVD] = "OPN-RCVD",
+               [PLINK_CNF_RCVD] = "CNF_RCVD",
+               [PLINK_ESTAB] = "ESTAB",
+               [PLINK_HOLDING] = "HOLDING",
+               [PLINK_BLOCKED] = "BLOCKED"
+       };
+#endif
 
        /* need action_code, aux */
        if (len < IEEE80211_MIN_ACTION_SIZE + 3)
@@ -536,8 +548,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
                }
        }
 
-       mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %d %d %d %d\n",
-               mgmt->sa, sta->plink_state,
+       mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %s %d %d %d\n",
+               mgmt->sa, mplstates[sta->plink_state],
                le16_to_cpu(sta->llid), le16_to_cpu(sta->plid),
                event);
        reason = 0;