forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/wldev_common.h
....@@ -1,15 +1,16 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
21 /*
32 * Common function shared by Linux WEXT, cfg80211 and p2p drivers
43 *
5
- * Copyright (C) 1999-2019, Broadcom Corporation
6
- *
4
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
5
+ *
6
+ * Copyright (C) 1999-2017, Broadcom Corporation
7
+ *
78 * Unless you and Broadcom execute a separate written software license
89 * agreement governing use of this software, this software is licensed to you
910 * under the terms of the GNU General Public License version 2 (the "GPL"),
1011 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
1112 * following added to such license:
12
- *
13
+ *
1314 * As a special exception, the copyright holders of this software give you
1415 * permission to link this software with independent modules, and to copy and
1516 * distribute the resulting executable under terms of your choice, provided that
....@@ -17,7 +18,7 @@
1718 * the license of that module. An independent module is a module which is not
1819 * derived from this software. The special exception does not apply to any
1920 * modifications of the software.
20
- *
21
+ *
2122 * Notwithstanding the above, under no circumstances may you combine this
2223 * software in any way with any other Broadcom software provided under a license
2324 * other than the GPL, without Broadcom's express prior written consent.
....@@ -25,7 +26,7 @@
2526 *
2627 * <<Broadcom-WL-IPTag/Open:>>
2728 *
28
- * $Id: wldev_common.h 556083 2015-05-12 14:03:00Z $
29
+ * $Id: wldev_common.h 695669 2017-04-21 13:04:52Z $
2930 */
3031 #ifndef __WLDEV_COMMON_H__
3132 #define __WLDEV_COMMON_H__
....@@ -36,22 +37,26 @@
3637 * netdev_ops->ndo_do_ioctl in new kernels)
3738 * @dev: the net_device handle
3839 */
39
-s32 wldev_ioctl(
40
- struct net_device *dev, u32 cmd, void *arg, u32 len, u32 set);
40
+
41
+s32 wldev_ioctl_get(
42
+ struct net_device *dev, u32 cmd, void *arg, u32 len);
43
+
44
+s32 wldev_ioctl_set(
45
+ struct net_device *dev, u32 cmd, const void *arg, u32 len);
4146
4247 /** Retrieve named IOVARs, this function calls wl_dev_ioctl with
4348 * WLC_GET_VAR IOCTL code
4449 */
4550 s32 wldev_iovar_getbuf(
4651 struct net_device *dev, s8 *iovar_name,
47
- void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
52
+ const void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
4853
4954 /** Set named IOVARs, this function calls wl_dev_ioctl with
5055 * WLC_SET_VAR IOCTL code
5156 */
5257 s32 wldev_iovar_setbuf(
5358 struct net_device *dev, s8 *iovar_name,
54
- void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
59
+ const void *param, s32 paramlen, void *buf, s32 buflen, struct mutex* buf_sync);
5560
5661 s32 wldev_iovar_setint(
5762 struct net_device *dev, s8 *iovar, s32 val);
....@@ -64,7 +69,7 @@
6469 */
6570
6671 s32 wldev_mkiovar_bsscfg(
67
- const s8 *iovar_name, s8 *param, s32 paramlen,
72
+ const s8 *iovar_name, const s8 *param, s32 paramlen,
6873 s8 *iovar_buf, s32 buflen, s32 bssidx);
6974
7075 /** Retrieve named and bsscfg indexed IOVARs, this function calls wl_dev_ioctl with
....@@ -78,7 +83,7 @@
7883 * WLC_SET_VAR IOCTL code
7984 */
8085 s32 wldev_iovar_setbuf_bsscfg(
81
- struct net_device *dev, s8 *iovar_name, void *param, s32 paramlen,
86
+ struct net_device *dev, const s8 *iovar_name, const void *param, s32 paramlen,
8287 void *buf, s32 buflen, s32 bsscfg_idx, struct mutex* buf_sync);
8388
8489 s32 wldev_iovar_getint_bsscfg(
....@@ -95,7 +100,9 @@
95100 extern void dhd_get_customized_country_code(struct net_device *dev, char *country_iso_code,
96101 wl_country_t *cspec);
97102 extern void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec, bool notify);
103
+#ifdef OEM_ANDROID
98104 extern bool dhd_force_country_change(struct net_device *dev);
105
+#endif // endif
99106 extern void dhd_bus_band_set(struct net_device *dev, uint band);
100107 extern int wldev_set_country(struct net_device *dev, char *country_code, bool notify,
101108 bool user_enforced, int revinfo);
....@@ -106,8 +113,15 @@
106113 extern int net_os_set_dtim_skip(struct net_device *dev, int val);
107114 extern int net_os_set_suspend_disable(struct net_device *dev, int val);
108115 extern int net_os_set_suspend(struct net_device *dev, int val, int force);
109
-extern int wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_ext_t* ssid,
116
+extern int net_os_set_suspend_bcn_li_dtim(struct net_device *dev, int val);
117
+extern int net_os_set_max_dtim_enable(struct net_device *dev, int val);
118
+#ifdef DISABLE_DTIM_IN_SUSPEND
119
+extern int net_os_set_disable_dtim_in_suspend(struct net_device *dev, int val);
120
+#endif /* DISABLE_DTIM_IN_SUSPEND */
121
+#if defined(OEM_ANDROID)
122
+extern int wl_parse_ssid_list_tlv(char** list_str, wlc_ssid_ext_t* ssid,
110123 int max, int *bytes_left);
124
+#endif /* defined(OEM_ANDROID) */
111125
112126 /* Get the link speed from dongle, speed is in kpbs */
113127 int wldev_get_link_speed(struct net_device *dev, int *plink_speed);
....@@ -117,7 +131,7 @@
117131 int wldev_get_ssid(struct net_device *dev, wlc_ssid_t *pssid);
118132
119133 int wldev_get_band(struct net_device *dev, uint *pband);
120
-int wldev_get_mode(struct net_device *dev, uint8 *pband);
134
+int wldev_get_mode(struct net_device *dev, uint8 *pband, uint8 caplen);
121135 int wldev_get_datarate(struct net_device *dev, int *datarate);
122136 int wldev_set_band(struct net_device *dev, uint band);
123137