linux/drivers/staging/rtl8192e/rtllib_rx.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Original code based Host AP (software wireless LAN access point) driver
 * for Intersil Prism2/2.5/3 - hostap.o module, common routines
 *
 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
 * <[email protected]>
 * Copyright (c) 2002-2003, Jouni Malinen <[email protected]>
 * Copyright (c) 2004, Intel Corporation
 *
 * Few modifications for Realtek's Wi-Fi drivers by
 * Andrea Merello <[email protected]>
 *
 * A special thanks goes to Realtek for their support !
 */
#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/in6.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/tcp.h>
#include <linux/types.h>
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <linux/uaccess.h>
#include <linux/ctype.h>

#include "rtllib.h"

static void rtllib_rx_mgt(struct rtllib_device *ieee, struct sk_buff *skb,
			  struct rtllib_rx_stats *stats);

static inline void rtllib_monitor_rx(struct rtllib_device *ieee,
				     struct sk_buff *skb,
				     struct rtllib_rx_stats *rx_status,
				     size_t hdr_length)
{}

/* Called only as a tasklet (software IRQ) */
static struct rtllib_frag_entry *
rtllib_frag_cache_find(struct rtllib_device *ieee, unsigned int seq,
		       unsigned int frag, u8 tid, u8 *src, u8 *dst)
{}

/* Called only as a tasklet (software IRQ) */
static struct sk_buff *
rtllib_frag_cache_get(struct rtllib_device *ieee,
		      struct ieee80211_hdr *hdr)
{}

/* Called only as a tasklet (software IRQ) */
static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
					struct ieee80211_hdr *hdr)
{}

/* rtllib_rx_frame_mgtmt
 *
 * Responsible for handling management control frames
 *
 * Called by rtllib_rx
 */
static inline int
rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb,
		     struct rtllib_rx_stats *rx_stats, u16 type, u16 stype)
{}

/* No encapsulation header if EtherType < 0x600 (=length) */

/* Called by rtllib_rx_frame_decrypt */
static int rtllib_is_eapol_frame(struct rtllib_device *ieee,
				 struct sk_buff *skb, size_t hdrlen)
{}

/* Called only as a tasklet (software IRQ), by rtllib_rx */
static inline int
rtllib_rx_frame_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
			struct lib80211_crypt_data *crypt)
{}

/* Called only as a tasklet (software IRQ), by rtllib_rx */
static inline int
rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
			     int keyidx, struct lib80211_crypt_data *crypt)
{}

/* this function is stolen from ipw2200 driver*/
#define IEEE_PACKET_RETRY_TIME
static int is_duplicate_packet(struct rtllib_device *ieee,
			       struct ieee80211_hdr *header)
{}

static bool add_reorder_entry(struct rx_ts_record *ts,
			      struct rx_reorder_entry *pReorderEntry)
{}

void rtllib_indicate_packets(struct rtllib_device *ieee,
			     struct rtllib_rxb **prxb_indicate_array, u8 index)
{}

void rtllib_flush_rx_ts_pending_pkts(struct rtllib_device *ieee,
				     struct rx_ts_record *ts)
{}

static void rx_reorder_indicate_packet(struct rtllib_device *ieee,
				       struct rtllib_rxb *prxb,
				       struct rx_ts_record *ts, u16 SeqNum)
{}

static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
			 struct rtllib_rx_stats *rx_stats,
			 struct rtllib_rxb *rxb, u8 *src, u8 *dst)
{}

static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee,
				   struct sk_buff *skb,
				   struct rtllib_rx_stats *rx_stats)
{}

static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
				     struct sk_buff *skb, u8 multicast)
{}

static void rtllib_rx_extract_addr(struct rtllib_device *ieee,
				   struct ieee80211_hdr *hdr, u8 *dst,
				   u8 *src, u8 *bssid)
{}

