linux/drivers/net/wireless/ath/wil6210/main.c

// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/moduleparam.h>
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
#include <linux/rtnetlink.h>

#include "wil6210.h"
#include "txrx.h"
#include "txrx_edma.h"
#include "wmi.h"
#include "boot_loader.h"

#define WAIT_FOR_HALP_VOTE_MS
#define WAIT_FOR_SCAN_ABORT_MS
#define WIL_DEFAULT_NUM_RX_STATUS_RINGS
#define WIL_BOARD_FILE_MAX_NAMELEN

bool debug_fw; /* = false; */
module_param(debug_fw, bool, 0444);
MODULE_PARM_DESC();

static u8 oob_mode;
module_param(oob_mode, byte, 0444);
MODULE_PARM_DESC();

bool no_fw_recovery;
module_param(no_fw_recovery, bool, 0644);
MODULE_PARM_DESC();

/* if not set via modparam, will be set to default value of 1/8 of
 * rx ring size during init flow
 */
unsigned short rx_ring_overflow_thrsh =;
module_param(rx_ring_overflow_thrsh, ushort, 0444);
MODULE_PARM_DESC();

/* We allow allocation of more than 1 page buffers to support large packets.
 * It is suboptimal behavior performance wise in case MTU above page size.
 */
unsigned int mtu_max =;
static int mtu_max_set(const char *val, const struct kernel_param *kp)
{}

static const struct kernel_param_ops mtu_max_ops =;

module_param_cb();
MODULE_PARM_DESC();

static uint rx_ring_order;
static uint tx_ring_order =;
static uint bcast_ring_order =;

static int ring_order_set(const char *val, const struct kernel_param *kp)
{}

static const struct kernel_param_ops ring_order_ops =;

module_param_cb();
MODULE_PARM_DESC();
module_param_cb();
MODULE_PARM_DESC();
module_param_cb();
MODULE_PARM_DESC();

enum {};

enum {};

#define RST_DELAY
#define RST_COUNT

#define PMU_READY_DELAY_MS

#define OTP_HW_DELAY
/* round up to be above 2 ms total */
#define OTP_HW_COUNT

/*
 * Due to a hardware issue,
 * one has to read/write to/from NIC in 32-bit chunks;
 * regular memcpy_fromio and siblings will
 * not work on 64-bit platform - it uses 64-bit transactions
 *
 * Force 32-bit transactions to enable NIC on 64-bit platforms
 *
 * To avoid byte swap on big endian host, __raw_{read|write}l
 * should be used - {read|write}l would swap bytes to provide
 * little endian on PCI value in host endianness.
 */
void wil_memcpy_fromio_32(void *dst, const volatile void __iomem *src,
			  size_t count)
{}

void wil_memcpy_toio_32(volatile void __iomem *dst, const void *src,
			size_t count)
{}

/* Device memory access is prohibited while reset or suspend.
 * wil_mem_access_lock protects accessing device memory in these cases
 */
int wil_mem_access_lock(struct wil6210_priv *wil)
{}

void wil_mem_access_unlock(struct wil6210_priv *wil)
{}

static void wil_ring_fini_tx(struct wil6210_priv *wil, int id)
{}

static bool wil_vif_is_connected(struct wil6210_priv *wil, u8 mid)
{}

static void wil_disconnect_cid_complete(struct wil6210_vif *vif, int cid,
					u16 reason_code)
__acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
{}

static void _wil6210_disconnect_complete(struct wil6210_vif *vif,
					 const u8 *bssid, u16 reason_code)
{}

static int wil_disconnect_cid(struct wil6210_vif *vif, int cid,
			      u16 reason_code)
{}

static void _wil6210_disconnect(struct wil6210_vif *vif, const u8 *bssid,
				u16 reason_code)
{}

void wil_disconnect_worker(struct work_struct *work)
{}

static int wil_wait_for_recovery(struct wil6210_priv *wil)
{}

void wil_set_recovery_state(struct wil6210_priv *wil, int state)
{}

bool wil_is_recovery_blocked(struct wil6210_priv *wil)
{}

static void wil_fw_error_worker(struct work_struct *work)
{}

static int wil_find_free_ring(struct wil6210_priv *wil)
{}

int wil_ring_init_tx(struct wil6210_vif *vif, int cid)
{}

int wil_bcast_init(struct wil6210_vif *vif)
{}

void wil_bcast_fini(struct wil6210_vif *vif)
{}

void wil_bcast_fini_all(struct wil6210_priv *wil)
{}

