linux/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c

// SPDX-License-Identifier: GPL-2.0
/******************************************************************************
 *
 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
 *
 ******************************************************************************/
#include <drv_types.h>
#include <rtw_debug.h>
#include <rtw_wifi_regd.h>
#include <hal_btcoex.h>
#include <linux/kernel.h>
#include <asm/unaligned.h>

static struct mlme_handler mlme_sta_tbl[] =;

static struct action_handler OnAction_tbl[] =;

static u8 null_addr[ETH_ALEN] =;

/**************************************************
OUI definitions for the vendor specific IE
***************************************************/
unsigned char RTW_WPA_OUI[] =;
unsigned char WMM_OUI[] =;
unsigned char WPS_OUI[] =;
unsigned char P2P_OUI[] =;
unsigned char WFD_OUI[] =;

unsigned char WMM_INFO_OUI[] =;
unsigned char WMM_PARA_OUI[] =;

static unsigned char REALTEK_96B_IE[] =;

/********************************************************
ChannelPlan definitions
*********************************************************/
static struct rt_channel_plan_2g	RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] =;

static struct rt_channel_plan_map	RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] =;

 /* use the combination for max channel numbers */
static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE =;

/* Search the @param ch in given @param ch_set
 * @ch_set: the given channel set
 * @ch: the given channel number
 *
 * return the index of channel_num in channel_set, -1 if not found
 */
int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch)
{}

/****************************************************************************

Following are the initialization functions for WiFi MLME

*****************************************************************************/

int init_hw_mlme_ext(struct adapter *padapter)
{}

void init_mlme_default_rate_set(struct adapter *padapter)
{}

static void init_mlme_ext_priv_value(struct adapter *padapter)
{}

static int has_channel(struct rt_channel_info *channel_set,
					   u8 chanset_size,
					   u8 chan)
{}

static void init_channel_list(struct adapter *padapter, struct rt_channel_info *channel_set,
							  u8 chanset_size,
							  struct p2p_channels *channel_list)
{}

static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_channel_info *channel_set)
{}

void init_mlme_ext_priv(struct adapter *padapter)
{}

void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
{}

static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, union recv_frame *precv_frame)
{}

void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
{}

/****************************************************************************

Following are the callback functions for each subtype of the management frames

*****************************************************************************/

unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnProbeRsp(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAuthClient(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnDeAuth(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnDisassoc(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAtim(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int on_action_spct(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_frame)
{}

static s32 rtw_action_public_decache(union recv_frame *recv_frame, s32 token)
{}

static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
{}

static unsigned int on_action_public_vendor(union recv_frame *precv_frame)
{}

static unsigned int on_action_public_default(union recv_frame *precv_frame, u8 action)
{}

unsigned int on_action_public(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAction_ht(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int OnAction(struct adapter *padapter, union recv_frame *precv_frame)
{}

unsigned int DoReserved(struct adapter *padapter, union recv_frame *precv_frame)
{}

static struct xmit_frame *_alloc_mgtxmitframe(struct xmit_priv *pxmitpriv, bool once)
{}

inline struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv)
{}

/****************************************************************************

Following are some TX functions for WiFi MLME

*****************************************************************************/

void update_mgnt_tx_rate(struct adapter *padapter, u8 rate)
{}

void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib *pattrib)
{}

void update_mgntframe_attrib_addr(struct adapter *padapter, struct xmit_frame *pmgntframe)
{}

void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe)
{}

s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntframe, int timeout_ms)
{}

s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe)
{}

static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode)
{}

void issue_beacon(struct adapter *padapter, int timeout_ms)
{}

void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p_probereq)
{}

static int _issue_probereq(struct adapter *padapter,
			   struct ndis_802_11_ssid *pssid,
			   u8 *da, u8 ch, bool append_wps, bool wait_ack)
{}

inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da)
{}

int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, u8 ch, bool append_wps,
	int try_cnt, int wait_ms)
{}

/*  if psta == NULL, indicate we are station(client) now... */
void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status)
{}


void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_info *pstat, int pkt_type)
{}

void issue_assocreq(struct adapter *padapter)
{}

/* when wait_ack is true, this function should be called at process context */
static int _issue_nulldata(struct adapter *padapter, unsigned char *da,
			   unsigned int power_mode, bool wait_ack)
{}

