Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62733e5a authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

[S390] cio: move scsw helper functions to header file



All scsw helper functions are very short and usage of them shouldn't
result in function calls. Therefore we move them to a separate header
file.
Also saves a lot of EXPORT_SYMBOLs.

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 1f1148c8
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -125,4 +125,32 @@ struct chsc_cpd_info {
#define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
#define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)

#ifdef __KERNEL__

struct css_general_char {
	u64 : 12;
	u32 dynio : 1;	 /* bit 12 */
	u32 : 28;
	u32 aif : 1;	 /* bit 41 */
	u32 : 3;
	u32 mcss : 1;	 /* bit 45 */
	u32 fcs : 1;	 /* bit 46 */
	u32 : 1;
	u32 ext_mb : 1;  /* bit 48 */
	u32 : 7;
	u32 aif_tdd : 1; /* bit 56 */
	u32 : 1;
	u32 qebsm : 1;	 /* bit 58 */
	u32 : 8;
	u32 aif_osa : 1; /* bit 67 */
	u32 : 14;
	u32 cib : 1;	 /* bit 82 */
	u32 : 5;
	u32 fcx : 1;	 /* bit 88 */
	u32 : 7;
}__attribute__((packed));

extern struct css_general_char css_general_characteristics;

#endif /* __KERNEL__ */
#endif
+1 −222
Original line number Diff line number Diff line
@@ -15,228 +15,7 @@
#define LPM_ANYPATH 0xff
#define __MAX_CSSID 0

/**
 * struct cmd_scsw - command-mode subchannel status word
 * @key: subchannel key
 * @sctl: suspend control
 * @eswf: esw format
 * @cc: deferred condition code
 * @fmt: format
 * @pfch: prefetch
 * @isic: initial-status interruption control
 * @alcc: address-limit checking control
 * @ssi: suppress-suspended interruption
 * @zcc: zero condition code
 * @ectl: extended control
 * @pno: path not operational
 * @res: reserved
 * @fctl: function control
 * @actl: activity control
 * @stctl: status control
 * @cpa: channel program address
 * @dstat: device status
 * @cstat: subchannel status
 * @count: residual count
 */
struct cmd_scsw {
	__u32 key  : 4;
	__u32 sctl : 1;
	__u32 eswf : 1;
	__u32 cc   : 2;
	__u32 fmt  : 1;
	__u32 pfch : 1;
	__u32 isic : 1;
	__u32 alcc : 1;
	__u32 ssi  : 1;
	__u32 zcc  : 1;
	__u32 ectl : 1;
	__u32 pno  : 1;
	__u32 res  : 1;
	__u32 fctl : 3;
	__u32 actl : 7;
	__u32 stctl : 5;
	__u32 cpa;
	__u32 dstat : 8;
	__u32 cstat : 8;
	__u32 count : 16;
} __attribute__ ((packed));

/**
 * struct tm_scsw - transport-mode subchannel status word
 * @key: subchannel key
 * @eswf: esw format
 * @cc: deferred condition code
 * @fmt: format
 * @x: IRB-format control
 * @q: interrogate-complete
 * @ectl: extended control
 * @pno: path not operational
 * @fctl: function control
 * @actl: activity control
 * @stctl: status control
 * @tcw: TCW address
 * @dstat: device status
 * @cstat: subchannel status
 * @fcxs: FCX status
 * @schxs: subchannel-extended status
 */
struct tm_scsw {
	u32 key:4;
	u32 :1;
	u32 eswf:1;
	u32 cc:2;
	u32 fmt:3;
	u32 x:1;
	u32 q:1;
	u32 :1;
	u32 ectl:1;
	u32 pno:1;
	u32 :1;
	u32 fctl:3;
	u32 actl:7;
	u32 stctl:5;
	u32 tcw;
	u32 dstat:8;
	u32 cstat:8;
	u32 fcxs:8;
	u32 schxs:8;
} __attribute__ ((packed));

/**
 * union scsw - subchannel status word
 * @cmd: command-mode SCSW
 * @tm: transport-mode SCSW
 */
union scsw {
	struct cmd_scsw cmd;
	struct tm_scsw tm;
} __attribute__ ((packed));

int scsw_is_tm(union scsw *scsw);
u32 scsw_key(union scsw *scsw);
u32 scsw_eswf(union scsw *scsw);
u32 scsw_cc(union scsw *scsw);
u32 scsw_ectl(union scsw *scsw);
u32 scsw_pno(union scsw *scsw);
u32 scsw_fctl(union scsw *scsw);
u32 scsw_actl(union scsw *scsw);
u32 scsw_stctl(union scsw *scsw);
u32 scsw_dstat(union scsw *scsw);
u32 scsw_cstat(union scsw *scsw);
int scsw_is_solicited(union scsw *scsw);
int scsw_is_valid_key(union scsw *scsw);
int scsw_is_valid_eswf(union scsw *scsw);
int scsw_is_valid_cc(union scsw *scsw);
int scsw_is_valid_ectl(union scsw *scsw);
int scsw_is_valid_pno(union scsw *scsw);
int scsw_is_valid_fctl(union scsw *scsw);
int scsw_is_valid_actl(union scsw *scsw);
int scsw_is_valid_stctl(union scsw *scsw);
int scsw_is_valid_dstat(union scsw *scsw);
int scsw_is_valid_cstat(union scsw *scsw);
int scsw_cmd_is_valid_key(union scsw *scsw);
int scsw_cmd_is_valid_sctl(union scsw *scsw);
int scsw_cmd_is_valid_eswf(union scsw *scsw);
int scsw_cmd_is_valid_cc(union scsw *scsw);
int scsw_cmd_is_valid_fmt(union scsw *scsw);
int scsw_cmd_is_valid_pfch(union scsw *scsw);
int scsw_cmd_is_valid_isic(union scsw *scsw);
int scsw_cmd_is_valid_alcc(union scsw *scsw);
int scsw_cmd_is_valid_ssi(union scsw *scsw);
int scsw_cmd_is_valid_zcc(union scsw *scsw);
int scsw_cmd_is_valid_ectl(union scsw *scsw);
int scsw_cmd_is_valid_pno(union scsw *scsw);
int scsw_cmd_is_valid_fctl(union scsw *scsw);
int scsw_cmd_is_valid_actl(union scsw *scsw);
int scsw_cmd_is_valid_stctl(union scsw *scsw);
int scsw_cmd_is_valid_dstat(union scsw *scsw);
int scsw_cmd_is_valid_cstat(union scsw *scsw);
int scsw_cmd_is_solicited(union scsw *scsw);
int scsw_tm_is_valid_key(union scsw *scsw);
int scsw_tm_is_valid_eswf(union scsw *scsw);
int scsw_tm_is_valid_cc(union scsw *scsw);
int scsw_tm_is_valid_fmt(union scsw *scsw);
int scsw_tm_is_valid_x(union scsw *scsw);
int scsw_tm_is_valid_q(union scsw *scsw);
int scsw_tm_is_valid_ectl(union scsw *scsw);
int scsw_tm_is_valid_pno(union scsw *scsw);
int scsw_tm_is_valid_fctl(union scsw *scsw);
int scsw_tm_is_valid_actl(union scsw *scsw);
int scsw_tm_is_valid_stctl(union scsw *scsw);
int scsw_tm_is_valid_dstat(union scsw *scsw);
int scsw_tm_is_valid_cstat(union scsw *scsw);
int scsw_tm_is_valid_fcxs(union scsw *scsw);
int scsw_tm_is_valid_schxs(union scsw *scsw);
int scsw_tm_is_solicited(union scsw *scsw);

#define SCSW_FCTL_CLEAR_FUNC	 0x1
#define SCSW_FCTL_HALT_FUNC	 0x2
#define SCSW_FCTL_START_FUNC	 0x4

#define SCSW_ACTL_SUSPENDED	 0x1
#define SCSW_ACTL_DEVACT	 0x2
#define SCSW_ACTL_SCHACT	 0x4
#define SCSW_ACTL_CLEAR_PEND	 0x8
#define SCSW_ACTL_HALT_PEND	 0x10
#define SCSW_ACTL_START_PEND	 0x20
#define SCSW_ACTL_RESUME_PEND	 0x40

#define SCSW_STCTL_STATUS_PEND	 0x1
#define SCSW_STCTL_SEC_STATUS	 0x2
#define SCSW_STCTL_PRIM_STATUS	 0x4
#define SCSW_STCTL_INTER_STATUS	 0x8
#define SCSW_STCTL_ALERT_STATUS	 0x10

#define DEV_STAT_ATTENTION	 0x80
#define DEV_STAT_STAT_MOD	 0x40
#define DEV_STAT_CU_END		 0x20
#define DEV_STAT_BUSY		 0x10
#define DEV_STAT_CHN_END	 0x08
#define DEV_STAT_DEV_END	 0x04
#define DEV_STAT_UNIT_CHECK	 0x02
#define DEV_STAT_UNIT_EXCEP	 0x01

#define SCHN_STAT_PCI		 0x80
#define SCHN_STAT_INCORR_LEN	 0x40
#define SCHN_STAT_PROG_CHECK	 0x20
#define SCHN_STAT_PROT_CHECK	 0x10
#define SCHN_STAT_CHN_DATA_CHK	 0x08
#define SCHN_STAT_CHN_CTRL_CHK	 0x04
#define SCHN_STAT_INTF_CTRL_CHK	 0x02
#define SCHN_STAT_CHAIN_CHECK	 0x01

/*
 * architectured values for first sense byte
 */
#define SNS0_CMD_REJECT		0x80
#define SNS_CMD_REJECT		SNS0_CMD_REJEC
#define SNS0_INTERVENTION_REQ	0x40
#define SNS0_BUS_OUT_CHECK	0x20
#define SNS0_EQUIPMENT_CHECK	0x10
#define SNS0_DATA_CHECK		0x08
#define SNS0_OVERRUN		0x04
#define SNS0_INCOMPL_DOMAIN	0x01

/*
 * architectured values for second sense byte
 */
#define SNS1_PERM_ERR		0x80
#define SNS1_INV_TRACK_FORMAT	0x40
#define SNS1_EOC		0x20
#define SNS1_MESSAGE_TO_OPER	0x10
#define SNS1_NO_REC_FOUND	0x08
#define SNS1_FILE_PROTECTED	0x04
#define SNS1_WRITE_INHIBITED	0x02
#define SNS1_INPRECISE_END	0x01

/*
 * architectured values for third sense byte
 */
#define SNS2_REQ_INH_WRITE	0x80
#define SNS2_CORRECTABLE	0x40
#define SNS2_FIRST_LOG_ERR	0x20
#define SNS2_ENV_DATA_PRESENT	0x10
#define SNS2_INPRECISE_END	0x04
#include <asm/scsw.h>

/**
 * struct ccw1 - channel command word
+229 −116

File changed and moved.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# Makefile for the S/390 common i/o drivers
#

obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o scsw.o \
obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \
	fcx.o itcw.o crw.o
ccw_device-objs += device.o device_fsm.o device_ops.o
ccw_device-objs += device_id.o device_pgid.o device_status.o
+0 −24
Original line number Diff line number Diff line
@@ -37,29 +37,6 @@ struct channel_path_desc {

struct channel_path;

struct css_general_char {
	u64 : 12;
	u32 dynio : 1;	 /* bit 12 */
	u32 : 28;
	u32 aif : 1;     /* bit 41 */
	u32 : 3;
	u32 mcss : 1;    /* bit 45 */
	u32 fcs : 1;	 /* bit 46 */
	u32 : 1;
	u32 ext_mb : 1;  /* bit 48 */
	u32 : 7;
	u32 aif_tdd : 1; /* bit 56 */
	u32 : 1;
	u32 qebsm : 1;   /* bit 58 */
	u32 : 8;
	u32 aif_osa : 1; /* bit 67 */
	u32 : 14;
	u32 cib : 1;	 /* bit 82 */
	u32 : 5;
	u32 fcx : 1;	 /* bit 88 */
	u32 : 7;
}__attribute__((packed));

struct css_chsc_char {
	u64 res;
	u64 : 20;
@@ -72,7 +49,6 @@ struct css_chsc_char {
	u32 : 19;
}__attribute__((packed));

extern struct css_general_char css_general_characteristics;
extern struct css_chsc_char css_chsc_characteristics;

struct chsc_ssd_info {