aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukáš Turek <8an@praha12.net>2009-12-21 16:50:48 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-12 13:50:07 -0500
commit310bc676e314e92c18257bfc916951879451ee32 (patch)
tree12050b5b473b8c9a1bf67450e03d45ade2a4b219
parent81077e82c3f591578625805dd6464a27a9ff56ec (diff)
mac80211: Add new callback set_coverage_class
Mac80211 callback to driver set_coverage_class() sets slot time and ACK timeout for given IEEE 802.11 coverage class. The callback is optional, but it's essential for long distance links. Signed-off-by: Lukas Turek <8an@praha12.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/mac80211.h5
-rw-r--r--net/mac80211/cfg.c7
-rw-r--r--net/mac80211/driver-ops.h15
-rw-r--r--net/mac80211/driver-trace.h23
4 files changed, 50 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f073a2a50574..ad4b70034e77 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1533,6 +1533,10 @@ enum ieee80211_ampdu_mlme_action {
1533 * and need to call wiphy_rfkill_set_hw_state() in the callback. 1533 * and need to call wiphy_rfkill_set_hw_state() in the callback.
1534 * The callback can sleep. 1534 * The callback can sleep.
1535 * 1535 *
1536 * @set_coverage_class: Set slot time for given coverage class as specified
1537 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
1538 * accordingly. This callback is not required and may sleep.
1539 *
1536 * @testmode_cmd: Implement a cfg80211 test mode command. 1540 * @testmode_cmd: Implement a cfg80211 test mode command.
1537 * The callback can sleep. 1541 * The callback can sleep.
1538 * 1542 *
@@ -1592,6 +1596,7 @@ struct ieee80211_ops {
1592 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 1596 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
1593 1597
1594 void (*rfkill_poll)(struct ieee80211_hw *hw); 1598 void (*rfkill_poll)(struct ieee80211_hw *hw);
1599 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
1595#ifdef CONFIG_NL80211_TESTMODE 1600#ifdef CONFIG_NL80211_TESTMODE
1596 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 1601 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
1597#endif 1602#endif
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 2e5e841e9b7b..976014c5e742 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1230,6 +1230,13 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1230 struct ieee80211_local *local = wiphy_priv(wiphy); 1230 struct ieee80211_local *local = wiphy_priv(wiphy);
1231 int err; 1231 int err;
1232 1232
1233 if (changed & WIPHY_PARAM_COVERAGE_CLASS) {
1234 err = drv_set_coverage_class(local, wiphy->coverage_class);
1235
1236 if (err)
1237 return err;
1238 }
1239
1233 if (changed & WIPHY_PARAM_RTS_THRESHOLD) { 1240 if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
1234 err = drv_set_rts_threshold(local, wiphy->rts_threshold); 1241 err = drv_set_rts_threshold(local, wiphy->rts_threshold);
1235 1242
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 8757ea73d544..de91d39e0276 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -214,6 +214,21 @@ static inline int drv_set_rts_threshold(struct ieee80211_local *local,
214 return ret; 214 return ret;
215} 215}
216 216
217static inline int drv_set_coverage_class(struct ieee80211_local *local,
218 u8 value)
219{
220 int ret = 0;
221 might_sleep();
222
223 if (local->ops->set_coverage_class)
224 local->ops->set_coverage_class(&local->hw, value);
225 else
226 ret = -EOPNOTSUPP;
227
228 trace_drv_set_coverage_class(local, value, ret);
229 return ret;
230}
231
217static inline void drv_sta_notify(struct ieee80211_local *local, 232static inline void drv_sta_notify(struct ieee80211_local *local,
218 struct ieee80211_sub_if_data *sdata, 233 struct ieee80211_sub_if_data *sdata,
219 enum sta_notify_cmd cmd, 234 enum sta_notify_cmd cmd,
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 977cc7528bc6..0ea258123b8e 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -491,6 +491,29 @@ TRACE_EVENT(drv_set_rts_threshold,
491 ) 491 )
492); 492);
493 493
494TRACE_EVENT(drv_set_coverage_class,
495 TP_PROTO(struct ieee80211_local *local, u8 value, int ret),
496
497 TP_ARGS(local, value, ret),
498
499 TP_STRUCT__entry(
500 LOCAL_ENTRY
501 __field(u8, value)
502 __field(int, ret)
503 ),
504
505 TP_fast_assign(
506 LOCAL_ASSIGN;
507 __entry->ret = ret;
508 __entry->value = value;
509 ),
510
511 TP_printk(
512 LOCAL_PR_FMT " value:%d ret:%d",
513 LOCAL_PR_ARG, __entry->value, __entry->ret
514 )
515);
516
494TRACE_EVENT(drv_sta_notify, 517TRACE_EVENT(drv_sta_notify,
495 TP_PROTO(struct ieee80211_local *local, 518 TP_PROTO(struct ieee80211_local *local,
496 struct ieee80211_sub_if_data *sdata, 519 struct ieee80211_sub_if_data *sdata,