2 * Copyright 2002-2005, Devicescape Software, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
12 /* Stations flags (struct sta_info::flags) */
13 #define WLAN_STA_AUTH BIT(0)
14 #define WLAN_STA_ASSOC BIT(1)
15 #define WLAN_STA_PS BIT(2)
16 #define WLAN_STA_TIM BIT(3) /* TIM bit is on for PS stations */
17 #define WLAN_STA_PERM BIT(4) /* permanent; do not remove entry on expiration */
18 #define WLAN_STA_AUTHORIZED BIT(5) /* If 802.1X is used, this flag is
19 * controlling whether STA is authorized to
20 * send and receive non-IEEE 802.1X frames
22 #define WLAN_STA_SHORT_PREAMBLE BIT(7)
23 #define WLAN_STA_WME BIT(9)
24 #define WLAN_STA_XR BIT(26)
25 #define WLAN_STA_WDS BIT(27)
29 struct list_head list
;
30 struct sta_info
*hnext
; /* next entry in hash table list */
31 atomic_t users
; /* number of users (do not remove if > 0) */
34 u16 aid
; /* STA's unique AID (1..2007), 0 = not yet assigned */
35 u32 flags
; /* WLAN_STA_ */
37 struct sk_buff_head ps_tx_buf
; /* buffer of TX frames for station in
38 * power saving state */
39 int pspoll
; /* whether STA has send a PS Poll frame */
40 struct sk_buff_head tx_filtered
; /* buffer of TX frames that were
41 * already given to low-level driver,
42 * but were filtered */
45 unsigned long rx_packets
, tx_packets
; /* number of RX/TX MSDUs */
46 unsigned long rx_bytes
, tx_bytes
;
47 unsigned long tx_retry_failed
, tx_retry_count
;
48 unsigned long tx_filtered_count
;
50 unsigned int wep_weak_iv_count
; /* number of RX frames with weak IV */
52 unsigned long last_rx
;
53 u32 supp_rates
; /* bitmap of supported rates in local->curr_rates */
54 int txrate
; /* index in local->curr_rates */
55 int last_txrate
; /* last rate used to send a frame to this STA */
58 struct net_device
*dev
; /* which net device is this station associated
61 struct ieee80211_key
*key
;
63 u32 tx_num_consecutive_failures
;
69 /* last received seq/frag number from this STA (per RX queue) */
70 u16 last_seq_ctrl
[NUM_RX_DATA_QUEUES
];
71 unsigned long num_duplicates
; /* number of duplicate frames received
73 unsigned long tx_fragments
; /* number of transmitted MPDUs */
74 unsigned long rx_fragments
; /* number of received MPDUs */
75 unsigned long rx_dropped
; /* number of dropped MPDUs from this STA */
77 int last_rssi
; /* RSSI of last received frame from this STA */
78 int last_ack_rssi
[3]; /* RSSI of last received ACKs from this STA */
79 unsigned long last_ack
;
86 int key_idx_compression
; /* key table index for compression and TX
87 * filtering; used only if sta->key is not
90 int proc_entry_added
:1;
91 int assoc_ap
:1; /* whether this is an AP that we are associated with
94 #ifdef CONFIG_HOSTAPD_WPA_TESTING
96 #endif /* CONFIG_HOSTAPD_WPA_TESTING */
98 #ifdef CONFIG_IEEE80211_DEBUG_COUNTERS
99 unsigned int wme_rx_queue
[NUM_RX_DATA_QUEUES
];
100 unsigned int wme_tx_queue
[NUM_RX_DATA_QUEUES
];
101 #endif /* CONFIG_IEEE80211_DEBUG_COUNTERS */
107 /* Maximum number of concurrently registered stations */
108 #define MAX_STA_COUNT 2007
110 /* Maximum number of AIDs to use for STAs; must be 2007 or lower
111 * (IEEE 802.11 beacon format limitation) */
112 #define MAX_AID_TABLE_SIZE 2007
114 #define STA_HASH_SIZE 256
115 #define STA_HASH(sta) (sta[5])
118 /* Maximum number of frames to buffer per power saving station */
119 #define STA_MAX_TX_BUFFER 128
121 /* Buffered frame expiry time */
122 #define STA_TX_BUFFER_EXPIRE (10 * HZ)
124 /* How often station data is cleaned up (e.g., expiration of buffered frames)
126 #define STA_INFO_CLEANUP_INTERVAL (10 * HZ)
129 struct sta_info
* sta_info_get(struct ieee80211_local
*local
, u8
*addr
);
130 int sta_info_min_txrate_get(struct ieee80211_local
*local
);
131 void sta_info_release(struct ieee80211_local
*local
, struct sta_info
*sta
);
132 struct sta_info
* sta_info_add(struct ieee80211_local
*local
,
133 struct net_device
*dev
, u8
*addr
);
134 void sta_info_free(struct ieee80211_local
*local
, struct sta_info
*sta
,
136 void sta_info_init(struct ieee80211_local
*local
);
137 void sta_info_start(struct ieee80211_local
*local
);
138 void sta_info_stop(struct ieee80211_local
*local
);
139 void sta_info_remove_aid_ptr(struct sta_info
*sta
);
140 void sta_info_flush(struct ieee80211_local
*local
, struct net_device
*dev
);
142 #endif /* STA_INFO_H */