/*
 * [IMPORTANT] Don't call this function in interrupt context
 *
 * When wait_ms > 0, this function should be called at process context
 * da == NULL for station mode
 */
int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms)
{}

/*
 * [IMPORTANT] This function run in interrupt context
 *
 * The null data packet would be sent without power bit,
 * and not guarantee success.
 */
s32 issue_nulldata_in_interrupt(struct adapter *padapter, u8 *da)
{}

/* when wait_ack is true, this function should be called at process context */
static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da,
			       u16 tid, bool wait_ack)
{}

/* when wait_ms >0 , this function should be called at process context */
/* da == NULL for station mode */
int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms)
{}

static int _issue_deauth(struct adapter *padapter, unsigned char *da,
			 unsigned short reason, bool wait_ack)
{}

int issue_deauth(struct adapter *padapter, unsigned char *da, unsigned short reason)
{}

int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, int try_cnt,
	int wait_ms)
{}

void issue_action_SA_Query(struct adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short tid)
{}

void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status)
{}

static void issue_action_BSSCoexistPacket(struct adapter *padapter)
{}

unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
{}

unsigned int send_beacon(struct adapter *padapter)
{}

/****************************************************************************

Following are some utility functions for WiFi MLME

*****************************************************************************/

void site_survey(struct adapter *padapter)
{}

/* collect bss info from Beacon and Probe request/response frames. */
u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, struct wlan_bssid_ex *bssid)
{}

void start_create_ibss(struct adapter *padapter)
{}

void start_clnt_join(struct adapter *padapter)
{}

void start_clnt_auth(struct adapter *padapter)
{}


void start_clnt_assoc(struct adapter *padapter)
{}

unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr, unsigned short reason)
{}

static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid)
{}

/****************************************************************************

Following are the functions to report events

*****************************************************************************/

void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame)
{}

void report_surveydone_event(struct adapter *padapter)
{}

void report_join_res(struct adapter *padapter, int res)
{}

void report_wmm_edca_update(struct adapter *padapter)
{}

void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsigned short reason)
{}

void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int cam_idx)
{}

/****************************************************************************

Following are the event callback functions

*****************************************************************************/

/* for sta/adhoc mode */
void update_sta_info(struct adapter *padapter, struct sta_info *psta)
{}

static void rtw_mlmeext_disconnect(struct adapter *padapter)
{}

void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
{}

/* currently only adhoc mode will go here */
void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *psta)
{}

void mlmeext_sta_del_event_callback(struct adapter *padapter)
{}

/****************************************************************************

Following are the functions for the timer handlers

*****************************************************************************/
void _linked_info_dump(struct adapter *padapter)
{}

static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
{}

void linked_status_chk(struct adapter *padapter)
{}

void survey_timer_hdl(struct timer_list *t)
{}

void link_timer_hdl(struct timer_list *t)
{}

void addba_timer_hdl(struct timer_list *t)
{}

void sa_query_timer_hdl(struct timer_list *t)
{}

u8 NULL_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_channel *out,
	u32 out_num, struct rtw_ieee80211_channel *in, u32 in_num)
{}

u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 setauth_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf)
{}


u8 chk_bmc_sleepq_cmd(struct adapter *padapter)
{}

u8 set_tx_beacon_cmd(struct adapter *padapter)
{}

static struct fwevent wlanevents[] =;

u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

u8 h2c_msg_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset)
{}

u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf)
{}

u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

/*  TDLS_ESTABLISHED	: write RCR DATA BIT */
/*  TDLS_CS_OFF		: go back to the channel linked with AP, terminating channel switch procedure */
/*  TDLS_INIT_CH_SEN	: init channel sensing, receive all data and mgnt frame */
/*  TDLS_DONE_CH_SEN: channel sensing and report candidate channel */
/*  TDLS_OFF_CH		: first time set channel to off channel */
/*  TDLS_BASE_CH		: go back tp the channel linked with AP when set base channel as target channel */
/*  TDLS_P_OFF_CH	: periodically go to off channel */
/*  TDLS_P_BASE_CH	: periodically go back to base channel */
/*  TDLS_RS_RCR		: restore RCR */
/*  TDLS_TEAR_STA	: free tdls sta */
u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf)
{}

u8 run_in_thread_hdl(struct adapter *padapter, u8 *pbuf)
{}