mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-24 01:54:03 -04:00
Change vif_event_lock to spinlock from mutex, since this lock is used in wait_event_timeout() via vif_event_equals(). This caused a warning report as below. As far as I can see, this lock protects regions where updating structure members, not function calls. Also, since those regions are not called from interrupt handlers (of course, it was a mutex), spin_lock is used instead of spin_lock_irqsave. [ 186.678550] ------------[ cut here ]------------ [ 186.678556] WARNING: CPU: 2 PID: 7140 at /home/mhiramat/ksrc/linux/kernel/sched/core.c:7545 __might_sleep+0x7c/0x80 [ 186.678560] do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff980d9090>] prepare_to_wait_event+0x60/0x100 [ 186.678560] Modules linked in: brcmfmac xt_CHECKSUM rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter xt_tcpudp ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_raw ip6table_security ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_filter ip6_tables iptable_raw iptable_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_filter ip_tables x_tables bnep nls_iso8859_1 i2c_designware_platform i2c_designware_core snd_hda_codec_hdmi snd_hda_codec_realtek dcdbas snd_hda_codec_generic snd_hda_intel snd_hda_codec intel_rapl snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp [ 186.678594] snd_pcm crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 joydev glue_helper snd_hwdep lrw gf128mul uvcvideo ablk_helper snd_seq_midi cryptd snd_seq_midi_event snd_rawmidi videobuf2_vmalloc videobuf2_memops snd_seq input_leds videobuf2_v4l2 cfg80211 videobuf2_core snd_timer videodev serio_raw btusb snd_seq_device media btrtl rtsx_pci_ms snd mei_me memstick hid_multitouch mei soundcore brcmutil idma64 virt_dma intel_lpss_pci processor_thermal_device intel_soc_dts_iosf hci_uart btbcm btqca btintel bluetooth int3403_thermal dell_smo8800 intel_lpss_acpi intel_lpss int3402_thermal int340x_thermal_zone intel_hid mac_hid int3400_thermal shpchp sparse_keymap acpi_pad acpi_thermal_rel acpi_als kfifo_buf industrialio kvm_intel kvm irqbypass parport_pc ppdev lp parport autofs4 btrfs xor raid6_pq [ 186.678631] usbhid nouveau ttm i915 rtsx_pci_sdmmc mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse drm ahci rtsx_pci nvme nvme_core libahci i2c_hid hid pinctrl_sunrisepoint video wmi pinctrl_intel fjes [last unloaded: brcmfmac] [ 186.678646] CPU: 2 PID: 7140 Comm: wpa_supplicant Not tainted 4.8.0-rc1+ #8 [ 186.678647] Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.02.00 04/07/2016 [ 186.678648] 0000000000000000 ffff9d8c64b5b900 ffffffff98442f23 ffff9d8c64b5b950 [ 186.678651] 0000000000000000 ffff9d8c64b5b940 ffffffff9808b22b 00001d790000000d [ 186.678653] ffffffff98c75e78 000000000000026c 0000000000000000 ffff9d8c2706d058 [ 186.678655] Call Trace: [ 186.678659] [<ffffffff98442f23>] dump_stack+0x85/0xc2 [ 186.678666] [<ffffffff9808b22b>] __warn+0xcb/0xf0 [ 186.678668] [<ffffffff9808b29f>] warn_slowpath_fmt+0x4f/0x60 [ 186.678671] [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100 [ 186.678672] [<ffffffff980d9090>] ? prepare_to_wait_event+0x60/0x100 [ 186.678674] [<ffffffff980b922c>] __might_sleep+0x7c/0x80 [ 186.678680] [<ffffffff988b0853>] mutex_lock_nested+0x33/0x3b0 [ 186.678682] [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10 [ 186.678689] [<ffffffffc0c57d2d>] brcmf_cfg80211_wait_vif_event+0xcd/0x130 [brcmfmac] [ 186.678691] [<ffffffff980d9190>] ? wake_atomic_t_function+0x60/0x60 [ 186.678697] [<ffffffffc0c628e9>] brcmf_p2p_del_vif+0xf9/0x220 [brcmfmac] [ 186.678702] [<ffffffffc0c57fab>] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac] [ 186.678716] [<ffffffffc0b0539e>] nl80211_del_interface+0xfe/0x3a0 [cfg80211] [ 186.678718] [<ffffffff987ca335>] genl_family_rcv_msg+0x1b5/0x370 [ 186.678720] [<ffffffff980e5d8d>] ? trace_hardirqs_on+0xd/0x10 [ 186.678721] [<ffffffff987ca56d>] genl_rcv_msg+0x7d/0xb0 [ 186.678722] [<ffffffff987ca4f0>] ? genl_family_rcv_msg+0x370/0x370 [ 186.678724] [<ffffffff987c9a47>] netlink_rcv_skb+0x97/0xb0 [ 186.678726] [<ffffffff987ca168>] genl_rcv+0x28/0x40 [ 186.678727] [<ffffffff987c93c3>] netlink_unicast+0x1d3/0x2f0 [ 186.678729] [<ffffffff987c933b>] ? netlink_unicast+0x14b/0x2f0 [ 186.678731] [<ffffffff987c97cb>] netlink_sendmsg+0x2eb/0x3a0 [ 186.678733] [<ffffffff9876dad8>] sock_sendmsg+0x38/0x50 [ 186.678734] [<ffffffff9876e4df>] ___sys_sendmsg+0x27f/0x290 [ 186.678737] [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0 [ 186.678739] [<ffffffff9828b9be>] ? mntput_no_expire+0x8e/0x3f0 [ 186.678741] [<ffffffff9828b935>] ? mntput_no_expire+0x5/0x3f0 [ 186.678743] [<ffffffff9828bd44>] ? mntput+0x24/0x40 [ 186.678744] [<ffffffff98267830>] ? __fput+0x190/0x200 [ 186.678746] [<ffffffff9876f125>] __sys_sendmsg+0x45/0x80 [ 186.678748] [<ffffffff9876f172>] SyS_sendmsg+0x12/0x20 [ 186.678749] [<ffffffff988b5680>] entry_SYSCALL_64_fastpath+0x23/0xc1 [ 186.678751] [<ffffffff980e2b8f>] ? trace_hardirqs_off_caller+0x1f/0xc0 [ 186.678752] ---[ end trace e224d66c5d8408b5 ]--- Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
417 lines
12 KiB
C
417 lines
12 KiB
C
/*
|
|
* Copyright (c) 2010 Broadcom Corporation
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
* copyright notice and this permission notice appear in all copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
#ifndef BRCMFMAC_CFG80211_H
|
|
#define BRCMFMAC_CFG80211_H
|
|
|
|
/* for brcmu_d11inf */
|
|
#include <brcmu_d11.h>
|
|
|
|
#include "core.h"
|
|
#include "fwil_types.h"
|
|
#include "p2p.h"
|
|
|
|
#define WL_NUM_SCAN_MAX 10
|
|
#define WL_TLV_INFO_MAX 1024
|
|
#define WL_BSS_INFO_MAX 2048
|
|
#define WL_ASSOC_INFO_MAX 512 /* assoc related fil max buf */
|
|
#define WL_EXTRA_BUF_MAX 2048
|
|
#define WL_ROAM_TRIGGER_LEVEL -75
|
|
#define WL_ROAM_DELTA 20
|
|
|
|
/* Keep BRCMF_ESCAN_BUF_SIZE below 64K (65536). Allocing over 64K can be
|
|
* problematic on some systems and should be avoided.
|
|
*/
|
|
#define BRCMF_ESCAN_BUF_SIZE 65000
|
|
#define BRCMF_ESCAN_TIMER_INTERVAL_MS 10000 /* E-Scan timeout */
|
|
|
|
#define WL_ESCAN_ACTION_START 1
|
|
#define WL_ESCAN_ACTION_CONTINUE 2
|
|
#define WL_ESCAN_ACTION_ABORT 3
|
|
|
|
#define WL_AUTH_SHARED_KEY 1 /* d11 shared authentication */
|
|
#define IE_MAX_LEN 512
|
|
|
|
/* IE TLV processing */
|
|
#define TLV_LEN_OFF 1 /* length offset */
|
|
#define TLV_HDR_LEN 2 /* header length */
|
|
#define TLV_BODY_OFF 2 /* body offset */
|
|
#define TLV_OUI_LEN 3 /* oui id length */
|
|
|
|
/* 802.11 Mgmt Packet flags */
|
|
#define BRCMF_VNDR_IE_BEACON_FLAG 0x1
|
|
#define BRCMF_VNDR_IE_PRBRSP_FLAG 0x2
|
|
#define BRCMF_VNDR_IE_ASSOCRSP_FLAG 0x4
|
|
#define BRCMF_VNDR_IE_AUTHRSP_FLAG 0x8
|
|
#define BRCMF_VNDR_IE_PRBREQ_FLAG 0x10
|
|
#define BRCMF_VNDR_IE_ASSOCREQ_FLAG 0x20
|
|
/* vendor IE in IW advertisement protocol ID field */
|
|
#define BRCMF_VNDR_IE_IWAPID_FLAG 0x40
|
|
/* allow custom IE id */
|
|
#define BRCMF_VNDR_IE_CUSTOM_FLAG 0x100
|
|
|
|
/* P2P Action Frames flags (spec ordered) */
|
|
#define BRCMF_VNDR_IE_GONREQ_FLAG 0x001000
|
|
#define BRCMF_VNDR_IE_GONRSP_FLAG 0x002000
|
|
#define BRCMF_VNDR_IE_GONCFM_FLAG 0x004000
|
|
#define BRCMF_VNDR_IE_INVREQ_FLAG 0x008000
|
|
#define BRCMF_VNDR_IE_INVRSP_FLAG 0x010000
|
|
#define BRCMF_VNDR_IE_DISREQ_FLAG 0x020000
|
|
#define BRCMF_VNDR_IE_DISRSP_FLAG 0x040000
|
|
#define BRCMF_VNDR_IE_PRDREQ_FLAG 0x080000
|
|
#define BRCMF_VNDR_IE_PRDRSP_FLAG 0x100000
|
|
|
|
#define BRCMF_VNDR_IE_P2PAF_SHIFT 12
|
|
|
|
#define BRCMF_MAX_DEFAULT_KEYS 6
|
|
|
|
/* beacon loss timeout defaults */
|
|
#define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON 2
|
|
#define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_OFF 4
|
|
|
|
#define BRCMF_VIF_EVENT_TIMEOUT msecs_to_jiffies(1500)
|
|
|
|
/**
|
|
* enum brcmf_scan_status - scan engine status
|
|
*
|
|
* @BRCMF_SCAN_STATUS_BUSY: scanning in progress on dongle.
|
|
* @BRCMF_SCAN_STATUS_ABORT: scan being aborted on dongle.
|
|
* @BRCMF_SCAN_STATUS_SUPPRESS: scanning is suppressed in driver.
|
|
*/
|
|
enum brcmf_scan_status {
|
|
BRCMF_SCAN_STATUS_BUSY,
|
|
BRCMF_SCAN_STATUS_ABORT,
|
|
BRCMF_SCAN_STATUS_SUPPRESS,
|
|
};
|
|
|
|
/* dongle configuration */
|
|
struct brcmf_cfg80211_conf {
|
|
u32 frag_threshold;
|
|
u32 rts_threshold;
|
|
u32 retry_short;
|
|
u32 retry_long;
|
|
};
|
|
|
|
/* security information with currently associated ap */
|
|
struct brcmf_cfg80211_security {
|
|
u32 wpa_versions;
|
|
u32 auth_type;
|
|
u32 cipher_pairwise;
|
|
u32 cipher_group;
|
|
};
|
|
|
|
/**
|
|
* struct brcmf_cfg80211_profile - profile information.
|
|
*
|
|
* @bssid: bssid of joined/joining ibss.
|
|
* @sec: security information.
|
|
* @key: key information
|
|
*/
|
|
struct brcmf_cfg80211_profile {
|
|
u8 bssid[ETH_ALEN];
|
|
struct brcmf_cfg80211_security sec;
|
|
struct brcmf_wsec_key key[BRCMF_MAX_DEFAULT_KEYS];
|
|
};
|
|
|
|
/**
|
|
* enum brcmf_vif_status - bit indices for vif status.
|
|
*
|
|
* @BRCMF_VIF_STATUS_READY: ready for operation.
|
|
* @BRCMF_VIF_STATUS_CONNECTING: connect/join in progress.
|
|
* @BRCMF_VIF_STATUS_CONNECTED: connected/joined succesfully.
|
|
* @BRCMF_VIF_STATUS_DISCONNECTING: disconnect/disable in progress.
|
|
* @BRCMF_VIF_STATUS_AP_CREATED: AP operation started.
|
|
*/
|
|
enum brcmf_vif_status {
|
|
BRCMF_VIF_STATUS_READY,
|
|
BRCMF_VIF_STATUS_CONNECTING,
|
|
BRCMF_VIF_STATUS_CONNECTED,
|
|
BRCMF_VIF_STATUS_DISCONNECTING,
|
|
BRCMF_VIF_STATUS_AP_CREATED
|
|
};
|
|
|
|
/**
|
|
* struct vif_saved_ie - holds saved IEs for a virtual interface.
|
|
*
|
|
* @probe_req_ie: IE info for probe request.
|
|
* @probe_res_ie: IE info for probe response.
|
|
* @beacon_ie: IE info for beacon frame.
|
|
* @probe_req_ie_len: IE info length for probe request.
|
|
* @probe_res_ie_len: IE info length for probe response.
|
|
* @beacon_ie_len: IE info length for beacon frame.
|
|
*/
|
|
struct vif_saved_ie {
|
|
u8 probe_req_ie[IE_MAX_LEN];
|
|
u8 probe_res_ie[IE_MAX_LEN];
|
|
u8 beacon_ie[IE_MAX_LEN];
|
|
u8 assoc_req_ie[IE_MAX_LEN];
|
|
u32 probe_req_ie_len;
|
|
u32 probe_res_ie_len;
|
|
u32 beacon_ie_len;
|
|
u32 assoc_req_ie_len;
|
|
};
|
|
|
|
/**
|
|
* struct brcmf_cfg80211_vif - virtual interface specific information.
|
|
*
|
|
* @ifp: lower layer interface pointer
|
|
* @wdev: wireless device.
|
|
* @profile: profile information.
|
|
* @sme_state: SME state using enum brcmf_vif_status bits.
|
|
* @list: linked list.
|
|
* @mgmt_rx_reg: registered rx mgmt frame types.
|
|
* @mbss: Multiple BSS type, set if not first AP (not relevant for P2P).
|
|
*/
|
|
struct brcmf_cfg80211_vif {
|
|
struct brcmf_if *ifp;
|
|
struct wireless_dev wdev;
|
|
struct brcmf_cfg80211_profile profile;
|
|
unsigned long sme_state;
|
|
struct vif_saved_ie saved_ie;
|
|
struct list_head list;
|
|
u16 mgmt_rx_reg;
|
|
bool mbss;
|
|
int is_11d;
|
|
};
|
|
|
|
/* association inform */
|
|
struct brcmf_cfg80211_connect_info {
|
|
u8 *req_ie;
|
|
s32 req_ie_len;
|
|
u8 *resp_ie;
|
|
s32 resp_ie_len;
|
|
};
|
|
|
|
/* assoc ie length */
|
|
struct brcmf_cfg80211_assoc_ielen_le {
|
|
__le32 req_len;
|
|
__le32 resp_len;
|
|
};
|
|
|
|
/* dongle escan state */
|
|
enum wl_escan_state {
|
|
WL_ESCAN_STATE_IDLE,
|
|
WL_ESCAN_STATE_SCANNING
|
|
};
|
|
|
|
struct escan_info {
|
|
u32 escan_state;
|
|
u8 *escan_buf;
|
|
struct wiphy *wiphy;
|
|
struct brcmf_if *ifp;
|
|
s32 (*run)(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
|
|
struct cfg80211_scan_request *request);
|
|
};
|
|
|
|
/**
|
|
* struct brcmf_cfg80211_vif_event - virtual interface event information.
|
|
*
|
|
* @vif_wq: waitqueue awaiting interface event from firmware.
|
|
* @vif_event_lock: protects other members in this structure.
|
|
* @vif_complete: completion for net attach.
|
|
* @action: either add, change, or delete.
|
|
* @vif: virtual interface object related to the event.
|
|
*/
|
|
struct brcmf_cfg80211_vif_event {
|
|
wait_queue_head_t vif_wq;
|
|
spinlock_t vif_event_lock;
|
|
u8 action;
|
|
struct brcmf_cfg80211_vif *vif;
|
|
};
|
|
|
|
/**
|
|
* struct brcmf_cfg80211_wowl - wowl related information.
|
|
*
|
|
* @active: set on suspend, cleared on resume.
|
|
* @pre_pmmode: firmware PM mode at entering suspend.
|
|
* @nd: net dectect data.
|
|
* @nd_info: helper struct to pass to cfg80211.
|
|
* @nd_data_wait: wait queue to sync net detect data.
|
|
* @nd_data_completed: completion for net detect data.
|
|
* @nd_enabled: net detect enabled.
|
|
*/
|
|
struct brcmf_cfg80211_wowl {
|
|
bool active;
|
|
u32 pre_pmmode;
|
|
struct cfg80211_wowlan_nd_match *nd;
|
|
struct cfg80211_wowlan_nd_info *nd_info;
|
|
wait_queue_head_t nd_data_wait;
|
|
bool nd_data_completed;
|
|
bool nd_enabled;
|
|
};
|
|
|
|
/**
|
|
* struct brcmf_cfg80211_info - dongle private data of cfg80211 interface
|
|
*
|
|
* @wiphy: wiphy object for cfg80211 interface.
|
|
* @ops: pointer to copy of ops as registered with wiphy object.
|
|
* @conf: dongle configuration.
|
|
* @p2p: peer-to-peer specific information.
|
|
* @btcoex: Bluetooth coexistence information.
|
|
* @scan_request: cfg80211 scan request object.
|
|
* @usr_sync: mainly for dongle up/down synchronization.
|
|
* @bss_list: bss_list holding scanned ap information.
|
|
* @bss_info: bss information for cfg80211 layer.
|
|
* @conn_info: association info.
|
|
* @pmk_list: wpa2 pmk list.
|
|
* @scan_status: scan activity on the dongle.
|
|
* @pub: common driver information.
|
|
* @channel: current channel.
|
|
* @active_scan: current scan mode.
|
|
* @sched_escan: e-scan for scheduled scan support running.
|
|
* @ibss_starter: indicates this sta is ibss starter.
|
|
* @pwr_save: indicate whether dongle to support power save mode.
|
|
* @dongle_up: indicate whether dongle up or not.
|
|
* @roam_on: on/off switch for dongle self-roaming.
|
|
* @scan_tried: indicates if first scan attempted.
|
|
* @dcmd_buf: dcmd buffer.
|
|
* @extra_buf: mainly to grab assoc information.
|
|
* @debugfsdir: debugfs folder for this device.
|
|
* @escan_info: escan information.
|
|
* @escan_timeout: Timer for catch scan timeout.
|
|
* @escan_timeout_work: scan timeout worker.
|
|
* @vif_list: linked list of vif instances.
|
|
* @vif_cnt: number of vif instances.
|
|
* @vif_event: vif event signalling.
|
|
* @wowl: wowl related information.
|
|
*/
|
|
struct brcmf_cfg80211_info {
|
|
struct wiphy *wiphy;
|
|
struct cfg80211_ops *ops;
|
|
struct brcmf_cfg80211_conf *conf;
|
|
struct brcmf_p2p_info p2p;
|
|
struct brcmf_btcoex_info *btcoex;
|
|
struct cfg80211_scan_request *scan_request;
|
|
struct mutex usr_sync;
|
|
struct wl_cfg80211_bss_info *bss_info;
|
|
struct brcmf_cfg80211_connect_info conn_info;
|
|
struct brcmf_pmk_list_le pmk_list;
|
|
unsigned long scan_status;
|
|
struct brcmf_pub *pub;
|
|
u32 channel;
|
|
bool active_scan;
|
|
bool sched_escan;
|
|
bool ibss_starter;
|
|
bool pwr_save;
|
|
bool dongle_up;
|
|
bool scan_tried;
|
|
u8 *dcmd_buf;
|
|
u8 *extra_buf;
|
|
struct dentry *debugfsdir;
|
|
struct escan_info escan_info;
|
|
struct timer_list escan_timeout;
|
|
struct work_struct escan_timeout_work;
|
|
struct list_head vif_list;
|
|
struct brcmf_cfg80211_vif_event vif_event;
|
|
struct completion vif_disabled;
|
|
struct brcmu_d11inf d11inf;
|
|
struct brcmf_assoclist_le assoclist;
|
|
struct brcmf_cfg80211_wowl wowl;
|
|
};
|
|
|
|
/**
|
|
* struct brcmf_tlv - tag_ID/length/value_buffer tuple.
|
|
*
|
|
* @id: tag identifier.
|
|
* @len: number of bytes in value buffer.
|
|
* @data: value buffer.
|
|
*/
|
|
struct brcmf_tlv {
|
|
u8 id;
|
|
u8 len;
|
|
u8 data[1];
|
|
};
|
|
|
|
static inline struct wiphy *cfg_to_wiphy(struct brcmf_cfg80211_info *cfg)
|
|
{
|
|
return cfg->wiphy;
|
|
}
|
|
|
|
static inline struct brcmf_cfg80211_info *wiphy_to_cfg(struct wiphy *w)
|
|
{
|
|
return (struct brcmf_cfg80211_info *)(wiphy_priv(w));
|
|
}
|
|
|
|
static inline struct brcmf_cfg80211_info *wdev_to_cfg(struct wireless_dev *wd)
|
|
{
|
|
return (struct brcmf_cfg80211_info *)(wdev_priv(wd));
|
|
}
|
|
|
|
static inline
|
|
struct net_device *cfg_to_ndev(struct brcmf_cfg80211_info *cfg)
|
|
{
|
|
struct brcmf_cfg80211_vif *vif;
|
|
vif = list_first_entry(&cfg->vif_list, struct brcmf_cfg80211_vif, list);
|
|
return vif->wdev.netdev;
|
|
}
|
|
|
|
static inline struct brcmf_cfg80211_info *ndev_to_cfg(struct net_device *ndev)
|
|
{
|
|
return wdev_to_cfg(ndev->ieee80211_ptr);
|
|
}
|
|
|
|
static inline struct brcmf_cfg80211_profile *ndev_to_prof(struct net_device *nd)
|
|
{
|
|
struct brcmf_if *ifp = netdev_priv(nd);
|
|
return &ifp->vif->profile;
|
|
}
|
|
|
|
static inline struct brcmf_cfg80211_vif *ndev_to_vif(struct net_device *ndev)
|
|
{
|
|
struct brcmf_if *ifp = netdev_priv(ndev);
|
|
return ifp->vif;
|
|
}
|
|
|
|
static inline struct
|
|
brcmf_cfg80211_connect_info *cfg_to_conn(struct brcmf_cfg80211_info *cfg)
|
|
{
|
|
return &cfg->conn_info;
|
|
}
|
|
|
|
struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
|
|
struct device *busdev,
|
|
bool p2pdev_forced);
|
|
void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg);
|
|
s32 brcmf_cfg80211_up(struct net_device *ndev);
|
|
s32 brcmf_cfg80211_down(struct net_device *ndev);
|
|
enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp);
|
|
|
|
struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
|
|
enum nl80211_iftype type);
|
|
void brcmf_free_vif(struct brcmf_cfg80211_vif *vif);
|
|
|
|
s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag,
|
|
const u8 *vndr_ie_buf, u32 vndr_ie_len);
|
|
s32 brcmf_vif_clear_mgmt_ies(struct brcmf_cfg80211_vif *vif);
|
|
const struct brcmf_tlv *
|
|
brcmf_parse_tlvs(const void *buf, int buflen, uint key);
|
|
u16 channel_to_chanspec(struct brcmu_d11inf *d11inf,
|
|
struct ieee80211_channel *ch);
|
|
bool brcmf_get_vif_state_any(struct brcmf_cfg80211_info *cfg,
|
|
unsigned long state);
|
|
void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg,
|
|
struct brcmf_cfg80211_vif *vif);
|
|
bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg);
|
|
int brcmf_cfg80211_wait_vif_event(struct brcmf_cfg80211_info *cfg,
|
|
u8 action, ulong timeout);
|
|
s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
|
|
struct brcmf_if *ifp, bool aborted,
|
|
bool fw_abort);
|
|
void brcmf_set_mpc(struct brcmf_if *ndev, int mpc);
|
|
void brcmf_abort_scanning(struct brcmf_cfg80211_info *cfg);
|
|
void brcmf_cfg80211_free_netdev(struct net_device *ndev);
|
|
|
|
#endif /* BRCMFMAC_CFG80211_H */
|