aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ieee80211.h
diff options
context:
space:
mode:
authorLiad Kaufman <liad.kaufman@intel.com>2014-11-09 11:50:08 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-11-19 12:44:29 -0500
commit1277b4a9f531e84e26f9e0210c1801b0c0bf81ca (patch)
treebabc1273db9300734cecbab2d692bd39db946028 /include/linux/ieee80211.h
parent24d342c514827d52d008736bf02c9f145651ca8e (diff)
mac80211: retransmit TDLS teardown packet through AP if not ACKed
Since the TDLS peer station might not receive the teardown packet (e.g., when in PS), this makes sure the packet is retransmitted - this time through the AP - if the TDLS peer didn't ACK the packet. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/linux/ieee80211.h')
-rw-r--r--include/linux/ieee80211.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index f65b5446d983..4e2bb9107878 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -19,6 +19,7 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22#include <asm/unaligned.h>
22 23
23/* 24/*
24 * DS bit usage 25 * DS bit usage
@@ -2418,6 +2419,30 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2418 return !!(tim->virtual_map[index] & mask); 2419 return !!(tim->virtual_map[index] & mask);
2419} 2420}
2420 2421
2422/**
2423 * ieee80211_get_tdls_action - get tdls packet action (or -1, if not tdls packet)
2424 * @skb: the skb containing the frame, length will not be checked
2425 * @hdr_size: the size of the ieee80211_hdr that starts at skb->data
2426 *
2427 * This function assumes the frame is a data frame, and that the network header
2428 * is in the correct place.
2429 */
2430static inline int ieee80211_get_tdls_action(struct sk_buff *skb, u32 hdr_size)
2431{
2432 if (!skb_is_nonlinear(skb) &&
2433 skb->len > (skb_network_offset(skb) + 2)) {
2434 /* Point to where the indication of TDLS should start */
2435 const u8 *tdls_data = skb_network_header(skb) - 2;
2436
2437 if (get_unaligned_be16(tdls_data) == ETH_P_TDLS &&
2438 tdls_data[2] == WLAN_TDLS_SNAP_RFTYPE &&
2439 tdls_data[3] == WLAN_CATEGORY_TDLS)
2440 return tdls_data[4];
2441 }
2442
2443 return -1;
2444}
2445
2421/* convert time units */ 2446/* convert time units */
2422#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024)) 2447#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
2423#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x)) 2448#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))