2014-09-07 17:32:25

by Lorenzo Bianconi

[permalink] [raw]
Subject: [PATCHv3 0/2] add auto parameter to set distance command

Add auto parameter to set distance command in order to enable ACK timeout
estimation algorithm (dynack). Currently dynack is supported just by ath9k

This patch is based on "configure dynack through mac80211/cfg80211 stack"
patchset sent on linux-wireless

Changes since v2:
- define NL80211_FEATURE_ACKTO_ESTIMATION to report driver dynack capability
- rebase on top of mac80211-next tree

Changes since v1:
- add dynack info to info command

Lorenzo Bianconi (2):
iw: update nl80211.h
iw: add auto parameter to set distance command

info.c | 2 ++
nl80211.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
phy.c | 43 +++++++++++++++++++++++++------------------
3 files changed, 71 insertions(+), 18 deletions(-)

--
1.9.1



2014-09-07 17:32:27

by Lorenzo Bianconi

[permalink] [raw]
Subject: [PATCHv3 2/2] iw: add auto parameter to set distance command

Add auto parameter to set distance command in order to enable ACK timeout
estimation algorithm (dynack). Dynack is automatically disabled setting valid
value for coverage class. Currently dynack is supported just by ath9k

This patch is based on "configure dynack through mac80211/cfg80211 stack"
patchset sent on linux-wireless

Signed-off-by: Lorenzo Bianconi <[email protected]>
---
info.c | 2 ++
nl80211.h | 12 ++++++++++++
phy.c | 43 +++++++++++++++++++++++++------------------
3 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/info.c b/info.c
index 97ff39d..b72801b 100644
--- a/info.c
+++ b/info.c
@@ -551,6 +551,8 @@ broken_combination:
printf("\tDevice supports scan flush.\n");
if (features & NL80211_FEATURE_AP_SCAN)
printf("\tDevice supports AP scan.\n");
+ if (features & NL80211_FEATURE_ACKTO_ESTIMATION)
+ printf("\tDevice supports ACK timeout estimation.\n");
}

