linux/drivers/net/wireless/intel/ipw2x00/libipw_rx.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * 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-2005, Intel Corporation
 */

#include <linux/compiler.h>
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/in6.h>
#include <linux/gfp.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/proc_fs.h>
#include <linux/skbuff.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 <net/lib80211.h>

#include "libipw.h"

static void libipw_monitor_rx(struct libipw_device *ieee,
					struct sk_buff *skb,
					struct libipw_rx_stats *rx_stats)
{}

/* Called only as a tasklet (software IRQ) */
static struct libipw_frag_entry *libipw_frag_cache_find(struct
							      libipw_device
							      *ieee,
							      unsigned int seq,
							      unsigned int frag,
							      u8 * src,
							      u8 * dst)
{}

/* Called only as a tasklet (software IRQ) */
static struct sk_buff *libipw_frag_cache_get(struct libipw_device *ieee,
						struct libipw_hdr_4addr *hdr)
{}

/* Called only as a tasklet (software IRQ) */
static int libipw_frag_cache_invalidate(struct libipw_device *ieee,
					   struct libipw_hdr_4addr *hdr)
{}

#ifdef NOT_YET
/* libipw_rx_frame_mgtmt
 *
 * Responsible for handling management control frames
 *
 * Called by libipw_rx */
static int
libipw_rx_frame_mgmt(struct libipw_device *ieee, struct sk_buff *skb,
			struct libipw_rx_stats *rx_stats, u16 type,
			u16 stype)
{
	if (ieee->iw_mode == IW_MODE_MASTER) {
		printk(KERN_DEBUG "%s: Master mode not yet supported.\n",
		       ieee->dev->name);
		return 0;
/*
  hostap_update_sta_ps(ieee, (struct hostap_libipw_hdr_4addr *)
  skb->data);*/
	}

	if (ieee->hostapd && type == WLAN_FC_TYPE_MGMT) {
		if (stype == WLAN_FC_STYPE_BEACON &&
		    ieee->iw_mode == IW_MODE_MASTER) {
			struct sk_buff *skb2;
			/* Process beacon frames also in kernel driver to
			 * update STA(AP) table statistics */
			skb2 = skb_clone(skb, GFP_ATOMIC);
			if (skb2)
				hostap_rx(skb2->dev, skb2, rx_stats);
		}

		/* send management frames to the user space daemon for
		 * processing */
		ieee->apdevstats.rx_packets++;
		ieee->apdevstats.rx_bytes += skb->len;
		prism2_rx_80211(ieee->apdev, skb, rx_stats, PRISM2_RX_MGMT);
		return 0;
	}

	if (ieee->iw_mode == IW_MODE_MASTER) {
		if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) {
			printk(KERN_DEBUG "%s: unknown management frame "
			       "(type=0x%02x, stype=0x%02x) dropped\n",
			       skb->dev->name, type, stype);
			return -1;
		}

		hostap_rx(skb->dev, skb, rx_stats);
		return 0;
	}

	printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: management frame "
	       "received in non-Host AP mode\n", skb->dev->name);
	return -1;
}
#endif

/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
static unsigned char libipw_rfc1042_header[] =;

/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static unsigned char libipw_bridge_tunnel_header[] =;
/* No encapsulation header if EtherType < 0x600 (=length) */

/* Called by libipw_rx_frame_decrypt */
static int libipw_is_eapol_frame(struct libipw_device *ieee,
				    struct sk_buff *skb)
{}

/* Called only as a tasklet (software IRQ), by libipw_rx */
static int
libipw_rx_frame_decrypt(struct libipw_device *ieee, struct sk_buff *skb,
			   struct lib80211_crypt_data *crypt)
{}

/* Called only as a tasklet (software IRQ), by libipw_rx */
static int
libipw_rx_frame_decrypt_msdu(struct libipw_device *ieee,
				struct sk_buff *skb, int keyidx,
				struct lib80211_crypt_data *crypt)
{}

/* 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 libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
		 struct libipw_rx_stats *rx_stats)
{}

/* Filter out unrelated packets, call libipw_rx[_mgt]
 * This function takes over the skb, it should not be used again after calling
 * this function. */
void libipw_rx_any(struct libipw_device *ieee,
		     struct sk_buff *skb, struct libipw_rx_stats *stats)
{}

#define MGMT_FRAME_FIXED_PART_LENGTH

static u8 qos_oui[QOS_OUI_LEN] =;

/*
* Make the structure we read from the beacon packet to have
* the right values
*/
static int libipw_verify_qos_info(struct libipw_qos_information_element
				     *info_element, int sub_type)
{}

/*
 * Parse a QoS parameter element
 */
static int libipw_read_qos_param_element(
			struct libipw_qos_parameter_info *element_param,
			struct libipw_info_element *info_element)
{}

/*
 * Parse a QoS information element
 */
static int libipw_read_qos_info_element(
			struct libipw_qos_information_element *element_info,
			struct libipw_info_element *info_element)
{}

/*
 * Write QoS parameters from the ac parameters.
 */
static void libipw_qos_convert_ac_to_parameters(struct
						  libipw_qos_parameter_info
						  *param_elm, struct
						  libipw_qos_parameters
						  *qos_param)
{}

/*
 * 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 libipw_parse_qos_info_param_IE(struct libipw_info_element
					     *info_element,
					     struct libipw_network *network)
{}

#ifdef CONFIG_LIBIPW_DEBUG
#define MFIE_STRING(x)

static const char *get_info_element_string(u16 id)
{}
#endif

static int libipw_parse_info_param(struct libipw_info_element
				      *info_element, u16 length,
				      struct libipw_network *network)
{}

static int libipw_handle_assoc_resp(struct libipw_device *ieee, struct libipw_assoc_response
				       *frame, struct libipw_rx_stats *stats)
{}

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

static int libipw_network_init(struct libipw_device *ieee, struct libipw_probe_response
					 *beacon,
					 struct libipw_network *network,
					 struct libipw_rx_stats *stats)
{}

static inline int is_same_network(struct libipw_network *src,
				  struct libipw_network *dst)
{}

static void update_network(struct libipw_network *dst,
				  struct libipw_network *src)
{}

static inline int is_beacon(__le16 fc)
{}

static void libipw_process_probe_response(struct libipw_device
						    *ieee, struct
						    libipw_probe_response
						    *beacon, struct libipw_rx_stats
						    *stats)
{}

void libipw_rx_mgt(struct libipw_device *ieee,
		      struct libipw_hdr_4addr *header,
		      struct libipw_rx_stats *stats)
{}

EXPORT_SYMBOL_GPL();
EXPORT_SYMBOL();
EXPORT_SYMBOL();