404

[ Avaa Bypassed ]




Upload:

Command:

botdev@13.59.219.20: ~ $
#ifndef __NET_REGULATORY_H
#define __NET_REGULATORY_H
/*
 * regulatory support structures
 *
 * Copyright 2008-2009	Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/rcupdate.h>

/**
 * enum environment_cap - Environment parsed from country IE
 * @ENVIRON_ANY: indicates country IE applies to both indoor and
 *	outdoor operation.
 * @ENVIRON_INDOOR: indicates country IE applies only to indoor operation
 * @ENVIRON_OUTDOOR: indicates country IE applies only to outdoor operation
 */
enum environment_cap {
	ENVIRON_ANY,
	ENVIRON_INDOOR,
	ENVIRON_OUTDOOR,
};

/**
 * struct regulatory_request - used to keep track of regulatory requests
 *
 * @rcu_head: RCU head struct used to free the request
 * @wiphy_idx: this is set if this request's initiator is
 *	%REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
 *	can be used by the wireless core to deal with conflicts
 *	and potentially inform users of which devices specifically
 *	cased the conflicts.
 * @initiator: indicates who sent this request, could be any of
 *	of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
 *	regulatory domain. We have a few special codes:
 *	00 - World regulatory domain
 *	99 - built by driver but a specific alpha2 cannot be determined
 *	98 - result of an intersection between two regulatory domains
 *	97 - regulatory domain has not yet been configured
 * @dfs_region: If CRDA responded with a regulatory domain that requires
 *	DFS master operation on a known DFS region (NL80211_DFS_*),
 *	dfs_region represents that region. Drivers can use this and the
 *	@alpha2 to adjust their device's DFS parameters as required.
 * @user_reg_hint_type: if the @initiator was of type
 *	%NL80211_REGDOM_SET_BY_USER, this classifies the type
 *	of hint passed. This could be any of the %NL80211_USER_REG_HINT_*
 *	types.
 * @intersect: indicates whether the wireless core should intersect
 *	the requested regulatory domain with the presently set regulatory
 *	domain.
 * @processed: indicates whether or not this requests has already been
 *	processed. When the last request is processed it means that the
 *	currently regulatory domain set on cfg80211 is updated from
 *	CRDA and can be used by other regulatory requests. When a
 *	the last request is not yet processed we must yield until it
 *	is processed before processing any new requests.
 * @country_ie_checksum: checksum of the last processed and accepted
 *	country IE
 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
 *	indoor, or if it doesn't matter
 * @list: used to insert into the reg_requests_list linked list
 */
struct regulatory_request {
	struct rcu_head rcu_head;
	int wiphy_idx;
	enum nl80211_reg_initiator initiator;
	enum nl80211_user_reg_hint_type user_reg_hint_type;
	char alpha2[3];
	enum nl80211_dfs_regions dfs_region;
	bool intersect;
	bool processed;
	enum environment_cap country_ie_env;
	struct list_head list;
};

