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 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2012-07-20 09:15:04 +00:00
|
|
|
* Copyright IBM Corp. 2002, 2009
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2009-06-16 08:30:20 +00:00
|
|
|
* Author(s): Arnd Bergmann <arndb@de.ibm.com>
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2009-06-16 08:30:20 +00:00
|
|
|
* Interface for CCW device drivers
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
#ifndef _S390_CCWDEV_H_
|
|
|
|
#define _S390_CCWDEV_H_
|
|
|
|
|
|
|
|
#include <linux/device.h>
|
|
|
|
#include <linux/mod_devicetable.h>
|
2020-04-16 13:08:41 +00:00
|
|
|
#include <asm/chsc.h>
|
2008-07-14 07:58:51 +00:00
|
|
|
#include <asm/fcx.h>
|
2011-10-30 14:16:04 +00:00
|
|
|
#include <asm/irq.h>
|
2012-12-13 12:38:51 +00:00
|
|
|
#include <asm/schid.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* structs from asm/cio.h */
|
|
|
|
struct irb;
|
|
|
|
struct ccw1;
|
2007-05-10 13:45:42 +00:00
|
|
|
struct ccw_dev_id;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* simplified initializers for struct ccw_device:
|
|
|
|
* CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
|
|
|
|
* entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */
|
|
|
|
#define CCW_DEVICE(cu, cum) \
|
|
|
|
.cu_type=(cu), .cu_model=(cum), \
|
|
|
|
.match_flags=(CCW_DEVICE_ID_MATCH_CU_TYPE \
|
|
|
|
| (cum ? CCW_DEVICE_ID_MATCH_CU_MODEL : 0))
|
|
|
|
|
|
|
|
#define CCW_DEVICE_DEVTYPE(cu, cum, dev, devm) \
|
|
|
|
.cu_type=(cu), .cu_model=(cum), .dev_type=(dev), .dev_model=(devm),\
|
|
|
|
.match_flags=CCW_DEVICE_ID_MATCH_CU_TYPE \
|
|
|
|
| ((cum) ? CCW_DEVICE_ID_MATCH_CU_MODEL : 0) \
|
|
|
|
| CCW_DEVICE_ID_MATCH_DEVICE_TYPE \
|
|
|
|
| ((devm) ? CCW_DEVICE_ID_MATCH_DEVICE_MODEL : 0)
|
|
|
|
|
|
|
|
/* scan through an array of device ids and return the first
|
|
|
|
* entry that matches the device.
|
|
|
|
*
|
|
|
|
* the array must end with an entry containing zero match_flags
|
|
|
|
*/
|
|
|
|
static inline const struct ccw_device_id *
|
|
|
|
ccw_device_id_match(const struct ccw_device_id *array,
|
|
|
|
const struct ccw_device_id *match)
|
|
|
|
{
|
|
|
|
const struct ccw_device_id *id = array;
|
|
|
|
|
|
|
|
for (id = array; id->match_flags; id++) {
|
|
|
|
if ((id->match_flags & CCW_DEVICE_ID_MATCH_CU_TYPE)
|
|
|
|
&& (id->cu_type != match->cu_type))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ((id->match_flags & CCW_DEVICE_ID_MATCH_CU_MODEL)
|
|
|
|
&& (id->cu_model != match->cu_model))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ((id->match_flags & CCW_DEVICE_ID_MATCH_DEVICE_TYPE)
|
|
|
|
&& (id->dev_type != match->dev_type))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ((id->match_flags & CCW_DEVICE_ID_MATCH_DEVICE_MODEL)
|
|
|
|
&& (id->dev_model != match->dev_model))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2006-07-12 14:41:55 +00:00
|
|
|
return NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-10-12 14:11:17 +00:00
|
|
|
/**
|
|
|
|
* struct ccw_device - channel attached device
|
|
|
|
* @ccwlock: pointer to device lock
|
|
|
|
* @id: id of this device
|
|
|
|
* @drv: ccw driver for this device
|
|
|
|
* @dev: embedded device structure
|
|
|
|
* @online: online status of device
|
|
|
|
* @handler: interrupt handler
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2007-10-12 14:11:17 +00:00
|
|
|
* @handler is a member of the device rather than the driver since a driver
|
|
|
|
* can have different interrupt handlers for different ccw devices
|
|
|
|
* (multi-subchannel drivers).
|
|
|
|
*/
|
2005-04-16 22:20:36 +00:00
|
|
|
struct ccw_device {
|
|
|
|
spinlock_t *ccwlock;
|
2007-10-12 14:11:17 +00:00
|
|
|
/* private: */
|
2005-04-16 22:20:36 +00:00
|
|
|
struct ccw_device_private *private; /* cio private information */
|
2007-10-12 14:11:17 +00:00
|
|
|
/* public: */
|
|
|
|
struct ccw_device_id id;
|
|
|
|
struct ccw_driver *drv;
|
|
|
|
struct device dev;
|
2005-04-16 22:20:36 +00:00
|
|
|
int online;
|
|
|
|
void (*handler) (struct ccw_device *, unsigned long, struct irb *);
|
|
|
|
};
|
|
|
|
|
2010-10-25 14:10:34 +00:00
|
|
|
/*
|
|
|
|
* Possible events used by the path_event notifier.
|
|
|
|
*/
|
|
|
|
#define PE_NONE 0x0
|
|
|
|
#define PE_PATH_GONE 0x1 /* A path is no longer available. */
|
|
|
|
#define PE_PATH_AVAILABLE 0x2 /* A path has become available and
|
|
|
|
was successfully verified. */
|
|
|
|
#define PE_PATHGROUP_ESTABLISHED 0x4 /* A pathgroup was reset and had
|
|
|
|
to be established again. */
|
|
|
|
|
2010-05-26 21:27:08 +00:00
|
|
|
/*
|
|
|
|
* Possible CIO actions triggered by the unit check handler.
|
|
|
|
*/
|
|
|
|
enum uc_todo {
|
|
|
|
UC_TODO_RETRY,
|
|
|
|
UC_TODO_RETRY_ON_NEW_PATH,
|
|
|
|
UC_TODO_STOP
|
|
|
|
};
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-10-12 14:11:17 +00:00
|
|
|
/**
|
|
|
|
* struct ccw driver - device driver for channel attached devices
|
|
|
|
* @ids: ids supported by this driver
|
|
|
|
* @probe: function called on probe
|
|
|
|
* @remove: function called on remove
|
|
|
|
* @set_online: called when setting device online
|
|
|
|
* @set_offline: called when setting device offline
|
|
|
|
* @notify: notify driver of device state changes
|
2010-10-25 14:10:34 +00:00
|
|
|
* @path_event: notify driver of channel path events
|
2007-10-12 14:11:21 +00:00
|
|
|
* @shutdown: called at device shutdown
|
2009-06-16 08:30:20 +00:00
|
|
|
* @prepare: prepare for pm state transition
|
|
|
|
* @complete: undo work done in @prepare
|
|
|
|
* @freeze: callback for freezing during hibernation snapshotting
|
|
|
|
* @thaw: undo work done in @freeze
|
|
|
|
* @restore: callback for restoring after hibernation
|
2010-05-26 21:27:08 +00:00
|
|
|
* @uc_handler: callback for unit check handler
|
2007-10-12 14:11:17 +00:00
|
|
|
* @driver: embedded device driver structure
|
2011-10-30 14:16:04 +00:00
|
|
|
* @int_class: interruption class to use for accounting interrupts
|
2007-10-12 14:11:17 +00:00
|
|
|
*/
|
2005-04-16 22:20:36 +00:00
|
|
|
struct ccw_driver {
|
2007-10-12 14:11:17 +00:00
|
|
|
struct ccw_device_id *ids;
|
|
|
|
int (*probe) (struct ccw_device *);
|
2005-04-16 22:20:36 +00:00
|
|
|
void (*remove) (struct ccw_device *);
|
|
|
|
int (*set_online) (struct ccw_device *);
|
|
|
|
int (*set_offline) (struct ccw_device *);
|
|
|
|
int (*notify) (struct ccw_device *, int);
|
2010-10-25 14:10:34 +00:00
|
|
|
void (*path_event) (struct ccw_device *, int *);
|
2007-10-12 14:11:21 +00:00
|
|
|
void (*shutdown) (struct ccw_device *);
|
2009-06-16 08:30:20 +00:00
|
|
|
int (*prepare) (struct ccw_device *);
|
|
|
|
void (*complete) (struct ccw_device *);
|
|
|
|
int (*freeze)(struct ccw_device *);
|
|
|
|
int (*thaw) (struct ccw_device *);
|
|
|
|
int (*restore)(struct ccw_device *);
|
2010-05-26 21:27:08 +00:00
|
|
|
enum uc_todo (*uc_handler) (struct ccw_device *, struct irb *);
|
2007-10-12 14:11:17 +00:00
|
|
|
struct device_driver driver;
|
2011-10-30 14:16:04 +00:00
|
|
|
enum interruption_class int_class;
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
|
|
|
|
const char *bus_id);
|
|
|
|
|
|
|
|
/* devices drivers call these during module load and unload.
|
|
|
|
* When a driver is registered, its probe method is called
|
|
|
|
* when new devices for its type pop up */
|
|
|
|
extern int ccw_driver_register (struct ccw_driver *driver);
|
|
|
|
extern void ccw_driver_unregister (struct ccw_driver *driver);
|
|
|
|
|
|
|
|
struct ccw1;
|
|
|
|
|
2007-02-12 14:47:18 +00:00
|
|
|
extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long);
|
2005-04-16 22:20:36 +00:00
|
|
|
extern int ccw_device_set_options(struct ccw_device *, unsigned long);
|
2007-02-12 14:47:18 +00:00
|
|
|
extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
|
2009-12-07 11:51:30 +00:00
|
|
|
int ccw_device_is_pathgroup(struct ccw_device *cdev);
|
|
|
|
int ccw_device_is_multipath(struct ccw_device *cdev);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Allow for i/o completion notification after primary interrupt status. */
|
|
|
|
#define CCWDEV_EARLY_NOTIFICATION 0x0001
|
|
|
|
/* Report all interrupt conditions. */
|
|
|
|
#define CCWDEV_REPORT_ALL 0x0002
|
|
|
|
/* Try to perform path grouping. */
|
|
|
|
#define CCWDEV_DO_PATHGROUP 0x0004
|
|
|
|
/* Allow forced onlining of boxed devices. */
|
|
|
|
#define CCWDEV_ALLOW_FORCE 0x0008
|
2009-12-07 11:51:30 +00:00
|
|
|
/* Try to use multipath mode. */
|
|
|
|
#define CCWDEV_DO_MULTIPATH 0x0010
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
|
|
|
|
unsigned long, __u8, unsigned long);
|
|
|
|
extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *,
|
|
|
|
unsigned long, __u8, unsigned long, int);
|
|
|
|
extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *,
|
|
|
|
unsigned long, __u8, __u8, unsigned long);
|
|
|
|
extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *,
|
|
|
|
unsigned long, __u8, __u8,
|
|
|
|
unsigned long, int);
|
|
|
|
|
|
|
|
|
|
|
|
extern int ccw_device_resume(struct ccw_device *);
|
|
|
|
extern int ccw_device_halt(struct ccw_device *, unsigned long);
|
|
|
|
extern int ccw_device_clear(struct ccw_device *, unsigned long);
|
2008-07-14 07:58:51 +00:00
|
|
|
int ccw_device_tm_start_key(struct ccw_device *cdev, struct tcw *tcw,
|
|
|
|
unsigned long intparm, u8 lpm, u8 key);
|
|
|
|
int ccw_device_tm_start_key(struct ccw_device *, struct tcw *,
|
|
|
|
unsigned long, u8, u8);
|
|
|
|
int ccw_device_tm_start_timeout_key(struct ccw_device *, struct tcw *,
|
|
|
|
unsigned long, u8, u8, int);
|
|
|
|
int ccw_device_tm_start(struct ccw_device *, struct tcw *,
|
|
|
|
unsigned long, u8);
|
|
|
|
int ccw_device_tm_start_timeout(struct ccw_device *, struct tcw *,
|
|
|
|
unsigned long, u8, int);
|
|
|
|
int ccw_device_tm_intrg(struct ccw_device *cdev);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2011-01-05 11:47:56 +00:00
|
|
|
int ccw_device_get_mdc(struct ccw_device *cdev, u8 mask);
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
extern int ccw_device_set_online(struct ccw_device *cdev);
|
|
|
|
extern int ccw_device_set_offline(struct ccw_device *cdev);
|
|
|
|
|
|
|
|
|
|
|
|
extern struct ciw *ccw_device_get_ciw(struct ccw_device *, __u32 cmd);
|
|
|
|
extern __u8 ccw_device_get_path_mask(struct ccw_device *);
|
2007-05-10 13:45:42 +00:00
|
|
|
extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#define get_ccwdev_lock(x) (x)->ccwlock
|
|
|
|
|
|
|
|
#define to_ccwdev(n) container_of(n, struct ccw_device, dev)
|
|
|
|
#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)
|
|
|
|
|
2014-01-27 12:28:10 +00:00
|
|
|
extern struct ccw_device *ccw_device_create_console(struct ccw_driver *);
|
|
|
|
extern void ccw_device_destroy_console(struct ccw_device *);
|
|
|
|
extern int ccw_device_enable_console(struct ccw_device *);
|
2013-04-13 10:53:21 +00:00
|
|
|
extern void ccw_device_wait_idle(struct ccw_device *);
|
2013-04-13 10:56:51 +00:00
|
|
|
extern int ccw_device_force_console(struct ccw_device *);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2019-03-26 11:41:09 +00:00
|
|
|
extern void *ccw_device_dma_zalloc(struct ccw_device *cdev, size_t size);
|
|
|
|
extern void ccw_device_dma_free(struct ccw_device *cdev,
|
|
|
|
void *cpu_addr, size_t size);
|
|
|
|
|
2010-08-09 16:12:50 +00:00
|
|
|
int ccw_device_siosl(struct ccw_device *);
|
|
|
|
|
2012-05-30 14:03:22 +00:00
|
|
|
extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
|
|
|
|
|
2017-06-29 11:27:22 +00:00
|
|
|
struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int);
|
2016-06-23 08:58:15 +00:00
|
|
|
u8 *ccw_device_get_util_str(struct ccw_device *cdev, int chp_idx);
|
2020-04-16 13:08:41 +00:00
|
|
|
int ccw_device_pnso(struct ccw_device *cdev,
|
2020-09-10 17:23:44 +00:00
|
|
|
struct chsc_pnso_area *pnso_area, u8 oc,
|
|
|
|
struct chsc_pnso_resume_token resume_token, int cnc);
|
2020-09-10 17:23:45 +00:00
|
|
|
int ccw_device_get_cssid(struct ccw_device *cdev, u8 *cssid);
|
|
|
|
int ccw_device_get_iid(struct ccw_device *cdev, u8 *iid);
|
|
|
|
int ccw_device_get_chpid(struct ccw_device *cdev, int chp_idx, u8 *chpid);
|
|
|
|
int ccw_device_get_chid(struct ccw_device *cdev, int chp_idx, u16 *chid);
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif /* _S390_CCWDEV_H_ */
|