]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/mac80211/sta_info.h
mac80211: retry sending failed BAR frames later instead of tearing down aggr
[mirror_ubuntu-bionic-kernel.git] / net / mac80211 / sta_info.h
index 28beb78e601edc4f0e3f4d8e596f8dad1428c755..56a3d38a2cd19479520f875d080d53127a37a73d 100644 (file)
@@ -86,6 +86,8 @@ enum ieee80211_sta_info_flags {
  * @stop_initiator: initiator of a session stop
  * @tx_stop: TX DelBA frame when stopping
  * @buf_size: reorder buffer size at receiver
+ * @failed_bar_ssn: ssn of the last failed BAR tx attempt
+ * @bar_pending: BAR needs to be re-sent
  *
  * This structure's lifetime is managed by RCU, assignments to
  * the array holding it must hold the aggregation mutex.
@@ -106,6 +108,9 @@ struct tid_ampdu_tx {
        u8 stop_initiator;
        bool tx_stop;
        u8 buf_size;
+
+       u16 failed_bar_ssn;
+       bool bar_pending;
 };
 
 /**
@@ -238,10 +243,12 @@ struct sta_ampdu_mlme {
  * @plink_timer: peer link watch timer
  * @plink_timer_was_running: used by suspend/resume to restore timers
  * @debugfs: debug filesystem info
- * @sta: station information we share with the driver
  * @dead: set to true when sta is unlinked
  * @uploaded: set to true when sta is uploaded to the driver
  * @lost_packets: number of consecutive lost packets
+ * @dummy: indicate a dummy station created for receiving
+ *     EAP frames before association
+ * @sta: station information we share with the driver
  */
 struct sta_info {
        /* General information, mostly static */
@@ -336,6 +343,9 @@ struct sta_info {
 
        unsigned int lost_packets;
 
+       /* should be right in front of sta to be in the same cache line */
+       bool dummy;
+
        /* keep last! */
        struct ieee80211_sta sta;
 };
@@ -436,9 +446,15 @@ rcu_dereference_protected_tid_tx(struct sta_info *sta, int tid)
 struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
                              const u8 *addr);
 
+struct sta_info *sta_info_get_rx(struct ieee80211_sub_if_data *sdata,
+                             const u8 *addr);
+
 struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
                                  const u8 *addr);
 
+struct sta_info *sta_info_get_bss_rx(struct ieee80211_sub_if_data *sdata,
+                                 const u8 *addr);
+
 static inline
 void for_each_sta_info_type_check(struct ieee80211_local *local,
                                  const u8 *addr,
@@ -448,6 +464,22 @@ void for_each_sta_info_type_check(struct ieee80211_local *local,
 }
 
 #define for_each_sta_info(local, _addr, _sta, nxt)                     \
+       for (   /* initialise loop */                                   \
+               _sta = rcu_dereference(local->sta_hash[STA_HASH(_addr)]),\
+               nxt = _sta ? rcu_dereference(_sta->hnext) : NULL;       \
+               /* typecheck */                                         \
+               for_each_sta_info_type_check(local, (_addr), _sta, nxt),\
+               /* continue condition */                                \
+               _sta;                                                   \
+               /* advance loop */                                      \
+               _sta = nxt,                                             \
+               nxt = _sta ? rcu_dereference(_sta->hnext) : NULL        \
+            )                                                          \
+       /* run code only if address matches and it's not a dummy sta */ \
+       if (memcmp(_sta->sta.addr, (_addr), ETH_ALEN) == 0 &&           \
+               !_sta->dummy)
+
+#define for_each_sta_info_rx(local, _addr, _sta, nxt)                  \
        for (   /* initialise loop */                                   \
                _sta = rcu_dereference(local->sta_hash[STA_HASH(_addr)]),\
                nxt = _sta ? rcu_dereference(_sta->hnext) : NULL;       \
@@ -484,6 +516,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
 int sta_info_insert(struct sta_info *sta);
 int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU);
 int sta_info_insert_atomic(struct sta_info *sta);
+int sta_info_reinsert(struct sta_info *sta);
 
 int sta_info_destroy_addr(struct ieee80211_sub_if_data *sdata,
                          const u8 *addr);