/**
 * enum ieee80211_regulatory_flags - device regulatory flags
 *
 * @REGULATORY_CUSTOM_REG: tells us the driver for this device
 *	has its own custom regulatory domain and cannot identify the
 *	ISO / IEC 3166 alpha2 it belongs to. When this is enabled
 *	we will disregard the first regulatory hint (when the
 *	initiator is %REGDOM_SET_BY_CORE). Drivers that use
 *	wiphy_apply_custom_regulatory() should have this flag set
 *	or the regulatory core will set it for the wiphy.
 *	If you use regulatory_hint() *after* using
 *	wiphy_apply_custom_regulatory() the wireless core will
 *	clear the REGULATORY_CUSTOM_REG for your wiphy as it would be
 *	implied that the device somehow gained knowledge of its region.
 * @REGULATORY_STRICT_REG: tells us that the wiphy for this device
 *	has regulatory domain that it wishes to be considered as the
 *	superset for regulatory rules. After this device gets its regulatory
 *	domain programmed further regulatory hints shall only be considered
 *	for this device to enhance regulatory compliance, forcing the
 *	device to only possibly use subsets of the original regulatory
 *	rules. For example if channel 13 and 14 are disabled by this
 *	device's regulatory domain no user specified regulatory hint which
 *	has these channels enabled would enable them for this wiphy,
 *	the device's original regulatory domain will be trusted as the
 *	base. You can program the superset of regulatory rules for this
 *	wiphy with regulatory_hint() for cards programmed with an
 *	ISO3166-alpha2 country code. wiphys that use regulatory_hint()
 *	will have their wiphy->regd programmed once the regulatory
 *	domain is set, and all other regulatory hints will be ignored
 *	until their own regulatory domain gets programmed.
 * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to
 *	ensure that passive scan flags and beaconing flags may not be lifted by
 *	cfg80211 due to regulatory beacon hints. For more information on beacon
 *	hints read the documenation for regulatory_hint_found_beacon()
 * @REGULATORY_COUNTRY_IE_FOLLOW_POWER:  for devices that have a preference
 *	that even though they may have programmed their own custom power
 *	setting prior to wiphy registration, they want to ensure their channel
 *	power settings are updated for this connection with the power settings
 *	derived from the regulatory domain. The regulatory domain used will be
 *	based on the ISO3166-alpha2 from country IE provided through
 *	regulatory_hint_country_ie()
 * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore
 * 	all country IE information processed by the regulatory core. This will
 * 	override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
 * 	be ignored.
 * @REGULATORY_ENABLE_RELAX_NO_IR: for devices that wish to allow the
 *      NO_IR relaxation, which enables transmissions on channels on which
 *      otherwise initiating radiation is not allowed. This will enable the
 *      relaxations enabled under the CFG80211_REG_RELAX_NO_IR configuration
 *      option
 * @REGULATORY_IGNORE_STALE_KICKOFF: the regulatory core will _not_ make sure
 *	all interfaces on this wiphy reside on allowed channels. If this flag
 *	is not set, upon a regdomain change, the interfaces are given a grace
 *	period (currently 60 seconds) to disconnect or move to an allowed
 *	channel. Interfaces on forbidden channels are forcibly disconnected.
 *	Currently these types of interfaces are supported for enforcement:
 *	NL80211_IFTYPE_ADHOC, NL80211_IFTYPE_STATION, NL80211_IFTYPE_AP,
 *	NL80211_IFTYPE_AP_VLAN, NL80211_IFTYPE_MONITOR,
 *	NL80211_IFTYPE_P2P_CLIENT, NL80211_IFTYPE_P2P_GO,
 *	NL80211_IFTYPE_P2P_DEVICE. The flag will be set by default if a device
 *	includes any modes unsupported for enforcement checking.
 * @REGULATORY_WIPHY_SELF_MANAGED: for devices that employ wiphy-specific
 *	regdom management. These devices will ignore all regdom changes not
 *	originating from their own wiphy.
 *	A self-managed wiphys only employs regulatory information obtained from
 *	the FW and driver and does not use other cfg80211 sources like
 *	beacon-hints, country-code IEs and hints from other devices on the same
 *	system. Conversely, a self-managed wiphy does not share its regulatory
 *	hints with other devices in the system. If a system contains several
 *	devices, one or more of which are self-managed, there might be
 *	contradictory regulatory settings between them. Usage of flag is
 *	generally discouraged. Only use it if the FW/driver is incompatible
 *	with non-locally originated hints.
 *	This flag is incompatible with the flags: %REGULATORY_CUSTOM_REG,
 *	%REGULATORY_STRICT_REG, %REGULATORY_COUNTRY_IE_FOLLOW_POWER,
 *	%REGULATORY_COUNTRY_IE_IGNORE and %REGULATORY_DISABLE_BEACON_HINTS.
 *	Mixing any of the above flags with this flag will result in a failure
 *	to register the wiphy. This flag implies
 *	%REGULATORY_DISABLE_BEACON_HINTS and %REGULATORY_COUNTRY_IE_IGNORE.
 */
enum ieee80211_regulatory_flags {
	REGULATORY_CUSTOM_REG			= BIT(0),
	REGULATORY_STRICT_REG			= BIT(1),
	REGULATORY_DISABLE_BEACON_HINTS		= BIT(2),
	REGULATORY_COUNTRY_IE_FOLLOW_POWER	= BIT(3),
	REGULATORY_COUNTRY_IE_IGNORE		= BIT(4),
	REGULATORY_ENABLE_RELAX_NO_IR           = BIT(5),
	REGULATORY_IGNORE_STALE_KICKOFF         = BIT(6),
	REGULATORY_WIPHY_SELF_MANAGED		= BIT(7),
};

struct ieee80211_freq_range {
	u32 start_freq_khz;
	u32 end_freq_khz;
	u32 max_bandwidth_khz;
};

struct ieee80211_power_rule {
	u32 max_antenna_gain;
	u32 max_eirp;
};

struct ieee80211_reg_rule {
	struct ieee80211_freq_range freq_range;
	struct ieee80211_power_rule power_rule;
	u32 flags;
	u32 dfs_cac_ms;
};

struct ieee80211_regdomain {
	struct rcu_head rcu_head;
	u32 n_reg_rules;
	char alpha2[3];
	enum nl80211_dfs_regions dfs_region;
	struct ieee80211_reg_rule reg_rules[];
};

