/*
* Linux cfg80211 driver
*
* $Copyright Open Broadcom Corporation$
*
* $Id: wl_cfg80211.c 506036 2014-10-02 11:33:14Z $
*/
/* */
#include <typedefs.h>
#include <linuxver.h>
#include <osl.h>
#include <linux/kernel.h>
#include <bcmutils.h>
#include <bcmwifi_channels.h>
#include <bcmendian.h>
#include <proto/ethernet.h>
#include <proto/802.11.h>
#include <linux/if_arp.h>
#include <asm/uaccess.h>
#include <dngl_stats.h>
#include <dhd.h>
#include <dhd_linux.h>
#include <dhdioctl.h>
#include <wlioctl.h>
#include <dhd_cfg80211.h>
#ifdef PNO_SUPPORT
#include <dhd_pno.h>
#endif /* PNO_SUPPORT */
#include <proto/ethernet.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/netdevice.h>
#include <linux/sched.h>
#include <linux/etherdevice.h>
#include <linux/wireless.h>
#include <linux/ieee80211.h>
#include <linux/wait.h>
#include <net/cfg80211.h>
#include <net/rtnetlink.h>
#include <wlioctl.h>
#include <wldev_common.h>
#include <wl_cfg80211.h>
#include <wl_cfgp2p.h>
#include <wl_android.h>
#include <wl_cfgvendor.h>
#ifdef WL_NAN
#include <wl_cfgnan.h>
#endif /* WL_NAN */
#include <dhd_config.h>
#ifdef PROP_TXSTATUS
#include <dhd_wlfc.h>
#endif
#ifdef WL11U
#if !defined(WL_ENABLE_P2P_IF) && !defined(WL_CFG80211_P2P_DEV_IF)
#error You should enable 'WL_ENABLE_P2P_IF' or 'WL_CFG80211_P2P_DEV_IF' \
according to Kernel version and is supported only in Android-JB
#endif /* !WL_ENABLE_P2P_IF && !WL_CFG80211_P2P_DEV_IF */
#endif /* WL11U */
#ifdef BCMWAPI_WPI
/* these items should evetually go into wireless.h of the linux system headfile dir */
#ifndef IW_ENCODE_ALG_SM4
#define IW_ENCODE_ALG_SM4 0x20
#endif
#ifndef IW_AUTH_WAPI_ENABLED
#define IW_AUTH_WAPI_ENABLED 0x20
#endif
#ifndef IW_AUTH_WAPI_VERSION_1
#define IW_AUTH_WAPI_VERSION_1 0x00000008
#endif
#ifndef IW_AUTH_CIPHER_SMS4
#define IW_AUTH_CIPHER_SMS4 0x00000020
#endif
#ifndef IW_AUTH_KEY_MGMT_WAPI_PSK
#define IW_AUTH_KEY_MGMT_WAPI_PSK 4
#endif
#ifndef IW_AUTH_KEY_MGMT_WAPI_CERT
#define IW_AUTH_KEY_MGMT_WAPI_CERT 8
#endif
#endif /* BCMWAPI_WPI */
#ifdef BCMWAPI_WPI
#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED | SMS4_ENABLED))
#else /* BCMWAPI_WPI */
#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
#endif /* BCMWAPI_WPI */
static struct device *cfg80211_parent_dev = NULL;
/* g_bcm_cfg should be static. Do not change */
static struct bcm_cfg80211 *g_bcm_cfg = NULL;
u32 wl_dbg_level = WL_DBG_ERR;
#ifdef WLAIBSS_MCHAN
#define IBSS_IF_NAME "ibss%d"
#endif /* WLAIBSS_MCHAN */
#ifdef VSDB
/* sleep time to keep STA's connecting or connection for continuous af tx or finding a peer */
#define DEFAULT_SLEEP_TIME_VSDB 120
#define OFF_CHAN_TIME_THRESHOLD_MS 200
#define AF_RETRY_DELAY_TIME 40
/* if sta is connected or connecting, sleep for a while before retry af tx or finding a peer */
#define WL_AF_TX_KEEP_PRI_CONNECTION_VSDB(cfg) \
do { \
if (wl_get_drv_status(cfg, CONNECTED, bcmcfg_to_prmry_ndev(cfg)) || \
wl_get_drv_status(cfg, CONNECTING, bcmcfg_to_prmry_ndev(cfg))) { \
OSL_SLEEP(DEFAULT_SLEEP_TIME_VSDB); \
} \
} while (0)
#else /* VSDB */
/* if not VSDB, do nothing */
#define WL_AF_TX_KEEP_PRI_CONNECTION_VSDB(cfg)
#endif /* VSDB */
#ifdef WL_CFG80211_SYNC_GON
#define WL_DRV_STATUS_SENDING_AF_FRM_EXT(cfg) \
(wl_get_drv_status_all(cfg, SENDING_ACT_FRM) || \
wl_get_drv_status_all(cfg, WAITING_NEXT_ACT_FRM_LISTEN))
#else
#define WL_DRV_STATUS_SENDING_AF_FRM_EXT(cfg) wl_get_drv_status_all(cfg, SENDING_ACT_FRM)
#endif /* WL_CFG80211_SYNC_GON */
#define WL_IS_P2P_DEV_EVENT(e) ((e->emsg.ifidx == 0) && \
(e->emsg.bsscfgidx == P2PAPI_BSSCFG_DEVICE))
#define COEX_DHCP
#define WLAN_EID_SSID 0
#define CH_MIN_5G_CHANNEL 34
#define CH_MIN_2G_CHANNEL 1
#ifdef WLAIBSS
enum abiss_event_type {
AIBSS_EVENT_TXFAIL
};
#endif
enum rmc_event_type {
RMC_EVENT_NONE,
RMC_EVENT_LEADER_CHECK_FAIL
};
/* This is to override regulatory domains defined in cfg80211 module (reg.c)
* By default world regulatory domain defined in reg.c puts the flags NL80211_RRF_PASSIVE_SCAN
* and NL80211_RRF_NO_IBSS for 5GHz channels (for 36..48 and 149..165).
* With respect to these flags, wpa_supplicant doesn't start p2p operations on 5GHz channels.
* All the chnages in world regulatory domain are to be done here.
*/
static const struct ieee80211_regdomain brcm_regdom = {
.n_reg_rules = 4,
.alpha2 = "99",
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
REG_RULE(2412-10, 2472+10, 40, 6, 20, 0),
/* If any */
/* IEEE 802.11 channel 14 - Only JP enables
* this and for 802.11b only
*/
REG_RULE(2484-10, 2484+10, 20, 6, 20, 0),
/* IEEE 802.11a, channel 36..64 */
REG_RULE(5150-10, 5350+10, 40, 6, 20, 0),
/* IEEE 802.11a, channel 100..165 */
REG_RULE(5470-10, 5850+10, 40, 6, 20, 0), }
};
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) && \
(defined(WL_IFACE_COMB_NUM_CHANNELS) || defined(WL_CFG80211_P2P_DEV_IF))
/*
* Possible interface combinations supported by driver
*
* ADHOC Mode - #ADHOC <= 1 on channels = 1
* SoftAP Mode - #AP <= 1 on channels = 1
* STA + P2P Mode - #STA <= 2, #{P2P-GO, P2P-client} <= 1, #P2P-device <= 1
* on channels = 2
*/
static const struct ieee80211_iface_limit common_if_limits[] = {
{
.max = 1,
.types = BIT(NL80211_IFTYPE_AP),
},
{
/*
* During P2P-GO removal, P2P-GO is first changed to STA and later only
* removed. So setting maximum possible number of STA interfaces according
* to kernel version.
*
* less than linux-3.8 - max:3 (wlan0 + p2p0 + group removal of p2p-p2p0-x)
* linux-3.8 and above - max:2 (wlan0 + group removal of p2p-wlan0-x)
*/
#ifdef WL_ENABLE_P2P_IF
.max = 3,
#else
.max = 2,
#endif /* WL_ENABLE_P2P_IF */
.types = BIT(NL80211_IFTYPE_STATION),
},
{
.max = 2,
.types = BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_CLIENT),
},
#if defined(WL_CFG80211_P2P_DEV_IF)
{
.max = 1,
.types = BIT(NL80211_IFTYPE_P2P_DEVICE),
},
#endif /* WL_CFG80211_P2P_DEV_IF */
{
.max = 1,
.types = BIT(NL80211_IFTYPE_ADHOC),
},
};
#ifdef BCM4330_CHIP
#define NUM_DIFF_CHANNELS 1
#else
#define NUM_DIFF_CHANNELS 2
#endif
static struct ieee80211_iface_combination
common_iface_combinations[] = {
{
.num_different_channels = NUM_DIFF_CHANNELS,
.max_interfaces = 4,
.limits = common_if_limits,
.n_limits = ARRAY_SIZE(common_if_limits),
},
};
#endif /* LINUX_VER >= 3.0 && (WL_IFACE_COMB_NUM_CHANNELS || WL_CFG80211_P2P_DEV_IF) */
/* Data Element Definitions */
#define WPS_ID_CONFIG_METHODS 0x1008
#define WPS_ID_REQ_TYPE 0x103A
#define WPS_ID_DEVICE_NAME 0x1011
#define WPS_ID_VERSION 0x104A
#define WPS_ID_DEVICE_PWD_ID 0x1012
#define WPS_ID_REQ_DEV_TYPE 0x106A
#define WPS_ID_SELECTED_REGISTRAR_CONFIG_METHODS 0x1053
#define WPS_ID_PRIM_DEV_TYPE 0x1054
/* Device Password ID */
#define DEV_PW_DEFAULT 0x0000
#define DEV_PW_USER_SPECIFIED 0x0001,
#define DEV_PW_MACHINE_SPECIFIED 0x0002
#define DEV_PW_REKEY 0x0003
#define DEV_PW_PUSHBUTTON 0x0004
#define DEV_PW_REGISTRAR_SPECIFIED 0x0005
/* Config Methods */
#define WPS_CONFIG_USBA 0x0001
#define WPS_CONFIG_ETHERNET 0x0002
#define WPS_CONFIG_LABEL 0x0004
#define WPS_CONFIG_DISPLAY 0x0008
#define WPS_CONFIG_EXT_NFC_TOKEN 0x0010
#define WPS_CONFIG_INT_NFC_TOKEN 0x0020
#define WPS_CONFIG_NFC_INTERFACE 0x0040
#define WPS_CONFIG_PUSHBUTTON 0x0080
#define WPS_CONFIG_KEYPAD 0x0100
#define WPS_CONFIG_VIRT_PUSHBUTTON 0x0280
#define WPS_CONFIG_PHY_PUSHBUTTON 0x0480
#define WPS_CONFIG_VIRT_DISPLAY 0x2008
#define WPS_CONFIG_PHY_DISPLAY 0x4008
#ifdef BCMCCX
#ifndef WLAN_AKM_SUITE_CCKM
#define WLAN_AKM_SUITE_CCKM 0x00409600
#endif
#define DOT11_LEAP_AUTH 0x80 /* LEAP auth frame paylod constants */
#endif /* BCMCCX */
#ifdef MFP
#define WL_AKM_SUITE_MFP_1X 0x000FAC05
#define WL_AKM_SUITE_MFP_PSK 0x000FAC06
#define WL_MFP_CAPABLE 0x1
#define WL_MFP_REQUIRED 0x2
#endif /* MFP */
#ifndef IBSS_COALESCE_ALLOWED
#define
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
RK系列Android AP6xxx WiFi BT Patch (533个子文件)
fw_bcm4354a1_ag.bin 576KB
fw_bcm4354a1_ag_p2p.bin 576KB
fw_bcm4354a1_ag_apsta.bin 576KB
fw_bcm4356a2_ag_apsta.bin 542KB
fw_bcm4356a2_ag.bin 542KB
fw_bcm4356a2_ag_p2p.bin 542KB
fw_bcm43455c0_ag_apsta.bin 487KB
fw_bcm43455c0_ag.bin 487KB
fw_bcm43455c0_ag_p2p.bin 472KB
fw_bcm4334b1_ag.bin 447KB
fw_bcm4334b1_ag_p2p.bin 447KB
fw_bcm43436b0.bin 411KB
fw_bcm43436b0_apsta.bin 411KB
fw_bcm4334b1_ag_apsta.bin 404KB
fw_bcm43438a0.bin 396KB
fw_bcm43438a0_apsta.bin 396KB
fw_bcm43241b4_ag.bin 383KB
fw_bcm43438a0_p2p.bin 380KB
fw_bcm43438a1.bin 367KB
fw_bcm43438a1_apsta.bin 367KB
fw_bcm43438a1_p2p.bin 366KB
fw_bcm43341b0_ag_apsta.bin 358KB
fw_bcm43341b0_ag_p2p.bin 358KB
fw_bcm43341b0_ag.bin 358KB
wl_cfg80211.c 432KB
wl_cfg80211.c 432KB
dhd_linux.c 274KB
dhd_linux.c 274KB
dhd_sdio.c 269KB
dhd_sdio.c 269KB
dhd_pcie.c 125KB
dhd_pcie.c 125KB
dhd_msgbuf.c 123KB
dhd_msgbuf.c 123KB
dhd_wlfc.c 104KB
dhd_wlfc.c 104KB
wl_iw.c 98KB
wl_iw.c 98KB
wl_cfgp2p.c 82KB
wl_cfgp2p.c 82KB
dhd_config.c 82KB
dhd_config.c 82KB
wl_android.c 81KB
wl_android.c 81KB
bcmutils.c 76KB
bcmutils.c 76KB
siutils.c 73KB
siutils.c 73KB
dhd_common.c 72KB
dhd_common.c 72KB
dhd_pno.c 61KB
dhd_pno.c 61KB
hardware.c 60KB
hardware.c 60KB
linux_osl.c 60KB
linux_osl.c 60KB
wl_android_ext.c 54KB
wl_android_ext.c 54KB
bcmsdh_sdmmc.c 52KB
bcmsdh_sdmmc.c 52KB
hardware.c 50KB
dhd_ip.c 40KB
dhd_ip.c 40KB
wl_escan.c 38KB
wl_escan.c 38KB
dhd_pcie_linux.c 33KB
dhd_pcie_linux.c 33KB
bcmwifi_channels.c 32KB
bcmwifi_channels.c 32KB
sbutils.c 27KB
sbutils.c 27KB
aiutils.c 27KB
aiutils.c 27KB
dhd_flowring.c 22KB
dhd_flowring.c 22KB
dhd_linux_platdev.c 21KB
dhd_linux_platdev.c 21KB
dhd_cdc.c 19KB
dhd_cdc.c 19KB
bcmsdh.c 17KB
bcmsdh.c 17KB
upio.c 16KB
hnd_pktpool.c 15KB
hnd_pktpool.c 15KB
wl_cfg_btcoex.c 15KB
wl_cfg_btcoex.c 15KB
upio.c 14KB
upio.c 14KB
bcmsdh_linux.c 13KB
bcmsdh_linux.c 13KB
bcmsdh_sdmmc_linux.c 11KB
bcmsdh_sdmmc_linux.c 11KB
userial_vendor.c 11KB
userial_vendor.c 11KB
userial_vendor.c 11KB
circularbuf.c 10KB
circularbuf.c 10KB
dhd_static_buf.c 10KB
dhd_static_buf.c 10KB
wl_linux_mon.c 10KB
共 533 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
嵌入式开发达人
- 粉丝: 3
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 电力场景安全帽检测数据集VOC+YOLO格式295张2类别.7z
- MISC图片隐写MISC图片隐写MISC图片隐写MISC图片隐写MISC图片隐写.txt
- 七维大脑原理:探索人类心智的多元维度.txt
- 电力场景设备漏油检测数据集VOC+YOLO格式338张1类别.7z
- 基于yolov8+pyqt5实现精美界面支持图片视频和摄像检测源码.zip
- 用C语言为母亲节献上一份特别的祝福.zip
- LCD1602液晶显示屏的深入探索与实用指南.zip
- 基于Matlab人脸肤色定理的教师人数统计+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab霍夫曼变换的表盘读数识别+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab火灾烟雾检测源码带GUI界面+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功