Changeset 30682


Ignore:
Timestamp:
2012-02-22T14:39:16+01:00 (6 years ago)
Author:
jow
Message:

[package] iwinfo: add per-station rate and mcs info to assoclist op

Location:
trunk/package/iwinfo
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/iwinfo/Makefile

    r30663 r30682  
    88 
    99PKG_NAME:=libiwinfo 
    10 PKG_RELEASE:=28 
     10PKG_RELEASE:=29 
    1111 
    1212PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) 
  • trunk/package/iwinfo/src/include/iwinfo.h

    r30605 r30682  
    5050 
    5151 
     52struct iwinfo_rate_entry { 
     53        uint16_t rate; 
     54        uint8_t mcs; 
     55        uint8_t is_40mhz:1; 
     56        uint8_t is_short_gi:1; 
     57}; 
     58 
    5259struct iwinfo_assoclist_entry { 
    5360        uint8_t mac[6]; 
    5461        int8_t signal; 
    5562        int8_t noise; 
     63        uint32_t inactive; 
     64        uint32_t rx_packets; 
     65        uint32_t tx_packets; 
     66        struct iwinfo_rate_entry rx_rate; 
     67        struct iwinfo_rate_entry tx_rate; 
    5668}; 
    5769 
  • trunk/package/iwinfo/src/include/iwinfo/api/broadcom.h

    r29403 r30682  
    6565} wl_sta_rssi_t; 
    6666 
     67#define WL_NUMRATES     255 /* max # of rates in a rateset */ 
     68typedef struct wl_rateset { 
     69    uint32_t                            count;          /* # rates in this set */ 
     70    uint8_t                             rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */ 
     71} wl_rateset_t; 
     72 
     73typedef struct wl_sta_info { 
     74    uint16_t                            ver;        /* version of this struct */ 
     75    uint16_t                            len;        /* length in bytes of this structure */ 
     76    uint16_t                            cap;        /* sta's advertised capabilities */ 
     77    uint32_t                            flags;      /* flags defined below */ 
     78    uint32_t                            idle;       /* time since data pkt rx'd from sta */ 
     79    unsigned char                       ea[6];      /* Station address */ 
     80    wl_rateset_t                        rateset;    /* rateset in use */ 
     81    uint32_t                            in;             /* seconds elapsed since associated */ 
     82    uint32_t                            listen_interval_inms; /* Min Listen interval in ms for this STA */ 
     83    uint32_t                            tx_pkts;    /* # of packets transmitted */ 
     84    uint32_t                            tx_failures;    /* # of packets failed */ 
     85    uint32_t                            rx_ucast_pkts;  /* # of unicast packets received */ 
     86    uint32_t                            rx_mcast_pkts;  /* # of multicast packets received */ 
     87    uint32_t                            tx_rate;    /* Rate of last successful tx frame */ 
     88    uint32_t                            rx_rate;    /* Rate of last successful rx frame */ 
     89} wl_sta_info_t; 
     90 
    6791typedef struct wlc_ssid { 
    6892        uint32_t                                ssid_len; 
  • trunk/package/iwinfo/src/include/iwinfo/api/madwifi.h

    r29403 r30682  
    2323 
    2424/* ieee80211.h */ 
    25 #define IEEE80211_ADDR_LEN              6 
    26 #define IEEE80211_RATE_VAL              0x7f 
     25#define IEEE80211_ADDR_LEN                      6 
     26#define IEEE80211_RATE_VAL                      0x7f 
     27#define IEEE80211_SEQ_SEQ_MASK          0xfff0 
     28#define IEEE80211_SEQ_SEQ_SHIFT         4 
    2729 
    2830 
  • trunk/package/iwinfo/src/include/iwinfo/api/nl80211.h

    r29403 r30682  
    77 * Copyright 2008 Michael Wu <flamingice@sourmilk.net> 
    88 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> 
    9  * Copyright 2008 Michael Buesch <mb@bu3sch.de> 
     9 * Copyright 2008 Michael Buesch <m@bues.ch> 
    1010 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com> 
    1111 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> 
     
    7575 * For more technical details, see the corresponding command descriptions 
    7676 * below. 
     77 */ 
     78 
     79/** 
     80 * DOC: Virtual interface / concurrency capabilities 
     81 * 
     82 * Some devices are able to operate with virtual MACs, they can have 
     83 * more than one virtual interface. The capability handling for this 
     84 * is a bit complex though, as there may be a number of restrictions 
     85 * on the types of concurrency that are supported. 
     86 * 
     87 * To start with, each device supports the interface types listed in 
     88 * the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the 
     89 * types there no concurrency is implied. 
     90 * 
     91 * Once concurrency is desired, more attributes must be observed: 
     92 * To start with, since some interface types are purely managed in 
     93 * software, like the AP-VLAN type in mac80211 for example, there's 
     94 * an additional list of these, they can be added at any time and 
     95 * are only restricted by some semantic restrictions (e.g. AP-VLAN 
     96 * cannot be added without a corresponding AP interface). This list 
     97 * is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute. 
     98 * 
     99 * Further, the list of supported combinations is exported. This is 
     100 * in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically, 
     101 * it exports a list of "groups", and at any point in time the 
     102 * interfaces that are currently active must fall into any one of 
     103 * the advertised groups. Within each group, there are restrictions 
     104 * on the number of interfaces of different types that are supported 
     105 * and also the number of different channels, along with potentially 
     106 * some other restrictions. See &enum nl80211_if_combination_attrs. 
     107 * 
     108 * All together, these attributes define the concurrency of virtual 
     109 * interfaces that a given device supports. 
    77110 */ 
    78111 
     
    129162 *      using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, 
    130163 *      %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. 
     164 *      Following attributes are provided for drivers that generate full Beacon 
     165 *      and Probe Response frames internally: %NL80211_ATTR_SSID, 
     166 *      %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, 
     167 *      %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, 
     168 *      %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 
     169 *      %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP, 
     170 *      %NL80211_ATTR_IE_ASSOC_RESP. 
    131171 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, 
    132172 *      parameters are like for %NL80211_CMD_SET_BEACON. 
     
    149189 *      destination %NL80211_ATTR_MAC on the interface identified by 
    150190 *      %NL80211_ATTR_IFINDEX. 
     191 * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by 
     192 *      %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP. 
     193 * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by 
     194 *      %NL80211_ATTR_MAC. 
    151195 * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the 
    152196 *      the interface identified by %NL80211_ATTR_IFINDEX. 
     
    173217 *      store this as a valid request and then query userspace for it. 
    174218 * 
    175  * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the 
     219 * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the 
    176220 *      interface identified by %NL80211_ATTR_IFINDEX 
    177221 * 
    178  * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the 
     222 * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the 
    179223 *      interface identified by %NL80211_ATTR_IFINDEX 
    180224 * 
     
    195239 * @NL80211_CMD_GET_SCAN: get scan results 
    196240 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters 
     241 *      %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the 
     242 *      probe requests at CCK rate or not. 
    197243 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to 
    198244 *      NL80211_CMD_GET_SCAN and on the "scan" multicast group) 
    199245 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, 
    200246 *      partial scan results may be available 
     247 * 
     248 * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain 
     249 *      intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL. 
     250 *      Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) 
     251 *      are passed, they are used in the probe requests.  For 
     252 *      broadcast, a broadcast SSID must be passed (ie. an empty 
     253 *      string).  If no SSID is passed, no probe requests are sent and 
     254 *      a passive scan is performed.  %NL80211_ATTR_SCAN_FREQUENCIES, 
     255 *      if passed, define which channels should be scanned; if not 
     256 *      passed, all channels allowed for the current regulatory domain 
     257 *      are used.  Extra IEs can also be passed from the userspace by 
     258 *      using the %NL80211_ATTR_IE attribute. 
     259 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan.  Returns -ENOENT 
     260 *      if scheduled scan is not running. 
     261 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan 
     262 *      results available. 
     263 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has 
     264 *      stopped.  The driver may issue this event at any time during a 
     265 *      scheduled scan.  One reason for stopping the scan is if the hardware 
     266 *      does not support starting an association or a normal scan while running 
     267 *      a scheduled scan.  This event is also sent when the 
     268 *      %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface 
     269 *      is brought down while a scheduled scan was running. 
    201270 * 
    202271 * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation 
     
    359428 *      frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 
    360429 *      optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on 
    361  *      which channel the frame is to be transmitted or was received. This 
    362  *      channel has to be the current channel (remain-on-channel or the 
    363  *      operational channel). When called, this operation returns a cookie 
    364  *      (%NL80211_ATTR_COOKIE) that will be included with the TX status event 
    365  *      pertaining to the TX request. 
     430 *      which channel the frame is to be transmitted or was received. If this 
     431 *      channel is not the current channel (remain-on-channel or the 
     432 *      operational channel) the device will switch to the given channel and 
     433 *      transmit the frame, optionally waiting for a response for the time 
     434 *      specified using %NL80211_ATTR_DURATION. When called, this operation 
     435 *      returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the 
     436 *      TX status event pertaining to the TX request. 
     437 *      %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the 
     438 *      management frames at CCK rate or not in 2GHz band. 
     439 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this 
     440 *      command may be used with the corresponding cookie to cancel the wait 
     441 *      time if it is known that it is no longer necessary. 
    366442 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility. 
    367443 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame 
     
    390466 * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. 
    391467 * 
     468 * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial 
     469 *      mesh config parameters may be given. 
     470 * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the 
     471 *      network is determined by the network interface. 
     472 * 
     473 * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame 
     474 *      notification. This event is used to indicate that an unprotected 
     475 *      deauthentication frame was dropped when MFP is in use. 
     476 * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame 
     477 *      notification. This event is used to indicate that an unprotected 
     478 *      disassociation frame was dropped when MFP is in use. 
     479 * 
     480 * @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a 
     481 *      beacon or probe response from a compatible mesh peer.  This is only 
     482 *      sent while no station information (sta_info) exists for the new peer 
     483 *      candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH is set.  On 
     484 *      reception of this notification, userspace may decide to create a new 
     485 *      station (@NL80211_CMD_NEW_STATION).  To stop this notification from 
     486 *      reoccurring, the userspace authentication daemon may want to create the 
     487 *      new station with the AUTHENTICATED flag unset and maybe change it later 
     488 *      depending on the authentication result. 
     489 * 
     490 * @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings. 
     491 * @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings. 
     492 *      Since wireless is more complex than wired ethernet, it supports 
     493 *      various triggers. These triggers can be configured through this 
     494 *      command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For 
     495 *      more background information, see 
     496 *      http://wireless.kernel.org/en/users/Documentation/WoWLAN. 
     497 * 
     498 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver 
     499 *      the necessary information for supporting GTK rekey offload. This 
     500 *      feature is typically used during WoWLAN. The configuration data 
     501 *      is contained in %NL80211_ATTR_REKEY_DATA (which is nested and 
     502 *      contains the data in sub-attributes). After rekeying happened, 
     503 *      this command may also be sent by the driver as an MLME event to 
     504 *      inform userspace of the new replay counter. 
     505 * 
     506 * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace 
     507 *      of PMKSA caching dandidates. 
     508 * 
     509 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). 
     510 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. 
     511 * 
     512 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP 
     513 *      (or GO) interface (i.e. hostapd) to ask for unexpected frames to 
     514 *      implement sending deauth to stations that send unexpected class 3 
     515 *      frames. Also used as the event sent by the kernel when such a frame 
     516 *      is received. 
     517 *      For the event, the %NL80211_ATTR_MAC attribute carries the TA and 
     518 *      other attributes like the interface index are present. 
     519 *      If used as the command it must have an interface index and you can 
     520 *      only unsubscribe from the event by closing the socket. Subscription 
     521 *      is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events. 
     522 * 
     523 * @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the 
     524 *      associated station identified by %NL80211_ATTR_MAC sent a 4addr frame 
     525 *      and wasn't already in a 4-addr VLAN. The event will be sent similarly 
     526 *      to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener. 
     527 * 
     528 * @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface 
     529 *      by sending a null data frame to it and reporting when the frame is 
     530 *      acknowleged. This is used to allow timing out inactive clients. Uses 
     531 *      %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a 
     532 *      direct reply with an %NL80211_ATTR_COOKIE that is later used to match 
     533 *      up the event with the request. The event includes the same data and 
     534 *      has %NL80211_ATTR_ACK set if the frame was ACKed. 
     535 * 
     536 * @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from 
     537 *      other BSSes when any interfaces are in AP mode. This helps implement 
     538 *      OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME 
     539 *      messages. Note that per PHY only one application may register. 
     540 * 
     541 * @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether 
     542 *      No Acknowledgement Policy should be applied. 
     543 * 
    392544 * @NL80211_CMD_MAX: highest used command number 
    393545 * @__NL80211_CMD_AFTER_LAST: internal use 
    394546 */ 
    395547enum nl80211_commands { 
    396 /* don't change the order or add anything inbetween, this is ABI! */ 
     548/* don't change the order or add anything between, this is ABI! */ 
    397549        NL80211_CMD_UNSPEC, 
    398550 
     
    432584        NL80211_CMD_REQ_SET_REG, 
    433585 
    434         NL80211_CMD_GET_MESH_PARAMS, 
    435         NL80211_CMD_SET_MESH_PARAMS, 
     586        NL80211_CMD_GET_MESH_CONFIG, 
     587        NL80211_CMD_SET_MESH_CONFIG, 
    436588 
    437589        NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */, 
     
    493645        NL80211_CMD_SET_CHANNEL, 
    494646        NL80211_CMD_SET_WDS_PEER, 
     647 
     648        NL80211_CMD_FRAME_WAIT_CANCEL, 
     649 
     650        NL80211_CMD_JOIN_MESH, 
     651        NL80211_CMD_LEAVE_MESH, 
     652 
     653        NL80211_CMD_UNPROT_DEAUTHENTICATE, 
     654        NL80211_CMD_UNPROT_DISASSOCIATE, 
     655 
     656        NL80211_CMD_NEW_PEER_CANDIDATE, 
     657 
     658        NL80211_CMD_GET_WOWLAN, 
     659        NL80211_CMD_SET_WOWLAN, 
     660 
     661        NL80211_CMD_START_SCHED_SCAN, 
     662        NL80211_CMD_STOP_SCHED_SCAN, 
     663        NL80211_CMD_SCHED_SCAN_RESULTS, 
     664        NL80211_CMD_SCHED_SCAN_STOPPED, 
     665 
     666        NL80211_CMD_SET_REKEY_OFFLOAD, 
     667 
     668        NL80211_CMD_PMKSA_CANDIDATE, 
     669 
     670        NL80211_CMD_TDLS_OPER, 
     671        NL80211_CMD_TDLS_MGMT, 
     672 
     673        NL80211_CMD_UNEXPECTED_FRAME, 
     674 
     675        NL80211_CMD_PROBE_CLIENT, 
     676 
     677        NL80211_CMD_REGISTER_BEACONS, 
     678 
     679        NL80211_CMD_UNEXPECTED_4ADDR_FRAME, 
     680 
     681        NL80211_CMD_SET_NOACK_MAP, 
    495682 
    496683        /* add new commands above here */ 
     
    513700#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE 
    514701#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT 
     702 
     703#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS 
     704 
     705/* source-level API compatibility */ 
     706#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG 
     707#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG 
     708#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE 
    515709 
    516710/** 
     
    584778 * 
    585779 * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). 
    586  * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link. 
     780 * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link. 
    587781 * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. 
    588782 * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path 
     
    629823 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with 
    630824 *      a single scan request, a wiphy attribute. 
     825 * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can 
     826 *      scan with a single scheduled scan request, a wiphy attribute. 
    631827 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements 
    632828 *      that can be added to a scan request 
     829 * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information 
     830 *      elements that can be added to a scheduled scan request 
     831 * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be 
     832 *      used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute. 
    633833 * 
    634834 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) 
     
    711911 *      event (u16) 
    712912 * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating 
    713  *      that protected APs should be used. 
    714  * 
    715  * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to 
    716  *      indicate which unicast key ciphers will be used with the connection 
     913 *      that protected APs should be used. This is also used with NEW_BEACON to 
     914 *      indicate that the BSS is to use protection. 
     915 * 
     916 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON 
     917 *      to indicate which unicast key ciphers will be used with the connection 
    717918 *      (an array of u32). 
    718  * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate 
    719  *      which group key cipher will be used with the connection (a u32). 
    720  * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate 
    721  *      which WPA version(s) the AP we want to associate with is using 
     919 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to 
     920 *      indicate which group key cipher will be used with the connection (a 
     921 *      u32). 
     922 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to 
     923 *      indicate which WPA version(s) the AP we want to associate with is using 
    722924 *      (a u32 with flags from &enum nl80211_wpa_versions). 
    723  * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate 
    724  *      which key management algorithm(s) to use (an array of u32). 
     925 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to 
     926 *      indicate which key management algorithm(s) to use (an array of u32). 
    725927 * 
    726928 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as 
     
    759961 * 
    760962 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. 
     963 * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that 
     964 *      specifies the maximum duration that can be requested with the 
     965 *      remain-on-channel operation, in milliseconds, u32. 
    761966 * 
    762967 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. 
     
    8051010 *      means support for per-station GTKs. 
    8061011 * 
     1012 * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting. 
     1013 *      This can be used to mask out antennas which are not attached or should 
     1014 *      not be used for transmitting. If an antenna is not selected in this 
     1015 *      bitmap the hardware is not allowed to transmit on this antenna. 
     1016 * 
     1017 *      Each bit represents one antenna, starting with antenna 1 at the first 
     1018 *      bit. Depending on which antennas are selected in the bitmap, 802.11n 
     1019 *      drivers can derive which chainmasks to use (if all antennas belonging to 
     1020 *      a particular chain are disabled this chain should be disabled) and if 
     1021 *      a chain has diversity antennas wether diversity should be used or not. 
     1022 *      HT capabilities (STBC, TX Beamforming, Antenna selection) can be 
     1023 *      derived from the available chains after applying the antenna mask. 
     1024 *      Non-802.11n drivers can derive wether to use diversity or not. 
     1025 *      Drivers may reject configurations or RX/TX mask combinations they cannot 
     1026 *      support by returning -EINVAL. 
     1027 * 
     1028 * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving. 
     1029 *      This can be used to mask out antennas which are not attached or should 
     1030 *      not be used for receiving. If an antenna is not selected in this bitmap 
     1031 *      the hardware should not be configured to receive on this antenna. 
     1032 *      For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX. 
     1033 * 
     1034 * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available 
     1035 *      for configuration as TX antennas via the above parameters. 
     1036 * 
     1037 * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available 
     1038 *      for configuration as RX antennas via the above parameters. 
     1039 * 
    8071040 * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS 
     1041 * 
     1042 * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be 
     1043 *      transmitted on another channel when the channel given doesn't match 
     1044 *      the current channel. If the current channel doesn't match and this 
     1045 *      flag isn't set, the frame will be rejected. This is also used as an 
     1046 *      nl80211 capability flag. 
     1047 * 
     1048 * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) 
     1049 * 
     1050 * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags 
     1051 *      attributes, specifying what a key should be set as default as. 
     1052 *      See &enum nl80211_key_default_types. 
     1053 * 
     1054 * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters.  These cannot be 
     1055 *      changed once the mesh is active. 
     1056 * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute 
     1057 *      containing attributes from &enum nl80211_meshconf_params. 
     1058 * @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver 
     1059 *      allows auth frames in a mesh to be passed to userspace for processing via 
     1060 *      the @NL80211_MESH_SETUP_USERSPACE_AUTH flag. 
     1061 * @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as 
     1062 *      defined in &enum nl80211_plink_state. Used when userspace is 
     1063 *      driving the peer link management state machine. 
     1064 *      @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. 
     1065 * 
     1066 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy 
     1067 *      capabilities, the supported WoWLAN triggers 
     1068 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to 
     1069 *      indicate which WoW triggers should be enabled. This is also 
     1070 *      used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN 
     1071 *      triggers. 
     1072 
     1073 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan 
     1074 *      cycles, in msecs. 
     1075 
     1076 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more 
     1077 *      sets of attributes to match during scheduled scans.  Only BSSs 
     1078 *      that match any of the sets will be reported.  These are 
     1079 *      pass-thru filter rules. 
     1080 *      For a match to succeed, the BSS must match all attributes of a 
     1081 *      set.  Since not every hardware supports matching all types of 
     1082 *      attributes, there is no guarantee that the reported BSSs are 
     1083 *      fully complying with the match sets and userspace needs to be 
     1084 *      able to ignore them by itself. 
     1085 *      Thus, the implementation is somewhat hardware-dependent, but 
     1086 *      this is only an optimization and the userspace application 
     1087 *      needs to handle all the non-filtered results anyway. 
     1088 *      If the match attributes don't make sense when combined with 
     1089 *      the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID 
     1090 *      is included in the probe request, but the match attributes 
     1091 *      will never let it go through), -EINVAL may be returned. 
     1092 *      If ommited, no filtering is done. 
     1093 * 
     1094 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported 
     1095 *      interface combinations. In each nested item, it contains attributes 
     1096 *      defined in &enum nl80211_if_combination_attrs. 
     1097 * @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like 
     1098 *      %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that 
     1099 *      are managed in software: interfaces of these types aren't subject to 
     1100 *      any restrictions in their number or combinations. 
     1101 * 
     1102 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information 
     1103 *      necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. 
     1104 * 
     1105 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, 
     1106 *      nested array attribute containing an entry for each band, with the entry 
     1107 *      being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but 
     1108 *      without the length restriction (at most %NL80211_MAX_SUPP_RATES). 
     1109 * 
     1110 * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon 
     1111 *      and Probe Response (when response to wildcard Probe Request); see 
     1112 *      &enum nl80211_hidden_ssid, represented as a u32 
     1113 * 
     1114 * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame. 
     1115 *      This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to 
     1116 *      provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the 
     1117 *      driver (or firmware) replies to Probe Request frames. 
     1118 * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association 
     1119 *      Response frames. This is used with %NL80211_CMD_NEW_BEACON and 
     1120 *      %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into 
     1121 *      (Re)Association Response frames when the driver (or firmware) replies to 
     1122 *      (Re)Association Request frames. 
     1123 * 
     1124 * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration 
     1125 *      of the station, see &enum nl80211_sta_wme_attr. 
     1126 * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working 
     1127 *      as AP. 
     1128 * 
     1129 * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of 
     1130 *      roaming to another AP in the same ESS if the signal lever is low. 
     1131 * 
     1132 * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching 
     1133 *      candidate information, see &enum nl80211_pmksa_candidate_attr. 
     1134 * 
     1135 * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not 
     1136 *      for management frames transmission. In order to avoid p2p probe/action 
     1137 *      frames are being transmitted at CCK rate in 2GHz band, the user space 
     1138 *      applications use this attribute. 
     1139 *      This attribute is used with %NL80211_CMD_TRIGGER_SCAN and 
     1140 *      %NL80211_CMD_FRAME commands. 
     1141 * 
     1142 * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup 
     1143 *      request, link setup confirm, link teardown, etc.). Values are 
     1144 *      described in the TDLS (802.11z) specification. 
     1145 * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a 
     1146 *      TDLS conversation between two devices. 
     1147 * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see 
     1148 *      &enum nl80211_tdls_operation, represented as a u8. 
     1149 * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate 
     1150 *      as a TDLS peer sta. 
     1151 * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown 
     1152 *      procedures should be performed by sending TDLS packets via 
     1153 *      %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be 
     1154 *      used for asking the driver to perform a TDLS operation. 
     1155 * 
     1156 * @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices 
     1157 *      that have AP support to indicate that they have the AP SME integrated 
     1158 *      with support for the features listed in this attribute, see 
     1159 *      &enum nl80211_ap_sme_features. 
     1160 * 
     1161 * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells 
     1162 *      the driver to not wait for an acknowledgement. Note that due to this, 
     1163 *      it will also not give a status callback nor return a cookie. This is 
     1164 *      mostly useful for probe responses to save airtime. 
     1165 * 
     1166 * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from 
     1167 *      &enum nl80211_feature_flags and is advertised in wiphy information. 
     1168 * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe 
     1169 * 
     1170 *      requests while operating in AP-mode. 
     1171 *      This attribute holds a bitmap of the supported protocols for 
     1172 *      offloading (see &enum nl80211_probe_resp_offload_support_attr). 
     1173 * 
     1174 * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire 
     1175 *      probe-response frame. The DA field in the 802.11 header is zero-ed out, 
     1176 *      to be filled by the FW. 
     1177 * @NL80211_ATTR_DISABLE_HT:  Force HT capable interfaces to disable 
     1178 *      this feature.  Currently, only supported in mac80211 drivers. 
     1179 * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the 
     1180 *      ATTR_HT_CAPABILITY to which attention should be paid. 
     1181 *      Currently, only mac80211 NICs support this feature. 
     1182 *      The values that may be configured are: 
     1183 *       MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40 
     1184 *       AMPDU density and AMPDU factor. 
     1185 *      All values are treated as suggestions and may be ignored 
     1186 *      by the driver as required.  The actual values may be seen in 
     1187 *      the station debugfs ht_caps file. 
     1188 * 
     1189 * @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country 
     1190 *    abides to when initiating radiation on DFS channels. A country maps 
     1191 *    to one DFS region. 
     1192 * 
     1193 * @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of 
     1194 *      up to 16 TIDs. 
    8081195 * 
    8091196 * @NL80211_ATTR_MAX: highest attribute number currently defined 
     
    8111198 */ 
    8121199enum nl80211_attrs { 
    813 /* don't change the order or add anything inbetween, this is ABI! */ 
     1200/* don't change the order or add anything between, this is ABI! */ 
    8141201        NL80211_ATTR_UNSPEC, 
    8151202 
     
    8611248        NL80211_ATTR_REG_RULES, 
    8621249 
    863         NL80211_ATTR_MESH_PARAMS, 
     1250        NL80211_ATTR_MESH_CONFIG, 
    8641251 
    8651252        NL80211_ATTR_BSS_BASIC_RATES, 
     
    9761363        NL80211_ATTR_SUPPORT_IBSS_RSN, 
    9771364 
     1365        NL80211_ATTR_WIPHY_ANTENNA_TX, 
     1366        NL80211_ATTR_WIPHY_ANTENNA_RX, 
     1367 
    9781368        NL80211_ATTR_MCAST_RATE, 
     1369 
     1370        NL80211_ATTR_OFFCHANNEL_TX_OK, 
     1371 
     1372        NL80211_ATTR_BSS_HT_OPMODE, 
     1373 
     1374        NL80211_ATTR_KEY_DEFAULT_TYPES, 
     1375 
     1376        NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION, 
     1377 
     1378        NL80211_ATTR_MESH_SETUP, 
     1379 
     1380        NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, 
     1381        NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, 
     1382 
     1383        NL80211_ATTR_SUPPORT_MESH_AUTH, 
     1384        NL80211_ATTR_STA_PLINK_STATE, 
     1385 
     1386        NL80211_ATTR_WOWLAN_TRIGGERS, 
     1387        NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, 
     1388 
     1389        NL80211_ATTR_SCHED_SCAN_INTERVAL, 
     1390 
     1391        NL80211_ATTR_INTERFACE_COMBINATIONS, 
     1392        NL80211_ATTR_SOFTWARE_IFTYPES, 
     1393 
     1394        NL80211_ATTR_REKEY_DATA, 
     1395 
     1396        NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS, 
     1397        NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN, 
     1398 
     1399        NL80211_ATTR_SCAN_SUPP_RATES, 
     1400 
     1401        NL80211_ATTR_HIDDEN_SSID, 
     1402 
     1403        NL80211_ATTR_IE_PROBE_RESP, 
     1404        NL80211_ATTR_IE_ASSOC_RESP, 
     1405 
     1406        NL80211_ATTR_STA_WME, 
     1407        NL80211_ATTR_SUPPORT_AP_UAPSD, 
     1408 
     1409        NL80211_ATTR_ROAM_SUPPORT, 
     1410 
     1411        NL80211_ATTR_SCHED_SCAN_MATCH, 
     1412        NL80211_ATTR_MAX_MATCH_SETS, 
     1413 
     1414        NL80211_ATTR_PMKSA_CANDIDATE, 
     1415 
     1416        NL80211_ATTR_TX_NO_CCK_RATE, 
     1417 
     1418        NL80211_ATTR_TDLS_ACTION, 
     1419        NL80211_ATTR_TDLS_DIALOG_TOKEN, 
     1420        NL80211_ATTR_TDLS_OPERATION, 
     1421        NL80211_ATTR_TDLS_SUPPORT, 
     1422        NL80211_ATTR_TDLS_EXTERNAL_SETUP, 
     1423 
     1424        NL80211_ATTR_DEVICE_AP_SME, 
     1425 
     1426        NL80211_ATTR_DONT_WAIT_FOR_ACK, 
     1427 
     1428        NL80211_ATTR_FEATURE_FLAGS, 
     1429 
     1430        NL80211_ATTR_PROBE_RESP_OFFLOAD, 
     1431 
     1432        NL80211_ATTR_PROBE_RESP, 
     1433 
     1434        NL80211_ATTR_DFS_REGION, 
     1435 
     1436        NL80211_ATTR_DISABLE_HT, 
     1437        NL80211_ATTR_HT_CAPABILITY_MASK, 
     1438 
     1439        NL80211_ATTR_NOACK_MAP, 
    9791440 
    9801441        /* add attributes here, update the policy in nl80211.c */ 
     
    9861447/* source-level API compatibility */ 
    9871448#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION 
     1449#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG 
    9881450 
    9891451/* 
     
    10111473#define NL80211_ATTR_KEY NL80211_ATTR_KEY 
    10121474#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS 
     1475#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS 
    10131476 
    10141477#define NL80211_MAX_SUPP_RATES                  32 
     1478#define NL80211_MAX_SUPP_HT_RATES               77 
    10151479#define NL80211_MAX_SUPP_REG_RULES              32 
    10161480#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY       0 
     
    10291493 * @NL80211_IFTYPE_STATION: managed BSS member 
    10301494 * @NL80211_IFTYPE_AP: access point 
    1031  * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points 
     1495 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces 
     1496 *      are a bit special in that they must always be tied to a pre-existing 
     1497 *      AP type interface. 
    10321498 * @NL80211_IFTYPE_WDS: wireless distribution interface 
    10331499 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 
     
    10711537 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 
    10721538 * @NL80211_STA_FLAG_MFP: station uses management frame protection 
     1539 * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated 
     1540 * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should 
     1541 *      only be used in managed mode (even in the flags mask). Note that the 
     1542 *      flag can't be changed, it is only valid while adding a station, and 
     1543 *      attempts to change it will silently be ignored (rather than rejected 
     1544 *      as errors.) 
    10731545 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined 
    10741546 * @__NL80211_STA_FLAG_AFTER_LAST: internal use 
     
    10801552        NL80211_STA_FLAG_WME, 
    10811553        NL80211_STA_FLAG_MFP, 
     1554        NL80211_STA_FLAG_AUTHENTICATED, 
     1555        NL80211_STA_FLAG_TDLS_PEER, 
    10821556 
    10831557        /* keep last */ 
     
    11251599 
    11261600/** 
     1601 * enum nl80211_sta_bss_param - BSS information collected by STA 
     1602 * 
     1603 * These attribute types are used with %NL80211_STA_INFO_BSS_PARAM 
     1604 * when getting information about the bitrate of a station. 
     1605 * 
     1606 * @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved 
     1607 * @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag) 
     1608 * @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE:  whether short preamble is enabled 
     1609 *      (flag) 
     1610 * @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME:  whether short slot time is enabled 
     1611 *      (flag) 
     1612 * @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8) 
     1613 * @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16) 
     1614 * @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined 
     1615 * @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use 
     1616 */ 
     1617enum nl80211_sta_bss_param { 
     1618        __NL80211_STA_BSS_PARAM_INVALID, 
     1619        NL80211_STA_BSS_PARAM_CTS_PROT, 
     1620        NL80211_STA_BSS_PARAM_SHORT_PREAMBLE, 
     1621        NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME, 
     1622        NL80211_STA_BSS_PARAM_DTIM_PERIOD, 
     1623        NL80211_STA_BSS_PARAM_BEACON_INTERVAL, 
     1624 
     1625        /* keep last */ 
     1626        __NL80211_STA_BSS_PARAM_AFTER_LAST, 
     1627        NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1 
     1628}; 
     1629 
     1630/** 
    11271631 * enum nl80211_sta_info - station information 
    11281632 * 
     
    11341638 * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) 
    11351639 * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) 
    1136  * @__NL80211_STA_INFO_AFTER_LAST: internal 
    1137  * @NL80211_STA_INFO_MAX: highest possible station info attribute 
    11381640 * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) 
    11391641 * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute 
    1140  *      containing info as possible, see &enum nl80211_sta_info_txrate. 
     1642 *      containing info as possible, see &enum nl80211_rate_info 
    11411643 * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) 
    11421644 * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this 
     
    11441646 * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) 
    11451647 * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) 
     1648 * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm) 
     1649 * @NL80211_STA_INFO_LLID: the station's mesh LLID 
     1650 * @NL80211_STA_INFO_PLID: the station's mesh PLID 
     1651 * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station 
     1652 *      (see %enum nl80211_plink_state) 
     1653 * @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested 
     1654 *      attribute, like NL80211_STA_INFO_TX_BITRATE. 
     1655 * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute 
     1656 *     containing info as possible, see &enum nl80211_sta_bss_param 
     1657 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected 
     1658 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. 
     1659 * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32) 
     1660 * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU 
     1661 * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average 
     1662 * @__NL80211_STA_INFO_AFTER_LAST: internal 
     1663 * @NL80211_STA_INFO_MAX: highest possible station info attribute 
    11461664 */ 
    11471665enum nl80211_sta_info { 
     
    11591677        NL80211_STA_INFO_TX_RETRIES, 
    11601678        NL80211_STA_INFO_TX_FAILED, 
     1679        NL80211_STA_INFO_SIGNAL_AVG, 
     1680        NL80211_STA_INFO_RX_BITRATE, 
     1681        NL80211_STA_INFO_BSS_PARAM, 
     1682        NL80211_STA_INFO_CONNECTED_TIME, 
     1683        NL80211_STA_INFO_STA_FLAGS, 
     1684        NL80211_STA_INFO_BEACON_LOSS, 
     1685        NL80211_STA_INFO_CHAIN_SIGNAL, 
     1686        NL80211_STA_INFO_CHAIN_SIGNAL_AVG, 
    11611687 
    11621688        /* keep last */ 
     
    13121838 * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an 
    13131839 *      802.11 country information element with regulatory information it 
    1314  *      thinks we should consider. 
     1840 *      thinks we should consider. cfg80211 only processes the country 
     1841 *      code from the IE, and relies on the regulatory domain information 
     1842 *      structure passed by userspace (CRDA) from our wireless-regdb. 
     1843 *      If a channel is enabled but the country code indicates it should 
     1844 *      be disabled we disable the channel and re-enable it upon disassociation. 
    13151845 */ 
    13161846enum nl80211_reg_initiator { 
     
    13841914 
    13851915/** 
     1916 * enum nl80211_sched_scan_match_attr - scheduled scan match attributes 
     1917 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved 
     1918 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, 
     1919 * only report BSS with matching SSID. 
     1920 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter 
     1921 *      attribute number currently defined 
     1922 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use 
     1923 */ 
     1924enum nl80211_sched_scan_match_attr { 
     1925        __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, 
     1926 
     1927        NL80211_ATTR_SCHED_SCAN_MATCH_SSID, 
     1928 
     1929        /* keep last */ 
     1930        __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, 
     1931        NL80211_SCHED_SCAN_MATCH_ATTR_MAX = 
     1932                __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 
     1933}; 
     1934 
     1935/** 
    13861936 * enum nl80211_reg_rule_flags - regulatory rule flags 
    13871937 * 
     
    14061956        NL80211_RRF_PASSIVE_SCAN        = 1<<7, 
    14071957        NL80211_RRF_NO_IBSS             = 1<<8, 
     1958}; 
     1959 
     1960/** 
     1961 * enum nl80211_dfs_regions - regulatory DFS regions 
     1962 * 
     1963 * @NL80211_DFS_UNSET: Country has no DFS master region specified 
     1964 * @NL80211_DFS_FCC_: Country follows DFS master rules from FCC 
     1965 * @NL80211_DFS_FCC_: Country follows DFS master rules from ETSI 
     1966 * @NL80211_DFS_JP_: Country follows DFS master rules from JP/MKK/Telec 
     1967 */ 
     1968enum nl80211_dfs_regions { 
     1969        NL80211_DFS_UNSET       = 0, 
     1970        NL80211_DFS_FCC         = 1, 
     1971        NL80211_DFS_ETSI        = 2, 
     1972        NL80211_DFS_JP          = 3, 
    14081973}; 
    14091974 
     
    14812046 * enum nl80211_meshconf_params - mesh configuration parameters 
    14822047 * 
    1483  * Mesh configuration parameters 
     2048 * Mesh configuration parameters. These can be changed while the mesh is 
     2049 * active. 
    14842050 * 
    14852051 * @__NL80211_MESHCONF_INVALID: internal use 
     
    14882054 * millisecond units, used by the Peer Link Open message 
    14892055 * 
    1490  * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the inital confirm timeout, in 
     2056 * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in 
    14912057 * millisecond units, used by the peer link management to close a peer link 
    14922058 * 
     
    15282094 * that it takes for an HWMP information element to propagate across the mesh 
    15292095 * 
    1530  * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not 
     2096 * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not 
     2097 * 
     2098 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a 
     2099 * source mesh point for path selection elements. 
     2100 * 
     2101 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL:  The interval of time (in TUs) between 
     2102 * root announcements are transmitted. 
     2103 * 
     2104 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has 
     2105 * access to a broader network beyond the MBSS.  This is done via Root 
     2106 * Announcement frames. 
     2107 * 
     2108 * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in 
     2109 * TUs) during which a mesh STA can send only one Action frame containing a 
     2110 * PERR element. 
     2111 * 
     2112 * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding 
     2113 * or forwarding entity (default is TRUE - forwarding entity) 
    15312114 * 
    15322115 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 
     
    15502133        NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 
    15512134        NL80211_MESHCONF_HWMP_ROOTMODE, 
     2135        NL80211_MESHCONF_ELEMENT_TTL, 
     2136        NL80211_MESHCONF_HWMP_RANN_INTERVAL, 
     2137        NL80211_MESHCONF_GATE_ANNOUNCEMENTS, 
     2138        NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL, 
     2139        NL80211_MESHCONF_FORWARDING, 
    15522140 
    15532141        /* keep last */ 
    15542142        __NL80211_MESHCONF_ATTR_AFTER_LAST, 
    15552143        NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1 
     2144}; 
     2145 
     2146/** 
     2147 * enum nl80211_mesh_setup_params - mesh setup parameters 
     2148 * 
     2149 * Mesh setup parameters.  These are used to start/join a mesh and cannot be 
     2150 * changed while the mesh is active. 
     2151 * 
     2152 * @__NL80211_MESH_SETUP_INVALID: Internal use 
     2153 * 
     2154 * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a 
     2155 * vendor specific path selection algorithm or disable it to use the default 
     2156 * HWMP. 
     2157 * 
     2158 * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a 
     2159 * vendor specific path metric or disable it to use the default Airtime 
     2160 * metric. 
     2161 * 
     2162 * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a 
     2163 * robust security network ie, or a vendor specific information element that 
     2164 * vendors will use to identify the path selection methods and metrics in use. 
     2165 * 
     2166 * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication 
     2167 * daemon will be authenticating mesh candidates. 
     2168 * 
     2169 * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication 
     2170 * daemon will be securing peer link frames.  AMPE is a secured version of Mesh 
     2171 * Peering Management (MPM) and is implemented with the assistance of a 
     2172 * userspace daemon.  When this flag is set, the kernel will send peer 
     2173 * management frames to a userspace daemon that will implement AMPE 
     2174 * functionality (security capabilities selection, key confirmation, and key 
     2175 * management).  When the flag is unset (default), the kernel can autonomously 
     2176 * complete (unsecured) mesh peering without the need of a userspace daemon. 
     2177 * 
     2178 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number 
     2179 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 
     2180 */ 
     2181enum nl80211_mesh_setup_params { 
     2182        __NL80211_MESH_SETUP_INVALID, 
     2183        NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL, 
     2184        NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC, 
     2185        NL80211_MESH_SETUP_IE, 
     2186        NL80211_MESH_SETUP_USERSPACE_AUTH, 
     2187        NL80211_MESH_SETUP_USERSPACE_AMPE, 
     2188 
     2189        /* keep last */ 
     2190        __NL80211_MESH_SETUP_ATTR_AFTER_LAST, 
     2191        NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1 
    15562192}; 
    15572193 
     
    17142350 
    17152351/** 
     2352 * enum nl80211_key_default_types - key default types 
     2353 * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid 
     2354 * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default 
     2355 *      unicast key 
     2356 * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default 
     2357 *      multicast key 
     2358 * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types 
     2359 */ 
     2360enum nl80211_key_default_types { 
     2361        __NL80211_KEY_DEFAULT_TYPE_INVALID, 
     2362        NL80211_KEY_DEFAULT_TYPE_UNICAST, 
     2363        NL80211_KEY_DEFAULT_TYPE_MULTICAST, 
     2364 
     2365        NUM_NL80211_KEY_DEFAULT_TYPES 
     2366}; 
     2367 
     2368/** 
    17162369 * enum nl80211_key_attributes - key attributes 
    17172370 * @__NL80211_KEY_INVALID: invalid 
     
    17292382 *      specified the default depends on whether a MAC address was 
    17302383 *      given with the command using the key or not (u32) 
     2384 * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags 
     2385 *      attributes, specifying what a key should be set as default as. 
     2386 *      See &enum nl80211_key_default_types. 
    17312387 * @__NL80211_KEY_AFTER_LAST: internal 
    17322388 * @NL80211_KEY_MAX: highest key attribute 
     
    17412397        NL80211_KEY_DEFAULT_MGMT, 
    17422398        NL80211_KEY_TYPE, 
     2399        NL80211_KEY_DEFAULT_TYPES, 
    17432400 
    17442401        /* keep last */ 
     
    17542411 *      1 = 500 kbps) but without the IE length restriction (at most 
    17552412 *      %NL80211_MAX_SUPP_RATES in a single array). 
     2413 * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection 
     2414 *      in an array of MCS numbers. 
    17562415 * @__NL80211_TXRATE_AFTER_LAST: internal 
    17572416 * @NL80211_TXRATE_MAX: highest TX rate attribute 
     
    17602419        __NL80211_TXRATE_INVALID, 
    17612420        NL80211_TXRATE_LEGACY, 
     2421        NL80211_TXRATE_MCS, 
    17622422 
    17632423        /* keep last */ 
     
    17912451 *      new event may be issued (to reduce effects of RSSI oscillation). 
    17922452 * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event 
     2453 * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many 
     2454 *      consecutive packets were not acknowledged by the peer 
    17932455 * @__NL80211_ATTR_CQM_AFTER_LAST: internal 
    17942456 * @NL80211_ATTR_CQM_MAX: highest key attribute 
     
    17992461        NL80211_ATTR_CQM_RSSI_HYST, 
    18002462        NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, 
     2463        NL80211_ATTR_CQM_PKT_LOSS_EVENT, 
    18012464 
    18022465        /* keep last */ 
     
    18302493}; 
    18312494 
     2495/** 
     2496 * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute 
     2497 * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute 
     2498 * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has 
     2499 *      a zero bit are ignored 
     2500 * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have 
     2501 *      a bit for each byte in the pattern. The lowest-order bit corresponds 
     2502 *      to the first byte of the pattern, but the bytes of the pattern are 
     2503 *      in a little-endian-like format, i.e. the 9th byte of the pattern 
     2504 *      corresponds to the lowest-order bit in the second byte of the mask. 
     2505 *      For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where 
     2506 *      xx indicates "don't care") would be represented by a pattern of 
     2507 *      twelve zero bytes, and a mask of "0xed,0x07". 
     2508 *      Note that the pattern matching is done as though frames were not 
     2509 *      802.11 frames but 802.3 frames, i.e. the frame is fully unpacked 
     2510 *      first (including SNAP header unpacking) and then matched. 
     2511 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes 
     2512 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number 
     2513 */ 
     2514enum nl80211_wowlan_packet_pattern_attr { 
     2515        __NL80211_WOWLAN_PKTPAT_INVALID, 
     2516        NL80211_WOWLAN_PKTPAT_MASK, 
     2517        NL80211_WOWLAN_PKTPAT_PATTERN, 
     2518 
     2519        NUM_NL80211_WOWLAN_PKTPAT, 
     2520        MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, 
     2521}; 
     2522 
     2523/** 
     2524 * struct nl80211_wowlan_pattern_support - pattern support information 
     2525 * @max_patterns: maximum number of patterns supported 
     2526 * @min_pattern_len: minimum length of each pattern 
     2527 * @max_pattern_len: maximum length of each pattern 
     2528 * 
     2529 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 
     2530 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 
     2531 * capability information given by the kernel to userspace. 
     2532 */ 
     2533struct nl80211_wowlan_pattern_support { 
     2534        __u32 max_patterns; 
     2535        __u32 min_pattern_len; 
     2536        __u32 max_pattern_len; 
     2537} __attribute__((packed)); 
     2538 
     2539/** 
     2540 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions 
     2541 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes 
     2542 * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put 
     2543 *      the chip into a special state -- works best with chips that have 
     2544 *      support for low-power operation already (flag) 
     2545 * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect 
     2546 *      is detected is implementation-specific (flag) 
     2547 * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed 
     2548 *      by 16 repetitions of MAC addr, anywhere in payload) (flag) 
     2549 * @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns 
     2550 *      which are passed in an array of nested attributes, each nested attribute 
     2551 *      defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern. 
     2552 *      Each pattern defines a wakeup packet. The matching is done on the MSDU, 
     2553 *      i.e. as though the packet was an 802.3 packet, so the pattern matching 
     2554 *      is done after the packet is converted to the MSDU. 
     2555 * 
     2556 *      In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 
     2557 *      carrying a &struct nl80211_wowlan_pattern_support. 
     2558 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be 
     2559 *      used when setting, used only to indicate that GTK rekeying is supported 
     2560 *      by the device (flag) 
     2561 * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if 
     2562 *      done by the device) (flag) 
     2563 * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request 
     2564 *      packet (flag) 
     2565 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag) 
     2566 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released 
     2567 *      (on devices that have rfkill in the device) (flag) 
     2568 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers 
     2569 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number 
     2570 */ 
     2571enum nl80211_wowlan_triggers { 
     2572        __NL80211_WOWLAN_TRIG_INVALID, 
     2573        NL80211_WOWLAN_TRIG_ANY, 
     2574        NL80211_WOWLAN_TRIG_DISCONNECT, 
     2575        NL80211_WOWLAN_TRIG_MAGIC_PKT, 
     2576        NL80211_WOWLAN_TRIG_PKT_PATTERN, 
     2577        NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED, 
     2578        NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE, 
     2579        NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST, 
     2580        NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE, 
     2581        NL80211_WOWLAN_TRIG_RFKILL_RELEASE, 
     2582 
     2583        /* keep last */ 
     2584        NUM_NL80211_WOWLAN_TRIG, 
     2585        MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1 
     2586}; 
     2587 
     2588/** 
     2589 * enum nl80211_iface_limit_attrs - limit attributes 
     2590 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 
     2591 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 
     2592 *      can be chosen from this set of interface types (u32) 
     2593 * @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a 
     2594 *      flag attribute for each interface type in this set 
     2595 * @NUM_NL80211_IFACE_LIMIT: number of attributes 
     2596 * @MAX_NL80211_IFACE_LIMIT: highest attribute number 
     2597 */ 
     2598enum nl80211_iface_limit_attrs { 
     2599        NL80211_IFACE_LIMIT_UNSPEC, 
     2600        NL80211_IFACE_LIMIT_MAX, 
     2601        NL80211_IFACE_LIMIT_TYPES, 
     2602 
     2603        /* keep last */ 
     2604        NUM_NL80211_IFACE_LIMIT, 
     2605        MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1 
     2606}; 
     2607 
     2608/** 
     2609 * enum nl80211_if_combination_attrs -- interface combination attributes 
     2610 * 
     2611 * @NL80211_IFACE_COMB_UNSPEC: (reserved) 
     2612 * @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits 
     2613 *      for given interface types, see &enum nl80211_iface_limit_attrs. 
     2614 * @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of 
     2615 *      interfaces that can be created in this group. This number doesn't 
     2616 *      apply to interfaces purely managed in software, which are listed 
     2617 *      in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE. 
     2618 * @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that 
     2619 *      beacon intervals within this group must be all the same even for 
     2620 *      infrastructure and AP/GO combinations, i.e. the GO(s) must adopt 
     2621 *      the infrastructure network's beacon interval. 
     2622 * @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many 
     2623 *      different channels may be used within this group. 
     2624 * @NUM_NL80211_IFACE_COMB: number of attributes 
     2625 * @MAX_NL80211_IFACE_COMB: highest attribute number 
     2626 * 
     2627 * Examples: 
     2628 *      limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 
     2629 *      => allows an AP and a STA that must match BIs 
     2630 * 
     2631 *      numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8 
     2632 *      => allows 8 of AP/GO 
     2633 * 
     2634 *      numbers = [ #{STA} <= 2 ], channels = 2, max = 2 
     2635 *      => allows two STAs on different channels 
     2636 * 
     2637 *      numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4 
     2638 *      => allows a STA plus three P2P interfaces 
     2639 * 
     2640 * The list of these four possiblities could completely be contained 
     2641 * within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate 
     2642 * that any of these groups must match. 
     2643 * 
     2644 * "Combinations" of just a single interface will not be listed here, 
     2645 * a single interface of any valid interface type is assumed to always 
     2646 * be possible by itself. This means that implicitly, for each valid 
     2647 * interface type, the following group always exists: 
     2648 *      numbers = [ #{<type>} <= 1 ], channels = 1, max = 1 
     2649 */ 
     2650enum nl80211_if_combination_attrs { 
     2651        NL80211_IFACE_COMB_UNSPEC, 
     2652        NL80211_IFACE_COMB_LIMITS, 
     2653        NL80211_IFACE_COMB_MAXNUM, 
     2654        NL80211_IFACE_COMB_STA_AP_BI_MATCH, 
     2655        NL80211_IFACE_COMB_NUM_CHANNELS, 
     2656 
     2657        /* keep last */ 
     2658        NUM_NL80211_IFACE_COMB, 
     2659        MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1 
     2660}; 
     2661 
     2662 
     2663/** 
     2664 * enum nl80211_plink_state - state of a mesh peer link finite state machine 
     2665 * 
     2666 * @NL80211_PLINK_LISTEN: initial state, considered the implicit 
     2667 *      state of non existant mesh peer links 
     2668 * @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to 
     2669 *      this mesh peer 
     2670 * @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received 
     2671 *      from this mesh peer 
     2672 * @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been 
     2673 *      received from this mesh peer 
     2674 * @NL80211_PLINK_ESTAB: mesh peer link is established 
     2675 * @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled 
     2676 * @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh 
     2677 *      plink are discarded 
     2678 * @NUM_NL80211_PLINK_STATES: number of peer link states 
     2679 * @MAX_NL80211_PLINK_STATES: highest numerical value of plink states 
     2680 */ 
     2681enum nl80211_plink_state { 
     2682        NL80211_PLINK_LISTEN, 
     2683        NL80211_PLINK_OPN_SNT, 
     2684        NL80211_PLINK_OPN_RCVD, 
     2685        NL80211_PLINK_CNF_RCVD, 
     2686        NL80211_PLINK_ESTAB, 
     2687        NL80211_PLINK_HOLDING, 
     2688        NL80211_PLINK_BLOCKED, 
     2689 
     2690        /* keep last */ 
     2691        NUM_NL80211_PLINK_STATES, 
     2692        MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 
     2693}; 
     2694 
     2695#define NL80211_KCK_LEN                 16 
     2696#define NL80211_KEK_LEN                 16 
     2697#define NL80211_REPLAY_CTR_LEN          8 
     2698 
     2699/** 
     2700 * enum nl80211_rekey_data - attributes for GTK rekey offload 
     2701 * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes 
     2702 * @NL80211_REKEY_DATA_KEK: key encryption key (binary) 
     2703 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary) 
     2704 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary) 
     2705 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal) 
     2706 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal) 
     2707 */ 
     2708enum nl80211_rekey_data { 
     2709        __NL80211_REKEY_DATA_INVALID, 
     2710        NL80211_REKEY_DATA_KEK, 
     2711        NL80211_REKEY_DATA_KCK, 
     2712        NL80211_REKEY_DATA_REPLAY_CTR, 
     2713 
     2714        /* keep last */ 
     2715        NUM_NL80211_REKEY_DATA, 
     2716        MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 
     2717}; 
     2718 
     2719/** 
     2720 * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID 
     2721 * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in 
     2722 *      Beacon frames) 
     2723 * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element 
     2724 *      in Beacon frames 
     2725 * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID 
     2726 *      element in Beacon frames but zero out each byte in the SSID 
     2727 */ 
     2728enum nl80211_hidden_ssid { 
     2729        NL80211_HIDDEN_SSID_NOT_IN_USE, 
     2730        NL80211_HIDDEN_SSID_ZERO_LEN, 
     2731        NL80211_HIDDEN_SSID_ZERO_CONTENTS 
     2732}; 
     2733 
     2734/** 
     2735 * enum nl80211_sta_wme_attr - station WME attributes 
     2736 * @__NL80211_STA_WME_INVALID: invalid number for nested attribute 
     2737 * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format 
     2738 *      is the same as the AC bitmap in the QoS info field. 
     2739 * @NL80211_STA_WME_MAX_SP: max service period. the format is the same 
     2740 *      as the MAX_SP field in the QoS info field (but already shifted down). 
     2741 * @__NL80211_STA_WME_AFTER_LAST: internal 
     2742 * @NL80211_STA_WME_MAX: highest station WME attribute 
     2743 */ 
     2744enum nl80211_sta_wme_attr { 
     2745        __NL80211_STA_WME_INVALID, 
     2746        NL80211_STA_WME_UAPSD_QUEUES, 
     2747        NL80211_STA_WME_MAX_SP, 
     2748 
     2749        /* keep last */ 
     2750        __NL80211_STA_WME_AFTER_LAST, 
     2751        NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1 
     2752}; 
     2753 
     2754/** 
     2755 * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates 
     2756 * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes 
     2757 * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher 
     2758 *      priority) 
     2759 * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets) 
     2760 * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag) 
     2761 * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes 
     2762 *      (internal) 
     2763 * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute 
     2764 *      (internal) 
     2765 */ 
     2766enum nl80211_pmksa_candidate_attr { 
     2767        __NL80211_PMKSA_CANDIDATE_INVALID, 
     2768        NL80211_PMKSA_CANDIDATE_INDEX, 
     2769        NL80211_PMKSA_CANDIDATE_BSSID, 
     2770        NL80211_PMKSA_CANDIDATE_PREAUTH, 
     2771 
     2772        /* keep last */ 
     2773        NUM_NL80211_PMKSA_CANDIDATE, 
     2774        MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1 
     2775}; 
     2776 
     2777/** 
     2778 * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION 
     2779 * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request 
     2780 * @NL80211_TDLS_SETUP: Setup TDLS link 
     2781 * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established 
     2782 * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link 
     2783 * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link 
     2784 */ 
     2785enum nl80211_tdls_operation { 
     2786        NL80211_TDLS_DISCOVERY_REQ, 
     2787        NL80211_TDLS_SETUP, 
     2788        NL80211_TDLS_TEARDOWN, 
     2789        NL80211_TDLS_ENABLE_LINK, 
     2790        NL80211_TDLS_DISABLE_LINK, 
     2791}; 
     2792 
     2793/* 
     2794 * enum nl80211_ap_sme_features - device-integrated AP features 
     2795 * Reserved for future use, no bits are defined in 
     2796 * NL80211_ATTR_DEVICE_AP_SME yet. 
     2797enum nl80211_ap_sme_features { 
     2798}; 
     2799 */ 
     2800 
     2801/** 
     2802 * enum nl80211_feature_flags - device/driver features 
     2803 * @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back 
     2804 *      TX status to the socket error queue when requested with the 
     2805 *      socket option. 
     2806 * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. 
     2807 */ 
     2808enum nl80211_feature_flags { 
     2809        NL80211_FEATURE_SK_TX_STATUS    = 1 << 0, 
     2810        NL80211_FEATURE_HT_IBSS         = 1 << 1, 
     2811}; 
     2812 
     2813/** 
     2814 * enum nl80211_probe_resp_offload_support_attr - optional supported 
     2815 *      protocols for probe-response offloading by the driver/FW. 
     2816 *      To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute. 
     2817 *      Each enum value represents a bit in the bitmap of supported 
     2818 *      protocols. Typically a subset of probe-requests belonging to a 
     2819 *      supported protocol will be excluded from offload and uploaded 
     2820 *      to the host. 
     2821 * 
     2822 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1 
     2823 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2 
     2824 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P 
     2825 * @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u 
     2826 */ 
     2827enum nl80211_probe_resp_offload_support_attr { 
     2828        NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS =        1<<0, 
     2829        NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 =       1<<1, 
     2830        NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P =        1<<2, 
     2831        NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U =     1<<3, 
     2832}; 
     2833 
    18322834#endif /* __LINUX_NL80211_H */ 
  • trunk/package/iwinfo/src/iwinfo_cli.c

    r29634 r30682  
    272272                        (modes & IWINFO_80211_G) ? "g" : "", 
    273273                        (modes & IWINFO_80211_N) ? "n" : ""); 
     274 
     275        return buf; 
     276} 
     277 
     278static char * format_assocrate(struct iwinfo_rate_entry *r) 
     279{ 
     280        static char buf[40]; 
     281        char *p = buf; 
     282        int l = sizeof(buf); 
     283 
     284        if (r->rate <= 0) 
     285        { 
     286                snprintf(buf, sizeof(buf), "unknown"); 
     287        } 
     288        else 
     289        { 
     290                p += snprintf(p, l, "%s", format_rate(r->rate)); 
     291                l = sizeof(buf) - (p - buf); 
     292 
     293                if (r->mcs >= 0) 
     294                { 
     295                        p += snprintf(p, l, ", MCS %d, %dMHz", r->mcs, 20 + r->is_40mhz*20); 
     296                        l = sizeof(buf) - (p - buf); 
     297 
     298                        if (r->is_short_gi) 
     299                                p += snprintf(p, l, ", short GI"); 
     300                } 
     301        } 
    274302 
    275303        return buf; 
     
    636664                e = (struct iwinfo_assoclist_entry *) &buf[i]; 
    637665 
    638                 printf("%s  %s / %s (SNR %d)\n", 
     666                printf("%s  %s / %s (SNR %d)  %d ms ago\n", 
    639667                        format_bssid(e->mac), 
    640668                        format_signal(e->signal), 
    641669                        format_noise(e->noise), 
    642                         (e->signal - e->noise)); 
     670                        (e->signal - e->noise), 
     671                        e->inactive); 
     672 
     673                printf("        RX: %-38s  %8d Pkts.\n", 
     674                        format_assocrate(&e->rx_rate), 
     675                        e->rx_packets 
     676                ); 
     677 
     678                printf("        TX: %-38s  %8d Pkts.\n\n", 
     679                        format_assocrate(&e->tx_rate), 
     680                        e->tx_packets 
     681                ); 
    643682        } 
    644683} 
  • trunk/package/iwinfo/src/iwinfo_lua.c

    r29425 r30682  
    265265                        lua_pushnumber(L, e->noise); 
    266266                        lua_setfield(L, -2, "noise"); 
     267 
     268                        lua_pushnumber(L, e->inactive); 
     269                        lua_setfield(L, -2, "inactive"); 
     270 
     271                        lua_pushnumber(L, e->rx_packets); 
     272                        lua_setfield(L, -2, "rx_packets"); 
     273 
     274                        lua_pushnumber(L, e->tx_packets); 
     275                        lua_setfield(L, -2, "tx_packets"); 
     276 
     277                        lua_pushnumber(L, e->rx_rate.rate); 
     278                        lua_setfield(L, -2, "rx_rate"); 
     279 
     280                        lua_pushnumber(L, e->tx_rate.rate); 
     281                        lua_setfield(L, -2, "tx_rate"); 
     282 
     283                        if (e->rx_rate.mcs >= 0) 
     284                        { 
     285                                lua_pushnumber(L, e->rx_rate.mcs); 
     286                                lua_setfield(L, -2, "rx_mcs"); 
     287 
     288                                lua_pushboolean(L, e->rx_rate.is_40mhz); 
     289                                lua_setfield(L, -2, "rx_40mhz"); 
     290 
     291                                lua_pushboolean(L, e->rx_rate.is_short_gi); 
     292                                lua_setfield(L, -2, "rx_short_gi"); 
     293                        } 
     294 
     295                        if (e->tx_rate.mcs >= 0) 
     296                        { 
     297                                lua_pushnumber(L, e->tx_rate.mcs); 
     298                                lua_setfield(L, -2, "tx_mcs"); 
     299 
     300                                lua_pushboolean(L, e->tx_rate.is_40mhz); 
     301                                lua_setfield(L, -2, "tx_40mhz"); 
     302 
     303                                lua_pushboolean(L, e->tx_rate.is_short_gi); 
     304                                lua_setfield(L, -2, "tx_short_gi"); 
     305                        } 
    267306 
    268307                        lua_setfield(L, -2, macstr); 
  • trunk/package/iwinfo/src/iwinfo_madwifi.c

    r30605 r30682  
    727727                        si = (struct ieee80211req_sta_info *) cp; 
    728728 
     729                        memset(&entry, 0, sizeof(entry)); 
     730 
    729731                        entry.signal = (si->isi_rssi - 95); 
    730732                        entry.noise  = noise; 
    731733                        memcpy(entry.mac, &si->isi_macaddr, 6); 
     734 
     735                        entry.inactive = si->isi_inact * 1000; 
     736 
     737                        entry.tx_packets = (si->isi_txseqs[0] & IEEE80211_SEQ_SEQ_MASK) 
     738                                >> IEEE80211_SEQ_SEQ_SHIFT; 
     739 
     740                        entry.rx_packets = (si->isi_rxseqs[0] & IEEE80211_SEQ_SEQ_MASK) 
     741                                >> IEEE80211_SEQ_SEQ_SHIFT; 
     742 
     743                        entry.tx_rate.rate = 
     744                                (si->isi_rates[si->isi_txrate] & IEEE80211_RATE_VAL) * 500; 
     745 
     746                        /* XXX: this is just a guess */ 
     747                        entry.rx_rate.rate = entry.tx_rate.rate; 
     748 
     749                        entry.rx_rate.mcs = -1; 
     750                        entry.tx_rate.mcs = -1; 
     751 
    732752                        memcpy(&buf[bl], &entry, sizeof(struct iwinfo_assoclist_entry)); 
    733753 
  • trunk/package/iwinfo/src/iwinfo_nl80211.c

    r30605 r30682  
    10531053        struct nlattr **attr = nl80211_parse(msg); 
    10541054        struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1]; 
     1055        struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1]; 
    10551056 
    10561057        static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = { 
    10571058                [NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32    }, 
    1058                 [NL80211_STA_INFO_RX_BYTES]      = { .type = NLA_U32    }, 
    1059                 [NL80211_STA_INFO_TX_BYTES]      = { .type = NLA_U32    }, 
    10601059                [NL80211_STA_INFO_RX_PACKETS]    = { .type = NLA_U32    }, 
    10611060                [NL80211_STA_INFO_TX_PACKETS]    = { .type = NLA_U32    }, 
     1061                [NL80211_STA_INFO_RX_BITRATE]    = { .type = NLA_NESTED }, 
     1062                [NL80211_STA_INFO_TX_BITRATE]    = { .type = NLA_NESTED }, 
    10621063                [NL80211_STA_INFO_SIGNAL]        = { .type = NLA_U8     }, 
    1063                 [NL80211_STA_INFO_TX_BITRATE]    = { .type = NLA_NESTED }, 
    1064                 [NL80211_STA_INFO_LLID]          = { .type = NLA_U16    }, 
    1065                 [NL80211_STA_INFO_PLID]          = { .type = NLA_U16    }, 
    1066                 [NL80211_STA_INFO_PLINK_STATE]   = { .type = NLA_U8     }, 
     1064        }; 
     1065 
     1066        static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = { 
     1067                [NL80211_RATE_INFO_BITRATE]      = { .type = NLA_U16    }, 
     1068                [NL80211_RATE_INFO_MCS]          = { .type = NLA_U8     }, 
     1069                [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG   }, 
     1070                [NL80211_RATE_INFO_SHORT_GI]     = { .type = NLA_FLAG   }, 
    10671071        }; 
    10681072 
    10691073        /* advance to end of array */ 
    10701074        e += arr->count; 
     1075        memset(e, 0, sizeof(*e)); 
    10711076 
    10721077        if (attr[NL80211_ATTR_MAC]) 
    10731078                memcpy(e->mac, nla_data(attr[NL80211_ATTR_MAC]), 6); 
    10741079 
    1075         if (attr[NL80211_ATTR_STA_INFO]) 
    1076         { 
    1077                 if (!nla_parse_nested(sinfo, NL80211_STA_INFO_MAX, 
    1078                                 attr[NL80211_ATTR_STA_INFO], stats_policy)) 
    1079                 { 
    1080                         if (sinfo[NL80211_STA_INFO_SIGNAL]) 
    1081                                 e->signal = nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]); 
     1080        if (attr[NL80211_ATTR_STA_INFO] && 
     1081                !nla_parse_nested(sinfo, NL80211_STA_INFO_MAX, 
     1082                        attr[NL80211_ATTR_STA_INFO], stats_policy)) 
     1083        { 
     1084                if (sinfo[NL80211_STA_INFO_SIGNAL]) 
     1085                        e->signal = nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]); 
     1086 
     1087                if (sinfo[NL80211_STA_INFO_INACTIVE_TIME]) 
     1088                        e->inactive = nla_get_u32(sinfo[NL80211_STA_INFO_INACTIVE_TIME]); 
     1089 
     1090                if (sinfo[NL80211_STA_INFO_RX_PACKETS]) 
     1091                        e->rx_packets = nla_get_u32(sinfo[NL80211_STA_INFO_RX_PACKETS]); 
     1092 
     1093                if (sinfo[NL80211_STA_INFO_TX_PACKETS]) 
     1094                        e->tx_packets = nla_get_u32(sinfo[NL80211_STA_INFO_TX_PACKETS]); 
     1095 
     1096                if (sinfo[NL80211_STA_INFO_RX_BITRATE] && 
     1097                        !nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX, 
     1098                                sinfo[NL80211_STA_INFO_RX_BITRATE], rate_policy)) 
     1099                { 
     1100                        if (rinfo[NL80211_RATE_INFO_BITRATE]) 
     1101                                e->rx_rate.rate = 
     1102                                        nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]) * 100; 
     1103 
     1104                        if (rinfo[NL80211_RATE_INFO_MCS]) 
     1105                                e->rx_rate.mcs = nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]); 
     1106 
     1107                        if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH]) 
     1108                                e->rx_rate.is_40mhz = 1; 
     1109 
     1110                        if (rinfo[NL80211_RATE_INFO_SHORT_GI]) 
     1111                                e->rx_rate.is_short_gi = 1; 
     1112                } 
     1113 
     1114                if (sinfo[NL80211_STA_INFO_TX_BITRATE] && 
     1115                        !nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX, 
     1116                                sinfo[NL80211_STA_INFO_TX_BITRATE], rate_policy)) 
     1117                { 
     1118                        if (rinfo[NL80211_RATE_INFO_BITRATE]) 
     1119                                e->tx_rate.rate = 
     1120                                        nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]) * 100; 
     1121 
     1122                        if (rinfo[NL80211_RATE_INFO_MCS]) 
     1123                                e->tx_rate.mcs = nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]); 
     1124 
     1125                        if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH]) 
     1126                                e->tx_rate.is_40mhz = 1; 
     1127 
     1128                        if (rinfo[NL80211_RATE_INFO_SHORT_GI]) 
     1129                                e->tx_rate.is_short_gi = 1; 
    10821130                } 
    10831131        } 
     
    11141162                                        nl80211_free(req); 
    11151163                                } 
    1116  
    1117                                 break; 
    11181164                        } 
    11191165                } 
  • trunk/package/iwinfo/src/iwinfo_wl.c

    r29425 r30682  
    3838} 
    3939 
     40static int wl_iovar(const char *name, const char *cmd, const char *arg, 
     41                                        int arglen, void *buf, int buflen) 
     42{ 
     43        int cmdlen = strlen(cmd) + 1; 
     44 
     45        memcpy(buf, cmd, cmdlen); 
     46 
     47        if (arg && arglen > 0) 
     48                memcpy(buf + cmdlen, arg, arglen); 
     49 
     50        return wl_ioctl(name, WLC_GET_VAR, buf, buflen); 
     51} 
     52 
    4053static struct wl_maclist * wl_read_assoclist(const char *ifname) 
    4154{ 
     
    4356        int maclen = 4 + WL_MAX_STA_COUNT * 6; 
    4457 
    45         if( (macs = (struct wl_maclist *) malloc(maclen)) != NULL ) 
     58        if ((macs = (struct wl_maclist *) malloc(maclen)) != NULL) 
    4659        { 
    4760                memset(macs, 0, maclen); 
    4861                macs->count = WL_MAX_STA_COUNT; 
    4962 
    50                 if( !wl_ioctl(ifname, WLC_GET_ASSOCLIST, macs, maclen) ) 
     63                if (!wl_ioctl(ifname, WLC_GET_ASSOCLIST, macs, maclen)) 
    5164                        return macs; 
    5265 
     
    6174{ 
    6275        int magic; 
    63  
    64         if( !wl_ioctl(ifname, WLC_GET_MAGIC, &magic, sizeof(magic)) && (magic == WLC_IOCTL_MAGIC)) 
    65                 return 1; 
    66  
    67         return 0; 
     76        return (!wl_ioctl(ifname, WLC_GET_MAGIC, &magic, sizeof(magic)) && 
     77                        (magic == WLC_IOCTL_MAGIC)); 
    6878} 
    6979 
     
    7888        int ap, infra, passive; 
    7989 
    80         if( (ret = wl_ioctl(ifname, WLC_GET_AP, &ap, sizeof(ap))) ) 
     90        if ((ret = wl_ioctl(ifname, WLC_GET_AP, &ap, sizeof(ap)))) 
    8191                return ret; 
    8292 
    83         if( (ret = wl_ioctl(ifname, WLC_GET_INFRA, &infra, sizeof(infra))) ) 
     93        if ((ret = wl_ioctl(ifname, WLC_GET_INFRA, &infra, sizeof(infra)))) 
    8494                return ret; 
    8595 
    86         if( (ret = wl_ioctl(ifname, WLC_GET_PASSIVE, &passive, sizeof(passive))) ) 
     96        if ((ret = wl_ioctl(ifname, WLC_GET_PASSIVE, &passive, sizeof(passive)))) 
    8797                return ret; 
    8898 
    89         if( passive ) 
     99        if (passive) 
    90100                sprintf(buf, "Monitor"); 
    91         else if( !infra ) 
     101        else if (!infra) 
    92102                sprintf(buf, "Ad-Hoc"); 
    93         else if( ap ) 
     103        else if (ap) 
    94104                sprintf(buf, "Master"); 
    95105        else 
     
    104114        wlc_ssid_t ssid; 
    105115 
    106         if( !(ret = wl_ioctl(ifname, WLC_GET_SSID, &ssid, sizeof(ssid))) ) 
     116        if (!(ret = wl_ioctl(ifname, WLC_GET_SSID, &ssid, sizeof(ssid)))) 
    107117                memcpy(buf, ssid.ssid, ssid.ssid_len); 
    108118 
     
    115125        char bssid[6]; 
    116126 
    117         if( !(ret = wl_ioctl(ifname, WLC_GET_BSSID, bssid, 6)) ) 
     127        if (!(ret = wl_ioctl(ifname, WLC_GET_BSSID, bssid, 6))) 
    118128                sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X", 
    119129                        (uint8_t)bssid[0], (uint8_t)bssid[1], (uint8_t)bssid[2], 
     
    164174        wl_ioctl(ifname, WLC_GET_BSS_INFO, tmp, WLC_IOCTL_MAXLEN); 
    165175 
    166         if( !wl_ioctl(ifname, WLC_GET_AP, &ap, sizeof(ap)) && !ap ) 
     176        if (!wl_ioctl(ifname, WLC_GET_AP, &ap, sizeof(ap)) && !ap) 
    167177        { 
    168178                *buf = tmp[WL_BSS_RSSI_OFFSET]; 
     
    173183 
    174184                /* Calculate average rssi from conntected stations */ 
    175                 if( (macs = wl_read_assoclist(ifname)) != NULL ) 
     185                if ((macs = wl_read_assoclist(ifname)) != NULL) 
    176186                { 
    177                         for( i = 0; i < macs->count; i++ ) 
     187                        for (i = 0; i < macs->count; i++) 
    178188                        { 
    179189                                memcpy(starssi.mac, &macs->ea[i], 6); 
    180190 
    181                                 if( !wl_ioctl(ifname, WLC_GET_RSSI, &starssi, 12) ) 
     191                                if (!wl_ioctl(ifname, WLC_GET_RSSI, &starssi, 12)) 
    182192                                { 
    183193                                        rssi -= starssi.rssi; 
     
    260270        { 
    261271                case 0: 
    262                         if( wsec && !wauth ) 
     272                        if (wsec && !wauth) 
    263273                                c->auth_algs |= IWINFO_AUTH_OPEN; 
    264274 
    265                         else if( wsec && wauth ) 
     275                        else if (wsec && wauth) 
    266276                                c->auth_algs |= IWINFO_AUTH_SHARED; 
    267277 
     
    375385 
    376386        return 0; 
     387} 
     388 
     389static void wl_get_assoclist_cb(const char *ifname, 
     390                                                            struct iwinfo_assoclist_entry *e) 
     391{ 
     392        wl_sta_info_t sta = { 0 }; 
     393 
     394        if (!wl_iovar(ifname, "sta_info", e->mac, 6, &sta, sizeof(sta)) && 
     395                (sta.ver >= 2)) 
     396        { 
     397                e->inactive     = sta.idle * 1000; 
     398                e->rx_packets   = sta.rx_ucast_pkts; 
     399                e->tx_packets   = sta.tx_pkts; 
     400                e->rx_rate.rate = sta.rx_rate; 
     401                e->tx_rate.rate = sta.tx_rate; 
     402 
     403                /* ToDo: 11n */ 
     404                e.rx_rate.mcs = -1; 
     405                e.tx_rate.mcs = -1; 
     406        } 
    377407} 
    378408 
     
    395425        wl_ioctl(ifname, WLC_GET_PASSIVE, &passive, sizeof(passive)); 
    396426 
    397         if( wl_get_noise(ifname, &noise) ) 
     427        if (wl_get_noise(ifname, &noise)) 
    398428                noise = 0; 
    399429 
    400         if( (ap || infra || passive) && ((macs = wl_read_assoclist(ifname)) != NULL) ) 
    401         { 
    402                 for( i = 0, j = 0; i < macs->count; i++, j += sizeof(struct iwinfo_assoclist_entry) ) 
     430        if ((ap || infra || passive) && ((macs = wl_read_assoclist(ifname)) != NULL)) 
     431        { 
     432                for (i = 0, j = 0; i < macs->count; i++, j += sizeof(struct iwinfo_assoclist_entry)) 
    403433                { 
     434                        memset(&entry, 0, sizeof(entry)); 
    404435                        memcpy(rssi.mac, &macs->ea[i], 6); 
    405436 
    406                         if( !wl_ioctl(ifname, WLC_GET_RSSI, &rssi, sizeof(struct wl_sta_rssi)) ) 
     437                        if (!wl_ioctl(ifname, WLC_GET_RSSI, &rssi, sizeof(struct wl_sta_rssi))) 
    407438                                entry.signal = (rssi.rssi - 0x100); 
    408439                        else 
     
    411442                        entry.noise = noise; 
    412443                        memcpy(entry.mac, &macs->ea[i], 6); 
     444                        wl_get_assoclist_cb(ifname, &entry); 
     445 
    413446                        memcpy(&buf[j], &entry, sizeof(entry)); 
    414447                } 
     
    418451                return 0; 
    419452        } 
    420         else if( (arp = fopen("/proc/net/arp", "r")) != NULL ) 
     453        else if ((arp = fopen("/proc/net/arp", "r")) != NULL) 
    421454        { 
    422455                j = 0; 
    423456 
    424                 while( fgets(line, sizeof(line), arp) != NULL ) 
     457                while (fgets(line, sizeof(line), arp) != NULL) 
    425458                { 
    426                         if( sscanf(line, "%*s 0x%*d 0x%*d %17s %*s %s", macstr, devstr) && !strcmp(devstr, ifname) ) 
     459                        if (sscanf(line, "%*s 0x%*d 0x%*d %17s %*s %s", macstr, devstr) && !strcmp(devstr, ifname)) 
    427460                        { 
    428461                                rssi.mac[0] = strtol(&macstr[0],  NULL, 16); 
     
    433466                                rssi.mac[5] = strtol(&macstr[15], NULL, 16); 
    434467 
    435                                 if( !wl_ioctl(ifname, WLC_GET_RSSI, &rssi, sizeof(struct wl_sta_rssi)) ) 
     468                                if (!wl_ioctl(ifname, WLC_GET_RSSI, &rssi, sizeof(struct wl_sta_rssi))) 
    436469                                        entry.signal = (rssi.rssi - 0x100); 
    437470                                else 
     
    461494        int i; 
    462495 
    463         for( i = 0; i < 8; i++ ) 
     496        for (i = 0; i < 8; i++) 
    464497        { 
    465498                entry.dbm = dbm[i]; 
     
    486519        char ccode[WLC_CNTRY_BUF_SZ]; 
    487520 
    488         if( !wl_ioctl(ifname, WLC_GET_COUNTRY, ccode, WLC_CNTRY_BUF_SZ) ) 
     521        if (!wl_ioctl(ifname, WLC_GET_COUNTRY, ccode, WLC_CNTRY_BUF_SZ)) 
    489522        { 
    490523                /* IL0 -> World */ 
    491                 if( !strcmp(ccode, "IL0") ) 
     524                if (!strcmp(ccode, "IL0")) 
    492525                        sprintf(buf, "00"); 
    493526 
    494527                /* YU -> RS */ 
    495                 else if( !strcmp(ccode, "YU") ) 
     528                else if (!strcmp(ccode, "YU")) 
    496529                        sprintf(buf, "RS"); 
    497530 
     
    514547        cl->buflen = sizeof(cdata); 
    515548 
    516         if( !wl_ioctl(ifname, WLC_GET_COUNTRY_LIST, cl, cl->buflen) ) 
    517         { 
    518                 for( i = 0, count = 0; i < cl->count; i++, c++ ) 
     549        if (!wl_ioctl(ifname, WLC_GET_COUNTRY_LIST, cl, cl->buflen)) 
     550        { 
     551                for (i = 0, count = 0; i < cl->count; i++, c++) 
    519552                { 
    520553                        sprintf(c->ccode, &cl->country_abbrev[i * WLC_CNTRY_BUF_SZ]); 
     
    522555 
    523556                        /* IL0 -> World */ 
    524                         if( !strcmp(c->ccode, "IL0") ) 
     557                        if (!strcmp(c->ccode, "IL0")) 
    525558                                c->iso3166 = 0x3030; 
    526559 
    527560                        /* YU -> RS */ 
    528                         else if( !strcmp(c->ccode, "YU") ) 
     561                        else if (!strcmp(c->ccode, "YU")) 
    529562                                c->iso3166 = 0x5253; 
    530563                } 
     
    547580 
    548581        /* Multi bssid support only works on corerev >= 9 */ 
    549         if( !wl_ioctl(ifname, WLC_GET_REVINFO, &revinfo, sizeof(revinfo)) ) 
    550         { 
    551                 if( revinfo.corerev >= 9 ) 
     582        if (!wl_ioctl(ifname, WLC_GET_REVINFO, &revinfo, sizeof(revinfo))) 
     583        { 
     584                if (revinfo.corerev >= 9) 
    552585                { 
    553586                        *buf = 1; 
Note: See TracChangeset for help on using the changeset viewer.