linux/drivers/net/wireless/realtek/rtlwifi/base.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2009-2012  Realtek Corporation.*/

#include "wifi.h"
#include "rc.h"
#include "base.h"
#include "efuse.h"
#include "cam.h"
#include "ps.h"
#include "regd.h"
#include "pci.h"
#include <linux/ip.h>
#include <linux/module.h>
#include <linux/udp.h>

/*
 *NOTICE!!!: This file will be very big, we should
 *keep it clear under following roles:
 *
 *This file include following parts, so, if you add new
 *functions into this file, please check which part it
 *should includes. or check if you should add new part
 *for this file:
 *
 *1) mac80211 init functions
 *2) tx information functions
 *3) functions called by core.c
 *4) wq & timer callback functions
 *5) frame process functions
 *6) IOT functions
 *7) sysfs functions
 *8) vif functions
 *9) ...
 */

/*********************************************************
 *
 * mac80211 init functions
 *
 *********************************************************/
static struct ieee80211_channel rtl_channeltable_2g[] =;

static struct ieee80211_channel rtl_channeltable_5g[] =;

static struct ieee80211_rate rtl_ratetable_2g[] =;

static struct ieee80211_rate rtl_ratetable_5g[] =;

static const struct ieee80211_supported_band rtl_band_2ghz =;

static struct ieee80211_supported_band rtl_band_5ghz =;

static const u8 tid_to_ac[] =;

u8 rtl_tid_to_ac(u8 tid)
{}
EXPORT_SYMBOL_GPL();

static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
				  struct ieee80211_sta_ht_cap *ht_cap)
{}

static void _rtl_init_hw_vht_capab(struct ieee80211_hw *hw,
				   struct ieee80211_sta_vht_cap *vht_cap)
{}

static void _rtl_init_mac80211(struct ieee80211_hw *hw)
{}

static void rtl_watchdog_wq_callback(struct work_struct *work);
static void rtl_fwevt_wq_callback(struct work_struct *work);
static void rtl_c2hcmd_wq_callback(struct work_struct *work);

static int _rtl_init_deferred_work(struct ieee80211_hw *hw)
{}

void rtl_deinit_deferred_work(struct ieee80211_hw *hw, bool ips_wq)
{}
EXPORT_SYMBOL_GPL();

void rtl_init_rfkill(struct ieee80211_hw *hw)
{}
EXPORT_SYMBOL();

void rtl_deinit_rfkill(struct ieee80211_hw *hw)
{}
EXPORT_SYMBOL_GPL();

int rtl_init_core(struct ieee80211_hw *hw)
{}
EXPORT_SYMBOL_GPL();

static void rtl_free_entries_from_scan_list(struct ieee80211_hw *hw);
static void rtl_free_entries_from_ack_queue(struct ieee80211_hw *hw,
					    bool timeout);

void rtl_deinit_core(struct ieee80211_hw *hw)
{}
EXPORT_SYMBOL_GPL();

void rtl_init_rx_config(struct ieee80211_hw *hw)
{}
EXPORT_SYMBOL_GPL();

/*********************************************************
 *
 * tx information functions
 *
 *********************************************************/
static void _rtl_qurey_shortpreamble_mode(struct ieee80211_hw *hw,
					  struct rtl_tcb_desc *tcb_desc,
					  struct ieee80211_tx_info *info)
{}

static void _rtl_query_shortgi(struct ieee80211_hw *hw,
			       struct ieee80211_sta *sta,
			       struct rtl_tcb_desc *tcb_desc,
			       struct ieee80211_tx_info *info)
{}

static void _rtl_query_protection_mode(struct ieee80211_hw *hw,
				       struct rtl_tcb_desc *tcb_desc,
				       struct ieee80211_tx_info *info)
{}

u8 rtl_mrate_idx_to_arfr_id(struct ieee80211_hw *hw, u8 rate_index,
			    enum wireless_mode wirelessmode)
{}
EXPORT_SYMBOL();

static void _rtl_txrate_selectmode(struct ieee80211_hw *hw,
				   struct ieee80211_sta *sta,
				   struct rtl_tcb_desc *tcb_desc)
{}

