Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sta_info.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  * Modifications for inclusion into the Linux staging tree are
19  * Copyright(c) 2010 Larry Finger. All rights reserved.
20  *
21  * Contact information:
22  * WLAN FAE <[email protected]>
23  * Larry Finger <[email protected]>
24  *
25  ******************************************************************************/
26 #ifndef __STA_INFO_H_
27 #define __STA_INFO_H_
28 
29 #include "osdep_service.h"
30 #include "drv_types.h"
31 #include "wifi.h"
32 
33 #define NUM_STA 32
34 #define NUM_ACL 64
35 
36 
37 /* if mode ==0, then the sta is allowed once the addr is hit.
38  * if mode ==1, then the sta is rejected once the addr is non-hit.
39  */
40 struct wlan_acl_node {
41  struct list_head list;
44 };
45 
46 struct wlan_acl_pool {
48 };
49 
50 struct stainfo_stats {
51 
56 };
57 
58 struct sta_info {
60  struct list_head list; /*free_sta_queue*/
61  struct list_head hash_list; /*sta_hash*/
69  uint ieee8021x_blocked; /*0: allowed, 1:blocked */
70  uint XPrivacy; /*aes, tkip...*/
74  union pn48 txpn; /* PN48 used for Unicast xmit.*/
75  union pn48 rxpn; /* PN48 used for Unicast recv.*/
81  /*for A-MPDU Rx reordering buffer control */
83  struct ht_priv htpriv;
84  /* Notes:
85  * STA_Mode:
86  * curr_network(mlme_priv/security_priv/qos/ht)
87  * + sta_info: (STA & AP) CAP/INFO
88  * scan_q: AP CAP/INFO
89  * AP_Mode:
90  * curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO
91  * sta_info: (AP & STA) CAP/INFO
92  */
95  unsigned int expire_to;
96  unsigned int auth_seq;
97  unsigned int authalg;
98  unsigned char chg_txt[128];
99  unsigned int tx_ra_bitmap;
100 };
101 
102 struct sta_priv {
109  struct __queue sleep_q;
114  unsigned int auth_to; /* sec, time to expire in authenticating. */
115  unsigned int assoc_to; /* sec, time to expire before associating. */
116  unsigned int expire_to; /* sec , time to expire after associated. */
117 };
118 
119 static inline u32 wifi_mac_hash(u8 *mac)
120 {
121  u32 x;
122 
123  x = mac[0];
124  x = (x << 2) ^ mac[1];
125  x = (x << 2) ^ mac[2];
126  x = (x << 2) ^ mac[3];
127  x = (x << 2) ^ mac[4];
128  x = (x << 2) ^ mac[5];
129  x ^= x >> 8;
130  x = x & (NUM_STA - 1);
131  return x;
132 }
133 
134 u32 _r8712_init_sta_priv(struct sta_priv *pstapriv);
135 u32 _r8712_free_sta_priv(struct sta_priv *pstapriv);
136 struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv,
137  u8 *hwaddr);
138 void r8712_free_stainfo(struct _adapter *padapter , struct sta_info *psta);
139 void r8712_free_all_stainfo(struct _adapter *padapter);
140 struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
141 void r8712_init_bcmc_stainfo(struct _adapter *padapter);
142 struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter);
143 u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 * mac_addr);
144 
145 #endif /* _STA_INFO_H_ */
146