From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, Johannes Berg <johannes@sipsolutions.net>,
Simon Wunderlich <siwu@hrz.tu-chemnitz.de>,
Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Subject: [PATCH 2/2] iw: remove ifdefs for mcs mask
Date: Sat, 28 Jan 2012 17:25:35 +0100 [thread overview]
Message-ID: <1327767935-16984-5-git-send-email-siwu@hrz.tu-chemnitz.de> (raw)
In-Reply-To: <1327767935-16984-1-git-send-email-siwu@hrz.tu-chemnitz.de>
These are enums, not defines. Therefore the ifdef check can never be
true.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
---
bitrate.c | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/bitrate.c b/bitrate.c
index cefd150..22b863e 100644
--- a/bitrate.c
+++ b/bitrate.c
@@ -17,12 +17,10 @@ static int handle_bitrates(struct nl80211_state *state,
uint8_t *legacy = NULL;
int *n_legacy = NULL;
bool have_mcs_24 = false, have_mcs_5 = false;
-#ifdef NL80211_TXRATE_MCS
uint8_t mcs_24[77], mcs_5[77];
int n_mcs_24 = 0, n_mcs_5 = 0;
uint8_t *mcs = NULL;
int *n_mcs = NULL;
-#endif
enum {
S_NONE,
S_LEGACY,
@@ -32,9 +30,7 @@ static int handle_bitrates(struct nl80211_state *state,
for (i = 0; i < argc; i++) {
char *end;
double tmpd;
-#ifdef NL80211_TXRATE_MCS
long tmpl;
-#endif
if (strcmp(argv[i], "legacy-2.4") == 0) {
if (have_legacy_24)
@@ -51,7 +47,6 @@ static int handle_bitrates(struct nl80211_state *state,
n_legacy = &n_legacy_5;
have_legacy_5 = true;
}
-#ifdef NL80211_TXRATE_MCS
else if (strcmp(argv[i], "mcs-2.4") == 0) {
if (have_mcs_24)
return 1;
@@ -67,7 +62,6 @@ static int handle_bitrates(struct nl80211_state *state,
n_mcs = &n_mcs_5;
have_mcs_5 = true;
}
-#endif
else switch (parser_state) {
case S_LEGACY:
tmpd = strtod(argv[i], &end);
@@ -78,7 +72,6 @@ static int handle_bitrates(struct nl80211_state *state,
legacy[(*n_legacy)++] = tmpd * 2;
break;
case S_MCS:
-#ifdef NL80211_TXRATE_MCS
tmpl = strtol(argv[i], &end, 0);
if (*end != '\0')
return 1;
@@ -86,7 +79,6 @@ static int handle_bitrates(struct nl80211_state *state,
return 1;
mcs[(*n_mcs)++] = tmpl;
break;
-#endif
default:
return 1;
}
@@ -102,10 +94,8 @@ static int handle_bitrates(struct nl80211_state *state,
goto nla_put_failure;
if (have_legacy_24)
nla_put(msg, NL80211_TXRATE_LEGACY, n_legacy_24, legacy_24);
-#ifdef NL80211_TXRATE_MCS
if (have_mcs_24)
nla_put(msg, NL80211_TXRATE_MCS, n_mcs_24, mcs_24);
-#endif
nla_nest_end(msg, nl_band);
}
@@ -115,10 +105,8 @@ static int handle_bitrates(struct nl80211_state *state,
goto nla_put_failure;
if (have_legacy_5)
nla_put(msg, NL80211_TXRATE_LEGACY, n_legacy_5, legacy_5);
-#ifdef NL80211_TXRATE_MCS
if (have_mcs_5)
nla_put(msg, NL80211_TXRATE_MCS, n_mcs_5, mcs_5);
-#endif
nla_nest_end(msg, nl_band);
}
@@ -130,13 +118,9 @@ static int handle_bitrates(struct nl80211_state *state,
}
#define DESCR_LEGACY "[legacy-<2.4|5> <legacy rate in Mbps>*]"
-#ifdef NL80211_TXRATE_MCS
#define DESCR DESCR_LEGACY " [mcs-<2.4|5> <MCS index>*]"
-#else
-#define DESCR DESCR_LEGACY
-#endif
-COMMAND(set, bitrates, DESCR, NL80211_CMD_SET_TX_BITRATE_MASK, 0, CIB_NETDEV,
- handle_bitrates,
+COMMAND(set, bitrates, "[legacy-<2.4|5> <legacy rate in Mbps>*] [mcs-<2.4|5> <MCS index>*]",
+ NL80211_CMD_SET_TX_BITRATE_MASK, 0, CIB_NETDEV, handle_bitrates,
"Sets up the specified rate masks.\n"
"Not passing any arguments would clear the existing mask (if any).");
--
1.7.7.3
next prev parent reply other threads:[~2012-01-28 16:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-28 16:25 [PATCHv3 0/2] [RESEND] add support for mcs masks Simon Wunderlich
2012-01-28 16:25 ` [PATCHv3 1/2] nl80211: " Simon Wunderlich
2020-11-12 10:38 ` Wen Gong
2020-11-12 10:38 ` Wen Gong
2020-11-12 10:38 ` Wen Gong
2020-11-13 8:55 ` Wen Gong
2020-11-13 8:55 ` Wen Gong
2020-11-13 8:55 ` Wen Gong
2012-01-28 16:25 ` [PATCHv3 2/2] mac80211: " Simon Wunderlich
2012-01-28 16:25 ` [PATCH 1/2] iw: add nl80211 bitrates Simon Wunderlich
2012-01-28 16:25 ` Simon Wunderlich [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-01-05 19:58 [PATCHv2 0/2] add support for mcs masks Simon Wunderlich
2012-01-05 19:58 ` [PATCH 2/2] iw: remove ifdefs for mcs mask Simon Wunderlich
2012-01-09 13:05 ` Johannes Berg
2012-01-10 18:29 ` Simon Wunderlich
2011-12-19 14:14 [PATCH 0/2] add support for mcs masks Simon Wunderlich
2011-12-19 14:14 ` [PATCH 2/2] iw: remove ifdefs for mcs mask Simon Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327767935-16984-5-git-send-email-siwu@hrz.tu-chemnitz.de \
--to=simon.wunderlich@s2003.tu-chemnitz.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mathias.kretschmer@fokus.fraunhofer.de \
--cc=siwu@hrz.tu-chemnitz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.