[pkg-wpa-devel] r1297 - in /iw/trunk: COPYING Makefile README debian/changelog debian/control debian/copyright defconfig genl.c info.c iw.h mesh.c nl80211.h phy.c util.c version.sh
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Tue Dec 9 18:06:19 UTC 2008
Author: kelmo-guest
Date: Tue Dec 9 18:06:18 2008
New Revision: 1297
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1297
Log:
* New upstream release.
* Update debian/copright for change from BSD-3 -> ISC license.
* Add ${misc:Depends} to dependency field, as debhelper uses it as
required.
Removed:
iw/trunk/defconfig
Modified:
iw/trunk/COPYING
iw/trunk/Makefile
iw/trunk/README
iw/trunk/debian/changelog
iw/trunk/debian/control
iw/trunk/debian/copyright
iw/trunk/genl.c
iw/trunk/info.c
iw/trunk/iw.h
iw/trunk/mesh.c
iw/trunk/nl80211.h
iw/trunk/phy.c
iw/trunk/util.c
iw/trunk/version.sh
Modified: iw/trunk/COPYING
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/COPYING?rev=1297&op=diff
==============================================================================
--- iw/trunk/COPYING (original)
+++ iw/trunk/COPYING Tue Dec 9 18:06:18 2008
@@ -3,27 +3,14 @@
Copyright (c) 2007 Mike Kershaw
Copyright (c) 2008 Luis R. Rodriguez
-All rights reserved.
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Modified: iw/trunk/Makefile
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/Makefile?rev=1297&op=diff
==============================================================================
--- iw/trunk/Makefile (original)
+++ iw/trunk/Makefile Tue Dec 9 18:06:18 2008
@@ -2,10 +2,14 @@
MAKEFLAGS += --no-print-directory
+PREFIX ?= /usr
+BINDIR ?= $(PREFIX)/bin
+MANDIR ?= $(PREFIX)/share/man
+
MKDIR ?= mkdir -p
INSTALL ?= install
-PREFIX ?= /usr
CC ?= "gcc"
+
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration `pkg-config --cflags libnl-1`
CFLAGS += -O2 -g
LDFLAGS += `pkg-config --libs libnl-1`
@@ -49,11 +53,11 @@
install: iw iw.8.gz
@$(NQ) ' INST iw'
- $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)/bin/
- $(Q)$(INSTALL) -m 755 -o root -g root -t $(DESTDIR)$(PREFIX)/bin/ iw
+ $(Q)$(MKDIR) $(DESTDIR)$(BINDIR)
+ $(Q)$(INSTALL) -m 755 -t $(DESTDIR)$(BINDIR) iw
@$(NQ) ' INST iw.8'
- $(Q)$(MKDIR) $(DESTDIR)$(PREFIX)/share/man/man8/
- $(Q)$(INSTALL) -m 644 -o root -g root -t $(DESTDIR)$(PREFIX)/share/man/man8/ iw.8.gz
+ $(Q)$(MKDIR) $(DESTDIR)$(MANDIR)/man8/
+ $(Q)$(INSTALL) -m 644 -t $(DESTDIR)$(MANDIR)/man8/ iw.8.gz
clean:
$(Q)rm -f iw *.o *~ *.gz version.h *-stamp
Modified: iw/trunk/README
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/README?rev=1297&op=diff
==============================================================================
--- iw/trunk/README (original)
+++ iw/trunk/README Tue Dec 9 18:06:18 2008
@@ -2,5 +2,14 @@
This is 'iw', a tool to use nl80211.
-To build iw, just enter 'make'. If that fails, copy the file
-defconfig to .config and adjust the settings in it.
+To build iw, just enter 'make'. If that fails, set the
+PKG_CONFIG_PATH environment variable to allow the Makefile
+to find libnl.
+
+
+'iw' is currently maintained at http://git.sipsolutions.net/iw.git/,
+some more documentation is available at
+http://wireless.kernel.org/en/users/Documentation/iw.
+
+Please send all patches to Johannes Berg <johannes at sipsolutions.net>
+and CC linux-wireless at vger.kernel.org for community review.
Modified: iw/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/debian/changelog?rev=1297&op=diff
==============================================================================
--- iw/trunk/debian/changelog (original)
+++ iw/trunk/debian/changelog Tue Dec 9 18:06:18 2008
@@ -1,3 +1,12 @@
+iw (0.9.7-1) experimental; urgency=low
+
+ * New upstream release.
+ * Update debian/copright for change from BSD-3 -> ISC license.
+ * Add ${misc:Depends} to dependency field, as debhelper uses it as
+ required.
+
+ -- Kel Modderman <kel at otaku42.de> Wed, 10 Dec 2008 04:04:58 +1000
+
iw (0.9.6-1) experimental; urgency=low
* Initial release. (Closes: #499537)
Modified: iw/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/debian/control?rev=1297&op=diff
==============================================================================
--- iw/trunk/debian/control (original)
+++ iw/trunk/debian/control Tue Dec 9 18:06:18 2008
@@ -15,7 +15,7 @@
Package: iw
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
Conflicts: aircrack-ng
Description: tool for configuring Linux wireless devices
This package contains the `iw' tool which allows you to configure and show
Modified: iw/trunk/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/debian/copyright?rev=1297&op=diff
==============================================================================
--- iw/trunk/debian/copyright (original)
+++ iw/trunk/debian/copyright Tue Dec 9 18:06:18 2008
@@ -7,13 +7,22 @@
Copyright: Copyright (c) 2007 Andy Lutomirski
Copyright: Copyright (c) 2007 Mike Kershaw
Copyright: Copyright (c) 2008 Luis R. Rodriguez
-License: BSD-3
- On Debian GNU/Linux systems, the complete text of the BSD license can be
- found at `/usr/share/common-licenses/BSD'.
+License: ISC
Files: debian/*
Copyright: Copyright (c) 2007, 2008 Johannes Berg
Copyright: Copyright (c) 2008 Kel Modderman
-License: BSD-3
- On Debian GNU/Linux systems, the complete text of the BSD license can be
- found at `/usr/share/common-licenses/BSD'.
+License: ISC
+
+License: ISC
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Modified: iw/trunk/genl.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/genl.c?rev=1297&op=diff
==============================================================================
--- iw/trunk/genl.c (original)
+++ iw/trunk/genl.c Tue Dec 9 18:06:18 2008
@@ -15,11 +15,6 @@
int *ret = arg;
*ret = err->error;
return NL_STOP;
-}
-
-static int finish_handler(struct nl_msg *msg, void *arg)
-{
- return NL_SKIP;
}
static int ack_handler(struct nl_msg *msg, void *arg)
@@ -102,7 +97,6 @@
ret = 1;
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &ret);
- nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, NULL);
nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &ret);
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, family_handler, &grp);
Modified: iw/trunk/info.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/info.c?rev=1297&op=diff
==============================================================================
--- iw/trunk/info.c (original)
+++ iw/trunk/info.c Tue Dec 9 18:06:18 2008
@@ -16,7 +16,7 @@
printf(" (");
else
printf(", ");
- printf(name);
+ printf("%s", name);
*open = 1;
}
@@ -34,6 +34,7 @@
[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
+ [NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
};
struct nlattr *tb_rate[NL80211_BITRATE_ATTR_MAX + 1];
@@ -137,11 +138,18 @@
printf("\t\tFrequencies:\n");
nla_for_each_nested(nl_freq, tb_band[NL80211_BAND_ATTR_FREQS], rem_freq) {
+ uint32_t freq;
nla_parse(tb_freq, NL80211_FREQUENCY_ATTR_MAX, nla_data(nl_freq),
nla_len(nl_freq), freq_policy);
if (!tb_freq[NL80211_FREQUENCY_ATTR_FREQ])
continue;
- printf("\t\t\t* %d MHz", nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_FREQ]));
+ freq = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_FREQ]);
+ printf("\t\t\t* %d MHz [%d]", freq, ieee80211_frequency_to_channel(freq));
+
+ if (tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] &&
+ !tb_freq[NL80211_FREQUENCY_ATTR_DISABLED])
+ printf(" (%.1f dBm)", 0.01 * nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]));
+
open = 0;
if (tb_freq[NL80211_FREQUENCY_ATTR_DISABLED])
print_flag("disabled", &open);
Modified: iw/trunk/iw.h
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/iw.h?rev=1297&op=diff
==============================================================================
--- iw/trunk/iw.h (original)
+++ iw/trunk/iw.h Tue Dec 9 18:06:18 2008
@@ -39,6 +39,8 @@
int argc, char **argv);
};
+#define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
+
#define __COMMAND(sect, name, args, nlcmd, flags, hidden, idby, handler)\
static const struct cmd \
__cmd_ ## handler ## _ ## nlcmd ## _ ## idby ## _ ## hidden \
@@ -57,6 +59,8 @@
int mac_addr_n2a(char *mac_addr, unsigned char *arg);
const char *iftype_name(enum nl80211_iftype iftype);
+int ieee80211_channel_to_frequency(int chan);
+int ieee80211_frequency_to_channel(int freq);
int nl_get_multicast_id(struct nl_handle *handle, const char *family, const char *group);
Modified: iw/trunk/mesh.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/mesh.c?rev=1297&op=diff
==============================================================================
--- iw/trunk/mesh.c (original)
+++ iw/trunk/mesh.c Tue Dec 9 18:06:18 2008
@@ -172,9 +172,7 @@
int i;
const char *comma = "";
- for (i = 0;
- i < sizeof(_mesh_param_descrs)/sizeof(_mesh_param_descrs[0]);
- ++i) {
+ for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
printf("%s%s", comma, _mesh_param_descrs[i].name);
comma = ", ";
}
@@ -194,12 +192,9 @@
/* Find out what mesh parameter we want to change. */
mdescr = NULL;
- for (i = 0;
- i < sizeof(_mesh_param_descrs)/sizeof(_mesh_param_descrs[0]);
- ++i) {
+ for (i = 0; ARRAY_SIZE(_mesh_param_descrs); i++)
if (!strcmp(_mesh_param_descrs[i].name, argv[0]))
return _mesh_param_descrs + i;
- }
if (!mdescr) {
printf("Mesh_param must be one of: ");
Modified: iw/trunk/nl80211.h
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/nl80211.h?rev=1297&op=diff
==============================================================================
--- iw/trunk/nl80211.h (original)
+++ iw/trunk/nl80211.h Tue Dec 9 18:06:18 2008
@@ -3,7 +3,26 @@
/*
* 802.11 netlink interface public header
*
- * Copyright 2006, 2007 Johannes Berg <johannes at sipsolutions.net>
+ * Copyright 2006, 2007, 2008 Johannes Berg <johannes at sipsolutions.net>
+ * Copyright 2008 Michael Wu <flamingice at sourmilk.net>
+ * Copyright 2008 Luis Carlos Cobo <luisca at cozybit.com>
+ * Copyright 2008 Michael Buesch <mb at bu3sch.de>
+ * Copyright 2008 Luis R. Rodriguez <lrodriguez at atheros.com>
+ * Copyright 2008 Jouni Malinen <jouni.malinen at atheros.com>
+ * Copyright 2008 Colin McCabe <colin at cozybit.com>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
*/
/**
@@ -25,8 +44,10 @@
*
* @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
* to get a list of all present wiphys.
- * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
- * %NL80211_ATTR_WIPHY_NAME.
+ * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
+ * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
+ * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or
+ * %NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET.
* @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
* or rename notification. Has attributes %NL80211_ATTR_WIPHY and
* %NL80211_ATTR_WIPHY_NAME.
@@ -178,6 +199,15 @@
* @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
* /sys/class/ieee80211/<phyname>/index
* @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
+ * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
+ * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
+ * @NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET: included with NL80211_ATTR_WIPHY_FREQ
+ * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):
+ * NL80211_SEC_CHAN_NO_HT = HT not allowed (i.e., same as not including
+ * this attribute)
+ * NL80211_SEC_CHAN_DISABLED = HT20 only
+ * NL80211_SEC_CHAN_BELOW = secondary channel is below the primary channel
+ * NL80211_SEC_CHAN_ABOVE = secondary channel is above the primary channel
*
* @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
* @NL80211_ATTR_IFNAME: network interface name
@@ -243,6 +273,9 @@
* (u8, 0 or 1)
* @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
* (u8, 0 or 1)
+ * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
+ * rates in format defined by IEEE 802.11 7.3.2.2 but without the length
+ * restriction (at most %NL80211_MAX_SUPP_RATES).
*
* @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION)
@@ -307,6 +340,12 @@
NL80211_ATTR_MESH_PARAMS,
+ NL80211_ATTR_BSS_BASIC_RATES,
+
+ NL80211_ATTR_WIPHY_TXQ_PARAMS,
+ NL80211_ATTR_WIPHY_FREQ,
+ NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -318,6 +357,10 @@
* here
*/
#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
+#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
+#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
+#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
+#define NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET
#define NL80211_MAX_SUPP_RATES 32
#define NL80211_MAX_SUPP_REG_RULES 32
@@ -497,6 +540,8 @@
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
* on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
+ * (100 * dBm).
*/
enum nl80211_frequency_attr {
__NL80211_FREQUENCY_ATTR_INVALID,
@@ -505,11 +550,14 @@
NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
NL80211_FREQUENCY_ATTR_NO_IBSS,
NL80211_FREQUENCY_ATTR_RADAR,
+ NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
};
+
+#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
/**
* enum nl80211_bitrate_attr - bitrate attributes
@@ -692,4 +740,44 @@
NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
};
+/**
+ * enum nl80211_txq_attr - TX queue parameter attributes
+ * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
+ * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*)
+ * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
+ * disabled
+ * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
+ * 2^n-1 in the range 1..32767]
+ * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
+ * 2^n-1 in the range 1..32767]
+ * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
+ * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
+ * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
+ */
+enum nl80211_txq_attr {
+ __NL80211_TXQ_ATTR_INVALID,
+ NL80211_TXQ_ATTR_QUEUE,
+ NL80211_TXQ_ATTR_TXOP,
+ NL80211_TXQ_ATTR_CWMIN,
+ NL80211_TXQ_ATTR_CWMAX,
+ NL80211_TXQ_ATTR_AIFS,
+
+ /* keep last */
+ __NL80211_TXQ_ATTR_AFTER_LAST,
+ NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
+};
+
+enum nl80211_txq_q {
+ NL80211_TXQ_Q_VO,
+ NL80211_TXQ_Q_VI,
+ NL80211_TXQ_Q_BE,
+ NL80211_TXQ_Q_BK
+};
+
+enum nl80211_sec_chan_offset {
+ NL80211_SEC_CHAN_NO_HT /* No HT */,
+ NL80211_SEC_CHAN_DISABLED /* HT20 only */,
+ NL80211_SEC_CHAN_BELOW /* HT40- */,
+ NL80211_SEC_CHAN_ABOVE /* HT40+ */
+};
#endif /* __LINUX_NL80211_H */
Modified: iw/trunk/phy.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/phy.c?rev=1297&op=diff
==============================================================================
--- iw/trunk/phy.c (original)
+++ iw/trunk/phy.c Tue Dec 9 18:06:18 2008
@@ -1,3 +1,4 @@
+#include <stdbool.h>
#include <errno.h>
#include <net/if.h>
@@ -24,3 +25,64 @@
return -ENOBUFS;
}
COMMAND(set, name, "<new name>", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_name);
+
+static int handle_freqchan(struct nl_msg *msg, bool chan,
+ int argc, char **argv)
+{
+ static const struct {
+ const char *name;
+ unsigned int val;
+ } htmap[] = {
+ { .name = "HT20", .val = NL80211_SEC_CHAN_DISABLED, },
+ { .name = "HT40+", .val = NL80211_SEC_CHAN_ABOVE, },
+ { .name = "HT40-", .val = NL80211_SEC_CHAN_BELOW, },
+ };
+ unsigned int htval = NL80211_SEC_CHAN_NO_HT;
+ unsigned int freq;
+ int i;
+
+ if (!argc || argc > 2)
+ return 1;
+
+ if (argc == 2) {
+ for (i = 0; i < ARRAY_SIZE(htmap); i++) {
+ if (strcasecmp(htmap[i].name, argv[1]) == 0) {
+ htval = htmap[i].val;
+ break;
+ }
+ }
+ if (htval == NL80211_SEC_CHAN_NO_HT)
+ return 1;
+ }
+
+ freq = strtoul(argv[0], NULL, 10);
+ if (chan)
+ freq = ieee80211_channel_to_frequency(freq);
+
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, htval);
+
+ return 0;
+ nla_put_failure:
+ return -ENOBUFS;
+}
+
+static int handle_freq(struct nl_cb *cb, struct nl_msg *msg,
+ int argc, char **argv)
+{
+ return handle_freqchan(msg, false, argc, argv);
+}
+COMMAND(set, freq, "<freq> [HT20|HT40+|HT40-]",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq);
+COMMAND(set, freq, "<freq> [HT20|HT40+|HT40-]",
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq);
+
+static int handle_chan(struct nl_cb *cb, struct nl_msg *msg,
+ int argc, char **argv)
+{
+ return handle_freqchan(msg, true, argc, argv);
+}
+COMMAND(set, channel, "<channel> [HT20|HT40+|HT40-]",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_chan);
+COMMAND(set, channel, "<channel> [HT20|HT40+|HT40-]",
+ NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_chan);
Modified: iw/trunk/util.c
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/util.c?rev=1297&op=diff
==============================================================================
--- iw/trunk/util.c (original)
+++ iw/trunk/util.c Tue Dec 9 18:06:18 2008
@@ -65,3 +65,27 @@
sprintf(modebuf, "Unknown mode (%d)", iftype);
return modebuf;
}
+
+int ieee80211_channel_to_frequency(int chan)
+{
+ if (chan < 14)
+ return 2407 + chan * 5;
+
+ if (chan == 14)
+ return 2484;
+
+ /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */
+ return (chan + 1000) * 5;
+}
+
+int ieee80211_frequency_to_channel(int freq)
+{
+ if (freq == 2484)
+ return 14;
+
+ if (freq < 2484)
+ return (freq - 2407) / 5;
+
+ /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */
+ return freq/5 - 1000;
+}
Modified: iw/trunk/version.sh
URL: http://svn.debian.org/wsvn/pkg-wpa/iw/trunk/version.sh?rev=1297&op=diff
==============================================================================
--- iw/trunk/version.sh (original)
+++ iw/trunk/version.sh Tue Dec 9 18:06:18 2008
@@ -1,6 +1,6 @@
#!/bin/sh
-VERSION="0.9.6"
+VERSION="0.9.7"
OUT="version.h"
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
More information about the Pkg-wpa-devel
mailing list