/* SPDX-License-Identifier: GPL-2.0 */
/******************************************************************************
 *
 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
 *
 * Modifications for inclusion into the Linux staging tree are
 * Copyright(c) 2010 Larry Finger. All rights reserved.
 *
 * Contact information:
 * WLAN FAE <wlanfae@realtek.com>
 * Larry Finger <Larry.Finger@lwfinger.net>
 *
 ******************************************************************************/
#ifndef __STA_INFO_H_
#define __STA_INFO_H_

#include "osdep_service.h"
#include "drv_types.h"
#include "wifi.h"

#define NUM_STA 32
#define NUM_ACL 64

/* if mode ==0, then the sta is allowed once the addr is hit.
 * if mode ==1, then the sta is rejected once the addr is non-hit.
 */
struct wlan_acl_node {
	struct list_head list;
	u8       addr[ETH_ALEN];
	u8       mode;
};

struct wlan_acl_pool {
	struct wlan_acl_node aclnode[NUM_ACL];
};

struct	stainfo_stats {
	uint	rx_pkts;
	uint	rx_bytes;
	u64	tx_pkts;
	uint	tx_bytes;
};

struct sta_info {
	spinlock_t lock;
	struct list_head list; /*free_sta_queue*/
	struct list_head hash_list; /*sta_hash*/
	struct sta_xmit_priv sta_xmitpriv;
	struct sta_recv_priv sta_recvpriv;
	uint state;
	uint aid;
	uint	mac_id;
	uint	qos_option;
	u8	hwaddr[ETH_ALEN];
	uint	ieee8021x_blocked;	/*0: allowed, 1:blocked */
	uint	XPrivacy; /*aes, tkip...*/
	union Keytype	tkiptxmickey;
	union Keytype	tkiprxmickey;
	union Keytype	x_UncstKey;
	union pn48		txpn;	/* PN48 used for Unicast xmit.*/
	union pn48		rxpn;	/* PN48 used for Unicast recv.*/
	u8	bssrateset[16];
	uint	bssratelen;
	s32  rssi;
	s32	signal_quality;
	struct stainfo_stats sta_stats;
	/*for A-MPDU Rx reordering buffer control */
	struct recv_reorder_ctrl recvreorder_ctrl[16];
	struct ht_priv	htpriv;
	/* Notes:
	 * STA_Mode:
	 * curr_network(mlme_priv/security_priv/qos/ht)
	 *   + sta_info: (STA & AP) CAP/INFO
	 * scan_q: AP CAP/INFO
	 * AP_Mode:
	 * curr_network(mlme_priv/security_priv/qos/ht) : AP CAP/INFO
	 * sta_info: (AP & STA) CAP/INFO
	 */
	struct list_head asoc_list;
	struct list_head auth_list;
	unsigned int expire_to;
	unsigned int auth_seq;
	unsigned int authalg;
	unsigned char chg_txt[128];
	unsigned int tx_ra_bitmap;
};

struct	sta_priv {
	u8 *pallocated_stainfo_buf;
	u8 *pstainfo_buf;
	struct  __queue	free_sta_queue;
	spinlock_t sta_hash_lock;
	struct list_head sta_hash[NUM_STA];
	int asoc_sta_count;
	struct  __queue sleep_q;
	struct  __queue wakeup_q;
	struct _adapter *padapter;
	struct list_head asoc_list;
	struct list_head auth_list;
	unsigned int auth_to;  /* sec, time to expire in authenticating. */
	unsigned int assoc_to; /* sec, time to expire before associating. */
	unsigned int expire_to; /* sec , time to expire after associated. */
};

static inline u32 wifi_mac_hash(u8 *mac)
{
	u32 x;

	x = mac[0];
	x = (x << 2) ^ mac[1];
	x = (x << 2) ^ mac[2];
	x = (x << 2) ^ mac[3];
	x = (x << 2) ^ mac[4];
	x = (x << 2) ^ mac[5];
	x ^= x >> 8;
	x  = x & (NUM_STA - 1);
	return x;
}

int _r8712_init_sta_priv(struct sta_priv *pstapriv);
void _r8712_free_sta_priv(struct sta_priv *pstapriv);
struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv,
				     u8 *hwaddr);
void r8712_free_stainfo(struct _adapter *padapter, struct sta_info *psta);
void r8712_free_all_stainfo(struct _adapter *padapter);
struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr);
void r8712_init_bcmc_stainfo(struct _adapter *padapter);
struct sta_info *r8712_get_bcmc_stainfo(struct _adapter *padapter);
u8 r8712_access_ctrl(struct wlan_acl_pool *pacl_list, u8 *mac_addr);

#endif /* _STA_INFO_H_ */

