Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66759
b: refs/heads/master
c: f97df02
h: refs/heads/master
i:
  66757: c5005f3
  66755: a9d784c
  66751: f4e184b
v: v3
  • Loading branch information
Johannes Berg authored and David S. Miller committed Oct 10, 2007
1 parent a6212ce commit 8c2223d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 61 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75a5f0ccfdbc0151ee40bb742f7b5c8eba493c0e
refs/heads/master: f97df02e23269c7650869f6192e809f8ac1a4b39
61 changes: 61 additions & 0 deletions trunk/include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define IEEE80211_H

#include <linux/types.h>
#include <asm/byteorder.h>

#define FCS_LEN 4

Expand Down Expand Up @@ -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 */
60 changes: 0 additions & 60 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 8c2223d

Please sign in to comment.