1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
6 * Modifications for inclusion into the Linux staging tree are
7 * Copyright(c) 2010 Larry Finger. All rights reserved.
10 * WLAN FAE <wlanfae@realtek.com>
11 * Larry Finger <Larry.Finger@lwfinger.net>
13 ******************************************************************************/
17 #include "osdep_service.h"
18 #include "drv_types.h"
25 /* if mode ==0, then the sta is allowed once the addr is hit.
26 * if mode ==1, then the sta is rejected once the addr is non-hit.
28 struct wlan_acl_node {
29 struct list_head list;
34 struct wlan_acl_pool {
35 struct wlan_acl_node aclnode[NUM_ACL];
38 struct stainfo_stats {
47 struct list_head list; /*free_sta_queue*/
48 struct list_head hash_list; /*sta_hash*/
49 struct sta_xmit_priv sta_xmitpriv;
50 struct sta_recv_priv sta_recvpriv;
56 uint ieee8021x_blocked; /*0: allowed, 1:blocked */
57 uint XPrivacy; /*aes, tkip...*/
58 union Keytype tkiptxmickey;
59 union Keytype tkiprxmickey;
60 union Keytype x_UncstKey;
61 union pn48 txpn; /* PN48 used for Unicast xmit.*/
62 union pn48 rxpn; /* PN48 used for Unicast recv.*/
67 struct stainfo_stats sta_stats;
68 /*for A-MPDU Rx reordering buffer control */
69 struct recv_reorder_ctrl recvreorder_ctrl[16];
70 struct ht_priv htpriv;
73 * curr_network(mlme_priv/security_priv/qos/ht)
74 * + sta_info: (STA & AP) CAP/INFO
77 * curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO
78 * sta_info: (AP & STA) CAP/INFO
80 struct list_head asoc_list;
81 struct list_head auth_list;
82 unsigned int expire_to;
83 unsigned int auth_seq;
85 unsigned char chg_txt[128];
86 unsigned int tx_ra_bitmap;
90 u8 *pallocated_stainfo_buf;
92 struct __queue free_sta_queue;
93 spinlock_t sta_hash_lock;
94 struct list_head sta_hash[NUM_STA];
96 struct __queue sleep_q;
97 struct __queue wakeup_q;
98 struct _adapter *padapter;
99 struct list_head asoc_list;
100 struct list_head auth_list;
101 unsigned int auth_to; /* sec, time to expire in authenticating. */
102 unsigned int assoc_to; /* sec, time to expire before associating. */
103 unsigned int expire_to; /* sec , time to expire after associated. */
106 static inline u32 wifi_mac_hash(u8 *mac)
111 x = (x << 2) ^ mac[1];
112 x = (x << 2) ^ mac[2];
113 x = (x << 2) ^ mac[3];
114 x = (x << 2) ^ mac[4];
115 x = (x << 2) ^ mac[5];
117 x = x & (NUM_STA - 1);
121 int _r8712_init_sta_priv(struct sta_priv *pstapriv);
122 void _r8712_free_sta_priv(struct sta_priv *pstapriv);
123 struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv,
125 void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta);
126 void r8712_free_all_stainfo(struct _adapter *padapter);
127 struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
128 void r8712_init_bcmc_stainfo(struct _adapter *padapter);
129 struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter);
130 u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr);
132 #endif /* _STA_INFO_H_ */