3 Add auto parameter to set distance command in order to enable ACK timeout
4 estimation algorithm (dynack). Dynack is automatically disabled setting valid
5 value for coverage class. Currently dynack is supported just by ath9k
7 This patch is based on "configure dynack through mac80211/cfg80211 stack"
8 patchset sent on linux-wireless
10 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
13 nl80211.h | 12 ++++++++++++
14 phy.c | 43 +++++++++++++++++++++++++------------------
15 3 files changed, 39 insertions(+), 18 deletions(-)
19 @@ -551,6 +551,8 @@ broken_combination:
20 printf("\tDevice supports scan flush.\n");
21 if (features & NL80211_FEATURE_AP_SCAN)
22 printf("\tDevice supports AP scan.\n");
23 + if (features & NL80211_FEATURE_ACKTO_ESTIMATION)
24 + printf("\tDevice supports ACK timeout estimation.\n");
27 if (tb_msg[NL80211_ATTR_TDLS_SUPPORT])
30 @@ -362,39 +362,46 @@ static int handle_distance(struct nl8021
31 int argc, char **argv,
35 - unsigned int distance, coverage;
43 - distance = strtoul(argv[0], &end, 10);
44 + if (strcmp("auto", argv[0]) == 0) {
45 + NLA_PUT_FLAG(msg, NL80211_ATTR_WIPHY_DYN_ACK);
48 + unsigned int distance, coverage;
52 + distance = strtoul(argv[0], &end, 10);
55 - * Divide double the distance by the speed of light in m/usec (300) to
56 - * get round-trip time in microseconds and then divide the result by
57 - * three to get coverage class as specified in IEEE 802.11-2007 table
58 - * 7-27. Values are rounded upwards.
60 - coverage = (distance + 449) / 450;
67 + * Divide double the distance by the speed of light
68 + * in m/usec (300) to get round-trip time in microseconds
69 + * and then divide the result by three to get coverage class
70 + * as specified in IEEE 802.11-2007 table 7-27.
71 + * Values are rounded upwards.
73 + coverage = (distance + 449) / 450;
77 - NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage);
78 + NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage);
85 -COMMAND(set, distance, "<distance>",
86 +COMMAND(set, distance, "<auto|distance>",
87 NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_distance,
88 - "Set appropriate coverage class for given link distance in meters.\n"
89 + "Enable ACK timeout estimation algorithm (dynack) or set appropriate\n"
90 + "coverage class for given link distance in meters.\n"
91 + "To disable dynack set valid value for coverage class.\n"
92 "Valid values: 0 - 114750");
94 static int handle_txpower(struct nl80211_state *state,