int wil_priv_init(struct wil6210_priv *wil)
{}

void wil6210_bus_request(struct wil6210_priv *wil, u32 kbps)
{}

/**
 * wil6210_disconnect - disconnect one connection
 * @vif: virtual interface context
 * @bssid: peer to disconnect, NULL to disconnect all
 * @reason_code: Reason code for the Disassociation frame
 *
 * Disconnect and release associated resources. Issue WMI
 * command(s) to trigger MAC disconnect. When command was issued
 * successfully, call the wil6210_disconnect_complete function
 * to handle the event synchronously
 */
void wil6210_disconnect(struct wil6210_vif *vif, const u8 *bssid,
			u16 reason_code)
{}

/**
 * wil6210_disconnect_complete - handle disconnect event
 * @vif: virtual interface context
 * @bssid: peer to disconnect, NULL to disconnect all
 * @reason_code: Reason code for the Disassociation frame
 *
 * Release associated resources and indicate upper layers the
 * connection is terminated.
 */
void wil6210_disconnect_complete(struct wil6210_vif *vif, const u8 *bssid,
				 u16 reason_code)
{}

void wil_priv_deinit(struct wil6210_priv *wil)
{}

static void wil_shutdown_bl(struct wil6210_priv *wil)
{}

/* this format is used by ARC embedded CPU for instruction memory */
static inline u32 ARC_me_imm32(u32 d)
{}

/* defines access to interrupt vectors for wil_freeze_bl */
#define ARC_IRQ_VECTOR_OFFSET(N)
/* ARC long jump instruction */
#define ARC_JAL_INST

static void wil_freeze_bl(struct wil6210_priv *wil)
{}

static void wil_bl_prepare_halt(struct wil6210_priv *wil)
{}

static inline void wil_halt_cpu(struct wil6210_priv *wil)
{}

static inline void wil_release_cpu(struct wil6210_priv *wil)
{}

static void wil_set_oob_mode(struct wil6210_priv *wil, u8 mode)
{}

static int wil_wait_device_ready(struct wil6210_priv *wil, int no_flash)
{}

static int wil_wait_device_ready_talyn_mb(struct wil6210_priv *wil)
{}

static int wil_target_reset(struct wil6210_priv *wil, int no_flash)
{}

static void wil_collect_fw_info(struct wil6210_priv *wil)
{}

void wil_refresh_fw_capabilities(struct wil6210_priv *wil)
{}

void wil_mbox_ring_le2cpus(struct wil6210_mbox_ring *r)
{}

/* construct actual board file name to use */
void wil_get_board_file(struct wil6210_priv *wil, char *buf, size_t len)
{}

static int wil_get_bl_info(struct wil6210_priv *wil)
{}

static void wil_bl_crash_info(struct wil6210_priv *wil, bool is_err)
{}

static int wil_get_otp_info(struct wil6210_priv *wil)
{}

static int wil_wait_for_fw_ready(struct wil6210_priv *wil)
{}

void wil_abort_scan(struct wil6210_vif *vif, bool sync)
{}

void wil_abort_scan_all_vifs(struct wil6210_priv *wil, bool sync)
{}

int wil_ps_update(struct wil6210_priv *wil, enum wmi_ps_profile_type ps_profile)
{}

static void wil_pre_fw_config(struct wil6210_priv *wil)
{}

static int wil_restore_vifs(struct wil6210_priv *wil)
{}

/*
 * Clear FW and ucode log start addr to indicate FW log is not ready. The host
 * driver clears the addresses before FW starts and FW initializes the address
 * when it is ready to send logs.
 */
void wil_clear_fw_log_addr(struct wil6210_priv *wil)
{}

/*
 * We reset all the structures, and we reset the UMAC.
 * After calling this routine, you're expected to reload
 * the firmware.
 */
int wil_reset(struct wil6210_priv *wil, bool load_fw)
{}

void wil_fw_error_recovery(struct wil6210_priv *wil)
{}

int __wil_up(struct wil6210_priv *wil)
{}

int wil_up(struct wil6210_priv *wil)
{}

int __wil_down(struct wil6210_priv *wil)
{}

int wil_down(struct wil6210_priv *wil)
{}

int wil_find_cid(struct wil6210_priv *wil, u8 mid, const u8 *mac)
{}

void wil_halp_vote(struct wil6210_priv *wil)
{}

void wil_halp_unvote(struct wil6210_priv *wil)
{}

void wil_init_txrx_ops(struct wil6210_priv *wil)
{}