if (tb_msg[NL80211_ATTR_TDLS_SUPPORT])
diff --git a/nl80211.h b/nl80211.h
index 8951c31..bad7a22 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -1605,6 +1605,12 @@ enum nl80211_commands {
* association request. In addition, it must also set the RRM capability
* flag in the association request's Capability Info field.
*
+ * @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout
+ * estimation algorithm (dynack). In order to activate dynack
+ * %NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower
+ * drivers to indicate dynack capability. Dynack is automatically disabled
+ * setting valid value for coverage class.
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1949,6 +1955,8 @@ enum nl80211_attrs {

NL80211_ATTR_USE_RRM,

+ NL80211_ATTR_WIPHY_DYN_ACK,
+
/* add attributes here, update the policy in nl80211.c */

__NL80211_ATTR_AFTER_LAST,
@@ -3979,6 +3987,9 @@ enum nl80211_ap_sme_features {
* current tx power value into the TPC Report IE in the spectrum
* management TPC Report action frame, and in the Radio Measurement Link
* Measurement Report action frame.
+ * @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout
+ * estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used
+ * to enable dynack.
*/
enum nl80211_feature_flags {
NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -4004,6 +4015,7 @@ enum nl80211_feature_flags {
NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20,
NL80211_FEATURE_QUIET = 1 << 21,
NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22,
+ NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23,
};

/**
diff --git a/phy.c b/phy.c
index 517d203..aab462d 100644
--- a/phy.c
+++ b/phy.c
@@ -362,39 +362,46 @@ static int handle_distance(struct nl80211_state *state,
int argc, char **argv,
enum id_input id)
{
- char *end;
- unsigned int distance, coverage;
-
if (argc != 1)
return 1;

if (!*argv[0])
return 1;

- distance = strtoul(argv[0], &end, 10);
+ if (strcmp("auto", argv[0]) == 0) {
+ NLA_PUT_FLAG(msg, NL80211_ATTR_WIPHY_DYN_ACK);
+ } else {
+ char *end;
+ unsigned int distance, coverage;

- if (*end)
- return 1;
+ distance = strtoul(argv[0], &end, 10);

- /*
- * Divide double the distance by the speed of light in m/usec (300) to
- * get round-trip time in microseconds and then divide the result by
- * three to get coverage class as specified in IEEE 802.11-2007 table
- * 7-27. Values are rounded upwards.
- */
- coverage = (distance + 449) / 450;
- if (coverage > 255)
- return 1;
+ if (*end)
+ return 1;

- NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage);
+ /*
+ * Divide double the distance by the speed of light
+ * in m/usec (300) to get round-trip time in microseconds
+ * and then divide the result by three to get coverage class
+ * as specified in IEEE 802.11-2007 table 7-27.
+ * Values are rounded upwards.
+ */
+ coverage = (distance + 449) / 450;
+ if (coverage > 255)
+ return 1;
+
+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage);
+ }

return 0;
nla_put_failure:
return -ENOBUFS;
}
-COMMAND(set, distance, "<distance>",
+COMMAND(set, distance, "<auto|distance>",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_distance,
- "Set appropriate coverage class for given link distance in meters.\n"
+ "Enable ACK timeout estimation algorithm (dynack) or set appropriate\n"
+ "coverage class for given link distance in meters.\n"
+ "To disable dynack set valid value for coverage class.\n"
"Valid values: 0 - 114750");

static int handle_txpower(struct nl80211_state *state,
--
1.9.1


2014-09-07 17:32:26

by Lorenzo Bianconi

[permalink] [raw]
Subject: [PATCHv3 1/2] iw: update nl80211.h

Sync nl80211_attrs enumeration and nl80211_feature_flags enumeration with
mac80211-next tree. This change is necessary to add support to dynack
configuration.

Signed-off-by: Lorenzo Bianconi <[email protected]>
---
nl80211.h | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

diff --git a/nl80211.h b/nl80211.h
index be9519b..8951c31 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -1591,6 +1591,20 @@ enum nl80211_commands {
* creation then the new interface will be owned by the netlink socket
* that created it and will be destroyed when the socket is closed
*
+ * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
+ * the TDLS link initiator.
+ *
+ * @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection
+ * shall support Radio Resource Measurements (11k). This attribute can be
+ * used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests.
+ * User space applications are expected to use this flag only if the
+ * underlying device supports these minimal RRM features:
+ * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
+ * %NL80211_FEATURE_QUIET,
+ * If this flag is used, driver must add the Power Capabilities IE to the
+ * association request. In addition, it must also set the RRM capability
+ * flag in the association request's Capability Info field.
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1931,6 +1945,10 @@ enum nl80211_attrs {
NL80211_ATTR_CSA_C_OFFSETS_TX,
NL80211_ATTR_MAX_CSA_COUNTERS,

+ NL80211_ATTR_TDLS_INITIATOR,
+
+ NL80211_ATTR_USE_RRM,
+
/* add attributes here, update the policy in nl80211.c */

__NL80211_ATTR_AFTER_LAST,
@@ -3951,6 +3969,16 @@ enum nl80211_ap_sme_features {
* @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
* channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
* lifetime of a BSS.
+ * @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter
+ * Set IE to probe requests.
+ * @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE
+ * to probe requests.
+ * @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period
+ * requests sent to it by an AP.
+ * @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the
+ * current tx power value into the TPC Report IE in the spectrum
+ * management TPC Report action frame, and in the Radio Measurement Link
+ * Measurement Report action frame.
*/
enum nl80211_feature_flags {
NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3972,6 +4000,10 @@ enum nl80211_feature_flags {
NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
+ NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19,
+ NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20,
+ NL80211_FEATURE_QUIET = 1 << 21,
+ NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22,
};

/**
--
1.9.1


2014-10-09 15:21:36

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv3 2/2] iw: add auto parameter to set distance command

On Thu, 2014-10-09 at 16:46 +0200, Lorenzo Bianconi wrote:

> > Somehow you also changed nl80211.h here - you shouldn't do that at all
> > really :) I will deal with the updates of that file for iw.
>
> I added NL80211_ATTR_WIPHY_DYN_ACK flag attribute to nl80211_attrs
> enumeration and NL80211_FEATURE_ACKTO_ESTIMATION flag attribute to
> nl80211_feature_flags. I should not? Should I use a different patch?

I never apply patches to nl80211.h - I only copy the file from the
latest kernel. That way I avoid sync issues and if then your patch
doesn't compile I know I haven't applied the kernel patch :)

So yeah - you should simply not do it at all. I'll copy if/when needed.

johannes


2014-10-09 14:21:16

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCHv3 2/2] iw: add auto parameter to set distance command

On Sun, 2014-09-07 at 19:32 +0200, Lorenzo Bianconi wrote:
> Add auto parameter to set distance command in order to enable ACK timeout
> estimation algorithm (dynack). Dynack is automatically disabled setting valid
> value for coverage class. Currently dynack is supported just by ath9k
>
> This patch is based on "configure dynack through mac80211/cfg80211 stack"
> patchset sent on linux-wireless

Applied.

> nl80211.h | 12 ++++++++++++

Somehow you also changed nl80211.h here - you shouldn't do that at all
really :) I will deal with the updates of that file for iw.

johannes


2014-10-09 14:46:36

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCHv3 2/2] iw: add auto parameter to set distance command

> On Sun, 2014-09-07 at 19:32 +0200, Lorenzo Bianconi wrote:
>> Add auto parameter to set distance command in order to enable ACK timeout
>> estimation algorithm (dynack). Dynack is automatically disabled setting valid
>> value for coverage class. Currently dynack is supported just by ath9k
>>
>> This patch is based on "configure dynack through mac80211/cfg80211 stack"
>> patchset sent on linux-wireless
>
> Applied.
>
>> nl80211.h | 12 ++++++++++++
>
> Somehow you also changed nl80211.h here - you shouldn't do that at all
> really :) I will deal with the updates of that file for iw.

I added NL80211_ATTR_WIPHY_DYN_ACK flag attribute to nl80211_attrs
enumeration and NL80211_FEATURE_ACKTO_ESTIMATION flag attribute to
nl80211_feature_flags. I should not? Should I use a different patch?

>
> johannes
>

Regards,
Lorenzo

--
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp;
umount; make clean; sleep