]> err.no Git - linux-2.6/blobdiff - net/mac80211/util.c
mac80211: add missing "break" statement in mesh code
[linux-2.6] / net / mac80211 / util.c
index 790c32f894c0e784c77195871f9c6d47b218bfe1..b46496fa2e102fb3d6045bb0b8b2dba7aa2b28a3 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "ieee80211_i.h"
 #include "ieee80211_rate.h"
+#include "mesh.h"
 #include "wme.h"
 
 /* privid for wiphys to determine whether they belong to us or not */
@@ -146,6 +147,24 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb)
 }
 EXPORT_SYMBOL(ieee80211_get_hdrlen_from_skb);
 
+int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr)
+{
+       int ae = meshhdr->flags & IEEE80211S_FLAGS_AE;
+       /* 7.1.3.5a.2 */
+       switch (ae) {
+       case 0:
+               return 5;
+       case 1:
+               return 11;
+       case 2:
+               return 17;
+       case 3:
+               return 23;
+       default:
+               return 5;
+       }
+}
+
 void ieee80211_tx_set_iswep(struct ieee80211_txrx_data *tx)
 {
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) tx->skb->data;