Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f97df02e23269c7650869f6192e809f8ac1a4b39
Commit:     f97df02e23269c7650869f6192e809f8ac1a4b39
Parent:     75a5f0ccfdbc0151ee40bb742f7b5c8eba493c0e
Author:     Johannes Berg <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 17:29:20 2007 -0400
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:52:59 2007 -0700

    [PATCH] wireless networking: move frame inline functions to generic header
    
    These inlines are generally useful, not just with mac80211.
    
    Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
    Signed-off-by: Michael Wu <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 include/linux/ieee80211.h |   61 +++++++++++++++++++++++++++++++++++++++++++++
 include/net/mac80211.h    |   60 --------------------------------------------
 2 files changed, 61 insertions(+), 60 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 272f8c8..30621c2 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -16,6 +16,7 @@
 #define IEEE80211_H
 
 #include <linux/types.h>
+#include <asm/byteorder.h>
 
 #define FCS_LEN 4
 
@@ -350,4 +351,64 @@ enum ieee80211_eid {
 
 #define WLAN_MAX_KEY_LEN               32
 
+/**
+ * ieee80211_get_SA - get pointer to SA
+ *
+ * Given an 802.11 frame, this function returns the offset
+ * to the source address (SA). It does not verify that the
+ * header is long enough to contain the address, and the
+ * header must be long enough to contain the frame control
+ * field.
+ *
+ * @hdr: the frame
+ */
+static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
+{
+       u8 *raw = (u8 *) hdr;
+       u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */
+
+       switch (tofrom) {
+               case 2:
+                       return hdr->addr3;
+               case 3:
+                       return hdr->addr4;
+       }
+       return hdr->addr2;
+}
+
+/**
+ * ieee80211_get_DA - get pointer to DA
+ *
+ * Given an 802.11 frame, this function returns the offset
+ * to the destination address (DA). It does not verify that
+ * the header is long enough to contain the address, and the
+ * header must be long enough to contain the frame control
+ * field.
+ *
+ * @hdr: the frame
+ */
+static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
+{
+       u8 *raw = (u8 *) hdr;
+       u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */
+
+       if (to_ds)
+               return hdr->addr3;
+       return hdr->addr1;
+}
+
+/**
+ * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
+ *
+ * This function determines whether the "more fragments" bit is set
+ * in the frame.
+ *
+ * @hdr: the frame
+ */
+static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
+{
+       return (le16_to_cpu(hdr->frame_control) &
+               IEEE80211_FCTL_MOREFRAGS) != 0;
+}
+
 #endif /* IEEE80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d2cf734..fcca9c3 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1399,64 +1399,4 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
  */
 void ieee80211_scan_completed(struct ieee80211_hw *hw);
 
-/**
- * ieee80211_get_SA - get pointer to SA
- *
- * Given an 802.11 frame, this function returns the offset
- * to the source address (SA). It does not verify that the
- * header is long enough to contain the address, and the
- * header must be long enough to contain the frame control
- * field.
- *
- * @hdr: the frame
- */
-static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
-{
-       u8 *raw = (u8 *) hdr;
-       u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */
-
-       switch (tofrom) {
-               case 2:
-                       return hdr->addr3;
-               case 3:
-                       return hdr->addr4;
-       }
-       return hdr->addr2;
-}
-
-/**
- * ieee80211_get_DA - get pointer to DA
- *
- * Given an 802.11 frame, this function returns the offset
- * to the destination address (DA). It does not verify that
- * the header is long enough to contain the address, and the
- * header must be long enough to contain the frame control
- * field.
- *
- * @hdr: the frame
- */
-static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
-{
-       u8 *raw = (u8 *) hdr;
-       u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */
-
-       if (to_ds)
-               return hdr->addr3;
-       return hdr->addr1;
-}
-
-/**
- * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
- *
- * This function determines whether the "more fragments" bit is set
- * in the frame.
- *
- * @hdr: the frame
- */
-static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
-{
-       return (le16_to_cpu(hdr->frame_control) &
-               IEEE80211_FCTL_MOREFRAGS) != 0;
-}
-
 #endif /* MAC80211_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to