static void _rtl_query_bandwidth_mode(struct ieee80211_hw *hw,
				      struct ieee80211_sta *sta,
				      struct rtl_tcb_desc *tcb_desc)
{}

static u8 _rtl_get_vht_highest_n_rate(struct ieee80211_hw *hw,
				      struct ieee80211_sta *sta)
{}

static u8 _rtl_get_highest_n_rate(struct ieee80211_hw *hw,
				  struct ieee80211_sta *sta)
{}

/* mac80211's rate_idx is like this:
 *
 * 2.4G band:rx_status->band == NL80211_BAND_2GHZ
 *
 * B/G rate:
 * (rx_status->flag & RX_FLAG_HT) = 0,
 * DESC_RATE1M-->DESC_RATE54M ==> idx is 0-->11,
 *
 * N rate:
 * (rx_status->flag & RX_FLAG_HT) = 1,
 * DESC_RATEMCS0-->DESC_RATEMCS15 ==> idx is 0-->15
 *
 * 5G band:rx_status->band == NL80211_BAND_5GHZ
 * A rate:
 * (rx_status->flag & RX_FLAG_HT) = 0,
 * DESC_RATE6M-->DESC_RATE54M ==> idx is 0-->7,
 *
 * N rate:
 * (rx_status->flag & RX_FLAG_HT) = 1,
 * DESC_RATEMCS0-->DESC_RATEMCS15 ==> idx is 0-->15
 *
 * VHT rates:
 * DESC_RATEVHT1SS_MCS0-->DESC_RATEVHT1SS_MCS9 ==> idx is 0-->9
 * DESC_RATEVHT2SS_MCS0-->DESC_RATEVHT2SS_MCS9 ==> idx is 0-->9
 */
int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht, bool isvht,
			 u8 desc_rate)
{}
EXPORT_SYMBOL();

static u8 _rtl_get_tx_hw_rate(struct ieee80211_hw *hw,
			      struct ieee80211_tx_info *info)
{}

void rtl_get_tcb_desc(struct ieee80211_hw *hw,
		      struct ieee80211_tx_info *info,
		      struct ieee80211_sta *sta,
		      struct sk_buff *skb, struct rtl_tcb_desc *tcb_desc)
{}
EXPORT_SYMBOL();

bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw, u8 *sa,
				u8 *bssid, u16 tid);

static void process_agg_start(struct ieee80211_hw *hw,
			      struct ieee80211_hdr *hdr, u16 tid)
{}

bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
{}
EXPORT_SYMBOL_GPL();

static void setup_special_tx(struct rtl_priv *rtlpriv, struct rtl_ps_ctl *ppsc,
			     int type)
{}

static const u8 *rtl_skb_ether_type_ptr(struct ieee80211_hw *hw,
					struct sk_buff *skb, bool is_enc)
{}

/*should call before software enc*/
u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx,
		       bool is_enc)
{}
EXPORT_SYMBOL_GPL();

void rtl_tx_ackqueue(struct ieee80211_hw *hw, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

static void rtl_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
			  bool ack)
{}

bool rtl_is_tx_report_skb(struct ieee80211_hw *hw, struct sk_buff *skb)
{}

static u16 rtl_get_tx_report_sn(struct ieee80211_hw *hw,
				struct rtlwifi_tx_info *tx_info)
{}

void rtl_set_tx_report(struct rtl_tcb_desc *ptcb_desc, u8 *pdesc,
		       struct ieee80211_hw *hw, struct rtlwifi_tx_info *tx_info)
{}
EXPORT_SYMBOL_GPL();

void rtl_tx_report_handler(struct ieee80211_hw *hw, u8 *tmp_buf, u8 c2h_cmd_len)
{}
EXPORT_SYMBOL_GPL();

bool rtl_check_tx_report_acked(struct ieee80211_hw *hw)
{}

void rtl_wait_tx_report_acked(struct ieee80211_hw *hw, u32 wait_ms)
{}

u32 rtl_get_hal_edca_param(struct ieee80211_hw *hw,
			   struct ieee80211_vif *vif,
			   enum wireless_mode wirelessmode,
			   struct ieee80211_tx_queue_params *param)
{}
EXPORT_SYMBOL_GPL();

