^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __NET_CFG80211_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __NET_CFG80211_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * 802.11 device and configuration interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright 2013-2014 Intel Mobile Communications GmbH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Copyright 2015-2017 Intel Deutschland GmbH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * Copyright (C) 2018-2020 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/debugfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/bug.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/netlink.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/nl80211.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/if_ether.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/ieee80211.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <linux/net.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/android_kabi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <net/regulatory.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * DOC: Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * cfg80211 is the configuration API for 802.11 devices in Linux. It bridges
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * userspace and drivers, and offers some utility functionality associated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * with 802.11. cfg80211 must, directly or indirectly via mac80211, be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * by all modern wireless drivers in Linux, so that they offer a consistent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * API through nl80211. For backward compatibility, cfg80211 also offers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * wireless extensions to userspace, but hides them from drivers completely.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * Additionally, cfg80211 contains code to help enforce regulatory spectrum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * use restrictions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * DOC: Device registration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * In order for a driver to use cfg80211, it must register the hardware device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * with cfg80211. This happens through a number of hardware capability structs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * described below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * The fundamental structure for each device is the 'wiphy', of which each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * instance describes a physical wireless device connected to the system. Each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * such wiphy can have zero, one, or many virtual interfaces associated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * it, which need to be identified as such by pointing the network interface's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * @ieee80211_ptr pointer to a &struct wireless_dev which further describes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * the wireless part of the interface, normally this struct is embedded in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * network interface's private data area. Drivers can optionally allow creating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * or destroying virtual interfaces on the fly, but without at least one or the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * ability to create some the wireless device isn't useful.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * Each wiphy structure contains device capability information, and also has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * a pointer to the various operations the driver offers. The definitions and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * structures here describe these capabilities in detail.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) struct wiphy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * wireless hardware capability structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * enum ieee80211_channel_flags - channel flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * Channel flags set by the regulatory control code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * @IEEE80211_CHAN_DISABLED: This channel is disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) * sending probe requests or beaconing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) * is not permitted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) * is not permitted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) * @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) * @IEEE80211_CHAN_NO_80MHZ: If the driver supports 80 MHz on the band,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * this flag indicates that an 80 MHz channel cannot use this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) * channel as the control or any of the secondary channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * This may be due to the driver or due to regulatory bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * restrictions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * @IEEE80211_CHAN_NO_160MHZ: If the driver supports 160 MHz on the band,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * this flag indicates that an 160 MHz channel cannot use this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * channel as the control or any of the secondary channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * This may be due to the driver or due to regulatory bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * restrictions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * @IEEE80211_CHAN_INDOOR_ONLY: see %NL80211_FREQUENCY_ATTR_INDOOR_ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * @IEEE80211_CHAN_IR_CONCURRENT: see %NL80211_FREQUENCY_ATTR_IR_CONCURRENT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) * @IEEE80211_CHAN_NO_20MHZ: 20 MHz bandwidth is not permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * @IEEE80211_CHAN_NO_10MHZ: 10 MHz bandwidth is not permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * @IEEE80211_CHAN_NO_HE: HE operation is not permitted on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * @IEEE80211_CHAN_1MHZ: 1 MHz bandwidth is permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) * @IEEE80211_CHAN_2MHZ: 2 MHz bandwidth is permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * @IEEE80211_CHAN_4MHZ: 4 MHz bandwidth is permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) * @IEEE80211_CHAN_8MHZ: 8 MHz bandwidth is permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * @IEEE80211_CHAN_16MHZ: 16 MHz bandwidth is permitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) enum ieee80211_channel_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) IEEE80211_CHAN_DISABLED = 1<<0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) IEEE80211_CHAN_NO_IR = 1<<1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) /* hole at 1<<2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) IEEE80211_CHAN_RADAR = 1<<3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) IEEE80211_CHAN_NO_OFDM = 1<<6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) IEEE80211_CHAN_NO_80MHZ = 1<<7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) IEEE80211_CHAN_NO_160MHZ = 1<<8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) IEEE80211_CHAN_INDOOR_ONLY = 1<<9,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) IEEE80211_CHAN_IR_CONCURRENT = 1<<10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) IEEE80211_CHAN_NO_20MHZ = 1<<11,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) IEEE80211_CHAN_NO_10MHZ = 1<<12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) IEEE80211_CHAN_NO_HE = 1<<13,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) IEEE80211_CHAN_1MHZ = 1<<14,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) IEEE80211_CHAN_2MHZ = 1<<15,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) IEEE80211_CHAN_4MHZ = 1<<16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) IEEE80211_CHAN_8MHZ = 1<<17,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) IEEE80211_CHAN_16MHZ = 1<<18,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) #define IEEE80211_CHAN_NO_HT40 \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) (IEEE80211_CHAN_NO_HT40PLUS | IEEE80211_CHAN_NO_HT40MINUS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) #define IEEE80211_DFS_MIN_CAC_TIME_MS 60000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) #define IEEE80211_DFS_MIN_NOP_TIME_MS (30 * 60 * 1000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) * struct ieee80211_channel - channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) * This structure describes a single channel for use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * with cfg80211.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * @center_freq: center frequency in MHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) * @freq_offset: offset from @center_freq, in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * @hw_value: hardware-specific value for the channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * @flags: channel flags from &enum ieee80211_channel_flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * @orig_flags: channel flags at registration time, used by regulatory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) * code to support devices with additional restrictions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * @band: band this channel belongs to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * @max_antenna_gain: maximum antenna gain in dBi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * @max_power: maximum transmission power (in dBm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * @max_reg_power: maximum regulatory transmission power (in dBm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * @beacon_found: helper to regulatory code to indicate when a beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * has been found on this channel. Use regulatory_hint_found_beacon()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * to enable this, this is useful only on 5 GHz band.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * @orig_mag: internal use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * @orig_mpwr: internal use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * @dfs_state: current state of this channel. Only relevant if radar is required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * on this channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) struct ieee80211_channel {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) enum nl80211_band band;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) u32 center_freq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) u16 freq_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) u16 hw_value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) int max_antenna_gain;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) int max_power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) int max_reg_power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) bool beacon_found;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) u32 orig_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) int orig_mag, orig_mpwr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) enum nl80211_dfs_state dfs_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) unsigned long dfs_state_entered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) unsigned int dfs_cac_ms;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) * enum ieee80211_rate_flags - rate flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) * Hardware/specification flags for rates. These are structured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) * in a way that allows using the same bitrate structure for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) * different bands/PHY modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) * @IEEE80211_RATE_SHORT_PREAMBLE: Hardware can send with short
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) * preamble on this bitrate; only relevant in 2.4GHz band and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) * with CCK rates.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) * @IEEE80211_RATE_MANDATORY_A: This bitrate is a mandatory rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) * when used with 802.11a (on the 5 GHz band); filled by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) * core code when registering the wiphy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) * @IEEE80211_RATE_MANDATORY_B: This bitrate is a mandatory rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) * when used with 802.11b (on the 2.4 GHz band); filled by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) * core code when registering the wiphy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) * @IEEE80211_RATE_MANDATORY_G: This bitrate is a mandatory rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) * when used with 802.11g (on the 2.4 GHz band); filled by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) * core code when registering the wiphy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) * @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) * @IEEE80211_RATE_SUPPORTS_5MHZ: Rate can be used in 5 MHz mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) * @IEEE80211_RATE_SUPPORTS_10MHZ: Rate can be used in 10 MHz mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) enum ieee80211_rate_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) IEEE80211_RATE_SHORT_PREAMBLE = 1<<0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) IEEE80211_RATE_MANDATORY_A = 1<<1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) IEEE80211_RATE_MANDATORY_B = 1<<2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) IEEE80211_RATE_MANDATORY_G = 1<<3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) IEEE80211_RATE_ERP_G = 1<<4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) IEEE80211_RATE_SUPPORTS_5MHZ = 1<<5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) IEEE80211_RATE_SUPPORTS_10MHZ = 1<<6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) * enum ieee80211_bss_type - BSS type filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) * @IEEE80211_BSS_TYPE_ESS: Infrastructure BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) * @IEEE80211_BSS_TYPE_PBSS: Personal BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) * @IEEE80211_BSS_TYPE_IBSS: Independent BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) * @IEEE80211_BSS_TYPE_MBSS: Mesh BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) * @IEEE80211_BSS_TYPE_ANY: Wildcard value for matching any BSS type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) enum ieee80211_bss_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) IEEE80211_BSS_TYPE_ESS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) IEEE80211_BSS_TYPE_PBSS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) IEEE80211_BSS_TYPE_IBSS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) IEEE80211_BSS_TYPE_MBSS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) IEEE80211_BSS_TYPE_ANY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) * enum ieee80211_privacy - BSS privacy filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) * @IEEE80211_PRIVACY_ON: privacy bit set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) * @IEEE80211_PRIVACY_OFF: privacy bit clear
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) * @IEEE80211_PRIVACY_ANY: Wildcard value for matching any privacy setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) enum ieee80211_privacy {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) IEEE80211_PRIVACY_ON,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) IEEE80211_PRIVACY_OFF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) IEEE80211_PRIVACY_ANY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) #define IEEE80211_PRIVACY(x) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) ((x) ? IEEE80211_PRIVACY_ON : IEEE80211_PRIVACY_OFF)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) * struct ieee80211_rate - bitrate definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) * This structure describes a bitrate that an 802.11 PHY can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) * operate with. The two values @hw_value and @hw_value_short
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) * are only for driver use when pointers to this structure are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) * passed around.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) * @flags: rate-specific flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) * @bitrate: bitrate in units of 100 Kbps
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) * @hw_value: driver/hardware value for this rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) * @hw_value_short: driver/hardware value for this rate when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) * short preamble is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) struct ieee80211_rate {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) u16 bitrate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) u16 hw_value, hw_value_short;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) * struct ieee80211_he_obss_pd - AP settings for spatial reuse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) * @enable: is the feature enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) * @sr_ctrl: The SR Control field of SRP element.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) * @non_srg_max_offset: non-SRG maximum tx power offset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) * @min_offset: minimal tx power offset an associated station shall use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) * @max_offset: maximum tx power offset an associated station shall use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) * @bss_color_bitmap: bitmap that indicates the BSS color values used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) * members of the SRG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) * @partial_bssid_bitmap: bitmap that indicates the partial BSSID values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) * used by members of the SRG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) struct ieee80211_he_obss_pd {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) bool enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) u8 sr_ctrl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) u8 non_srg_max_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) u8 min_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) u8 max_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) u8 bss_color_bitmap[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) u8 partial_bssid_bitmap[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) * struct cfg80211_he_bss_color - AP settings for BSS coloring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) * @color: the current color.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) * @enabled: HE BSS color is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) * @partial: define the AID equation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) struct cfg80211_he_bss_color {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) u8 color;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) bool enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) bool partial;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) * struct ieee80211_he_bss_color - AP settings for BSS coloring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) * @color: the current color.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) * @disabled: is the feature disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) * @partial: define the AID equation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) struct ieee80211_he_bss_color {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) u8 color;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) bool disabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) bool partial;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) * struct ieee80211_sta_ht_cap - STA's HT capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) * This structure describes most essential parameters needed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) * to describe 802.11n HT capabilities for an STA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) * @ht_supported: is HT supported by the STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) * @cap: HT capabilities map as described in 802.11n spec
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) * @ampdu_factor: Maximum A-MPDU length factor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) * @ampdu_density: Minimum A-MPDU spacing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) * @mcs: Supported MCS rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) struct ieee80211_sta_ht_cap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) u16 cap; /* use IEEE80211_HT_CAP_ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) bool ht_supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) u8 ampdu_factor;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) u8 ampdu_density;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) struct ieee80211_mcs_info mcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) * struct ieee80211_sta_vht_cap - STA's VHT capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) * This structure describes most essential parameters needed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) * to describe 802.11ac VHT capabilities for an STA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) * @vht_supported: is VHT supported by the STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) * @cap: VHT capabilities map as described in 802.11ac spec
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) * @vht_mcs: Supported VHT MCS rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) struct ieee80211_sta_vht_cap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) bool vht_supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) u32 cap; /* use IEEE80211_VHT_CAP_ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) struct ieee80211_vht_mcs_info vht_mcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) #define IEEE80211_HE_PPE_THRES_MAX_LEN 25
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) * struct ieee80211_sta_he_cap - STA's HE capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) * This structure describes most essential parameters needed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) * to describe 802.11ax HE capabilities for a STA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) * @has_he: true iff HE data is valid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) * @he_cap_elem: Fixed portion of the HE capabilities element.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) * @he_mcs_nss_supp: The supported NSS/MCS combinations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) * @ppe_thres: Holds the PPE Thresholds data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) struct ieee80211_sta_he_cap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) bool has_he;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) struct ieee80211_he_cap_elem he_cap_elem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) u8 ppe_thres[IEEE80211_HE_PPE_THRES_MAX_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) * struct ieee80211_sband_iftype_data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) * This structure encapsulates sband data that is relevant for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) * interface types defined in @types_mask. Each type in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) * @types_mask must be unique across all instances of iftype_data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) * @types_mask: interface types mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) * @he_cap: holds the HE capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) * @he_6ghz_capa: HE 6 GHz capabilities, must be filled in for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) * 6 GHz band channel (and 0 may be valid value).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) struct ieee80211_sband_iftype_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) u16 types_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) struct ieee80211_sta_he_cap he_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) struct ieee80211_he_6ghz_capa he_6ghz_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) * enum ieee80211_edmg_bw_config - allowed channel bandwidth configurations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) * @IEEE80211_EDMG_BW_CONFIG_4: 2.16GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) * @IEEE80211_EDMG_BW_CONFIG_5: 2.16GHz and 4.32GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) * @IEEE80211_EDMG_BW_CONFIG_6: 2.16GHz, 4.32GHz and 6.48GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) * @IEEE80211_EDMG_BW_CONFIG_7: 2.16GHz, 4.32GHz, 6.48GHz and 8.64GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) * @IEEE80211_EDMG_BW_CONFIG_8: 2.16GHz and 2.16GHz + 2.16GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) * @IEEE80211_EDMG_BW_CONFIG_9: 2.16GHz, 4.32GHz and 2.16GHz + 2.16GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) * @IEEE80211_EDMG_BW_CONFIG_10: 2.16GHz, 4.32GHz, 6.48GHz and 2.16GHz+2.16GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) * @IEEE80211_EDMG_BW_CONFIG_11: 2.16GHz, 4.32GHz, 6.48GHz, 8.64GHz and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) * 2.16GHz+2.16GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) * @IEEE80211_EDMG_BW_CONFIG_12: 2.16GHz, 2.16GHz + 2.16GHz and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) * 4.32GHz + 4.32GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) * @IEEE80211_EDMG_BW_CONFIG_13: 2.16GHz, 4.32GHz, 2.16GHz + 2.16GHz and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) * 4.32GHz + 4.32GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) * @IEEE80211_EDMG_BW_CONFIG_14: 2.16GHz, 4.32GHz, 6.48GHz, 2.16GHz + 2.16GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) * and 4.32GHz + 4.32GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) * @IEEE80211_EDMG_BW_CONFIG_15: 2.16GHz, 4.32GHz, 6.48GHz, 8.64GHz,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) * 2.16GHz + 2.16GHz and 4.32GHz + 4.32GHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) enum ieee80211_edmg_bw_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) IEEE80211_EDMG_BW_CONFIG_4 = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) IEEE80211_EDMG_BW_CONFIG_5 = 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) IEEE80211_EDMG_BW_CONFIG_6 = 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) IEEE80211_EDMG_BW_CONFIG_7 = 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) IEEE80211_EDMG_BW_CONFIG_8 = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) IEEE80211_EDMG_BW_CONFIG_9 = 9,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) IEEE80211_EDMG_BW_CONFIG_10 = 10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) IEEE80211_EDMG_BW_CONFIG_11 = 11,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) IEEE80211_EDMG_BW_CONFIG_12 = 12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) IEEE80211_EDMG_BW_CONFIG_13 = 13,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) IEEE80211_EDMG_BW_CONFIG_14 = 14,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) IEEE80211_EDMG_BW_CONFIG_15 = 15,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) * struct ieee80211_edmg - EDMG configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) * This structure describes most essential parameters needed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) * to describe 802.11ay EDMG configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) * @channels: bitmap that indicates the 2.16 GHz channel(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) * that are allowed to be used for transmissions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) * Bit 0 indicates channel 1, bit 1 indicates channel 2, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) * Set to 0 indicate EDMG not supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) * @bw_config: Channel BW Configuration subfield encodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) * the allowed channel bandwidth configurations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) struct ieee80211_edmg {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) u8 channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) enum ieee80211_edmg_bw_config bw_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) * struct ieee80211_sta_s1g_cap - STA's S1G capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) * This structure describes most essential parameters needed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) * to describe 802.11ah S1G capabilities for a STA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) * @s1g_supported: is STA an S1G STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) * @cap: S1G capabilities information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) * @nss_mcs: Supported NSS MCS set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) struct ieee80211_sta_s1g_cap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) bool s1g;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) u8 cap[10]; /* use S1G_CAPAB_ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) u8 nss_mcs[5];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) * struct ieee80211_supported_band - frequency band definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) * This structure describes a frequency band a wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) * is able to operate in.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) * @channels: Array of channels the hardware can operate with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) * in this band.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) * @band: the band this structure represents
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) * @n_channels: Number of channels in @channels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) * @bitrates: Array of bitrates the hardware can operate with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) * in this band. Must be sorted to give a valid "supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) * rates" IE, i.e. CCK rates first, then OFDM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) * @n_bitrates: Number of bitrates in @bitrates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) * @ht_cap: HT capabilities in this band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) * @vht_cap: VHT capabilities in this band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) * @s1g_cap: S1G capabilities in this band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) * @edmg_cap: EDMG capabilities in this band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) * @s1g_cap: S1G capabilities in this band (S1B band only, of course)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) * @n_iftype_data: number of iftype data entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) * @iftype_data: interface type data entries. Note that the bits in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) * @types_mask inside this structure cannot overlap (i.e. only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) * one occurrence of each type is allowed across all instances of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) * iftype_data).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) struct ieee80211_supported_band {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) struct ieee80211_channel *channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) struct ieee80211_rate *bitrates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) enum nl80211_band band;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) int n_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) int n_bitrates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) struct ieee80211_sta_ht_cap ht_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) struct ieee80211_sta_vht_cap vht_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) struct ieee80211_sta_s1g_cap s1g_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) struct ieee80211_edmg edmg_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) u16 n_iftype_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) const struct ieee80211_sband_iftype_data *iftype_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) * ieee80211_get_sband_iftype_data - return sband data for a given iftype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) * @sband: the sband to search for the STA on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) * @iftype: enum nl80211_iftype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) * Return: pointer to struct ieee80211_sband_iftype_data, or NULL is none found
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) static inline const struct ieee80211_sband_iftype_data *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) u8 iftype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) if (WARN_ON(iftype >= NL80211_IFTYPE_MAX))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) for (i = 0; i < sband->n_iftype_data; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) const struct ieee80211_sband_iftype_data *data =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) &sband->iftype_data[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) if (data->types_mask & BIT(iftype))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) return data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) * ieee80211_get_he_iftype_cap - return HE capabilities for an sband's iftype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) * @sband: the sband to search for the iftype on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) * @iftype: enum nl80211_iftype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) static inline const struct ieee80211_sta_he_cap *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) u8 iftype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) const struct ieee80211_sband_iftype_data *data =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) ieee80211_get_sband_iftype_data(sband, iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) if (data && data->he_cap.has_he)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) return &data->he_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) * ieee80211_get_he_sta_cap - return HE capabilities for an sband's STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) * @sband: the sband to search for the STA on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) static inline const struct ieee80211_sta_he_cap *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) return ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_STATION);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) * ieee80211_get_he_6ghz_capa - return HE 6 GHz capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) * @sband: the sband to search for the STA on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) * @iftype: the iftype to search for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) * Return: the 6GHz capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) static inline __le16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) enum nl80211_iftype iftype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) const struct ieee80211_sband_iftype_data *data =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) ieee80211_get_sband_iftype_data(sband, iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) if (WARN_ON(!data || !data->he_cap.has_he))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) return data->he_6ghz_capa.capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) * wiphy_read_of_freq_limits - read frequency limits from device tree
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) * @wiphy: the wireless device to get extra limits for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) * Some devices may have extra limitations specified in DT. This may be useful
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) * for chipsets that normally support more bands but are limited due to board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) * design (e.g. by antennas or external power amplifier).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) * This function reads info from DT and uses it to *modify* channels (disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) * unavailable ones). It's usually a *bad* idea to use it in drivers with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) * shared channel data as DT limitations are device specific. You should make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) * sure to call it only if channels in wiphy are copied and can be modified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) * without affecting other devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) * As this function access device node it has to be called after set_wiphy_dev.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) * It also modifies channels so they have to be set first.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) * If using this helper, call it before wiphy_register().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) #ifdef CONFIG_OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) void wiphy_read_of_freq_limits(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) #else /* CONFIG_OF */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) static inline void wiphy_read_of_freq_limits(struct wiphy *wiphy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) #endif /* !CONFIG_OF */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) * Wireless hardware/device configuration structures and methods
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) * DOC: Actions and configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) * Each wireless device and each virtual interface offer a set of configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) * operations and other actions that are invoked by userspace. Each of these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) * actions is described in the operations structure, and the parameters these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) * operations use are described separately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) * Additionally, some operations are asynchronous and expect to get status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) * information via some functions that drivers need to call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) * Scanning and BSS list handling with its associated functionality is described
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) * in a separate chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) #define VHT_MUMIMO_GROUPS_DATA_LEN (WLAN_MEMBERSHIP_LEN +\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) WLAN_USER_POSITION_LEN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) * struct vif_params - describes virtual interface parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) * @flags: monitor interface flags, unchanged if 0, otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) * %MONITOR_FLAG_CHANGED will be set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) * @use_4addr: use 4-address frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) * @macaddr: address to use for this virtual interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) * If this parameter is set to zero address the driver may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) * determine the address as needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) * This feature is only fully supported by drivers that enable the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) * %NL80211_FEATURE_MAC_ON_CREATE flag. Others may support creating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) ** only p2p devices with specified MAC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) * @vht_mumimo_groups: MU-MIMO groupID, used for monitoring MU-MIMO packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) * belonging to that MU-MIMO groupID; %NULL if not changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) * @vht_mumimo_follow_addr: MU-MIMO follow address, used for monitoring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) * MU-MIMO packets going to the specified station; %NULL if not changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) struct vif_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) int use_4addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) u8 macaddr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) const u8 *vht_mumimo_groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) const u8 *vht_mumimo_follow_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) * struct key_params - key information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) * Information about a key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) * @key: key material
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) * @key_len: length of key material
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) * @cipher: cipher suite selector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) * with the get_key() callback, must be in little endian,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) * length given by @seq_len.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) * @seq_len: length of @seq.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) * @vlan_id: vlan_id for VLAN group key (if nonzero)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) * @mode: key install mode (RX_TX, NO_TX or SET_TX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) struct key_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) const u8 *key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) const u8 *seq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) int key_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) int seq_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) u16 vlan_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) u32 cipher;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) enum nl80211_key_mode mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) * struct cfg80211_chan_def - channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) * @chan: the (control) channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) * @width: channel width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) * @center_freq1: center frequency of first segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) * @center_freq2: center frequency of second segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) * (only with 80+80 MHz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) * @edmg: define the EDMG channels configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) * If edmg is requested (i.e. the .channels member is non-zero),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) * chan will define the primary channel and all other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) * parameters are ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) * @freq1_offset: offset from @center_freq1, in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) struct cfg80211_chan_def {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) struct ieee80211_channel *chan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) enum nl80211_chan_width width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) u32 center_freq1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) u32 center_freq2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) struct ieee80211_edmg edmg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) u16 freq1_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) * cfg80211_bitrate_mask - masks for bitrate control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) struct cfg80211_bitrate_mask {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) u32 legacy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) u16 vht_mcs[NL80211_VHT_NSS_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) u16 he_mcs[NL80211_HE_NSS_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) enum nl80211_txrate_gi gi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) enum nl80211_he_gi he_gi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) enum nl80211_he_ltf he_ltf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) } control[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) * struct cfg80211_tid_cfg - TID specific configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) * @config_override: Flag to notify driver to reset TID configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) * of the peer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) * @tids: bitmap of TIDs to modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) * @mask: bitmap of attributes indicating which parameter changed,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) * similar to &nl80211_tid_config_supp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) * @noack: noack configuration value for the TID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) * @retry_long: retry count value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) * @retry_short: retry count value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) * @ampdu: Enable/Disable MPDU aggregation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) * @rtscts: Enable/Disable RTS/CTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) * @amsdu: Enable/Disable MSDU aggregation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) * @txrate_type: Tx bitrate mask type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) * @txrate_mask: Tx bitrate to be applied for the TID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) struct cfg80211_tid_cfg {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) bool config_override;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) u8 tids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) u64 mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) enum nl80211_tid_config noack;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) u8 retry_long, retry_short;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) enum nl80211_tid_config ampdu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) enum nl80211_tid_config rtscts;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) enum nl80211_tid_config amsdu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) enum nl80211_tx_rate_setting txrate_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) struct cfg80211_bitrate_mask txrate_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) * struct cfg80211_tid_config - TID configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) * @peer: Station's MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) * @n_tid_conf: Number of TID specific configurations to be applied
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) * @tid_conf: Configuration change info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) struct cfg80211_tid_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) const u8 *peer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) u32 n_tid_conf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) struct cfg80211_tid_cfg tid_conf[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) * cfg80211_get_chandef_type - return old channel type from chandef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) * @chandef: the channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) * Return: The old channel type (NOHT, HT20, HT40+/-) from a given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) * chandef, which must have a bandwidth allowing this conversion.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) static inline enum nl80211_channel_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) switch (chandef->width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) case NL80211_CHAN_WIDTH_20_NOHT:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) return NL80211_CHAN_NO_HT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) case NL80211_CHAN_WIDTH_20:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) return NL80211_CHAN_HT20;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) case NL80211_CHAN_WIDTH_40:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) if (chandef->center_freq1 > chandef->chan->center_freq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) return NL80211_CHAN_HT40PLUS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) return NL80211_CHAN_HT40MINUS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) WARN_ON(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) return NL80211_CHAN_NO_HT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) * cfg80211_chandef_create - create channel definition using channel type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) * @chandef: the channel definition struct to fill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) * @channel: the control channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) * @chantype: the channel type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) * Given a channel type, create a channel definition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) struct ieee80211_channel *channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) enum nl80211_channel_type chantype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) * cfg80211_chandef_identical - check if two channel definitions are identical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) * @chandef1: first channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) * @chandef2: second channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) * Return: %true if the channels defined by the channel definitions are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) * identical, %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) const struct cfg80211_chan_def *chandef2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) return (chandef1->chan == chandef2->chan &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) chandef1->width == chandef2->width &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) chandef1->center_freq1 == chandef2->center_freq1 &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) chandef1->freq1_offset == chandef2->freq1_offset &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) chandef1->center_freq2 == chandef2->center_freq2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) * cfg80211_chandef_is_edmg - check if chandef represents an EDMG channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) * @chandef: the channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819) * Return: %true if EDMG defined, %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822) cfg80211_chandef_is_edmg(const struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) return chandef->edmg.channels || chandef->edmg.bw_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) * cfg80211_chandef_compatible - check if two channel definitions are compatible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829) * @chandef1: first channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) * @chandef2: second channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832) * Return: %NULL if the given channel definitions are incompatible,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) * chandef1 or chandef2 otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) const struct cfg80211_chan_def *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837) const struct cfg80211_chan_def *chandef2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) * cfg80211_chandef_valid - check if a channel definition is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) * @chandef: the channel definition to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) * Return: %true if the channel definition is valid. %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847) * cfg80211_chandef_usable - check if secondary channels can be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) * @wiphy: the wiphy to validate against
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) * @chandef: the channel definition to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) * @prohibited_flags: the regulatory channel flags that must not be set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) * Return: %true if secondary channels are usable. %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853) bool cfg80211_chandef_usable(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) u32 prohibited_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) * cfg80211_chandef_dfs_required - checks if radar detection is required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859) * @wiphy: the wiphy to validate against
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) * @chandef: the channel definition to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) * @iftype: the interface type as specified in &enum nl80211_iftype
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862) * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) * 1 if radar detection is required, 0 if it is not, < 0 on error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865) int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867) enum nl80211_iftype iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870) * ieee80211_chandef_rate_flags - returns rate flags for a channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) * In some channel types, not all rates may be used - for example CCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) * rates may not be used in 5/10 MHz channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) * @chandef: channel definition for the channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) * Returns: rate flags which apply for this channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879) static inline enum ieee80211_rate_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) ieee80211_chandef_rate_flags(struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) switch (chandef->width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) case NL80211_CHAN_WIDTH_5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884) return IEEE80211_RATE_SUPPORTS_5MHZ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885) case NL80211_CHAN_WIDTH_10:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886) return IEEE80211_RATE_SUPPORTS_10MHZ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) * ieee80211_chandef_max_power - maximum transmission power for the chandef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) * In some regulations, the transmit power may depend on the configured channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) * bandwidth which may be defined as dBm/MHz. This function returns the actual
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898) * max_power for non-standard (20 MHz) channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900) * @chandef: channel definition for the channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902) * Returns: maximum allowed transmission power in dBm for the chandef
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905) ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907) switch (chandef->width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908) case NL80211_CHAN_WIDTH_5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909) return min(chandef->chan->max_reg_power - 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910) chandef->chan->max_power);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911) case NL80211_CHAN_WIDTH_10:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912) return min(chandef->chan->max_reg_power - 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) chandef->chan->max_power);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917) return chandef->chan->max_power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921) * enum survey_info_flags - survey information flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923) * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) * @SURVEY_INFO_IN_USE: channel is currently being used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) * @SURVEY_INFO_TIME: active time (in ms) was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926) * @SURVEY_INFO_TIME_BUSY: busy time was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927) * @SURVEY_INFO_TIME_EXT_BUSY: extension channel busy time was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928) * @SURVEY_INFO_TIME_RX: receive time was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929) * @SURVEY_INFO_TIME_TX: transmit time was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930) * @SURVEY_INFO_TIME_SCAN: scan time was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931) * @SURVEY_INFO_TIME_BSS_RX: local BSS receive time was filled in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933) * Used by the driver to indicate which info in &struct survey_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934) * it has filled in during the get_survey().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) enum survey_info_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937) SURVEY_INFO_NOISE_DBM = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938) SURVEY_INFO_IN_USE = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939) SURVEY_INFO_TIME = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) SURVEY_INFO_TIME_BUSY = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941) SURVEY_INFO_TIME_EXT_BUSY = BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) SURVEY_INFO_TIME_RX = BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943) SURVEY_INFO_TIME_TX = BIT(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944) SURVEY_INFO_TIME_SCAN = BIT(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) SURVEY_INFO_TIME_BSS_RX = BIT(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949) * struct survey_info - channel survey response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 950) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 951) * @channel: the channel this survey record reports, may be %NULL for a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 952) * record to report global statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953) * @filled: bitflag of flags from &enum survey_info_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954) * @noise: channel noise in dBm. This and all following fields are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955) * optional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956) * @time: amount of time in ms the radio was turn on (on the channel)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957) * @time_busy: amount of time the primary channel was sensed busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958) * @time_ext_busy: amount of time the extension channel was sensed busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959) * @time_rx: amount of time the radio spent receiving data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960) * @time_tx: amount of time the radio spent transmitting data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961) * @time_scan: amount of time the radio spent for scanning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962) * @time_bss_rx: amount of time the radio spent receiving data on a local BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964) * Used by dump_survey() to report back per-channel survey information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966) * This structure can later be expanded with things like
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967) * channel duty cycle etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969) struct survey_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970) struct ieee80211_channel *channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971) u64 time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972) u64 time_busy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) u64 time_ext_busy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974) u64 time_rx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) u64 time_tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) u64 time_scan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977) u64 time_bss_rx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978) u32 filled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979) s8 noise;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982) #define CFG80211_MAX_WEP_KEYS 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 984) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 985) * struct cfg80211_crypto_settings - Crypto settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 986) * @wpa_versions: indicates which, if any, WPA versions are enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 987) * (from enum nl80211_wpa_versions)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 988) * @cipher_group: group key cipher suite (or 0 if unset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 989) * @n_ciphers_pairwise: number of AP supported unicast ciphers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 990) * @ciphers_pairwise: unicast key cipher suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 991) * @n_akm_suites: number of AKM suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 992) * @akm_suites: AKM suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 993) * @control_port: Whether user space controls IEEE 802.1X port, i.e.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 994) * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 995) * required to assume that the port is unauthorized until authorized by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 996) * user space. Otherwise, port is marked authorized by default.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 997) * @control_port_ethertype: the control port protocol that should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 998) * allowed through even on unauthorized ports
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 999) * @control_port_no_encrypt: TRUE to prevent encryption of control port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) * protocol frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) * @control_port_over_nl80211: TRUE if userspace expects to exchange control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) * port frames over NL80211 instead of the network interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) * @control_port_no_preauth: disables pre-auth rx over the nl80211 control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) * port for mac80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) * @wep_keys: static WEP keys, if not NULL points to an array of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) * CFG80211_MAX_WEP_KEYS WEP keys
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) * @wep_tx_key: key index (0..3) of the default TX static WEP key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) * @psk: PSK (for devices supporting 4-way-handshake offload)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) * @sae_pwd: password for SAE authentication (for devices supporting SAE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) * offload)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) * @sae_pwd_len: length of SAE password (for devices supporting SAE offload)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) * @sae_pwe: The mechanisms allowed for SAE PWE derivation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) * NL80211_SAE_PWE_UNSPECIFIED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) * Not-specified, used to indicate userspace did not specify any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) * preference. The driver should follow its internal policy in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) * such a scenario.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019) * NL80211_SAE_PWE_HUNT_AND_PECK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) * Allow hunting-and-pecking loop only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) * NL80211_SAE_PWE_HASH_TO_ELEMENT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) * Allow hash-to-element only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) * NL80211_SAE_PWE_BOTH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026) * Allow either hunting-and-pecking loop or hash-to-element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) struct cfg80211_crypto_settings {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) u32 wpa_versions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) u32 cipher_group;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) int n_ciphers_pairwise;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) int n_akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) bool control_port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) __be16 control_port_ethertype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) bool control_port_no_encrypt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) bool control_port_over_nl80211;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) bool control_port_no_preauth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) struct key_params *wep_keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) int wep_tx_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) const u8 *psk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) const u8 *sae_pwd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) u8 sae_pwd_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) enum nl80211_sae_pwe_mechanism sae_pwe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051) * struct cfg80211_beacon_data - beacon data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) * @head: head portion of beacon (before TIM IE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) * or %NULL if not changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) * @tail: tail portion of beacon (after TIM IE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) * or %NULL if not changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) * @head_len: length of @head
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057) * @tail_len: length of @tail
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) * @beacon_ies_len: length of beacon_ies in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) * @proberesp_ies: extra information element(s) to add into Probe Response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) * frames or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) * @proberesp_ies_len: length of proberesp_ies in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) * @assocresp_ies: extra information element(s) to add into (Re)Association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) * Response frames or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) * @assocresp_ies_len: length of assocresp_ies in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) * @probe_resp_len: length of probe response template (@probe_resp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) * @probe_resp: probe response template (AP mode only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068) * @ftm_responder: enable FTM responder functionality; -1 for no change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) * (which also implies no change in LCI/civic location data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) * @lci: Measurement Report element content, starting with Measurement Token
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) * (measurement type 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) * @civicloc: Measurement Report element content, starting with Measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) * Token (measurement type 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) * @lci_len: LCI data length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) * @civicloc_len: Civic location data length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) struct cfg80211_beacon_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) const u8 *head, *tail;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) const u8 *beacon_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) const u8 *proberesp_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) const u8 *assocresp_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) const u8 *probe_resp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) const u8 *lci;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) const u8 *civicloc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) s8 ftm_responder;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087) size_t head_len, tail_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) size_t beacon_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) size_t proberesp_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) size_t assocresp_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) size_t probe_resp_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) size_t lci_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) size_t civicloc_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098) struct mac_address {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) u8 addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) * struct cfg80211_acl_data - Access control list data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) * @acl_policy: ACL policy to be applied on the station's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106) * entry specified by mac_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) * @n_acl_entries: Number of MAC address entries passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) * @mac_addrs: List of MAC addresses of stations to be used for ACL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) struct cfg80211_acl_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) enum nl80211_acl_policy acl_policy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) int n_acl_entries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) /* Keep it last */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) struct mac_address mac_addrs[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) * struct cfg80211_fils_discovery - FILS discovery parameters from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) * IEEE Std 802.11ai-2016, Annex C.3 MIB detail.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) * @min_interval: Minimum packet interval in TUs (0 - 10000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123) * @max_interval: Maximum packet interval in TUs (0 - 10000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124) * @tmpl_len: Template length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) * @tmpl: Template data for FILS discovery frame including the action
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) * frame headers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128) struct cfg80211_fils_discovery {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) u32 min_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) u32 max_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131) size_t tmpl_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) const u8 *tmpl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) * struct cfg80211_unsol_bcast_probe_resp - Unsolicited broadcast probe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) * response parameters in 6GHz.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) * @interval: Packet interval in TUs. Maximum allowed is 20 TU, as mentioned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) * in IEEE P802.11ax/D6.0 26.17.2.3.2 - AP behavior for fast passive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) * scanning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) * @tmpl_len: Template length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) * @tmpl: Template data for probe response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145) struct cfg80211_unsol_bcast_probe_resp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) u32 interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) size_t tmpl_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) const u8 *tmpl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) * enum cfg80211_ap_settings_flags - AP settings flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) * Used by cfg80211_ap_settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) * @AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) enum cfg80211_ap_settings_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) * struct cfg80211_ap_settings - AP configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) * Used to configure an AP interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) * @chandef: defines the channel to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) * @beacon: beacon data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) * @beacon_interval: beacon interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) * @dtim_period: DTIM period
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) * user space)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) * @ssid_len: length of @ssid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) * @crypto: crypto settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) * @privacy: the BSS uses privacy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) * @auth_type: Authentication type (algorithm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) * @smps_mode: SMPS mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) * @inactivity_timeout: time in seconds to determine station's inactivity.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) * @p2p_ctwindow: P2P CT Window
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181) * @p2p_opp_ps: P2P opportunistic PS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) * @acl: ACL configuration used by the drivers which has support for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) * MAC address based access control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) * @pbss: If set, start as a PCP instead of AP. Relevant for DMG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) * networks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) * @beacon_rate: bitrate to be used for beacons
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) * @ht_cap: HT capabilities (or %NULL if HT isn't enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) * @vht_cap: VHT capabilities (or %NULL if VHT isn't enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) * @he_cap: HE capabilities (or %NULL if HE isn't enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) * @ht_required: stations must support HT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) * @vht_required: stations must support VHT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) * @twt_responder: Enable Target Wait Time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) * @he_required: stations must support HE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) * @flags: flags, as defined in enum cfg80211_ap_settings_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) * @he_obss_pd: OBSS Packet Detection settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) * @he_bss_color: BSS Color settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) * @he_oper: HE operation IE (or %NULL if HE isn't enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) * @fils_discovery: FILS discovery transmission parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) struct cfg80211_ap_settings {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) struct cfg80211_beacon_data beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) int beacon_interval, dtim_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) const u8 *ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208) size_t ssid_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209) enum nl80211_hidden_ssid hidden_ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) struct cfg80211_crypto_settings crypto;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) bool privacy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) enum nl80211_auth_type auth_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213) enum nl80211_smps_mode smps_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214) int inactivity_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) u8 p2p_ctwindow;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216) bool p2p_opp_ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) const struct cfg80211_acl_data *acl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) bool pbss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) struct cfg80211_bitrate_mask beacon_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) const struct ieee80211_ht_cap *ht_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) const struct ieee80211_vht_cap *vht_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223) const struct ieee80211_he_cap_elem *he_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) const struct ieee80211_he_operation *he_oper;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) bool ht_required, vht_required, he_required;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) bool twt_responder;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228) struct ieee80211_he_obss_pd he_obss_pd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) struct cfg80211_he_bss_color he_bss_color;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230) struct cfg80211_fils_discovery fils_discovery;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) * struct cfg80211_csa_settings - channel switch settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) * Used for channel switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) * @chandef: defines the channel to use after the switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242) * @beacon_csa: beacon data while performing the switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243) * @counter_offsets_beacon: offsets of the counters within the beacon (tail)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244) * @counter_offsets_presp: offsets of the counters within the probe response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) * @n_counter_offsets_beacon: number of csa counters the beacon (tail)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246) * @n_counter_offsets_presp: number of csa counters in the probe response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) * @beacon_after: beacon data to be used on the new channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) * @radar_required: whether radar detection is required on the new channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249) * @block_tx: whether transmissions should be blocked while changing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) * @count: number of beacons until switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252) struct cfg80211_csa_settings {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) struct cfg80211_beacon_data beacon_csa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255) const u16 *counter_offsets_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) const u16 *counter_offsets_presp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) unsigned int n_counter_offsets_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) unsigned int n_counter_offsets_presp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259) struct cfg80211_beacon_data beacon_after;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) bool radar_required;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261) bool block_tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) u8 count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) #define CFG80211_MAX_NUM_DIFFERENT_CHANNELS 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) * struct iface_combination_params - input parameters for interface combinations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) * Used to pass interface combination parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274) * @num_different_channels: the number of different channels we want
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) * to use for verification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276) * @radar_detect: a bitmap where each bit corresponds to a channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) * width where radar detection is needed, as in the definition of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278) * &struct ieee80211_iface_combination.@radar_detect_widths
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) * @iftype_num: array with the number of interfaces of each interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) * type. The index is the interface type as specified in &enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) * nl80211_iftype.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) * @new_beacon_int: set this to the beacon interval of a new interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283) * that's not operating yet, if such is to be checked as part of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) * the verification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) struct iface_combination_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287) int num_different_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) u8 radar_detect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289) int iftype_num[NUM_NL80211_IFTYPES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) u32 new_beacon_int;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) * enum station_parameters_apply_mask - station parameter values to apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295) * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) * @STATION_PARAM_APPLY_PLINK_STATE: apply new plink state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) * Not all station parameters have in-band "no change" signalling,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300) * for those that don't these flags will are used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) enum station_parameters_apply_mask {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303) STATION_PARAM_APPLY_UAPSD = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304) STATION_PARAM_APPLY_CAPABILITY = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) STATION_PARAM_APPLY_PLINK_STATE = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) STATION_PARAM_APPLY_STA_TXPOWER = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310) * struct sta_txpwr - station txpower configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) * Used to configure txpower for station.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) * @power: tx power (in dBm) to be used for sending data traffic. If tx power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315) * is not provided, the default per-interface tx power setting will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316) * overriding. Driver should be picking up the lowest tx power, either tx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317) * power per-interface or per-station.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) * @type: In particular if TPC %type is NL80211_TX_POWER_LIMITED then tx power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319) * will be less than or equal to specified from userspace, whereas if TPC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) * %type is NL80211_TX_POWER_AUTOMATIC then it indicates default tx power.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) * NL80211_TX_POWER_FIXED is not a valid configuration option for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322) * per peer TPC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) struct sta_txpwr {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325) s16 power;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) enum nl80211_tx_power_setting type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330) * struct station_parameters - station parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) * Used to change and create a new station.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) * @vlan: vlan interface station should belong to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) * @supported_rates: supported rates in IEEE 802.11 format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336) * (or NULL for no change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) * @supported_rates_len: number of supported rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) * @sta_flags_mask: station flags that changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339) * (bitmask of BIT(%NL80211_STA_FLAG_...))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) * @sta_flags_set: station flags values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) * (bitmask of BIT(%NL80211_STA_FLAG_...))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342) * @listen_interval: listen interval or -1 for no change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1343) * @aid: AID or zero for no change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1344) * @vlan_id: VLAN ID for station (if nonzero)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1345) * @peer_aid: mesh peer AID or zero for no change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1346) * @plink_action: plink action to take
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1347) * @plink_state: set the peer link state for a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1348) * @ht_capa: HT capabilities of station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1349) * @vht_capa: VHT capabilities of station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1350) * @uapsd_queues: bitmap of queues configured for uapsd. same format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1351) * as the AC bitmap in the QoS info field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1352) * @max_sp: max Service Period. same format as the MAX_SP in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1353) * QoS info field (but already shifted down)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1354) * @sta_modify_mask: bitmap indicating which parameters changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1355) * (for those that don't have a natural "no change" value),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1356) * see &enum station_parameters_apply_mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1357) * @local_pm: local link-specific mesh power save mode (no change when set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1358) * to unknown)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1359) * @capability: station capability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1360) * @ext_capab: extended capabilities of the station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1361) * @ext_capab_len: number of extended capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1362) * @supported_channels: supported channels in IEEE 802.11 format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1363) * @supported_channels_len: number of supported channels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1364) * @supported_oper_classes: supported oper classes in IEEE 802.11 format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1365) * @supported_oper_classes_len: number of supported operating classes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1366) * @opmode_notif: operating mode field from Operating Mode Notification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1367) * @opmode_notif_used: information if operating mode field is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1368) * @support_p2p_ps: information if station supports P2P PS mechanism
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1369) * @he_capa: HE capabilities of station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1370) * @he_capa_len: the length of the HE capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1371) * @airtime_weight: airtime scheduler weight for this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1372) * @txpwr: transmit power for an associated station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1373) * @he_6ghz_capa: HE 6 GHz Band capabilities of station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1374) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1375) struct station_parameters {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1376) const u8 *supported_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1377) struct net_device *vlan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1378) u32 sta_flags_mask, sta_flags_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1379) u32 sta_modify_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1380) int listen_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1381) u16 aid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1382) u16 vlan_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1383) u16 peer_aid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1384) u8 supported_rates_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1385) u8 plink_action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1386) u8 plink_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1387) const struct ieee80211_ht_cap *ht_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1388) const struct ieee80211_vht_cap *vht_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1389) u8 uapsd_queues;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1390) u8 max_sp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1391) enum nl80211_mesh_power_mode local_pm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1392) u16 capability;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1393) const u8 *ext_capab;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1394) u8 ext_capab_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1395) const u8 *supported_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1396) u8 supported_channels_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1397) const u8 *supported_oper_classes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1398) u8 supported_oper_classes_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1399) u8 opmode_notif;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1400) bool opmode_notif_used;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1401) int support_p2p_ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1402) const struct ieee80211_he_cap_elem *he_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1403) u8 he_capa_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1404) u16 airtime_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1405) struct sta_txpwr txpwr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1406) const struct ieee80211_he_6ghz_capa *he_6ghz_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1407)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1408) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1409) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1410)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1411) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1412) * struct station_del_parameters - station deletion parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1413) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1414) * Used to delete a station entry (or all stations).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1415) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1416) * @mac: MAC address of the station to remove or NULL to remove all stations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1417) * @subtype: Management frame subtype to use for indicating removal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1418) * (10 = Disassociation, 12 = Deauthentication)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1419) * @reason_code: Reason code for the Disassociation/Deauthentication frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1420) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1421) struct station_del_parameters {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1422) const u8 *mac;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1423) u8 subtype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1424) u16 reason_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1425) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1426)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1427) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1428) * enum cfg80211_station_type - the type of station being modified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1429) * @CFG80211_STA_AP_CLIENT: client of an AP interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1430) * @CFG80211_STA_AP_CLIENT_UNASSOC: client of an AP interface that is still
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1431) * unassociated (update properties for this type of client is permitted)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1432) * @CFG80211_STA_AP_MLME_CLIENT: client of an AP interface that has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1433) * the AP MLME in the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1434) * @CFG80211_STA_AP_STA: AP station on managed interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1435) * @CFG80211_STA_IBSS: IBSS station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1436) * @CFG80211_STA_TDLS_PEER_SETUP: TDLS peer on managed interface (dummy entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1437) * while TDLS setup is in progress, it moves out of this state when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1438) * being marked authorized; use this only if TDLS with external setup is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1439) * supported/used)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1440) * @CFG80211_STA_TDLS_PEER_ACTIVE: TDLS peer on managed interface (active
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1441) * entry that is operating, has been marked authorized by userspace)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1442) * @CFG80211_STA_MESH_PEER_KERNEL: peer on mesh interface (kernel managed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1443) * @CFG80211_STA_MESH_PEER_USER: peer on mesh interface (user managed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1444) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1445) enum cfg80211_station_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1446) CFG80211_STA_AP_CLIENT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1447) CFG80211_STA_AP_CLIENT_UNASSOC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1448) CFG80211_STA_AP_MLME_CLIENT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1449) CFG80211_STA_AP_STA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1450) CFG80211_STA_IBSS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1451) CFG80211_STA_TDLS_PEER_SETUP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1452) CFG80211_STA_TDLS_PEER_ACTIVE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1453) CFG80211_STA_MESH_PEER_KERNEL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1454) CFG80211_STA_MESH_PEER_USER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1455) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1456)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1457) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1458) * cfg80211_check_station_change - validate parameter changes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1459) * @wiphy: the wiphy this operates on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1460) * @params: the new parameters for a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1461) * @statype: the type of station being modified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1462) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1463) * Utility function for the @change_station driver method. Call this function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1464) * with the appropriate station type looking up the station (and checking that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1465) * it exists). It will verify whether the station change is acceptable, and if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1466) * not will return an error code. Note that it may modify the parameters for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1467) * backward compatibility reasons, so don't use them before calling this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1468) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1469) int cfg80211_check_station_change(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1470) struct station_parameters *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1471) enum cfg80211_station_type statype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1472)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1473) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1474) * enum rate_info_flags - bitrate info flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1475) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1476) * Used by the driver to indicate the specific rate transmission
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1477) * type for 802.11n transmissions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1478) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1479) * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1480) * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1481) * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1482) * @RATE_INFO_FLAGS_DMG: 60GHz MCS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1483) * @RATE_INFO_FLAGS_HE_MCS: HE MCS information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1484) * @RATE_INFO_FLAGS_EDMG: 60GHz MCS in EDMG mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1485) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1486) enum rate_info_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1487) RATE_INFO_FLAGS_MCS = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1488) RATE_INFO_FLAGS_VHT_MCS = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1489) RATE_INFO_FLAGS_SHORT_GI = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1490) RATE_INFO_FLAGS_DMG = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1491) RATE_INFO_FLAGS_HE_MCS = BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1492) RATE_INFO_FLAGS_EDMG = BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1493) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1494)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1495) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1496) * enum rate_info_bw - rate bandwidth information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1497) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1498) * Used by the driver to indicate the rate bandwidth.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1499) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1500) * @RATE_INFO_BW_5: 5 MHz bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1501) * @RATE_INFO_BW_10: 10 MHz bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1502) * @RATE_INFO_BW_20: 20 MHz bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1503) * @RATE_INFO_BW_40: 40 MHz bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1504) * @RATE_INFO_BW_80: 80 MHz bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1505) * @RATE_INFO_BW_160: 160 MHz bandwidth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1506) * @RATE_INFO_BW_HE_RU: bandwidth determined by HE RU allocation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1507) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1508) enum rate_info_bw {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1509) RATE_INFO_BW_20 = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1510) RATE_INFO_BW_5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1511) RATE_INFO_BW_10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1512) RATE_INFO_BW_40,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1513) RATE_INFO_BW_80,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1514) RATE_INFO_BW_160,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1515) RATE_INFO_BW_HE_RU,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1516) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1517)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1518) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1519) * struct rate_info - bitrate information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1520) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1521) * Information about a receiving or transmitting bitrate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1522) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1523) * @flags: bitflag of flags from &enum rate_info_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1524) * @mcs: mcs index if struct describes an HT/VHT/HE rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1525) * @legacy: bitrate in 100kbit/s for 802.11abg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1526) * @nss: number of streams (VHT & HE only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1527) * @bw: bandwidth (from &enum rate_info_bw)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1528) * @he_gi: HE guard interval (from &enum nl80211_he_gi)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1529) * @he_dcm: HE DCM value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1530) * @he_ru_alloc: HE RU allocation (from &enum nl80211_he_ru_alloc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1531) * only valid if bw is %RATE_INFO_BW_HE_RU)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1532) * @n_bonded_ch: In case of EDMG the number of bonded channels (1-4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1533) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1534) struct rate_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1535) u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1536) u8 mcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1537) u16 legacy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1538) u8 nss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1539) u8 bw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1540) u8 he_gi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1541) u8 he_dcm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1542) u8 he_ru_alloc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1543) u8 n_bonded_ch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1544) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1545)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1546) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1547) * enum bss_param_flags - bitrate info flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1548) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1549) * Used by the driver to indicate the specific rate transmission
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1550) * type for 802.11n transmissions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1551) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1552) * @BSS_PARAM_FLAGS_CTS_PROT: whether CTS protection is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1553) * @BSS_PARAM_FLAGS_SHORT_PREAMBLE: whether short preamble is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1554) * @BSS_PARAM_FLAGS_SHORT_SLOT_TIME: whether short slot time is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1555) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1556) enum bss_param_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1557) BSS_PARAM_FLAGS_CTS_PROT = 1<<0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1558) BSS_PARAM_FLAGS_SHORT_PREAMBLE = 1<<1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1559) BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 1<<2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1560) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1561)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1562) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1563) * struct sta_bss_parameters - BSS parameters for the attached station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1564) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1565) * Information about the currently associated BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1566) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1567) * @flags: bitflag of flags from &enum bss_param_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1568) * @dtim_period: DTIM period for the BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1569) * @beacon_interval: beacon interval
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1570) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1571) struct sta_bss_parameters {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1572) u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1573) u8 dtim_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1574) u16 beacon_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1575) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1576)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1577) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1578) * struct cfg80211_txq_stats - TXQ statistics for this TID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1579) * @filled: bitmap of flags using the bits of &enum nl80211_txq_stats to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1580) * indicate the relevant values in this struct are filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1581) * @backlog_bytes: total number of bytes currently backlogged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1582) * @backlog_packets: total number of packets currently backlogged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1583) * @flows: number of new flows seen
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1584) * @drops: total number of packets dropped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1585) * @ecn_marks: total number of packets marked with ECN CE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1586) * @overlimit: number of drops due to queue space overflow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1587) * @overmemory: number of drops due to memory limit overflow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1588) * @collisions: number of hash collisions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1589) * @tx_bytes: total number of bytes dequeued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1590) * @tx_packets: total number of packets dequeued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1591) * @max_flows: maximum number of flows supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1592) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1593) struct cfg80211_txq_stats {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1594) u32 filled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1595) u32 backlog_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1596) u32 backlog_packets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1597) u32 flows;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1598) u32 drops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1599) u32 ecn_marks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1600) u32 overlimit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1601) u32 overmemory;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1602) u32 collisions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1603) u32 tx_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1604) u32 tx_packets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1605) u32 max_flows;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1606) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1607)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1608) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1609) * struct cfg80211_tid_stats - per-TID statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1610) * @filled: bitmap of flags using the bits of &enum nl80211_tid_stats to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1611) * indicate the relevant values in this struct are filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1612) * @rx_msdu: number of received MSDUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1613) * @tx_msdu: number of (attempted) transmitted MSDUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1614) * @tx_msdu_retries: number of retries (not counting the first) for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1615) * transmitted MSDUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1616) * @tx_msdu_failed: number of failed transmitted MSDUs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1617) * @txq_stats: TXQ statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1618) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1619) struct cfg80211_tid_stats {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1620) u32 filled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1621) u64 rx_msdu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1622) u64 tx_msdu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1623) u64 tx_msdu_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1624) u64 tx_msdu_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1625) struct cfg80211_txq_stats txq_stats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1626) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1627)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1628) #define IEEE80211_MAX_CHAINS 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1629)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1630) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1631) * struct station_info - station information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1632) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1633) * Station information filled by driver for get_station() and dump_station.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1634) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1635) * @filled: bitflag of flags using the bits of &enum nl80211_sta_info to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1636) * indicate the relevant values in this struct for them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1637) * @connected_time: time(in secs) since a station is last connected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1638) * @inactive_time: time since last station activity (tx/rx) in milliseconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1639) * @assoc_at: bootime (ns) of the last association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1640) * @rx_bytes: bytes (size of MPDUs) received from this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1641) * @tx_bytes: bytes (size of MPDUs) transmitted to this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1642) * @llid: mesh local link id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1643) * @plid: mesh peer link id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1644) * @plink_state: mesh peer link state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1645) * @signal: The signal strength, type depends on the wiphy's signal_type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1646) * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1647) * @signal_avg: Average signal strength, type depends on the wiphy's signal_type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1648) * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1649) * @chains: bitmask for filled values in @chain_signal, @chain_signal_avg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1650) * @chain_signal: per-chain signal strength of last received packet in dBm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1651) * @chain_signal_avg: per-chain signal strength average in dBm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1652) * @txrate: current unicast bitrate from this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1653) * @rxrate: current unicast bitrate to this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1654) * @rx_packets: packets (MSDUs & MMPDUs) received from this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1655) * @tx_packets: packets (MSDUs & MMPDUs) transmitted to this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1656) * @tx_retries: cumulative retry counts (MPDUs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1657) * @tx_failed: number of failed transmissions (MPDUs) (retries exceeded, no ACK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1658) * @rx_dropped_misc: Dropped for un-specified reason.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1659) * @bss_param: current BSS parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1660) * @generation: generation number for nl80211 dumps.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1661) * This number should increase every time the list of stations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1662) * changes, i.e. when a station is added or removed, so that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1663) * userspace can tell whether it got a consistent snapshot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1664) * @assoc_req_ies: IEs from (Re)Association Request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1665) * This is used only when in AP mode with drivers that do not use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1666) * user space MLME/SME implementation. The information is provided for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1667) * the cfg80211_new_sta() calls to notify user space of the IEs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1668) * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1669) * @sta_flags: station flags mask & values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1670) * @beacon_loss_count: Number of times beacon loss event has triggered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1671) * @t_offset: Time offset of the station relative to this host.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1672) * @local_pm: local mesh STA power save mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1673) * @peer_pm: peer mesh STA power save mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1674) * @nonpeer_pm: non-peer mesh STA power save mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1675) * @expected_throughput: expected throughput in kbps (including 802.11 headers)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1676) * towards this station.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1677) * @rx_beacon: number of beacons received from this peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1678) * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1679) * from this peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1680) * @connected_to_gate: true if mesh STA has a path to mesh gate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1681) * @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1682) * @tx_duration: aggregate PPDU duration(usecs) for all the frames to a peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1683) * @airtime_weight: current airtime scheduling weight
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1684) * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1685) * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1686) * Note that this doesn't use the @filled bit, but is used if non-NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1687) * @ack_signal: signal strength (in dBm) of the last ACK frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1688) * @avg_ack_signal: average rssi value of ack packet for the no of msdu's has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1689) * been sent.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1690) * @rx_mpdu_count: number of MPDUs received from this station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1691) * @fcs_err_count: number of packets (MPDUs) received from this station with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1692) * an FCS error. This counter should be incremented only when TA of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1693) * received packet with an FCS error matches the peer MAC address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1694) * @airtime_link_metric: mesh airtime link metric.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1695) * @connected_to_as: true if mesh STA has a path to authentication server
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1696) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1697) struct station_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1698) u64 filled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1699) u32 connected_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1700) u32 inactive_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1701) u64 assoc_at;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1702) u64 rx_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1703) u64 tx_bytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1704) u16 llid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1705) u16 plid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1706) u8 plink_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1707) s8 signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1708) s8 signal_avg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1709)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1710) u8 chains;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1711) s8 chain_signal[IEEE80211_MAX_CHAINS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1712) s8 chain_signal_avg[IEEE80211_MAX_CHAINS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1713)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1714) struct rate_info txrate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1715) struct rate_info rxrate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1716) u32 rx_packets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1717) u32 tx_packets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1718) u32 tx_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1719) u32 tx_failed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1720) u32 rx_dropped_misc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1721) struct sta_bss_parameters bss_param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1722) struct nl80211_sta_flag_update sta_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1723)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1724) int generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1725)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1726) const u8 *assoc_req_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1727) size_t assoc_req_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1728)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1729) u32 beacon_loss_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1730) s64 t_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1731) enum nl80211_mesh_power_mode local_pm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1732) enum nl80211_mesh_power_mode peer_pm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1733) enum nl80211_mesh_power_mode nonpeer_pm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1734)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1735) u32 expected_throughput;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1736)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1737) u64 tx_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1738) u64 rx_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1739) u64 rx_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1740) u8 rx_beacon_signal_avg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1741) u8 connected_to_gate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1742)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1743) struct cfg80211_tid_stats *pertid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1744) s8 ack_signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1745) s8 avg_ack_signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1746)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1747) u16 airtime_weight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1748)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1749) u32 rx_mpdu_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1750) u32 fcs_err_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1751)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1752) u32 airtime_link_metric;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1753)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1754) u8 connected_to_as;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1755)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1756) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1757) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1758)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1759) #if IS_ENABLED(CONFIG_CFG80211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1760) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1761) * cfg80211_get_station - retrieve information about a given station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1762) * @dev: the device where the station is supposed to be connected to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1763) * @mac_addr: the mac address of the station of interest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1764) * @sinfo: pointer to the structure to fill with the information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1765) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1766) * Returns 0 on success and sinfo is filled with the available information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1767) * otherwise returns a negative error code and the content of sinfo has to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1768) * considered undefined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1769) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1770) int cfg80211_get_station(struct net_device *dev, const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1771) struct station_info *sinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1772) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1773) static inline int cfg80211_get_station(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1774) const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1775) struct station_info *sinfo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1776) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1777) return -ENOENT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1778) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1779) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1780)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1781) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1782) * enum monitor_flags - monitor flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1783) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1784) * Monitor interface configuration flags. Note that these must be the bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1785) * according to the nl80211 flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1786) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1787) * @MONITOR_FLAG_CHANGED: set if the flags were changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1788) * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1789) * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1790) * @MONITOR_FLAG_CONTROL: pass control frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1791) * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1792) * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1793) * @MONITOR_FLAG_ACTIVE: active monitor, ACKs frames on its MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1794) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1795) enum monitor_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1796) MONITOR_FLAG_CHANGED = 1<<__NL80211_MNTR_FLAG_INVALID,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1797) MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1798) MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1799) MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1800) MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1801) MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1802) MONITOR_FLAG_ACTIVE = 1<<NL80211_MNTR_FLAG_ACTIVE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1803) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1804)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1805) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1806) * enum mpath_info_flags - mesh path information flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1807) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1808) * Used by the driver to indicate which info in &struct mpath_info it has filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1809) * in during get_station() or dump_station().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1810) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1811) * @MPATH_INFO_FRAME_QLEN: @frame_qlen filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1812) * @MPATH_INFO_SN: @sn filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1813) * @MPATH_INFO_METRIC: @metric filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1814) * @MPATH_INFO_EXPTIME: @exptime filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1815) * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1816) * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1817) * @MPATH_INFO_FLAGS: @flags filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1818) * @MPATH_INFO_HOP_COUNT: @hop_count filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1819) * @MPATH_INFO_PATH_CHANGE: @path_change_count filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1820) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1821) enum mpath_info_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1822) MPATH_INFO_FRAME_QLEN = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1823) MPATH_INFO_SN = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1824) MPATH_INFO_METRIC = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1825) MPATH_INFO_EXPTIME = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1826) MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1827) MPATH_INFO_DISCOVERY_RETRIES = BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1828) MPATH_INFO_FLAGS = BIT(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1829) MPATH_INFO_HOP_COUNT = BIT(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1830) MPATH_INFO_PATH_CHANGE = BIT(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1831) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1832)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1833) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1834) * struct mpath_info - mesh path information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1835) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1836) * Mesh path information filled by driver for get_mpath() and dump_mpath().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1837) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1838) * @filled: bitfield of flags from &enum mpath_info_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1839) * @frame_qlen: number of queued frames for this destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1840) * @sn: target sequence number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1841) * @metric: metric (cost) of this mesh path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1842) * @exptime: expiration time for the mesh path from now, in msecs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1843) * @flags: mesh path flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1844) * @discovery_timeout: total mesh path discovery timeout, in msecs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1845) * @discovery_retries: mesh path discovery retries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1846) * @generation: generation number for nl80211 dumps.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1847) * This number should increase every time the list of mesh paths
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1848) * changes, i.e. when a station is added or removed, so that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1849) * userspace can tell whether it got a consistent snapshot.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1850) * @hop_count: hops to destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1851) * @path_change_count: total number of path changes to destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1852) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1853) struct mpath_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1854) u32 filled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1855) u32 frame_qlen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1856) u32 sn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1857) u32 metric;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1858) u32 exptime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1859) u32 discovery_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1860) u8 discovery_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1861) u8 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1862) u8 hop_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1863) u32 path_change_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1864)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1865) int generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1866) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1867)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1868) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1869) * struct bss_parameters - BSS parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1870) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1871) * Used to change BSS parameters (mainly for AP mode).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1872) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1873) * @use_cts_prot: Whether to use CTS protection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1874) * (0 = no, 1 = yes, -1 = do not change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1875) * @use_short_preamble: Whether the use of short preambles is allowed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1876) * (0 = no, 1 = yes, -1 = do not change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1877) * @use_short_slot_time: Whether the use of short slot time is allowed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1878) * (0 = no, 1 = yes, -1 = do not change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1879) * @basic_rates: basic rates in IEEE 802.11 format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1880) * (or NULL for no change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1881) * @basic_rates_len: number of basic rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1882) * @ap_isolate: do not forward packets between connected stations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1883) * (0 = no, 1 = yes, -1 = do not change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1884) * @ht_opmode: HT Operation mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1885) * (u16 = opmode, -1 = do not change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1886) * @p2p_ctwindow: P2P CT Window (-1 = no change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1887) * @p2p_opp_ps: P2P opportunistic PS (-1 = no change)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1888) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1889) struct bss_parameters {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1890) int use_cts_prot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1891) int use_short_preamble;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1892) int use_short_slot_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1893) const u8 *basic_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1894) u8 basic_rates_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1895) int ap_isolate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1896) int ht_opmode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1897) s8 p2p_ctwindow, p2p_opp_ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1898) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1899)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1900) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1901) * struct mesh_config - 802.11s mesh configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1902) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1903) * These parameters can be changed while the mesh is active.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1904) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1905) * @dot11MeshRetryTimeout: the initial retry timeout in millisecond units used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1906) * by the Mesh Peering Open message
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1907) * @dot11MeshConfirmTimeout: the initial retry timeout in millisecond units
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1908) * used by the Mesh Peering Open message
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1909) * @dot11MeshHoldingTimeout: the confirm timeout in millisecond units used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1910) * the mesh peering management to close a mesh peering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1911) * @dot11MeshMaxPeerLinks: the maximum number of peer links allowed on this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1912) * mesh interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1913) * @dot11MeshMaxRetries: the maximum number of peer link open retries that can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1914) * be sent to establish a new peer link instance in a mesh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1915) * @dot11MeshTTL: the value of TTL field set at a source mesh STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1916) * @element_ttl: the value of TTL field set at a mesh STA for path selection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1917) * elements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1918) * @auto_open_plinks: whether we should automatically open peer links when we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1919) * detect compatible mesh peers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1920) * @dot11MeshNbrOffsetMaxNeighbor: the maximum number of neighbors to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1921) * synchronize to for 11s default synchronization method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1922) * @dot11MeshHWMPmaxPREQretries: the number of action frames containing a PREQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1923) * that an originator mesh STA can send to a particular path target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1924) * @path_refresh_time: how frequently to refresh mesh paths in milliseconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1925) * @min_discovery_timeout: the minimum length of time to wait until giving up on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1926) * a path discovery in milliseconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1927) * @dot11MeshHWMPactivePathTimeout: the time (in TUs) for which mesh STAs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1928) * receiving a PREQ shall consider the forwarding information from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1929) * root to be valid. (TU = time unit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1930) * @dot11MeshHWMPpreqMinInterval: the minimum interval of time (in TUs) during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1931) * which a mesh STA can send only one action frame containing a PREQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1932) * element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1933) * @dot11MeshHWMPperrMinInterval: the minimum interval of time (in TUs) during
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1934) * which a mesh STA can send only one Action frame containing a PERR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1935) * element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1936) * @dot11MeshHWMPnetDiameterTraversalTime: the interval of time (in TUs) that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1937) * it takes for an HWMP information element to propagate across the mesh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1938) * @dot11MeshHWMPRootMode: the configuration of a mesh STA as root mesh STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1939) * @dot11MeshHWMPRannInterval: the interval of time (in TUs) between root
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1940) * announcements are transmitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1941) * @dot11MeshGateAnnouncementProtocol: whether to advertise that this mesh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1942) * station has access to a broader network beyond the MBSS. (This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1943) * missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol set to true
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1944) * only means that the station will announce others it's a mesh gate, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1945) * not necessarily using the gate announcement protocol. Still keeping the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1946) * same nomenclature to be in sync with the spec)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1947) * @dot11MeshForwarding: whether the Mesh STA is forwarding or non-forwarding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1948) * entity (default is TRUE - forwarding entity)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1949) * @rssi_threshold: the threshold for average signal strength of candidate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1950) * station to establish a peer link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1951) * @ht_opmode: mesh HT protection mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1952) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1953) * @dot11MeshHWMPactivePathToRootTimeout: The time (in TUs) for which mesh STAs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1954) * receiving a proactive PREQ shall consider the forwarding information to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1955) * the root mesh STA to be valid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1956) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1957) * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1958) * PREQs are transmitted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1959) * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1960) * during which a mesh STA can send only one Action frame containing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1961) * a PREQ element for root path confirmation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1962) * @power_mode: The default mesh power save mode which will be the initial
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1963) * setting for new peer links.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1964) * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1965) * after transmitting its beacon.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1966) * @plink_timeout: If no tx activity is seen from a STA we've established
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1967) * peering with for longer than this time (in seconds), then remove it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1968) * from the STA's list of peers. Default is 30 minutes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1969) * @dot11MeshConnectedToMeshGate: if set to true, advertise that this STA is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1970) * connected to a mesh gate in mesh formation info. If false, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1971) * value in mesh formation is determined by the presence of root paths
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1972) * in the mesh path table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1973) * @dot11MeshNolearn: Try to avoid multi-hop path discovery (e.g. PREQ/PREP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1974) * for HWMP) if the destination is a direct neighbor. Note that this might
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1975) * not be the optimal decision as a multi-hop route might be better. So
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1976) * if using this setting you will likely also want to disable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1977) * dot11MeshForwarding and use another mesh routing protocol on top.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1978) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1979) struct mesh_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1980) u16 dot11MeshRetryTimeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1981) u16 dot11MeshConfirmTimeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1982) u16 dot11MeshHoldingTimeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1983) u16 dot11MeshMaxPeerLinks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1984) u8 dot11MeshMaxRetries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1985) u8 dot11MeshTTL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1986) u8 element_ttl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1987) bool auto_open_plinks;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1988) u32 dot11MeshNbrOffsetMaxNeighbor;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1989) u8 dot11MeshHWMPmaxPREQretries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1990) u32 path_refresh_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1991) u16 min_discovery_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1992) u32 dot11MeshHWMPactivePathTimeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1993) u16 dot11MeshHWMPpreqMinInterval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1994) u16 dot11MeshHWMPperrMinInterval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1995) u16 dot11MeshHWMPnetDiameterTraversalTime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1996) u8 dot11MeshHWMPRootMode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1997) bool dot11MeshConnectedToMeshGate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1998) bool dot11MeshConnectedToAuthServer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1999) u16 dot11MeshHWMPRannInterval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2000) bool dot11MeshGateAnnouncementProtocol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2001) bool dot11MeshForwarding;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2002) s32 rssi_threshold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2003) u16 ht_opmode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2004) u32 dot11MeshHWMPactivePathToRootTimeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2005) u16 dot11MeshHWMProotInterval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2006) u16 dot11MeshHWMPconfirmationInterval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2007) enum nl80211_mesh_power_mode power_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2008) u16 dot11MeshAwakeWindowDuration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2009) u32 plink_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2010) bool dot11MeshNolearn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2011)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2012) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2013) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2014)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2015) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2016) * struct mesh_setup - 802.11s mesh setup configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2017) * @chandef: defines the channel to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2018) * @mesh_id: the mesh ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2019) * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2020) * @sync_method: which synchronization method to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2021) * @path_sel_proto: which path selection protocol to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2022) * @path_metric: which metric to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2023) * @auth_id: which authentication method this mesh is using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2024) * @ie: vendor information elements (optional)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2025) * @ie_len: length of vendor information elements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2026) * @is_authenticated: this mesh requires authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2027) * @is_secure: this mesh uses security
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2028) * @user_mpm: userspace handles all MPM functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2029) * @dtim_period: DTIM period to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2030) * @beacon_interval: beacon interval to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2031) * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2032) * @basic_rates: basic rates to use when creating the mesh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2033) * @beacon_rate: bitrate to be used for beacons
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2034) * @userspace_handles_dfs: whether user space controls DFS operation, i.e.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2035) * changes the channel when a radar is detected. This is required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2036) * to operate on DFS channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2037) * @control_port_over_nl80211: TRUE if userspace expects to exchange control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2038) * port frames over NL80211 instead of the network interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2039) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2040) * These parameters are fixed when the mesh is created.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2041) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2042) struct mesh_setup {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2043) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2044) const u8 *mesh_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2045) u8 mesh_id_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2046) u8 sync_method;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2047) u8 path_sel_proto;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2048) u8 path_metric;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2049) u8 auth_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2050) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2051) u8 ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2052) bool is_authenticated;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2053) bool is_secure;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2054) bool user_mpm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2055) u8 dtim_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2056) u16 beacon_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2057) int mcast_rate[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2058) u32 basic_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2059) struct cfg80211_bitrate_mask beacon_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2060) bool userspace_handles_dfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2061) bool control_port_over_nl80211;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2062)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2063) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2064) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2065)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2066) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2067) * struct ocb_setup - 802.11p OCB mode setup configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2068) * @chandef: defines the channel to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2069) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2070) * These parameters are fixed when connecting to the network
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2071) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2072) struct ocb_setup {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2073) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2074) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2075)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2076) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2077) * struct ieee80211_txq_params - TX queue parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2078) * @ac: AC identifier
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2079) * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2080) * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2081) * 1..32767]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2082) * @cwmax: Maximum contention window [a value of the form 2^n-1 in the range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2083) * 1..32767]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2084) * @aifs: Arbitration interframe space [0..255]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2085) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2086) struct ieee80211_txq_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2087) enum nl80211_ac ac;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2088) u16 txop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2089) u16 cwmin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2090) u16 cwmax;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2091) u8 aifs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2092) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2093)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2094) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2095) * DOC: Scanning and BSS list handling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2096) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2097) * The scanning process itself is fairly simple, but cfg80211 offers quite
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2098) * a bit of helper functionality. To start a scan, the scan operation will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2099) * be invoked with a scan definition. This scan definition contains the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2100) * channels to scan, and the SSIDs to send probe requests for (including the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2101) * wildcard, if desired). A passive scan is indicated by having no SSIDs to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2102) * probe. Additionally, a scan request may contain extra information elements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2103) * that should be added to the probe request. The IEs are guaranteed to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2104) * well-formed, and will not exceed the maximum length the driver advertised
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2105) * in the wiphy structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2106) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2107) * When scanning finds a BSS, cfg80211 needs to be notified of that, because
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2108) * it is responsible for maintaining the BSS list; the driver should not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2109) * maintain a list itself. For this notification, various functions exist.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2110) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2111) * Since drivers do not maintain a BSS list, there are also a number of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2112) * functions to search for a BSS and obtain information about it from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2113) * BSS structure cfg80211 maintains. The BSS list is also made available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2114) * to userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2115) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2117) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2118) * struct cfg80211_ssid - SSID description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2119) * @ssid: the SSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2120) * @ssid_len: length of the ssid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2121) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2122) struct cfg80211_ssid {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2123) u8 ssid[IEEE80211_MAX_SSID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2124) u8 ssid_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2125) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2127) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2128) * struct cfg80211_scan_info - information about completed scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2129) * @scan_start_tsf: scan start time in terms of the TSF of the BSS that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2130) * wireless device that requested the scan is connected to. If this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2131) * information is not available, this field is left zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2132) * @tsf_bssid: the BSSID according to which %scan_start_tsf is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2133) * @aborted: set to true if the scan was aborted for any reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2134) * userspace will be notified of that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2135) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2136) struct cfg80211_scan_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2137) u64 scan_start_tsf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2138) u8 tsf_bssid[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2139) bool aborted;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2140) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2142) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2143) * struct cfg80211_scan_6ghz_params - relevant for 6 GHz only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2144) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2145) * @short_bssid: short ssid to scan for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2146) * @bssid: bssid to scan for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2147) * @channel_idx: idx of the channel in the channel array in the scan request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2148) * which the above info relvant to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2149) * @unsolicited_probe: the AP transmits unsolicited probe response every 20 TU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2150) * @short_ssid_valid: short_ssid is valid and can be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2151) * @psc_no_listen: when set, and the channel is a PSC channel, no need to wait
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2152) * 20 TUs before starting to send probe requests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2153) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2154) struct cfg80211_scan_6ghz_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2155) u32 short_ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2156) u32 channel_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2157) u8 bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2158) bool unsolicited_probe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2159) bool short_ssid_valid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2160) bool psc_no_listen;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2161) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2163) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2164) * struct cfg80211_scan_request - scan request description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2165) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2166) * @ssids: SSIDs to scan for (active scan only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2167) * @n_ssids: number of SSIDs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2168) * @channels: channels to scan on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2169) * @n_channels: total number of channels to scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2170) * @scan_width: channel width for scanning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2171) * @ie: optional information element(s) to add into Probe Request or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2172) * @ie_len: length of ie in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2173) * @duration: how long to listen on each channel, in TUs. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2174) * %duration_mandatory is not set, this is the maximum dwell time and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2175) * the actual dwell time may be shorter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2176) * @duration_mandatory: if set, the scan duration must be as specified by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2177) * %duration field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2178) * @flags: bit field of flags controlling operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2179) * @rates: bitmap of rates to advertise for each band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2180) * @wiphy: the wiphy this was for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2181) * @scan_start: time (in jiffies) when the scan started
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2182) * @wdev: the wireless device to scan for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2183) * @info: (internal) information about completed scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2184) * @notified: (internal) scan request was notified as done or aborted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2185) * @no_cck: used to send probe requests at non CCK rate in 2GHz band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2186) * @mac_addr: MAC address used with randomisation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2187) * @mac_addr_mask: MAC address mask used with randomisation, bits that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2188) * are 0 in the mask should be randomised, bits that are 1 should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2189) * be taken from the @mac_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2190) * @scan_6ghz: relevant for split scan request only,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2191) * true if this is the second scan request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2192) * @n_6ghz_params: number of 6 GHz params
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2193) * @scan_6ghz_params: 6 GHz params
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2194) * @bssid: BSSID to scan for (most commonly, the wildcard BSSID)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2195) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2196) struct cfg80211_scan_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2197) struct cfg80211_ssid *ssids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2198) int n_ssids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2199) u32 n_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2200) enum nl80211_bss_scan_width scan_width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2201) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2202) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2203) u16 duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2204) bool duration_mandatory;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2205) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2207) u32 rates[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2209) struct wireless_dev *wdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2211) u8 mac_addr[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2212) u8 mac_addr_mask[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2213) u8 bssid[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2215) /* internal */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2216) struct wiphy *wiphy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2217) unsigned long scan_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2218) struct cfg80211_scan_info info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2219) bool notified;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2220) bool no_cck;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2221) bool scan_6ghz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2222) u32 n_6ghz_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2223) struct cfg80211_scan_6ghz_params *scan_6ghz_params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2225) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2226)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2227) /* keep last */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2228) struct ieee80211_channel *channels[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2229) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2231) static inline void get_random_mask_addr(u8 *buf, const u8 *addr, const u8 *mask)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2232) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2233) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2235) get_random_bytes(buf, ETH_ALEN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2236) for (i = 0; i < ETH_ALEN; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2237) buf[i] &= ~mask[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2238) buf[i] |= addr[i] & mask[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2239) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2240) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2242) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2243) * struct cfg80211_match_set - sets of attributes to match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2244) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2245) * @ssid: SSID to be matched; may be zero-length in case of BSSID match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2246) * or no match (RSSI only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2247) * @bssid: BSSID to be matched; may be all-zero BSSID in case of SSID match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2248) * or no match (RSSI only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2249) * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2250) * @per_band_rssi_thold: Minimum rssi threshold for each band to be applied
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2251) * for filtering out scan results received. Drivers advertize this support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2252) * of band specific rssi based filtering through the feature capability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2253) * %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2254) * specific rssi thresholds take precedence over rssi_thold, if specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2255) * If not specified for any band, it will be assigned with rssi_thold of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2256) * corresponding matchset.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2257) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2258) struct cfg80211_match_set {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2259) struct cfg80211_ssid ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2260) u8 bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2261) s32 rssi_thold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2262) s32 per_band_rssi_thold[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2263) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2265) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2266) * struct cfg80211_sched_scan_plan - scan plan for scheduled scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2267) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2268) * @interval: interval between scheduled scan iterations. In seconds.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2269) * @iterations: number of scan iterations in this scan plan. Zero means
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2270) * infinite loop.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2271) * The last scan plan will always have this parameter set to zero,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2272) * all other scan plans will have a finite number of iterations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2273) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2274) struct cfg80211_sched_scan_plan {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2275) u32 interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2276) u32 iterations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2277) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2278)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2279) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2280) * struct cfg80211_bss_select_adjust - BSS selection with RSSI adjustment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2281) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2282) * @band: band of BSS which should match for RSSI level adjustment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2283) * @delta: value of RSSI level adjustment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2284) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2285) struct cfg80211_bss_select_adjust {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2286) enum nl80211_band band;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2287) s8 delta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2288) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2290) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2291) * struct cfg80211_sched_scan_request - scheduled scan request description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2292) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2293) * @reqid: identifies this request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2294) * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2295) * @n_ssids: number of SSIDs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2296) * @n_channels: total number of channels to scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2297) * @scan_width: channel width for scanning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2298) * @ie: optional information element(s) to add into Probe Request or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2299) * @ie_len: length of ie in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2300) * @flags: bit field of flags controlling operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2301) * @match_sets: sets of parameters to be matched for a scan result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2302) * entry to be considered valid and to be passed to the host
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2303) * (others are filtered out).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2304) * If ommited, all results are passed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2305) * @n_match_sets: number of match sets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2306) * @report_results: indicates that results were reported for this request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2307) * @wiphy: the wiphy this was for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2308) * @dev: the interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2309) * @scan_start: start time of the scheduled scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2310) * @channels: channels to scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2311) * @min_rssi_thold: for drivers only supporting a single threshold, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2312) * contains the minimum over all matchsets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2313) * @mac_addr: MAC address used with randomisation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2314) * @mac_addr_mask: MAC address mask used with randomisation, bits that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2315) * are 0 in the mask should be randomised, bits that are 1 should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2316) * be taken from the @mac_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2317) * @scan_plans: scan plans to be executed in this scheduled scan. Lowest
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2318) * index must be executed first.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2319) * @n_scan_plans: number of scan plans, at least 1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2320) * @rcu_head: RCU callback used to free the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2321) * @owner_nlportid: netlink portid of owner (if this should is a request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2322) * owned by a particular socket)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2323) * @nl_owner_dead: netlink owner socket was closed - this request be freed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2324) * @list: for keeping list of requests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2325) * @delay: delay in seconds to use before starting the first scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2326) * cycle. The driver may ignore this parameter and start
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2327) * immediately (or at any other time), if this feature is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2328) * supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2329) * @relative_rssi_set: Indicates whether @relative_rssi is set or not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2330) * @relative_rssi: Relative RSSI threshold in dB to restrict scan result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2331) * reporting in connected state to cases where a matching BSS is determined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2332) * to have better or slightly worse RSSI than the current connected BSS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2333) * The relative RSSI threshold values are ignored in disconnected state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2334) * @rssi_adjust: delta dB of RSSI preference to be given to the BSSs that belong
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2335) * to the specified band while deciding whether a better BSS is reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2336) * using @relative_rssi. If delta is a negative number, the BSSs that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2337) * belong to the specified band will be penalized by delta dB in relative
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2338) * comparisions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2339) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2340) struct cfg80211_sched_scan_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2341) u64 reqid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2342) struct cfg80211_ssid *ssids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2343) int n_ssids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2344) u32 n_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2345) enum nl80211_bss_scan_width scan_width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2346) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2347) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2348) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2349) struct cfg80211_match_set *match_sets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2350) int n_match_sets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2351) s32 min_rssi_thold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2352) u32 delay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2353) struct cfg80211_sched_scan_plan *scan_plans;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2354) int n_scan_plans;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2356) u8 mac_addr[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2357) u8 mac_addr_mask[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2358)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2359) bool relative_rssi_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2360) s8 relative_rssi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2361) struct cfg80211_bss_select_adjust rssi_adjust;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2363) /* internal */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2364) struct wiphy *wiphy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2365) struct net_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2366) unsigned long scan_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2367) bool report_results;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2368) struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2369) u32 owner_nlportid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2370) bool nl_owner_dead;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2371) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2372)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2373) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2374)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2375) /* keep last */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2376) struct ieee80211_channel *channels[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2377) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2378)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2379) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2380) * enum cfg80211_signal_type - signal type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2381) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2382) * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2383) * @CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2384) * @CFG80211_SIGNAL_TYPE_UNSPEC: signal strength, increasing from 0 through 100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2385) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2386) enum cfg80211_signal_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2387) CFG80211_SIGNAL_TYPE_NONE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2388) CFG80211_SIGNAL_TYPE_MBM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2389) CFG80211_SIGNAL_TYPE_UNSPEC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2390) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2392) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2393) * struct cfg80211_inform_bss - BSS inform data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2394) * @chan: channel the frame was received on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2395) * @scan_width: scan width that was used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2396) * @signal: signal strength value, according to the wiphy's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2397) * signal type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2398) * @boottime_ns: timestamp (CLOCK_BOOTTIME) when the information was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2399) * received; should match the time when the frame was actually
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2400) * received by the device (not just by the host, in case it was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2401) * buffered on the device) and be accurate to about 10ms.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2402) * If the frame isn't buffered, just passing the return value of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2403) * ktime_get_boottime_ns() is likely appropriate.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2404) * @parent_tsf: the time at the start of reception of the first octet of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2405) * timestamp field of the frame. The time is the TSF of the BSS specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2406) * by %parent_bssid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2407) * @parent_bssid: the BSS according to which %parent_tsf is set. This is set to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2408) * the BSS that requested the scan in which the beacon/probe was received.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2409) * @chains: bitmask for filled values in @chain_signal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2410) * @chain_signal: per-chain signal strength of last received BSS in dBm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2411) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2412) struct cfg80211_inform_bss {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2413) struct ieee80211_channel *chan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2414) enum nl80211_bss_scan_width scan_width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2415) s32 signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2416) u64 boottime_ns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2417) u64 parent_tsf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2418) u8 parent_bssid[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2419) u8 chains;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2420) s8 chain_signal[IEEE80211_MAX_CHAINS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2421) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2422)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2423) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2424) * struct cfg80211_bss_ies - BSS entry IE data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2425) * @tsf: TSF contained in the frame that carried these IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2426) * @rcu_head: internal use, for freeing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2427) * @len: length of the IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2428) * @from_beacon: these IEs are known to come from a beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2429) * @data: IE data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2430) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2431) struct cfg80211_bss_ies {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2432) u64 tsf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2433) struct rcu_head rcu_head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2434) int len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2435) bool from_beacon;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2436) u8 data[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2437) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2438)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2439) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2440) * struct cfg80211_bss - BSS description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2441) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2442) * This structure describes a BSS (which may also be a mesh network)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2443) * for use in scan results and similar.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2444) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2445) * @channel: channel this BSS is on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2446) * @scan_width: width of the control channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2447) * @bssid: BSSID of the BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2448) * @beacon_interval: the beacon interval as from the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2449) * @capability: the capability field in host byte order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2450) * @ies: the information elements (Note that there is no guarantee that these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2451) * are well-formed!); this is a pointer to either the beacon_ies or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2452) * proberesp_ies depending on whether Probe Response frame has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2453) * received. It is always non-%NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2454) * @beacon_ies: the information elements from the last Beacon frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2455) * (implementation note: if @hidden_beacon_bss is set this struct doesn't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2456) * own the beacon_ies, but they're just pointers to the ones from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2457) * @hidden_beacon_bss struct)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2458) * @proberesp_ies: the information elements from the last Probe Response frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2459) * @hidden_beacon_bss: in case this BSS struct represents a probe response from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2460) * a BSS that hides the SSID in its beacon, this points to the BSS struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2461) * that holds the beacon data. @beacon_ies is still valid, of course, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2462) * points to the same data as hidden_beacon_bss->beacon_ies in that case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2463) * @transmitted_bss: pointer to the transmitted BSS, if this is a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2464) * non-transmitted one (multi-BSSID support)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2465) * @nontrans_list: list of non-transmitted BSS, if this is a transmitted one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2466) * (multi-BSSID support)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2467) * @signal: signal strength value (type depends on the wiphy's signal_type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2468) * @chains: bitmask for filled values in @chain_signal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2469) * @chain_signal: per-chain signal strength of last received BSS in dBm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2470) * @bssid_index: index in the multiple BSS set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2471) * @max_bssid_indicator: max number of members in the BSS set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2472) * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2473) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2474) struct cfg80211_bss {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2475) struct ieee80211_channel *channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2476) enum nl80211_bss_scan_width scan_width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2477)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2478) const struct cfg80211_bss_ies __rcu *ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2479) const struct cfg80211_bss_ies __rcu *beacon_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2480) const struct cfg80211_bss_ies __rcu *proberesp_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2481)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2482) struct cfg80211_bss *hidden_beacon_bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2483) struct cfg80211_bss *transmitted_bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2484) struct list_head nontrans_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2485)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2486) s32 signal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2487)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2488) u16 beacon_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2489) u16 capability;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2490)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2491) u8 bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2492) u8 chains;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2493) s8 chain_signal[IEEE80211_MAX_CHAINS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2494)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2495) u8 bssid_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2496) u8 max_bssid_indicator;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2497)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2498) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2499)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2500) u8 priv[] __aligned(sizeof(void *));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2501) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2502)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2503) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2504) * ieee80211_bss_get_elem - find element with given ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2505) * @bss: the bss to search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2506) * @id: the element ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2507) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2508) * Note that the return value is an RCU-protected pointer, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2509) * rcu_read_lock() must be held when calling this function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2510) * Return: %NULL if not found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2511) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2512) const struct element *ieee80211_bss_get_elem(struct cfg80211_bss *bss, u8 id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2513)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2514) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2515) * ieee80211_bss_get_ie - find IE with given ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2516) * @bss: the bss to search
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2517) * @id: the element ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2518) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2519) * Note that the return value is an RCU-protected pointer, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2520) * rcu_read_lock() must be held when calling this function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2521) * Return: %NULL if not found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2522) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2523) static inline const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2524) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2525) return (void *)ieee80211_bss_get_elem(bss, id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2526) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2528)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2529) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2530) * struct cfg80211_auth_request - Authentication request data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2531) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2532) * This structure provides information needed to complete IEEE 802.11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2533) * authentication.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2534) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2535) * @bss: The BSS to authenticate with, the callee must obtain a reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2536) * to it if it needs to keep it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2537) * @auth_type: Authentication type (algorithm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2538) * @ie: Extra IEs to add to Authentication frame or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2539) * @ie_len: Length of ie buffer in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2540) * @key_len: length of WEP key for shared key authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2541) * @key_idx: index of WEP key for shared key authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2542) * @key: WEP key for shared key authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2543) * @auth_data: Fields and elements in Authentication frames. This contains
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2544) * the authentication frame body (non-IE and IE data), excluding the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2545) * Authentication algorithm number, i.e., starting at the Authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2546) * transaction sequence number field.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2547) * @auth_data_len: Length of auth_data buffer in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2548) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2549) struct cfg80211_auth_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2550) struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2551) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2552) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2553) enum nl80211_auth_type auth_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2554) const u8 *key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2555) u8 key_len, key_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2556) const u8 *auth_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2557) size_t auth_data_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2558) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2559)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2560) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2561) * enum cfg80211_assoc_req_flags - Over-ride default behaviour in association.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2562) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2563) * @ASSOC_REQ_DISABLE_HT: Disable HT (802.11n)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2564) * @ASSOC_REQ_DISABLE_VHT: Disable VHT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2565) * @ASSOC_REQ_USE_RRM: Declare RRM capability in this association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2566) * @CONNECT_REQ_EXTERNAL_AUTH_SUPPORT: User space indicates external
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2567) * authentication capability. Drivers can offload authentication to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2568) * userspace if this flag is set. Only applicable for cfg80211_connect()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2569) * request (connect callback).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2570) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2571) enum cfg80211_assoc_req_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2572) ASSOC_REQ_DISABLE_HT = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2573) ASSOC_REQ_DISABLE_VHT = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2574) ASSOC_REQ_USE_RRM = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2575) CONNECT_REQ_EXTERNAL_AUTH_SUPPORT = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2576) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2577)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2578) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2579) * struct cfg80211_assoc_request - (Re)Association request data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2580) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2581) * This structure provides information needed to complete IEEE 802.11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2582) * (re)association.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2583) * @bss: The BSS to associate with. If the call is successful the driver is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2584) * given a reference that it must give back to cfg80211_send_rx_assoc()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2585) * or to cfg80211_assoc_timeout(). To ensure proper refcounting, new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2586) * association requests while already associating must be rejected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2587) * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2588) * @ie_len: Length of ie buffer in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2589) * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2590) * @crypto: crypto settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2591) * @prev_bssid: previous BSSID, if not %NULL use reassociate frame. This is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2592) * to indicate a request to reassociate within the ESS instead of a request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2593) * do the initial association with the ESS. When included, this is set to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2594) * the BSSID of the current association, i.e., to the value that is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2595) * included in the Current AP address field of the Reassociation Request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2596) * frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2597) * @flags: See &enum cfg80211_assoc_req_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2598) * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2599) * will be used in ht_capa. Un-supported values will be ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2600) * @ht_capa_mask: The bits of ht_capa which are to be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2601) * @vht_capa: VHT capability override
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2602) * @vht_capa_mask: VHT capability mask indicating which fields to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2603) * @fils_kek: FILS KEK for protecting (Re)Association Request/Response frame or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2604) * %NULL if FILS is not used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2605) * @fils_kek_len: Length of fils_kek in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2606) * @fils_nonces: FILS nonces (part of AAD) for protecting (Re)Association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2607) * Request/Response frame or %NULL if FILS is not used. This field starts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2608) * with 16 octets of STA Nonce followed by 16 octets of AP Nonce.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2609) * @s1g_capa: S1G capability override
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2610) * @s1g_capa_mask: S1G capability override mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2611) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2612) struct cfg80211_assoc_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2613) struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2614) const u8 *ie, *prev_bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2615) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2616) struct cfg80211_crypto_settings crypto;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2617) bool use_mfp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2618) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2619) struct ieee80211_ht_cap ht_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2620) struct ieee80211_ht_cap ht_capa_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2621) struct ieee80211_vht_cap vht_capa, vht_capa_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2622) const u8 *fils_kek;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2623) size_t fils_kek_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2624) const u8 *fils_nonces;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2625) struct ieee80211_s1g_cap s1g_capa, s1g_capa_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2626)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2627) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2628) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2629)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2630) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2631) * struct cfg80211_deauth_request - Deauthentication request data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2632) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2633) * This structure provides information needed to complete IEEE 802.11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2634) * deauthentication.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2635) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2636) * @bssid: the BSSID of the BSS to deauthenticate from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2637) * @ie: Extra IEs to add to Deauthentication frame or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2638) * @ie_len: Length of ie buffer in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2639) * @reason_code: The reason code for the deauthentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2640) * @local_state_change: if set, change local state only and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2641) * do not set a deauth frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2642) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2643) struct cfg80211_deauth_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2644) const u8 *bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2645) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2646) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2647) u16 reason_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2648) bool local_state_change;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2649) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2650)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2651) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2652) * struct cfg80211_disassoc_request - Disassociation request data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2653) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2654) * This structure provides information needed to complete IEEE 802.11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2655) * disassociation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2656) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2657) * @bss: the BSS to disassociate from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2658) * @ie: Extra IEs to add to Disassociation frame or %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2659) * @ie_len: Length of ie buffer in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2660) * @reason_code: The reason code for the disassociation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2661) * @local_state_change: This is a request for a local state only, i.e., no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2662) * Disassociation frame is to be transmitted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2663) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2664) struct cfg80211_disassoc_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2665) struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2666) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2667) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2668) u16 reason_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2669) bool local_state_change;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2670) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2671)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2672) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2673) * struct cfg80211_ibss_params - IBSS parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2674) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2675) * This structure defines the IBSS parameters for the join_ibss()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2676) * method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2677) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2678) * @ssid: The SSID, will always be non-null.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2679) * @ssid_len: The length of the SSID, will always be non-zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2680) * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2681) * search for IBSSs with a different BSSID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2682) * @chandef: defines the channel to use if no other IBSS to join can be found
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2683) * @channel_fixed: The channel should be fixed -- do not search for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2684) * IBSSs to join on other channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2685) * @ie: information element(s) to include in the beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2686) * @ie_len: length of that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2687) * @beacon_interval: beacon interval to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2688) * @privacy: this is a protected network, keys will be configured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2689) * after joining
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2690) * @control_port: whether user space controls IEEE 802.1X port, i.e.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2691) * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2692) * required to assume that the port is unauthorized until authorized by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2693) * user space. Otherwise, port is marked authorized by default.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2694) * @control_port_over_nl80211: TRUE if userspace expects to exchange control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2695) * port frames over NL80211 instead of the network interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2696) * @userspace_handles_dfs: whether user space controls DFS operation, i.e.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2697) * changes the channel when a radar is detected. This is required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2698) * to operate on DFS channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2699) * @basic_rates: bitmap of basic rates to use when creating the IBSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2700) * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2701) * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2702) * will be used in ht_capa. Un-supported values will be ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2703) * @ht_capa_mask: The bits of ht_capa which are to be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2704) * @wep_keys: static WEP keys, if not NULL points to an array of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2705) * CFG80211_MAX_WEP_KEYS WEP keys
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2706) * @wep_tx_key: key index (0..3) of the default TX static WEP key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2707) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2708) struct cfg80211_ibss_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2709) const u8 *ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2710) const u8 *bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2711) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2712) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2713) u8 ssid_len, ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2714) u16 beacon_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2715) u32 basic_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2716) bool channel_fixed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2717) bool privacy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2718) bool control_port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2719) bool control_port_over_nl80211;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2720) bool userspace_handles_dfs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2721) int mcast_rate[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2722) struct ieee80211_ht_cap ht_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2723) struct ieee80211_ht_cap ht_capa_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2724) struct key_params *wep_keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2725) int wep_tx_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2726)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2727) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2728) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2729)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2730) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2731) * struct cfg80211_bss_selection - connection parameters for BSS selection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2732) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2733) * @behaviour: requested BSS selection behaviour.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2734) * @param: parameters for requestion behaviour.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2735) * @band_pref: preferred band for %NL80211_BSS_SELECT_ATTR_BAND_PREF.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2736) * @adjust: parameters for %NL80211_BSS_SELECT_ATTR_RSSI_ADJUST.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2737) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2738) struct cfg80211_bss_selection {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2739) enum nl80211_bss_select_attr behaviour;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2740) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2741) enum nl80211_band band_pref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2742) struct cfg80211_bss_select_adjust adjust;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2743) } param;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2744) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2745)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2746) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2747) * struct cfg80211_connect_params - Connection parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2748) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2749) * This structure provides information needed to complete IEEE 802.11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2750) * authentication and association.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2751) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2752) * @channel: The channel to use or %NULL if not specified (auto-select based
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2753) * on scan results)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2754) * @channel_hint: The channel of the recommended BSS for initial connection or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2755) * %NULL if not specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2756) * @bssid: The AP BSSID or %NULL if not specified (auto-select based on scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2757) * results)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2758) * @bssid_hint: The recommended AP BSSID for initial connection to the BSS or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2759) * %NULL if not specified. Unlike the @bssid parameter, the driver is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2760) * allowed to ignore this @bssid_hint if it has knowledge of a better BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2761) * to use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2762) * @ssid: SSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2763) * @ssid_len: Length of ssid in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2764) * @auth_type: Authentication type (algorithm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2765) * @ie: IEs for association request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2766) * @ie_len: Length of assoc_ie in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2767) * @privacy: indicates whether privacy-enabled APs should be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2768) * @mfp: indicate whether management frame protection is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2769) * @crypto: crypto settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2770) * @key_len: length of WEP key for shared key authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2771) * @key_idx: index of WEP key for shared key authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2772) * @key: WEP key for shared key authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2773) * @flags: See &enum cfg80211_assoc_req_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2774) * @bg_scan_period: Background scan period in seconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2775) * or -1 to indicate that default value is to be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2776) * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2777) * will be used in ht_capa. Un-supported values will be ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2778) * @ht_capa_mask: The bits of ht_capa which are to be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2779) * @vht_capa: VHT Capability overrides
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2780) * @vht_capa_mask: The bits of vht_capa which are to be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2781) * @pbss: if set, connect to a PCP instead of AP. Valid for DMG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2782) * networks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2783) * @bss_select: criteria to be used for BSS selection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2784) * @prev_bssid: previous BSSID, if not %NULL use reassociate frame. This is used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2785) * to indicate a request to reassociate within the ESS instead of a request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2786) * do the initial association with the ESS. When included, this is set to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2787) * the BSSID of the current association, i.e., to the value that is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2788) * included in the Current AP address field of the Reassociation Request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2789) * frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2790) * @fils_erp_username: EAP re-authentication protocol (ERP) username part of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2791) * NAI or %NULL if not specified. This is used to construct FILS wrapped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2792) * data IE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2793) * @fils_erp_username_len: Length of @fils_erp_username in octets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2794) * @fils_erp_realm: EAP re-authentication protocol (ERP) realm part of NAI or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2795) * %NULL if not specified. This specifies the domain name of ER server and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2796) * is used to construct FILS wrapped data IE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2797) * @fils_erp_realm_len: Length of @fils_erp_realm in octets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2798) * @fils_erp_next_seq_num: The next sequence number to use in the FILS ERP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2799) * messages. This is also used to construct FILS wrapped data IE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2800) * @fils_erp_rrk: ERP re-authentication Root Key (rRK) used to derive additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2801) * keys in FILS or %NULL if not specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2802) * @fils_erp_rrk_len: Length of @fils_erp_rrk in octets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2803) * @want_1x: indicates user-space supports and wants to use 802.1X driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2804) * offload of 4-way handshake.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2805) * @edmg: define the EDMG channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2806) * This may specify multiple channels and bonding options for the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2807) * to choose from, based on BSS configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2808) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2809) struct cfg80211_connect_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2810) struct ieee80211_channel *channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2811) struct ieee80211_channel *channel_hint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2812) const u8 *bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2813) const u8 *bssid_hint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2814) const u8 *ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2815) size_t ssid_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2816) enum nl80211_auth_type auth_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2817) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2818) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2819) bool privacy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2820) enum nl80211_mfp mfp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2821) struct cfg80211_crypto_settings crypto;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2822) const u8 *key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2823) u8 key_len, key_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2824) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2825) int bg_scan_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2826) struct ieee80211_ht_cap ht_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2827) struct ieee80211_ht_cap ht_capa_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2828) struct ieee80211_vht_cap vht_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2829) struct ieee80211_vht_cap vht_capa_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2830) bool pbss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2831) struct cfg80211_bss_selection bss_select;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2832) const u8 *prev_bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2833) const u8 *fils_erp_username;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2834) size_t fils_erp_username_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2835) const u8 *fils_erp_realm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2836) size_t fils_erp_realm_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2837) u16 fils_erp_next_seq_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2838) const u8 *fils_erp_rrk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2839) size_t fils_erp_rrk_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2840) bool want_1x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2841) struct ieee80211_edmg edmg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2842)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2843) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2844) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2845)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2846) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2847) * enum cfg80211_connect_params_changed - Connection parameters being updated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2848) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2849) * This enum provides information of all connect parameters that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2850) * have to be updated as part of update_connect_params() call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2851) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2852) * @UPDATE_ASSOC_IES: Indicates whether association request IEs are updated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2853) * @UPDATE_FILS_ERP_INFO: Indicates that FILS connection parameters (realm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2854) * username, erp sequence number and rrk) are updated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2855) * @UPDATE_AUTH_TYPE: Indicates that authentication type is updated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2856) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2857) enum cfg80211_connect_params_changed {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2858) UPDATE_ASSOC_IES = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2859) UPDATE_FILS_ERP_INFO = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2860) UPDATE_AUTH_TYPE = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2861) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2862)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2863) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2864) * enum wiphy_params_flags - set_wiphy_params bitfield values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2865) * @WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2866) * @WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2867) * @WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2868) * @WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2869) * @WIPHY_PARAM_COVERAGE_CLASS: coverage class changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2870) * @WIPHY_PARAM_DYN_ACK: dynack has been enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2871) * @WIPHY_PARAM_TXQ_LIMIT: TXQ packet limit has been changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2872) * @WIPHY_PARAM_TXQ_MEMORY_LIMIT: TXQ memory limit has been changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2873) * @WIPHY_PARAM_TXQ_QUANTUM: TXQ scheduler quantum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2874) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2875) enum wiphy_params_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2876) WIPHY_PARAM_RETRY_SHORT = 1 << 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2877) WIPHY_PARAM_RETRY_LONG = 1 << 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2878) WIPHY_PARAM_FRAG_THRESHOLD = 1 << 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2879) WIPHY_PARAM_RTS_THRESHOLD = 1 << 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2880) WIPHY_PARAM_COVERAGE_CLASS = 1 << 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2881) WIPHY_PARAM_DYN_ACK = 1 << 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2882) WIPHY_PARAM_TXQ_LIMIT = 1 << 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2883) WIPHY_PARAM_TXQ_MEMORY_LIMIT = 1 << 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2884) WIPHY_PARAM_TXQ_QUANTUM = 1 << 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2885) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2886)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2887) #define IEEE80211_DEFAULT_AIRTIME_WEIGHT 256
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2888)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2889) /* The per TXQ device queue limit in airtime */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2890) #define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2891) #define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2892)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2893) /* The per interface airtime threshold to switch to lower queue limit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2894) #define IEEE80211_AQL_THRESHOLD 24000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2895)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2896) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2897) * struct cfg80211_pmksa - PMK Security Association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2898) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2899) * This structure is passed to the set/del_pmksa() method for PMKSA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2900) * caching.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2901) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2902) * @bssid: The AP's BSSID (may be %NULL).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2903) * @pmkid: The identifier to refer a PMKSA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2904) * @pmk: The PMK for the PMKSA identified by @pmkid. This is used for key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2905) * derivation by a FILS STA. Otherwise, %NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2906) * @pmk_len: Length of the @pmk. The length of @pmk can differ depending on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2907) * the hash algorithm used to generate this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2908) * @ssid: SSID to specify the ESS within which a PMKSA is valid when using FILS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2909) * cache identifier (may be %NULL).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2910) * @ssid_len: Length of the @ssid in octets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2911) * @cache_id: 2-octet cache identifier advertized by a FILS AP identifying the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2912) * scope of PMKSA. This is valid only if @ssid_len is non-zero (may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2913) * %NULL).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2914) * @pmk_lifetime: Maximum lifetime for PMKSA in seconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2915) * (dot11RSNAConfigPMKLifetime) or 0 if not specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2916) * The configured PMKSA must not be used for PMKSA caching after
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2917) * expiration and any keys derived from this PMK become invalid on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2918) * expiration, i.e., the current association must be dropped if the PMK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2919) * used for it expires.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2920) * @pmk_reauth_threshold: Threshold time for reauthentication (percentage of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2921) * PMK lifetime, dot11RSNAConfigPMKReauthThreshold) or 0 if not specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2922) * Drivers are expected to trigger a full authentication instead of using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2923) * this PMKSA for caching when reassociating to a new BSS after this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2924) * threshold to generate a new PMK before the current one expires.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2925) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2926) struct cfg80211_pmksa {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2927) const u8 *bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2928) const u8 *pmkid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2929) const u8 *pmk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2930) size_t pmk_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2931) const u8 *ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2932) size_t ssid_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2933) const u8 *cache_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2934) u32 pmk_lifetime;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2935) u8 pmk_reauth_threshold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2936) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2937)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2938) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2939) * struct cfg80211_pkt_pattern - packet pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2940) * @mask: bitmask where to match pattern and where to ignore bytes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2941) * one bit per byte, in same format as nl80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2942) * @pattern: bytes to match where bitmask is 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2943) * @pattern_len: length of pattern (in bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2944) * @pkt_offset: packet offset (in bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2945) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2946) * Internal note: @mask and @pattern are allocated in one chunk of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2947) * memory, free @mask only!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2948) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2949) struct cfg80211_pkt_pattern {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2950) const u8 *mask, *pattern;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2951) int pattern_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2952) int pkt_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2953) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2954)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2955) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2956) * struct cfg80211_wowlan_tcp - TCP connection parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2957) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2958) * @sock: (internal) socket for source port allocation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2959) * @src: source IP address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2960) * @dst: destination IP address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2961) * @dst_mac: destination MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2962) * @src_port: source port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2963) * @dst_port: destination port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2964) * @payload_len: data payload length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2965) * @payload: data payload buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2966) * @payload_seq: payload sequence stamping configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2967) * @data_interval: interval at which to send data packets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2968) * @wake_len: wakeup payload match length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2969) * @wake_data: wakeup payload match data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2970) * @wake_mask: wakeup payload match mask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2971) * @tokens_size: length of the tokens buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2972) * @payload_tok: payload token usage configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2973) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2974) struct cfg80211_wowlan_tcp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2975) struct socket *sock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2976) __be32 src, dst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2977) u16 src_port, dst_port;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2978) u8 dst_mac[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2979) int payload_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2980) const u8 *payload;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2981) struct nl80211_wowlan_tcp_data_seq payload_seq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2982) u32 data_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2983) u32 wake_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2984) const u8 *wake_data, *wake_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2985) u32 tokens_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2986) /* must be last, variable member */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2987) struct nl80211_wowlan_tcp_data_token payload_tok;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2988) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2989)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2990) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2991) * struct cfg80211_wowlan - Wake on Wireless-LAN support info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2992) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2993) * This structure defines the enabled WoWLAN triggers for the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2994) * @any: wake up on any activity -- special trigger if device continues
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2995) * operating as normal during suspend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2996) * @disconnect: wake up if getting disconnected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2997) * @magic_pkt: wake up on receiving magic packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2998) * @patterns: wake up on receiving packet matching a pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2999) * @n_patterns: number of patterns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3000) * @gtk_rekey_failure: wake up on GTK rekey failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3001) * @eap_identity_req: wake up on EAP identity request packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3002) * @four_way_handshake: wake up on 4-way handshake
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3003) * @rfkill_release: wake up when rfkill is released
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3004) * @tcp: TCP connection establishment/wakeup parameters, see nl80211.h.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3005) * NULL if not configured.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3006) * @nd_config: configuration for the scan to be used for net detect wake.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3007) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3008) struct cfg80211_wowlan {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3009) bool any, disconnect, magic_pkt, gtk_rekey_failure,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3010) eap_identity_req, four_way_handshake,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3011) rfkill_release;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3012) struct cfg80211_pkt_pattern *patterns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3013) struct cfg80211_wowlan_tcp *tcp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3014) int n_patterns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3015) struct cfg80211_sched_scan_request *nd_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3016) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3017)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3018) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3019) * struct cfg80211_coalesce_rules - Coalesce rule parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3020) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3021) * This structure defines coalesce rule for the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3022) * @delay: maximum coalescing delay in msecs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3023) * @condition: condition for packet coalescence.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3024) * see &enum nl80211_coalesce_condition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3025) * @patterns: array of packet patterns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3026) * @n_patterns: number of patterns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3027) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3028) struct cfg80211_coalesce_rules {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3029) int delay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3030) enum nl80211_coalesce_condition condition;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3031) struct cfg80211_pkt_pattern *patterns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3032) int n_patterns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3033) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3034)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3035) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3036) * struct cfg80211_coalesce - Packet coalescing settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3037) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3038) * This structure defines coalescing settings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3039) * @rules: array of coalesce rules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3040) * @n_rules: number of rules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3041) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3042) struct cfg80211_coalesce {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3043) struct cfg80211_coalesce_rules *rules;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3044) int n_rules;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3045) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3046)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3047) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3048) * struct cfg80211_wowlan_nd_match - information about the match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3049) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3050) * @ssid: SSID of the match that triggered the wake up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3051) * @n_channels: Number of channels where the match occurred. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3052) * value may be zero if the driver can't report the channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3053) * @channels: center frequencies of the channels where a match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3054) * occurred (in MHz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3055) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3056) struct cfg80211_wowlan_nd_match {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3057) struct cfg80211_ssid ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3058) int n_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3059) u32 channels[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3060) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3061)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3062) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3063) * struct cfg80211_wowlan_nd_info - net detect wake up information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3064) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3065) * @n_matches: Number of match information instances provided in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3066) * @matches. This value may be zero if the driver can't provide
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3067) * match information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3068) * @matches: Array of pointers to matches containing information about
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3069) * the matches that triggered the wake up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3070) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3071) struct cfg80211_wowlan_nd_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3072) int n_matches;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3073) struct cfg80211_wowlan_nd_match *matches[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3074) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3075)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3076) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3077) * struct cfg80211_wowlan_wakeup - wakeup report
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3078) * @disconnect: woke up by getting disconnected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3079) * @magic_pkt: woke up by receiving magic packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3080) * @gtk_rekey_failure: woke up by GTK rekey failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3081) * @eap_identity_req: woke up by EAP identity request packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3082) * @four_way_handshake: woke up by 4-way handshake
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3083) * @rfkill_release: woke up by rfkill being released
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3084) * @pattern_idx: pattern that caused wakeup, -1 if not due to pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3085) * @packet_present_len: copied wakeup packet data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3086) * @packet_len: original wakeup packet length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3087) * @packet: The packet causing the wakeup, if any.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3088) * @packet_80211: For pattern match, magic packet and other data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3089) * frame triggers an 802.3 frame should be reported, for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3090) * disconnect due to deauth 802.11 frame. This indicates which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3091) * it is.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3092) * @tcp_match: TCP wakeup packet received
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3093) * @tcp_connlost: TCP connection lost or failed to establish
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3094) * @tcp_nomoretokens: TCP data ran out of tokens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3095) * @net_detect: if not %NULL, woke up because of net detect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3096) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3097) struct cfg80211_wowlan_wakeup {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3098) bool disconnect, magic_pkt, gtk_rekey_failure,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3099) eap_identity_req, four_way_handshake,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3100) rfkill_release, packet_80211,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3101) tcp_match, tcp_connlost, tcp_nomoretokens;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3102) s32 pattern_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3103) u32 packet_present_len, packet_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3104) const void *packet;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3105) struct cfg80211_wowlan_nd_info *net_detect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3106) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3108) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3109) * struct cfg80211_gtk_rekey_data - rekey data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3110) * @kek: key encryption key (@kek_len bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3111) * @kck: key confirmation key (@kck_len bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3112) * @replay_ctr: replay counter (NL80211_REPLAY_CTR_LEN bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3113) * @kek_len: length of kek
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3114) * @kck_len length of kck
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3115) * @akm: akm (oui, id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3116) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3117) struct cfg80211_gtk_rekey_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3118) const u8 *kek, *kck, *replay_ctr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3119) u32 akm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3120) u8 kek_len, kck_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3121) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3123) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3124) * struct cfg80211_update_ft_ies_params - FT IE Information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3125) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3126) * This structure provides information needed to update the fast transition IE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3127) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3128) * @md: The Mobility Domain ID, 2 Octet value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3129) * @ie: Fast Transition IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3130) * @ie_len: Length of ft_ie in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3131) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3132) struct cfg80211_update_ft_ies_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3133) u16 md;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3134) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3135) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3136) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3138) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3139) * struct cfg80211_mgmt_tx_params - mgmt tx parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3140) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3141) * This structure provides information needed to transmit a mgmt frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3142) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3143) * @chan: channel to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3144) * @offchan: indicates wether off channel operation is required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3145) * @wait: duration for ROC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3146) * @buf: buffer to transmit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3147) * @len: buffer length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3148) * @no_cck: don't use cck rates for this frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3149) * @dont_wait_for_ack: tells the low level not to wait for an ack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3150) * @n_csa_offsets: length of csa_offsets array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3151) * @csa_offsets: array of all the csa offsets in the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3152) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3153) struct cfg80211_mgmt_tx_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3154) struct ieee80211_channel *chan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3155) bool offchan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3156) unsigned int wait;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3157) const u8 *buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3158) size_t len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3159) bool no_cck;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3160) bool dont_wait_for_ack;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3161) int n_csa_offsets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3162) const u16 *csa_offsets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3163) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3165) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3166) * struct cfg80211_dscp_exception - DSCP exception
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3167) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3168) * @dscp: DSCP value that does not adhere to the user priority range definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3169) * @up: user priority value to which the corresponding DSCP value belongs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3170) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3171) struct cfg80211_dscp_exception {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3172) u8 dscp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3173) u8 up;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3174) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3176) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3177) * struct cfg80211_dscp_range - DSCP range definition for user priority
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3178) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3179) * @low: lowest DSCP value of this user priority range, inclusive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3180) * @high: highest DSCP value of this user priority range, inclusive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3181) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3182) struct cfg80211_dscp_range {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3183) u8 low;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3184) u8 high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3185) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3187) /* QoS Map Set element length defined in IEEE Std 802.11-2012, 8.4.2.97 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3188) #define IEEE80211_QOS_MAP_MAX_EX 21
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3189) #define IEEE80211_QOS_MAP_LEN_MIN 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3190) #define IEEE80211_QOS_MAP_LEN_MAX \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3191) (IEEE80211_QOS_MAP_LEN_MIN + 2 * IEEE80211_QOS_MAP_MAX_EX)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3193) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3194) * struct cfg80211_qos_map - QoS Map Information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3195) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3196) * This struct defines the Interworking QoS map setting for DSCP values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3197) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3198) * @num_des: number of DSCP exceptions (0..21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3199) * @dscp_exception: optionally up to maximum of 21 DSCP exceptions from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3200) * the user priority DSCP range definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3201) * @up: DSCP range definition for a particular user priority
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3202) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3203) struct cfg80211_qos_map {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3204) u8 num_des;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3205) struct cfg80211_dscp_exception dscp_exception[IEEE80211_QOS_MAP_MAX_EX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3206) struct cfg80211_dscp_range up[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3207) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3209) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3210) * struct cfg80211_nan_conf - NAN configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3211) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3212) * This struct defines NAN configuration parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3213) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3214) * @master_pref: master preference (1 - 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3215) * @bands: operating bands, a bitmap of &enum nl80211_band values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3216) * For instance, for NL80211_BAND_2GHZ, bit 0 would be set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3217) * (i.e. BIT(NL80211_BAND_2GHZ)).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3218) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3219) struct cfg80211_nan_conf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3220) u8 master_pref;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3221) u8 bands;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3222) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3224) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3225) * enum cfg80211_nan_conf_changes - indicates changed fields in NAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3226) * configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3227) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3228) * @CFG80211_NAN_CONF_CHANGED_PREF: master preference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3229) * @CFG80211_NAN_CONF_CHANGED_BANDS: operating bands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3230) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3231) enum cfg80211_nan_conf_changes {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3232) CFG80211_NAN_CONF_CHANGED_PREF = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3233) CFG80211_NAN_CONF_CHANGED_BANDS = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3234) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3235)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3236) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3237) * struct cfg80211_nan_func_filter - a NAN function Rx / Tx filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3238) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3239) * @filter: the content of the filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3240) * @len: the length of the filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3241) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3242) struct cfg80211_nan_func_filter {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3243) const u8 *filter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3244) u8 len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3245) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3247) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3248) * struct cfg80211_nan_func - a NAN function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3249) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3250) * @type: &enum nl80211_nan_function_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3251) * @service_id: the service ID of the function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3252) * @publish_type: &nl80211_nan_publish_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3253) * @close_range: if true, the range should be limited. Threshold is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3254) * implementation specific.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3255) * @publish_bcast: if true, the solicited publish should be broadcasted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3256) * @subscribe_active: if true, the subscribe is active
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3257) * @followup_id: the instance ID for follow up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3258) * @followup_reqid: the requestor instance ID for follow up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3259) * @followup_dest: MAC address of the recipient of the follow up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3260) * @ttl: time to live counter in DW.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3261) * @serv_spec_info: Service Specific Info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3262) * @serv_spec_info_len: Service Specific Info length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3263) * @srf_include: if true, SRF is inclusive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3264) * @srf_bf: Bloom Filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3265) * @srf_bf_len: Bloom Filter length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3266) * @srf_bf_idx: Bloom Filter index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3267) * @srf_macs: SRF MAC addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3268) * @srf_num_macs: number of MAC addresses in SRF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3269) * @rx_filters: rx filters that are matched with corresponding peer's tx_filter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3270) * @tx_filters: filters that should be transmitted in the SDF.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3271) * @num_rx_filters: length of &rx_filters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3272) * @num_tx_filters: length of &tx_filters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3273) * @instance_id: driver allocated id of the function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3274) * @cookie: unique NAN function identifier.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3275) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3276) struct cfg80211_nan_func {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3277) enum nl80211_nan_function_type type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3278) u8 service_id[NL80211_NAN_FUNC_SERVICE_ID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3279) u8 publish_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3280) bool close_range;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3281) bool publish_bcast;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3282) bool subscribe_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3283) u8 followup_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3284) u8 followup_reqid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3285) struct mac_address followup_dest;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3286) u32 ttl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3287) const u8 *serv_spec_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3288) u8 serv_spec_info_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3289) bool srf_include;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3290) const u8 *srf_bf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3291) u8 srf_bf_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3292) u8 srf_bf_idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3293) struct mac_address *srf_macs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3294) int srf_num_macs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3295) struct cfg80211_nan_func_filter *rx_filters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3296) struct cfg80211_nan_func_filter *tx_filters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3297) u8 num_tx_filters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3298) u8 num_rx_filters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3299) u8 instance_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3300) u64 cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3301)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3302) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3303) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3305) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3306) * struct cfg80211_pmk_conf - PMK configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3307) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3308) * @aa: authenticator address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3309) * @pmk_len: PMK length in bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3310) * @pmk: the PMK material
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3311) * @pmk_r0_name: PMK-R0 Name. NULL if not applicable (i.e., the PMK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3312) * is not PMK-R0). When pmk_r0_name is not NULL, the pmk field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3313) * holds PMK-R0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3314) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3315) struct cfg80211_pmk_conf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3316) const u8 *aa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3317) u8 pmk_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3318) const u8 *pmk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3319) const u8 *pmk_r0_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3320) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3321)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3322) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3323) * struct cfg80211_external_auth_params - Trigger External authentication.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3324) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3325) * Commonly used across the external auth request and event interfaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3326) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3327) * @action: action type / trigger for external authentication. Only significant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3328) * for the authentication request event interface (driver to user space).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3329) * @bssid: BSSID of the peer with which the authentication has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3330) * to happen. Used by both the authentication request event and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3331) * authentication response command interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3332) * @ssid: SSID of the AP. Used by both the authentication request event and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3333) * authentication response command interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3334) * @key_mgmt_suite: AKM suite of the respective authentication. Used by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3335) * authentication request event interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3336) * @status: status code, %WLAN_STATUS_SUCCESS for successful authentication,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3337) * use %WLAN_STATUS_UNSPECIFIED_FAILURE if user space cannot give you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3338) * the real status code for failures. Used only for the authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3339) * response command interface (user space to driver).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3340) * @pmkid: The identifier to refer a PMKSA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3341) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3342) struct cfg80211_external_auth_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3343) enum nl80211_external_auth_action action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3344) u8 bssid[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3345) struct cfg80211_ssid ssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3346) unsigned int key_mgmt_suite;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3347) u16 status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3348) const u8 *pmkid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3349) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3351) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3352) * struct cfg80211_ftm_responder_stats - FTM responder statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3353) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3354) * @filled: bitflag of flags using the bits of &enum nl80211_ftm_stats to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3355) * indicate the relevant values in this struct for them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3356) * @success_num: number of FTM sessions in which all frames were successfully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3357) * answered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3358) * @partial_num: number of FTM sessions in which part of frames were
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3359) * successfully answered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3360) * @failed_num: number of failed FTM sessions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3361) * @asap_num: number of ASAP FTM sessions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3362) * @non_asap_num: number of non-ASAP FTM sessions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3363) * @total_duration_ms: total sessions durations - gives an indication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3364) * of how much time the responder was busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3365) * @unknown_triggers_num: number of unknown FTM triggers - triggers from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3366) * initiators that didn't finish successfully the negotiation phase with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3367) * the responder
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3368) * @reschedule_requests_num: number of FTM reschedule requests - initiator asks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3369) * for a new scheduling although it already has scheduled FTM slot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3370) * @out_of_window_triggers_num: total FTM triggers out of scheduled window
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3371) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3372) struct cfg80211_ftm_responder_stats {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3373) u32 filled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3374) u32 success_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3375) u32 partial_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3376) u32 failed_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3377) u32 asap_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3378) u32 non_asap_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3379) u64 total_duration_ms;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3380) u32 unknown_triggers_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3381) u32 reschedule_requests_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3382) u32 out_of_window_triggers_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3383) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3384)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3385) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3386) * struct cfg80211_pmsr_ftm_result - FTM result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3387) * @failure_reason: if this measurement failed (PMSR status is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3388) * %NL80211_PMSR_STATUS_FAILURE), this gives a more precise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3389) * reason than just "failure"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3390) * @burst_index: if reporting partial results, this is the index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3391) * in [0 .. num_bursts-1] of the burst that's being reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3392) * @num_ftmr_attempts: number of FTM request frames transmitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3393) * @num_ftmr_successes: number of FTM request frames acked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3394) * @busy_retry_time: if failure_reason is %NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3395) * fill this to indicate in how many seconds a retry is deemed possible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3396) * by the responder
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3397) * @num_bursts_exp: actual number of bursts exponent negotiated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3398) * @burst_duration: actual burst duration negotiated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3399) * @ftms_per_burst: actual FTMs per burst negotiated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3400) * @lci_len: length of LCI information (if present)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3401) * @civicloc_len: length of civic location information (if present)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3402) * @lci: LCI data (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3403) * @civicloc: civic location data (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3404) * @rssi_avg: average RSSI over FTM action frames reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3405) * @rssi_spread: spread of the RSSI over FTM action frames reported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3406) * @tx_rate: bitrate for transmitted FTM action frame response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3407) * @rx_rate: bitrate of received FTM action frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3408) * @rtt_avg: average of RTTs measured (must have either this or @dist_avg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3409) * @rtt_variance: variance of RTTs measured (note that standard deviation is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3410) * the square root of the variance)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3411) * @rtt_spread: spread of the RTTs measured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3412) * @dist_avg: average of distances (mm) measured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3413) * (must have either this or @rtt_avg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3414) * @dist_variance: variance of distances measured (see also @rtt_variance)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3415) * @dist_spread: spread of distances measured (see also @rtt_spread)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3416) * @num_ftmr_attempts_valid: @num_ftmr_attempts is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3417) * @num_ftmr_successes_valid: @num_ftmr_successes is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3418) * @rssi_avg_valid: @rssi_avg is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3419) * @rssi_spread_valid: @rssi_spread is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3420) * @tx_rate_valid: @tx_rate is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3421) * @rx_rate_valid: @rx_rate is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3422) * @rtt_avg_valid: @rtt_avg is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3423) * @rtt_variance_valid: @rtt_variance is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3424) * @rtt_spread_valid: @rtt_spread is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3425) * @dist_avg_valid: @dist_avg is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3426) * @dist_variance_valid: @dist_variance is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3427) * @dist_spread_valid: @dist_spread is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3428) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3429) struct cfg80211_pmsr_ftm_result {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3430) const u8 *lci;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3431) const u8 *civicloc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3432) unsigned int lci_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3433) unsigned int civicloc_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3434) enum nl80211_peer_measurement_ftm_failure_reasons failure_reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3435) u32 num_ftmr_attempts, num_ftmr_successes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3436) s16 burst_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3437) u8 busy_retry_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3438) u8 num_bursts_exp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3439) u8 burst_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3440) u8 ftms_per_burst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3441) s32 rssi_avg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3442) s32 rssi_spread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3443) struct rate_info tx_rate, rx_rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3444) s64 rtt_avg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3445) s64 rtt_variance;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3446) s64 rtt_spread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3447) s64 dist_avg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3448) s64 dist_variance;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3449) s64 dist_spread;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3450)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3451) u16 num_ftmr_attempts_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3452) num_ftmr_successes_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3453) rssi_avg_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3454) rssi_spread_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3455) tx_rate_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3456) rx_rate_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3457) rtt_avg_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3458) rtt_variance_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3459) rtt_spread_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3460) dist_avg_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3461) dist_variance_valid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3462) dist_spread_valid:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3463)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3464) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3465) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3466)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3467) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3468) * struct cfg80211_pmsr_result - peer measurement result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3469) * @addr: address of the peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3470) * @host_time: host time (use ktime_get_boottime() adjust to the time when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3471) * measurement was made)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3472) * @ap_tsf: AP's TSF at measurement time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3473) * @status: status of the measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3474) * @final: if reporting partial results, mark this as the last one; if not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3475) * reporting partial results always set this flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3476) * @ap_tsf_valid: indicates the @ap_tsf value is valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3477) * @type: type of the measurement reported, note that we only support reporting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3478) * one type at a time, but you can report multiple results separately and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3479) * they're all aggregated for userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3480) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3481) struct cfg80211_pmsr_result {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3482) u64 host_time, ap_tsf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3483) enum nl80211_peer_measurement_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3484)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3485) u8 addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3486)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3487) u8 final:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3488) ap_tsf_valid:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3489)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3490) enum nl80211_peer_measurement_type type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3492) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3493) struct cfg80211_pmsr_ftm_result ftm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3494) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3495) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3496)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3497) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3498) * struct cfg80211_pmsr_ftm_request_peer - FTM request data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3499) * @requested: indicates FTM is requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3500) * @preamble: frame preamble to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3501) * @burst_period: burst period to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3502) * @asap: indicates to use ASAP mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3503) * @num_bursts_exp: number of bursts exponent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3504) * @burst_duration: burst duration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3505) * @ftms_per_burst: number of FTMs per burst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3506) * @ftmr_retries: number of retries for FTM request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3507) * @request_lci: request LCI information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3508) * @request_civicloc: request civic location information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3509) * @trigger_based: use trigger based ranging for the measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3510) * If neither @trigger_based nor @non_trigger_based is set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3511) * EDCA based ranging will be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3512) * @non_trigger_based: use non trigger based ranging for the measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3513) * If neither @trigger_based nor @non_trigger_based is set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3514) * EDCA based ranging will be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3515) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3516) * See also nl80211 for the respective attribute documentation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3517) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3518) struct cfg80211_pmsr_ftm_request_peer {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3519) enum nl80211_preamble preamble;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3520) u16 burst_period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3521) u8 requested:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3522) asap:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3523) request_lci:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3524) request_civicloc:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3525) trigger_based:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3526) non_trigger_based:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3527) u8 num_bursts_exp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3528) u8 burst_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3529) u8 ftms_per_burst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3530) u8 ftmr_retries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3531) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3532)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3533) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3534) * struct cfg80211_pmsr_request_peer - peer data for a peer measurement request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3535) * @addr: MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3536) * @chandef: channel to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3537) * @report_ap_tsf: report the associated AP's TSF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3538) * @ftm: FTM data, see &struct cfg80211_pmsr_ftm_request_peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3539) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3540) struct cfg80211_pmsr_request_peer {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3541) u8 addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3542) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3543) u8 report_ap_tsf:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3544) struct cfg80211_pmsr_ftm_request_peer ftm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3545) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3546)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3547) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3548) * struct cfg80211_pmsr_request - peer measurement request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3549) * @cookie: cookie, set by cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3550) * @nl_portid: netlink portid - used by cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3551) * @drv_data: driver data for this request, if required for aborting,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3552) * not otherwise freed or anything by cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3553) * @mac_addr: MAC address used for (randomised) request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3554) * @mac_addr_mask: MAC address mask used for randomisation, bits that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3555) * are 0 in the mask should be randomised, bits that are 1 should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3556) * be taken from the @mac_addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3557) * @list: used by cfg80211 to hold on to the request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3558) * @timeout: timeout (in milliseconds) for the whole operation, if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3559) * zero it means there's no timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3560) * @n_peers: number of peers to do measurements with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3561) * @peers: per-peer measurement request data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3562) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3563) struct cfg80211_pmsr_request {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3564) u64 cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3565) void *drv_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3566) u32 n_peers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3567) u32 nl_portid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3568)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3569) u32 timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3570)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3571) u8 mac_addr[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3572) u8 mac_addr_mask[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3573)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3574) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3575)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3576) struct cfg80211_pmsr_request_peer peers[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3577) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3578)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3579) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3580) * struct cfg80211_update_owe_info - OWE Information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3581) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3582) * This structure provides information needed for the drivers to offload OWE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3583) * (Opportunistic Wireless Encryption) processing to the user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3584) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3585) * Commonly used across update_owe_info request and event interfaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3586) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3587) * @peer: MAC address of the peer device for which the OWE processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3588) * has to be done.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3589) * @status: status code, %WLAN_STATUS_SUCCESS for successful OWE info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3590) * processing, use %WLAN_STATUS_UNSPECIFIED_FAILURE if user space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3591) * cannot give you the real status code for failures. Used only for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3592) * OWE update request command interface (user space to driver).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3593) * @ie: IEs obtained from the peer or constructed by the user space. These are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3594) * the IEs of the remote peer in the event from the host driver and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3595) * the constructed IEs by the user space in the request interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3596) * @ie_len: Length of IEs in octets.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3597) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3598) struct cfg80211_update_owe_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3599) u8 peer[ETH_ALEN] __aligned(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3600) u16 status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3601) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3602) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3603) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3604)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3605) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3606) * struct mgmt_frame_regs - management frame registrations data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3607) * @global_stypes: bitmap of management frame subtypes registered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3608) * for the entire device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3609) * @interface_stypes: bitmap of management frame subtypes registered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3610) * for the given interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3611) * @global_mcast_rx: mcast RX is needed globally for these subtypes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3612) * @interface_mcast_stypes: mcast RX is needed on this interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3613) * for these subtypes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3614) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3615) struct mgmt_frame_regs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3616) u32 global_stypes, interface_stypes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3617) u32 global_mcast_stypes, interface_mcast_stypes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3618) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3619)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3620) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3621) * struct cfg80211_ops - backend description for wireless configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3622) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3623) * This struct is registered by fullmac card drivers and/or wireless stacks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3624) * in order to handle configuration requests on their interfaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3625) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3626) * All callbacks except where otherwise noted should return 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3627) * on success or a negative error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3628) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3629) * All operations are currently invoked under rtnl for consistency with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3630) * wireless extensions but this is subject to reevaluation as soon as this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3631) * code is used more widely and we have a first user without wext.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3632) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3633) * @suspend: wiphy device needs to be suspended. The variable @wow will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3634) * be %NULL or contain the enabled Wake-on-Wireless triggers that are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3635) * configured for the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3636) * @resume: wiphy device needs to be resumed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3637) * @set_wakeup: Called when WoWLAN is enabled/disabled, use this callback
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3638) * to call device_set_wakeup_enable() to enable/disable wakeup from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3639) * the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3640) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3641) * @add_virtual_intf: create a new virtual interface with the given name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3642) * must set the struct wireless_dev's iftype. Beware: You must create
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3643) * the new netdev in the wiphy's network namespace! Returns the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3644) * wireless_dev, or an ERR_PTR. For P2P device wdevs, the driver must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3645) * also set the address member in the wdev.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3646) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3647) * @del_virtual_intf: remove the virtual interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3648) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3649) * @change_virtual_intf: change type/configuration of virtual interface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3650) * keep the struct wireless_dev's iftype updated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3651) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3652) * @add_key: add a key with the given parameters. @mac_addr will be %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3653) * when adding a group key.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3654) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3655) * @get_key: get information about the key with the given parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3656) * @mac_addr will be %NULL when requesting information for a group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3657) * key. All pointers given to the @callback function need not be valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3658) * after it returns. This function should return an error if it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3659) * not possible to retrieve the key, -ENOENT if it doesn't exist.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3660) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3661) * @del_key: remove a key given the @mac_addr (%NULL for a group key)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3662) * and @key_index, return -ENOENT if the key doesn't exist.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3663) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3664) * @set_default_key: set the default key on an interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3665) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3666) * @set_default_mgmt_key: set the default management frame key on an interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3667) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3668) * @set_default_beacon_key: set the default Beacon frame key on an interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3669) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3670) * @set_rekey_data: give the data necessary for GTK rekeying to the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3671) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3672) * @start_ap: Start acting in AP mode defined by the parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3673) * @change_beacon: Change the beacon parameters for an access point mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3674) * interface. This should reject the call when AP mode wasn't started.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3675) * @stop_ap: Stop being an AP, including stopping beaconing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3676) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3677) * @add_station: Add a new station.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3678) * @del_station: Remove a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3679) * @change_station: Modify a given station. Note that flags changes are not much
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3680) * validated in cfg80211, in particular the auth/assoc/authorized flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3681) * might come to the driver in invalid combinations -- make sure to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3682) * them, also against the existing state! Drivers must call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3683) * cfg80211_check_station_change() to validate the information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3684) * @get_station: get station information for the station identified by @mac
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3685) * @dump_station: dump station callback -- resume dump at index @idx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3686) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3687) * @add_mpath: add a fixed mesh path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3688) * @del_mpath: delete a given mesh path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3689) * @change_mpath: change a given mesh path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3690) * @get_mpath: get a mesh path for the given parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3691) * @dump_mpath: dump mesh path callback -- resume dump at index @idx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3692) * @get_mpp: get a mesh proxy path for the given parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3693) * @dump_mpp: dump mesh proxy path callback -- resume dump at index @idx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3694) * @join_mesh: join the mesh network with the specified parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3695) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3696) * @leave_mesh: leave the current mesh network
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3697) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3698) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3699) * @get_mesh_config: Get the current mesh configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3700) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3701) * @update_mesh_config: Update mesh parameters on a running mesh.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3702) * The mask is a bitfield which tells us which parameters to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3703) * set, and which to leave alone.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3704) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3705) * @change_bss: Modify parameters for a given BSS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3706) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3707) * @set_txq_params: Set TX queue parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3708) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3709) * @libertas_set_mesh_channel: Only for backward compatibility for libertas,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3710) * as it doesn't implement join_mesh and needs to set the channel to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3711) * join the mesh instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3712) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3713) * @set_monitor_channel: Set the monitor mode channel for the device. If other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3714) * interfaces are active this callback should reject the configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3715) * If no interfaces are active or the device is down, the channel should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3716) * be stored for when a monitor interface becomes active.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3717) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3718) * @scan: Request to do a scan. If returning zero, the scan request is given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3719) * the driver, and will be valid until passed to cfg80211_scan_done().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3720) * For scan results, call cfg80211_inform_bss(); you can call this outside
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3721) * the scan/scan_done bracket too.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3722) * @abort_scan: Tell the driver to abort an ongoing scan. The driver shall
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3723) * indicate the status of the scan through cfg80211_scan_done().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3724) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3725) * @auth: Request to authenticate with the specified peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3726) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3727) * @assoc: Request to (re)associate with the specified peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3728) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3729) * @deauth: Request to deauthenticate from the specified peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3730) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3731) * @disassoc: Request to disassociate from the specified peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3732) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3733) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3734) * @connect: Connect to the ESS with the specified parameters. When connected,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3735) * call cfg80211_connect_result()/cfg80211_connect_bss() with status code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3736) * %WLAN_STATUS_SUCCESS. If the connection fails for some reason, call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3737) * cfg80211_connect_result()/cfg80211_connect_bss() with the status code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3738) * from the AP or cfg80211_connect_timeout() if no frame with status code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3739) * was received.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3740) * The driver is allowed to roam to other BSSes within the ESS when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3741) * other BSS matches the connect parameters. When such roaming is initiated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3742) * by the driver, the driver is expected to verify that the target matches
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3743) * the configured security parameters and to use Reassociation Request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3744) * frame instead of Association Request frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3745) * The connect function can also be used to request the driver to perform a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3746) * specific roam when connected to an ESS. In that case, the prev_bssid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3747) * parameter is set to the BSSID of the currently associated BSS as an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3748) * indication of requesting reassociation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3749) * In both the driver-initiated and new connect() call initiated roaming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3750) * cases, the result of roaming is indicated with a call to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3751) * cfg80211_roamed(). (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3752) * @update_connect_params: Update the connect parameters while connected to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3753) * BSS. The updated parameters can be used by driver/firmware for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3754) * subsequent BSS selection (roaming) decisions and to form the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3755) * Authentication/(Re)Association Request frames. This call does not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3756) * request an immediate disassociation or reassociation with the current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3757) * BSS, i.e., this impacts only subsequent (re)associations. The bits in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3758) * changed are defined in &enum cfg80211_connect_params_changed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3759) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3760) * @disconnect: Disconnect from the BSS/ESS or stop connection attempts if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3761) * connection is in progress. Once done, call cfg80211_disconnected() in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3762) * case connection was already established (invoked with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3763) * wireless_dev mutex held), otherwise call cfg80211_connect_timeout().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3764) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3765) * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3766) * cfg80211_ibss_joined(), also call that function when changing BSSID due
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3767) * to a merge.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3768) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3769) * @leave_ibss: Leave the IBSS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3770) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3771) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3772) * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3773) * MESH mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3774) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3775) * @set_wiphy_params: Notify that wiphy parameters have changed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3776) * @changed bitfield (see &enum wiphy_params_flags) describes which values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3777) * have changed. The actual parameter values are available in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3778) * struct wiphy. If returning an error, no value should be changed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3779) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3780) * @set_tx_power: set the transmit power according to the parameters,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3781) * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3782) * wdev may be %NULL if power was set for the wiphy, and will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3783) * always be %NULL unless the driver supports per-vif TX power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3784) * (as advertised by the nl80211 feature flag.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3785) * @get_tx_power: store the current TX power into the dbm variable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3786) * return 0 if successful
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3787) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3788) * @set_wds_peer: set the WDS peer for a WDS interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3789) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3790) * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3791) * functions to adjust rfkill hw state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3792) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3793) * @dump_survey: get site survey information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3794) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3795) * @remain_on_channel: Request the driver to remain awake on the specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3796) * channel for the specified duration to complete an off-channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3797) * operation (e.g., public action frame exchange). When the driver is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3798) * ready on the requested channel, it must indicate this with an event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3799) * notification by calling cfg80211_ready_on_channel().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3800) * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3801) * This allows the operation to be terminated prior to timeout based on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3802) * the duration value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3803) * @mgmt_tx: Transmit a management frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3804) * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3805) * frame on another channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3806) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3807) * @testmode_cmd: run a test mode command; @wdev may be %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3808) * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3809) * used by the function, but 0 and 1 must not be touched. Additionally,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3810) * return error codes other than -ENOBUFS and -ENOENT will terminate the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3811) * dump and return to userspace with an error, so be careful. If any data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3812) * was passed in from userspace then the data/len arguments will be present
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3813) * and point to the data contained in %NL80211_ATTR_TESTDATA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3814) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3815) * @set_bitrate_mask: set the bitrate mask configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3816) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3817) * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3818) * devices running firmwares capable of generating the (re) association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3819) * RSN IE. It allows for faster roaming between WPA2 BSSIDs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3820) * @del_pmksa: Delete a cached PMKID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3821) * @flush_pmksa: Flush all cached PMKIDs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3822) * @set_power_mgmt: Configure WLAN power management. A timeout value of -1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3823) * allows the driver to adjust the dynamic ps timeout value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3824) * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3825) * After configuration, the driver should (soon) send an event indicating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3826) * the current level is above/below the configured threshold; this may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3827) * need some care when the configuration is changed (without first being
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3828) * disabled.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3829) * @set_cqm_rssi_range_config: Configure two RSSI thresholds in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3830) * connection quality monitor. An event is to be sent only when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3831) * signal level is found to be outside the two values. The driver should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3832) * set %NL80211_EXT_FEATURE_CQM_RSSI_LIST if this method is implemented.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3833) * If it is provided then there's no point providing @set_cqm_rssi_config.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3834) * @set_cqm_txe_config: Configure connection quality monitor TX error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3835) * thresholds.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3836) * @sched_scan_start: Tell the driver to start a scheduled scan.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3837) * @sched_scan_stop: Tell the driver to stop an ongoing scheduled scan with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3838) * given request id. This call must stop the scheduled scan and be ready
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3839) * for starting a new one before it returns, i.e. @sched_scan_start may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3840) * called immediately after that again and should not fail in that case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3841) * The driver should not call cfg80211_sched_scan_stopped() for a requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3842) * stop (when this method returns 0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3843) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3844) * @update_mgmt_frame_registrations: Notify the driver that management frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3845) * registrations were updated. The callback is allowed to sleep.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3846) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3847) * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3848) * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3849) * reject TX/RX mask combinations they cannot support by returning -EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3850) * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3851) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3852) * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3853) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3854) * @tdls_mgmt: Transmit a TDLS management frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3855) * @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3856) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3857) * @probe_client: probe an associated client, must return a cookie that it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3858) * later passes to cfg80211_probe_status().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3859) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3860) * @set_noack_map: Set the NoAck Map for the TIDs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3861) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3862) * @get_channel: Get the current operating channel for the virtual interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3863) * For monitor interfaces, it should return %NULL unless there's a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3864) * current monitoring channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3865) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3866) * @start_p2p_device: Start the given P2P device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3867) * @stop_p2p_device: Stop the given P2P device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3868) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3869) * @set_mac_acl: Sets MAC address control list in AP and P2P GO mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3870) * Parameters include ACL policy, an array of MAC address of stations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3871) * and the number of MAC addresses. If there is already a list in driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3872) * this new list replaces the existing one. Driver has to clear its ACL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3873) * when number of MAC addresses entries is passed as 0. Drivers which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3874) * advertise the support for MAC based ACL have to implement this callback.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3875) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3876) * @start_radar_detection: Start radar detection in the driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3877) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3878) * @end_cac: End running CAC, probably because a related CAC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3879) * was finished on another phy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3880) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3881) * @update_ft_ies: Provide updated Fast BSS Transition information to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3882) * driver. If the SME is in the driver/firmware, this information can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3883) * used in building Authentication and Reassociation Request frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3884) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3885) * @crit_proto_start: Indicates a critical protocol needs more link reliability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3886) * for a given duration (milliseconds). The protocol is provided so the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3887) * driver can take the most appropriate actions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3888) * @crit_proto_stop: Indicates critical protocol no longer needs increased link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3889) * reliability. This operation can not fail.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3890) * @set_coalesce: Set coalesce parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3891) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3892) * @channel_switch: initiate channel-switch procedure (with CSA). Driver is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3893) * responsible for veryfing if the switch is possible. Since this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3894) * inherently tricky driver may decide to disconnect an interface later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3895) * with cfg80211_stop_iface(). This doesn't mean driver can accept
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3896) * everything. It should do it's best to verify requests and reject them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3897) * as soon as possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3898) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3899) * @set_qos_map: Set QoS mapping information to the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3900) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3901) * @set_ap_chanwidth: Set the AP (including P2P GO) mode channel width for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3902) * given interface This is used e.g. for dynamic HT 20/40 MHz channel width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3903) * changes during the lifetime of the BSS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3904) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3905) * @add_tx_ts: validate (if admitted_time is 0) or add a TX TS to the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3906) * with the given parameters; action frame exchange has been handled by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3907) * userspace so this just has to modify the TX path to take the TS into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3908) * account.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3909) * If the admitted time is 0 just validate the parameters to make sure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3910) * the session can be created at all; it is valid to just always return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3911) * success for that but that may result in inefficient behaviour (handshake
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3912) * with the peer followed by immediate teardown when the addition is later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3913) * rejected)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3914) * @del_tx_ts: remove an existing TX TS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3915) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3916) * @join_ocb: join the OCB network with the specified parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3917) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3918) * @leave_ocb: leave the current OCB network
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3919) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3920) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3921) * @tdls_channel_switch: Start channel-switching with a TDLS peer. The driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3922) * is responsible for continually initiating channel-switching operations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3923) * and returning to the base channel for communication with the AP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3924) * @tdls_cancel_channel_switch: Stop channel-switching with a TDLS peer. Both
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3925) * peers must be on the base channel when the call completes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3926) * @start_nan: Start the NAN interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3927) * @stop_nan: Stop the NAN interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3928) * @add_nan_func: Add a NAN function. Returns negative value on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3929) * On success @nan_func ownership is transferred to the driver and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3930) * it may access it outside of the scope of this function. The driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3931) * should free the @nan_func when no longer needed by calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3932) * cfg80211_free_nan_func().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3933) * On success the driver should assign an instance_id in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3934) * provided @nan_func.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3935) * @del_nan_func: Delete a NAN function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3936) * @nan_change_conf: changes NAN configuration. The changed parameters must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3937) * be specified in @changes (using &enum cfg80211_nan_conf_changes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3938) * All other parameters must be ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3939) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3940) * @set_multicast_to_unicast: configure multicast to unicast conversion for BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3941) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3942) * @get_txq_stats: Get TXQ stats for interface or phy. If wdev is %NULL, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3943) * function should return phy stats, and interface stats otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3944) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3945) * @set_pmk: configure the PMK to be used for offloaded 802.1X 4-Way handshake.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3946) * If not deleted through @del_pmk the PMK remains valid until disconnect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3947) * upon which the driver should clear it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3948) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3949) * @del_pmk: delete the previously configured PMK for the given authenticator.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3950) * (invoked with the wireless_dev mutex held)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3951) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3952) * @external_auth: indicates result of offloaded authentication processing from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3953) * user space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3954) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3955) * @tx_control_port: TX a control port frame (EAPoL). The noencrypt parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3956) * tells the driver that the frame should not be encrypted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3957) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3958) * @get_ftm_responder_stats: Retrieve FTM responder statistics, if available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3959) * Statistics should be cumulative, currently no way to reset is provided.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3960) * @start_pmsr: start peer measurement (e.g. FTM)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3961) * @abort_pmsr: abort peer measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3962) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3963) * @update_owe_info: Provide updated OWE info to driver. Driver implementing SME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3964) * but offloading OWE processing to the user space will get the updated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3965) * DH IE through this interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3966) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3967) * @probe_mesh_link: Probe direct Mesh peer's link quality by sending data frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3968) * and overrule HWMP path selection algorithm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3969) * @set_tid_config: TID specific configuration, this can be peer or BSS specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3970) * This callback may sleep.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3971) * @reset_tid_config: Reset TID specific configuration for the peer, for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3972) * given TIDs. This callback may sleep.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3973) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3974) struct cfg80211_ops {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3975) int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3976) int (*resume)(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3977) void (*set_wakeup)(struct wiphy *wiphy, bool enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3978)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3979) struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3980) const char *name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3981) unsigned char name_assign_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3982) enum nl80211_iftype type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3983) struct vif_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3984) int (*del_virtual_intf)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3985) struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3986) int (*change_virtual_intf)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3987) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3988) enum nl80211_iftype type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3989) struct vif_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3990)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3991) int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3992) u8 key_index, bool pairwise, const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3993) struct key_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3994) int (*get_key)(struct wiphy *wiphy, struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3995) u8 key_index, bool pairwise, const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3996) void *cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3997) void (*callback)(void *cookie, struct key_params*));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3998) int (*del_key)(struct wiphy *wiphy, struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3999) u8 key_index, bool pairwise, const u8 *mac_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4000) int (*set_default_key)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4001) struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4002) u8 key_index, bool unicast, bool multicast);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4003) int (*set_default_mgmt_key)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4004) struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4005) u8 key_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4006) int (*set_default_beacon_key)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4007) struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4008) u8 key_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4009)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4010) int (*start_ap)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4011) struct cfg80211_ap_settings *settings);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4012) int (*change_beacon)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4013) struct cfg80211_beacon_data *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4014) int (*stop_ap)(struct wiphy *wiphy, struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4015)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4016)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4017) int (*add_station)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4018) const u8 *mac,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4019) struct station_parameters *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4020) int (*del_station)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4021) struct station_del_parameters *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4022) int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4023) const u8 *mac,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4024) struct station_parameters *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4025) int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4026) const u8 *mac, struct station_info *sinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4027) int (*dump_station)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4028) int idx, u8 *mac, struct station_info *sinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4029)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4030) int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4031) const u8 *dst, const u8 *next_hop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4032) int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4033) const u8 *dst);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4034) int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4035) const u8 *dst, const u8 *next_hop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4036) int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4037) u8 *dst, u8 *next_hop, struct mpath_info *pinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4038) int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4039) int idx, u8 *dst, u8 *next_hop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4040) struct mpath_info *pinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4041) int (*get_mpp)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4042) u8 *dst, u8 *mpp, struct mpath_info *pinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4043) int (*dump_mpp)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4044) int idx, u8 *dst, u8 *mpp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4045) struct mpath_info *pinfo);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4046) int (*get_mesh_config)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4047) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4048) struct mesh_config *conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4049) int (*update_mesh_config)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4050) struct net_device *dev, u32 mask,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4051) const struct mesh_config *nconf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4052) int (*join_mesh)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4053) const struct mesh_config *conf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4054) const struct mesh_setup *setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4055) int (*leave_mesh)(struct wiphy *wiphy, struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4056)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4057) int (*join_ocb)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4058) struct ocb_setup *setup);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4059) int (*leave_ocb)(struct wiphy *wiphy, struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4060)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4061) int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4062) struct bss_parameters *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4063)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4064) int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4065) struct ieee80211_txq_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4066)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4067) int (*libertas_set_mesh_channel)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4068) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4069) struct ieee80211_channel *chan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4070)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4071) int (*set_monitor_channel)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4072) struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4073)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4074) int (*scan)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4075) struct cfg80211_scan_request *request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4076) void (*abort_scan)(struct wiphy *wiphy, struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4077)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4078) int (*auth)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4079) struct cfg80211_auth_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4080) int (*assoc)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4081) struct cfg80211_assoc_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4082) int (*deauth)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4083) struct cfg80211_deauth_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4084) int (*disassoc)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4085) struct cfg80211_disassoc_request *req);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4086)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4087) int (*connect)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4088) struct cfg80211_connect_params *sme);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4089) int (*update_connect_params)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4090) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4091) struct cfg80211_connect_params *sme,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4092) u32 changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4093) int (*disconnect)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4094) u16 reason_code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4095)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4096) int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4097) struct cfg80211_ibss_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4098) int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4099)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4100) int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4101) int rate[NUM_NL80211_BANDS]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4103) int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4105) int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4106) enum nl80211_tx_power_setting type, int mbm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4107) int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4108) int *dbm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4110) int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4111) const u8 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4113) void (*rfkill_poll)(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4115) #ifdef CONFIG_NL80211_TESTMODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4116) int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4117) void *data, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4118) int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4119) struct netlink_callback *cb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4120) void *data, int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4121) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4123) int (*set_bitrate_mask)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4124) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4125) const u8 *peer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4126) const struct cfg80211_bitrate_mask *mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4128) int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4129) int idx, struct survey_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4131) int (*set_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4132) struct cfg80211_pmksa *pmksa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4133) int (*del_pmksa)(struct wiphy *wiphy, struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4134) struct cfg80211_pmksa *pmksa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4135) int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4137) int (*remain_on_channel)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4138) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4139) struct ieee80211_channel *chan,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4140) unsigned int duration,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4141) u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4142) int (*cancel_remain_on_channel)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4143) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4144) u64 cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4146) int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4147) struct cfg80211_mgmt_tx_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4148) u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4149) int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4150) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4151) u64 cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4153) int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4154) bool enabled, int timeout);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4156) int (*set_cqm_rssi_config)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4157) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4158) s32 rssi_thold, u32 rssi_hyst);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4160) int (*set_cqm_rssi_range_config)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4161) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4162) s32 rssi_low, s32 rssi_high);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4164) int (*set_cqm_txe_config)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4165) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4166) u32 rate, u32 pkts, u32 intvl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4168) void (*update_mgmt_frame_registrations)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4169) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4170) struct mgmt_frame_regs *upd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4172) int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4173) int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4175) int (*sched_scan_start)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4176) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4177) struct cfg80211_sched_scan_request *request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4178) int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4179) u64 reqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4181) int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4182) struct cfg80211_gtk_rekey_data *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4184) int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4185) const u8 *peer, u8 action_code, u8 dialog_token,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4186) u16 status_code, u32 peer_capability,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4187) bool initiator, const u8 *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4188) int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4189) const u8 *peer, enum nl80211_tdls_operation oper);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4191) int (*probe_client)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4192) const u8 *peer, u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4194) int (*set_noack_map)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4195) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4196) u16 noack_map);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4198) int (*get_channel)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4199) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4200) struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4202) int (*start_p2p_device)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4203) struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4204) void (*stop_p2p_device)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4205) struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4207) int (*set_mac_acl)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4208) const struct cfg80211_acl_data *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4210) int (*start_radar_detection)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4211) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4212) struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4213) u32 cac_time_ms);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4214) void (*end_cac)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4215) struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4216) int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4217) struct cfg80211_update_ft_ies_params *ftie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4218) int (*crit_proto_start)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4219) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4220) enum nl80211_crit_proto_id protocol,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4221) u16 duration);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4222) void (*crit_proto_stop)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4223) struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4224) int (*set_coalesce)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4225) struct cfg80211_coalesce *coalesce);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4226)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4227) int (*channel_switch)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4228) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4229) struct cfg80211_csa_settings *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4231) int (*set_qos_map)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4232) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4233) struct cfg80211_qos_map *qos_map);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4235) int (*set_ap_chanwidth)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4236) struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4238) int (*add_tx_ts)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4239) u8 tsid, const u8 *peer, u8 user_prio,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4240) u16 admitted_time);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4241) int (*del_tx_ts)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4242) u8 tsid, const u8 *peer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4244) int (*tdls_channel_switch)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4245) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4246) const u8 *addr, u8 oper_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4247) struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4248) void (*tdls_cancel_channel_switch)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4249) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4250) const u8 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4251) int (*start_nan)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4252) struct cfg80211_nan_conf *conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4253) void (*stop_nan)(struct wiphy *wiphy, struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4254) int (*add_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4255) struct cfg80211_nan_func *nan_func);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4256) void (*del_nan_func)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4257) u64 cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4258) int (*nan_change_conf)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4259) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4260) struct cfg80211_nan_conf *conf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4261) u32 changes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4262)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4263) int (*set_multicast_to_unicast)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4264) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4265) const bool enabled);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4266)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4267) int (*get_txq_stats)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4268) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4269) struct cfg80211_txq_stats *txqstats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4270)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4271) int (*set_pmk)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4272) const struct cfg80211_pmk_conf *conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4273) int (*del_pmk)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4274) const u8 *aa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4275) int (*external_auth)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4276) struct cfg80211_external_auth_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4278) int (*tx_control_port)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4279) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4280) const u8 *buf, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4281) const u8 *dest, const __be16 proto,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4282) const bool noencrypt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4283) u64 *cookie);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4285) int (*get_ftm_responder_stats)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4286) struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4287) struct cfg80211_ftm_responder_stats *ftm_stats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4289) int (*start_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4290) struct cfg80211_pmsr_request *request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4291) void (*abort_pmsr)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4292) struct cfg80211_pmsr_request *request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4293) int (*update_owe_info)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4294) struct cfg80211_update_owe_info *owe_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4295) int (*probe_mesh_link)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4296) const u8 *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4297) int (*set_tid_config)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4298) struct cfg80211_tid_config *tid_conf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4299) int (*reset_tid_config)(struct wiphy *wiphy, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4300) const u8 *peer, u8 tids);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4301) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4302) ANDROID_KABI_RESERVE(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4303) ANDROID_KABI_RESERVE(3);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4304) ANDROID_KABI_RESERVE(4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4305) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4306)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4307) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4308) * wireless hardware and networking interfaces structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4309) * and registration/helper functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4310) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4311)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4312) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4313) * enum wiphy_flags - wiphy capability flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4314) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4315) * @WIPHY_FLAG_SPLIT_SCAN_6GHZ: if set to true, the scan request will be split
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4316) * into two, first for legacy bands and second for UHB.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4317) * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4318) * wiphy at all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4319) * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4320) * by default -- this flag will be set depending on the kernel's default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4321) * on wiphy_new(), but can be changed by the driver if it has a good
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4322) * reason to override the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4323) * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4324) * on a VLAN interface). This flag also serves an extra purpose of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4325) * supporting 4ADDR AP mode on devices which do not support AP/VLAN iftype.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4326) * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4327) * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4328) * control port protocol ethertype. The device also honours the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4329) * control_port_no_encrypt flag.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4330) * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4331) * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4332) * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4333) * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4334) * firmware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4335) * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4336) * @WIPHY_FLAG_SUPPORTS_TDLS: The device supports TDLS (802.11z) operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4337) * @WIPHY_FLAG_TDLS_EXTERNAL_SETUP: The device does not handle TDLS (802.11z)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4338) * link setup/discovery operations internally. Setup, discovery and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4339) * teardown packets should be sent through the @NL80211_CMD_TDLS_MGMT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4340) * command. When this flag is not set, @NL80211_CMD_TDLS_OPER should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4341) * used for asking the driver/firmware to perform a TDLS operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4342) * @WIPHY_FLAG_HAVE_AP_SME: device integrates AP SME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4343) * @WIPHY_FLAG_REPORTS_OBSS: the device will report beacons from other BSSes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4344) * when there are virtual interfaces in AP mode by calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4345) * cfg80211_report_obss_beacon().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4346) * @WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD: When operating as an AP, the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4347) * responds to probe-requests in hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4348) * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4349) * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4350) * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4351) * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4352) * beaconing mode (AP, IBSS, Mesh, ...).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4353) * @WIPHY_FLAG_HAS_STATIC_WEP: The device supports static WEP key installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4354) * before connection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4355) * @WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK: The device supports bigger kek and kck keys
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4356) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4357) enum wiphy_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4358) WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4359) /* use hole at 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4360) WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4361) WIPHY_FLAG_NETNS_OK = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4362) WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4363) WIPHY_FLAG_4ADDR_AP = BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4364) WIPHY_FLAG_4ADDR_STATION = BIT(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4365) WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4366) WIPHY_FLAG_IBSS_RSN = BIT(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4367) WIPHY_FLAG_MESH_AUTH = BIT(10),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4368) /* use hole at 11 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4369) /* use hole at 12 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4370) WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4371) WIPHY_FLAG_AP_UAPSD = BIT(14),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4372) WIPHY_FLAG_SUPPORTS_TDLS = BIT(15),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4373) WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(16),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4374) WIPHY_FLAG_HAVE_AP_SME = BIT(17),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4375) WIPHY_FLAG_REPORTS_OBSS = BIT(18),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4376) WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(19),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4377) WIPHY_FLAG_OFFCHAN_TX = BIT(20),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4378) WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4379) WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4380) WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4381) WIPHY_FLAG_HAS_STATIC_WEP = BIT(24),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4382) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4383)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4384) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4385) * struct ieee80211_iface_limit - limit on certain interface types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4386) * @max: maximum number of interfaces of these types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4387) * @types: interface types (bits)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4388) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4389) struct ieee80211_iface_limit {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4390) u16 max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4391) u16 types;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4392) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4394) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4395) * struct ieee80211_iface_combination - possible interface combination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4396) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4397) * With this structure the driver can describe which interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4398) * combinations it supports concurrently.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4399) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4400) * Examples:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4401) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4402) * 1. Allow #STA <= 1, #AP <= 1, matching BI, channels = 1, 2 total:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4403) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4404) * .. code-block:: c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4405) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4406) * struct ieee80211_iface_limit limits1[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4407) * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4408) * { .max = 1, .types = BIT(NL80211_IFTYPE_AP}, },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4409) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4410) * struct ieee80211_iface_combination combination1 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4411) * .limits = limits1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4412) * .n_limits = ARRAY_SIZE(limits1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4413) * .max_interfaces = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4414) * .beacon_int_infra_match = true,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4415) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4416) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4417) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4418) * 2. Allow #{AP, P2P-GO} <= 8, channels = 1, 8 total:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4419) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4420) * .. code-block:: c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4421) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4422) * struct ieee80211_iface_limit limits2[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4423) * { .max = 8, .types = BIT(NL80211_IFTYPE_AP) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4424) * BIT(NL80211_IFTYPE_P2P_GO), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4425) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4426) * struct ieee80211_iface_combination combination2 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4427) * .limits = limits2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4428) * .n_limits = ARRAY_SIZE(limits2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4429) * .max_interfaces = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4430) * .num_different_channels = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4431) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4432) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4433) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4434) * 3. Allow #STA <= 1, #{P2P-client,P2P-GO} <= 3 on two channels, 4 total.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4435) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4436) * This allows for an infrastructure connection and three P2P connections.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4437) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4438) * .. code-block:: c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4439) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4440) * struct ieee80211_iface_limit limits3[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4441) * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4442) * { .max = 3, .types = BIT(NL80211_IFTYPE_P2P_GO) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4443) * BIT(NL80211_IFTYPE_P2P_CLIENT), },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4444) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4445) * struct ieee80211_iface_combination combination3 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4446) * .limits = limits3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4447) * .n_limits = ARRAY_SIZE(limits3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4448) * .max_interfaces = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4449) * .num_different_channels = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4450) * };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4451) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4452) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4453) struct ieee80211_iface_combination {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4454) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4455) * @limits:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4456) * limits for the given interface types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4457) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4458) const struct ieee80211_iface_limit *limits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4459)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4460) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4461) * @num_different_channels:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4462) * can use up to this many different channels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4463) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4464) u32 num_different_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4465)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4466) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4467) * @max_interfaces:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4468) * maximum number of interfaces in total allowed in this group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4469) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4470) u16 max_interfaces;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4471)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4472) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4473) * @n_limits:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4474) * number of limitations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4475) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4476) u8 n_limits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4477)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4478) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4479) * @beacon_int_infra_match:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4480) * In this combination, the beacon intervals between infrastructure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4481) * and AP types must match. This is required only in special cases.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4482) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4483) bool beacon_int_infra_match;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4484)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4485) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4486) * @radar_detect_widths:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4487) * bitmap of channel widths supported for radar detection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4488) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4489) u8 radar_detect_widths;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4490)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4491) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4492) * @radar_detect_regions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4493) * bitmap of regions supported for radar detection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4494) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4495) u8 radar_detect_regions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4496)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4497) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4498) * @beacon_int_min_gcd:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4499) * This interface combination supports different beacon intervals.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4500) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4501) * = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4502) * all beacon intervals for different interface must be same.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4503) * > 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4504) * any beacon interval for the interface part of this combination AND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4505) * GCD of all beacon intervals from beaconing interfaces of this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4506) * combination must be greater or equal to this value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4507) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4508) u32 beacon_int_min_gcd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4509) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4510)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4511) struct ieee80211_txrx_stypes {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4512) u16 tx, rx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4513) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4514)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4515) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4516) * enum wiphy_wowlan_support_flags - WoWLAN support flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4517) * @WIPHY_WOWLAN_ANY: supports wakeup for the special "any"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4518) * trigger that keeps the device operating as-is and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4519) * wakes up the host on any activity, for example a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4520) * received packet that passed filtering; note that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4521) * packet should be preserved in that case
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4522) * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4523) * (see nl80211.h)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4524) * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4525) * @WIPHY_WOWLAN_SUPPORTS_GTK_REKEY: supports GTK rekeying while asleep
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4526) * @WIPHY_WOWLAN_GTK_REKEY_FAILURE: supports wakeup on GTK rekey failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4527) * @WIPHY_WOWLAN_EAP_IDENTITY_REQ: supports wakeup on EAP identity request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4528) * @WIPHY_WOWLAN_4WAY_HANDSHAKE: supports wakeup on 4-way handshake failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4529) * @WIPHY_WOWLAN_RFKILL_RELEASE: supports wakeup on RF-kill release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4530) * @WIPHY_WOWLAN_NET_DETECT: supports wakeup on network detection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4531) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4532) enum wiphy_wowlan_support_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4533) WIPHY_WOWLAN_ANY = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4534) WIPHY_WOWLAN_MAGIC_PKT = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4535) WIPHY_WOWLAN_DISCONNECT = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4536) WIPHY_WOWLAN_SUPPORTS_GTK_REKEY = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4537) WIPHY_WOWLAN_GTK_REKEY_FAILURE = BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4538) WIPHY_WOWLAN_EAP_IDENTITY_REQ = BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4539) WIPHY_WOWLAN_4WAY_HANDSHAKE = BIT(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4540) WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4541) WIPHY_WOWLAN_NET_DETECT = BIT(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4542) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4543)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4544) struct wiphy_wowlan_tcp_support {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4545) const struct nl80211_wowlan_tcp_data_token_feature *tok;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4546) u32 data_payload_max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4547) u32 data_interval_max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4548) u32 wake_payload_max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4549) bool seq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4550) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4551)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4552) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4553) * struct wiphy_wowlan_support - WoWLAN support data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4554) * @flags: see &enum wiphy_wowlan_support_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4555) * @n_patterns: number of supported wakeup patterns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4556) * (see nl80211.h for the pattern definition)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4557) * @pattern_max_len: maximum length of each pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4558) * @pattern_min_len: minimum length of each pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4559) * @max_pkt_offset: maximum Rx packet offset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4560) * @max_nd_match_sets: maximum number of matchsets for net-detect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4561) * similar, but not necessarily identical, to max_match_sets for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4562) * scheduled scans.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4563) * See &struct cfg80211_sched_scan_request.@match_sets for more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4564) * details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4565) * @tcp: TCP wakeup support information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4566) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4567) struct wiphy_wowlan_support {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4568) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4569) int n_patterns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4570) int pattern_max_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4571) int pattern_min_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4572) int max_pkt_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4573) int max_nd_match_sets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4574) const struct wiphy_wowlan_tcp_support *tcp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4575) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4576)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4577) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4578) * struct wiphy_coalesce_support - coalesce support data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4579) * @n_rules: maximum number of coalesce rules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4580) * @max_delay: maximum supported coalescing delay in msecs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4581) * @n_patterns: number of supported patterns in a rule
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4582) * (see nl80211.h for the pattern definition)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4583) * @pattern_max_len: maximum length of each pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4584) * @pattern_min_len: minimum length of each pattern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4585) * @max_pkt_offset: maximum Rx packet offset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4586) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4587) struct wiphy_coalesce_support {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4588) int n_rules;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4589) int max_delay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4590) int n_patterns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4591) int pattern_max_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4592) int pattern_min_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4593) int max_pkt_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4594) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4595)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4596) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4597) * enum wiphy_vendor_command_flags - validation flags for vendor commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4598) * @WIPHY_VENDOR_CMD_NEED_WDEV: vendor command requires wdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4599) * @WIPHY_VENDOR_CMD_NEED_NETDEV: vendor command requires netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4600) * @WIPHY_VENDOR_CMD_NEED_RUNNING: interface/wdev must be up & running
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4601) * (must be combined with %_WDEV or %_NETDEV)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4602) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4603) enum wiphy_vendor_command_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4604) WIPHY_VENDOR_CMD_NEED_WDEV = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4605) WIPHY_VENDOR_CMD_NEED_NETDEV = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4606) WIPHY_VENDOR_CMD_NEED_RUNNING = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4607) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4608)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4609) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4610) * enum wiphy_opmode_flag - Station's ht/vht operation mode information flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4611) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4612) * @STA_OPMODE_MAX_BW_CHANGED: Max Bandwidth changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4613) * @STA_OPMODE_SMPS_MODE_CHANGED: SMPS mode changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4614) * @STA_OPMODE_N_SS_CHANGED: max N_SS (number of spatial streams) changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4615) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4616) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4617) enum wiphy_opmode_flag {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4618) STA_OPMODE_MAX_BW_CHANGED = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4619) STA_OPMODE_SMPS_MODE_CHANGED = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4620) STA_OPMODE_N_SS_CHANGED = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4621) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4622)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4623) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4624) * struct sta_opmode_info - Station's ht/vht operation mode information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4625) * @changed: contains value from &enum wiphy_opmode_flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4626) * @smps_mode: New SMPS mode value from &enum nl80211_smps_mode of a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4627) * @bw: new max bandwidth value from &enum nl80211_chan_width of a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4628) * @rx_nss: new rx_nss value of a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4629) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4630)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4631) struct sta_opmode_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4632) u32 changed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4633) enum nl80211_smps_mode smps_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4634) enum nl80211_chan_width bw;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4635) u8 rx_nss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4636) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4637)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4638) #define VENDOR_CMD_RAW_DATA ((const struct nla_policy *)(long)(-ENODATA))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4639)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4640) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4641) * struct wiphy_vendor_command - vendor command definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4642) * @info: vendor command identifying information, as used in nl80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4643) * @flags: flags, see &enum wiphy_vendor_command_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4644) * @doit: callback for the operation, note that wdev is %NULL if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4645) * flags didn't ask for a wdev and non-%NULL otherwise; the data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4646) * pointer may be %NULL if userspace provided no data at all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4647) * @dumpit: dump callback, for transferring bigger/multiple items. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4648) * @storage points to cb->args[5], ie. is preserved over the multiple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4649) * dumpit calls.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4650) * @policy: policy pointer for attributes within %NL80211_ATTR_VENDOR_DATA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4651) * Set this to %VENDOR_CMD_RAW_DATA if no policy can be given and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4652) * attribute is just raw data (e.g. a firmware command).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4653) * @maxattr: highest attribute number in policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4654) * It's recommended to not have the same sub command with both @doit and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4655) * @dumpit, so that userspace can assume certain ones are get and others
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4656) * are used with dump requests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4657) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4658) struct wiphy_vendor_command {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4659) struct nl80211_vendor_cmd_info info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4660) u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4661) int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4662) const void *data, int data_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4663) int (*dumpit)(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4664) struct sk_buff *skb, const void *data, int data_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4665) unsigned long *storage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4666) const struct nla_policy *policy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4667) unsigned int maxattr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4668)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4669) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4670) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4671)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4672) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4673) * struct wiphy_iftype_ext_capab - extended capabilities per interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4674) * @iftype: interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4675) * @extended_capabilities: extended capabilities supported by the driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4676) * additional capabilities might be supported by userspace; these are the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4677) * 802.11 extended capabilities ("Extended Capabilities element") and are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4678) * in the same format as in the information element. See IEEE Std
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4679) * 802.11-2012 8.4.2.29 for the defined fields.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4680) * @extended_capabilities_mask: mask of the valid values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4681) * @extended_capabilities_len: length of the extended capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4682) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4683) struct wiphy_iftype_ext_capab {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4684) enum nl80211_iftype iftype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4685) const u8 *extended_capabilities;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4686) const u8 *extended_capabilities_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4687) u8 extended_capabilities_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4688) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4689)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4690) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4691) * struct cfg80211_pmsr_capabilities - cfg80211 peer measurement capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4692) * @max_peers: maximum number of peers in a single measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4693) * @report_ap_tsf: can report assoc AP's TSF for radio resource measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4694) * @randomize_mac_addr: can randomize MAC address for measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4695) * @ftm.supported: FTM measurement is supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4696) * @ftm.asap: ASAP-mode is supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4697) * @ftm.non_asap: non-ASAP-mode is supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4698) * @ftm.request_lci: can request LCI data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4699) * @ftm.request_civicloc: can request civic location data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4700) * @ftm.preambles: bitmap of preambles supported (&enum nl80211_preamble)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4701) * @ftm.bandwidths: bitmap of bandwidths supported (&enum nl80211_chan_width)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4702) * @ftm.max_bursts_exponent: maximum burst exponent supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4703) * (set to -1 if not limited; note that setting this will necessarily
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4704) * forbid using the value 15 to let the responder pick)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4705) * @ftm.max_ftms_per_burst: maximum FTMs per burst supported (set to 0 if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4706) * not limited)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4707) * @ftm.trigger_based: trigger based ranging measurement is supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4708) * @ftm.non_trigger_based: non trigger based ranging measurement is supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4709) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4710) struct cfg80211_pmsr_capabilities {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4711) unsigned int max_peers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4712) u8 report_ap_tsf:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4713) randomize_mac_addr:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4714)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4715) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4716) u32 preambles;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4717) u32 bandwidths;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4718) s8 max_bursts_exponent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4719) u8 max_ftms_per_burst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4720) u8 supported:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4721) asap:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4722) non_asap:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4723) request_lci:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4724) request_civicloc:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4725) trigger_based:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4726) non_trigger_based:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4727) } ftm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4728) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4729)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4730) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4731) * struct wiphy_iftype_akm_suites - This structure encapsulates supported akm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4732) * suites for interface types defined in @iftypes_mask. Each type in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4733) * @iftypes_mask must be unique across all instances of iftype_akm_suites.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4734) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4735) * @iftypes_mask: bitmask of interfaces types
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4736) * @akm_suites: points to an array of supported akm suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4737) * @n_akm_suites: number of supported AKM suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4738) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4739) struct wiphy_iftype_akm_suites {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4740) u16 iftypes_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4741) const u32 *akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4742) int n_akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4743) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4744)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4745) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4746) * struct wiphy - wireless hardware description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4747) * @reg_notifier: the driver's regulatory notification callback,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4748) * note that if your driver uses wiphy_apply_custom_regulatory()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4749) * the reg_notifier's request can be passed as NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4750) * @regd: the driver's regulatory domain, if one was requested via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4751) * the regulatory_hint() API. This can be used by the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4752) * on the reg_notifier() if it chooses to ignore future
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4753) * regulatory domain changes caused by other drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4754) * @signal_type: signal type reported in &struct cfg80211_bss.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4755) * @cipher_suites: supported cipher suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4756) * @n_cipher_suites: number of supported cipher suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4757) * @akm_suites: supported AKM suites. These are the default AKMs supported if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4758) * the supported AKMs not advertized for a specific interface type in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4759) * iftype_akm_suites.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4760) * @n_akm_suites: number of supported AKM suites
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4761) * @iftype_akm_suites: array of supported akm suites info per interface type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4762) * Note that the bits in @iftypes_mask inside this structure cannot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4763) * overlap (i.e. only one occurrence of each type is allowed across all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4764) * instances of iftype_akm_suites).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4765) * @num_iftype_akm_suites: number of interface types for which supported akm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4766) * suites are specified separately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4767) * @retry_short: Retry limit for short frames (dot11ShortRetryLimit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4768) * @retry_long: Retry limit for long frames (dot11LongRetryLimit)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4769) * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4770) * -1 = fragmentation disabled, only odd values >= 256 used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4771) * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4772) * @_net: the network namespace this wiphy currently lives in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4773) * @perm_addr: permanent MAC address of this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4774) * @addr_mask: If the device supports multiple MAC addresses by masking,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4775) * set this to a mask with variable bits set to 1, e.g. if the last
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4776) * four bits are variable then set it to 00-00-00-00-00-0f. The actual
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4777) * variable bits shall be determined by the interfaces added, with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4778) * interfaces not matching the mask being rejected to be brought up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4779) * @n_addresses: number of addresses in @addresses.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4780) * @addresses: If the device has more than one address, set this pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4781) * to a list of addresses (6 bytes each). The first one will be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4782) * by default for perm_addr. In this case, the mask should be set to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4783) * all-zeroes. In this case it is assumed that the device can handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4784) * the same number of arbitrary MAC addresses.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4785) * @registered: protects ->resume and ->suspend sysfs callbacks against
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4786) * unregister hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4787) * @debugfsdir: debugfs directory used for this wiphy (ieee80211/<wiphyname>).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4788) * It will be renamed automatically on wiphy renames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4789) * @dev: (virtual) struct device for this wiphy. The item in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4790) * /sys/class/ieee80211/ points to this. You need use set_wiphy_dev()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4791) * (see below).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4792) * @wext: wireless extension handlers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4793) * @priv: driver private data (sized according to wiphy_new() parameter)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4794) * @interface_modes: bitmask of interfaces types valid for this wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4795) * must be set by driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4796) * @iface_combinations: Valid interface combinations array, should not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4797) * list single interface types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4798) * @n_iface_combinations: number of entries in @iface_combinations array.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4799) * @software_iftypes: bitmask of software interface types, these are not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4800) * subject to any restrictions since they are purely managed in SW.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4801) * @flags: wiphy flags, see &enum wiphy_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4802) * @regulatory_flags: wiphy regulatory flags, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4803) * &enum ieee80211_regulatory_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4804) * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4805) * @ext_features: extended features advertised to nl80211, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4806) * &enum nl80211_ext_feature_index.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4807) * @bss_priv_size: each BSS struct has private data allocated with it,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4808) * this variable determines its size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4809) * @max_scan_ssids: maximum number of SSIDs the device can scan for in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4810) * any given scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4811) * @max_sched_scan_reqs: maximum number of scheduled scan requests that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4812) * the device can run concurrently.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4813) * @max_sched_scan_ssids: maximum number of SSIDs the device can scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4814) * for in any given scheduled scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4815) * @max_match_sets: maximum number of match sets the device can handle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4816) * when performing a scheduled scan, 0 if filtering is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4817) * supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4818) * @max_scan_ie_len: maximum length of user-controlled IEs device can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4819) * add to probe request frames transmitted during a scan, must not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4820) * include fixed IEs like supported rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4821) * @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4822) * scans
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4823) * @max_sched_scan_plans: maximum number of scan plans (scan interval and number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4824) * of iterations) for scheduled scan supported by the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4825) * @max_sched_scan_plan_interval: maximum interval (in seconds) for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4826) * single scan plan supported by the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4827) * @max_sched_scan_plan_iterations: maximum number of iterations for a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4828) * scan plan supported by the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4829) * @coverage_class: current coverage class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4830) * @fw_version: firmware version for ethtool reporting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4831) * @hw_version: hardware version for ethtool reporting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4832) * @max_num_pmkids: maximum number of PMKIDs supported by device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4833) * @privid: a pointer that drivers can use to identify if an arbitrary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4834) * wiphy is theirs, e.g. in global notifiers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4835) * @bands: information about bands/channels supported by this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4836) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4837) * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4838) * transmitted through nl80211, points to an array indexed by interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4839) * type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4840) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4841) * @available_antennas_tx: bitmap of antennas which are available to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4842) * configured as TX antennas. Antenna configuration commands will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4843) * rejected unless this or @available_antennas_rx is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4844) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4845) * @available_antennas_rx: bitmap of antennas which are available to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4846) * configured as RX antennas. Antenna configuration commands will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4847) * rejected unless this or @available_antennas_tx is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4848) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4849) * @probe_resp_offload:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4850) * Bitmap of supported protocols for probe response offloading.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4851) * See &enum nl80211_probe_resp_offload_support_attr. Only valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4852) * when the wiphy flag @WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD is set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4853) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4854) * @max_remain_on_channel_duration: Maximum time a remain-on-channel operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4855) * may request, if implemented.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4856) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4857) * @wowlan: WoWLAN support information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4858) * @wowlan_config: current WoWLAN configuration; this should usually not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4859) * used since access to it is necessarily racy, use the parameter passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4860) * to the suspend() operation instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4861) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4862) * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4863) * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4864) * If null, then none can be over-ridden.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4865) * @vht_capa_mod_mask: Specify what VHT capabilities can be over-ridden.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4866) * If null, then none can be over-ridden.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4867) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4868) * @wdev_list: the list of associated (virtual) interfaces; this list must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4869) * not be modified by the driver, but can be read with RTNL/RCU protection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4870) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4871) * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4872) * supports for ACL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4873) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4874) * @extended_capabilities: extended capabilities supported by the driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4875) * additional capabilities might be supported by userspace; these are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4876) * the 802.11 extended capabilities ("Extended Capabilities element")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4877) * and are in the same format as in the information element. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4878) * 802.11-2012 8.4.2.29 for the defined fields. These are the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4879) * extended capabilities to be used if the capabilities are not specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4880) * for a specific interface type in iftype_ext_capab.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4881) * @extended_capabilities_mask: mask of the valid values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4882) * @extended_capabilities_len: length of the extended capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4883) * @iftype_ext_capab: array of extended capabilities per interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4884) * @num_iftype_ext_capab: number of interface types for which extended
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4885) * capabilities are specified separately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4886) * @coalesce: packet coalescing support information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4887) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4888) * @vendor_commands: array of vendor commands supported by the hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4889) * @n_vendor_commands: number of vendor commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4890) * @vendor_events: array of vendor events supported by the hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4891) * @n_vendor_events: number of vendor events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4892) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4893) * @max_ap_assoc_sta: maximum number of associated stations supported in AP mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4894) * (including P2P GO) or 0 to indicate no such limit is advertised. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4895) * driver is allowed to advertise a theoretical limit that it can reach in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4896) * some cases, but may not always reach.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4897) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4898) * @max_num_csa_counters: Number of supported csa_counters in beacons
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4899) * and probe responses. This value should be set if the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4900) * wishes to limit the number of csa counters. Default (0) means
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4901) * infinite.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4902) * @bss_select_support: bitmask indicating the BSS selection criteria supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4903) * by the driver in the .connect() callback. The bit position maps to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4904) * attribute indices defined in &enum nl80211_bss_select_attr.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4905) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4906) * @nan_supported_bands: bands supported by the device in NAN mode, a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4907) * bitmap of &enum nl80211_band values. For instance, for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4908) * NL80211_BAND_2GHZ, bit 0 would be set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4909) * (i.e. BIT(NL80211_BAND_2GHZ)).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4910) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4911) * @txq_limit: configuration of internal TX queue frame limit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4912) * @txq_memory_limit: configuration internal TX queue memory limit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4913) * @txq_quantum: configuration of internal TX queue scheduler quantum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4914) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4915) * @tx_queue_len: allow setting transmit queue len for drivers not using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4916) * wake_tx_queue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4917) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4918) * @support_mbssid: can HW support association with nontransmitted AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4919) * @support_only_he_mbssid: don't parse MBSSID elements if it is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4920) * HE AP, in order to avoid compatibility issues.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4921) * @support_mbssid must be set for this to have any effect.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4922) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4923) * @pmsr_capa: peer measurement capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4924) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4925) * @tid_config_support: describes the per-TID config support that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4926) * device has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4927) * @tid_config_support.vif: bitmap of attributes (configurations)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4928) * supported by the driver for each vif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4929) * @tid_config_support.peer: bitmap of attributes (configurations)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4930) * supported by the driver for each peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4931) * @tid_config_support.max_retry: maximum supported retry count for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4932) * long/short retry configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4933) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4934) * @max_data_retry_count: maximum supported per TID retry count for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4935) * configuration through the %NL80211_TID_CONFIG_ATTR_RETRY_SHORT and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4936) * %NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4937) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4938) struct wiphy {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4939) /* assign these fields before you register the wiphy */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4940)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4941) u8 perm_addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4942) u8 addr_mask[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4943)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4944) struct mac_address *addresses;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4945)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4946) const struct ieee80211_txrx_stypes *mgmt_stypes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4947)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4948) const struct ieee80211_iface_combination *iface_combinations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4949) int n_iface_combinations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4950) u16 software_iftypes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4951)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4952) u16 n_addresses;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4953)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4954) /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4955) u16 interface_modes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4956)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4957) u16 max_acl_mac_addrs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4958)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4959) u32 flags, regulatory_flags, features;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4960) u8 ext_features[DIV_ROUND_UP(NUM_NL80211_EXT_FEATURES, 8)];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4961)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4962) u32 ap_sme_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4963)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4964) enum cfg80211_signal_type signal_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4965)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4966) int bss_priv_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4967) u8 max_scan_ssids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4968) u8 max_sched_scan_reqs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4969) u8 max_sched_scan_ssids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4970) u8 max_match_sets;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4971) u16 max_scan_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4972) u16 max_sched_scan_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4973) u32 max_sched_scan_plans;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4974) u32 max_sched_scan_plan_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4975) u32 max_sched_scan_plan_iterations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4976)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4977) int n_cipher_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4978) const u32 *cipher_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4979)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4980) int n_akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4981) const u32 *akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4982)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4983) const struct wiphy_iftype_akm_suites *iftype_akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4984) unsigned int num_iftype_akm_suites;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4985)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4986) u8 retry_short;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4987) u8 retry_long;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4988) u32 frag_threshold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4989) u32 rts_threshold;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4990) u8 coverage_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4991)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4992) char fw_version[ETHTOOL_FWVERS_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4993) u32 hw_version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4994)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4995) #ifdef CONFIG_PM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4996) const struct wiphy_wowlan_support *wowlan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4997) struct cfg80211_wowlan *wowlan_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4998) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4999)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5000) u16 max_remain_on_channel_duration;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5001)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5002) u8 max_num_pmkids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5003)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5004) u32 available_antennas_tx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5005) u32 available_antennas_rx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5006)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5007) u32 probe_resp_offload;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5008)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5009) const u8 *extended_capabilities, *extended_capabilities_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5010) u8 extended_capabilities_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5011)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5012) const struct wiphy_iftype_ext_capab *iftype_ext_capab;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5013) unsigned int num_iftype_ext_capab;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5014)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5015) const void *privid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5016)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5017) struct ieee80211_supported_band *bands[NUM_NL80211_BANDS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5018)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5019) void (*reg_notifier)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5020) struct regulatory_request *request);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5021)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5022) /* fields below are read-only, assigned by cfg80211 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5023)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5024) const struct ieee80211_regdomain __rcu *regd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5025)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5026) struct device dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5027)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5028) bool registered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5029)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5030) struct dentry *debugfsdir;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5031)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5032) const struct ieee80211_ht_cap *ht_capa_mod_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5033) const struct ieee80211_vht_cap *vht_capa_mod_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5034)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5035) struct list_head wdev_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5036)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5037) possible_net_t _net;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5038)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5039) #ifdef CONFIG_CFG80211_WEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5040) const struct iw_handler_def *wext;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5041) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5042)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5043) const struct wiphy_coalesce_support *coalesce;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5044)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5045) const struct wiphy_vendor_command *vendor_commands;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5046) const struct nl80211_vendor_cmd_info *vendor_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5047) int n_vendor_commands, n_vendor_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5048)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5049) u16 max_ap_assoc_sta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5050)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5051) u8 max_num_csa_counters;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5052)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5053) u32 bss_select_support;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5054)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5055) u8 nan_supported_bands;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5056)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5057) u32 txq_limit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5058) u32 txq_memory_limit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5059) u32 txq_quantum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5060)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5061) unsigned long tx_queue_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5062)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5063) u8 support_mbssid:1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5064) support_only_he_mbssid:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5065)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5066) const struct cfg80211_pmsr_capabilities *pmsr_capa;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5067)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5068) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5069) u64 peer, vif;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5070) u8 max_retry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5071) } tid_config_support;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5072)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5073) u8 max_data_retry_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5074)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5075) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5076)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5077) char priv[] __aligned(NETDEV_ALIGN);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5078) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5079)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5080) static inline struct net *wiphy_net(struct wiphy *wiphy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5081) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5082) return read_pnet(&wiphy->_net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5083) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5084)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5085) static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5086) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5087) write_pnet(&wiphy->_net, net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5088) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5089)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5090) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5091) * wiphy_priv - return priv from wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5092) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5093) * @wiphy: the wiphy whose priv pointer to return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5094) * Return: The priv of @wiphy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5095) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5096) static inline void *wiphy_priv(struct wiphy *wiphy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5097) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5098) BUG_ON(!wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5099) return &wiphy->priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5100) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5102) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5103) * priv_to_wiphy - return the wiphy containing the priv
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5104) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5105) * @priv: a pointer previously returned by wiphy_priv
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5106) * Return: The wiphy of @priv.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5107) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5108) static inline struct wiphy *priv_to_wiphy(void *priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5109) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5110) BUG_ON(!priv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5111) return container_of(priv, struct wiphy, priv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5112) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5113)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5114) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5115) * set_wiphy_dev - set device pointer for wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5116) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5117) * @wiphy: The wiphy whose device to bind
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5118) * @dev: The device to parent it to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5119) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5120) static inline void set_wiphy_dev(struct wiphy *wiphy, struct device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5122) wiphy->dev.parent = dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5123) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5125) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5126) * wiphy_dev - get wiphy dev pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5127) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5128) * @wiphy: The wiphy whose device struct to look up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5129) * Return: The dev of @wiphy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5130) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5131) static inline struct device *wiphy_dev(struct wiphy *wiphy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5132) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5133) return wiphy->dev.parent;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5134) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5136) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5137) * wiphy_name - get wiphy name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5138) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5139) * @wiphy: The wiphy whose name to return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5140) * Return: The name of @wiphy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5141) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5142) static inline const char *wiphy_name(const struct wiphy *wiphy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5143) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5144) return dev_name(&wiphy->dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5145) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5147) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5148) * wiphy_new_nm - create a new wiphy for use with cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5149) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5150) * @ops: The configuration operations for this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5151) * @sizeof_priv: The size of the private area to allocate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5152) * @requested_name: Request a particular name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5153) * NULL is valid value, and means use the default phy%d naming.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5154) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5155) * Create a new wiphy and associate the given operations with it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5156) * @sizeof_priv bytes are allocated for private use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5157) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5158) * Return: A pointer to the new wiphy. This pointer must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5159) * assigned to each netdev's ieee80211_ptr for proper operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5160) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5161) struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5162) const char *requested_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5164) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5165) * wiphy_new - create a new wiphy for use with cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5166) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5167) * @ops: The configuration operations for this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5168) * @sizeof_priv: The size of the private area to allocate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5169) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5170) * Create a new wiphy and associate the given operations with it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5171) * @sizeof_priv bytes are allocated for private use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5172) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5173) * Return: A pointer to the new wiphy. This pointer must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5174) * assigned to each netdev's ieee80211_ptr for proper operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5175) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5176) static inline struct wiphy *wiphy_new(const struct cfg80211_ops *ops,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5177) int sizeof_priv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5178) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5179) return wiphy_new_nm(ops, sizeof_priv, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5180) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5182) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5183) * wiphy_register - register a wiphy with cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5184) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5185) * @wiphy: The wiphy to register.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5186) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5187) * Return: A non-negative wiphy index or a negative error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5188) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5189) int wiphy_register(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5191) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5192) * wiphy_unregister - deregister a wiphy from cfg80211
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5193) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5194) * @wiphy: The wiphy to unregister.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5195) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5196) * After this call, no more requests can be made with this priv
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5197) * pointer, but the call may sleep to wait for an outstanding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5198) * request that is being handled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5199) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5200) void wiphy_unregister(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5202) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5203) * wiphy_free - free wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5204) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5205) * @wiphy: The wiphy to free
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5206) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5207) void wiphy_free(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5209) /* internal structs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5210) struct cfg80211_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5211) struct cfg80211_internal_bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5212) struct cfg80211_cached_keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5213) struct cfg80211_cqm_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5215) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5216) * struct wireless_dev - wireless device state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5217) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5218) * For netdevs, this structure must be allocated by the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5219) * that uses the ieee80211_ptr field in struct net_device (this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5220) * is intentional so it can be allocated along with the netdev.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5221) * It need not be registered then as netdev registration will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5222) * be intercepted by cfg80211 to see the new wireless device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5223) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5224) * For non-netdev uses, it must also be allocated by the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5225) * in response to the cfg80211 callbacks that require it, as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5226) * there's no netdev registration in that case it may not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5227) * allocated outside of callback operations that return it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5228) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5229) * @wiphy: pointer to hardware description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5230) * @iftype: interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5231) * @list: (private) Used to collect the interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5232) * @netdev: (private) Used to reference back to the netdev, may be %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5233) * @identifier: (private) Identifier used in nl80211 to identify this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5234) * wireless device if it has no netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5235) * @current_bss: (private) Used by the internal configuration code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5236) * @chandef: (private) Used by the internal configuration code to track
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5237) * the user-set channel definition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5238) * @preset_chandef: (private) Used by the internal configuration code to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5239) * track the channel to be used for AP later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5240) * @bssid: (private) Used by the internal configuration code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5241) * @ssid: (private) Used by the internal configuration code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5242) * @ssid_len: (private) Used by the internal configuration code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5243) * @mesh_id_len: (private) Used by the internal configuration code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5244) * @mesh_id_up_len: (private) Used by the internal configuration code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5245) * @wext: (private) Used by the internal wireless extensions compat code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5246) * @wext.ibss: (private) IBSS data part of wext handling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5247) * @wext.connect: (private) connection handling data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5248) * @wext.keys: (private) (WEP) key data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5249) * @wext.ie: (private) extra elements for association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5250) * @wext.ie_len: (private) length of extra elements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5251) * @wext.bssid: (private) selected network BSSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5252) * @wext.ssid: (private) selected network SSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5253) * @wext.default_key: (private) selected default key index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5254) * @wext.default_mgmt_key: (private) selected default management key index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5255) * @wext.prev_bssid: (private) previous BSSID for reassociation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5256) * @wext.prev_bssid_valid: (private) previous BSSID validity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5257) * @use_4addr: indicates 4addr mode is used on this interface, must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5258) * set by driver (if supported) on add_interface BEFORE registering the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5259) * netdev and may otherwise be used by driver read-only, will be update
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5260) * by cfg80211 on change_interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5261) * @mgmt_registrations: list of registrations for management frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5262) * @mgmt_registrations_need_update: mgmt registrations were updated,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5263) * need to propagate the update to the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5264) * @mtx: mutex used to lock data in this struct, may be used by drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5265) * and some API functions require it held
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5266) * @beacon_interval: beacon interval used on this device for transmitting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5267) * beacons, 0 when not valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5268) * @address: The address for this device, valid only if @netdev is %NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5269) * @is_running: true if this is a non-netdev device that has been started, e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5270) * the P2P Device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5271) * @cac_started: true if DFS channel availability check has been started
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5272) * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5273) * @cac_time_ms: CAC time in ms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5274) * @ps: powersave mode is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5275) * @ps_timeout: dynamic powersave timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5276) * @ap_unexpected_nlportid: (private) netlink port ID of application
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5277) * registered for unexpected class 3 frames (AP mode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5278) * @conn: (private) cfg80211 software SME connection state machine data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5279) * @connect_keys: (private) keys to set after connection is established
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5280) * @conn_bss_type: connecting/connected BSS type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5281) * @conn_owner_nlportid: (private) connection owner socket port ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5282) * @disconnect_wk: (private) auto-disconnect work
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5283) * @disconnect_bssid: (private) the BSSID to use for auto-disconnect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5284) * @ibss_fixed: (private) IBSS is using fixed BSSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5285) * @ibss_dfs_possible: (private) IBSS may change to a DFS channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5286) * @event_list: (private) list for internal event processing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5287) * @event_lock: (private) lock for event list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5288) * @owner_nlportid: (private) owner socket port ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5289) * @nl_owner_dead: (private) owner socket went away
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5290) * @cqm_config: (private) nl80211 RSSI monitor state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5291) * @pmsr_list: (private) peer measurement requests
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5292) * @pmsr_lock: (private) peer measurements requests/results lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5293) * @pmsr_free_wk: (private) peer measurements cleanup work
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5294) * @unprot_beacon_reported: (private) timestamp of last
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5295) * unprotected beacon report
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5296) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5297) struct wireless_dev {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5298) struct wiphy *wiphy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5299) enum nl80211_iftype iftype;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5301) /* the remainder of this struct should be private to cfg80211 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5302) struct list_head list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5303) struct net_device *netdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5304)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5305) u32 identifier;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5306)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5307) struct list_head mgmt_registrations;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5308) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5309) * ANDROID: mgmt_registrations_lock was restored to preserve ABI in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5310) * 5.10.77 due to backport of 09b1d5dc6ce1 ("cfg80211: fix management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5311) * registrations locking") but it is not used for anything so do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5312) * touch this variable!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5313) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5314) spinlock_t mgmt_registrations_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5315) u8 mgmt_registrations_need_update:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5316)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5317) struct mutex mtx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5319) bool use_4addr, is_running;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5320)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5321) u8 address[ETH_ALEN] __aligned(sizeof(u16));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5323) /* currently used for IBSS and SME - might be rearranged later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5324) u8 ssid[IEEE80211_MAX_SSID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5325) u8 ssid_len, mesh_id_len, mesh_id_up_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5326) struct cfg80211_conn *conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5327) struct cfg80211_cached_keys *connect_keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5328) enum ieee80211_bss_type conn_bss_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5329) u32 conn_owner_nlportid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5330)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5331) struct work_struct disconnect_wk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5332) u8 disconnect_bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5334) struct list_head event_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5335) spinlock_t event_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5337) struct cfg80211_internal_bss *current_bss; /* associated / joined */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5338) struct cfg80211_chan_def preset_chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5339) struct cfg80211_chan_def chandef;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5340)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5341) bool ibss_fixed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5342) bool ibss_dfs_possible;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5343)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5344) bool ps;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5345) int ps_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5347) int beacon_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5348)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5349) u32 ap_unexpected_nlportid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5351) u32 owner_nlportid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5352) bool nl_owner_dead;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5353)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5354) bool cac_started;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5355) unsigned long cac_start_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5356) unsigned int cac_time_ms;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5357)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5358) #ifdef CONFIG_CFG80211_WEXT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5359) /* wext data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5360) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5361) struct cfg80211_ibss_params ibss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5362) struct cfg80211_connect_params connect;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5363) struct cfg80211_cached_keys *keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5364) const u8 *ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5365) size_t ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5366) u8 bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5367) u8 prev_bssid[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5368) u8 ssid[IEEE80211_MAX_SSID_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5369) s8 default_key, default_mgmt_key;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5370) bool prev_bssid_valid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5371) } wext;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5372) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5373)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5374) struct cfg80211_cqm_config *cqm_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5375)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5376) struct list_head pmsr_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5377) spinlock_t pmsr_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5378) struct work_struct pmsr_free_wk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5379)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5380) unsigned long unprot_beacon_reported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5381)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5382) ANDROID_KABI_RESERVE(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5383) ANDROID_KABI_RESERVE(2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5384) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5385)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5386) static inline u8 *wdev_address(struct wireless_dev *wdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5387) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5388) if (wdev->netdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5389) return wdev->netdev->dev_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5390) return wdev->address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5391) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5392)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5393) static inline bool wdev_running(struct wireless_dev *wdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5394) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5395) if (wdev->netdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5396) return netif_running(wdev->netdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5397) return wdev->is_running;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5398) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5399)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5400) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5401) * wdev_priv - return wiphy priv from wireless_dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5402) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5403) * @wdev: The wireless device whose wiphy's priv pointer to return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5404) * Return: The wiphy priv of @wdev.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5405) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5406) static inline void *wdev_priv(struct wireless_dev *wdev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5407) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5408) BUG_ON(!wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5409) return wiphy_priv(wdev->wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5410) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5411)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5412) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5413) * DOC: Utility functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5414) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5415) * cfg80211 offers a number of utility functions that can be useful.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5416) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5417)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5418) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5419) * ieee80211_channel_equal - compare two struct ieee80211_channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5420) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5421) * @a: 1st struct ieee80211_channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5422) * @b: 2nd struct ieee80211_channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5423) * Return: true if center frequency of @a == @b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5424) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5425) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5426) ieee80211_channel_equal(struct ieee80211_channel *a,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5427) struct ieee80211_channel *b)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5428) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5429) return (a->center_freq == b->center_freq &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5430) a->freq_offset == b->freq_offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5431) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5432)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5433) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5434) * ieee80211_channel_to_khz - convert ieee80211_channel to frequency in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5435) * @chan: struct ieee80211_channel to convert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5436) * Return: The corresponding frequency (in KHz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5437) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5438) static inline u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5439) ieee80211_channel_to_khz(const struct ieee80211_channel *chan)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5440) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5441) return MHZ_TO_KHZ(chan->center_freq) + chan->freq_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5442) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5443)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5444) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5445) * ieee80211_s1g_channel_width - get allowed channel width from @chan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5446) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5447) * Only allowed for band NL80211_BAND_S1GHZ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5448) * @chan: channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5449) * Return: The allowed channel width for this center_freq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5450) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5451) enum nl80211_chan_width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5452) ieee80211_s1g_channel_width(const struct ieee80211_channel *chan);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5453)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5454) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5455) * ieee80211_channel_to_freq_khz - convert channel number to frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5456) * @chan: channel number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5457) * @band: band, necessary due to channel number overlap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5458) * Return: The corresponding frequency (in KHz), or 0 if the conversion failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5459) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5460) u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5462) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5463) * ieee80211_channel_to_frequency - convert channel number to frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5464) * @chan: channel number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5465) * @band: band, necessary due to channel number overlap
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5466) * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5467) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5468) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5469) ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5470) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5471) return KHZ_TO_MHZ(ieee80211_channel_to_freq_khz(chan, band));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5472) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5473)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5474) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5475) * ieee80211_freq_khz_to_channel - convert frequency to channel number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5476) * @freq: center frequency in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5477) * Return: The corresponding channel, or 0 if the conversion failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5478) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5479) int ieee80211_freq_khz_to_channel(u32 freq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5480)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5481) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5482) * ieee80211_frequency_to_channel - convert frequency to channel number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5483) * @freq: center frequency in MHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5484) * Return: The corresponding channel, or 0 if the conversion failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5485) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5486) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5487) ieee80211_frequency_to_channel(int freq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5488) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5489) return ieee80211_freq_khz_to_channel(MHZ_TO_KHZ(freq));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5490) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5492) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5493) * ieee80211_get_channel_khz - get channel struct from wiphy for specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5494) * frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5495) * @wiphy: the struct wiphy to get the channel for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5496) * @freq: the center frequency (in KHz) of the channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5497) * Return: The channel struct from @wiphy at @freq.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5498) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5499) struct ieee80211_channel *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5500) ieee80211_get_channel_khz(struct wiphy *wiphy, u32 freq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5501)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5502) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5503) * ieee80211_get_channel - get channel struct from wiphy for specified frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5504) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5505) * @wiphy: the struct wiphy to get the channel for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5506) * @freq: the center frequency (in MHz) of the channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5507) * Return: The channel struct from @wiphy at @freq.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5508) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5509) static inline struct ieee80211_channel *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5510) ieee80211_get_channel(struct wiphy *wiphy, int freq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5511) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5512) return ieee80211_get_channel_khz(wiphy, MHZ_TO_KHZ(freq));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5513) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5514)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5515) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5516) * cfg80211_channel_is_psc - Check if the channel is a 6 GHz PSC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5517) * @chan: control channel to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5518) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5519) * The Preferred Scanning Channels (PSC) are defined in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5520) * Draft IEEE P802.11ax/D5.0, 26.17.2.3.3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5521) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5522) static inline bool cfg80211_channel_is_psc(struct ieee80211_channel *chan)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5523) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5524) if (chan->band != NL80211_BAND_6GHZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5525) return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5526)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5527) return ieee80211_frequency_to_channel(chan->center_freq) % 16 == 5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5528) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5529)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5530) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5531) * ieee80211_get_response_rate - get basic rate for a given rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5532) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5533) * @sband: the band to look for rates in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5534) * @basic_rates: bitmap of basic rates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5535) * @bitrate: the bitrate for which to find the basic rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5536) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5537) * Return: The basic rate corresponding to a given bitrate, that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5538) * is the next lower bitrate contained in the basic rate map,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5539) * which is, for this function, given as a bitmap of indices of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5540) * rates in the band's bitrate table.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5541) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5542) struct ieee80211_rate *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5543) ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5544) u32 basic_rates, int bitrate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5545)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5546) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5547) * ieee80211_mandatory_rates - get mandatory rates for a given band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5548) * @sband: the band to look for rates in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5549) * @scan_width: width of the control channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5550) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5551) * This function returns a bitmap of the mandatory rates for the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5552) * band, bits are set according to the rate position in the bitrates array.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5553) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5554) u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5555) enum nl80211_bss_scan_width scan_width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5556)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5557) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5558) * Radiotap parsing functions -- for controlled injection support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5559) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5560) * Implemented in net/wireless/radiotap.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5561) * Documentation in Documentation/networking/radiotap-headers.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5562) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5563)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5564) struct radiotap_align_size {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5565) uint8_t align:4, size:4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5566) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5567)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5568) struct ieee80211_radiotap_namespace {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5569) const struct radiotap_align_size *align_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5570) int n_bits;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5571) uint32_t oui;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5572) uint8_t subns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5573) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5574)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5575) struct ieee80211_radiotap_vendor_namespaces {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5576) const struct ieee80211_radiotap_namespace *ns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5577) int n_ns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5578) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5579)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5580) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5581) * struct ieee80211_radiotap_iterator - tracks walk thru present radiotap args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5582) * @this_arg_index: index of current arg, valid after each successful call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5583) * to ieee80211_radiotap_iterator_next()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5584) * @this_arg: pointer to current radiotap arg; it is valid after each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5585) * call to ieee80211_radiotap_iterator_next() but also after
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5586) * ieee80211_radiotap_iterator_init() where it will point to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5587) * the beginning of the actual data portion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5588) * @this_arg_size: length of the current arg, for convenience
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5589) * @current_namespace: pointer to the current namespace definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5590) * (or internally %NULL if the current namespace is unknown)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5591) * @is_radiotap_ns: indicates whether the current namespace is the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5592) * radiotap namespace or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5593) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5594) * @_rtheader: pointer to the radiotap header we are walking through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5595) * @_max_length: length of radiotap header in cpu byte ordering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5596) * @_arg_index: next argument index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5597) * @_arg: next argument pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5598) * @_next_bitmap: internal pointer to next present u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5599) * @_bitmap_shifter: internal shifter for curr u32 bitmap, b0 set == arg present
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5600) * @_vns: vendor namespace definitions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5601) * @_next_ns_data: beginning of the next namespace's data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5602) * @_reset_on_ext: internal; reset the arg index to 0 when going to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5603) * next bitmap word
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5604) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5605) * Describes the radiotap parser state. Fields prefixed with an underscore
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5606) * must not be used by users of the parser, only by the parser internally.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5607) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5608)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5609) struct ieee80211_radiotap_iterator {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5610) struct ieee80211_radiotap_header *_rtheader;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5611) const struct ieee80211_radiotap_vendor_namespaces *_vns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5612) const struct ieee80211_radiotap_namespace *current_namespace;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5613)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5614) unsigned char *_arg, *_next_ns_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5615) __le32 *_next_bitmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5616)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5617) unsigned char *this_arg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5618) int this_arg_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5619) int this_arg_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5620)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5621) int is_radiotap_ns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5622)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5623) int _max_length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5624) int _arg_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5625) uint32_t _bitmap_shifter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5626) int _reset_on_ext;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5627) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5628)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5629) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5630) ieee80211_radiotap_iterator_init(struct ieee80211_radiotap_iterator *iterator,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5631) struct ieee80211_radiotap_header *radiotap_header,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5632) int max_length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5633) const struct ieee80211_radiotap_vendor_namespaces *vns);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5634)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5635) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5636) ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5637)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5638)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5639) extern const unsigned char rfc1042_header[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5640) extern const unsigned char bridge_tunnel_header[6];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5641)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5642) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5643) * ieee80211_get_hdrlen_from_skb - get header length from data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5644) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5645) * @skb: the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5646) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5647) * Given an skb with a raw 802.11 header at the data pointer this function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5648) * returns the 802.11 header length.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5649) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5650) * Return: The 802.11 header length in bytes (not including encryption
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5651) * headers). Or 0 if the data in the sk_buff is too short to contain a valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5652) * 802.11 header.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5653) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5654) unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5655)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5656) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5657) * ieee80211_hdrlen - get header length in bytes from frame control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5658) * @fc: frame control field in little-endian format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5659) * Return: The header length in bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5660) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5661) unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5662)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5663) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5664) * ieee80211_get_mesh_hdrlen - get mesh extension header length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5665) * @meshhdr: the mesh extension header, only the flags field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5666) * (first byte) will be accessed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5667) * Return: The length of the extension header, which is always at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5668) * least 6 bytes and at most 18 if address 5 and 6 are present.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5669) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5670) unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5671)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5672) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5673) * DOC: Data path helpers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5674) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5675) * In addition to generic utilities, cfg80211 also offers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5676) * functions that help implement the data path for devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5677) * that do not do the 802.11/802.3 conversion on the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5678) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5679)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5680) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5681) * ieee80211_data_to_8023_exthdr - convert an 802.11 data frame to 802.3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5682) * @skb: the 802.11 data frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5683) * @ehdr: pointer to a &struct ethhdr that will get the header, instead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5684) * of it being pushed into the SKB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5685) * @addr: the device MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5686) * @iftype: the virtual interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5687) * @data_offset: offset of payload after the 802.11 header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5688) * Return: 0 on success. Non-zero on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5689) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5690) int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5691) const u8 *addr, enum nl80211_iftype iftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5692) u8 data_offset, bool is_amsdu);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5693)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5694) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5695) * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5696) * @skb: the 802.11 data frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5697) * @addr: the device MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5698) * @iftype: the virtual interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5699) * Return: 0 on success. Non-zero on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5700) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5701) static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5702) enum nl80211_iftype iftype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5703) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5704) return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0, false);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5705) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5706)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5707) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5708) * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5709) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5710) * Decode an IEEE 802.11 A-MSDU and convert it to a list of 802.3 frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5711) * The @list will be empty if the decode fails. The @skb must be fully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5712) * header-less before being passed in here; it is freed in this function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5713) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5714) * @skb: The input A-MSDU frame without any headers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5715) * @list: The output list of 802.3 frames. It must be allocated and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5716) * initialized by the caller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5717) * @addr: The device MAC address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5718) * @iftype: The device interface type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5719) * @extra_headroom: The hardware extra headroom for SKBs in the @list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5720) * @check_da: DA to check in the inner ethernet header, or NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5721) * @check_sa: SA to check in the inner ethernet header, or NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5722) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5723) void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5724) const u8 *addr, enum nl80211_iftype iftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5725) const unsigned int extra_headroom,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5726) const u8 *check_da, const u8 *check_sa);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5727)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5728) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5729) * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5730) * @skb: the data frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5731) * @qos_map: Interworking QoS mapping or %NULL if not in use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5732) * Return: The 802.1p/1d tag.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5733) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5734) unsigned int cfg80211_classify8021d(struct sk_buff *skb,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5735) struct cfg80211_qos_map *qos_map);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5736)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5737) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5738) * cfg80211_find_elem_match - match information element and byte array in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5739) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5740) * @eid: element ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5741) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5742) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5743) * @match: byte array to match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5744) * @match_len: number of bytes in the match array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5745) * @match_offset: offset in the IE data where the byte array should match.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5746) * Note the difference to cfg80211_find_ie_match() which considers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5747) * the offset to start from the element ID byte, but here we take
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5748) * the data portion instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5749) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5750) * Return: %NULL if the element ID could not be found or if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5751) * the element is invalid (claims to be longer than the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5752) * data) or if the byte array doesn't match; otherwise return the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5753) * requested element struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5754) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5755) * Note: There are no checks on the element length other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5756) * having to fit into the given data and being large enough for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5757) * byte array to match.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5758) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5759) const struct element *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5760) cfg80211_find_elem_match(u8 eid, const u8 *ies, unsigned int len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5761) const u8 *match, unsigned int match_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5762) unsigned int match_offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5763)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5764) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5765) * cfg80211_find_ie_match - match information element and byte array in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5766) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5767) * @eid: element ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5768) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5769) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5770) * @match: byte array to match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5771) * @match_len: number of bytes in the match array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5772) * @match_offset: offset in the IE where the byte array should match.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5773) * If match_len is zero, this must also be set to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5774) * Otherwise this must be set to 2 or more, because the first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5775) * byte is the element id, which is already compared to eid, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5776) * the second byte is the IE length.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5777) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5778) * Return: %NULL if the element ID could not be found or if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5779) * the element is invalid (claims to be longer than the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5780) * data) or if the byte array doesn't match, or a pointer to the first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5781) * byte of the requested element, that is the byte containing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5782) * element ID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5783) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5784) * Note: There are no checks on the element length other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5785) * having to fit into the given data and being large enough for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5786) * byte array to match.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5787) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5788) static inline const u8 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5789) cfg80211_find_ie_match(u8 eid, const u8 *ies, unsigned int len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5790) const u8 *match, unsigned int match_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5791) unsigned int match_offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5792) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5793) /* match_offset can't be smaller than 2, unless match_len is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5794) * zero, in which case match_offset must be zero as well.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5795) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5796) if (WARN_ON((match_len && match_offset < 2) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5797) (!match_len && match_offset)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5798) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5799)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5800) return (void *)cfg80211_find_elem_match(eid, ies, len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5801) match, match_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5802) match_offset ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5803) match_offset - 2 : 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5804) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5805)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5806) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5807) * cfg80211_find_elem - find information element in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5808) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5809) * @eid: element ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5810) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5811) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5812) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5813) * Return: %NULL if the element ID could not be found or if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5814) * the element is invalid (claims to be longer than the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5815) * data) or if the byte array doesn't match; otherwise return the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5816) * requested element struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5817) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5818) * Note: There are no checks on the element length other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5819) * having to fit into the given data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5820) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5821) static inline const struct element *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5822) cfg80211_find_elem(u8 eid, const u8 *ies, int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5823) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5824) return cfg80211_find_elem_match(eid, ies, len, NULL, 0, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5825) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5826)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5827) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5828) * cfg80211_find_ie - find information element in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5829) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5830) * @eid: element ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5831) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5832) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5833) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5834) * Return: %NULL if the element ID could not be found or if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5835) * the element is invalid (claims to be longer than the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5836) * data), or a pointer to the first byte of the requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5837) * element, that is the byte containing the element ID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5838) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5839) * Note: There are no checks on the element length other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5840) * having to fit into the given data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5841) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5842) static inline const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5843) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5844) return cfg80211_find_ie_match(eid, ies, len, NULL, 0, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5845) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5846)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5847) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5848) * cfg80211_find_ext_elem - find information element with EID Extension in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5849) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5850) * @ext_eid: element ID Extension
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5851) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5852) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5853) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5854) * Return: %NULL if the etended element could not be found or if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5855) * the element is invalid (claims to be longer than the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5856) * data) or if the byte array doesn't match; otherwise return the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5857) * requested element struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5858) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5859) * Note: There are no checks on the element length other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5860) * having to fit into the given data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5861) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5862) static inline const struct element *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5863) cfg80211_find_ext_elem(u8 ext_eid, const u8 *ies, int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5864) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5865) return cfg80211_find_elem_match(WLAN_EID_EXTENSION, ies, len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5866) &ext_eid, 1, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5867) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5868)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5869) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5870) * cfg80211_find_ext_ie - find information element with EID Extension in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5871) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5872) * @ext_eid: element ID Extension
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5873) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5874) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5875) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5876) * Return: %NULL if the extended element ID could not be found or if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5877) * the element is invalid (claims to be longer than the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5878) * data), or a pointer to the first byte of the requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5879) * element, that is the byte containing the element ID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5880) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5881) * Note: There are no checks on the element length other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5882) * having to fit into the given data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5883) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5884) static inline const u8 *cfg80211_find_ext_ie(u8 ext_eid, const u8 *ies, int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5885) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5886) return cfg80211_find_ie_match(WLAN_EID_EXTENSION, ies, len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5887) &ext_eid, 1, 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5888) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5889)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5890) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5891) * cfg80211_find_vendor_elem - find vendor specific information element in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5892) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5893) * @oui: vendor OUI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5894) * @oui_type: vendor-specific OUI type (must be < 0xff), negative means any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5895) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5896) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5897) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5898) * Return: %NULL if the vendor specific element ID could not be found or if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5899) * element is invalid (claims to be longer than the given data); otherwise
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5900) * return the element structure for the requested element.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5901) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5902) * Note: There are no checks on the element length other than having to fit into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5903) * the given data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5904) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5905) const struct element *cfg80211_find_vendor_elem(unsigned int oui, int oui_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5906) const u8 *ies,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5907) unsigned int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5908)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5909) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5910) * cfg80211_find_vendor_ie - find vendor specific information element in data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5911) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5912) * @oui: vendor OUI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5913) * @oui_type: vendor-specific OUI type (must be < 0xff), negative means any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5914) * @ies: data consisting of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5915) * @len: length of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5916) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5917) * Return: %NULL if the vendor specific element ID could not be found or if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5918) * element is invalid (claims to be longer than the given data), or a pointer to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5919) * the first byte of the requested element, that is the byte containing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5920) * element ID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5921) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5922) * Note: There are no checks on the element length other than having to fit into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5923) * the given data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5924) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5925) static inline const u8 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5926) cfg80211_find_vendor_ie(unsigned int oui, int oui_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5927) const u8 *ies, unsigned int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5928) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5929) return (void *)cfg80211_find_vendor_elem(oui, oui_type, ies, len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5930) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5931)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5932) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5933) * cfg80211_send_layer2_update - send layer 2 update frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5934) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5935) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5936) * @addr: STA MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5937) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5938) * Wireless drivers can use this function to update forwarding tables in bridge
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5939) * devices upon STA association.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5940) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5941) void cfg80211_send_layer2_update(struct net_device *dev, const u8 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5942)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5943) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5944) * DOC: Regulatory enforcement infrastructure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5945) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5946) * TODO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5947) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5948)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5949) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5950) * regulatory_hint - driver hint to the wireless core a regulatory domain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5951) * @wiphy: the wireless device giving the hint (used only for reporting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5952) * conflicts)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5953) * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5954) * should be in. If @rd is set this should be NULL. Note that if you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5955) * set this to NULL you should still set rd->alpha2 to some accepted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5956) * alpha2.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5957) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5958) * Wireless drivers can use this function to hint to the wireless core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5959) * what it believes should be the current regulatory domain by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5960) * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5961) * domain should be in or by providing a completely build regulatory domain.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5962) * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5963) * for a regulatory domain structure for the respective country.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5964) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5965) * The wiphy must have been registered to cfg80211 prior to this call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5966) * For cfg80211 drivers this means you must first use wiphy_register(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5967) * for mac80211 drivers you must first use ieee80211_register_hw().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5968) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5969) * Drivers should check the return value, its possible you can get
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5970) * an -ENOMEM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5971) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5972) * Return: 0 on success. -ENOMEM.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5973) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5974) int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5975)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5976) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5977) * regulatory_set_wiphy_regd - set regdom info for self managed drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5978) * @wiphy: the wireless device we want to process the regulatory domain on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5979) * @rd: the regulatory domain informatoin to use for this wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5980) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5981) * Set the regulatory domain information for self-managed wiphys, only they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5982) * may use this function. See %REGULATORY_WIPHY_SELF_MANAGED for more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5983) * information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5984) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5985) * Return: 0 on success. -EINVAL, -EPERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5986) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5987) int regulatory_set_wiphy_regd(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5988) struct ieee80211_regdomain *rd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5989)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5990) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5991) * regulatory_set_wiphy_regd_sync_rtnl - set regdom for self-managed drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5992) * @wiphy: the wireless device we want to process the regulatory domain on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5993) * @rd: the regulatory domain information to use for this wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5994) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5995) * This functions requires the RTNL to be held and applies the new regdomain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5996) * synchronously to this wiphy. For more details see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5997) * regulatory_set_wiphy_regd().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5998) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5999) * Return: 0 on success. -EINVAL, -EPERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6000) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6001) int regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6002) struct ieee80211_regdomain *rd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6003)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6004) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6005) * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6006) * @wiphy: the wireless device we want to process the regulatory domain on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6007) * @regd: the custom regulatory domain to use for this wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6008) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6009) * Drivers can sometimes have custom regulatory domains which do not apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6010) * to a specific country. Drivers can use this to apply such custom regulatory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6011) * domains. This routine must be called prior to wiphy registration. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6012) * custom regulatory domain will be trusted completely and as such previous
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6013) * default channel settings will be disregarded. If no rule is found for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6014) * channel on the regulatory domain the channel will be disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6015) * Drivers using this for a wiphy should also set the wiphy flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6016) * REGULATORY_CUSTOM_REG or cfg80211 will set it for the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6017) * that called this helper.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6018) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6019) void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6020) const struct ieee80211_regdomain *regd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6021)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6022) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6023) * freq_reg_info - get regulatory information for the given frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6024) * @wiphy: the wiphy for which we want to process this rule for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6025) * @center_freq: Frequency in KHz for which we want regulatory information for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6026) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6027) * Use this function to get the regulatory rule for a specific frequency on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6028) * a given wireless device. If the device has a specific regulatory domain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6029) * it wants to follow we respect that unless a country IE has been received
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6030) * and processed already.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6031) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6032) * Return: A valid pointer, or, when an error occurs, for example if no rule
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6033) * can be found, the return value is encoded using ERR_PTR(). Use IS_ERR() to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6034) * check and PTR_ERR() to obtain the numeric return value. The numeric return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6035) * value will be -ERANGE if we determine the given center_freq does not even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6036) * have a regulatory rule for a frequency range in the center_freq's band.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6037) * See freq_in_rule_band() for our current definition of a band -- this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6038) * purely subjective and right now it's 802.11 specific.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6039) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6040) const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6041) u32 center_freq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6042)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6043) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6044) * reg_initiator_name - map regulatory request initiator enum to name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6045) * @initiator: the regulatory request initiator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6046) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6047) * You can use this to map the regulatory request initiator enum to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6048) * proper string representation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6049) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6050) const char *reg_initiator_name(enum nl80211_reg_initiator initiator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6051)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6052) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6053) * regulatory_pre_cac_allowed - check if pre-CAC allowed in the current regdom
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6054) * @wiphy: wiphy for which pre-CAC capability is checked.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6055) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6056) * Pre-CAC is allowed only in some regdomains (notable ETSI).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6057) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6058) bool regulatory_pre_cac_allowed(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6059)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6060) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6061) * DOC: Internal regulatory db functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6062) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6063) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6064)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6065) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6066) * reg_query_regdb_wmm - Query internal regulatory db for wmm rule
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6067) * Regulatory self-managed driver can use it to proactively
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6068) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6069) * @alpha2: the ISO/IEC 3166 alpha2 wmm rule to be queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6070) * @freq: the freqency(in MHz) to be queried.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6071) * @rule: pointer to store the wmm rule from the regulatory db.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6072) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6073) * Self-managed wireless drivers can use this function to query
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6074) * the internal regulatory database to check whether the given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6075) * ISO/IEC 3166 alpha2 country and freq have wmm rule limitations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6076) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6077) * Drivers should check the return value, its possible you can get
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6078) * an -ENODATA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6079) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6080) * Return: 0 on success. -ENODATA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6081) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6082) int reg_query_regdb_wmm(char *alpha2, int freq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6083) struct ieee80211_reg_rule *rule);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6084)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6085) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6086) * callbacks for asynchronous cfg80211 methods, notification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6087) * functions and BSS handling helpers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6088) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6089)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6090) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6091) * cfg80211_scan_done - notify that scan finished
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6092) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6093) * @request: the corresponding scan request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6094) * @info: information about the completed scan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6095) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6096) void cfg80211_scan_done(struct cfg80211_scan_request *request,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6097) struct cfg80211_scan_info *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6098)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6099) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6100) * cfg80211_sched_scan_results - notify that new scan results are available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6101) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6102) * @wiphy: the wiphy which got scheduled scan results
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6103) * @reqid: identifier for the related scheduled scan request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6104) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6105) void cfg80211_sched_scan_results(struct wiphy *wiphy, u64 reqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6107) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6108) * cfg80211_sched_scan_stopped - notify that the scheduled scan has stopped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6109) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6110) * @wiphy: the wiphy on which the scheduled scan stopped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6111) * @reqid: identifier for the related scheduled scan request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6112) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6113) * The driver can call this function to inform cfg80211 that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6114) * scheduled scan had to be stopped, for whatever reason. The driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6115) * is then called back via the sched_scan_stop operation when done.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6116) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6117) void cfg80211_sched_scan_stopped(struct wiphy *wiphy, u64 reqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6119) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6120) * cfg80211_sched_scan_stopped_rtnl - notify that the scheduled scan has stopped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6121) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6122) * @wiphy: the wiphy on which the scheduled scan stopped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6123) * @reqid: identifier for the related scheduled scan request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6124) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6125) * The driver can call this function to inform cfg80211 that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6126) * scheduled scan had to be stopped, for whatever reason. The driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6127) * is then called back via the sched_scan_stop operation when done.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6128) * This function should be called with rtnl locked.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6129) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6130) void cfg80211_sched_scan_stopped_rtnl(struct wiphy *wiphy, u64 reqid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6132) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6133) * cfg80211_inform_bss_frame_data - inform cfg80211 of a received BSS frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6134) * @wiphy: the wiphy reporting the BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6135) * @data: the BSS metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6136) * @mgmt: the management frame (probe response or beacon)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6137) * @len: length of the management frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6138) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6139) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6140) * This informs cfg80211 that BSS information was found and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6141) * the BSS should be updated/added.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6142) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6143) * Return: A referenced struct, must be released with cfg80211_put_bss()!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6144) * Or %NULL on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6145) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6146) struct cfg80211_bss * __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6147) cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6148) struct cfg80211_inform_bss *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6149) struct ieee80211_mgmt *mgmt, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6150) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6152) static inline struct cfg80211_bss * __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6153) cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6154) struct ieee80211_channel *rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6155) enum nl80211_bss_scan_width scan_width,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6156) struct ieee80211_mgmt *mgmt, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6157) s32 signal, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6158) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6159) struct cfg80211_inform_bss data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6160) .chan = rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6161) .scan_width = scan_width,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6162) .signal = signal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6163) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6165) return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6166) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6168) static inline struct cfg80211_bss * __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6169) cfg80211_inform_bss_frame(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6170) struct ieee80211_channel *rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6171) struct ieee80211_mgmt *mgmt, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6172) s32 signal, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6173) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6174) struct cfg80211_inform_bss data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6175) .chan = rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6176) .scan_width = NL80211_BSS_CHAN_WIDTH_20,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6177) .signal = signal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6178) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6180) return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6181) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6183) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6184) * cfg80211_gen_new_bssid - generate a nontransmitted BSSID for multi-BSSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6185) * @bssid: transmitter BSSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6186) * @max_bssid: max BSSID indicator, taken from Multiple BSSID element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6187) * @mbssid_index: BSSID index, taken from Multiple BSSID index element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6188) * @new_bssid: calculated nontransmitted BSSID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6189) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6190) static inline void cfg80211_gen_new_bssid(const u8 *bssid, u8 max_bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6191) u8 mbssid_index, u8 *new_bssid)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6192) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6193) u64 bssid_u64 = ether_addr_to_u64(bssid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6194) u64 mask = GENMASK_ULL(max_bssid - 1, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6195) u64 new_bssid_u64;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6197) new_bssid_u64 = bssid_u64 & ~mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6199) new_bssid_u64 |= ((bssid_u64 & mask) + mbssid_index) & mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6201) u64_to_ether_addr(new_bssid_u64, new_bssid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6202) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6204) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6205) * cfg80211_is_element_inherited - returns if element ID should be inherited
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6206) * @element: element to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6207) * @non_inherit_element: non inheritance element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6208) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6209) bool cfg80211_is_element_inherited(const struct element *element,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6210) const struct element *non_inherit_element);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6211)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6212) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6213) * cfg80211_merge_profile - merges a MBSSID profile if it is split between IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6214) * @ie: ies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6215) * @ielen: length of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6216) * @mbssid_elem: current MBSSID element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6217) * @sub_elem: current MBSSID subelement (profile)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6218) * @merged_ie: location of the merged profile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6219) * @max_copy_len: max merged profile length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6220) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6221) size_t cfg80211_merge_profile(const u8 *ie, size_t ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6222) const struct element *mbssid_elem,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6223) const struct element *sub_elem,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6224) u8 *merged_ie, size_t max_copy_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6226) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6227) * enum cfg80211_bss_frame_type - frame type that the BSS data came from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6228) * @CFG80211_BSS_FTYPE_UNKNOWN: driver doesn't know whether the data is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6229) * from a beacon or probe response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6230) * @CFG80211_BSS_FTYPE_BEACON: data comes from a beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6231) * @CFG80211_BSS_FTYPE_PRESP: data comes from a probe response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6232) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6233) enum cfg80211_bss_frame_type {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6234) CFG80211_BSS_FTYPE_UNKNOWN,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6235) CFG80211_BSS_FTYPE_BEACON,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6236) CFG80211_BSS_FTYPE_PRESP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6237) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6239) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6240) * cfg80211_inform_bss_data - inform cfg80211 of a new BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6241) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6242) * @wiphy: the wiphy reporting the BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6243) * @data: the BSS metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6244) * @ftype: frame type (if known)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6245) * @bssid: the BSSID of the BSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6246) * @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6247) * @capability: the capability field sent by the peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6248) * @beacon_interval: the beacon interval announced by the peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6249) * @ie: additional IEs sent by the peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6250) * @ielen: length of the additional IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6251) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6252) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6253) * This informs cfg80211 that BSS information was found and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6254) * the BSS should be updated/added.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6255) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6256) * Return: A referenced struct, must be released with cfg80211_put_bss()!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6257) * Or %NULL on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6258) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6259) struct cfg80211_bss * __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6260) cfg80211_inform_bss_data(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6261) struct cfg80211_inform_bss *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6262) enum cfg80211_bss_frame_type ftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6263) const u8 *bssid, u64 tsf, u16 capability,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6264) u16 beacon_interval, const u8 *ie, size_t ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6265) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6266)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6267) static inline struct cfg80211_bss * __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6268) cfg80211_inform_bss_width(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6269) struct ieee80211_channel *rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6270) enum nl80211_bss_scan_width scan_width,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6271) enum cfg80211_bss_frame_type ftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6272) const u8 *bssid, u64 tsf, u16 capability,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6273) u16 beacon_interval, const u8 *ie, size_t ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6274) s32 signal, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6275) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6276) struct cfg80211_inform_bss data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6277) .chan = rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6278) .scan_width = scan_width,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6279) .signal = signal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6280) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6281)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6282) return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6283) capability, beacon_interval, ie, ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6284) gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6285) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6287) static inline struct cfg80211_bss * __must_check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6288) cfg80211_inform_bss(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6289) struct ieee80211_channel *rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6290) enum cfg80211_bss_frame_type ftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6291) const u8 *bssid, u64 tsf, u16 capability,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6292) u16 beacon_interval, const u8 *ie, size_t ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6293) s32 signal, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6294) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6295) struct cfg80211_inform_bss data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6296) .chan = rx_channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6297) .scan_width = NL80211_BSS_CHAN_WIDTH_20,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6298) .signal = signal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6299) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6301) return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6302) capability, beacon_interval, ie, ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6303) gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6304) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6306) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6307) * cfg80211_get_bss - get a BSS reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6308) * @wiphy: the wiphy this BSS struct belongs to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6309) * @channel: the channel to search on (or %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6310) * @bssid: the desired BSSID (or %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6311) * @ssid: the desired SSID (or %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6312) * @ssid_len: length of the SSID (or 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6313) * @bss_type: type of BSS, see &enum ieee80211_bss_type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6314) * @privacy: privacy filter, see &enum ieee80211_privacy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6315) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6316) struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6317) struct ieee80211_channel *channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6318) const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6319) const u8 *ssid, size_t ssid_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6320) enum ieee80211_bss_type bss_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6321) enum ieee80211_privacy privacy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6322) static inline struct cfg80211_bss *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6323) cfg80211_get_ibss(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6324) struct ieee80211_channel *channel,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6325) const u8 *ssid, size_t ssid_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6326) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6327) return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6328) IEEE80211_BSS_TYPE_IBSS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6329) IEEE80211_PRIVACY_ANY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6330) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6331)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6332) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6333) * cfg80211_ref_bss - reference BSS struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6334) * @wiphy: the wiphy this BSS struct belongs to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6335) * @bss: the BSS struct to reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6336) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6337) * Increments the refcount of the given BSS struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6338) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6339) void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6340)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6341) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6342) * cfg80211_put_bss - unref BSS struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6343) * @wiphy: the wiphy this BSS struct belongs to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6344) * @bss: the BSS struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6345) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6346) * Decrements the refcount of the given BSS struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6347) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6348) void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6350) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6351) * cfg80211_unlink_bss - unlink BSS from internal data structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6352) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6353) * @bss: the bss to remove
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6354) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6355) * This function removes the given BSS from the internal data structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6356) * thereby making it no longer show up in scan results etc. Use this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6357) * function when you detect a BSS is gone. Normally BSSes will also time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6358) * out, so it is not necessary to use this function at all.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6359) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6360) void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6361)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6362) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6363) * cfg80211_bss_iter - iterate all BSS entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6364) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6365) * This function iterates over the BSS entries associated with the given wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6366) * and calls the callback for the iterated BSS. The iterator function is not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6367) * allowed to call functions that might modify the internal state of the BSS DB.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6368) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6369) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6370) * @chandef: if given, the iterator function will be called only if the channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6371) * of the currently iterated BSS is a subset of the given channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6372) * @iter: the iterator function to call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6373) * @iter_data: an argument to the iterator function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6374) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6375) void cfg80211_bss_iter(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6376) struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6377) void (*iter)(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6378) struct cfg80211_bss *bss,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6379) void *data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6380) void *iter_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6381)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6382) static inline enum nl80211_bss_scan_width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6383) cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6384) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6385) switch (chandef->width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6386) case NL80211_CHAN_WIDTH_5:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6387) return NL80211_BSS_CHAN_WIDTH_5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6388) case NL80211_CHAN_WIDTH_10:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6389) return NL80211_BSS_CHAN_WIDTH_10;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6390) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6391) return NL80211_BSS_CHAN_WIDTH_20;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6392) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6393) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6394)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6395) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6396) * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6397) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6398) * @buf: authentication frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6399) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6400) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6401) * This function is called whenever an authentication, disassociation or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6402) * deauthentication frame has been received and processed in station mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6403) * After being asked to authenticate via cfg80211_ops::auth() the driver must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6404) * call either this function or cfg80211_auth_timeout().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6405) * After being asked to associate via cfg80211_ops::assoc() the driver must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6406) * call either this function or cfg80211_auth_timeout().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6407) * While connected, the driver must calls this for received and processed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6408) * disassociation and deauthentication frames. If the frame couldn't be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6409) * because it was unprotected, the driver must call the function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6410) * cfg80211_rx_unprot_mlme_mgmt() instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6411) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6412) * This function may sleep. The caller must hold the corresponding wdev's mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6413) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6414) void cfg80211_rx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6415)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6416) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6417) * cfg80211_auth_timeout - notification of timed out authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6418) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6419) * @addr: The MAC address of the device with which the authentication timed out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6420) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6421) * This function may sleep. The caller must hold the corresponding wdev's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6422) * mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6423) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6424) void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6425)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6426) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6427) * cfg80211_rx_assoc_resp - notification of processed association response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6428) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6429) * @bss: the BSS that association was requested with, ownership of the pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6430) * moves to cfg80211 in this call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6431) * @buf: (Re)Association Response frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6432) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6433) * @uapsd_queues: bitmap of queues configured for uapsd. Same format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6434) * as the AC bitmap in the QoS info field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6435) * @req_ies: information elements from the (Re)Association Request frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6436) * @req_ies_len: length of req_ies data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6437) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6438) * After being asked to associate via cfg80211_ops::assoc() the driver must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6439) * call either this function or cfg80211_auth_timeout().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6440) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6441) * This function may sleep. The caller must hold the corresponding wdev's mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6442) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6443) void cfg80211_rx_assoc_resp(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6444) struct cfg80211_bss *bss,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6445) const u8 *buf, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6446) int uapsd_queues,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6447) const u8 *req_ies, size_t req_ies_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6448)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6449) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6450) * cfg80211_assoc_timeout - notification of timed out association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6451) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6452) * @bss: The BSS entry with which association timed out.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6453) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6454) * This function may sleep. The caller must hold the corresponding wdev's mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6455) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6456) void cfg80211_assoc_timeout(struct net_device *dev, struct cfg80211_bss *bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6457)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6458) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6459) * cfg80211_abandon_assoc - notify cfg80211 of abandoned association attempt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6460) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6461) * @bss: The BSS entry with which association was abandoned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6462) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6463) * Call this whenever - for reasons reported through other API, like deauth RX,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6464) * an association attempt was abandoned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6465) * This function may sleep. The caller must hold the corresponding wdev's mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6466) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6467) void cfg80211_abandon_assoc(struct net_device *dev, struct cfg80211_bss *bss);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6468)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6469) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6470) * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6471) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6472) * @buf: 802.11 frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6473) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6474) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6475) * This function is called whenever deauthentication has been processed in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6476) * station mode. This includes both received deauthentication frames and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6477) * locally generated ones. This function may sleep. The caller must hold the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6478) * corresponding wdev's mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6479) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6480) void cfg80211_tx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6481)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6482) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6483) * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6484) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6485) * @buf: received management frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6486) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6487) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6488) * This function is called whenever a received deauthentication or dissassoc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6489) * frame has been dropped in station mode because of MFP being used but the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6490) * frame was not protected. This is also used to notify reception of a Beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6491) * frame that was dropped because it did not include a valid MME MIC while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6492) * beacon protection was enabled (BIGTK configured in station mode).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6493) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6494) * This function may sleep.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6495) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6496) void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6497) const u8 *buf, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6498)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6499) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6500) * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6501) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6502) * @addr: The source MAC address of the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6503) * @key_type: The key type that the received frame used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6504) * @key_id: Key identifier (0..3). Can be -1 if missing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6505) * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6506) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6507) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6508) * This function is called whenever the local MAC detects a MIC failure in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6509) * received frame. This matches with MLME-MICHAELMICFAILURE.indication()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6510) * primitive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6511) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6512) void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6513) enum nl80211_key_type key_type, int key_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6514) const u8 *tsc, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6515)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6516) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6517) * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6518) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6519) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6520) * @bssid: the BSSID of the IBSS joined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6521) * @channel: the channel of the IBSS joined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6522) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6523) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6524) * This function notifies cfg80211 that the device joined an IBSS or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6525) * switched to a different BSSID. Before this function can be called,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6526) * either a beacon has to have been received from the IBSS, or one of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6527) * the cfg80211_inform_bss{,_frame} functions must have been called
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6528) * with the locally generated beacon -- this guarantees that there is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6529) * always a scan result for this IBSS. cfg80211 will handle the rest.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6530) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6531) void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6532) struct ieee80211_channel *channel, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6533)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6534) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6535) * cfg80211_notify_new_peer_candidate - notify cfg80211 of a new mesh peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6536) * candidate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6537) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6538) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6539) * @macaddr: the MAC address of the new candidate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6540) * @ie: information elements advertised by the peer candidate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6541) * @ie_len: length of the information elements buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6542) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6543) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6544) * This function notifies cfg80211 that the mesh peer candidate has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6545) * detected, most likely via a beacon or, less likely, via a probe response.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6546) * cfg80211 then sends a notification to userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6547) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6548) void cfg80211_notify_new_peer_candidate(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6549) const u8 *macaddr, const u8 *ie, u8 ie_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6550) int sig_dbm, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6551)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6552) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6553) * DOC: RFkill integration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6554) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6555) * RFkill integration in cfg80211 is almost invisible to drivers,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6556) * as cfg80211 automatically registers an rfkill instance for each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6557) * wireless device it knows about. Soft kill is also translated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6558) * into disconnecting and turning all interfaces off, drivers are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6559) * expected to turn off the device when all interfaces are down.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6560) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6561) * However, devices may have a hard RFkill line, in which case they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6562) * also need to interact with the rfkill subsystem, via cfg80211.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6563) * They can do this with a few helper functions documented here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6564) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6565)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6566) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6567) * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6568) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6569) * @blocked: block status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6570) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6571) void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6572)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6573) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6574) * wiphy_rfkill_start_polling - start polling rfkill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6575) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6576) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6577) void wiphy_rfkill_start_polling(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6578)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6579) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6580) * wiphy_rfkill_stop_polling - stop polling rfkill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6581) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6582) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6583) void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6584)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6585) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6586) * DOC: Vendor commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6587) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6588) * Occasionally, there are special protocol or firmware features that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6589) * can't be implemented very openly. For this and similar cases, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6590) * vendor command functionality allows implementing the features with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6591) * (typically closed-source) userspace and firmware, using nl80211 as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6592) * the configuration mechanism.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6593) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6594) * A driver supporting vendor commands must register them as an array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6595) * in struct wiphy, with handlers for each one, each command has an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6596) * OUI and sub command ID to identify it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6597) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6598) * Note that this feature should not be (ab)used to implement protocol
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6599) * features that could openly be shared across drivers. In particular,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6600) * it must never be required to use vendor commands to implement any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6601) * "normal" functionality that higher-level userspace like connection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6602) * managers etc. need.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6603) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6604)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6605) struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6606) enum nl80211_commands cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6607) enum nl80211_attrs attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6608) int approxlen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6609)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6610) struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6611) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6612) enum nl80211_commands cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6613) enum nl80211_attrs attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6614) unsigned int portid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6615) int vendor_event_idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6616) int approxlen, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6617)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6618) void __cfg80211_send_event_skb(struct sk_buff *skb, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6619)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6620) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6621) * cfg80211_vendor_cmd_alloc_reply_skb - allocate vendor command reply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6622) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6623) * @approxlen: an upper bound of the length of the data that will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6624) * be put into the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6625) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6626) * This function allocates and pre-fills an skb for a reply to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6627) * a vendor command. Since it is intended for a reply, calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6628) * it outside of a vendor command's doit() operation is invalid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6629) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6630) * The returned skb is pre-filled with some identifying data in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6631) * a way that any data that is put into the skb (with skb_put(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6632) * nla_put() or similar) will end up being within the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6633) * %NL80211_ATTR_VENDOR_DATA attribute, so all that needs to be done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6634) * with the skb is adding data for the corresponding userspace tool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6635) * which can then read that data out of the vendor data attribute.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6636) * You must not modify the skb in any other way.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6637) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6638) * When done, call cfg80211_vendor_cmd_reply() with the skb and return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6639) * its error code as the result of the doit() operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6640) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6641) * Return: An allocated and pre-filled skb. %NULL if any errors happen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6642) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6643) static inline struct sk_buff *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6644) cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6645) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6646) return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_VENDOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6647) NL80211_ATTR_VENDOR_DATA, approxlen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6648) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6649)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6650) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6651) * cfg80211_vendor_cmd_reply - send the reply skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6652) * @skb: The skb, must have been allocated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6653) * cfg80211_vendor_cmd_alloc_reply_skb()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6654) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6655) * Since calling this function will usually be the last thing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6656) * before returning from the vendor command doit() you should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6657) * return the error code. Note that this function consumes the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6658) * skb regardless of the return value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6659) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6660) * Return: An error code or 0 on success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6661) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6662) int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6663)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6664) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6665) * cfg80211_vendor_cmd_get_sender
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6666) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6667) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6668) * Return the current netlink port ID in a vendor command handler.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6669) * Valid to call only there.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6670) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6671) unsigned int cfg80211_vendor_cmd_get_sender(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6672)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6673) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6674) * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6675) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6676) * @wdev: the wireless device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6677) * @event_idx: index of the vendor event in the wiphy's vendor_events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6678) * @approxlen: an upper bound of the length of the data that will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6679) * be put into the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6680) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6681) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6682) * This function allocates and pre-fills an skb for an event on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6683) * vendor-specific multicast group.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6684) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6685) * If wdev != NULL, both the ifindex and identifier of the specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6686) * wireless device are added to the event message before the vendor data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6687) * attribute.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6688) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6689) * When done filling the skb, call cfg80211_vendor_event() with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6690) * skb to send the event.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6691) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6692) * Return: An allocated and pre-filled skb. %NULL if any errors happen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6693) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6694) static inline struct sk_buff *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6695) cfg80211_vendor_event_alloc(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6696) int approxlen, int event_idx, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6697) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6698) return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6699) NL80211_ATTR_VENDOR_DATA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6700) 0, event_idx, approxlen, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6701) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6702)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6703) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6704) * cfg80211_vendor_event_alloc_ucast - alloc unicast vendor-specific event skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6705) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6706) * @wdev: the wireless device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6707) * @event_idx: index of the vendor event in the wiphy's vendor_events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6708) * @portid: port ID of the receiver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6709) * @approxlen: an upper bound of the length of the data that will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6710) * be put into the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6711) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6712) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6713) * This function allocates and pre-fills an skb for an event to send to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6714) * a specific (userland) socket. This socket would previously have been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6715) * obtained by cfg80211_vendor_cmd_get_sender(), and the caller MUST take
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6716) * care to register a netlink notifier to see when the socket closes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6717) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6718) * If wdev != NULL, both the ifindex and identifier of the specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6719) * wireless device are added to the event message before the vendor data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6720) * attribute.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6721) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6722) * When done filling the skb, call cfg80211_vendor_event() with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6723) * skb to send the event.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6724) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6725) * Return: An allocated and pre-filled skb. %NULL if any errors happen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6726) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6727) static inline struct sk_buff *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6728) cfg80211_vendor_event_alloc_ucast(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6729) struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6730) unsigned int portid, int approxlen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6731) int event_idx, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6732) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6733) return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6734) NL80211_ATTR_VENDOR_DATA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6735) portid, event_idx, approxlen, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6736) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6737)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6738) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6739) * cfg80211_vendor_event - send the event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6740) * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6741) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6742) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6743) * This function sends the given @skb, which must have been allocated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6744) * by cfg80211_vendor_event_alloc(), as an event. It always consumes it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6745) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6746) static inline void cfg80211_vendor_event(struct sk_buff *skb, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6747) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6748) __cfg80211_send_event_skb(skb, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6749) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6750)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6751) #ifdef CONFIG_NL80211_TESTMODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6752) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6753) * DOC: Test mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6754) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6755) * Test mode is a set of utility functions to allow drivers to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6756) * interact with driver-specific tools to aid, for instance,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6757) * factory programming.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6758) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6759) * This chapter describes how drivers interact with it, for more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6760) * information see the nl80211 book's chapter on it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6761) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6762)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6763) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6764) * cfg80211_testmode_alloc_reply_skb - allocate testmode reply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6765) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6766) * @approxlen: an upper bound of the length of the data that will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6767) * be put into the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6768) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6769) * This function allocates and pre-fills an skb for a reply to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6770) * the testmode command. Since it is intended for a reply, calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6771) * it outside of the @testmode_cmd operation is invalid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6772) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6773) * The returned skb is pre-filled with the wiphy index and set up in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6774) * a way that any data that is put into the skb (with skb_put(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6775) * nla_put() or similar) will end up being within the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6776) * %NL80211_ATTR_TESTDATA attribute, so all that needs to be done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6777) * with the skb is adding data for the corresponding userspace tool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6778) * which can then read that data out of the testdata attribute. You
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6779) * must not modify the skb in any other way.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6780) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6781) * When done, call cfg80211_testmode_reply() with the skb and return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6782) * its error code as the result of the @testmode_cmd operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6783) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6784) * Return: An allocated and pre-filled skb. %NULL if any errors happen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6785) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6786) static inline struct sk_buff *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6787) cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6788) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6789) return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_TESTMODE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6790) NL80211_ATTR_TESTDATA, approxlen);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6791) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6792)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6793) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6794) * cfg80211_testmode_reply - send the reply skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6795) * @skb: The skb, must have been allocated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6796) * cfg80211_testmode_alloc_reply_skb()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6797) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6798) * Since calling this function will usually be the last thing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6799) * before returning from the @testmode_cmd you should return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6800) * the error code. Note that this function consumes the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6801) * regardless of the return value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6802) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6803) * Return: An error code or 0 on success.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6804) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6805) static inline int cfg80211_testmode_reply(struct sk_buff *skb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6806) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6807) return cfg80211_vendor_cmd_reply(skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6808) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6809)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6810) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6811) * cfg80211_testmode_alloc_event_skb - allocate testmode event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6812) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6813) * @approxlen: an upper bound of the length of the data that will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6814) * be put into the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6815) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6816) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6817) * This function allocates and pre-fills an skb for an event on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6818) * testmode multicast group.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6819) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6820) * The returned skb is set up in the same way as with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6821) * cfg80211_testmode_alloc_reply_skb() but prepared for an event. As
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6822) * there, you should simply add data to it that will then end up in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6823) * %NL80211_ATTR_TESTDATA attribute. Again, you must not modify the skb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6824) * in any other way.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6825) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6826) * When done filling the skb, call cfg80211_testmode_event() with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6827) * skb to send the event.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6828) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6829) * Return: An allocated and pre-filled skb. %NULL if any errors happen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6830) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6831) static inline struct sk_buff *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6832) cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6833) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6834) return __cfg80211_alloc_event_skb(wiphy, NULL, NL80211_CMD_TESTMODE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6835) NL80211_ATTR_TESTDATA, 0, -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6836) approxlen, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6837) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6838)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6839) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6840) * cfg80211_testmode_event - send the event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6841) * @skb: The skb, must have been allocated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6842) * cfg80211_testmode_alloc_event_skb()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6843) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6844) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6845) * This function sends the given @skb, which must have been allocated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6846) * by cfg80211_testmode_alloc_event_skb(), as an event. It always
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6847) * consumes it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6848) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6849) static inline void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6850) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6851) __cfg80211_send_event_skb(skb, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6852) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6853)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6854) #define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6855) #define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6856) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6857) #define CFG80211_TESTMODE_CMD(cmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6858) #define CFG80211_TESTMODE_DUMP(cmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6859) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6860)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6861) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6862) * struct cfg80211_fils_resp_params - FILS connection response params
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6863) * @kek: KEK derived from a successful FILS connection (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6864) * @kek_len: Length of @fils_kek in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6865) * @update_erp_next_seq_num: Boolean value to specify whether the value in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6866) * @erp_next_seq_num is valid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6867) * @erp_next_seq_num: The next sequence number to use in ERP message in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6868) * FILS Authentication. This value should be specified irrespective of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6869) * status for a FILS connection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6870) * @pmk: A new PMK if derived from a successful FILS connection (may be %NULL).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6871) * @pmk_len: Length of @pmk in octets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6872) * @pmkid: A new PMKID if derived from a successful FILS connection or the PMKID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6873) * used for this FILS connection (may be %NULL).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6874) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6875) struct cfg80211_fils_resp_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6876) const u8 *kek;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6877) size_t kek_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6878) bool update_erp_next_seq_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6879) u16 erp_next_seq_num;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6880) const u8 *pmk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6881) size_t pmk_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6882) const u8 *pmkid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6883) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6884)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6885) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6886) * struct cfg80211_connect_resp_params - Connection response params
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6887) * @status: Status code, %WLAN_STATUS_SUCCESS for successful connection, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6888) * %WLAN_STATUS_UNSPECIFIED_FAILURE if your device cannot give you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6889) * the real status code for failures. If this call is used to report a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6890) * failure due to a timeout (e.g., not receiving an Authentication frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6891) * from the AP) instead of an explicit rejection by the AP, -1 is used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6892) * indicate that this is a failure, but without a status code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6893) * @timeout_reason is used to report the reason for the timeout in that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6894) * case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6895) * @bssid: The BSSID of the AP (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6896) * @bss: Entry of bss to which STA got connected to, can be obtained through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6897) * cfg80211_get_bss() (may be %NULL). But it is recommended to store the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6898) * bss from the connect_request and hold a reference to it and return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6899) * through this param to avoid a warning if the bss is expired during the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6900) * connection, esp. for those drivers implementing connect op.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6901) * Only one parameter among @bssid and @bss needs to be specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6902) * @req_ie: Association request IEs (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6903) * @req_ie_len: Association request IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6904) * @resp_ie: Association response IEs (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6905) * @resp_ie_len: Association response IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6906) * @fils: FILS connection response parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6907) * @timeout_reason: Reason for connection timeout. This is used when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6908) * connection fails due to a timeout instead of an explicit rejection from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6909) * the AP. %NL80211_TIMEOUT_UNSPECIFIED is used when the timeout reason is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6910) * not known. This value is used only if @status < 0 to indicate that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6911) * failure is due to a timeout and not due to explicit rejection by the AP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6912) * This value is ignored in other cases (@status >= 0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6913) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6914) struct cfg80211_connect_resp_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6915) int status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6916) const u8 *bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6917) struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6918) const u8 *req_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6919) size_t req_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6920) const u8 *resp_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6921) size_t resp_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6922) struct cfg80211_fils_resp_params fils;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6923) enum nl80211_timeout_reason timeout_reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6924) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6925)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6926) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6927) * cfg80211_connect_done - notify cfg80211 of connection result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6928) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6929) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6930) * @params: connection response parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6931) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6932) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6933) * It should be called by the underlying driver once execution of the connection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6934) * request from connect() has been completed. This is similar to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6935) * cfg80211_connect_bss(), but takes a structure pointer for connection response
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6936) * parameters. Only one of the functions among cfg80211_connect_bss(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6937) * cfg80211_connect_result(), cfg80211_connect_timeout(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6938) * and cfg80211_connect_done() should be called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6939) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6940) void cfg80211_connect_done(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6941) struct cfg80211_connect_resp_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6942) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6943)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6944) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6945) * cfg80211_connect_bss - notify cfg80211 of connection result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6946) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6947) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6948) * @bssid: the BSSID of the AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6949) * @bss: Entry of bss to which STA got connected to, can be obtained through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6950) * cfg80211_get_bss() (may be %NULL). But it is recommended to store the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6951) * bss from the connect_request and hold a reference to it and return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6952) * through this param to avoid a warning if the bss is expired during the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6953) * connection, esp. for those drivers implementing connect op.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6954) * Only one parameter among @bssid and @bss needs to be specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6955) * @req_ie: association request IEs (maybe be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6956) * @req_ie_len: association request IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6957) * @resp_ie: association response IEs (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6958) * @resp_ie_len: assoc response IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6959) * @status: status code, %WLAN_STATUS_SUCCESS for successful connection, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6960) * %WLAN_STATUS_UNSPECIFIED_FAILURE if your device cannot give you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6961) * the real status code for failures. If this call is used to report a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6962) * failure due to a timeout (e.g., not receiving an Authentication frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6963) * from the AP) instead of an explicit rejection by the AP, -1 is used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6964) * indicate that this is a failure, but without a status code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6965) * @timeout_reason is used to report the reason for the timeout in that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6966) * case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6967) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6968) * @timeout_reason: reason for connection timeout. This is used when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6969) * connection fails due to a timeout instead of an explicit rejection from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6970) * the AP. %NL80211_TIMEOUT_UNSPECIFIED is used when the timeout reason is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6971) * not known. This value is used only if @status < 0 to indicate that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6972) * failure is due to a timeout and not due to explicit rejection by the AP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6973) * This value is ignored in other cases (@status >= 0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6974) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6975) * It should be called by the underlying driver once execution of the connection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6976) * request from connect() has been completed. This is similar to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6977) * cfg80211_connect_result(), but with the option of identifying the exact bss
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6978) * entry for the connection. Only one of the functions among
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6979) * cfg80211_connect_bss(), cfg80211_connect_result(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6980) * cfg80211_connect_timeout(), and cfg80211_connect_done() should be called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6981) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6982) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6983) cfg80211_connect_bss(struct net_device *dev, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6984) struct cfg80211_bss *bss, const u8 *req_ie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6985) size_t req_ie_len, const u8 *resp_ie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6986) size_t resp_ie_len, int status, gfp_t gfp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6987) enum nl80211_timeout_reason timeout_reason)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6988) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6989) struct cfg80211_connect_resp_params params;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6990)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6991) memset(¶ms, 0, sizeof(params));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6992) params.status = status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6993) params.bssid = bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6994) params.bss = bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6995) params.req_ie = req_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6996) params.req_ie_len = req_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6997) params.resp_ie = resp_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6998) params.resp_ie_len = resp_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6999) params.timeout_reason = timeout_reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7001) cfg80211_connect_done(dev, ¶ms, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7002) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7003)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7004) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7005) * cfg80211_connect_result - notify cfg80211 of connection result
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7006) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7007) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7008) * @bssid: the BSSID of the AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7009) * @req_ie: association request IEs (maybe be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7010) * @req_ie_len: association request IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7011) * @resp_ie: association response IEs (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7012) * @resp_ie_len: assoc response IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7013) * @status: status code, %WLAN_STATUS_SUCCESS for successful connection, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7014) * %WLAN_STATUS_UNSPECIFIED_FAILURE if your device cannot give you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7015) * the real status code for failures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7016) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7017) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7018) * It should be called by the underlying driver once execution of the connection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7019) * request from connect() has been completed. This is similar to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7020) * cfg80211_connect_bss() which allows the exact bss entry to be specified. Only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7021) * one of the functions among cfg80211_connect_bss(), cfg80211_connect_result(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7022) * cfg80211_connect_timeout(), and cfg80211_connect_done() should be called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7023) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7024) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7025) cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7026) const u8 *req_ie, size_t req_ie_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7027) const u8 *resp_ie, size_t resp_ie_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7028) u16 status, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7029) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7030) cfg80211_connect_bss(dev, bssid, NULL, req_ie, req_ie_len, resp_ie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7031) resp_ie_len, status, gfp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7032) NL80211_TIMEOUT_UNSPECIFIED);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7033) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7034)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7035) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7036) * cfg80211_connect_timeout - notify cfg80211 of connection timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7037) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7038) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7039) * @bssid: the BSSID of the AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7040) * @req_ie: association request IEs (maybe be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7041) * @req_ie_len: association request IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7042) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7043) * @timeout_reason: reason for connection timeout.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7044) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7045) * It should be called by the underlying driver whenever connect() has failed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7046) * in a sequence where no explicit authentication/association rejection was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7047) * received from the AP. This could happen, e.g., due to not being able to send
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7048) * out the Authentication or Association Request frame or timing out while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7049) * waiting for the response. Only one of the functions among
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7050) * cfg80211_connect_bss(), cfg80211_connect_result(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7051) * cfg80211_connect_timeout(), and cfg80211_connect_done() should be called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7052) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7053) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7054) cfg80211_connect_timeout(struct net_device *dev, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7055) const u8 *req_ie, size_t req_ie_len, gfp_t gfp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7056) enum nl80211_timeout_reason timeout_reason)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7057) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7058) cfg80211_connect_bss(dev, bssid, NULL, req_ie, req_ie_len, NULL, 0, -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7059) gfp, timeout_reason);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7060) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7061)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7062) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7063) * struct cfg80211_roam_info - driver initiated roaming information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7064) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7065) * @channel: the channel of the new AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7066) * @bss: entry of bss to which STA got roamed (may be %NULL if %bssid is set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7067) * @bssid: the BSSID of the new AP (may be %NULL if %bss is set)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7068) * @req_ie: association request IEs (maybe be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7069) * @req_ie_len: association request IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7070) * @resp_ie: association response IEs (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7071) * @resp_ie_len: assoc response IEs length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7072) * @fils: FILS related roaming information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7073) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7074) struct cfg80211_roam_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7075) struct ieee80211_channel *channel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7076) struct cfg80211_bss *bss;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7077) const u8 *bssid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7078) const u8 *req_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7079) size_t req_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7080) const u8 *resp_ie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7081) size_t resp_ie_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7082) struct cfg80211_fils_resp_params fils;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7083) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7084)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7085) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7086) * cfg80211_roamed - notify cfg80211 of roaming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7087) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7088) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7089) * @info: information about the new BSS. struct &cfg80211_roam_info.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7090) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7091) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7092) * This function may be called with the driver passing either the BSSID of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7093) * new AP or passing the bss entry to avoid a race in timeout of the bss entry.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7094) * It should be called by the underlying driver whenever it roamed from one AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7095) * to another while connected. Drivers which have roaming implemented in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7096) * firmware should pass the bss entry to avoid a race in bss entry timeout where
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7097) * the bss entry of the new AP is seen in the driver, but gets timed out by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7098) * time it is accessed in __cfg80211_roamed() due to delay in scheduling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7099) * rdev->event_work. In case of any failures, the reference is released
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7100) * either in cfg80211_roamed() or in __cfg80211_romed(), Otherwise, it will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7101) * released while disconnecting from the current bss.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7102) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7103) void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7104) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7106) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7107) * cfg80211_port_authorized - notify cfg80211 of successful security association
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7108) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7109) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7110) * @bssid: the BSSID of the AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7111) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7112) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7113) * This function should be called by a driver that supports 4 way handshake
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7114) * offload after a security association was successfully established (i.e.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7115) * the 4 way handshake was completed successfully). The call to this function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7116) * should be preceded with a call to cfg80211_connect_result(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7117) * cfg80211_connect_done(), cfg80211_connect_bss() or cfg80211_roamed() to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7118) * indicate the 802.11 association.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7119) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7120) void cfg80211_port_authorized(struct net_device *dev, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7121) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7123) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7124) * cfg80211_disconnected - notify cfg80211 that connection was dropped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7125) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7126) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7127) * @ie: information elements of the deauth/disassoc frame (may be %NULL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7128) * @ie_len: length of IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7129) * @reason: reason code for the disconnection, set it to 0 if unknown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7130) * @locally_generated: disconnection was requested locally
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7131) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7132) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7133) * After it calls this function, the driver should enter an idle state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7134) * and not try to connect to any AP any more.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7135) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7136) void cfg80211_disconnected(struct net_device *dev, u16 reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7137) const u8 *ie, size_t ie_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7138) bool locally_generated, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7140) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7141) * cfg80211_ready_on_channel - notification of remain_on_channel start
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7142) * @wdev: wireless device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7143) * @cookie: the request cookie
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7144) * @chan: The current channel (from remain_on_channel request)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7145) * @duration: Duration in milliseconds that the driver intents to remain on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7146) * channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7147) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7148) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7149) void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7150) struct ieee80211_channel *chan,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7151) unsigned int duration, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7153) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7154) * cfg80211_remain_on_channel_expired - remain_on_channel duration expired
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7155) * @wdev: wireless device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7156) * @cookie: the request cookie
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7157) * @chan: The current channel (from remain_on_channel request)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7158) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7159) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7160) void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7161) struct ieee80211_channel *chan,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7162) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7164) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7165) * cfg80211_tx_mgmt_expired - tx_mgmt duration expired
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7166) * @wdev: wireless device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7167) * @cookie: the requested cookie
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7168) * @chan: The current channel (from tx_mgmt request)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7169) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7170) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7171) void cfg80211_tx_mgmt_expired(struct wireless_dev *wdev, u64 cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7172) struct ieee80211_channel *chan, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7174) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7175) * cfg80211_sinfo_alloc_tid_stats - allocate per-tid statistics.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7176) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7177) * @sinfo: the station information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7178) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7179) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7180) int cfg80211_sinfo_alloc_tid_stats(struct station_info *sinfo, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7182) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7183) * cfg80211_sinfo_release_content - release contents of station info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7184) * @sinfo: the station information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7185) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7186) * Releases any potentially allocated sub-information of the station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7187) * information, but not the struct itself (since it's typically on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7188) * the stack.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7189) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7190) static inline void cfg80211_sinfo_release_content(struct station_info *sinfo)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7191) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7192) kfree(sinfo->pertid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7193) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7195) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7196) * cfg80211_new_sta - notify userspace about station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7197) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7198) * @dev: the netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7199) * @mac_addr: the station's address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7200) * @sinfo: the station information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7201) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7202) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7203) void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7204) struct station_info *sinfo, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7206) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7207) * cfg80211_del_sta_sinfo - notify userspace about deletion of a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7208) * @dev: the netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7209) * @mac_addr: the station's address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7210) * @sinfo: the station information/statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7211) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7212) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7213) void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7214) struct station_info *sinfo, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7216) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7217) * cfg80211_del_sta - notify userspace about deletion of a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7218) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7219) * @dev: the netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7220) * @mac_addr: the station's address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7221) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7222) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7223) static inline void cfg80211_del_sta(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7224) const u8 *mac_addr, gfp_t gfp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7226) cfg80211_del_sta_sinfo(dev, mac_addr, NULL, gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7227) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7229) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7230) * cfg80211_conn_failed - connection request failed notification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7231) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7232) * @dev: the netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7233) * @mac_addr: the station's address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7234) * @reason: the reason for connection failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7235) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7236) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7237) * Whenever a station tries to connect to an AP and if the station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7238) * could not connect to the AP as the AP has rejected the connection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7239) * for some reasons, this function is called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7240) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7241) * The reason for connection failure can be any of the value from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7242) * nl80211_connect_failed_reason enum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7243) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7244) void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7245) enum nl80211_connect_failed_reason reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7246) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7248) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7249) * cfg80211_rx_mgmt_khz - notification of received, unprocessed management frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7250) * @wdev: wireless device receiving the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7251) * @freq: Frequency on which the frame was received in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7252) * @sig_dbm: signal strength in dBm, or 0 if unknown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7253) * @buf: Management frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7254) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7255) * @flags: flags, as defined in enum nl80211_rxmgmt_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7256) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7257) * This function is called whenever an Action frame is received for a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7258) * mode interface, but is not processed in kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7259) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7260) * Return: %true if a user space application has registered for this frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7261) * For action frames, that makes it responsible for rejecting unrecognized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7262) * action frames; %false otherwise, in which case for action frames the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7263) * driver is responsible for rejecting the frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7264) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7265) bool cfg80211_rx_mgmt_khz(struct wireless_dev *wdev, int freq, int sig_dbm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7266) const u8 *buf, size_t len, u32 flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7268) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7269) * cfg80211_rx_mgmt - notification of received, unprocessed management frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7270) * @wdev: wireless device receiving the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7271) * @freq: Frequency on which the frame was received in MHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7272) * @sig_dbm: signal strength in dBm, or 0 if unknown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7273) * @buf: Management frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7274) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7275) * @flags: flags, as defined in enum nl80211_rxmgmt_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7276) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7277) * This function is called whenever an Action frame is received for a station
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7278) * mode interface, but is not processed in kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7279) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7280) * Return: %true if a user space application has registered for this frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7281) * For action frames, that makes it responsible for rejecting unrecognized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7282) * action frames; %false otherwise, in which case for action frames the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7283) * driver is responsible for rejecting the frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7284) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7285) static inline bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7286) int sig_dbm, const u8 *buf, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7287) u32 flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7288) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7289) return cfg80211_rx_mgmt_khz(wdev, MHZ_TO_KHZ(freq), sig_dbm, buf, len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7290) flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7291) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7293) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7294) * cfg80211_mgmt_tx_status - notification of TX status for management frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7295) * @wdev: wireless device receiving the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7296) * @cookie: Cookie returned by cfg80211_ops::mgmt_tx()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7297) * @buf: Management frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7298) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7299) * @ack: Whether frame was acknowledged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7300) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7301) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7302) * This function is called whenever a management frame was requested to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7303) * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7304) * transmission attempt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7305) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7306) void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7307) const u8 *buf, size_t len, bool ack, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7309) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7310) * cfg80211_control_port_tx_status - notification of TX status for control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7311) * port frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7312) * @wdev: wireless device receiving the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7313) * @cookie: Cookie returned by cfg80211_ops::tx_control_port()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7314) * @buf: Data frame (header + body)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7315) * @len: length of the frame data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7316) * @ack: Whether frame was acknowledged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7317) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7318) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7319) * This function is called whenever a control port frame was requested to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7320) * transmitted with cfg80211_ops::tx_control_port() to report the TX status of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7321) * the transmission attempt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7322) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7323) void cfg80211_control_port_tx_status(struct wireless_dev *wdev, u64 cookie,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7324) const u8 *buf, size_t len, bool ack,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7325) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7327) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7328) * cfg80211_rx_control_port - notification about a received control port frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7329) * @dev: The device the frame matched to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7330) * @skb: The skbuf with the control port frame. It is assumed that the skbuf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7331) * is 802.3 formatted (with 802.3 header). The skb can be non-linear.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7332) * This function does not take ownership of the skb, so the caller is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7333) * responsible for any cleanup. The caller must also ensure that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7334) * skb->protocol is set appropriately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7335) * @unencrypted: Whether the frame was received unencrypted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7336) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7337) * This function is used to inform userspace about a received control port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7338) * frame. It should only be used if userspace indicated it wants to receive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7339) * control port frames over nl80211.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7340) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7341) * The frame is the data portion of the 802.3 or 802.11 data frame with all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7342) * network layer headers removed (e.g. the raw EAPoL frame).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7343) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7344) * Return: %true if the frame was passed to userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7345) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7346) bool cfg80211_rx_control_port(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7347) struct sk_buff *skb, bool unencrypted);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7348)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7349) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7350) * cfg80211_cqm_rssi_notify - connection quality monitoring rssi event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7351) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7352) * @rssi_event: the triggered RSSI event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7353) * @rssi_level: new RSSI level value or 0 if not available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7354) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7355) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7356) * This function is called when a configured connection quality monitoring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7357) * rssi threshold reached event occurs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7358) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7359) void cfg80211_cqm_rssi_notify(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7360) enum nl80211_cqm_rssi_threshold_event rssi_event,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7361) s32 rssi_level, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7363) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7364) * cfg80211_cqm_pktloss_notify - notify userspace about packetloss to peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7365) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7366) * @peer: peer's MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7367) * @num_packets: how many packets were lost -- should be a fixed threshold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7368) * but probably no less than maybe 50, or maybe a throughput dependent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7369) * threshold (to account for temporary interference)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7370) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7371) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7372) void cfg80211_cqm_pktloss_notify(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7373) const u8 *peer, u32 num_packets, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7374)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7375) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7376) * cfg80211_cqm_txe_notify - TX error rate event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7377) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7378) * @peer: peer's MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7379) * @num_packets: how many packets were lost
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7380) * @rate: % of packets which failed transmission
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7381) * @intvl: interval (in s) over which the TX failure threshold was breached.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7382) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7383) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7384) * Notify userspace when configured % TX failures over number of packets in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7385) * given interval is exceeded.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7386) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7387) void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7388) u32 num_packets, u32 rate, u32 intvl, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7389)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7390) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7391) * cfg80211_cqm_beacon_loss_notify - beacon loss event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7392) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7393) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7394) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7395) * Notify userspace about beacon loss from the connected AP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7396) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7397) void cfg80211_cqm_beacon_loss_notify(struct net_device *dev, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7399) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7400) * cfg80211_radar_event - radar detection event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7401) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7402) * @chandef: chandef for the current channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7403) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7404) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7405) * This function is called when a radar is detected on the current chanenl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7406) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7407) void cfg80211_radar_event(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7408) struct cfg80211_chan_def *chandef, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7409)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7410) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7411) * cfg80211_sta_opmode_change_notify - STA's ht/vht operation mode change event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7412) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7413) * @mac: MAC address of a station which opmode got modified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7414) * @sta_opmode: station's current opmode value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7415) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7416) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7417) * Driver should call this function when station's opmode modified via action
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7418) * frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7419) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7420) void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7421) struct sta_opmode_info *sta_opmode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7422) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7423)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7424) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7425) * cfg80211_cac_event - Channel availability check (CAC) event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7426) * @netdev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7427) * @chandef: chandef for the current channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7428) * @event: type of event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7429) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7430) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7431) * This function is called when a Channel availability check (CAC) is finished
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7432) * or aborted. This must be called to notify the completion of a CAC process,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7433) * also by full-MAC drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7434) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7435) void cfg80211_cac_event(struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7436) const struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7437) enum nl80211_radar_event event, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7438)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7439)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7440) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7441) * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7442) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7443) * @bssid: BSSID of AP (to avoid races)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7444) * @replay_ctr: new replay counter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7445) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7446) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7447) void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7448) const u8 *replay_ctr, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7449)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7450) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7451) * cfg80211_pmksa_candidate_notify - notify about PMKSA caching candidate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7452) * @dev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7453) * @index: candidate index (the smaller the index, the higher the priority)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7454) * @bssid: BSSID of AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7455) * @preauth: Whether AP advertises support for RSN pre-authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7456) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7457) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7458) void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7459) const u8 *bssid, bool preauth, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7460)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7461) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7462) * cfg80211_rx_spurious_frame - inform userspace about a spurious frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7463) * @dev: The device the frame matched to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7464) * @addr: the transmitter address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7465) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7466) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7467) * This function is used in AP mode (only!) to inform userspace that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7468) * a spurious class 3 frame was received, to be able to deauth the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7469) * sender.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7470) * Return: %true if the frame was passed to userspace (or this failed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7471) * for a reason other than not having a subscription.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7472) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7473) bool cfg80211_rx_spurious_frame(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7474) const u8 *addr, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7475)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7476) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7477) * cfg80211_rx_unexpected_4addr_frame - inform about unexpected WDS frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7478) * @dev: The device the frame matched to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7479) * @addr: the transmitter address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7480) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7481) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7482) * This function is used in AP mode (only!) to inform userspace that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7483) * an associated station sent a 4addr frame but that wasn't expected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7484) * It is allowed and desirable to send this event only once for each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7485) * station to avoid event flooding.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7486) * Return: %true if the frame was passed to userspace (or this failed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7487) * for a reason other than not having a subscription.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7488) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7489) bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7490) const u8 *addr, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7492) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7493) * cfg80211_probe_status - notify userspace about probe status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7494) * @dev: the device the probe was sent on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7495) * @addr: the address of the peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7496) * @cookie: the cookie filled in @probe_client previously
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7497) * @acked: indicates whether probe was acked or not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7498) * @ack_signal: signal strength (in dBm) of the ACK frame.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7499) * @is_valid_ack_signal: indicates the ack_signal is valid or not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7500) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7501) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7502) void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7503) u64 cookie, bool acked, s32 ack_signal,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7504) bool is_valid_ack_signal, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7505)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7506) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7507) * cfg80211_report_obss_beacon_khz - report beacon from other APs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7508) * @wiphy: The wiphy that received the beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7509) * @frame: the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7510) * @len: length of the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7511) * @freq: frequency the frame was received on in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7512) * @sig_dbm: signal strength in dBm, or 0 if unknown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7513) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7514) * Use this function to report to userspace when a beacon was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7515) * received. It is not useful to call this when there is no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7516) * netdev that is in AP/GO mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7517) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7518) void cfg80211_report_obss_beacon_khz(struct wiphy *wiphy, const u8 *frame,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7519) size_t len, int freq, int sig_dbm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7520)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7521) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7522) * cfg80211_report_obss_beacon - report beacon from other APs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7523) * @wiphy: The wiphy that received the beacon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7524) * @frame: the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7525) * @len: length of the frame
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7526) * @freq: frequency the frame was received on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7527) * @sig_dbm: signal strength in dBm, or 0 if unknown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7528) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7529) * Use this function to report to userspace when a beacon was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7530) * received. It is not useful to call this when there is no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7531) * netdev that is in AP/GO mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7532) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7533) static inline void cfg80211_report_obss_beacon(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7534) const u8 *frame, size_t len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7535) int freq, int sig_dbm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7536) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7537) cfg80211_report_obss_beacon_khz(wiphy, frame, len, MHZ_TO_KHZ(freq),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7538) sig_dbm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7539) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7540)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7541) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7542) * cfg80211_reg_can_beacon - check if beaconing is allowed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7543) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7544) * @chandef: the channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7545) * @iftype: interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7546) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7547) * Return: %true if there is no secondary channel or the secondary channel(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7548) * can be used for beaconing (i.e. is not a radar channel etc.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7549) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7550) bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7551) struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7552) enum nl80211_iftype iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7553)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7554) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7555) * cfg80211_reg_can_beacon_relax - check if beaconing is allowed with relaxation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7556) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7557) * @chandef: the channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7558) * @iftype: interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7559) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7560) * Return: %true if there is no secondary channel or the secondary channel(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7561) * can be used for beaconing (i.e. is not a radar channel etc.). This version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7562) * also checks if IR-relaxation conditions apply, to allow beaconing under
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7563) * more permissive conditions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7564) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7565) * Requires the RTNL to be held.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7566) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7567) bool cfg80211_reg_can_beacon_relax(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7568) struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7569) enum nl80211_iftype iftype);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7570)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7571) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7572) * cfg80211_ch_switch_notify - update wdev channel and notify userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7573) * @dev: the device which switched channels
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7574) * @chandef: the new channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7575) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7576) * Caller must acquire wdev_lock, therefore must only be called from sleepable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7577) * driver context!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7578) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7579) void cfg80211_ch_switch_notify(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7580) struct cfg80211_chan_def *chandef);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7581)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7582) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7583) * cfg80211_ch_switch_started_notify - notify channel switch start
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7584) * @dev: the device on which the channel switch started
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7585) * @chandef: the future channel definition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7586) * @count: the number of TBTTs until the channel switch happens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7587) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7588) * Inform the userspace about the channel switch that has just
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7589) * started, so that it can take appropriate actions (eg. starting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7590) * channel switch on other vifs), if necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7591) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7592) void cfg80211_ch_switch_started_notify(struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7593) struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7594) u8 count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7595)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7596) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7597) * ieee80211_operating_class_to_band - convert operating class to band
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7598) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7599) * @operating_class: the operating class to convert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7600) * @band: band pointer to fill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7601) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7602) * Returns %true if the conversion was successful, %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7603) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7604) bool ieee80211_operating_class_to_band(u8 operating_class,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7605) enum nl80211_band *band);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7606)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7607) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7608) * ieee80211_chandef_to_operating_class - convert chandef to operation class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7609) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7610) * @chandef: the chandef to convert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7611) * @op_class: a pointer to the resulting operating class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7612) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7613) * Returns %true if the conversion was successful, %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7614) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7615) bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7616) u8 *op_class);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7617)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7618) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7619) * ieee80211_chandef_to_khz - convert chandef to frequency in KHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7620) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7621) * @chandef: the chandef to convert
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7622) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7623) * Returns the center frequency of chandef (1st segment) in KHz.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7624) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7625) static inline u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7626) ieee80211_chandef_to_khz(const struct cfg80211_chan_def *chandef)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7627) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7628) return MHZ_TO_KHZ(chandef->center_freq1) + chandef->freq1_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7629) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7630)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7631) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7632) * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7633) * @dev: the device on which the operation is requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7634) * @peer: the MAC address of the peer device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7635) * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7636) * NL80211_TDLS_TEARDOWN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7637) * @reason_code: the reason code for teardown request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7638) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7639) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7640) * This function is used to request userspace to perform TDLS operation that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7641) * requires knowledge of keys, i.e., link setup or teardown when the AP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7642) * connection uses encryption. This is optional mechanism for the driver to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7643) * if it can automatically determine when a TDLS link could be useful (e.g.,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7644) * based on traffic and signal strength for a peer).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7645) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7646) void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7647) enum nl80211_tdls_operation oper,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7648) u16 reason_code, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7649)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7650) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7651) * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7652) * @rate: given rate_info to calculate bitrate from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7653) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7654) * return 0 if MCS index >= 32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7655) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7656) u32 cfg80211_calculate_bitrate(struct rate_info *rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7657)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7658) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7659) * cfg80211_unregister_wdev - remove the given wdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7660) * @wdev: struct wireless_dev to remove
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7661) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7662) * Call this function only for wdevs that have no netdev assigned,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7663) * e.g. P2P Devices. It removes the device from the list so that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7664) * it can no longer be used. It is necessary to call this function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7665) * even when cfg80211 requests the removal of the interface by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7666) * calling the del_virtual_intf() callback. The function must also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7667) * be called when the driver wishes to unregister the wdev, e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7668) * when the device is unbound from the driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7669) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7670) * Requires the RTNL to be held.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7671) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7672) void cfg80211_unregister_wdev(struct wireless_dev *wdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7673)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7674) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7675) * struct cfg80211_ft_event_params - FT Information Elements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7676) * @ies: FT IEs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7677) * @ies_len: length of the FT IE in bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7678) * @target_ap: target AP's MAC address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7679) * @ric_ies: RIC IE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7680) * @ric_ies_len: length of the RIC IE in bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7681) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7682) struct cfg80211_ft_event_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7683) const u8 *ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7684) size_t ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7685) const u8 *target_ap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7686) const u8 *ric_ies;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7687) size_t ric_ies_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7688) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7689)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7690) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7691) * cfg80211_ft_event - notify userspace about FT IE and RIC IE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7692) * @netdev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7693) * @ft_event: IE information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7694) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7695) void cfg80211_ft_event(struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7696) struct cfg80211_ft_event_params *ft_event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7697)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7698) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7699) * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7700) * @ies: the input IE buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7701) * @len: the input length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7702) * @attr: the attribute ID to find
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7703) * @buf: output buffer, can be %NULL if the data isn't needed, e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7704) * if the function is only called to get the needed buffer size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7705) * @bufsize: size of the output buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7706) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7707) * The function finds a given P2P attribute in the (vendor) IEs and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7708) * copies its contents to the given buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7709) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7710) * Return: A negative error code (-%EILSEQ or -%ENOENT) if the data is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7711) * malformed or the attribute can't be found (respectively), or the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7712) * length of the found attribute (which can be zero).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7713) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7714) int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7715) enum ieee80211_p2p_attr_id attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7716) u8 *buf, unsigned int bufsize);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7717)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7718) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7719) * ieee80211_ie_split_ric - split an IE buffer according to ordering (with RIC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7720) * @ies: the IE buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7721) * @ielen: the length of the IE buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7722) * @ids: an array with element IDs that are allowed before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7723) * the split. A WLAN_EID_EXTENSION value means that the next
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7724) * EID in the list is a sub-element of the EXTENSION IE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7725) * @n_ids: the size of the element ID array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7726) * @after_ric: array IE types that come after the RIC element
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7727) * @n_after_ric: size of the @after_ric array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7728) * @offset: offset where to start splitting in the buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7729) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7730) * This function splits an IE buffer by updating the @offset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7731) * variable to point to the location where the buffer should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7732) * split.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7733) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7734) * It assumes that the given IE buffer is well-formed, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7735) * has to be guaranteed by the caller!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7736) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7737) * It also assumes that the IEs in the buffer are ordered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7738) * correctly, if not the result of using this function will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7739) * be ordered correctly either, i.e. it does no reordering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7740) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7741) * The function returns the offset where the next part of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7742) * buffer starts, which may be @ielen if the entire (remainder)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7743) * of the buffer should be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7744) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7745) size_t ieee80211_ie_split_ric(const u8 *ies, size_t ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7746) const u8 *ids, int n_ids,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7747) const u8 *after_ric, int n_after_ric,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7748) size_t offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7749)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7750) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7751) * ieee80211_ie_split - split an IE buffer according to ordering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7752) * @ies: the IE buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7753) * @ielen: the length of the IE buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7754) * @ids: an array with element IDs that are allowed before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7755) * the split. A WLAN_EID_EXTENSION value means that the next
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7756) * EID in the list is a sub-element of the EXTENSION IE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7757) * @n_ids: the size of the element ID array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7758) * @offset: offset where to start splitting in the buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7759) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7760) * This function splits an IE buffer by updating the @offset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7761) * variable to point to the location where the buffer should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7762) * split.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7763) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7764) * It assumes that the given IE buffer is well-formed, this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7765) * has to be guaranteed by the caller!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7766) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7767) * It also assumes that the IEs in the buffer are ordered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7768) * correctly, if not the result of using this function will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7769) * be ordered correctly either, i.e. it does no reordering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7770) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7771) * The function returns the offset where the next part of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7772) * buffer starts, which may be @ielen if the entire (remainder)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7773) * of the buffer should be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7774) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7775) static inline size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7776) const u8 *ids, int n_ids, size_t offset)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7777) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7778) return ieee80211_ie_split_ric(ies, ielen, ids, n_ids, NULL, 0, offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7779) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7780)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7781) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7782) * cfg80211_report_wowlan_wakeup - report wakeup from WoWLAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7783) * @wdev: the wireless device reporting the wakeup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7784) * @wakeup: the wakeup report
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7785) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7786) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7787) * This function reports that the given device woke up. If it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7788) * caused the wakeup, report the reason(s), otherwise you may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7789) * pass %NULL as the @wakeup parameter to advertise that something
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7790) * else caused the wakeup.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7791) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7792) void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7793) struct cfg80211_wowlan_wakeup *wakeup,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7794) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7795)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7796) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7797) * cfg80211_crit_proto_stopped() - indicate critical protocol stopped by driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7798) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7799) * @wdev: the wireless device for which critical protocol is stopped.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7800) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7801) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7802) * This function can be called by the driver to indicate it has reverted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7803) * operation back to normal. One reason could be that the duration given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7804) * by .crit_proto_start() has expired.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7805) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7806) void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7807)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7808) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7809) * ieee80211_get_num_supported_channels - get number of channels device has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7810) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7811) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7812) * Return: the number of channels supported by the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7813) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7814) unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7815)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7816) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7817) * cfg80211_check_combinations - check interface combinations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7818) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7819) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7820) * @params: the interface combinations parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7821) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7822) * This function can be called by the driver to check whether a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7823) * combination of interfaces and their types are allowed according to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7824) * the interface combinations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7825) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7826) int cfg80211_check_combinations(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7827) struct iface_combination_params *params);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7828)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7829) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7830) * cfg80211_iter_combinations - iterate over matching combinations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7831) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7832) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7833) * @params: the interface combinations parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7834) * @iter: function to call for each matching combination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7835) * @data: pointer to pass to iter function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7836) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7837) * This function can be called by the driver to check what possible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7838) * combinations it fits in at a given moment, e.g. for channel switching
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7839) * purposes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7840) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7841) int cfg80211_iter_combinations(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7842) struct iface_combination_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7843) void (*iter)(const struct ieee80211_iface_combination *c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7844) void *data),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7845) void *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7846)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7847) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7848) * cfg80211_stop_iface - trigger interface disconnection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7849) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7850) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7851) * @wdev: wireless device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7852) * @gfp: context flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7853) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7854) * Trigger interface to be stopped as if AP was stopped, IBSS/mesh left, STA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7855) * disconnected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7856) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7857) * Note: This doesn't need any locks and is asynchronous.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7858) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7859) void cfg80211_stop_iface(struct wiphy *wiphy, struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7860) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7861)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7862) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7863) * cfg80211_shutdown_all_interfaces - shut down all interfaces for a wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7864) * @wiphy: the wiphy to shut down
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7865) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7866) * This function shuts down all interfaces belonging to this wiphy by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7867) * calling dev_close() (and treating non-netdev interfaces as needed).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7868) * It shouldn't really be used unless there are some fatal device errors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7869) * that really can't be recovered in any other way.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7870) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7871) * Callers must hold the RTNL and be able to deal with callbacks into
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7872) * the driver while the function is running.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7873) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7874) void cfg80211_shutdown_all_interfaces(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7875)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7876) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7877) * wiphy_ext_feature_set - set the extended feature flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7878) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7879) * @wiphy: the wiphy to modify.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7880) * @ftidx: extended feature bit index.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7881) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7882) * The extended features are flagged in multiple bytes (see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7883) * &struct wiphy.@ext_features)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7884) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7885) static inline void wiphy_ext_feature_set(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7886) enum nl80211_ext_feature_index ftidx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7887) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7888) u8 *ft_byte;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7889)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7890) ft_byte = &wiphy->ext_features[ftidx / 8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7891) *ft_byte |= BIT(ftidx % 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7892) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7893)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7894) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7895) * wiphy_ext_feature_isset - check the extended feature flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7896) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7897) * @wiphy: the wiphy to modify.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7898) * @ftidx: extended feature bit index.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7899) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7900) * The extended features are flagged in multiple bytes (see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7901) * &struct wiphy.@ext_features)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7902) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7903) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7904) wiphy_ext_feature_isset(struct wiphy *wiphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7905) enum nl80211_ext_feature_index ftidx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7906) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7907) u8 ft_byte;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7908)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7909) ft_byte = wiphy->ext_features[ftidx / 8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7910) return (ft_byte & BIT(ftidx % 8)) != 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7911) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7912)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7913) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7914) * cfg80211_free_nan_func - free NAN function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7915) * @f: NAN function that should be freed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7916) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7917) * Frees all the NAN function and all it's allocated members.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7918) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7919) void cfg80211_free_nan_func(struct cfg80211_nan_func *f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7920)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7921) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7922) * struct cfg80211_nan_match_params - NAN match parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7923) * @type: the type of the function that triggered a match. If it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7924) * %NL80211_NAN_FUNC_SUBSCRIBE it means that we replied to a subscriber.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7925) * If it is %NL80211_NAN_FUNC_PUBLISH, it means that we got a discovery
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7926) * result.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7927) * If it is %NL80211_NAN_FUNC_FOLLOW_UP, we received a follow up.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7928) * @inst_id: the local instance id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7929) * @peer_inst_id: the instance id of the peer's function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7930) * @addr: the MAC address of the peer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7931) * @info_len: the length of the &info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7932) * @info: the Service Specific Info from the peer (if any)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7933) * @cookie: unique identifier of the corresponding function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7934) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7935) struct cfg80211_nan_match_params {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7936) enum nl80211_nan_function_type type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7937) u8 inst_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7938) u8 peer_inst_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7939) const u8 *addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7940) u8 info_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7941) const u8 *info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7942) u64 cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7943) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7944)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7945) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7946) * cfg80211_nan_match - report a match for a NAN function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7947) * @wdev: the wireless device reporting the match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7948) * @match: match notification parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7949) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7950) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7951) * This function reports that the a NAN function had a match. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7952) * can be a subscribe that had a match or a solicited publish that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7953) * was sent. It can also be a follow up that was received.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7954) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7955) void cfg80211_nan_match(struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7956) struct cfg80211_nan_match_params *match, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7957)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7958) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7959) * cfg80211_nan_func_terminated - notify about NAN function termination.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7960) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7961) * @wdev: the wireless device reporting the match
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7962) * @inst_id: the local instance id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7963) * @reason: termination reason (one of the NL80211_NAN_FUNC_TERM_REASON_*)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7964) * @cookie: unique NAN function identifier
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7965) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7966) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7967) * This function reports that the a NAN function is terminated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7968) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7969) void cfg80211_nan_func_terminated(struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7970) u8 inst_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7971) enum nl80211_nan_func_term_reason reason,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7972) u64 cookie, gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7973)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7974) /* ethtool helper */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7975) void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7976)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7977) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7978) * cfg80211_external_auth_request - userspace request for authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7979) * @netdev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7980) * @params: External authentication parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7981) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7982) * Returns: 0 on success, < 0 on error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7983) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7984) int cfg80211_external_auth_request(struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7985) struct cfg80211_external_auth_params *params,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7986) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7987)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7988) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7989) * cfg80211_pmsr_report - report peer measurement result data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7990) * @wdev: the wireless device reporting the measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7991) * @req: the original measurement request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7992) * @result: the result data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7993) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7994) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7995) void cfg80211_pmsr_report(struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7996) struct cfg80211_pmsr_request *req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7997) struct cfg80211_pmsr_result *result,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7998) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7999)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8000) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8001) * cfg80211_pmsr_complete - report peer measurement completed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8002) * @wdev: the wireless device reporting the measurement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8003) * @req: the original measurement request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8004) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8005) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8006) * Report that the entire measurement completed, after this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8007) * the request pointer will no longer be valid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8008) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8009) void cfg80211_pmsr_complete(struct wireless_dev *wdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8010) struct cfg80211_pmsr_request *req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8011) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8012)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8013) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8014) * cfg80211_iftype_allowed - check whether the interface can be allowed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8015) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8016) * @iftype: interface type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8017) * @is_4addr: use_4addr flag, must be '0' when check_swif is '1'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8018) * @check_swif: check iftype against software interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8019) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8020) * Check whether the interface is allowed to operate; additionally, this API
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8021) * can be used to check iftype against the software interfaces when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8022) * check_swif is '1'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8023) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8024) bool cfg80211_iftype_allowed(struct wiphy *wiphy, enum nl80211_iftype iftype,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8025) bool is_4addr, u8 check_swif);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8026)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8027)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8028) /* Logging, debugging and troubleshooting/diagnostic helpers. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8029)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8030) /* wiphy_printk helpers, similar to dev_printk */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8031)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8032) #define wiphy_printk(level, wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8033) dev_printk(level, &(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8034) #define wiphy_emerg(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8035) dev_emerg(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8036) #define wiphy_alert(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8037) dev_alert(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8038) #define wiphy_crit(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8039) dev_crit(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8040) #define wiphy_err(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8041) dev_err(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8042) #define wiphy_warn(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8043) dev_warn(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8044) #define wiphy_notice(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8045) dev_notice(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8046) #define wiphy_info(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8047) dev_info(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8048)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8049) #define wiphy_err_ratelimited(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8050) dev_err_ratelimited(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8051) #define wiphy_warn_ratelimited(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8052) dev_warn_ratelimited(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8053)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8054) #define wiphy_debug(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8055) wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8056)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8057) #define wiphy_dbg(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8058) dev_dbg(&(wiphy)->dev, format, ##args)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8059)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8060) #if defined(VERBOSE_DEBUG)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8061) #define wiphy_vdbg wiphy_dbg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8062) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8063) #define wiphy_vdbg(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8064) ({ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8065) if (0) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8066) wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8067) 0; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8068) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8069) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8070)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8071) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8072) * wiphy_WARN() acts like wiphy_printk(), but with the key difference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8073) * of using a WARN/WARN_ON to get the message out, including the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8074) * file/line information and a backtrace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8075) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8076) #define wiphy_WARN(wiphy, format, args...) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8077) WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8078)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8079) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8080) * cfg80211_update_owe_info_event - Notify the peer's OWE info to user space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8081) * @netdev: network device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8082) * @owe_info: peer's owe info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8083) * @gfp: allocation flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8084) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8085) void cfg80211_update_owe_info_event(struct net_device *netdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8086) struct cfg80211_update_owe_info *owe_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8087) gfp_t gfp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8088)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8089) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8090) * cfg80211_bss_flush - resets all the scan entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8091) * @wiphy: the wiphy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8092) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8093) void cfg80211_bss_flush(struct wiphy *wiphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8094)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8095) #endif /* __NET_CFG80211_H */