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

// SPDX-License-Identifier: GPL-2.0
/******************************************************************************
 *
 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
 *
 ******************************************************************************/

#include <drv_types.h>
#include <rtw_debug.h>
#include <linux/of.h>
#include <asm/unaligned.h>

u8 RTW_WPA_OUI_TYPE[] =;
u16 RTW_WPA_VERSION =;
u8 WPA_AUTH_KEY_MGMT_NONE[] =;
u8 WPA_AUTH_KEY_MGMT_UNSPEC_802_1X[] =;
u8 WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X[] =;
u8 WPA_CIPHER_SUITE_NONE[] =;
u8 WPA_CIPHER_SUITE_WEP40[] =;
u8 WPA_CIPHER_SUITE_TKIP[] =;
u8 WPA_CIPHER_SUITE_WRAP[] =;
u8 WPA_CIPHER_SUITE_CCMP[] =;
u8 WPA_CIPHER_SUITE_WEP104[] =;

u16 RSN_VERSION_BSD =;
u8 RSN_AUTH_KEY_MGMT_UNSPEC_802_1X[] =;
u8 RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X[] =;
u8 RSN_CIPHER_SUITE_NONE[] =;
u8 RSN_CIPHER_SUITE_WEP40[] =;
u8 RSN_CIPHER_SUITE_TKIP[] =;
u8 RSN_CIPHER_SUITE_WRAP[] =;
u8 RSN_CIPHER_SUITE_CCMP[] =;
u8 RSN_CIPHER_SUITE_WEP104[] =;
/*  */
/*  for adhoc-master to generate ie and provide supported-rate to fw */
/*  */

static u8 WIFI_CCKRATES[] =;

static u8 WIFI_OFDMRATES[] =;

int rtw_get_bit_value_from_ieee_value(u8 val)
{}

bool rtw_is_cckrates_included(u8 *rate)
{}

bool rtw_is_cckratesonly_included(u8 *rate)
{}

int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
{}

u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source,
				unsigned int *frlen)
{}

/*  rtw_set_ie will update frame length */
u8 *rtw_set_ie(u8 *pbuf,
	       signed int index,
	       uint len,
	       u8 *source,
	       uint *frlen) /* frame length */
{}

/*----------------------------------------------------------------------------
index: the information element id index, limit is the limit for search
-----------------------------------------------------------------------------*/
u8 *rtw_get_ie(u8 *pbuf, signed int index, signed int *len, signed int limit)
{}

/**
 * rtw_get_ie_ex - Search specific IE from a series of IEs
 * @in_ie: Address of IEs to search
 * @in_len: Length limit from in_ie
 * @eid: Element ID to match
 * @oui: OUI to match
 * @oui_len: OUI length
 * @ie: If not NULL and the specific IE is found, the IE will be copied to the buf starting from the specific IE
 * @ielen: If not NULL and the specific IE is found, will set to the length of the entire IE
 *
 * Returns: The address of the specific IE found, or NULL
 */
u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, uint *ielen)
{}

/**
 * rtw_ies_remove_ie - Find matching IEs and remove
 * @ies: Address of IEs to search
 * @ies_len: Pointer of length of ies, will update to new length
 * @offset: The offset to start search
 * @eid: Element ID to match
 * @oui: OUI to match
 * @oui_len: OUI length
 *
 * Returns: _SUCCESS: ies is updated, _FAIL: not updated
 */
int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 oui_len)
{}

void rtw_set_supported_rate(u8 *supported_rates, uint mode)
{}

uint rtw_get_rateset_len(u8 *rateset)
{}

int rtw_generate_ie(struct registry_priv *pregistrypriv)
{}

unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
{}

unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
{}

int rtw_get_wpa_cipher_suite(u8 *s)
{}

int rtw_get_wpa2_cipher_suite(u8 *s)
{}

int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x)
{}

int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x)
{}

/* ifdef CONFIG_WAPI_SUPPORT */
int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
{}
/* endif */

void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len)
{}

/**
 * rtw_get_wps_ie - Search WPS IE from a series of IEs
 * @in_ie: Address of IEs to search
 * @in_len: Length limit from in_ie
 * @wps_ie: If not NULL and WPS IE is found, WPS IE will be copied to the buf starting from wps_ie
 * @wps_ielen: If not NULL and WPS IE is found, will set to the length of the entire WPS IE
 *
 * Returns: The address of the WPS IE found, or NULL
 */
u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
{}

/**
 * rtw_get_wps_attr - Search a specific WPS attribute from a given WPS IE
 * @wps_ie: Address of WPS IE to search
 * @wps_ielen: Length limit from wps_ie
 * @target_attr_id: The attribute ID of WPS attribute to search
 * @buf_attr: If not NULL and the WPS attribute is found, WPS attribute will be copied to the buf starting from buf_attr
 * @len_attr: If not NULL and the WPS attribute is found, will set to the length of the entire WPS attribute
 *
 * Returns: the address of the specific WPS attribute found, or NULL
 */
u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_attr, u32 *len_attr)
{}

/**
 * rtw_get_wps_attr_content - Search a specific WPS attribute content from a given WPS IE
 * @wps_ie: Address of WPS IE to search
 * @wps_ielen: Length limit from wps_ie
 * @target_attr_id: The attribute ID of WPS attribute to search
 * @buf_content: If not NULL and the WPS attribute is found, WPS attribute content will be copied to the buf starting from buf_content
 * @len_content: If not NULL and the WPS attribute is found, will set to the length of the WPS attribute content
 *
 * Returns: the address of the specific WPS attribute content found, or NULL
 */
u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_content, uint *len_content)
{}

static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
					    struct rtw_ieee802_11_elems *elems,
					    int show_errors)
{}

/**
 * rtw_ieee802_11_parse_elems - Parse information elements in management frames
 * @start: Pointer to the start of IEs
 * @len: Length of IE buffer in octets
 * @elems: Data structure for parsed elements
 * @show_errors: Whether to show parsing errors in debug log
 * Returns: Parsing result
 */
enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
				struct rtw_ieee802_11_elems *elems,
				int show_errors)
{}

void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr)
{}

static int rtw_get_cipher_info(struct wlan_network *pnetwork)
{}

void rtw_get_bcn_info(struct wlan_network *pnetwork)
{}

/* show MCS rate, unit: 100Kbps */
u16 rtw_mcs_rate(u8 bw_40MHz, u8 short_GI, unsigned char *MCS_rate)
{}

int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *action)
{}

static const char *_action_public_str[] =;

const char *action_public_str(u8 action)
{}