/*********************************************************
 *
 * functions called by core.c
 *
 *********************************************************/
int rtl_tx_agg_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		     struct ieee80211_sta *sta, u16 tid, u16 *ssn)
{}

int rtl_tx_agg_stop(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		    struct ieee80211_sta *sta, u16 tid)
{}

int rtl_rx_agg_start(struct ieee80211_hw *hw,
		     struct ieee80211_sta *sta, u16 tid)
{}

int rtl_rx_agg_stop(struct ieee80211_hw *hw,
		    struct ieee80211_sta *sta, u16 tid)
{}

int rtl_tx_agg_oper(struct ieee80211_hw *hw,
		struct ieee80211_sta *sta, u16 tid)
{}

void rtl_rx_ampdu_apply(struct rtl_priv *rtlpriv)
{}
EXPORT_SYMBOL();

/*********************************************************
 *
 * wq & timer callback functions
 *
 *********************************************************/
/* this function is used for roaming */
void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb)
{}
EXPORT_SYMBOL_GPL();

static void rtl_free_entries_from_scan_list(struct ieee80211_hw *hw)
{}

static void rtl_free_entries_from_ack_queue(struct ieee80211_hw *hw,
					    bool chk_timeout)
{}

void rtl_scan_list_expire(struct ieee80211_hw *hw)
{}

void rtl_collect_scan_list(struct ieee80211_hw *hw, struct sk_buff *skb)
{}
EXPORT_SYMBOL();

static void rtl_watchdog_wq_callback(struct work_struct *work)
{}

void rtl_watch_dog_timer_callback(struct timer_list *t)
{}

static void rtl_fwevt_wq_callback(struct work_struct *work)
{}

static void rtl_c2h_content_parsing(struct ieee80211_hw *hw,
				    struct sk_buff *skb);

static bool rtl_c2h_fast_cmd(struct ieee80211_hw *hw, struct sk_buff *skb)
{}

void rtl_c2hcmd_enqueue(struct ieee80211_hw *hw, struct sk_buff *skb)
{}
EXPORT_SYMBOL();

static void rtl_c2h_content_parsing(struct ieee80211_hw *hw,
				    struct sk_buff *skb)
{}

void rtl_c2hcmd_launcher(struct ieee80211_hw *hw, int exec)
{}

static void rtl_c2hcmd_wq_callback(struct work_struct *work)
{}

/*********************************************************
 *
 * frame process functions
 *
 *********************************************************/
u8 *rtl_find_ie(u8 *data, unsigned int len, u8 ie)
{}

/* when we use 2 rx ants we send IEEE80211_SMPS_OFF */
/* when we use 1 rx ant we send IEEE80211_SMPS_STATIC */
static struct sk_buff *rtl_make_smps_action(struct ieee80211_hw *hw,
				     enum ieee80211_smps_mode smps,
				     u8 *da, u8 *bssid)
{}

int rtl_send_smps_action(struct ieee80211_hw *hw,
			 struct ieee80211_sta *sta,
			 enum ieee80211_smps_mode smps)
{}
EXPORT_SYMBOL();

void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
{}
EXPORT_SYMBOL();

/* because mac80211 have issues when can receive del ba
 * so here we just make a fake del_ba if we receive a ba_req
 * but rx_agg was opened to let mac80211 release some ba
 * related resources, so please this del_ba for tx
 */
struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw,
				u8 *sa, u8 *bssid, u16 tid)
{}

/*********************************************************
 *
 * IOT functions
 *
 *********************************************************/
static bool rtl_chk_vendor_ouisub(struct ieee80211_hw *hw,
				  struct octet_string vendor_ie)
{}

static bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
		unsigned int len)
{}

void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len)
{}
EXPORT_SYMBOL_GPL();

MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_DESCRIPTION();

struct rtl_global_var rtl_global_var =;
EXPORT_SYMBOL_GPL();

static int __init rtl_core_module_init(void)
{}

static void __exit rtl_core_module_exit(void)
{}

module_init();
module_exit(rtl_core_module_exit);