2007-04-27 22:01:28 +08:00
|
|
|
/*
|
2012-07-20 17:15:04 +08:00
|
|
|
* Copyright IBM Corp. 2007, 2010
|
2007-04-27 22:01:28 +08:00
|
|
|
* Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef S390_CHP_H
|
2016-05-23 21:19:38 +08:00
|
|
|
#define S390_CHP_H
|
2007-04-27 22:01:28 +08:00
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/device.h>
|
2010-10-25 22:10:27 +08:00
|
|
|
#include <linux/mutex.h>
|
2007-04-27 22:01:31 +08:00
|
|
|
#include <asm/chpid.h>
|
2007-04-27 22:01:28 +08:00
|
|
|
#include "chsc.h"
|
2008-07-14 15:58:43 +08:00
|
|
|
#include "css.h"
|
2007-04-27 22:01:28 +08:00
|
|
|
|
2007-04-27 22:01:31 +08:00
|
|
|
#define CHP_STATUS_STANDBY 0
|
|
|
|
#define CHP_STATUS_CONFIGURED 1
|
|
|
|
#define CHP_STATUS_RESERVED 2
|
|
|
|
#define CHP_STATUS_NOT_RECOGNIZED 3
|
|
|
|
|
2008-07-14 15:58:45 +08:00
|
|
|
#define CHP_ONLINE 0
|
|
|
|
#define CHP_OFFLINE 1
|
|
|
|
#define CHP_VARY_ON 2
|
|
|
|
#define CHP_VARY_OFF 3
|
|
|
|
|
2008-07-14 15:59:02 +08:00
|
|
|
struct chp_link {
|
2008-07-14 15:58:45 +08:00
|
|
|
struct chp_id chpid;
|
|
|
|
u32 fla_mask;
|
|
|
|
u16 fla;
|
|
|
|
};
|
|
|
|
|
2007-04-27 22:01:31 +08:00
|
|
|
static inline int chp_test_bit(u8 *bitmap, int num)
|
|
|
|
{
|
|
|
|
int byte = num >> 3;
|
|
|
|
int mask = 128 >> (num & 7);
|
|
|
|
|
|
|
|
return (bitmap[byte] & mask) ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-27 22:01:28 +08:00
|
|
|
struct channel_path {
|
2010-10-25 22:10:27 +08:00
|
|
|
struct device dev;
|
2007-04-27 22:01:28 +08:00
|
|
|
struct chp_id chpid;
|
2010-10-25 22:10:27 +08:00
|
|
|
struct mutex lock; /* Serialize access to below members. */
|
2007-04-27 22:01:28 +08:00
|
|
|
int state;
|
|
|
|
struct channel_path_desc desc;
|
2013-03-11 19:58:18 +08:00
|
|
|
struct channel_path_desc_fmt1 desc_fmt1;
|
2007-04-27 22:01:28 +08:00
|
|
|
/* Channel-measurement related stuff: */
|
|
|
|
int cmg;
|
|
|
|
int shared;
|
2016-01-25 17:30:27 +08:00
|
|
|
struct cmg_chars cmg_chars;
|
2007-04-27 22:01:28 +08:00
|
|
|
};
|
|
|
|
|
2010-10-25 22:10:31 +08:00
|
|
|
/* Return channel_path struct for given chpid. */
|
|
|
|
static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
|
|
|
|
{
|
|
|
|
return channel_subsystems[chpid.cssid]->chps[chpid.id];
|
|
|
|
}
|
|
|
|
|
2007-04-27 22:01:28 +08:00
|
|
|
int chp_get_status(struct chp_id chpid);
|
|
|
|
u8 chp_get_sch_opm(struct subchannel *sch);
|
|
|
|
int chp_is_registered(struct chp_id chpid);
|
2014-05-07 19:27:21 +08:00
|
|
|
struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid);
|
2007-04-27 22:01:28 +08:00
|
|
|
void chp_remove_cmg_attr(struct channel_path *chp);
|
|
|
|
int chp_add_cmg_attr(struct channel_path *chp);
|
2013-03-11 19:58:18 +08:00
|
|
|
int chp_update_desc(struct channel_path *chp);
|
2007-04-27 22:01:28 +08:00
|
|
|
int chp_new(struct chp_id chpid);
|
2007-04-27 22:01:31 +08:00
|
|
|
void chp_cfg_schedule(struct chp_id chpid, int configure);
|
|
|
|
void chp_cfg_cancel_deconfigure(struct chp_id chpid);
|
|
|
|
int chp_info_get_status(struct chp_id chpid);
|
2008-07-14 15:59:02 +08:00
|
|
|
int chp_ssd_get_mask(struct chsc_ssd_info *, struct chp_link *);
|
2007-04-27 22:01:28 +08:00
|
|
|
#endif /* S390_CHP_H */
|