1 /* Copyright (c) 2014 Broadcom Corporation
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14  */
15 #ifndef BRCMFMAC_COMMON_H
16 #define BRCMFMAC_COMMON_H
17 
18 extern const u8 ALLFFMAC[ETH_ALEN];
19 
20 #define BRCMF_FW_ALTPATH_LEN			256
21 
22 /* Definitions for the module global and device specific settings are defined
23  * here. Two structs are used for them. brcmf_mp_global_t and brcmf_mp_device.
24  * The mp_global is instantiated once in a global struct and gets initialized
25  * by the common_attach function which should be called before any other
26  * (module) initiliazation takes place. The device specific settings is part
27  * of the drvr struct and should be initialized on every brcmf_attach.
28  */
29 
30 /**
31  * struct brcmf_mp_global_t - Global module paramaters.
32  *
33  * @firmware_path: Alternative firmware path.
34  */
35 struct brcmf_mp_global_t {
36 	char	firmware_path[BRCMF_FW_ALTPATH_LEN];
37 };
38 
39 extern struct brcmf_mp_global_t brcmf_mp_global;
40 
41 /**
42  * struct brcmf_mp_device - Device module paramaters.
43  *
44  * @sdiod_txglomsz: SDIO txglom size.
45  * @joinboost_5g_rssi: 5g rssi booost for preferred join selection.
46  * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant).
47  * @feature_disable: Feature_disable bitmask.
48  * @fcmode: FWS flow control.
49  * @roamoff: Firmware roaming off?
50  */
51 struct brcmf_mp_device {
52 	int	sdiod_txglomsz;
53 	int	joinboost_5g_rssi;
54 	bool	p2p_enable;
55 	int	feature_disable;
56 	int	fcmode;
57 	bool	roamoff;
58 	bool	ignore_probe_fail;
59 };
60 
61 void brcmf_mp_attach(void);
62 int brcmf_mp_device_attach(struct brcmf_pub *drvr);
63 void brcmf_mp_device_detach(struct brcmf_pub *drvr);
64 #ifdef DEBUG
65 static inline bool brcmf_ignoring_probe_fail(struct brcmf_pub *drvr)
66 {
67 	return drvr->settings->ignore_probe_fail;
68 }
69 #else
70 static inline bool brcmf_ignoring_probe_fail(struct brcmf_pub *drvr)
71 {
72 	return false;
73 }
74 #endif
75 
76 /* Sets dongle media info (drv_version, mac address). */
77 int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
78 
79 #endif /* BRCMFMAC_COMMON_H */
80