Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: ISC
0002 /*
0003  * Copyright (c) 2014 Broadcom Corporation
0004  */
0005 #ifndef BRCMFMAC_COMMON_H
0006 #define BRCMFMAC_COMMON_H
0007 
0008 #include <linux/platform_device.h>
0009 #include <linux/platform_data/brcmfmac.h>
0010 #include "fwil_types.h"
0011 
0012 #define BRCMF_FW_ALTPATH_LEN            256
0013 
0014 /* Definitions for the module global and device specific settings are defined
0015  * here. Two structs are used for them. brcmf_mp_global_t and brcmf_mp_device.
0016  * The mp_global is instantiated once in a global struct and gets initialized
0017  * by the common_attach function which should be called before any other
0018  * (module) initiliazation takes place. The device specific settings is part
0019  * of the drvr struct and should be initialized on every brcmf_attach.
0020  */
0021 
0022 /**
0023  * struct brcmf_mp_global_t - Global module paramaters.
0024  *
0025  * @firmware_path: Alternative firmware path.
0026  */
0027 struct brcmf_mp_global_t {
0028     char    firmware_path[BRCMF_FW_ALTPATH_LEN];
0029 };
0030 
0031 extern struct brcmf_mp_global_t brcmf_mp_global;
0032 
0033 /**
0034  * struct brcmf_mp_device - Device module paramaters.
0035  *
0036  * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
0037  * @feature_disable: Feature_disable bitmask.
0038  * @fcmode: FWS flow control.
0039  * @roamoff: Firmware roaming off?
0040  * @ignore_probe_fail: Ignore probe failure.
0041  * @trivial_ccode_map: Assume firmware uses ISO3166 country codes with rev 0
0042  * @country_codes: If available, pointer to struct for translating country codes
0043  * @bus: Bus specific platform data. Only SDIO at the mmoment.
0044  */
0045 struct brcmf_mp_device {
0046     bool        p2p_enable;
0047     unsigned int    feature_disable;
0048     int     fcmode;
0049     bool        roamoff;
0050     bool        iapp;
0051     bool        ignore_probe_fail;
0052     bool        trivial_ccode_map;
0053     struct brcmfmac_pd_cc *country_codes;
0054     const char  *board_type;
0055     unsigned char   mac[ETH_ALEN];
0056     union {
0057         struct brcmfmac_sdio_pd sdio;
0058     } bus;
0059 };
0060 
0061 void brcmf_c_set_joinpref_default(struct brcmf_if *ifp);
0062 
0063 struct brcmf_mp_device *brcmf_get_module_param(struct device *dev,
0064                            enum brcmf_bus_type bus_type,
0065                            u32 chip, u32 chiprev);
0066 void brcmf_release_module_param(struct brcmf_mp_device *module_param);
0067 
0068 /* Sets dongle media info (drv_version, mac address). */
0069 int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
0070 int brcmf_c_set_cur_etheraddr(struct brcmf_if *ifp, const u8 *addr);
0071 
0072 #ifdef CONFIG_DMI
0073 void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev);
0074 #else
0075 static inline void
0076 brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) {}
0077 #endif
0078 
0079 u8 brcmf_map_prio_to_prec(void *cfg, u8 prio);
0080 
0081 u8 brcmf_map_prio_to_aci(void *cfg, u8 prio);
0082 
0083 #endif /* BRCMFMAC_COMMON_H */