[pkg-wpa-devel] r1346 - in /iw/branches/upstream/current: info.c iw.8 iw.c nl80211.h version.sh
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Fri Mar 27 17:13:45 UTC 2009
Author: kelmo-guest
Date: Fri Mar 27 17:13:45 2009
New Revision: 1346
URL: http://svn.debian.org/wsvn/?sc=1&rev=1346
Log:
[svn-upgrade] Integrating new upstream version, iw (0.9.11)
Modified:
iw/branches/upstream/current/info.c
iw/branches/upstream/current/iw.8
iw/branches/upstream/current/iw.c
iw/branches/upstream/current/nl80211.h
iw/branches/upstream/current/version.sh
Modified: iw/branches/upstream/current/info.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/info.c?rev=1346&op=diff
==============================================================================
--- iw/branches/upstream/current/info.c (original)
+++ iw/branches/upstream/current/info.c Fri Mar 27 17:13:45 2009
@@ -54,7 +54,6 @@
[NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
- [NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH] = { .type = NLA_U32 },
};
struct nlattr *tb_rate[NL80211_BITRATE_ATTR_MAX + 1];
@@ -206,19 +205,9 @@
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_DISABLED]) {
- bool set_freq_pow_bw = false;
- if (tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]) {
- printf(" (%.1f dBm", 0.01 * nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]));
- set_freq_pow_bw = true;
- }
- if (tb_freq[NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH]) {
- printf(" / %d MHz", nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH]));
- set_freq_pow_bw = true;
- }
- if (set_freq_pow_bw)
- printf(")");
- }
+ 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]) {
Modified: iw/branches/upstream/current/iw.8
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/iw.8?rev=1346&op=diff
==============================================================================
--- iw/branches/upstream/current/iw.8 (original)
+++ iw/branches/upstream/current/iw.8 Fri Mar 27 17:13:45 2009
@@ -41,7 +41,10 @@
.TP
.B phy <phy name>
-- wireless hardware device.
+- wireless hardware device (by name).
+.TP
+.B phy#<phy index>
+- wireless hardware device (by index).
.TP
.B reg
Modified: iw/branches/upstream/current/iw.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/iw.c?rev=1346&op=diff
==============================================================================
--- iw/branches/upstream/current/iw.c (original)
+++ iw/branches/upstream/current/iw.c Fri Mar 27 17:13:45 2009
@@ -149,6 +149,8 @@
snprintf(buf, sizeof(buf), "/sys/class/ieee80211/%s/index", name);
fd = open(buf, O_RDONLY);
+ if (fd < 0)
+ return -1;
pos = read(fd, buf, sizeof(buf) - 1);
if (pos < 0)
return -1;
@@ -178,8 +180,15 @@
return NL_STOP;
}
+enum id_input {
+ II_NONE,
+ II_NETDEV,
+ II_PHY_NAME,
+ II_PHY_IDX,
+};
+
static int handle_cmd(struct nl80211_state *state,
- enum command_identify_by idby,
+ enum id_input idby,
int argc, char **argv)
{
struct cmd *cmd;
@@ -188,24 +197,41 @@
int devidx = 0;
int err;
const char *command, *section;
-
- if (argc <= 1 && idby != CIB_NONE)
+ char *tmp;
+ enum command_identify_by command_idby = CIB_NONE;
+
+ if (argc <= 1 && idby != II_NONE)
return 1;
switch (idby) {
- case CIB_PHY:
+ case II_PHY_IDX:
+ command_idby = CIB_PHY;
+ devidx = strtoul(*argv + 4, &tmp, 0);
+ if (*tmp != '\0')
+ return 1;
+ argc--;
+ argv++;
+ break;
+ case II_PHY_NAME:
+ command_idby = CIB_PHY;
devidx = phy_lookup(*argv);
argc--;
argv++;
break;
- case CIB_NETDEV:
+ case II_NETDEV:
+ command_idby = CIB_NETDEV;
devidx = if_nametoindex(*argv);
+ if (devidx == 0)
+ devidx = -1;
argc--;
argv++;
break;
default:
break;
}
+
+ if (devidx < 0)
+ return -errno;
section = command = *argv;
argc--;
@@ -215,7 +241,7 @@
cmd = (struct cmd *)((char *)cmd + cmd_size)) {
if (!cmd->handler)
continue;
- if (cmd->idby != idby)
+ if (cmd->idby != command_idby)
continue;
if (cmd->section) {
if (strcmp(cmd->section, section))
@@ -256,7 +282,7 @@
genlmsg_put(msg, 0, 0, genl_family_get_id(state->nl80211), 0,
cmd->nl_msg_flags, cmd->cmd, 0);
- switch (idby) {
+ switch (command_idby) {
case CIB_PHY:
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, devidx);
break;
@@ -454,13 +480,18 @@
} else if (strcmp(*argv, "dev") == 0) {
argc--;
argv++;
- err = handle_cmd(&nlstate, CIB_NETDEV, argc, argv);
- } else if (strcmp(*argv, "phy") == 0) {
- argc--;
- argv++;
- err = handle_cmd(&nlstate, CIB_PHY, argc, argv);
+ err = handle_cmd(&nlstate, II_NETDEV, argc, argv);
+ } else if (strncmp(*argv, "phy", 3) == 0) {
+ if (strlen(*argv) == 3) {
+ argc--;
+ argv++;
+ err = handle_cmd(&nlstate, II_PHY_NAME, argc, argv);
+ } else if (*(*argv + 3) == '#')
+ err = handle_cmd(&nlstate, II_PHY_IDX, argc, argv);
+ else
+ err = 1;
} else
- err = handle_cmd(&nlstate, CIB_NONE, argc, argv);
+ err = handle_cmd(&nlstate, II_NONE, argc, argv);
if (err == 1)
usage(argv0);
Modified: iw/branches/upstream/current/nl80211.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/nl80211.h?rev=1346&op=diff
==============================================================================
--- iw/branches/upstream/current/nl80211.h (original)
+++ iw/branches/upstream/current/nl80211.h Fri Mar 27 17:13:45 2009
@@ -664,7 +664,6 @@
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
* (100 * dBm).
- * @NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH: max bandwidth allowed, given in MHz
*/
enum nl80211_frequency_attr {
__NL80211_FREQUENCY_ATTR_INVALID,
@@ -674,7 +673,6 @@
NL80211_FREQUENCY_ATTR_NO_IBSS,
NL80211_FREQUENCY_ATTR_RADAR,
NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
- NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
@@ -682,7 +680,6 @@
};
#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
-#define NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH NL80211_FREQUENCY_ATTR_MAX_BANDWIDTH
/**
* enum nl80211_bitrate_attr - bitrate attributes
Modified: iw/branches/upstream/current/version.sh
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/version.sh?rev=1346&op=diff
==============================================================================
--- iw/branches/upstream/current/version.sh (original)
+++ iw/branches/upstream/current/version.sh Fri Mar 27 17:13:45 2009
@@ -1,6 +1,6 @@
#!/bin/sh
-VERSION="0.9.10"
+VERSION="0.9.11"
OUT="version.h"
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
More information about the Pkg-wpa-devel
mailing list