aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo.bianconi83@gmail.com>2014-09-04 17:57:40 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-09-05 07:54:03 -0400
commit3057dbfdab1b86a77ed6d512fc857b032f78663b (patch)
treeff0cc509ea5665424c337da9ca87ab268613d0de /net
parenteaa336b0f5087addb32217e6a70845ed57249f76 (diff)
cfg80211: enable dynack through nl80211
Enable ACK timeout estimation algorithm (dynack) using mac80211 set_coverage_class API. Dynack is activated passing coverage class equals to -1 to lower drivers and it is automatically disabled setting valid value for coverage class. Define NL80211_ATTR_WIPHY_DYN_ACK flag attribute to enable dynack from userspace. In order to activate dynack NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower drivers to indicate dynack capability. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 459dc2769d0e..cf178d2b621d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -226,6 +226,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
226 [NL80211_ATTR_WIPHY_FRAG_THRESHOLD] = { .type = NLA_U32 }, 226 [NL80211_ATTR_WIPHY_FRAG_THRESHOLD] = { .type = NLA_U32 },
227 [NL80211_ATTR_WIPHY_RTS_THRESHOLD] = { .type = NLA_U32 }, 227 [NL80211_ATTR_WIPHY_RTS_THRESHOLD] = { .type = NLA_U32 },
228 [NL80211_ATTR_WIPHY_COVERAGE_CLASS] = { .type = NLA_U8 }, 228 [NL80211_ATTR_WIPHY_COVERAGE_CLASS] = { .type = NLA_U8 },
229 [NL80211_ATTR_WIPHY_DYN_ACK] = { .type = NLA_FLAG },
229 230
230 [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 }, 231 [NL80211_ATTR_IFTYPE] = { .type = NLA_U32 },
231 [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, 232 [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 },
@@ -2239,11 +2240,21 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
2239 } 2240 }
2240 2241
2241 if (info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]) { 2242 if (info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]) {
2243 if (info->attrs[NL80211_ATTR_WIPHY_DYN_ACK])
2244 return -EINVAL;
2245
2242 coverage_class = nla_get_u8( 2246 coverage_class = nla_get_u8(
2243 info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]); 2247 info->attrs[NL80211_ATTR_WIPHY_COVERAGE_CLASS]);
2244 changed |= WIPHY_PARAM_COVERAGE_CLASS; 2248 changed |= WIPHY_PARAM_COVERAGE_CLASS;
2245 } 2249 }
2246 2250
2251 if (info->attrs[NL80211_ATTR_WIPHY_DYN_ACK]) {
2252 if (!(rdev->wiphy.features & NL80211_FEATURE_ACKTO_ESTIMATION))
2253 return -EOPNOTSUPP;
2254
2255 changed |= WIPHY_PARAM_DYN_ACK;
2256 }
2257
2247 if (changed) { 2258 if (changed) {
2248 u8 old_retry_short, old_retry_long; 2259 u8 old_retry_short, old_retry_long;
2249 u32 old_frag_threshold, old_rts_threshold; 2260 u32 old_frag_threshold, old_rts_threshold;