static int rtllib_rx_data_filter(struct rtllib_device *ieee, struct ieee80211_hdr *hdr,
				 u8 *dst, u8 *src, u8 *bssid, u8 *addr2)
{}

static int rtllib_rx_get_crypt(struct rtllib_device *ieee, struct sk_buff *skb,
			struct lib80211_crypt_data **crypt, size_t hdrlen)
{}

static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
		      struct rtllib_rx_stats *rx_stats,
		      struct lib80211_crypt_data *crypt, size_t hdrlen)
{}

static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
				      u8 nr_subframes)
{}

static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
		struct rtllib_rx_stats *rx_stats,
		struct rtllib_rxb *rxb,
		u8 *dst,
		u8 *src)
{}

static int rtllib_rx_infra_adhoc(struct rtllib_device *ieee, struct sk_buff *skb,
		 struct rtllib_rx_stats *rx_stats)
{}

static int rtllib_rx_monitor(struct rtllib_device *ieee, struct sk_buff *skb,
		 struct rtllib_rx_stats *rx_stats)
{}

/* All received frames are sent to this function. @skb contains the frame in
 * IEEE 802.11 format, i.e., in the format it was sent over air.
 * This function is called only as a tasklet (software IRQ).
 */
int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
		 struct rtllib_rx_stats *rx_stats)
{}
EXPORT_SYMBOL();

static u8 qos_oui[QOS_OUI_LEN] =;

/* Make ther structure we read from the beacon packet has the right values */
static int rtllib_verify_qos_info(struct rtllib_qos_information_element
				     *info_element, int sub_type)
{}

/* Parse a QoS parameter element */
static int rtllib_read_qos_param_element(
			struct rtllib_qos_parameter_info *element_param,
			struct rtllib_info_element *info_element)
{}

/* Parse a QoS information element */
static int rtllib_read_qos_info_element(
			struct rtllib_qos_information_element *element_info,
			struct rtllib_info_element *info_element)
{}

/* Write QoS parameters from the ac parameters. */
static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info *param_elm,
					       struct rtllib_qos_data *qos_data)
{}

/* we have a generic data element which it may contain QoS information or
 * parameters element. check the information element length to decide
 * which type to read
 */
static int rtllib_parse_qos_info_param_IE(struct rtllib_device *ieee,
					  struct rtllib_info_element
					     *info_element,
					  struct rtllib_network *network)
{}

static const char *get_info_element_string(u16 id)
{}

static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
				      struct rtllib_info_element *info_element,
				      struct rtllib_network *network,
				      u16 *tmp_htcap_len,
				      u16 *tmp_htinfo_len)
{}

static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element,
				     struct rtllib_network *network,
				     u16 *tmp_htcap_len)
{}

int rtllib_parse_info_param(struct rtllib_device *ieee,
		struct rtllib_info_element *info_element,
		u16 length,
		struct rtllib_network *network,
		struct rtllib_rx_stats *stats)
{}

static long rtllib_translate_todbm(u8 signal_strength_index)
{}

static inline int rtllib_network_init(
	struct rtllib_device *ieee,
	struct rtllib_probe_response *beacon,
	struct rtllib_network *network,
	struct rtllib_rx_stats *stats)
{}

static inline int is_same_network(struct rtllib_network *src,
				  struct rtllib_network *dst, u8 ssidbroad)
{}

static inline void update_network(struct rtllib_device *ieee,
				  struct rtllib_network *dst,
				  struct rtllib_network *src)
{}

static int is_passive_channel(struct rtllib_device *rtllib, u8 channel)
{}

int rtllib_legal_channel(struct rtllib_device *rtllib, u8 channel)
{}
EXPORT_SYMBOL();

static inline void rtllib_process_probe_response(
	struct rtllib_device *ieee,
	struct rtllib_probe_response *beacon,
	struct rtllib_rx_stats *stats)
{}

static void rtllib_rx_mgt(struct rtllib_device *ieee,
			  struct sk_buff *skb,
			  struct rtllib_rx_stats *stats)
{}