#define MHZ_TO_KHZ(freq) ((freq) * 1000)
#define KHZ_TO_MHZ(freq) ((freq) / 1000)
#define DBI_TO_MBI(gain) ((gain) * 100)
#define MBI_TO_DBI(gain) ((gain) / 100)
#define DBM_TO_MBM(gain) ((gain) * 100)
#define MBM_TO_DBM(gain) ((gain) / 100)

#define REG_RULE_EXT(start, end, bw, gain, eirp, dfs_cac, reg_flags)	\
{									\
	.freq_range.start_freq_khz = MHZ_TO_KHZ(start),			\
	.freq_range.end_freq_khz = MHZ_TO_KHZ(end),			\
	.freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw),			\
	.power_rule.max_antenna_gain = DBI_TO_MBI(gain),		\
	.power_rule.max_eirp = DBM_TO_MBM(eirp),			\
	.flags = reg_flags,						\
	.dfs_cac_ms = dfs_cac,						\
}

#define REG_RULE(start, end, bw, gain, eirp, reg_flags) \
	REG_RULE_EXT(start, end, bw, gain, eirp, 0, reg_flags)

#endif

Filemanager

Name Type Size Permission Actions
9p Folder 0755
bluetooth Folder 0755
caif Folder 0755
iucv Folder 0755
netfilter Folder 0755
netns Folder 0755
nfc Folder 0755
phonet Folder 0755
sctp Folder 0755
tc_act Folder 0755
6lowpan.h File 10.03 KB 0644
Space.h File 1.15 KB 0644
act_api.h File 6.38 KB 0644
addrconf.h File 12.63 KB 0644
af_ieee802154.h File 1.55 KB 0644
af_rxrpc.h File 2.79 KB 0644
af_unix.h File 2.22 KB 0644
af_vsock.h File 7.21 KB 0644
ah.h File 382 B 0644
arp.h File 2 KB 0644
atmclip.h File 1.48 KB 0644
ax25.h File 15.02 KB 0644
ax88796.h File 998 B 0644
bond_3ad.h File 9.79 KB 0644
bond_alb.h File 6.6 KB 0644
bond_options.h File 3.92 KB 0644
bonding.h File 19.1 KB 0644
busy_poll.h File 3.8 KB 0644
calipso.h File 2.15 KB 0644
cfg80211-wext.h File 1.95 KB 0644
cfg80211.h File 221.24 KB 0644
cfg802154.h File 10.89 KB 0644
checksum.h File 4.76 KB 0644
cipso_ipv4.h File 8.2 KB 0644
cls_cgroup.h File 2.15 KB 0644
codel.h File 5.65 KB 0644
codel_impl.h File 7.98 KB 0644
codel_qdisc.h File 2.9 KB 0644
compat.h File 2.11 KB 0644
datalink.h File 619 B 0644
dcbevent.h File 1.26 KB 0644
dcbnl.h File 4.2 KB 0644
devlink.h File 13.25 KB 0644
dn.h File 6.88 KB 0644
dn_dev.h File 5.36 KB 0644
dn_fib.h File 3.98 KB 0644
dn_neigh.h File 968 B 0644
dn_nsp.h File 5.83 KB 0644
dn_route.h File 4.36 KB 0644
dsa.h File 13.94 KB 0644
dsfield.h File 1.11 KB 0644
dst.h File 13.48 KB 0644
dst_cache.h File 2.53 KB 0644
dst_metadata.h File 5.39 KB 0644
dst_ops.h File 2 KB 0644
erspan.h File 2.11 KB 0644
esp.h File 877 B 0644
ethoc.h File 538 B 0644
fib_notifier.h File 1.29 KB 0644
fib_rules.h File 4.18 KB 0644
firewire.h File 636 B 0644
flow.h File 6.16 KB 0644
flow_dissector.h File 7.55 KB 0644
fou.h File 549 B 0644
fq.h File 2.67 KB 0644
fq_impl.h File 6.9 KB 0644
garp.h File 2.62 KB 0644
gen_stats.h File 2.34 KB 0644
genetlink.h File 11.3 KB 0644
geneve.h File 1.67 KB 0644
gre.h File 2.99 KB 0644
gro_cells.h File 443 B 0644
gtp.h File 633 B 0644
gue.h File 3.23 KB 0644
hwbm.h File 937 B 0644
icmp.h File 2.01 KB 0644
ieee80211_radiotap.h File 6.63 KB 0644
ieee802154_netdev.h File 9.14 KB 0644
if_inet6.h File 6.13 KB 0644
ife.h File 1.06 KB 0644
ila.h File 498 B 0644
inet6_connection_sock.h File 976 B 0644
inet6_hashtables.h File 3.7 KB 0644
inet_common.h File 1.89 KB 0644
inet_connection_sock.h File 10.48 KB 0644
inet_ecn.h File 6.02 KB 0644
inet_frag.h File 4.51 KB 0644
inet_hashtables.h File 12.91 KB 0644
inet_sock.h File 8.25 KB 0644
inet_timewait_sock.h File 3.82 KB 0644
inetpeer.h File 3.29 KB 0644
ip.h File 18.51 KB 0644
ip6_checksum.h File 2.89 KB 0644
ip6_fib.h File 10.04 KB 0644
ip6_route.h File 7.63 KB 0644
ip6_tunnel.h File 4.72 KB 0644
ip_fib.h File 10.72 KB 0644
ip_tunnels.h File 13.61 KB 0644
ip_vs.h File 46.78 KB 0644
ipcomp.h File 659 B 0644
ipconfig.h File 811 B 0644
ipv6.h File 29.97 KB 0644
ipv6_frag.h File 2.54 KB 0644
ipx.h File 4.4 KB 0644
iw_handler.h File 20.91 KB 0644
kcm.h File 4.96 KB 0644
l3mdev.h File 5.86 KB 0644
lapb.h File 4.75 KB 0644
lib80211.h File 3.92 KB 0644
llc.h File 4.41 KB 0644
llc_c_ac.h File 9.31 KB 0644
llc_c_ev.h File 10.68 KB 0644
llc_c_st.h File 1.72 KB 0644
llc_conn.h File 4.06 KB 0644
llc_if.h File 2.16 KB 0644
llc_pdu.h File 14.44 KB 0644
llc_s_ac.h File 1.55 KB 0644
llc_s_ev.h File 2.2 KB 0644
llc_s_st.h File 947 B 0644
llc_sap.h File 1.08 KB 0644
lwtunnel.h File 5.84 KB 0644
mac80211.h File 230.36 KB 0644
mac802154.h File 15.27 KB 0644
mip6.h File 1.58 KB 0644
mld.h File 2.8 KB 0644
mpls.h File 932 B 0644
mpls_iptunnel.h File 827 B 0644
mrp.h File 3.03 KB 0644
ncsi.h File 1.92 KB 0644
ndisc.h File 13.77 KB 0644
neighbour.h File 15.06 KB 0644
net_namespace.h File 10.08 KB 0644
net_ratelimit.h File 220 B 0644
netevent.h File 910 B 0644
netlabel.h File 20.74 KB 0644
netlink.h File 40.39 KB 0644
netprio_cgroup.h File 1.24 KB 0644
netrom.h File 7.68 KB 0644
nexthop.h File 865 B 0644
nl802154.h File 12.09 KB 0644
nsh.h File 12.31 KB 0644
p8022.h File 447 B 0644
ping.h File 3.45 KB 0644
pkt_cls.h File 17.34 KB 0644
pkt_sched.h File 4.05 KB 0644
pptp.h File 557 B 0644
protocol.h File 4.08 KB 0644
psample.h File 860 B 0644
psnap.h File 351 B 0644
raw.h File 2.07 KB 0644
rawv6.h File 854 B 0644
red.h File 10.45 KB 0644
regulatory.h File 10.12 KB 0644
request_sock.h File 6.46 KB 0644
rose.h File 7.62 KB 0644
route.h File 10.02 KB 0644
rtnetlink.h File 6.13 KB 0644
sch_generic.h File 23.3 KB 0644
scm.h File 3.5 KB 0644
secure_seq.h File 855 B 0644
seg6.h File 1.66 KB 0644
seg6_hmac.h File 1.65 KB 0644
slhc_vj.h File 6.67 KB 0644
smc.h File 440 B 0644
snmp.h File 5.23 KB 0644
sock.h File 69.75 KB 0644
sock_reuseport.h File 863 B 0644
stp.h File 383 B 0644
strparser.h File 3.75 KB 0644
switchdev.h File 6.52 KB 0644
tcp.h File 62.8 KB 0644
tcp_states.h File 1.26 KB 0644
timewait_sock.h File 1.11 KB 0644
tipc.h File 2.34 KB 0644
tls.h File 7.12 KB 0644
transp_v6.h File 2.08 KB 0644
tso.h File 515 B 0644
tun_proto.h File 988 B 0644
udp.h File 12.82 KB 0644
udp_tunnel.h File 5.12 KB 0644
udplite.h File 3.83 KB 0644
vsock_addr.h File 1.05 KB 0644
vxlan.h File 10.43 KB 0644
wext.h File 1.51 KB 0644
wimax.h File 19.97 KB 0644
x25.h File 9.43 KB 0644
x25device.h File 387 B 0644
xfrm.h File 53.72 KB 0644