mac80211: add helper functions for tracking P2P NoA state
PATCH 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
@@ -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)
On 09/12/13 16:59, Felix Fietkau wrote:
[...]
Quoted 8 lines
+/**
+ * structieee80211_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
+ */
why not providing the kerneldoc for all the fields? Even the more obvious for you may not be so obvious for the next poor reader that has to touch this code :-)
include/net/mac80211.h bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, · line 4648
Quoted 13 lines
include/net/mac80211.h +13
-0+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 ]; +};
Cheers,
Signature · 1 line
Antonio Quartulli
Quoted 11 lines · Antonio Quartulli
On 09/12/13 16:59, Felix Fietkau wrote:
[...]Quoted 8 lines
+/**
+ * structieee80211_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
+ */
Quoted 3 lines
why not providing the kerneldoc for all the fields? Even the more obvious for you may not be so obvious for the next poor reader that has to touch this code :-)
The driver should not care about those, they're private for the mac80211 utility function.
- Felix