]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
update nl80211.h, adjust phy.c for new API
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 12 Dec 2008 21:40:45 +0000 (22:40 +0100)
committerJohannes Berg <johannes@sipsolutions.net>
Fri, 12 Dec 2008 21:40:45 +0000 (22:40 +0100)
nl80211.h
phy.c

index 04d4516f9c712e91f4aaf541015c93d61abd9b25..e86ed59f9ad59b25317ce2be2f084a73063704c5 100644 (file)
--- a/nl80211.h
+++ b/nl80211.h
@@ -201,13 +201,13 @@ enum nl80211_commands {
  * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
  * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
  * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
- * @NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET: included with NL80211_ATTR_WIPHY_FREQ
+ * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
  *     if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):
- *     NL80211_SEC_CHAN_NO_HT = HT not allowed (i.e., same as not including
+ *     NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
  *             this attribute)
- *     NL80211_SEC_CHAN_DISABLED = HT20 only
- *     NL80211_SEC_CHAN_BELOW = secondary channel is below the primary channel
- *     NL80211_SEC_CHAN_ABOVE = secondary channel is above the primary channel
+ *     NL80211_CHAN_HT20 = HT20 only
+ *     NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
+ *     NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
  *
  * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
  * @NL80211_ATTR_IFNAME: network interface name
@@ -344,7 +344,7 @@ enum nl80211_attrs {
 
        NL80211_ATTR_WIPHY_TXQ_PARAMS,
        NL80211_ATTR_WIPHY_FREQ,
-       NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET,
+       NL80211_ATTR_WIPHY_CHANNEL_TYPE,
 
        /* add attributes here, update the policy in nl80211.c */
 
@@ -424,6 +424,32 @@ enum nl80211_sta_flags {
        NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
 };
 
+/**
+ * enum nl80211_rate_info - bitrate information
+ *
+ * These attribute types are used with %NL80211_STA_INFO_TXRATE
+ * when getting information about the bitrate of a station.
+ *
+ * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
+ * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
+ * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
+ * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
+ * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
+ * @__NL80211_RATE_INFO_AFTER_LAST: internal use
+ */
+enum nl80211_rate_info {
+       __NL80211_RATE_INFO_INVALID,
+       NL80211_RATE_INFO_BITRATE,
+       NL80211_RATE_INFO_MCS,
+       NL80211_RATE_INFO_40_MHZ_WIDTH,
+       NL80211_RATE_INFO_SHORT_GI,
+
+       /* keep last */
+       __NL80211_RATE_INFO_AFTER_LAST,
+       NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
+};
+
 /**
  * enum nl80211_sta_info - station information
  *
@@ -436,6 +462,9 @@ enum nl80211_sta_flags {
  * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
+ * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
+ * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
+ *     containing info as possible, see &enum nl80211_sta_info_txrate.
  */
 enum nl80211_sta_info {
        __NL80211_STA_INFO_INVALID,
@@ -445,6 +474,8 @@ enum nl80211_sta_info {
        NL80211_STA_INFO_LLID,
        NL80211_STA_INFO_PLID,
        NL80211_STA_INFO_PLINK_STATE,
+       NL80211_STA_INFO_SIGNAL,
+       NL80211_STA_INFO_TX_BITRATE,
 
        /* keep last */
        __NL80211_STA_INFO_AFTER_LAST,
@@ -774,10 +805,10 @@ enum nl80211_txq_q {
        NL80211_TXQ_Q_BK
 };
 
-enum nl80211_sec_chan_offset {
-       NL80211_SEC_CHAN_NO_HT /* No HT */,
-       NL80211_SEC_CHAN_DISABLED /* HT20 only */,
-       NL80211_SEC_CHAN_BELOW /* HT40- */,
-       NL80211_SEC_CHAN_ABOVE /* HT40+ */
+enum nl80211_channel_type {
+       NL80211_CHAN_NO_HT,
+       NL80211_CHAN_HT20,
+       NL80211_CHAN_HT40MINUS,
+       NL80211_CHAN_HT40PLUS
 };
 #endif /* __LINUX_NL80211_H */
diff --git a/phy.c b/phy.c
index 74cc1764e81d8863e01acebffd1b56b825e7cb15..f5850dc167d528b1f1b0d62774f36695ad735648 100644 (file)
--- a/phy.c
+++ b/phy.c
@@ -33,11 +33,11 @@ static int handle_freqchan(struct nl_msg *msg, bool chan,
                const char *name;
                unsigned int val;
        } htmap[] = {
-               { .name = "HT20", .val = NL80211_SEC_CHAN_DISABLED, },
-               { .name = "HT40+", .val = NL80211_SEC_CHAN_ABOVE, },
-               { .name = "HT40-", .val = NL80211_SEC_CHAN_BELOW, },
+               { .name = "HT20", .val = NL80211_CHAN_HT20, },
+               { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, },
+               { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, },
        };
-       unsigned int htval = NL80211_SEC_CHAN_NO_HT;
+       unsigned int htval = NL80211_CHAN_NO_HT;
        unsigned int freq;
        int i;
 
@@ -51,7 +51,7 @@ static int handle_freqchan(struct nl_msg *msg, bool chan,
                                break;
                        }
                }
-               if (htval == NL80211_SEC_CHAN_NO_HT)
+               if (htval == NL80211_CHAN_NO_HT)
                        return 1;
        }
 
@@ -60,7 +60,7 @@ static int handle_freqchan(struct nl_msg *msg, bool chan,
                freq = ieee80211_channel_to_frequency(freq);
 
        NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
-       NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET, htval);
+       NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, htval);
 
        return 0;
  nla_put_failure: