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 */
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
2012-11-29 21:35:47 +08:00
|
|
|
* Copyright IBM Corp. 1999,2012
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2009-06-16 16:30:40 +08:00
|
|
|
* Author(s): Martin Peschke <mpeschke@de.ibm.com>
|
|
|
|
* Martin Schwidefsky <schwidefsky@de.ibm.com>
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SCLP_H__
|
|
|
|
#define __SCLP_H__
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/list.h>
|
2007-02-06 04:18:37 +08:00
|
|
|
#include <asm/sclp.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm/ebcdic.h>
|
|
|
|
|
|
|
|
/* maximum number of pages concerning our own memory management */
|
|
|
|
#define MAX_KMEM_PAGES (sizeof(unsigned long) << 3)
|
2013-05-24 18:30:03 +08:00
|
|
|
#define SCLP_CONSOLE_PAGES 6
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2018-01-23 22:07:09 +08:00
|
|
|
#define SCLP_EVTYP_MASK(T) (1UL << (sizeof(sccb_mask_t) * BITS_PER_BYTE - (T)))
|
2015-11-27 19:33:18 +08:00
|
|
|
|
2007-04-27 22:01:53 +08:00
|
|
|
#define EVTYP_OPCMD 0x01
|
|
|
|
#define EVTYP_MSG 0x02
|
2015-11-27 19:33:18 +08:00
|
|
|
#define EVTYP_CONFMGMDATA 0x04
|
2013-04-08 15:52:57 +08:00
|
|
|
#define EVTYP_DIAG_TEST 0x07
|
2007-04-27 22:01:53 +08:00
|
|
|
#define EVTYP_STATECHANGE 0x08
|
|
|
|
#define EVTYP_PMSGCMD 0x09
|
2015-11-27 19:33:18 +08:00
|
|
|
#define EVTYP_ASYNC 0x0A
|
|
|
|
#define EVTYP_CTLPROGIDENT 0x0B
|
2017-02-13 20:38:17 +08:00
|
|
|
#define EVTYP_STORE_DATA 0x0C
|
2015-11-27 18:18:02 +08:00
|
|
|
#define EVTYP_ERRNOTIFY 0x18
|
2007-04-27 22:01:53 +08:00
|
|
|
#define EVTYP_VT220MSG 0x1A
|
|
|
|
#define EVTYP_SDIAS 0x1C
|
2015-11-27 19:33:18 +08:00
|
|
|
#define EVTYP_SIGQUIESCE 0x1D
|
2011-05-23 16:24:43 +08:00
|
|
|
#define EVTYP_OCF 0x1E
|
2007-04-27 22:01:53 +08:00
|
|
|
|
2015-11-27 19:33:18 +08:00
|
|
|
#define EVTYP_OPCMD_MASK SCLP_EVTYP_MASK(EVTYP_OPCMD)
|
|
|
|
#define EVTYP_MSG_MASK SCLP_EVTYP_MASK(EVTYP_MSG)
|
|
|
|
#define EVTYP_CONFMGMDATA_MASK SCLP_EVTYP_MASK(EVTYP_CONFMGMDATA)
|
|
|
|
#define EVTYP_DIAG_TEST_MASK SCLP_EVTYP_MASK(EVTYP_DIAG_TEST)
|
|
|
|
#define EVTYP_STATECHANGE_MASK SCLP_EVTYP_MASK(EVTYP_STATECHANGE)
|
|
|
|
#define EVTYP_PMSGCMD_MASK SCLP_EVTYP_MASK(EVTYP_PMSGCMD)
|
|
|
|
#define EVTYP_ASYNC_MASK SCLP_EVTYP_MASK(EVTYP_ASYNC)
|
|
|
|
#define EVTYP_CTLPROGIDENT_MASK SCLP_EVTYP_MASK(EVTYP_CTLPROGIDENT)
|
2017-02-13 20:38:17 +08:00
|
|
|
#define EVTYP_STORE_DATA_MASK SCLP_EVTYP_MASK(EVTYP_STORE_DATA)
|
2015-11-27 19:33:18 +08:00
|
|
|
#define EVTYP_ERRNOTIFY_MASK SCLP_EVTYP_MASK(EVTYP_ERRNOTIFY)
|
|
|
|
#define EVTYP_VT220MSG_MASK SCLP_EVTYP_MASK(EVTYP_VT220MSG)
|
|
|
|
#define EVTYP_SDIAS_MASK SCLP_EVTYP_MASK(EVTYP_SDIAS)
|
|
|
|
#define EVTYP_SIGQUIESCE_MASK SCLP_EVTYP_MASK(EVTYP_SIGQUIESCE)
|
|
|
|
#define EVTYP_OCF_MASK SCLP_EVTYP_MASK(EVTYP_OCF)
|
2007-04-27 22:01:53 +08:00
|
|
|
|
|
|
|
#define GNRLMSGFLGS_DOM 0x8000
|
|
|
|
#define GNRLMSGFLGS_SNDALRM 0x4000
|
|
|
|
#define GNRLMSGFLGS_HOLDMSG 0x2000
|
|
|
|
|
|
|
|
#define LNTPFLGS_CNTLTEXT 0x8000
|
|
|
|
#define LNTPFLGS_LABELTEXT 0x4000
|
|
|
|
#define LNTPFLGS_DATATEXT 0x2000
|
|
|
|
#define LNTPFLGS_ENDTEXT 0x1000
|
|
|
|
#define LNTPFLGS_PROMPTTEXT 0x0800
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
typedef unsigned int sclp_cmdw_t;
|
|
|
|
|
2016-12-03 16:48:01 +08:00
|
|
|
#define SCLP_CMDW_READ_CPU_INFO 0x00010001
|
2018-05-23 17:07:13 +08:00
|
|
|
#define SCLP_CMDW_READ_SCP_INFO 0x00020001
|
2018-04-12 00:42:37 +08:00
|
|
|
#define SCLP_CMDW_READ_STORAGE_INFO 0x00040001
|
2018-05-23 17:07:13 +08:00
|
|
|
#define SCLP_CMDW_READ_SCP_INFO_FORCED 0x00120001
|
2007-02-06 04:18:37 +08:00
|
|
|
#define SCLP_CMDW_READ_EVENT_DATA 0x00770005
|
|
|
|
#define SCLP_CMDW_WRITE_EVENT_DATA 0x00760005
|
|
|
|
#define SCLP_CMDW_WRITE_EVENT_MASK 0x00780005
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#define GDS_ID_MDSMU 0x1310
|
2007-04-27 22:01:53 +08:00
|
|
|
#define GDS_ID_MDSROUTEINFO 0x1311
|
|
|
|
#define GDS_ID_AGUNWRKCORR 0x1549
|
|
|
|
#define GDS_ID_SNACONDREPORT 0x1532
|
2005-04-17 06:20:36 +08:00
|
|
|
#define GDS_ID_CPMSU 0x1212
|
2007-04-27 22:01:53 +08:00
|
|
|
#define GDS_ID_ROUTTARGINSTR 0x154D
|
|
|
|
#define GDS_ID_OPREQ 0x8070
|
|
|
|
#define GDS_ID_TEXTCMD 0x1320
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-04-27 22:01:53 +08:00
|
|
|
#define GDS_KEY_SELFDEFTEXTMSG 0x31
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-06-16 16:30:40 +08:00
|
|
|
enum sclp_pm_event {
|
|
|
|
SCLP_PM_EVENT_FREEZE,
|
|
|
|
SCLP_PM_EVENT_THAW,
|
|
|
|
SCLP_PM_EVENT_RESTORE,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SCLP_PANIC_PRIO 1
|
|
|
|
#define SCLP_PANIC_PRIO_CLIENT 0
|
|
|
|
|
2018-01-23 23:54:11 +08:00
|
|
|
typedef u64 sccb_mask_t;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-07-10 17:24:09 +08:00
|
|
|
struct sccb_header {
|
|
|
|
u16 length;
|
|
|
|
u8 function_code;
|
|
|
|
u8 control_mask[3];
|
|
|
|
u16 response_code;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
2012-06-11 22:06:59 +08:00
|
|
|
struct init_sccb {
|
|
|
|
struct sccb_header header;
|
|
|
|
u16 _reserved;
|
|
|
|
u16 mask_length;
|
2018-01-23 23:41:38 +08:00
|
|
|
u8 masks[4 * 1021]; /* variable length */
|
|
|
|
/*
|
|
|
|
* u8 receive_mask[mask_length];
|
|
|
|
* u8 send_mask[mask_length];
|
|
|
|
* u8 sclp_receive_mask[mask_length];
|
|
|
|
* u8 sclp_send_mask[mask_length];
|
|
|
|
*/
|
2012-06-11 22:06:59 +08:00
|
|
|
} __attribute__((packed));
|
|
|
|
|
2018-01-23 23:50:43 +08:00
|
|
|
#define SCLP_MASK_SIZE_COMPAT 4
|
|
|
|
|
2018-01-23 23:41:38 +08:00
|
|
|
static inline sccb_mask_t sccb_get_mask(u8 *masks, size_t len, int i)
|
|
|
|
{
|
|
|
|
sccb_mask_t res = 0;
|
|
|
|
|
|
|
|
memcpy(&res, masks + i * len, min(sizeof(res), len));
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void sccb_set_mask(u8 *masks, size_t len, int i, sccb_mask_t val)
|
|
|
|
{
|
|
|
|
memset(masks + i * len, 0, len);
|
|
|
|
memcpy(masks + i * len, &val, min(sizeof(val), len));
|
|
|
|
}
|
|
|
|
|
|
|
|
#define sccb_get_generic_mask(sccb, i) \
|
|
|
|
({ \
|
|
|
|
__typeof__(sccb) __sccb = sccb; \
|
|
|
|
\
|
|
|
|
sccb_get_mask(__sccb->masks, __sccb->mask_length, i); \
|
|
|
|
})
|
|
|
|
#define sccb_get_recv_mask(sccb) sccb_get_generic_mask(sccb, 0)
|
|
|
|
#define sccb_get_send_mask(sccb) sccb_get_generic_mask(sccb, 1)
|
|
|
|
#define sccb_get_sclp_recv_mask(sccb) sccb_get_generic_mask(sccb, 2)
|
|
|
|
#define sccb_get_sclp_send_mask(sccb) sccb_get_generic_mask(sccb, 3)
|
|
|
|
|
|
|
|
#define sccb_set_generic_mask(sccb, i, val) \
|
|
|
|
({ \
|
|
|
|
__typeof__(sccb) __sccb = sccb; \
|
|
|
|
\
|
|
|
|
sccb_set_mask(__sccb->masks, __sccb->mask_length, i, val); \
|
|
|
|
})
|
|
|
|
#define sccb_set_recv_mask(sccb, val) sccb_set_generic_mask(sccb, 0, val)
|
|
|
|
#define sccb_set_send_mask(sccb, val) sccb_set_generic_mask(sccb, 1, val)
|
|
|
|
#define sccb_set_sclp_recv_mask(sccb, val) sccb_set_generic_mask(sccb, 2, val)
|
|
|
|
#define sccb_set_sclp_send_mask(sccb, val) sccb_set_generic_mask(sccb, 3, val)
|
|
|
|
|
2016-12-03 16:48:01 +08:00
|
|
|
struct read_cpu_info_sccb {
|
|
|
|
struct sccb_header header;
|
|
|
|
u16 nr_configured;
|
|
|
|
u16 offset_configured;
|
|
|
|
u16 nr_standby;
|
|
|
|
u16 offset_standby;
|
|
|
|
u8 reserved[4096 - 16];
|
|
|
|
} __attribute__((packed, aligned(PAGE_SIZE)));
|
|
|
|
|
2018-05-23 17:07:13 +08:00
|
|
|
struct read_info_sccb {
|
|
|
|
struct sccb_header header; /* 0-7 */
|
|
|
|
u16 rnmax; /* 8-9 */
|
|
|
|
u8 rnsize; /* 10 */
|
|
|
|
u8 _pad_11[16 - 11]; /* 11-15 */
|
|
|
|
u16 ncpurl; /* 16-17 */
|
|
|
|
u16 cpuoff; /* 18-19 */
|
|
|
|
u8 _pad_20[24 - 20]; /* 20-23 */
|
|
|
|
u8 loadparm[8]; /* 24-31 */
|
|
|
|
u8 _pad_32[42 - 32]; /* 32-41 */
|
|
|
|
u8 fac42; /* 42 */
|
|
|
|
u8 fac43; /* 43 */
|
|
|
|
u8 _pad_44[48 - 44]; /* 44-47 */
|
|
|
|
u64 facilities; /* 48-55 */
|
|
|
|
u8 _pad_56[66 - 56]; /* 56-65 */
|
|
|
|
u8 fac66; /* 66 */
|
|
|
|
u8 _pad_67[76 - 67]; /* 67-83 */
|
|
|
|
u32 ibc; /* 76-79 */
|
|
|
|
u8 _pad80[84 - 80]; /* 80-83 */
|
|
|
|
u8 fac84; /* 84 */
|
|
|
|
u8 fac85; /* 85 */
|
|
|
|
u8 _pad_86[91 - 86]; /* 86-90 */
|
|
|
|
u8 fac91; /* 91 */
|
|
|
|
u8 _pad_92[98 - 92]; /* 92-97 */
|
|
|
|
u8 fac98; /* 98 */
|
|
|
|
u8 hamaxpow; /* 99 */
|
|
|
|
u32 rnsize2; /* 100-103 */
|
|
|
|
u64 rnmax2; /* 104-111 */
|
|
|
|
u32 hsa_size; /* 112-115 */
|
|
|
|
u8 fac116; /* 116 */
|
|
|
|
u8 fac117; /* 117 */
|
|
|
|
u8 fac118; /* 118 */
|
|
|
|
u8 fac119; /* 119 */
|
|
|
|
u16 hcpua; /* 120-121 */
|
|
|
|
u8 _pad_122[124 - 122]; /* 122-123 */
|
|
|
|
u32 hmfai; /* 124-127 */
|
2018-12-07 06:30:04 +08:00
|
|
|
u8 _pad_128[134 - 128]; /* 128-133 */
|
|
|
|
u8 byte_134; /* 134 */
|
2019-02-12 19:37:50 +08:00
|
|
|
u8 cpudirq; /* 135 */
|
2019-04-08 20:24:08 +08:00
|
|
|
u16 cbl; /* 136-137 */
|
|
|
|
u8 _pad_138[4096 - 138]; /* 138-4095 */
|
2018-05-23 17:07:13 +08:00
|
|
|
} __packed __aligned(PAGE_SIZE);
|
|
|
|
|
2018-04-12 00:42:37 +08:00
|
|
|
struct read_storage_sccb {
|
|
|
|
struct sccb_header header;
|
|
|
|
u16 max_id;
|
|
|
|
u16 assigned;
|
|
|
|
u16 standby;
|
|
|
|
u16 :16;
|
|
|
|
u32 entries[0];
|
|
|
|
} __packed;
|
|
|
|
|
2016-12-03 16:48:01 +08:00
|
|
|
static inline void sclp_fill_core_info(struct sclp_core_info *info,
|
|
|
|
struct read_cpu_info_sccb *sccb)
|
|
|
|
{
|
|
|
|
char *page = (char *) sccb;
|
|
|
|
|
|
|
|
memset(info, 0, sizeof(*info));
|
|
|
|
info->configured = sccb->nr_configured;
|
|
|
|
info->standby = sccb->nr_standby;
|
|
|
|
info->combined = sccb->nr_configured + sccb->nr_standby;
|
|
|
|
memcpy(&info->core, page + sccb->offset_configured,
|
|
|
|
info->combined * sizeof(struct sclp_core_entry));
|
|
|
|
}
|
|
|
|
|
2015-05-06 15:17:51 +08:00
|
|
|
#define SCLP_HAS_CHP_INFO (sclp.facilities & 0x8000000000000000ULL)
|
|
|
|
#define SCLP_HAS_CHP_RECONFIG (sclp.facilities & 0x2000000000000000ULL)
|
|
|
|
#define SCLP_HAS_CPU_INFO (sclp.facilities & 0x0800000000000000ULL)
|
|
|
|
#define SCLP_HAS_CPU_RECONFIG (sclp.facilities & 0x0400000000000000ULL)
|
|
|
|
#define SCLP_HAS_PCI_RECONFIG (sclp.facilities & 0x0000000040000000ULL)
|
2007-07-10 17:24:10 +08:00
|
|
|
|
2009-09-11 16:28:47 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
struct gds_subvector {
|
|
|
|
u8 length;
|
|
|
|
u8 key;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
struct gds_vector {
|
|
|
|
u16 length;
|
|
|
|
u16 gds_id;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
struct evbuf_header {
|
|
|
|
u16 length;
|
|
|
|
u8 type;
|
|
|
|
u8 flags;
|
|
|
|
u16 _reserved;
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
|
|
|
struct sclp_req {
|
|
|
|
struct list_head list; /* list_head for request queueing. */
|
|
|
|
sclp_cmdw_t command; /* sclp command to execute */
|
|
|
|
void *sccb; /* pointer to the sccb to execute */
|
|
|
|
char status; /* status of this request */
|
|
|
|
int start_count; /* number of SVCs done for this req */
|
|
|
|
/* Callback that is called after reaching final status. */
|
|
|
|
void (*callback)(struct sclp_req *, void *data);
|
|
|
|
void *callback_data;
|
2014-03-31 22:18:29 +08:00
|
|
|
int queue_timeout; /* request queue timeout (sec), set by
|
|
|
|
caller of sclp_add_request(), if
|
|
|
|
needed */
|
|
|
|
/* Internal fields */
|
|
|
|
unsigned long queue_expires; /* request queue timeout (jiffies) */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#define SCLP_REQ_FILLED 0x00 /* request is ready to be processed */
|
|
|
|
#define SCLP_REQ_QUEUED 0x01 /* request is queued to be processed */
|
|
|
|
#define SCLP_REQ_RUNNING 0x02 /* request is currently running */
|
|
|
|
#define SCLP_REQ_DONE 0x03 /* request is completed successfully */
|
|
|
|
#define SCLP_REQ_FAILED 0x05 /* request is finally failed */
|
2014-03-31 22:18:29 +08:00
|
|
|
#define SCLP_REQ_QUEUED_TIMEOUT 0x06 /* request on queue timed out */
|
|
|
|
|
|
|
|
#define SCLP_QUEUE_INTERVAL 5 /* timeout interval for request queue */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* function pointers that a high level driver has to use for registration */
|
|
|
|
/* of some routines it wants to be called from the low level driver */
|
|
|
|
struct sclp_register {
|
|
|
|
struct list_head list;
|
2008-02-19 22:29:32 +08:00
|
|
|
/* User wants to receive: */
|
2005-04-17 06:20:36 +08:00
|
|
|
sccb_mask_t receive_mask;
|
2008-02-19 22:29:32 +08:00
|
|
|
/* User wants to send: */
|
2005-04-17 06:20:36 +08:00
|
|
|
sccb_mask_t send_mask;
|
2008-02-19 22:29:32 +08:00
|
|
|
/* H/W can receive: */
|
2005-04-17 06:20:36 +08:00
|
|
|
sccb_mask_t sclp_receive_mask;
|
2008-02-19 22:29:32 +08:00
|
|
|
/* H/W can send: */
|
2005-04-17 06:20:36 +08:00
|
|
|
sccb_mask_t sclp_send_mask;
|
|
|
|
/* called if event type availability changes */
|
|
|
|
void (*state_change_fn)(struct sclp_register *);
|
|
|
|
/* called for events in cp_receive_mask/sclp_receive_mask */
|
|
|
|
void (*receiver_fn)(struct evbuf_header *);
|
2009-06-16 16:30:40 +08:00
|
|
|
/* called for power management events */
|
|
|
|
void (*pm_event_fn)(struct sclp_register *, enum sclp_pm_event);
|
|
|
|
/* pm event posted flag */
|
|
|
|
int pm_event_posted;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/* externals from sclp.c */
|
|
|
|
int sclp_add_request(struct sclp_req *req);
|
|
|
|
void sclp_sync_wait(void);
|
|
|
|
int sclp_register(struct sclp_register *reg);
|
|
|
|
void sclp_unregister(struct sclp_register *reg);
|
|
|
|
int sclp_remove_processed(struct sccb_header *sccb);
|
|
|
|
int sclp_deactivate(void);
|
|
|
|
int sclp_reactivate(void);
|
2013-06-06 15:52:08 +08:00
|
|
|
int sclp_sync_request(sclp_cmdw_t command, void *sccb);
|
2014-03-31 22:18:29 +08:00
|
|
|
int sclp_sync_request_timeout(sclp_cmdw_t command, void *sccb, int timeout);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-05-10 21:45:46 +08:00
|
|
|
int sclp_sdias_init(void);
|
|
|
|
void sclp_sdias_exit(void);
|
|
|
|
|
2017-01-27 22:54:57 +08:00
|
|
|
enum {
|
|
|
|
sclp_init_state_uninitialized,
|
|
|
|
sclp_init_state_initializing,
|
|
|
|
sclp_init_state_initialized
|
|
|
|
};
|
|
|
|
|
|
|
|
extern int sclp_init_state;
|
2013-05-24 18:30:03 +08:00
|
|
|
extern int sclp_console_pages;
|
|
|
|
extern int sclp_console_drop;
|
|
|
|
extern unsigned long sclp_console_full;
|
2018-01-23 23:50:43 +08:00
|
|
|
extern bool sclp_mask_compat_mode;
|
2013-05-24 18:30:03 +08:00
|
|
|
|
2019-04-08 18:49:58 +08:00
|
|
|
extern char *sclp_early_sccb;
|
2017-01-24 22:58:52 +08:00
|
|
|
|
|
|
|
void sclp_early_wait_irq(void);
|
|
|
|
int sclp_early_cmd(sclp_cmdw_t cmd, void *sccb);
|
|
|
|
unsigned int sclp_early_con_check_linemode(struct init_sccb *sccb);
|
2018-01-23 23:41:38 +08:00
|
|
|
unsigned int sclp_early_con_check_vt220(struct init_sccb *sccb);
|
2017-01-24 22:58:52 +08:00
|
|
|
int sclp_early_set_event_mask(struct init_sccb *sccb,
|
2018-01-23 22:07:09 +08:00
|
|
|
sccb_mask_t receive_mask,
|
|
|
|
sccb_mask_t send_mask);
|
2018-05-23 17:07:13 +08:00
|
|
|
int sclp_early_get_info(struct read_info_sccb *info);
|
2017-01-24 22:58:52 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* useful inlines */
|
|
|
|
|
2017-01-24 22:58:52 +08:00
|
|
|
/* Perform service call. Return 0 on success, non-zero otherwise. */
|
|
|
|
static inline int sclp_service_call(sclp_cmdw_t command, void *sccb)
|
|
|
|
{
|
|
|
|
int cc = 4; /* Initialize for program check handling */
|
|
|
|
|
|
|
|
asm volatile(
|
|
|
|
"0: .insn rre,0xb2200000,%1,%2\n" /* servc %1,%2 */
|
|
|
|
"1: ipm %0\n"
|
|
|
|
" srl %0,28\n"
|
|
|
|
"2:\n"
|
|
|
|
EX_TABLE(0b, 2b)
|
|
|
|
EX_TABLE(1b, 2b)
|
|
|
|
: "+&d" (cc) : "d" (command), "a" ((unsigned long)sccb)
|
|
|
|
: "cc", "memory");
|
|
|
|
if (cc == 4)
|
|
|
|
return -EINVAL;
|
|
|
|
if (cc == 3)
|
|
|
|
return -EIO;
|
|
|
|
if (cc == 2)
|
|
|
|
return -EBUSY;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* VM uses EBCDIC 037, LPAR+native(SE+HMC) use EBCDIC 500 */
|
|
|
|
/* translate single character from ASCII to EBCDIC */
|
|
|
|
static inline unsigned char
|
|
|
|
sclp_ascebc(unsigned char ch)
|
|
|
|
{
|
|
|
|
return (MACHINE_IS_VM) ? _ascebc[ch] : _ascebc_500[ch];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* translate string from EBCDIC to ASCII */
|
|
|
|
static inline void
|
2019-04-15 16:35:54 +08:00
|
|
|
sclp_ebcasc_str(char *str, int nr)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
(MACHINE_IS_VM) ? EBCASC(str, nr) : EBCASC_500(str, nr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* translate string from ASCII to EBCDIC */
|
|
|
|
static inline void
|
2019-04-15 16:35:54 +08:00
|
|
|
sclp_ascebc_str(char *str, int nr)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
|
|
|
(MACHINE_IS_VM) ? ASCEBC(str, nr) : ASCEBC_500(str, nr);
|
|
|
|
}
|
|
|
|
|
2011-05-23 16:24:42 +08:00
|
|
|
static inline struct gds_vector *
|
|
|
|
sclp_find_gds_vector(void *start, void *end, u16 id)
|
|
|
|
{
|
|
|
|
struct gds_vector *v;
|
|
|
|
|
|
|
|
for (v = start; (void *) v < end; v = (void *) v + v->length)
|
|
|
|
if (v->gds_id == id)
|
|
|
|
return v;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct gds_subvector *
|
|
|
|
sclp_find_gds_subvector(void *start, void *end, u8 key)
|
|
|
|
{
|
|
|
|
struct gds_subvector *sv;
|
|
|
|
|
|
|
|
for (sv = start; (void *) sv < end; sv = (void *) sv + sv->length)
|
|
|
|
if (sv->key == key)
|
|
|
|
return sv;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif /* __SCLP_H__ */
|