linux/drivers/net/wireless/silabs/wfx/hif_rx.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Handling of the chip-to-host events (aka indications) of the hardware API.
 *
 * Copyright (c) 2017-2020, Silicon Laboratories, Inc.
 * Copyright (c) 2010, ST-Ericsson
 */
#include <linux/skbuff.h>
#include <linux/etherdevice.h>

#include "hif_rx.h"
#include "wfx.h"
#include "scan.h"
#include "bh.h"
#include "sta.h"
#include "data_rx.h"
#include "hif_api_cmd.h"

static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
				   const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_tx_confirm(struct wfx_dev *wdev,
			      const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
				    const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_startup_indication(struct wfx_dev *wdev,
				      const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
				     const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_receive_indication(struct wfx_dev *wdev, const struct wfx_hif_msg *hif,
				      const void *buf, struct sk_buff *skb)
{}

static int wfx_hif_event_indication(struct wfx_dev *wdev,
				    const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
					       const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
					    const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
					    const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
					     const struct wfx_hif_msg *hif, const void *buf)
{}

static int wfx_hif_generic_indication(struct wfx_dev *wdev,
				      const struct wfx_hif_msg *hif, const void *buf)
{}

static const struct {} hif_errors[] =;

static int wfx_hif_error_indication(struct wfx_dev *wdev,
				    const struct wfx_hif_msg *hif, const void *buf)
{
	const struct wfx_hif_ind_error *body = buf;
	int type = le32_to_cpu(body->type);
	int param = (s8)body->data[0];
	int i;

	for (i = 0; i < ARRAY_SIZE(hif_errors); i++)
		if (type == hif_errors[i].val)
			break;
	if (i < ARRAY_SIZE(hif_errors))
		if (hif_errors[i].has_param)
			dev_err(wdev->dev, "asynchronous error: %s: %d\n",
				hif_errors[i].str, param);
		else
			dev_err(wdev->dev, "asynchronous error: %s\n", hif_errors[i].str);
	else
		dev_err(wdev->dev, "asynchronous error: unknown: %08x\n", type);
	print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET,
		       16, 1, hif, le16_to_cpu(hif->len), false);
	wdev->chip_frozen = true;

	return 0;
};

static int wfx_hif_exception_indication(struct wfx_dev *wdev,
					const struct wfx_hif_msg *hif, const void *buf)
{}

static const struct {} hif_handlers[] =;

void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
{}