[pkg-wpa-devel] r1844 - in /iw/trunk: bitrate.c debian/changelog event.c info.c nl80211.h util.c version.sh
slh-guest at users.alioth.debian.org
slh-guest at users.alioth.debian.org
Sat Jan 25 00:43:24 UTC 2014
Author: slh-guest
Date: Sat Jan 25 00:43:24 2014
New Revision: 1844
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1844
Log:
v3.14
Modified:
iw/trunk/bitrate.c
iw/trunk/debian/changelog
iw/trunk/event.c
iw/trunk/info.c
iw/trunk/nl80211.h
iw/trunk/util.c
iw/trunk/version.sh
Modified: iw/trunk/bitrate.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/bitrate.c?rev=1844&op=diff
==============================================================================
--- iw/trunk/bitrate.c (original)
+++ iw/trunk/bitrate.c Sat Jan 25 00:43:24 2014
@@ -3,6 +3,78 @@
#include "nl80211.h"
#include "iw.h"
+
+static int parse_vht_chunk(const char *arg, __u8 *nss, __u16 *mcs)
+{
+ int count, i;
+ unsigned int inss, mcs_start, mcs_end, tab[10];
+
+ *nss = 0; *mcs = 0;
+
+ if (strchr(arg, '-')) {
+ /* Format: NSS:MCS_START-MCS_END */
+ count = sscanf(arg, "%u:%u-%u", &inss, &mcs_start, &mcs_end);
+
+ if (count != 3)
+ return 0;
+
+ if (inss < 1 || inss > NL80211_VHT_NSS_MAX)
+ return 0;
+
+ if (mcs_start > mcs_end)
+ return 0;
+
+ if (mcs_start > 9 || mcs_end > 9)
+ return 0;
+
+ *nss = inss;
+ for (i = mcs_start; i <= mcs_end; i++)
+ *mcs |= 1 << i;
+
+ } else {
+ /* Format: NSS:MCSx,MCSy,... */
+ count = sscanf(arg, "%u:%u,%u,%u,%u,%u,%u,%u,%u,%u,%u", &inss,
+ &tab[0], &tab[1], &tab[2], &tab[3], &tab[4], &tab[5],
+ &tab[6], &tab[7], &tab[8], &tab[9]);
+
+ if (count < 2)
+ return 0;
+
+ if (inss < 1 || inss > NL80211_VHT_NSS_MAX)
+ return 0;
+
+ *nss = inss;
+ for (i = 0; i < count - 1; i++) {
+ if (tab[i] > 9)
+ return 0;
+ *mcs |= 1 << tab[i];
+ }
+ }
+
+ return 1;
+}
+
+static int setup_vht(struct nl80211_txrate_vht *txrate_vht,
+ int argc, char **argv)
+{
+ __u8 nss;
+ __u16 mcs;
+ int i;
+
+ memset(txrate_vht, 0, sizeof(*txrate_vht));
+
+ for (i = 0; i < argc; i++) {
+ if(!parse_vht_chunk(argv[i], &nss, &mcs))
+ return 0;
+
+ nss--;
+ txrate_vht->mcs[nss] |= mcs;
+ }
+
+ return 1;
+}
+
+#define VHT_ARGC_MAX 100
static int handle_bitrates(struct nl80211_state *state,
struct nl_cb *cb,
@@ -17,15 +89,24 @@
int n_legacy_24 = 0, n_legacy_5 = 0;
uint8_t *legacy = NULL;
int *n_legacy = NULL;
- bool have_mcs_24 = false, have_mcs_5 = false;
- uint8_t mcs_24[77], mcs_5[77];
- int n_mcs_24 = 0, n_mcs_5 = 0;
+ bool have_ht_mcs_24 = false, have_ht_mcs_5 = false;
+ bool have_vht_mcs_24 = false, have_vht_mcs_5 = false;
+ uint8_t ht_mcs_24[77], ht_mcs_5[77];
+ int n_ht_mcs_24 = 0, n_ht_mcs_5 = 0;
+ struct nl80211_txrate_vht txrate_vht_24 = {};
+ struct nl80211_txrate_vht txrate_vht_5 = {};
uint8_t *mcs = NULL;
int *n_mcs = NULL;
+ char *vht_argv_5[VHT_ARGC_MAX] = {}; char *vht_argv_24[VHT_ARGC_MAX] = {};
+ char **vht_argv = NULL;
+ int vht_argc_5 = 0; int vht_argc_24 = 0;
+ int *vht_argc = NULL;
+
enum {
S_NONE,
S_LEGACY,
- S_MCS,
+ S_HT,
+ S_VHT,
} parser_state = S_NONE;
for (i = 0; i < argc; i++) {
@@ -48,20 +129,34 @@
n_legacy = &n_legacy_5;
have_legacy_5 = true;
}
- else if (strcmp(argv[i], "mcs-2.4") == 0) {
- if (have_mcs_24)
- return 1;
- parser_state = S_MCS;
- mcs = mcs_24;
- n_mcs = &n_mcs_24;
- have_mcs_24 = true;
- } else if (strcmp(argv[i], "mcs-5") == 0) {
- if (have_mcs_5)
- return 1;
- parser_state = S_MCS;
- mcs = mcs_5;
- n_mcs = &n_mcs_5;
- have_mcs_5 = true;
+ else if (strcmp(argv[i], "ht-mcs-2.4") == 0) {
+ if (have_ht_mcs_24)
+ return 1;
+ parser_state = S_HT;
+ mcs = ht_mcs_24;
+ n_mcs = &n_ht_mcs_24;
+ have_ht_mcs_24 = true;
+ } else if (strcmp(argv[i], "ht-mcs-5") == 0) {
+ if (have_ht_mcs_5)
+ return 1;
+ parser_state = S_HT;
+ mcs = ht_mcs_5;
+ n_mcs = &n_ht_mcs_5;
+ have_ht_mcs_5 = true;
+ } else if (strcmp(argv[i], "vht-mcs-2.4") == 0) {
+ if (have_vht_mcs_24)
+ return 1;
+ parser_state = S_VHT;
+ vht_argv = vht_argv_24;
+ vht_argc = &vht_argc_24;
+ have_vht_mcs_24 = true;
+ } else if (strcmp(argv[i], "vht-mcs-5") == 0) {
+ if (have_vht_mcs_5)
+ return 1;
+ parser_state = S_VHT;
+ vht_argv = vht_argv_5;
+ vht_argc = &vht_argc_5;
+ have_vht_mcs_5 = true;
}
else switch (parser_state) {
case S_LEGACY:
@@ -72,42 +167,59 @@
return 1;
legacy[(*n_legacy)++] = tmpd * 2;
break;
- case S_MCS:
+ case S_HT:
tmpl = strtol(argv[i], &end, 0);
if (*end != '\0')
return 1;
if (tmpl < 0 || tmpl > 255)
return 1;
mcs[(*n_mcs)++] = tmpl;
+ break;
+ case S_VHT:
+ if (*vht_argc >= VHT_ARGC_MAX)
+ return 1;
+ vht_argv[(*vht_argc)++] = argv[i];
break;
default:
return 1;
}
}
+ if (have_vht_mcs_24)
+ if(!setup_vht(&txrate_vht_24, vht_argc_24, vht_argv_24))
+ return -EINVAL;
+
+ if (have_vht_mcs_5)
+ if(!setup_vht(&txrate_vht_5, vht_argc_5, vht_argv_5))
+ return -EINVAL;
+
nl_rates = nla_nest_start(msg, NL80211_ATTR_TX_RATES);
if (!nl_rates)
goto nla_put_failure;
- if (have_legacy_24 || have_mcs_24) {
+ if (have_legacy_24 || have_ht_mcs_24 || have_vht_mcs_24) {
nl_band = nla_nest_start(msg, NL80211_BAND_2GHZ);
if (!nl_band)
goto nla_put_failure;
if (have_legacy_24)
nla_put(msg, NL80211_TXRATE_LEGACY, n_legacy_24, legacy_24);
- if (have_mcs_24)
- nla_put(msg, NL80211_TXRATE_MCS, n_mcs_24, mcs_24);
+ if (have_ht_mcs_24)
+ nla_put(msg, NL80211_TXRATE_HT, n_ht_mcs_24, ht_mcs_24);
+ if (have_vht_mcs_24)
+ nla_put(msg, NL80211_TXRATE_VHT, sizeof(txrate_vht_24), &txrate_vht_24);
nla_nest_end(msg, nl_band);
}
- if (have_legacy_5 || have_mcs_5) {
+ if (have_legacy_5 || have_ht_mcs_5 || have_vht_mcs_5) {
nl_band = nla_nest_start(msg, NL80211_BAND_5GHZ);
if (!nl_band)
goto nla_put_failure;
if (have_legacy_5)
nla_put(msg, NL80211_TXRATE_LEGACY, n_legacy_5, legacy_5);
- if (have_mcs_5)
- nla_put(msg, NL80211_TXRATE_MCS, n_mcs_5, mcs_5);
+ if (have_ht_mcs_5)
+ nla_put(msg, NL80211_TXRATE_HT, n_ht_mcs_5, ht_mcs_5);
+ if (have_vht_mcs_5)
+ nla_put(msg, NL80211_TXRATE_VHT, sizeof(txrate_vht_5), &txrate_vht_5);
nla_nest_end(msg, nl_band);
}
@@ -119,9 +231,9 @@
}
#define DESCR_LEGACY "[legacy-<2.4|5> <legacy rate in Mbps>*]"
-#define DESCR DESCR_LEGACY " [mcs-<2.4|5> <MCS index>*]"
-
-COMMAND(set, bitrates, "[legacy-<2.4|5> <legacy rate in Mbps>*] [mcs-<2.4|5> <MCS index>*]",
+#define DESCR DESCR_LEGACY " [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*]"
+
+COMMAND(set, bitrates, "[legacy-<2.4|5> <legacy rate in Mbps>*] [ht-mcs-<2.4|5> <MCS index>*] [vht-mcs-<2.4|5> <NSS:MCSx,MCSy... | NSS:MCSx-MCSy>*]",
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).");
Modified: iw/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/debian/changelog?rev=1844&op=diff
==============================================================================
--- iw/trunk/debian/changelog (original)
+++ iw/trunk/debian/changelog Sat Jan 25 00:43:24 2014
@@ -1,4 +1,4 @@
-iw (3.13-1) UNRELEASED; urgency=low
+iw (3.14-1) UNRELEASED; urgency=low
* NOT RELEASED YET
* New upstream release:
@@ -16,7 +16,7 @@
* deploy hardening support.
* allow parallel building.
- -- Stefan Lippers-Hollmann <s.l-h at gmx.de> Wed, 25 Dec 2013 04:37:09 +0100
+ -- Stefan Lippers-Hollmann <s.l-h at gmx.de> Sat, 25 Jan 2014 01:42:32 +0100
iw (3.4-1) unstable; urgency=low
Modified: iw/trunk/event.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/event.c?rev=1844&op=diff
==============================================================================
--- iw/trunk/event.c (original)
+++ iw/trunk/event.c Sat Jan 25 00:43:24 2014
@@ -531,6 +531,11 @@
(unsigned long long)nla_get_u64(tb[NL80211_ATTR_COOKIE]),
tb[NL80211_ATTR_ACK] ? "acked" : "no ack");
break;
+ case NL80211_CMD_VENDOR:
+ printf("vendor event %.6x:%d\n",
+ nla_get_u32(tb[NL80211_ATTR_VENDOR_ID]),
+ nla_get_u32(tb[NL80211_ATTR_VENDOR_SUBCMD]));
+ break;
default:
printf("unknown event %d\n", gnlh->cmd);
break;
@@ -595,6 +600,13 @@
/* MLME multicast group */
mcid = nl_get_multicast_id(state->nl_sock, "nl80211", "mlme");
+ if (mcid >= 0) {
+ ret = nl_socket_add_membership(state->nl_sock, mcid);
+ if (ret)
+ return ret;
+ }
+
+ mcid = nl_get_multicast_id(state->nl_sock, "nl80211", "vendor");
if (mcid >= 0) {
ret = nl_socket_add_membership(state->nl_sock, mcid);
if (ret)
Modified: iw/trunk/info.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/info.c?rev=1844&op=diff
==============================================================================
--- iw/trunk/info.c (original)
+++ iw/trunk/info.c Sat Jan 25 00:43:24 2014
@@ -534,6 +534,9 @@
printf("\tDevice supports AP scan.\n");
}
+ if (tb_msg[NL80211_ATTR_TDLS_SUPPORT])
+ printf("\tDevice supports T-DLS.\n");
+
if (tb_msg[NL80211_ATTR_COALESCE_RULE]) {
struct nl80211_coalesce_rule_support *rule;
struct nl80211_pattern_support *pat;
Modified: iw/trunk/nl80211.h
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/nl80211.h?rev=1844&op=diff
==============================================================================
--- iw/trunk/nl80211.h (original)
+++ iw/trunk/nl80211.h Sat Jan 25 00:43:24 2014
@@ -693,6 +693,21 @@
* other station that transmission must be blocked until the channel
* switch is complete.
*
+ * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
+ * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
+ * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
+ * %NL80211_ATTR_VENDOR_DATA.
+ * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
+ * used in the wiphy data as a nested attribute containing descriptions
+ * (&struct nl80211_vendor_cmd_info) of the supported vendor commands.
+ * This may also be sent as an event with the same attributes.
+ *
+ * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
+ * The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
+ * that attribute is not included, QoS mapping is disabled. Since this
+ * QoS mapping is relevant for IP packets, it is only valid during an
+ * association. This is cleared on disassociation and AP restart.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -859,6 +874,10 @@
NL80211_CMD_SET_COALESCE,
NL80211_CMD_CHANNEL_SWITCH,
+
+ NL80211_CMD_VENDOR,
+
+ NL80211_CMD_SET_QOS_MAP,
/* add new commands above here */
@@ -1515,8 +1534,26 @@
* to react to radar events, e.g. initiate a channel switch or leave the
* IBSS network.
*
- * @NL80211_ATTR_SUPPORT_5_10_MHZ: A flag indicating that the device supports
- * 5 MHz and 10 MHz channel bandwidth.
+ * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
+ * 5 MHz channel bandwidth.
+ * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
+ * 10 MHz channel bandwidth.
+ *
+ * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
+ * Notification Element based on association request when used with
+ * %NL80211_CMD_NEW_STATION; u8 attribute.
+ *
+ * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
+ * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
+ * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
+ * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
+ * attribute is also used for vendor command feature advertisement
+ * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
+ * info, containing a nested array of possible events
+ *
+ * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
+ * data is in the format defined for the payload of the QoS Map Set element
+ * in IEEE Std 802.11-2012, 8.4.2.97.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1834,7 +1871,17 @@
NL80211_ATTR_HANDLE_DFS,
- NL80211_ATTR_SUPPORT_5_10_MHZ,
+ NL80211_ATTR_SUPPORT_5_MHZ,
+ NL80211_ATTR_SUPPORT_10_MHZ,
+
+ NL80211_ATTR_OPMODE_NOTIF,
+
+ NL80211_ATTR_VENDOR_ID,
+ NL80211_ATTR_VENDOR_SUBCMD,
+ NL80211_ATTR_VENDOR_DATA,
+ NL80211_ATTR_VENDOR_EVENTS,
+
+ NL80211_ATTR_QOS_MAP,
/* add attributes here, update the policy in nl80211.c */
@@ -3080,19 +3127,33 @@
* in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
* 1 = 500 kbps) but without the IE length restriction (at most
* %NL80211_MAX_SUPP_RATES in a single array).
- * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection
+ * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
* in an array of MCS numbers.
+ * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
+ * see &struct nl80211_txrate_vht
* @__NL80211_TXRATE_AFTER_LAST: internal
* @NL80211_TXRATE_MAX: highest TX rate attribute
*/
enum nl80211_tx_rate_attributes {
__NL80211_TXRATE_INVALID,
NL80211_TXRATE_LEGACY,
- NL80211_TXRATE_MCS,
+ NL80211_TXRATE_HT,
+ NL80211_TXRATE_VHT,
/* keep last */
__NL80211_TXRATE_AFTER_LAST,
NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
+};
+
+#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
+#define NL80211_VHT_NSS_MAX 8
+
+/**
+ * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
+ * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
+ */
+struct nl80211_txrate_vht {
+ __u16 mcs[NL80211_VHT_NSS_MAX];
};
/**
@@ -3956,4 +4017,24 @@
NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
};
+/*
+ * If this flag is unset, the lower 24 bits are an OUI, if set
+ * a Linux nl80211 vendor ID is used (no such IDs are allocated
+ * yet, so that's not valid so far)
+ */
+#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
+
+/**
+ * struct nl80211_vendor_cmd_info - vendor command data
+ * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
+ * value is a 24-bit OUI; if it is set then a separately allocated ID
+ * may be used, but no such IDs are allocated yet. New IDs should be
+ * added to this file when needed.
+ * @subcmd: sub-command ID for the command
+ */
+struct nl80211_vendor_cmd_info {
+ __u32 vendor_id;
+ __u32 subcmd;
+};
+
#endif /* __LINUX_NL80211_H */
Modified: iw/trunk/util.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/util.c?rev=1844&op=diff
==============================================================================
--- iw/trunk/util.c (original)
+++ iw/trunk/util.c Sat Jan 25 00:43:24 2014
@@ -248,6 +248,10 @@
[NL80211_CMD_FT_EVENT] = "ft_event",
[NL80211_CMD_CRIT_PROTOCOL_START] = "crit_protocol_start",
[NL80211_CMD_CRIT_PROTOCOL_STOP] = "crit_protocol_stop",
+ [NL80211_CMD_GET_COALESCE] = "get_coalesce",
+ [NL80211_CMD_SET_COALESCE] = "set_coalesce",
+ [NL80211_CMD_CHANNEL_SWITCH] = "channel_switch",
+ [NL80211_CMD_VENDOR] = "vendor",
};
static char cmdbuf[100];
Modified: iw/trunk/version.sh
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/version.sh?rev=1844&op=diff
==============================================================================
--- iw/trunk/version.sh (original)
+++ iw/trunk/version.sh Sat Jan 25 00:43:24 2014
@@ -1,6 +1,6 @@
#!/bin/sh
-VERSION="3.13"
+VERSION="3.14"
OUT="$1"
if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
More information about the Pkg-wpa-devel
mailing list