mac80211: clean up mesh code
[firefly-linux-kernel-4.4.55.git] / net / mac80211 / sta_info.h
index f7e65fa3f9ed64e13f28712fae274a9d4ff0c97a..4ad500373d5a7cbed5b9c8eac9b60f5f8c045682 100644 (file)
@@ -107,6 +107,16 @@ struct tid_ampdu_rx {
        struct timer_list session_timer;
 };
 
+enum plink_state {
+       LISTEN,
+       OPN_SNT,
+       OPN_RCVD,
+       CNF_RCVD,
+       ESTAB,
+       HOLDING,
+       BLOCKED
+};
+
 /**
  * struct sta_ampdu_mlme - STA aggregation information.
  *
@@ -144,6 +154,8 @@ struct sta_info {
        unsigned long rx_bytes, tx_bytes;
        unsigned long tx_retry_failed, tx_retry_count;
        unsigned long tx_filtered_count;
+       /* moving percentage of failed MSDUs */
+       unsigned int fail_avg;
 
        unsigned int wep_weak_iv_count; /* number of RX frames with weak IV */
 
@@ -177,8 +189,6 @@ struct sta_info {
        int last_rssi; /* RSSI of last received frame from this STA */
        int last_signal; /* signal of last received frame from this STA */
        int last_noise; /* noise of last received frame from this STA */
-       int last_ack_rssi[3]; /* RSSI of last received ACKs from this STA */
-       unsigned long last_ack;
        int channel_use;
        int channel_use_raw;
 
@@ -194,14 +204,26 @@ struct sta_info {
        struct sta_ampdu_mlme ampdu_mlme;
        u8 timer_to_tid[STA_TID_NUM];   /* convert timer id to tid */
        u8 tid_to_tx_q[STA_TID_NUM];    /* map tid to tx queue */
+#ifdef CONFIG_MAC80211_MESH
+       /* mesh peer link attributes */
+       __le16 llid;            /* Local link ID */
+       __le16 plid;            /* Peer link ID */
+       __le16 reason;          /* Buffer for cancel reason on HOLDING state */
+       enum plink_state plink_state;
+       u32 plink_timeout;
+       struct timer_list plink_timer;
+       u8 plink_retries;       /* Retries in establishment */
+       bool ignore_plink_timer;
+       spinlock_t plink_lock;  /* For peer_state reads / updates and other
+                                  updates in the structure. Ensures robust
+                                  transitions for the peerlink FSM */
+#endif
 
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct sta_info_debugfsdentries {
                struct dentry *dir;
                struct dentry *flags;
                struct dentry *num_ps_buf_frames;
-               struct dentry *last_ack_rssi;
-               struct dentry *last_ack_ms;
                struct dentry *inactive_ms;
                struct dentry *last_seq_ctrl;
 #ifdef CONFIG_MAC80211_DEBUG_COUNTERS
@@ -238,9 +260,11 @@ static inline void __sta_info_get(struct sta_info *sta)
 }
 
 struct sta_info * sta_info_get(struct ieee80211_local *local, u8 *addr);
+struct sta_info *sta_info_get_by_idx(struct ieee80211_local *local, int idx,
+                                     struct net_device *dev);
 void sta_info_put(struct sta_info *sta);
-struct sta_info * sta_info_add(struct ieee80211_local *local,
-                              struct net_device *dev, u8 *addr, gfp_t gfp);
+struct sta_info *sta_info_add(struct ieee80211_local *local,
+                             struct net_device *dev, u8 *addr, gfp_t gfp);
 void sta_info_remove(struct sta_info *sta);
 void sta_info_free(struct sta_info *sta);
 void sta_info_init(struct ieee80211_local *local);