linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c

// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2010 Broadcom Corporation
 */

#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/module.h>
#include <linux/firmware.h>
#include <brcmu_wifi.h>
#include <brcmu_utils.h>
#include "core.h"
#include "bus.h"
#include "debug.h"
#include "fwil.h"
#include "fwil_types.h"
#include "tracepoint.h"
#include "common.h"
#include "of.h"
#include "firmware.h"
#include "chip.h"

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

#define BRCMF_DEFAULT_SCAN_CHANNEL_TIME
#define BRCMF_DEFAULT_SCAN_UNASSOC_TIME

/* default boost value for RSSI_DELTA in preferred join selection */
#define BRCMF_JOIN_PREF_RSSI_BOOST

#define BRCMF_DEFAULT_TXGLOM_SIZE

static int brcmf_sdiod_txglomsz =;
module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
MODULE_PARM_DESC();

/* Debug level configuration. See debug.h for bits, sysfs modifiable */
int brcmf_msg_level;
module_param_named(debug, brcmf_msg_level, int, 0600);
MODULE_PARM_DESC();

static int brcmf_p2p_enable;
module_param_named(p2pon, brcmf_p2p_enable, int, 0);
MODULE_PARM_DESC();

static int brcmf_feature_disable;
module_param_named(feature_disable, brcmf_feature_disable, int, 0);
MODULE_PARM_DESC();

static char brcmf_firmware_path[BRCMF_FW_ALTPATH_LEN];
module_param_string();
MODULE_PARM_DESC();

static int brcmf_fcmode;
module_param_named(fcmode, brcmf_fcmode, int, 0);
MODULE_PARM_DESC();

static int brcmf_roamoff;
module_param_named(roamoff, brcmf_roamoff, int, 0400);
MODULE_PARM_DESC();

static int brcmf_iapp_enable;
module_param_named(iapp, brcmf_iapp_enable, int, 0);
MODULE_PARM_DESC();

#ifdef DEBUG
/* always succeed brcmf_bus_started() */
static int brcmf_ignore_probe_fail;
module_param_named(ignore_probe_fail, brcmf_ignore_probe_fail, int, 0);
MODULE_PARM_DESC();
#endif

static struct brcmfmac_platform_data *brcmfmac_pdata;
struct brcmf_mp_global_t brcmf_mp_global;

void brcmf_c_set_joinpref_default(struct brcmf_if *ifp)
{}

static int brcmf_c_download(struct brcmf_if *ifp, u16 flag,
			    struct brcmf_dload_data_le *dload_buf,
			    u32 len, const char *var)
{}

static int brcmf_c_download_blob(struct brcmf_if *ifp,
				 const void *data, size_t size,
				 const char *loadvar, const char *statvar)
{}

static int brcmf_c_process_clm_blob(struct brcmf_if *ifp)
{}

static int brcmf_c_process_txcap_blob(struct brcmf_if *ifp)
{}

int brcmf_c_set_cur_etheraddr(struct brcmf_if *ifp, const u8 *addr)
{}

/* On some boards there is no eeprom to hold the nvram, in this case instead
 * a board specific nvram is loaded from /lib/firmware. On most boards the
 * macaddr setting in the /lib/firmware nvram file is ignored because the
 * wifibt chip has a unique MAC programmed into the chip itself.
 * But in some cases the actual MAC from the /lib/firmware nvram file gets
 * used, leading to MAC conflicts.
 * The MAC addresses in the troublesome nvram files seem to all come from
 * the same nvram file template, so we only need to check for 1 known
 * address to detect this.
 */
static const u8 brcmf_default_mac_address[ETH_ALEN] =;

static int brcmf_c_process_cal_blob(struct brcmf_if *ifp)
{}

int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
{}

#ifndef CONFIG_BRCM_TRACING
void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...)
{
	struct va_format vaf;
	va_list args;

	va_start(args, fmt);

	vaf.fmt = fmt;
	vaf.va = &args;
	if (bus)
		dev_err(bus->dev, "%s: %pV", func, &vaf);
	else
		pr_err("%s: %pV", func, &vaf);

	va_end(args);
}
#endif

#if defined(CONFIG_BRCM_TRACING) || defined(CONFIG_BRCMDBG)
void __brcmf_dbg(u32 level, const char *func, const char *fmt, ...)
{}
#endif

static void brcmf_mp_attach(void)
{}

struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
					       enum brcmf_bus_type bus_type,
					       u32 chip, u32 chiprev)
{}

void brcmf_release_module_param(struct brcmf_mp_device *module_param)
{}

static int __init brcmf_common_pd_probe(struct platform_device *pdev)
{}

static void brcmf_common_pd_remove(struct platform_device *pdev)
{}

static struct platform_driver brcmf_pd =;

static int __init brcmfmac_module_init(void)
{}

static void __exit brcmfmac_module_exit(void)
{}

module_init();
module_exit(brcmfmac_module_exit);