License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 19:29:12 +08:00
|
|
|
/*
|
|
|
|
* Portions of this file
|
2021-10-29 15:25:39 +08:00
|
|
|
* Copyright (C) 2018, 2020-2021 Intel Corporation
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 19:29:12 +08:00
|
|
|
*/
|
2007-09-21 01:09:35 +08:00
|
|
|
#ifndef __NET_WIRELESS_NL80211_H
|
|
|
|
#define __NET_WIRELESS_NL80211_H
|
|
|
|
|
|
|
|
#include "core.h"
|
|
|
|
|
2009-07-02 03:26:46 +08:00
|
|
|
int nl80211_init(void);
|
|
|
|
void nl80211_exit(void);
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 19:29:12 +08:00
|
|
|
|
|
|
|
void *nl80211hdr_put(struct sk_buff *skb, u32 portid, u32 seq,
|
|
|
|
int flags, u8 cmd);
|
|
|
|
bool nl80211_put_sta_rate(struct sk_buff *msg, struct rate_info *info,
|
|
|
|
int attr);
|
|
|
|
|
|
|
|
static inline u64 wdev_id(struct wireless_dev *wdev)
|
|
|
|
{
|
|
|
|
return (u64)wdev->identifier |
|
|
|
|
((u64)wiphy_to_rdev(wdev->wiphy)->wiphy_idx << 32);
|
|
|
|
}
|
|
|
|
|
|
|
|
int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
|
|
|
|
struct genl_info *info,
|
|
|
|
struct cfg80211_chan_def *chandef);
|
|
|
|
int nl80211_parse_random_mac(struct nlattr **attrs,
|
|
|
|
u8 *mac_addr, u8 *mac_addr_mask);
|
|
|
|
|
2014-05-26 19:52:25 +08:00
|
|
|
void nl80211_notify_wiphy(struct cfg80211_registered_device *rdev,
|
|
|
|
enum nl80211_commands cmd);
|
2016-08-04 05:58:33 +08:00
|
|
|
void nl80211_notify_iface(struct cfg80211_registered_device *rdev,
|
|
|
|
struct wireless_dev *wdev,
|
|
|
|
enum nl80211_commands cmd);
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_scan_start(struct cfg80211_registered_device *rdev,
|
2012-06-19 01:17:03 +08:00
|
|
|
struct wireless_dev *wdev);
|
cfg80211: send scan results from work queue
Due to the previous commit, when a scan finishes, it is in theory
possible to hit the following sequence:
1. interface starts being removed
2. scan is cancelled by driver and cfg80211 is notified
3. scan done work is scheduled
4. interface is removed completely, rdev->scan_req is freed,
event sent to userspace but scan done work remains pending
5. new scan is requested on another virtual interface
6. scan done work runs, freeing the still-running scan
To fix this situation, hang on to the scan done message and block
new scans while that is the case, and only send the message from
the work function, regardless of whether the scan_req is already
freed from interface removal. This makes step 5 above impossible
and changes step 6 to be
5. scan done work runs, sending the scan done message
As this can't work for wext, so we send the message immediately,
but this shouldn't be an issue since we still return -EBUSY.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-01-22 17:14:19 +08:00
|
|
|
struct sk_buff *nl80211_build_scan_msg(struct cfg80211_registered_device *rdev,
|
|
|
|
struct wireless_dev *wdev, bool aborted);
|
2016-12-16 19:21:54 +08:00
|
|
|
void nl80211_send_scan_msg(struct cfg80211_registered_device *rdev,
|
|
|
|
struct sk_buff *msg);
|
2017-04-13 20:06:27 +08:00
|
|
|
void nl80211_send_sched_scan(struct cfg80211_sched_scan_request *req, u32 cmd);
|
2014-12-16 01:26:00 +08:00
|
|
|
void nl80211_common_reg_change_event(enum nl80211_commands cmd_id,
|
|
|
|
struct regulatory_request *request);
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
nl80211_send_reg_change_event(struct regulatory_request *request)
|
|
|
|
{
|
|
|
|
nl80211_common_reg_change_event(NL80211_CMD_REG_CHANGE, request);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
nl80211_send_wiphy_reg_change_event(struct regulatory_request *request)
|
|
|
|
{
|
|
|
|
nl80211_common_reg_change_event(NL80211_CMD_WIPHY_REG_CHANGE, request);
|
|
|
|
}
|
|
|
|
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_rx_auth(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev,
|
2009-07-02 03:26:47 +08:00
|
|
|
const u8 *buf, size_t len, gfp_t gfp);
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev,
|
2022-06-28 22:25:37 +08:00
|
|
|
struct cfg80211_rx_assoc_resp *data);
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_deauth(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev,
|
2020-12-06 20:54:42 +08:00
|
|
|
const u8 *buf, size_t len,
|
|
|
|
bool reconnect, gfp_t gfp);
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev,
|
2020-12-06 20:54:42 +08:00
|
|
|
const u8 *buf, size_t len,
|
|
|
|
bool reconnect, gfp_t gfp);
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_auth_timeout(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev,
|
2009-07-02 03:26:47 +08:00
|
|
|
const u8 *addr, gfp_t gfp);
|
2009-07-02 03:26:46 +08:00
|
|
|
void nl80211_send_assoc_timeout(struct cfg80211_registered_device *rdev,
|
2009-03-28 02:53:56 +08:00
|
|
|
struct net_device *netdev,
|
2009-07-02 03:26:47 +08:00
|
|
|
const u8 *addr, gfp_t gfp);
|
2009-07-02 03:26:54 +08:00
|
|
|
void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
|
2017-03-31 05:22:33 +08:00
|
|
|
struct net_device *netdev,
|
|
|
|
struct cfg80211_connect_resp_params *params,
|
2017-01-13 07:12:21 +08:00
|
|
|
gfp_t gfp);
|
2009-07-02 03:26:54 +08:00
|
|
|
void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
|
2017-04-26 15:58:49 +08:00
|
|
|
struct net_device *netdev,
|
|
|
|
struct cfg80211_roam_info *info, gfp_t gfp);
|
2017-09-29 20:21:49 +08:00
|
|
|
void nl80211_send_port_authorized(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev, const u8 *bssid);
|
2009-07-02 03:26:54 +08:00
|
|
|
void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev, u16 reason,
|
2009-07-07 09:56:11 +08:00
|
|
|
const u8 *ie, size_t ie_len, bool from_ap);
|
2009-07-02 03:26:54 +08:00
|
|
|
|
2009-07-02 03:26:46 +08:00
|
|
|
void
|
2009-03-28 03:59:49 +08:00
|
|
|
nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev, const u8 *addr,
|
|
|
|
enum nl80211_key_type key_type,
|
2009-07-02 03:26:47 +08:00
|
|
|
int key_id, const u8 *tsc, gfp_t gfp);
|
2007-09-21 01:09:35 +08:00
|
|
|
|
2009-07-02 03:26:46 +08:00
|
|
|
void
|
2009-04-03 02:08:09 +08:00
|
|
|
nl80211_send_beacon_hint_event(struct wiphy *wiphy,
|
|
|
|
struct ieee80211_channel *channel_before,
|
|
|
|
struct ieee80211_channel *channel_after);
|
|
|
|
|
2009-04-20 03:24:32 +08:00
|
|
|
void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
|
|
|
|
struct net_device *netdev, const u8 *bssid,
|
|
|
|
gfp_t gfp);
|
|
|
|
|
2010-08-12 21:38:38 +08:00
|
|
|
int nl80211_send_mgmt(struct cfg80211_registered_device *rdev,
|
2012-06-15 21:30:18 +08:00
|
|
|
struct wireless_dev *wdev, u32 nlpid,
|
2012-03-06 05:18:41 +08:00
|
|
|
int freq, int sig_dbm,
|
2013-08-15 19:51:28 +08:00
|
|
|
const u8 *buf, size_t len, u32 flags, gfp_t gfp);
|
2013-02-09 01:16:19 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
nl80211_radar_notify(struct cfg80211_registered_device *rdev,
|
2013-11-06 20:55:51 +08:00
|
|
|
const struct cfg80211_chan_def *chandef,
|
2013-02-09 01:16:19 +08:00
|
|
|
enum nl80211_radar_event event,
|
|
|
|
struct net_device *netdev, gfp_t gfp);
|
|
|
|
|
2014-01-24 21:06:29 +08:00
|
|
|
void nl80211_send_ap_stopped(struct wireless_dev *wdev);
|
|
|
|
|
2013-06-29 02:51:26 +08:00
|
|
|
void cfg80211_rdev_free_coalesce(struct cfg80211_registered_device *rdev);
|
|
|
|
|
cfg80211: add peer measurement with FTM initiator API
Add a new "peer measurement" API, that can be used to measure
certain things related to a peer. Right now, only implement
FTM (flight time measurement) over it, but the idea is that
it'll be extensible to also support measuring the necessary
things to calculate e.g. angle-of-arrival for WiGig.
The API is structured to have a generic list of peers and
channels to measure with/on, and then for each of those a
set of measurements (again, only FTM right now) to perform.
Results are sent to the requesting socket, including a final
complete message.
Closing the controlling netlink socket will abort a running
measurement.
v3:
- add a bit to report "final" for partial results
- remove list keeping etc. and just unicast out the results
to the requester (big code reduction ...)
- also send complete message unicast, and as a result
remove the multicast group
- separate out struct cfg80211_pmsr_ftm_request_peer
from struct cfg80211_pmsr_request_peer
- document timeout == 0 if no timeout
- disallow setting timeout nl80211 attribute to 0,
must not include attribute for no timeout
- make MAC address randomization optional
- change num bursts exponent default to 0 (1 burst, rather
rather than the old default of 15==don't care)
v4:
- clarify NL80211_ATTR_TIMEOUT documentation
v5:
- remove unnecessary nl80211 multicast/family changes
- remove partial results bit/flag, final is sufficient
- add max_bursts_exponent, max_ftms_per_burst to capability
- rename "frames per burst" -> "FTMs per burst"
v6:
- rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
and call it in leave, so the device can't go down with any
pending measurements
v7:
- wording fixes (Lior)
- fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
v8:
- copyright statements
- minor coding style fixes
- fix error path leak
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-09-10 19:29:12 +08:00
|
|
|
/* peer measurement */
|
|
|
|
int nl80211_pmsr_start(struct sk_buff *skb, struct genl_info *info);
|
|
|
|
int nl80211_pmsr_dump_results(struct sk_buff *skb, struct netlink_callback *cb);
|
|
|
|
|
2007-09-21 01:09:35 +08:00
|
|
|
#endif /* __NET_WIRELESS_NL80211_H */
|