Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright IBM Corp. 2002, 2009
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Author(s): Arnd Bergmann <arndb@de.ibm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Interface for CCW device drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #ifndef _S390_CCWDEV_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #define _S390_CCWDEV_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/mod_devicetable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <asm/chsc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <asm/fcx.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <asm/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <asm/schid.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) /* structs from asm/cio.h */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) struct irb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) struct ccw1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) struct ccw_dev_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) /* simplified initializers for struct ccw_device:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #define CCW_DEVICE(cu, cum) 						\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	.cu_type=(cu), .cu_model=(cum),					\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	.match_flags=(CCW_DEVICE_ID_MATCH_CU_TYPE			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 		   | (cum ? CCW_DEVICE_ID_MATCH_CU_MODEL : 0))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) #define CCW_DEVICE_DEVTYPE(cu, cum, dev, devm)				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	.cu_type=(cu), .cu_model=(cum), .dev_type=(dev), .dev_model=(devm),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	.match_flags=CCW_DEVICE_ID_MATCH_CU_TYPE			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		   | ((cum) ? CCW_DEVICE_ID_MATCH_CU_MODEL : 0) 	\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 		   | CCW_DEVICE_ID_MATCH_DEVICE_TYPE			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 		   | ((devm) ? CCW_DEVICE_ID_MATCH_DEVICE_MODEL : 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) /* scan through an array of device ids and return the first
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * entry that matches the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * the array must end with an entry containing zero match_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) static inline const struct ccw_device_id *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) ccw_device_id_match(const struct ccw_device_id *array,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 			const struct ccw_device_id *match)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	const struct ccw_device_id *id = array;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	for (id = array; id->match_flags; id++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		if ((id->match_flags & CCW_DEVICE_ID_MATCH_CU_TYPE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		    && (id->cu_type != match->cu_type))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		if ((id->match_flags & CCW_DEVICE_ID_MATCH_CU_MODEL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		    && (id->cu_model != match->cu_model))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		if ((id->match_flags & CCW_DEVICE_ID_MATCH_DEVICE_TYPE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		    && (id->dev_type != match->dev_type))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		if ((id->match_flags & CCW_DEVICE_ID_MATCH_DEVICE_MODEL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		    && (id->dev_model != match->dev_model))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		return id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)  * struct ccw_device - channel attached device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  * @ccwlock: pointer to device lock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)  * @id: id of this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  * @drv: ccw driver for this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  * @dev: embedded device structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  * @online: online status of device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  * @handler: interrupt handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)  * @handler is a member of the device rather than the driver since a driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)  * can have different interrupt handlers for different ccw devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)  * (multi-subchannel drivers).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) struct ccw_device {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	spinlock_t *ccwlock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) /* private: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	struct ccw_device_private *private;	/* cio private information */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) /* public: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	struct ccw_device_id id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	struct ccw_driver *drv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	struct device dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	int online;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	void (*handler) (struct ccw_device *, unsigned long, struct irb *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  * Possible events used by the path_event notifier.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define PE_NONE				0x0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #define PE_PATH_GONE			0x1 /* A path is no longer available. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) #define PE_PATH_AVAILABLE		0x2 /* A path has become available and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 					       was successfully verified. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) #define PE_PATHGROUP_ESTABLISHED	0x4 /* A pathgroup was reset and had
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 					       to be established again. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  * Possible CIO actions triggered by the unit check handler.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) enum uc_todo {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	UC_TODO_RETRY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	UC_TODO_RETRY_ON_NEW_PATH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	UC_TODO_STOP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * struct ccw driver - device driver for channel attached devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  * @ids: ids supported by this driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  * @probe: function called on probe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  * @remove: function called on remove
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)  * @set_online: called when setting device online
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)  * @set_offline: called when setting device offline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  * @notify: notify driver of device state changes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)  * @path_event: notify driver of channel path events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  * @shutdown: called at device shutdown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  * @prepare: prepare for pm state transition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  * @complete: undo work done in @prepare
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  * @freeze: callback for freezing during hibernation snapshotting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  * @thaw: undo work done in @freeze
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  * @restore: callback for restoring after hibernation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  * @uc_handler: callback for unit check handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  * @driver: embedded device driver structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  * @int_class: interruption class to use for accounting interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) struct ccw_driver {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	struct ccw_device_id *ids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	int (*probe) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	void (*remove) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	int (*set_online) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	int (*set_offline) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	int (*notify) (struct ccw_device *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	void (*path_event) (struct ccw_device *, int *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	void (*shutdown) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	int (*prepare) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	void (*complete) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	int (*freeze)(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	int (*thaw) (struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	int (*restore)(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	enum uc_todo (*uc_handler) (struct ccw_device *, struct irb *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	struct device_driver driver;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	enum interruption_class int_class;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) extern struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 					      const char *bus_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /* devices drivers call these during module load and unload.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  * When a driver is registered, its probe method is called
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  * when new devices for its type pop up */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) extern int  ccw_driver_register   (struct ccw_driver *driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) extern void ccw_driver_unregister (struct ccw_driver *driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) struct ccw1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) extern int ccw_device_set_options(struct ccw_device *, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) int ccw_device_is_pathgroup(struct ccw_device *cdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) int ccw_device_is_multipath(struct ccw_device *cdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) /* Allow for i/o completion notification after primary interrupt status. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) #define CCWDEV_EARLY_NOTIFICATION	0x0001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) /* Report all interrupt conditions. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) #define CCWDEV_REPORT_ALL	 	0x0002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) /* Try to perform path grouping. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) #define CCWDEV_DO_PATHGROUP             0x0004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) /* Allow forced onlining of boxed devices. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) #define CCWDEV_ALLOW_FORCE              0x0008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) /* Try to use multipath mode. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) #define CCWDEV_DO_MULTIPATH		0x0010
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 			    unsigned long, __u8, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 				    unsigned long, __u8, unsigned long, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 				unsigned long, __u8, __u8, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 					unsigned long, __u8, __u8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 					unsigned long, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) extern int ccw_device_resume(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) extern int ccw_device_halt(struct ccw_device *, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) extern int ccw_device_clear(struct ccw_device *, unsigned long);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) int ccw_device_tm_start_key(struct ccw_device *cdev, struct tcw *tcw,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 			    unsigned long intparm, u8 lpm, u8 key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) int ccw_device_tm_start_key(struct ccw_device *, struct tcw *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 			    unsigned long, u8, u8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) int ccw_device_tm_start_timeout_key(struct ccw_device *, struct tcw *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 			    unsigned long, u8, u8, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) int ccw_device_tm_start(struct ccw_device *, struct tcw *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 			    unsigned long, u8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) int ccw_device_tm_start_timeout(struct ccw_device *, struct tcw *,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 			    unsigned long, u8, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) int ccw_device_tm_intrg(struct ccw_device *cdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) int ccw_device_get_mdc(struct ccw_device *cdev, u8 mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) extern int ccw_device_set_online(struct ccw_device *cdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) extern int ccw_device_set_offline(struct ccw_device *cdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) extern struct ciw *ccw_device_get_ciw(struct ccw_device *, __u32 cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) extern __u8 ccw_device_get_path_mask(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #define get_ccwdev_lock(x) (x)->ccwlock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #define to_ccwdev(n) container_of(n, struct ccw_device, dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) #define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) extern struct ccw_device *ccw_device_create_console(struct ccw_driver *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) extern void ccw_device_destroy_console(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) extern int ccw_device_enable_console(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) extern void ccw_device_wait_idle(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) extern int ccw_device_force_console(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) extern void *ccw_device_dma_zalloc(struct ccw_device *cdev, size_t size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) extern void ccw_device_dma_free(struct ccw_device *cdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 				void *cpu_addr, size_t size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) int ccw_device_siosl(struct ccw_device *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) u8 *ccw_device_get_util_str(struct ccw_device *cdev, int chp_idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) int ccw_device_pnso(struct ccw_device *cdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		    struct chsc_pnso_area *pnso_area, u8 oc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		    struct chsc_pnso_resume_token resume_token, int cnc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) int ccw_device_get_cssid(struct ccw_device *cdev, u8 *cssid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) int ccw_device_get_iid(struct ccw_device *cdev, u8 *iid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) int ccw_device_get_chpid(struct ccw_device *cdev, int chp_idx, u8 *chpid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) int ccw_device_get_chid(struct ccw_device *cdev, int chp_idx, u16 *chid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) #endif /* _S390_CCWDEV_H_ */