mac80211: Set the correct values for hwmp (1) and airtimeLinkMetric (1)
[carl9170fw.git] / include / linux / ieee80211.h
index d2d4435610290efd3b6005fd277110149879ad95..e4448caebc8b62835d5a064e1e6758335f17e4bf 100644 (file)
@@ -557,6 +557,15 @@ static inline unsigned int ieee80211_hdrlen(__le16 fc)
         return hdrlen;
 }
 
+/**
+ * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
+ * @seq_ctrl: frame sequence control bytes in little-endian byteorder
+ */
+static inline int ieee80211_is_first_frag(__le16 seq_ctrl)
+{
+       return (seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0;
+}
+
 struct ieee80211s_hdr {
        u8 flags;
        u8 ttl;
@@ -644,9 +653,9 @@ struct ieee80211_rann_ie {
        u8 rann_hopcount;
        u8 rann_ttl;
        u8 rann_addr[6];
-       u32 rann_seq;
-       u32 rann_interval;
-       u32 rann_metric;
+       __le32 rann_seq;
+       __le32 rann_interval;
+       __le32 rann_metric;
 } __attribute__ ((packed));
 
 enum ieee80211_rann_flags {
@@ -1028,13 +1037,13 @@ enum ieee80211_min_mpdu_spacing {
 };
 
 /**
- * struct ieee80211_ht_info - HT information
+ * struct ieee80211_ht_operation - HT operation IE
  *
- * This structure is the "HT information element" as
- * described in 802.11n D5.0 7.3.2.58
+ * This structure is the "HT operation element" as
+ * described in 802.11n-2009 7.3.2.57
  */
-struct ieee80211_ht_info {
-       u8 control_chan;
+struct ieee80211_ht_operation {
+       u8 primary_chan;
        u8 ht_param;
        __le16 operation_mode;
        __le16 stbc_param;
@@ -1048,8 +1057,6 @@ struct ieee80211_ht_info {
 #define                IEEE80211_HT_PARAM_CHA_SEC_BELOW        0x03
 #define IEEE80211_HT_PARAM_CHAN_WIDTH_ANY              0x04
 #define IEEE80211_HT_PARAM_RIFS_MODE                   0x08
-#define IEEE80211_HT_PARAM_SPSMP_SUPPORT               0x10
-#define IEEE80211_HT_PARAM_SERV_INTERVAL_GRAN          0xE0
 
 /* for operation_mode */
 #define IEEE80211_HT_OP_MODE_PROTECTION                        0x0003
@@ -1322,7 +1329,7 @@ enum ieee80211_eid {
        WLAN_EID_EXT_SUPP_RATES = 50,
 
        WLAN_EID_HT_CAPABILITY = 45,
-       WLAN_EID_HT_INFORMATION = 61,
+       WLAN_EID_HT_OPERATION = 61,
 
        WLAN_EID_RSN = 48,
        WLAN_EID_MMIE = 76,
@@ -1461,6 +1468,18 @@ enum ieee80211_tdls_actioncode {
 /* TDLS specific payload type in the LLC/SNAP header */
 #define WLAN_TDLS_SNAP_RFTYPE  0x2
 
+/**
+ * enum - mesh synchronization method identifier
+ *
+ * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method
+ * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method
+ * that will be specified in a vendor specific information element
+ */
+enum {
+       IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1,
+       IEEE80211_SYNC_METHOD_VENDOR = 255,
+};
+
 /**
  * enum - mesh path selection protocol identifier
  *
@@ -1469,7 +1488,7 @@ enum ieee80211_tdls_actioncode {
  * be specified in a vendor specific information element
  */
 enum {
-       IEEE80211_PATH_PROTOCOL_HWMP = 0,
+       IEEE80211_PATH_PROTOCOL_HWMP = 1,
        IEEE80211_PATH_PROTOCOL_VENDOR = 255,
 };
 
@@ -1481,7 +1500,7 @@ enum {
  * specified in a vendor specific information element
  */
 enum {
-       IEEE80211_PATH_METRIC_AIRTIME = 0,
+       IEEE80211_PATH_METRIC_AIRTIME = 1,
        IEEE80211_PATH_METRIC_VENDOR = 255,
 };
 
@@ -1724,6 +1743,23 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
        return false;
 }
 
+/**
+ * ieee80211_is_public_action - check if frame is a public action frame
+ * @hdr: the frame
+ * @len: length of the frame
+ */
+static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
+                                             size_t len)
+{
+       struct ieee80211_mgmt *mgmt = (void *)hdr;
+
+       if (len < IEEE80211_MIN_ACTION_SIZE)
+               return false;
+       if (!ieee80211_is_action(hdr->frame_control))
+               return false;
+       return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
+}
+
 /**
  * ieee80211_fhss_chan_to_freq - get channel frequency
  * @channel: the FHSS channel