2 * Linux cfg80211 driver - Android related functions
4 * Copyright (C) 1999-2019, Broadcom.
6 * Unless you and Broadcom execute a separate written software license
7 * agreement governing use of this software, this software is licensed to you
8 * under the terms of the GNU General Public License version 2 (the "GPL"),
9 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10 * following added to such license:
12 * As a special exception, the copyright holders of this software give you
13 * permission to link this software with independent modules, and to copy and
14 * distribute the resulting executable under terms of your choice, provided that
15 * you also meet, for each linked independent module, the terms and conditions of
16 * the license of that module. An independent module is a module which is not
17 * derived from this software. The special exception does not apply to any
18 * modifications of the software.
20 * Notwithstanding the above, under no circumstances may you combine this
21 * software in any way with any other Broadcom software provided under a license
22 * other than the GPL, without Broadcom's express prior written consent.
25 * <<Broadcom-WL-IPTag/Open:>>
27 * $Id: wl_android.h 695651 2017-04-21 10:48:20Z $
30 #include <linux/module.h>
31 #include <linux/netdevice.h>
32 #include <wldev_common.h>
34 /* If any feature uses the Generic Netlink Interface, put it here to enable WL_GENL
37 #if defined(BT_WIFI_HANDOVER)
42 #include <net/genetlink.h>
45 typedef struct _android_wifi_priv_cmd
{
49 } android_wifi_priv_cmd
;
52 typedef struct _compat_android_wifi_priv_cmd
{
56 } compat_android_wifi_priv_cmd
;
57 #endif /* CONFIG_COMPAT */
60 * Android platform dependent functions, feel free to add Android specific functions here
61 * (save the macros in dhd). Please do NOT declare functions that are NOT exposed to dhd
62 * or cfg, define them as static in wl_android.c
66 * wl_android_init will be called from module init function (dhd_module_init now), similarly
67 * wl_android_exit will be called from module exit function (dhd_module_cleanup now)
69 int wl_android_init(void);
70 int wl_android_exit(void);
71 void wl_android_post_init(void);
72 int wl_android_wifi_on(struct net_device
*dev
);
73 int wl_android_wifi_off(struct net_device
*dev
, bool on_failure
);
74 int wl_android_priv_cmd(struct net_device
*net
, struct ifreq
*ifr
);
75 int wl_handle_private_cmd(struct net_device
*net
, char *command
, u32 cmd_len
);
78 typedef struct bcm_event_hdr
{
83 /* attributes (variables): the index in this enum is used as a reference for the type,
84 * userspace application has to indicate the corresponding type
85 * the policy is used for security considerations
93 #define BCM_GENL_ATTR_MAX (__BCM_GENL_ATTR_MAX - 1)
95 /* commands: enumeration of all commands (functions),
96 * used by userspace application to identify command to be ececuted
103 #define BCM_GENL_CMD_MAX (__BCM_GENL_CMD_MAX - 1)
105 /* Enum values used by the BCM supplicant to identify the events */
111 #ifdef BT_WIFI_HANDOVER
112 BCM_E_DEV_BT_WIFI_HO_REQ
,
117 s32
wl_genl_send_msg(struct net_device
*ndev
, u32 event_type
,
118 const u8
*string
, u16 len
, u8
*hdr
, u16 hdrlen
);
120 s32
wl_netlink_send_msg(int pid
, int type
, int seq
, const void *data
, size_t size
);
122 /* hostap mac mode */
123 #define MACLIST_MODE_DISABLED 0
124 #define MACLIST_MODE_DENY 1
125 #define MACLIST_MODE_ALLOW 2
127 /* max number of assoc list */
128 #define MAX_NUM_OF_ASSOCLIST 64
131 #define WL_CH_BANDWIDTH_20MHZ 20
132 #define WL_CH_BANDWIDTH_40MHZ 40
133 #define WL_CH_BANDWIDTH_80MHZ 80
134 /* max number of mac filter list
135 * restrict max number to 10 as maximum cmd string size is 255
137 #define MAX_NUM_MAC_FILT 10
139 int wl_android_set_ap_mac_list(struct net_device
*dev
, int macmode
, struct maclist
*maclist
);