18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: ISC
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2014 Broadcom Corporation
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci#ifndef BRCMFMAC_COMMON_H
68c2ecf20Sopenharmony_ci#define BRCMFMAC_COMMON_H
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
98c2ecf20Sopenharmony_ci#include <linux/platform_data/brcmfmac.h>
108c2ecf20Sopenharmony_ci#include "fwil_types.h"
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define BRCMF_FW_ALTPATH_LEN			256
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/* Definitions for the module global and device specific settings are defined
158c2ecf20Sopenharmony_ci * here. Two structs are used for them. brcmf_mp_global_t and brcmf_mp_device.
168c2ecf20Sopenharmony_ci * The mp_global is instantiated once in a global struct and gets initialized
178c2ecf20Sopenharmony_ci * by the common_attach function which should be called before any other
188c2ecf20Sopenharmony_ci * (module) initiliazation takes place. The device specific settings is part
198c2ecf20Sopenharmony_ci * of the drvr struct and should be initialized on every brcmf_attach.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/**
238c2ecf20Sopenharmony_ci * struct brcmf_mp_global_t - Global module paramaters.
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * @firmware_path: Alternative firmware path.
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_cistruct brcmf_mp_global_t {
288c2ecf20Sopenharmony_ci	char	firmware_path[BRCMF_FW_ALTPATH_LEN];
298c2ecf20Sopenharmony_ci};
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciextern struct brcmf_mp_global_t brcmf_mp_global;
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/**
348c2ecf20Sopenharmony_ci * struct brcmf_mp_device - Device module paramaters.
358c2ecf20Sopenharmony_ci *
368c2ecf20Sopenharmony_ci * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
378c2ecf20Sopenharmony_ci * @feature_disable: Feature_disable bitmask.
388c2ecf20Sopenharmony_ci * @fcmode: FWS flow control.
398c2ecf20Sopenharmony_ci * @roamoff: Firmware roaming off?
408c2ecf20Sopenharmony_ci * @ignore_probe_fail: Ignore probe failure.
418c2ecf20Sopenharmony_ci * @country_codes: If available, pointer to struct for translating country codes
428c2ecf20Sopenharmony_ci * @bus: Bus specific platform data. Only SDIO at the mmoment.
438c2ecf20Sopenharmony_ci */
448c2ecf20Sopenharmony_cistruct brcmf_mp_device {
458c2ecf20Sopenharmony_ci	bool		p2p_enable;
468c2ecf20Sopenharmony_ci	unsigned int	feature_disable;
478c2ecf20Sopenharmony_ci	int		fcmode;
488c2ecf20Sopenharmony_ci	bool		roamoff;
498c2ecf20Sopenharmony_ci	bool		iapp;
508c2ecf20Sopenharmony_ci	bool		ignore_probe_fail;
518c2ecf20Sopenharmony_ci	struct brcmfmac_pd_cc *country_codes;
528c2ecf20Sopenharmony_ci	const char	*board_type;
538c2ecf20Sopenharmony_ci	union {
548c2ecf20Sopenharmony_ci		struct brcmfmac_sdio_pd sdio;
558c2ecf20Sopenharmony_ci	} bus;
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_civoid brcmf_c_set_joinpref_default(struct brcmf_if *ifp);
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cistruct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
618c2ecf20Sopenharmony_ci					       enum brcmf_bus_type bus_type,
628c2ecf20Sopenharmony_ci					       u32 chip, u32 chiprev);
638c2ecf20Sopenharmony_civoid brcmf_release_module_param(struct brcmf_mp_device *module_param);
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/* Sets dongle media info (drv_version, mac address). */
668c2ecf20Sopenharmony_ciint brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#ifdef CONFIG_DMI
698c2ecf20Sopenharmony_civoid brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev);
708c2ecf20Sopenharmony_ci#else
718c2ecf20Sopenharmony_cistatic inline void
728c2ecf20Sopenharmony_cibrcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) {}
738c2ecf20Sopenharmony_ci#endif
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciu8 brcmf_map_prio_to_prec(void *cfg, u8 prio);
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciu8 brcmf_map_prio_to_aci(void *cfg, u8 prio);
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#endif /* BRCMFMAC_COMMON_H */
80