This source file includes following definitions.
- wifi_mac_hash
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef __STA_INFO_H_
15 #define __STA_INFO_H_
16
17 #include "osdep_service.h"
18 #include "drv_types.h"
19 #include "wifi.h"
20
21 #define NUM_STA 32
22 #define NUM_ACL 64
23
24
25
26
27
28 struct wlan_acl_node {
29 struct list_head list;
30 u8 addr[ETH_ALEN];
31 u8 mode;
32 };
33
34 struct wlan_acl_pool {
35 struct wlan_acl_node aclnode[NUM_ACL];
36 };
37
38 struct stainfo_stats {
39
40 uint rx_pkts;
41 uint rx_bytes;
42 u64 tx_pkts;
43 uint tx_bytes;
44 };
45
46 struct sta_info {
47 spinlock_t lock;
48 struct list_head list;
49 struct list_head hash_list;
50 struct sta_xmit_priv sta_xmitpriv;
51 struct sta_recv_priv sta_recvpriv;
52 uint state;
53 uint aid;
54 uint mac_id;
55 uint qos_option;
56 u8 hwaddr[ETH_ALEN];
57 uint ieee8021x_blocked;
58 uint XPrivacy;
59 union Keytype tkiptxmickey;
60 union Keytype tkiprxmickey;
61 union Keytype x_UncstKey;
62 union pn48 txpn;
63 union pn48 rxpn;
64 u8 bssrateset[16];
65 uint bssratelen;
66 s32 rssi;
67 s32 signal_quality;
68 struct stainfo_stats sta_stats;
69
70 struct recv_reorder_ctrl recvreorder_ctrl[16];
71 struct ht_priv htpriv;
72
73
74
75
76
77
78
79
80
81 struct list_head asoc_list;
82 struct list_head auth_list;
83 unsigned int expire_to;
84 unsigned int auth_seq;
85 unsigned int authalg;
86 unsigned char chg_txt[128];
87 unsigned int tx_ra_bitmap;
88 };
89
90 struct sta_priv {
91 u8 *pallocated_stainfo_buf;
92 u8 *pstainfo_buf;
93 struct __queue free_sta_queue;
94 spinlock_t sta_hash_lock;
95 struct list_head sta_hash[NUM_STA];
96 int asoc_sta_count;
97 struct __queue sleep_q;
98 struct __queue wakeup_q;
99 struct _adapter *padapter;
100 struct list_head asoc_list;
101 struct list_head auth_list;
102 unsigned int auth_to;
103 unsigned int assoc_to;
104 unsigned int expire_to;
105 };
106
107 static inline u32 wifi_mac_hash(u8 *mac)
108 {
109 u32 x;
110
111 x = mac[0];
112 x = (x << 2) ^ mac[1];
113 x = (x << 2) ^ mac[2];
114 x = (x << 2) ^ mac[3];
115 x = (x << 2) ^ mac[4];
116 x = (x << 2) ^ mac[5];
117 x ^= x >> 8;
118 x = x & (NUM_STA - 1);
119 return x;
120 }
121
122 int _r8712_init_sta_priv(struct sta_priv *pstapriv);
123 void _r8712_free_sta_priv(struct sta_priv *pstapriv);
124 struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv,
125 u8 *hwaddr);
126 void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta);
127 void r8712_free_all_stainfo(struct _adapter *padapter);
128 struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
129 void r8712_init_bcmc_stainfo(struct _adapter *padapter);
130 struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter);
131 u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr);
132
133 #endif
134