linux/drivers/net/wireless/intel/iwlwifi/dvm/rx.c

// SPDX-License-Identifier: GPL-2.0-only
/******************************************************************************
 *
 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2015 Intel Deutschland GmbH
 * Copyright(c) 2018, 2020-2021 Intel Corporation
 *
 * Portions of this file are derived from the ipw3945 project, as well
 * as portionhelp of the ieee80211 subsystem header files.
 *****************************************************************************/

#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <net/mac80211.h>
#include <asm/unaligned.h>

#include "iwl-trans.h"
#include "iwl-io.h"
#include "dev.h"
#include "calib.h"
#include "agn.h"

/******************************************************************************
 *
 * Generic RX handler implementations
 *
 ******************************************************************************/

static void iwlagn_rx_reply_error(struct iwl_priv *priv,
				  struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_csa(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb)
{}


static void iwlagn_rx_spectrum_measure_notif(struct iwl_priv *priv,
					     struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_pm_sleep_notif(struct iwl_priv *priv,
				     struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
						struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_beacon_notif(struct iwl_priv *priv,
				   struct iwl_rx_cmd_buffer *rxb)
{}

/*
 * iwl_good_plcp_health - checks for plcp error.
 *
 * When the plcp error is exceeding the thresholds, reset the radio
 * to improve the throughput.
 */
static bool iwlagn_good_plcp_health(struct iwl_priv *priv,
				 struct statistics_rx_phy *cur_ofdm,
				 struct statistics_rx_ht_phy *cur_ofdm_ht,
				 unsigned int msecs)
{}

int iwl_force_rf_reset(struct iwl_priv *priv, bool external)
{}


static void iwlagn_recover_from_statistics(struct iwl_priv *priv,
				struct statistics_rx_phy *cur_ofdm,
				struct statistics_rx_ht_phy *cur_ofdm_ht,
				struct statistics_tx *tx,
				unsigned long stamp)
{}

/* Calculate noise level, based on measurements during network silence just
 *   before arriving beacon.  This measurement can be done only if we know
 *   exactly when to expect beacons, therefore only when we're associated. */
static void iwlagn_rx_calc_noise(struct iwl_priv *priv)
{}

#ifdef CONFIG_IWLWIFI_DEBUGFS
/*
 *  based on the assumption of all statistics counter are in DWORD
 *  FIXME: This function is for debugging, do not deal with
 *  the case of counters roll-over.
 */
static void accum_stats(__le32 *prev, __le32 *cur, __le32 *delta,
			__le32 *max_delta, __le32 *accum, int size)
{}

static void
iwlagn_accumulative_statistics(struct iwl_priv *priv,
			    struct statistics_general_common *common,
			    struct statistics_rx_non_phy *rx_non_phy,
			    struct statistics_rx_phy *rx_ofdm,
			    struct statistics_rx_ht_phy *rx_ofdm_ht,
			    struct statistics_rx_phy *rx_cck,
			    struct statistics_tx *tx,
			    struct statistics_bt_activity *bt_activity)
{}
#else
static inline void
iwlagn_accumulative_statistics(struct iwl_priv *priv,
			    struct statistics_general_common *common,
			    struct statistics_rx_non_phy *rx_non_phy,
			    struct statistics_rx_phy *rx_ofdm,
			    struct statistics_rx_ht_phy *rx_ofdm_ht,
			    struct statistics_rx_phy *rx_cck,
			    struct statistics_tx *tx,
			    struct statistics_bt_activity *bt_activity)
{
}
#endif

static void iwlagn_rx_statistics(struct iwl_priv *priv,
				 struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_reply_statistics(struct iwl_priv *priv,
				       struct iwl_rx_cmd_buffer *rxb)
{}

/* Handle notification from uCode that card's power state is changing
 * due to software, hardware, or critical temperature RFKILL */
static void iwlagn_rx_card_state_notif(struct iwl_priv *priv,
				       struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_missed_beacon_notif(struct iwl_priv *priv,
					  struct iwl_rx_cmd_buffer *rxb)

{}

/* Cache phy data (Rx signal strength, etc) for HT frame (REPLY_RX_PHY_CMD).
 * This will be used later in iwl_rx_reply_rx() for REPLY_RX_MPDU_CMD. */
static void iwlagn_rx_reply_rx_phy(struct iwl_priv *priv,
				   struct iwl_rx_cmd_buffer *rxb)
{}

/*
 * returns non-zero if packet should be dropped
 */
static int iwlagn_set_decrypted_flag(struct iwl_priv *priv,
				  struct ieee80211_hdr *hdr,
				  u32 decrypt_res,
				  struct ieee80211_rx_status *stats)
{}

static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
					struct ieee80211_hdr *hdr,
					u16 len,
					u32 ampdu_status,
					struct iwl_rx_cmd_buffer *rxb,
					struct ieee80211_rx_status *stats)
{}

static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
{}

/* Calc max signal level (dBm) among 3 possible receivers */
static int iwlagn_calc_rssi(struct iwl_priv *priv,
			     struct iwl_rx_phy_res *rx_resp)
{}

/* Called for REPLY_RX_MPDU_CMD */
static void iwlagn_rx_reply_rx(struct iwl_priv *priv,
			       struct iwl_rx_cmd_buffer *rxb)
{}

static void iwlagn_rx_noa_notification(struct iwl_priv *priv,
				       struct iwl_rx_cmd_buffer *rxb)
{}

/*
 * iwl_setup_rx_handlers - Initialize Rx handler callbacks
 *
 * Setup the RX handlers for each of the reply types sent from the uCode
 * to the host.
 */
void iwl_setup_rx_handlers(struct iwl_priv *priv)
{}

void iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct napi_struct *napi,
		     struct iwl_rx_cmd_buffer *rxb)
{}