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.
13 ******************************************************************************/
17 #include "osdep_service.h"
18 #include "drv_types.h"
24 /* if mode ==0, then the sta is allowed once the addr is hit.
25 * if mode ==1, then the sta is rejected once the addr is non-hit.
27 struct wlan_acl_node {
28 struct list_head list;
33 struct wlan_acl_pool {
34 struct wlan_acl_node aclnode[NUM_ACL];
37 struct stainfo_stats {
46 struct list_head list; /*free_sta_queue*/
47 struct list_head hash_list; /*sta_hash*/
48 struct sta_xmit_priv sta_xmitpriv;
49 struct sta_recv_priv sta_recvpriv;
55 uint ieee8021x_blocked; /*0: allowed, 1:blocked */
56 uint XPrivacy; /*aes, tkip...*/
57 union Keytype tkiptxmickey;
58 union Keytype tkiprxmickey;
59 union Keytype x_UncstKey;
60 union pn48 txpn; /* PN48 used for Unicast xmit.*/
61 union pn48 rxpn; /* PN48 used for Unicast recv.*/
66 struct stainfo_stats sta_stats;
67 /*for A-MPDU Rx reordering buffer control */
68 struct recv_reorder_ctrl recvreorder_ctrl[16];
69 struct ht_priv htpriv;
72 * curr_network(mlme_priv/security_priv/qos/ht)
73 * + sta_info: (STA & AP) CAP/INFO
76 * curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO
77 * sta_info: (AP & STA) CAP/INFO
79 struct list_head asoc_list;
80 struct list_head auth_list;
81 unsigned int expire_to;
82 unsigned int auth_seq;
84 unsigned char chg_txt[128];
85 unsigned int tx_ra_bitmap;
89 u8 *pallocated_stainfo_buf;
91 struct __queue free_sta_queue;
92 spinlock_t sta_hash_lock;
93 struct list_head sta_hash[NUM_STA];
95 struct __queue sleep_q;
96 struct __queue wakeup_q;
97 struct _adapter *padapter;
98 struct list_head asoc_list;
99 struct list_head auth_list;
100 unsigned int auth_to; /* sec, time to expire in authenticating. */
101 unsigned int assoc_to; /* sec, time to expire before associating. */
102 unsigned int expire_to; /* sec , time to expire after associated. */
105 static inline u32 wifi_mac_hash(u8 *mac)
110 x = (x << 2) ^ mac[1];
111 x = (x << 2) ^ mac[2];
112 x = (x << 2) ^ mac[3];
113 x = (x << 2) ^ mac[4];
114 x = (x << 2) ^ mac[5];
116 x = x & (NUM_STA - 1);
120 int _r8712_init_sta_priv(struct sta_priv *pstapriv);
121 void _r8712_free_sta_priv(struct sta_priv *pstapriv);
122 struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv,
124 void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta);
125 void r8712_free_all_stainfo(struct _adapter *padapter);
126 struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
127 void r8712_init_bcmc_stainfo(struct _adapter *padapter);
128 struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter);
129 u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr);
131 #endif /* _STA_INFO_H_ */