aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-03-26 18:21:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-27 16:08:07 -0400
commit056cdd599d004e36de64c925b8a13f6676451360 (patch)
treeb7487ed554d7565ea69fd282f56e97c72565f414 /net/mac80211/ieee80211_i.h
parent8dd62822ddbf6a9314e9b92a3816c04490c91293 (diff)
mac80211: reorder fields to make some structures smaller
This patch reorders some fields in various structures to have less padding within the structures, making them smaller. It doesn't yet make any type adjustments, but often size_t is used for example for IE lengths which is total overkill since size_t will be 8 bytes long on 64-bit yet the length can at most fill a u8. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h50
1 files changed, 27 insertions, 23 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a6485f01b3c8..7ab806602183 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -73,11 +73,12 @@ struct ieee80211_fragment_entry {
73struct ieee80211_sta_bss { 73struct ieee80211_sta_bss {
74 struct list_head list; 74 struct list_head list;
75 struct ieee80211_sta_bss *hnext; 75 struct ieee80211_sta_bss *hnext;
76 size_t ssid_len;
77
76 atomic_t users; 78 atomic_t users;
77 79
78 u8 bssid[ETH_ALEN]; 80 u8 bssid[ETH_ALEN];
79 u8 ssid[IEEE80211_MAX_SSID_LEN]; 81 u8 ssid[IEEE80211_MAX_SSID_LEN];
80 size_t ssid_len;
81 u16 capability; /* host byte order */ 82 u16 capability; /* host byte order */
82 enum ieee80211_band band; 83 enum ieee80211_band band;
83 int freq; 84 int freq;
@@ -98,8 +99,8 @@ struct ieee80211_sta_bss {
98#define IEEE80211_MAX_SUPP_RATES 32 99#define IEEE80211_MAX_SUPP_RATES 32
99 u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; 100 u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
100 size_t supp_rates_len; 101 size_t supp_rates_len;
101 int beacon_int;
102 u64 timestamp; 102 u64 timestamp;
103 int beacon_int;
103 104
104 int probe_resp; 105 int probe_resp;
105 unsigned long last_update; 106 unsigned long last_update;
@@ -154,9 +155,7 @@ struct ieee80211_tx_data {
154 struct ieee80211_local *local; 155 struct ieee80211_local *local;
155 struct ieee80211_sub_if_data *sdata; 156 struct ieee80211_sub_if_data *sdata;
156 struct sta_info *sta; 157 struct sta_info *sta;
157 u16 fc, ethertype;
158 struct ieee80211_key *key; 158 struct ieee80211_key *key;
159 unsigned int flags;
160 159
161 struct ieee80211_tx_control *control; 160 struct ieee80211_tx_control *control;
162 struct ieee80211_channel *channel; 161 struct ieee80211_channel *channel;
@@ -168,8 +167,11 @@ struct ieee80211_tx_data {
168 167
169 /* Extra fragments (in addition to the first fragment 168 /* Extra fragments (in addition to the first fragment
170 * in skb) */ 169 * in skb) */
171 int num_extra_frag;
172 struct sk_buff **extra_frag; 170 struct sk_buff **extra_frag;
171 int num_extra_frag;
172
173 u16 fc, ethertype;
174 unsigned int flags;
173}; 175};
174 176
175 177
@@ -192,12 +194,12 @@ struct ieee80211_rx_data {
192 struct ieee80211_local *local; 194 struct ieee80211_local *local;
193 struct ieee80211_sub_if_data *sdata; 195 struct ieee80211_sub_if_data *sdata;
194 struct sta_info *sta; 196 struct sta_info *sta;
195 u16 fc, ethertype;
196 struct ieee80211_key *key; 197 struct ieee80211_key *key;
197 unsigned int flags;
198
199 struct ieee80211_rx_status *status; 198 struct ieee80211_rx_status *status;
200 struct ieee80211_rate *rate; 199 struct ieee80211_rate *rate;
200
201 u16 fc, ethertype;
202 unsigned int flags;
201 int sent_ps_buffered; 203 int sent_ps_buffered;
202 int queue; 204 int queue;
203 int load; 205 int load;
@@ -222,9 +224,9 @@ struct ieee80211_tx_packet_data {
222struct ieee80211_tx_stored_packet { 224struct ieee80211_tx_stored_packet {
223 struct ieee80211_tx_control control; 225 struct ieee80211_tx_control control;
224 struct sk_buff *skb; 226 struct sk_buff *skb;
225 int num_extra_frag;
226 struct sk_buff **extra_frag; 227 struct sk_buff **extra_frag;
227 struct ieee80211_rate *last_frag_rate; 228 struct ieee80211_rate *last_frag_rate;
229 int num_extra_frag;
228 unsigned int last_frag_rate_ctrl_probe; 230 unsigned int last_frag_rate_ctrl_probe;
229}; 231};
230 232
@@ -246,8 +248,8 @@ struct ieee80211_if_ap {
246 * bitmap_empty :) 248 * bitmap_empty :)
247 * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */ 249 * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
248 u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)]; 250 u8 tim[sizeof(unsigned long) * BITS_TO_LONGS(IEEE80211_MAX_AID + 1)];
249 atomic_t num_sta_ps; /* number of stations in PS mode */
250 struct sk_buff_head ps_bc_buf; 251 struct sk_buff_head ps_bc_buf;
252 atomic_t num_sta_ps; /* number of stations in PS mode */
251 int dtim_count; 253 int dtim_count;
252 int force_unicast_rateidx; /* forced TX rateidx for unicast frames */ 254 int force_unicast_rateidx; /* forced TX rateidx for unicast frames */
253 int max_ratectrl_rateidx; /* max TX rateidx for rate control */ 255 int max_ratectrl_rateidx; /* max TX rateidx for rate control */
@@ -255,8 +257,8 @@ struct ieee80211_if_ap {
255}; 257};
256 258
257struct ieee80211_if_wds { 259struct ieee80211_if_wds {
258 u8 remote_addr[ETH_ALEN];
259 struct sta_info *sta; 260 struct sta_info *sta;
261 u8 remote_addr[ETH_ALEN];
260}; 262};
261 263
262struct ieee80211_if_vlan { 264struct ieee80211_if_vlan {
@@ -290,12 +292,12 @@ struct mesh_config {
290 u8 dot11MeshTTL; 292 u8 dot11MeshTTL;
291 bool auto_open_plinks; 293 bool auto_open_plinks;
292 /* HWMP parameters */ 294 /* HWMP parameters */
293 u32 dot11MeshHWMPactivePathTimeout;
294 u16 dot11MeshHWMPpreqMinInterval;
295 u16 dot11MeshHWMPnetDiameterTraversalTime;
296 u8 dot11MeshHWMPmaxPREQretries; 295 u8 dot11MeshHWMPmaxPREQretries;
297 u32 path_refresh_time; 296 u32 path_refresh_time;
298 u16 min_discovery_timeout; 297 u16 min_discovery_timeout;
298 u32 dot11MeshHWMPactivePathTimeout;
299 u16 dot11MeshHWMPpreqMinInterval;
300 u16 dot11MeshHWMPnetDiameterTraversalTime;
299}; 301};
300 302
301 303
@@ -314,23 +316,22 @@ struct mesh_config {
314#define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12) 316#define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12)
315#define IEEE80211_STA_PRIVACY_INVOKED BIT(13) 317#define IEEE80211_STA_PRIVACY_INVOKED BIT(13)
316struct ieee80211_if_sta { 318struct ieee80211_if_sta {
319 struct timer_list timer;
320 struct work_struct work;
321 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
322 u8 ssid[IEEE80211_MAX_SSID_LEN];
317 enum { 323 enum {
318 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, 324 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
319 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED, 325 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED,
320 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED, 326 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED,
321 IEEE80211_MESH_UP 327 IEEE80211_MESH_UP
322 } state; 328 } state;
323 struct timer_list timer;
324 struct work_struct work;
325 u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
326 u8 ssid[IEEE80211_MAX_SSID_LEN];
327 size_t ssid_len; 329 size_t ssid_len;
328 u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; 330 u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
329 size_t scan_ssid_len; 331 size_t scan_ssid_len;
330#ifdef CONFIG_MAC80211_MESH 332#ifdef CONFIG_MAC80211_MESH
331 struct timer_list mesh_path_timer; 333 struct timer_list mesh_path_timer;
332 u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; 334 u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN];
333 bool accepting_plinks;
334 size_t mesh_id_len; 335 size_t mesh_id_len;
335 /* Active Path Selection Protocol Identifier */ 336 /* Active Path Selection Protocol Identifier */
336 u8 mesh_pp_id[4]; 337 u8 mesh_pp_id[4];
@@ -354,6 +355,7 @@ struct ieee80211_if_sta {
354 struct mesh_stats mshstats; 355 struct mesh_stats mshstats;
355 struct mesh_config mshcfg; 356 struct mesh_config mshcfg;
356 u8 mesh_seqnum[3]; 357 u8 mesh_seqnum[3];
358 bool accepting_plinks;
357#endif 359#endif
358 u16 aid; 360 u16 aid;
359 u16 ap_capab, capab; 361 u16 ap_capab, capab;
@@ -364,16 +366,18 @@ struct ieee80211_if_sta {
364 u8 *assocreq_ies, *assocresp_ies; 366 u8 *assocreq_ies, *assocresp_ies;
365 size_t assocreq_ies_len, assocresp_ies_len; 367 size_t assocreq_ies_len, assocresp_ies_len;
366 368
369 struct sk_buff_head skb_queue;
370
367 int auth_tries, assoc_tries; 371 int auth_tries, assoc_tries;
368 372
373 unsigned long request;
374
375 unsigned long last_probe;
376
369 unsigned int flags; 377 unsigned int flags;
370#define IEEE80211_STA_REQ_SCAN 0 378#define IEEE80211_STA_REQ_SCAN 0
371#define IEEE80211_STA_REQ_AUTH 1 379#define IEEE80211_STA_REQ_AUTH 1
372#define IEEE80211_STA_REQ_RUN 2 380#define IEEE80211_STA_REQ_RUN 2
373 unsigned long request;
374 struct sk_buff_head skb_queue;
375
376 unsigned long last_probe;
377 381
378#define IEEE80211_AUTH_ALG_OPEN BIT(0) 382#define IEEE80211_AUTH_ALG_OPEN BIT(0)
379#define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1) 383#define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1)