Merge tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / include / net / mac80211.h
index cca510a..e2dba93 100644 (file)
@@ -715,6 +715,7 @@ enum mac80211_tx_info_flags {
  *     frame (PS-Poll or uAPSD).
  * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information
  * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame
+ * @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path
  *
  * These flags are used in tx_info->control.flags.
  */
@@ -723,6 +724,7 @@ enum mac80211_tx_control_flags {
        IEEE80211_TX_CTRL_PS_RESPONSE           = BIT(1),
        IEEE80211_TX_CTRL_RATE_INJECT           = BIT(2),
        IEEE80211_TX_CTRL_AMSDU                 = BIT(3),
+       IEEE80211_TX_CTRL_FAST_XMIT             = BIT(4),
 };
 
 /*
@@ -809,14 +811,18 @@ enum mac80211_rate_control_flags {
  * in the control information, and it will be filled by the rate
  * control algorithm according to what should be sent. For example,
  * if this array contains, in the format { <idx>, <count> } the
- * information
+ * information::
+ *
  *    { 3, 2 }, { 2, 2 }, { 1, 4 }, { -1, 0 }, { -1, 0 }
+ *
  * then this means that the frame should be transmitted
  * up to twice at rate 3, up to twice at rate 2, and up to four
  * times at rate 1 if it doesn't get acknowledged. Say it gets
  * acknowledged by the peer after the fifth attempt, the status
- * information should then contain
+ * information should then contain::
+ *
  *   { 3, 2 }, { 2, 2 }, { 1, 1 }, { -1, 0 } ...
+ *
  * since it was transmitted twice at rate 3, twice at rate 2
  * and once at rate 1 after which we received an acknowledgement.
  */
@@ -1166,8 +1172,8 @@ enum mac80211_rx_vht_flags {
  * @rate_idx: index of data rate into band's supported rates or MCS index if
  *     HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT)
  * @vht_nss: number of streams (VHT only)
- * @flag: %RX_FLAG_*
- * @vht_flag: %RX_VHT_FLAG_*
+ * @flag: %RX_FLAG_\*
+ * @vht_flag: %RX_VHT_FLAG_\*
  * @rx_flags: internal RX flags for mac80211
  * @ampdu_reference: A-MPDU reference number, must be a different value for
  *     each A-MPDU but the same for each subframe within one A-MPDU
@@ -1430,7 +1436,7 @@ enum ieee80211_vif_flags {
  * @probe_req_reg: probe requests should be reported to mac80211 for this
  *     interface.
  * @drv_priv: data area for driver use, will always be aligned to
- *     sizeof(void *).
+ *     sizeof(void \*).
  * @txq: the multicast data TX queue (if driver uses the TXQ abstraction)
  */
 struct ieee80211_vif {
@@ -1735,10 +1741,13 @@ struct ieee80211_sta_rates {
  * @supp_rates: Bitmap of supported rates (per band)
  * @ht_cap: HT capabilities of this STA; restricted to our own capabilities
  * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
+ * @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU
+ *     that this station is allowed to transmit to us.
+ *     Can be modified by driver.
  * @wme: indicates whether the STA supports QoS/WME (if local devices does,
  *     otherwise always false)
  * @drv_priv: data area for driver use, will always be aligned to
- *     sizeof(void *), size is determined in hw information.
+ *     sizeof(void \*), size is determined in hw information.
  * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
  *     if wme is supported.
  * @max_sp: max Service Period. Only valid if wme is supported.
@@ -1775,6 +1784,7 @@ struct ieee80211_sta {
        u16 aid;
        struct ieee80211_sta_ht_cap ht_cap;
        struct ieee80211_sta_vht_cap vht_cap;
+       u8 max_rx_aggregation_subframes;
        bool wme;
        u8 uapsd_queues;
        u8 max_sp;
@@ -2014,6 +2024,11 @@ struct ieee80211_txq {
  * @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list
  *     skbs, needed for zero-copy software A-MSDU.
  *
+ * @IEEE80211_HW_REPORTS_LOW_ACK: The driver (or firmware) reports low ack event
+ *     by ieee80211_report_low_ack() based on its own algorithm. For such
+ *     drivers, mac80211 packet loss mechanism will not be triggered and driver
+ *     is completely depending on firmware event for station kickout.
+ *
  * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
  */
 enum ieee80211_hw_flags {
@@ -2054,6 +2069,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_USES_RSS,
        IEEE80211_HW_TX_AMSDU,
        IEEE80211_HW_TX_FRAG_LIST,
+       IEEE80211_HW_REPORTS_LOW_ACK,
 
        /* keep last, obviously */
        NUM_IEEE80211_HW_FLAGS
@@ -2134,12 +2150,20 @@ enum ieee80211_hw_flags {
  *
  * @radiotap_mcs_details: lists which MCS information can the HW
  *     reports, by default it is set to _MCS, _GI and _BW but doesn't
- *     include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only
+ *     include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_\* values, only
  *     adding _BW is supported today.
  *
  * @radiotap_vht_details: lists which VHT MCS information the HW reports,
  *     the default is _GI | _BANDWIDTH.
- *     Use the %IEEE80211_RADIOTAP_VHT_KNOWN_* values.
+ *     Use the %IEEE80211_RADIOTAP_VHT_KNOWN_\* values.
+ *
+ * @radiotap_timestamp: Information for the radiotap timestamp field; if the
+ *     'units_pos' member is set to a non-negative value it must be set to
+ *     a combination of a IEEE80211_RADIOTAP_TIMESTAMP_UNIT_* and a
+ *     IEEE80211_RADIOTAP_TIMESTAMP_SPOS_* value, and then the timestamp
+ *     field will be added and populated from the &struct ieee80211_rx_status
+ *     device_timestamp. If the 'accuracy' member is non-negative, it's put
+ *     into the accuracy radiotap field and the accuracy known flag is set.
  *
  * @netdev_features: netdev features to be set in each netdev created
  *     from this HW. Note that not all features are usable with mac80211,
@@ -2159,6 +2183,8 @@ enum ieee80211_hw_flags {
  * @n_cipher_schemes: a size of an array of cipher schemes definitions.
  * @cipher_schemes: a pointer to an array of cipher scheme definitions
  *     supported by HW.
+ * @max_nan_de_entries: maximum number of NAN DE functions supported by the
+ *     device.
  */
 struct ieee80211_hw {
        struct ieee80211_conf conf;
@@ -2184,11 +2210,16 @@ struct ieee80211_hw {
        u8 offchannel_tx_hw_queue;
        u8 radiotap_mcs_details;
        u16 radiotap_vht_details;
+       struct {
+               int units_pos;
+               s16 accuracy;
+       } radiotap_timestamp;
        netdev_features_t netdev_features;
        u8 uapsd_queues;
        u8 uapsd_max_sp_len;
        u8 n_cipher_schemes;
        const struct ieee80211_cipher_scheme *cipher_schemes;
+       u8 max_nan_de_entries;
 };
 
 static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
@@ -2459,6 +2490,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
  * in the software stack cares about, we will, in the future, have mac80211
  * tell the driver which information elements are interesting in the sense
  * that we want to see changes in them. This will include
+ *
  *  - a list of information element IDs
  *  - a list of OUIs for the vendor information element
  *
@@ -3085,11 +3117,8 @@ enum ieee80211_reconfig_type {
  *
  * @sta_add_debugfs: Drivers can use this callback to add debugfs files
  *     when a station is added to mac80211's station list. This callback
- *     and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS
- *     conditional. This callback can sleep.
- *
- * @sta_remove_debugfs: Remove the debugfs files which were added using
- *     @sta_add_debugfs. This callback can sleep.
+ *     should be within a CONFIG_MAC80211_DEBUGFS conditional. This
+ *     callback can sleep.
  *
  * @sta_notify: Notifies low level driver about power state transition of an
  *     associated station, AP,  IBSS/WDS/mesh peer etc. For a VIF operating
@@ -3147,6 +3176,12 @@ enum ieee80211_reconfig_type {
  *     required function.
  *     The callback can sleep.
  *
+ * @offset_tsf: Offset the TSF timer by the specified value in the
+ *     firmware/hardware.  Preferred to set_tsf as it avoids delay between
+ *     calling set_tsf() and hardware getting programmed, which will show up
+ *     as TSF delay. Is not a required function.
+ *     The callback can sleep.
+ *
  * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
  *     with other STAs in the IBSS. This is only used in IBSS mode. This
  *     function is optional if the firmware/hardware takes full care of
@@ -3401,6 +3436,21 @@ enum ieee80211_reconfig_type {
  *     synchronization which is needed in case driver has in its RSS queues
  *     pending frames that were received prior to the control path action
  *     currently taken (e.g. disassociation) but are not processed yet.
+ *
+ * @start_nan: join an existing NAN cluster, or create a new one.
+ * @stop_nan: leave the NAN cluster.
+ * @nan_change_conf: change NAN configuration. The data in cfg80211_nan_conf
+ *     contains full new configuration and changes specify which parameters
+ *     are changed with respect to the last NAN config.
+ *     The driver gets both full configuration and the changed parameters since
+ *     some devices may need the full configuration while others need only the
+ *     changed parameters.
+ * @add_nan_func: Add a NAN function. Returns 0 on success. The data in
+ *     cfg80211_nan_func must not be referenced outside the scope of
+ *     this call.
+ * @del_nan_func: Remove a NAN function. The driver must call
+ *     ieee80211_nan_func_terminated() with
+ *     NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal.
  */
 struct ieee80211_ops {
        void (*tx)(struct ieee80211_hw *hw,
@@ -3485,10 +3535,6 @@ struct ieee80211_ops {
                                struct ieee80211_vif *vif,
                                struct ieee80211_sta *sta,
                                struct dentry *dir);
-       void (*sta_remove_debugfs)(struct ieee80211_hw *hw,
-                                  struct ieee80211_vif *vif,
-                                  struct ieee80211_sta *sta,
-                                  struct dentry *dir);
 #endif
        void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                        enum sta_notify_cmd, struct ieee80211_sta *sta);
@@ -3516,6 +3562,8 @@ struct ieee80211_ops {
        u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
        void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                        u64 tsf);
+       void (*offset_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+                          s64 offset);
        void (*reset_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
        int (*tx_last_beacon)(struct ieee80211_hw *hw);
        int (*ampdu_action)(struct ieee80211_hw *hw,
@@ -3640,6 +3688,21 @@ struct ieee80211_ops {
        void (*wake_tx_queue)(struct ieee80211_hw *hw,
                              struct ieee80211_txq *txq);
        void (*sync_rx_queues)(struct ieee80211_hw *hw);
+
+       int (*start_nan)(struct ieee80211_hw *hw,
+                        struct ieee80211_vif *vif,
+                        struct cfg80211_nan_conf *conf);
+       int (*stop_nan)(struct ieee80211_hw *hw,
+                       struct ieee80211_vif *vif);
+       int (*nan_change_conf)(struct ieee80211_hw *hw,
+                              struct ieee80211_vif *vif,
+                              struct cfg80211_nan_conf *conf, u32 changes);
+       int (*add_nan_func)(struct ieee80211_hw *hw,
+                           struct ieee80211_vif *vif,
+                           const struct cfg80211_nan_func *nan_func);
+       void (*del_nan_func)(struct ieee80211_hw *hw,
+                           struct ieee80211_vif *vif,
+                           u8 instance_id);
 };
 
 /**
@@ -5713,4 +5776,36 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
 void ieee80211_txq_get_depth(struct ieee80211_txq *txq,
                             unsigned long *frame_cnt,
                             unsigned long *byte_cnt);
+
+/**
+ * ieee80211_nan_func_terminated - notify about NAN function termination.
+ *
+ * This function is used to notify mac80211 about NAN function termination.
+ * Note that this function can't be called from hard irq.
+ *
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ * @inst_id: the local instance id
+ * @reason: termination reason (one of the NL80211_NAN_FUNC_TERM_REASON_*)
+ * @gfp: allocation flags
+ */
+void ieee80211_nan_func_terminated(struct ieee80211_vif *vif,
+                                  u8 inst_id,
+                                  enum nl80211_nan_func_term_reason reason,
+                                  gfp_t gfp);
+
+/**
+ * ieee80211_nan_func_match - notify about NAN function match event.
+ *
+ * This function is used to notify mac80211 about NAN function match. The
+ * cookie inside the match struct will be assigned by mac80211.
+ * Note that this function can't be called from hard irq.
+ *
+ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
+ * @match: match event information
+ * @gfp: allocation flags
+ */
+void ieee80211_nan_func_match(struct ieee80211_vif *vif,
+                             struct cfg80211_nan_match_params *match,
+                             gfp_t gfp);
+
 #endif /* MAC80211_H */