Mac80211 callback to driver set_coverage() sets slot time and ACK timeout
for given coverage class. The callback is optional, but it's essential for
long distance links.

Signed-off-by: Lukas Turek <8...@praha12.net>
---
 include/net/mac80211.h |    5 +++++
 net/mac80211/cfg.c     |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 1d75b96..2865bc6 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1477,6 +1477,10 @@ enum ieee80211_ampdu_mlme_action {
  *     need to set wiphy->rfkill_poll to %true before registration,
  *     and need to call wiphy_rfkill_set_hw_state() in the callback.
  *
+ * @set_coverage: Set slot time for given coverage class as specified
+ *     in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
+ *     accordingly. Optional function, could be NULL.
+ *
  * @testmode_cmd: Implement a cfg80211 test mode command.
  */
 struct ieee80211_ops {
@@ -1531,6 +1535,7 @@ struct ieee80211_ops {
                            struct ieee80211_sta *sta, u16 tid, u16 *ssn);
 
        void (*rfkill_poll)(struct ieee80211_hw *hw);
+       void (*set_coverage)(struct ieee80211_hw *hw, u8 coverage_class);
 #ifdef CONFIG_NL80211_TESTMODE
        int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
 #endif
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 93ee1fd..f0ab669 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1236,6 +1236,12 @@ static int ieee80211_set_wiphy_params(struct wiphy 
*wiphy, u32 changed)
        struct ieee80211_local *local = wiphy_priv(wiphy);
        int err;
 
+       if (changed & WIPHY_PARAM_COVERAGE_CLASS) {
+               if (!local->ops->set_coverage)
+                       return -EOPNOTSUPP;
+               local->ops->set_coverage(&local->hw, wiphy->coverage_class);
+       }
+
        if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
                err = drv_set_rts_threshold(local, wiphy->rts_threshold);
 
-- 
1.6.4.4
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to