// SPDX-License-Identifier: GPL-2.0/* * S/390 common I/O routines -- channel subsystem call * * Copyright IBM Corp. 1999,2012 * Author(s): Ingo Adlung (adlung@de.ibm.com) * Cornelia Huck (cornelia.huck@de.ibm.com) * Arnd Bergmann (arndb@de.ibm.com) */#define KMSG_COMPONENT "cio"#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt#include<linux/module.h>#include<linux/slab.h>#include<linux/init.h>#include<linux/device.h>#include<linux/mutex.h>#include<linux/pci.h>#include<asm/cio.h>#include<asm/chpid.h>#include<asm/chsc.h>#include<asm/crw.h>#include<asm/isc.h>#include<asm/ebcdic.h>#include<asm/ap.h>#include"css.h"#include"cio.h"#include"cio_debug.h"#include"ioasm.h"#include"chp.h"#include"chsc.h"staticvoid*sei_page;staticvoid*chsc_page;staticDEFINE_SPINLOCK(chsc_page_lock);/** * chsc_error_from_response() - convert a chsc response to an error * @response: chsc response code * * Returns an appropriate Linux error code for @response. */intchsc_error_from_response(intresponse){switch(response){case0x0001:return0;case0x0002:case0x0003:case0x0006:case0x0007:case0x0008:case0x000a:case0x0104:return-EINVAL;case0x0004:case0x0106:/* "Wrong Channel Parm" for the op 0x003d */return-EOPNOTSUPP;case0x000b:case0x0107:/* "Channel busy" for the op 0x003d */return-EBUSY;case0x0100:case0x0102:return-ENOMEM;case0x0108:/* "HW limit exceeded" for the op 0x003d */return-EUSERS;default:return-EIO;}}EXPORT_SYMBOL_GPL(chsc_error_from_response);structchsc_ssd_area{structchsc_headerrequest;u16:10;u16ssid:2;u16:4;u16f_sch;/* first subchannel */u16:16;u16l_sch;/* last subchannel */u32:32;structchsc_headerresponse;u32:32;u8sch_valid: