* @list: global linked list entry
* @hnext: hash table linked list pointer
* @local: pointer to the global information
+ * @sdata: TBD
+ * @key: TBD
+ * @rate_ctrl: TBD
+ * @rate_ctrl_priv: TBD
+ * @lock: used for locking all fields that require locking, see comments
+ * in the header file.
+ * @flaglock: spinlock for flags accesses
* @addr: MAC address of this STA
* @aid: STA's unique AID (1..2007, 0 = not assigned yet),
* only used in AP (and IBSS?) mode
+ * @listen_interval: TBD
+ * @pin_status: TBD
* @flags: STA flags, see &enum ieee80211_sta_info_flags
* @ps_tx_buf: buffer of frames to transmit to this station
* when it leaves power saving state
* power saving state
* @rx_packets: Number of MSDUs received from this STA
* @rx_bytes: Number of bytes received from this STA
- * @supp_rates: Bitmap of supported rates (per band)
- * @ht_info: HT capabilities of this STA
- * @lock: used for locking all fields that require locking, see comments
- * in the header file.
+ * @wep_weak_iv_count: TBD
+ * @last_rx: TBD
+ * @num_duplicates: number of duplicate frames received from this STA
+ * @rx_fragments: number of received MPDUs
+ * @rx_dropped: number of dropped MPDUs from this STA
+ * @last_signal: signal of last received frame from this STA
+ * @last_qual: qual of last received frame from this STA
+ * @last_noise: noise of last received frame from this STA
+ * @last_seq_ctrl: last received seq/frag number from this STA (per RX queue)
+ * @tx_filtered_count: TBD
+ * @tx_retry_failed: TBD
+ * @tx_retry_count: TBD
+ * @fail_avg: moving percentage of failed MSDUs
+ * @tx_packets: number of RX/TX MSDUs
+ * @tx_bytes: TBD
+ * @tx_fragments: number of transmitted MPDUs
+ * @last_txrate_idx: Index of the last used transmit rate
+ * @tid_seq: TBD
+ * @ampdu_mlme: TBD
+ * @timer_to_tid: identity mapping to ID timers
+ * @tid_to_tx_q: map tid to tx queue
+ * @llid: Local link ID
+ * @plid: Peer link ID
+ * @reason: Cancel reason on PLINK_HOLDING state
+ * @plink_retries: Retries in establishment
+ * @ignore_plink_timer: TBD
+ * @plink_state plink_state: TBD
+ * @plink_timeout: TBD
+ * @plink_timer: TBD
+ * @debugfs: debug filesystem info
+ * @sta: station information we share with the driver
*/
struct sta_info {
/* General information, mostly static */
struct rate_control_ref *rate_ctrl;
void *rate_ctrl_priv;
spinlock_t lock;
- struct ieee80211_ht_info ht_info;
- u64 supp_rates[IEEE80211_NUM_BANDS];
- u8 addr[ETH_ALEN];
- u16 aid;
+ spinlock_t flaglock;
+
u16 listen_interval;
/*
*/
u8 pin_status;
- /* frequently updated information, locked with lock spinlock */
+ /*
+ * frequently updated, locked with own spinlock (flaglock),
+ * use the accessors defined below
+ */
u32 flags;
/*
unsigned long rx_packets, rx_bytes;
unsigned long wep_weak_iv_count;
unsigned long last_rx;
- unsigned long num_duplicates; /* number of duplicate frames received
- * from this STA */
- unsigned long rx_fragments; /* number of received MPDUs */
- unsigned long rx_dropped; /* number of dropped MPDUs from this STA */
- int last_signal; /* signal of last received frame from this STA */
- int last_qual; /* qual of last received frame from this STA */
- int last_noise; /* noise of last received frame from this STA */
- /* last received seq/frag number from this STA (per RX queue) */
+ unsigned long num_duplicates;
+ unsigned long rx_fragments;
+ unsigned long rx_dropped;
+ int last_signal;
+ int last_qual;
+ int last_noise;
__le16 last_seq_ctrl[NUM_RX_DATA_QUEUES];
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
- unsigned int wme_rx_queue[NUM_RX_DATA_QUEUES];
-#endif
/* Updated from TX status path only, no locking requirements */
unsigned long tx_filtered_count;
unsigned long tx_retry_failed, tx_retry_count;
- /* TODO: update in generic code not rate control? */
- u32 tx_num_consecutive_failures;
- u32 tx_num_mpdu_ok;
- u32 tx_num_mpdu_fail;
/* moving percentage of failed MSDUs */
unsigned int fail_avg;
/* Updated from TX path only, no locking requirements */
- unsigned long tx_packets; /* number of RX/TX MSDUs */
+ unsigned long tx_packets;
unsigned long tx_bytes;
- unsigned long tx_fragments; /* number of transmitted MPDUs */
- int txrate_idx;
- int last_txrate_idx;
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
- unsigned int wme_tx_queue[NUM_RX_DATA_QUEUES];
-#endif
+ unsigned long tx_fragments;
+ unsigned int last_txrate_idx;
+ u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
/*
* Aggregation information, locked with lock.
*/
struct sta_ampdu_mlme ampdu_mlme;
- u8 timer_to_tid[STA_TID_NUM]; /* identity mapping to ID timers */
- u8 tid_to_tx_q[STA_TID_NUM]; /* map tid to tx queue */
+ u8 timer_to_tid[STA_TID_NUM];
+ u8 tid_to_tx_q[STA_TID_NUM];
#ifdef CONFIG_MAC80211_MESH
/*
* Mesh peer link attributes
* TODO: move to a sub-structure that is referenced with pointer?
*/
- __le16 llid; /* Local link ID */
- __le16 plid; /* Peer link ID */
- __le16 reason; /* Cancel reason on PLINK_HOLDING state */
- u8 plink_retries; /* Retries in establishment */
+ __le16 llid;
+ __le16 plid;
+ __le16 reason;
+ u8 plink_retries;
bool ignore_plink_timer;
enum plink_state plink_state;
u32 plink_timeout;
struct dentry *num_ps_buf_frames;
struct dentry *inactive_ms;
struct dentry *last_seq_ctrl;
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
- struct dentry *wme_rx_queue;
- struct dentry *wme_tx_queue;
-#endif
struct dentry *agg_status;
} debugfs;
#endif
+
+ /* keep last! */
+ struct ieee80211_sta sta;
};
static inline enum plink_state sta_plink_state(struct sta_info *sta)
static inline void set_sta_flags(struct sta_info *sta, const u32 flags)
{
- spin_lock_bh(&sta->lock);
+ unsigned long irqfl;
+
+ spin_lock_irqsave(&sta->flaglock, irqfl);
sta->flags |= flags;
- spin_unlock_bh(&sta->lock);
+ spin_unlock_irqrestore(&sta->flaglock, irqfl);
}
static inline void clear_sta_flags(struct sta_info *sta, const u32 flags)
{
- spin_lock_bh(&sta->lock);
+ unsigned long irqfl;
+
+ spin_lock_irqsave(&sta->flaglock, irqfl);
sta->flags &= ~flags;
- spin_unlock_bh(&sta->lock);
+ spin_unlock_irqrestore(&sta->flaglock, irqfl);
}
static inline void set_and_clear_sta_flags(struct sta_info *sta,
const u32 set, const u32 clear)
{
- spin_lock_bh(&sta->lock);
+ unsigned long irqfl;
+
+ spin_lock_irqsave(&sta->flaglock, irqfl);
sta->flags |= set;
sta->flags &= ~clear;
- spin_unlock_bh(&sta->lock);
+ spin_unlock_irqrestore(&sta->flaglock, irqfl);
}
static inline u32 test_sta_flags(struct sta_info *sta, const u32 flags)
{
u32 ret;
+ unsigned long irqfl;
- spin_lock_bh(&sta->lock);
+ spin_lock_irqsave(&sta->flaglock, irqfl);
ret = sta->flags & flags;
- spin_unlock_bh(&sta->lock);
+ spin_unlock_irqrestore(&sta->flaglock, irqfl);
return ret;
}
const u32 flags)
{
u32 ret;
+ unsigned long irqfl;
- spin_lock_bh(&sta->lock);
+ spin_lock_irqsave(&sta->flaglock, irqfl);
ret = sta->flags & flags;
sta->flags &= ~flags;
- spin_unlock_bh(&sta->lock);
+ spin_unlock_irqrestore(&sta->flaglock, irqfl);
return ret;
}
static inline u32 get_sta_flags(struct sta_info *sta)
{
u32 ret;
+ unsigned long irqfl;
- spin_lock_bh(&sta->lock);
+ spin_lock_irqsave(&sta->flaglock, irqfl);
ret = sta->flags;
- spin_unlock_bh(&sta->lock);
+ spin_unlock_irqrestore(&sta->flaglock, irqfl);
return ret;
}
/*
* Get a STA info, must have be under RCU read lock.
*/
-struct sta_info *sta_info_get(struct ieee80211_local *local, u8 *addr);
+struct sta_info *sta_info_get(struct ieee80211_local *local, const u8 *addr);
/*
* Get STA info by index, BROKEN!
*/
* has already unlinked it.
*/
void sta_info_unlink(struct sta_info **sta);
-void __sta_info_unlink(struct sta_info **sta);
void sta_info_destroy(struct sta_info *sta);
void sta_info_set_tim_bit(struct sta_info *sta);
int sta_info_flush(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata);
void sta_info_flush_delayed(struct ieee80211_sub_if_data *sdata);
+void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
+ unsigned long exp_time);
#endif /* STA_INFO_H */