Skip to contentSkip to conversation

mac80211: add helper functions for tracking P2P NoA state

RFC New Felix Fietkau 1 participant 1 message Dec 8, 2013 mac80211

lore
Share & tools
lore
#0 lore raw

RFC 1/1 mac80211: add helper functions for tracking P2P NoA state

---
 include/net/mac80211.h |  40 +++++++++++++++
 net/mac80211/util.c    | 135 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 175 insertions(+)
include/net/mac80211.h +40 -0
index 3cd408b..ae17543 100644
@@ -4625,4 +4625,44 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
 			      struct ieee80211_vif *vif, struct sk_buff *skb,
 			      int band, struct ieee80211_sta **sta);
 
+/**
+ * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state
+ *
+ * @next_tsf: TSF timestamp of the next absent state change
+ * @has_next_tsf: next absent state change event pending
+ *
+ * @absent: descriptor bitmask, set if GO is currently absent
+ */
+struct ieee80211_noa_data {
+	u32 next_tsf;
+	bool has_next_tsf;
+
+	u8 absent;
+
+	u8 count[IEEE80211_P2P_NOA_DESC_MAX];
+	struct {
+		u32 start;
+		u32 duration;
+		u32 interval;
+	} desc[IEEE80211_P2P_NOA_DESC_MAX];
+};
+
+/**
+ * ieee80211_parse_p2p_noa - initialize NoA tracking data from P2P IE
+ *
+ * @attr: P2P NoA IE
+ * @data: NoA tracking data
+ * @tsf: current TSF timestamp
+ */
+int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr,
+			    struct ieee80211_noa_data *data, u32 tsf);
+
+/**
+ * ieee80211_update_p2p_noa - get next pending P2P GO absent state change
+ *
+ * @data: NoA tracking data
+ * @tsf: current TSF timestamp
+ */
+void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
+
 #endif /* MAC80211_H */
net/mac80211/util.c +135 -0

138 lines not on this page · raw message

Signature · 1 line
1.8.3.4 (Apple Git-47)