{nl,cfg,mac}80211: implement dot11MeshHWMProotInterval and dot11MeshHWMPactivePathToR...
[pandora-kernel.git] / include / net / cfg80211.h
index 0289d4c..e52b38d 100644 (file)
@@ -404,6 +404,8 @@ struct cfg80211_beacon_data {
  *
  * Used to configure an AP interface.
  *
+ * @channel: the channel to start the AP on
+ * @channel_type: the channel type to use
  * @beacon: beacon data
  * @beacon_interval: beacon interval
  * @dtim_period: DTIM period
@@ -417,6 +419,9 @@ struct cfg80211_beacon_data {
  * @inactivity_timeout: time in seconds to determine station's inactivity.
  */
 struct cfg80211_ap_settings {
+       struct ieee80211_channel *channel;
+       enum nl80211_channel_type channel_type;
+
        struct cfg80211_beacon_data beacon;
 
        int beacon_interval, dtim_period;
@@ -622,10 +627,10 @@ struct sta_bss_parameters {
  * @llid: mesh local link id
  * @plid: mesh peer link id
  * @plink_state: mesh peer link state
- * @signal: the signal strength, type depends on the wiphy's signal_type
      NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
- * @signal_avg: avg signal strength, type depends on the wiphy's signal_type
      NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
+ * @signal: The signal strength, type depends on the wiphy's signal_type.
*     For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
+ * @signal_avg: Average signal strength, type depends on the wiphy's signal_type.
*     For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
  * @txrate: current unicast bitrate from this station
  * @rxrate: current unicast bitrate to this station
  * @rx_packets: packets received from this station
@@ -785,47 +790,97 @@ struct bss_parameters {
        int ht_opmode;
 };
 
-/*
+/**
  * struct mesh_config - 802.11s mesh configuration
  *
  * These parameters can be changed while the mesh is active.
+ *
+ * @dot11MeshRetryTimeout: the initial retry timeout in millisecond units used
+ *     by the Mesh Peering Open message
+ * @dot11MeshConfirmTimeout: the initial retry timeout in millisecond units
+ *     used by the Mesh Peering Open message
+ * @dot11MeshHoldingTimeout: the confirm timeout in millisecond units used by
+ *     the mesh peering management to close a mesh peering
+ * @dot11MeshMaxPeerLinks: the maximum number of peer links allowed on this
+ *     mesh interface
+ * @dot11MeshMaxRetries: the maximum number of peer link open retries that can
+ *     be sent to establish a new peer link instance in a mesh
+ * @dot11MeshTTL: the value of TTL field set at a source mesh STA
+ * @element_ttl: the value of TTL field set at a mesh STA for path selection
+ *     elements
+ * @auto_open_plinks: whether we should automatically open peer links when we
+ *     detect compatible mesh peers
+ * @dot11MeshNbrOffsetMaxNeighbor: the maximum number of neighbors to
+ *     synchronize to for 11s default synchronization method
+ * @dot11MeshHWMPmaxPREQretries: the number of action frames containing a PREQ
+ *     that an originator mesh STA can send to a particular path target
+ * @path_refresh_time: how frequently to refresh mesh paths in milliseconds
+ * @min_discovery_timeout: the minimum length of time to wait until giving up on
+ *     a path discovery in milliseconds
+ * @dot11MeshHWMPactivePathTimeout: the time (in TUs) for which mesh STAs
+ *     receiving a PREQ shall consider the forwarding information from the
+ *     root to be valid. (TU = time unit)
+ * @dot11MeshHWMPpreqMinInterval: the minimum interval of time (in TUs) during
+ *     which a mesh STA can send only one action frame containing a PREQ
+ *     element
+ * @dot11MeshHWMPperrMinInterval: the minimum interval of time (in TUs) during
+ *     which a mesh STA can send only one Action frame containing a PERR
+ *     element
+ * @dot11MeshHWMPnetDiameterTraversalTime: the interval of time (in TUs) that
+ *     it takes for an HWMP information element to propagate across the mesh
+ * @dot11MeshHWMPRootMode: the configuration of a mesh STA as root mesh STA
+ * @dot11MeshHWMPRannInterval: the interval of time (in TUs) between root
+ *     announcements are transmitted
+ * @dot11MeshGateAnnouncementProtocol: whether to advertise that this mesh
+ *     station has access to a broader network beyond the MBSS. (This is
+ *     missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol set to true
+ *     only means that the station will announce others it's a mesh gate, but
+ *     not necessarily using the gate announcement protocol. Still keeping the
+ *     same nomenclature to be in sync with the spec)
+ * @dot11MeshForwarding: whether the Mesh STA is forwarding or non-forwarding
+ *     entity (default is TRUE - forwarding entity)
+ * @rssi_threshold: the threshold for average signal strength of candidate
+ *     station to establish a peer link
+ * @ht_opmode: mesh HT protection mode
+ *
+ * @dot11MeshHWMPactivePathToRootTimeout: The time (in TUs) for which mesh STAs
+ *     receiving a proactive PREQ shall consider the forwarding information to
+ *     the root mesh STA to be valid.
+ *
+ * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive
+ *     PREQs are transmitted.
  */
 struct mesh_config {
-       /* Timeouts in ms */
-       /* Mesh plink management parameters */
        u16 dot11MeshRetryTimeout;
        u16 dot11MeshConfirmTimeout;
        u16 dot11MeshHoldingTimeout;
        u16 dot11MeshMaxPeerLinks;
-       u8  dot11MeshMaxRetries;
-       u8  dot11MeshTTL;
-       /* ttl used in path selection information elements */
-       u8  element_ttl;
+       u8 dot11MeshMaxRetries;
+       u8 dot11MeshTTL;
+       u8 element_ttl;
        bool auto_open_plinks;
-       /* neighbor offset synchronization */
        u32 dot11MeshNbrOffsetMaxNeighbor;
-       /* HWMP parameters */
-       u8  dot11MeshHWMPmaxPREQretries;
+       u8 dot11MeshHWMPmaxPREQretries;
        u32 path_refresh_time;
        u16 min_discovery_timeout;
        u32 dot11MeshHWMPactivePathTimeout;
        u16 dot11MeshHWMPpreqMinInterval;
        u16 dot11MeshHWMPperrMinInterval;
        u16 dot11MeshHWMPnetDiameterTraversalTime;
-       u8  dot11MeshHWMPRootMode;
+       u8 dot11MeshHWMPRootMode;
        u16 dot11MeshHWMPRannInterval;
-       /* This is missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol
-        * set to true only means that the station will announce others it's a
-        * mesh gate, but not necessarily using the gate announcement protocol.
-        * Still keeping the same nomenclature to be in sync with the spec. */
-       bool  dot11MeshGateAnnouncementProtocol;
+       bool dot11MeshGateAnnouncementProtocol;
        bool dot11MeshForwarding;
        s32 rssi_threshold;
        u16 ht_opmode;
+       u32 dot11MeshHWMPactivePathToRootTimeout;
+       u16 dot11MeshHWMProotInterval;
 };
 
 /**
  * struct mesh_setup - 802.11s mesh setup configuration
+ * @channel: the channel to start the mesh network on
+ * @channel_type: the channel type to use
  * @mesh_id: the mesh ID
  * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
  * @sync_method: which synchronization method to use
@@ -840,6 +895,8 @@ struct mesh_config {
  * These parameters are fixed when the mesh is created.
  */
 struct mesh_setup {
+       struct ieee80211_channel *channel;
+       enum nl80211_channel_type channel_type;
        const u8 *mesh_id;
        u8 mesh_id_len;
        u8 sync_method;
@@ -1411,11 +1468,14 @@ struct cfg80211_gtk_rekey_data {
  *
  * @set_txq_params: Set TX queue parameters
  *
- * @set_channel: Set channel for a given wireless interface. Some devices
- *     may support multi-channel operation (by channel hopping) so cfg80211
- *     doesn't verify much. Note, however, that the passed netdev may be
- *     %NULL as well if the user requested changing the channel for the
- *     device itself, or for a monitor interface.
+ * @libertas_set_mesh_channel: Only for backward compatibility for libertas,
+ *     as it doesn't implement join_mesh and needs to set the channel to
+ *     join the mesh instead.
+ *
+ * @set_monitor_channel: Set the monitor mode channel for the device. If other
+ *     interfaces are active this callback should reject the configuration.
+ *     If no interfaces are active or the device is down, the channel should
+ *     be stored for when a monitor interface becomes active.
  * @get_channel: Get the current operating channel, should return %NULL if
  *     there's no single defined operating channel if for example the
  *     device implements channel hopping for multi-channel virtual interfaces.
@@ -1605,9 +1665,13 @@ struct cfg80211_ops {
        int     (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
                                  struct ieee80211_txq_params *params);
 
-       int     (*set_channel)(struct wiphy *wiphy, struct net_device *dev,
-                              struct ieee80211_channel *chan,
-                              enum nl80211_channel_type channel_type);
+       int     (*libertas_set_mesh_channel)(struct wiphy *wiphy,
+                                            struct net_device *dev,
+                                            struct ieee80211_channel *chan);
+
+       int     (*set_monitor_channel)(struct wiphy *wiphy,
+                                      struct ieee80211_channel *chan,
+                                      enum nl80211_channel_type channel_type);
 
        int     (*scan)(struct wiphy *wiphy, struct net_device *dev,
                        struct cfg80211_scan_request *request);
@@ -2263,7 +2327,10 @@ struct cfg80211_cached_keys;
  * @netdev: (private) Used to reference back to the netdev
  * @current_bss: (private) Used by the internal configuration code
  * @channel: (private) Used by the internal configuration code to track
- *     user-set AP, monitor and WDS channels for wireless extensions
+ *     the user-set AP, monitor and WDS channel
+ * @preset_chan: (private) Used by the internal configuration code to
+ *     track the channel to be used for AP later
+ * @preset_chantype: (private) the corresponding channel type
  * @bssid: (private) Used by the internal configuration code
  * @ssid: (private) Used by the internal configuration code
  * @ssid_len: (private) Used by the internal configuration code
@@ -2313,7 +2380,8 @@ struct wireless_dev {
        spinlock_t event_lock;
 
        struct cfg80211_internal_bss *current_bss; /* associated / joined */
-       struct ieee80211_channel *channel;
+       struct ieee80211_channel *preset_chan;
+       enum nl80211_channel_type preset_chantype;
 
        bool ps;
        int ps_timeout;
@@ -3359,11 +3427,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy,
                                 const u8 *frame, size_t len,
                                 int freq, int sig_dbm, gfp_t gfp);
 
-/*
+/**
  * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used
  * @wiphy: the wiphy
  * @chan: main channel
  * @channel_type: HT mode
+ *
+ * This function returns true if there is no secondary channel or the secondary
+ * channel can be used for beaconing (i.e. is not a radar channel etc.)
  */
 bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy,
                                  struct ieee80211_channel *chan,