Path: blob/main/sys/contrib/dev/broadcom/brcm80211/brcmfmac/common.h
178665 views
// SPDX-License-Identifier: ISC1/*2* Copyright (c) 2014 Broadcom Corporation3*/4#ifndef BRCMFMAC_COMMON_H5#define BRCMFMAC_COMMON_H67#include <linux/platform_device.h>8#include <linux/platform_data/brcmfmac.h>9#include "fwil_types.h"1011#define BRCMF_FW_ALTPATH_LEN 2561213/* Definitions for the module global and device specific settings are defined14* here. Two structs are used for them. brcmf_mp_global_t and brcmf_mp_device.15* The mp_global is instantiated once in a global struct and gets initialized16* by the common_attach function which should be called before any other17* (module) initiliazation takes place. The device specific settings is part18* of the drvr struct and should be initialized on every brcmf_attach.19*/2021/**22* struct brcmf_mp_global_t - Global module parameters.23*24* @firmware_path: Alternative firmware path.25*/26struct brcmf_mp_global_t {27char firmware_path[BRCMF_FW_ALTPATH_LEN];28};2930extern struct brcmf_mp_global_t brcmf_mp_global;3132/**33* struct brcmf_mp_device - Device module parameters.34*35* @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).36* @feature_disable: Feature_disable bitmask.37* @fcmode: FWS flow control.38* @roamoff: Firmware roaming off?39* @ignore_probe_fail: Ignore probe failure.40* @trivial_ccode_map: Assume firmware uses ISO3166 country codes with rev 041* @country_codes: If available, pointer to struct for translating country codes42* @bus: Bus specific platform data. Only SDIO at the mmoment.43*/44struct brcmf_mp_device {45bool p2p_enable;46unsigned int feature_disable;47int fcmode;48bool roamoff;49bool iapp;50bool ignore_probe_fail;51bool trivial_ccode_map;52struct brcmfmac_pd_cc *country_codes;53const char *board_type;54unsigned char mac[ETH_ALEN];55const char *antenna_sku;56const void *cal_blob;57int cal_size;58union {59struct brcmfmac_sdio_pd sdio;60} bus;61};6263void brcmf_c_set_joinpref_default(struct brcmf_if *ifp);6465struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,66enum brcmf_bus_type bus_type,67u32 chip, u32 chiprev);68void brcmf_release_module_param(struct brcmf_mp_device *module_param);6970/* Sets dongle media info (drv_version, mac address). */71int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);72int brcmf_c_set_cur_etheraddr(struct brcmf_if *ifp, const u8 *addr);7374#ifdef CONFIG_DMI75void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev);76#else77static inline void78brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) {}79#endif8081#ifdef CONFIG_ACPI82void brcmf_acpi_probe(struct device *dev, enum brcmf_bus_type bus_type,83struct brcmf_mp_device *settings);84#else85static inline void brcmf_acpi_probe(struct device *dev,86enum brcmf_bus_type bus_type,87struct brcmf_mp_device *settings) {}88#endif8990u8 brcmf_map_prio_to_prec(void *cfg, u8 prio);9192u8 brcmf_map_prio_to_aci(void *cfg, u8 prio);9394#endif /* BRCMFMAC_COMMON_H */959697