]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
Merge branch 'master' into scan-test
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 8 Dec 2008 11:56:39 +0000 (12:56 +0100)
committerJohannes Berg <johannes@sipsolutions.net>
Mon, 8 Dec 2008 11:56:39 +0000 (12:56 +0100)
Conflicts:
Makefile
nl80211.h

1  2 
Makefile
info.c
nl80211.h

diff --combined Makefile
index 0f3d427fb7e72f3b68faa6773097c6e3f9dd5c94,df59b5101cacbdd3a771a0a4d198051b781b0c4a..4a949643f767d36ddc02956157e89a530d17a37f
+++ b/Makefile
@@@ -2,16 -2,20 +2,20 @@@
  
  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`
  NLVERSION = 1.0
  
- OBJS = iw.o info.o phy.o interface.o station.o util.o mpath.o reg.o mesh.o scan.o
 -OBJS = iw.o info.o phy.o interface.o station.o util.o mpath.o reg.o mesh.o genl.o
++OBJS = iw.o info.o phy.o interface.o station.o util.o mpath.o reg.o mesh.o genl.o scan.o
  ALL = iw
  
  ifeq ($(V),1)
@@@ -49,11 -53,11 +53,11 @@@ check
  
  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
diff --combined info.c
index 1079d2f0738b5563d2ca770f605e7f55e522577f,cbc3086df148aac1668ab837f9e88cd56a61d96d..7fb96ac76c5689e6020bc7082604bc7af74648f1
--- 1/info.c
--- 2/info.c
+++ b/info.c
@@@ -16,7 -16,7 +16,7 @@@ static void print_flag(const char *name
                printf(" (");
        else
                printf(", ");
-       printf(name);
+       printf("%s", name);
        *open = 1;
  }
  
@@@ -34,6 -34,7 +34,7 @@@ static int print_phy_handler(struct nl_
                [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];
                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);
                }
        }
  
 +      if (tb_msg[NL80211_ATTR_MAX_NUM_SCAN_SSIDS])
 +              printf("\tmax # scan SSIDs: %d\n",
 +                     nla_get_u8(tb_msg[NL80211_ATTR_MAX_NUM_SCAN_SSIDS]));
 +
        if (!tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES])
                return NL_SKIP;
  
diff --combined nl80211.h
index 2929d46033487874bb5e5afdb5ce2de0b64578e5,04d4516f9c712e91f4aaf541015c93d61abd9b25..1f60a24ea4dd1b9f7ab60318bcfee5403057f2e8
+++ b/nl80211.h
@@@ -3,7 -3,26 +3,26 @@@
  /*
   * 802.11 netlink interface public header
   *
-  * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
+  * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net>
+  * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
+  * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
+  * Copyright 2008 Michael Buesch <mb@bu3sch.de>
+  * Copyright 2008 Luis R. Rodriguez <lrodriguez@atheros.com>
+  * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
+  * Copyright 2008 Colin McCabe <colin@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.
+  *
   */
  
  /**
   *
   * @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.
   * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the
   *      interface identified by %NL80211_ATTR_IFINDEX
   *
 + * @NL80211_CMD_GET_SCAN: get scan results
 + * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
 + * @NL80211_CMD_NEW_SCAN: scan notification (as a reply to NL80211_CMD_GET_SCAN
 + *    and on the "scan" multicast group)
 + *
   * @NL80211_CMD_MAX: highest used command number
   * @__NL80211_CMD_AFTER_LAST: internal use
   */
@@@ -162,10 -178,6 +183,10 @@@ enum nl80211_commands 
        NL80211_CMD_GET_MESH_PARAMS,
        NL80211_CMD_SET_MESH_PARAMS,
  
 +      NL80211_CMD_GET_SCAN,
 +      NL80211_CMD_TRIGGER_SCAN,
 +      NL80211_CMD_NEW_SCAN,
 +
        /* add new commands above here */
  
        /* used to define NL80211_CMD_MAX below */
   * @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
   *    (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)
   *    supported interface types, each a flag attribute with the number
   *    of the interface mode.
   *
 + * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
 + *    a single scan request, a wiphy attribute.
 + *
 + * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies
 + * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs
 + * @NL80211_ATTR_BSS: scan result BSS
 + *
   * @NL80211_ATTR_MAX: highest attribute number currently defined
   * @__NL80211_ATTR_AFTER_LAST: internal use
   */
@@@ -323,13 -340,12 +356,19 @@@ enum nl80211_attrs 
  
        NL80211_ATTR_MESH_PARAMS,
  
+       NL80211_ATTR_BSS_BASIC_RATES,
+       NL80211_ATTR_WIPHY_TXQ_PARAMS,
+       NL80211_ATTR_WIPHY_FREQ,
+       NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET,
 +      NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
 +
 +      NL80211_ATTR_SCAN_FREQUENCIES,
 +      NL80211_ATTR_SCAN_SSIDS,
 +      NL80211_ATTR_SCAN_GENERATION,
 +      NL80211_ATTR_BSS,
 +
        /* add attributes here, update the policy in nl80211.c */
  
        __NL80211_ATTR_AFTER_LAST,
   * 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
@@@ -520,6 -540,8 +563,8 @@@ enum nl80211_band_attr 
   *    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,
        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
   * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
@@@ -715,18 -740,44 +763,59 @@@ enum nl80211_meshconf_params 
        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+ */
+ };
++
 +enum nl80211_bss {
 +      __NL80211_BSS_INVALID,
 +      NL80211_BSS_BSSID,
 +      NL80211_BSS_FREQUENCY,
 +      NL80211_BSS_TSF,
 +      NL80211_BSS_BEACON_INTERVAL,
 +      NL80211_BSS_CAPABILITY,
 +      NL80211_BSS_INFORMATION_ELEMENTS,
 +
 +      /* keep last */
 +      __NL80211_BSS_AFTER_LAST,
 +      NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
 +};
 +
  #endif /* __LINUX_NL80211_H */