summaryrefslogtreecommitdiff
path: root/drivers/s390/block/dasd_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_int.h')
-rw-r--r--drivers/s390/block/dasd_int.h111
1 files changed, 110 insertions, 1 deletions
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 8ca077fbdf4f..3bc008f9136c 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -298,6 +298,7 @@ struct dasd_discipline {
* configuration.
*/
int (*verify_path)(struct dasd_device *, __u8);
+ int (*pe_handler)(struct dasd_device *, __u8, __u8);
/*
* Last things to do when a device is set online, and first things
@@ -418,10 +419,40 @@ extern struct dasd_discipline *dasd_diag_discipline_pointer;
#define DASD_PATH_NOHPF 6
#define DASD_PATH_CUIR 7
#define DASD_PATH_IFCC 8
+#define DASD_PATH_FCSEC 9
#define DASD_THRHLD_MAX 4294967295U
#define DASD_INTERVAL_MAX 4294967295U
+/* FC Endpoint Security Capabilities */
+#define DASD_FC_SECURITY_UNSUP 0
+#define DASD_FC_SECURITY_AUTH 1
+#define DASD_FC_SECURITY_ENC_FCSP2 2
+#define DASD_FC_SECURITY_ENC_ERAS 3
+
+#define DASD_FC_SECURITY_ENC_STR "Encryption"
+static const struct {
+ u8 value;
+ char *name;
+} dasd_path_fcs_mnemonics[] = {
+ { DASD_FC_SECURITY_UNSUP, "Unsupported" },
+ { DASD_FC_SECURITY_AUTH, "Authentication" },
+ { DASD_FC_SECURITY_ENC_FCSP2, DASD_FC_SECURITY_ENC_STR },
+ { DASD_FC_SECURITY_ENC_ERAS, DASD_FC_SECURITY_ENC_STR },
+};
+
+static inline char *dasd_path_get_fcs_str(int val)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(dasd_path_fcs_mnemonics); i++) {
+ if (dasd_path_fcs_mnemonics[i].value == val)
+ return dasd_path_fcs_mnemonics[i].name;
+ }
+
+ return dasd_path_fcs_mnemonics[0].name;
+}
+
struct dasd_path {
unsigned long flags;
u8 cssid;
@@ -430,8 +461,18 @@ struct dasd_path {
struct dasd_conf_data *conf_data;
atomic_t error_count;
unsigned long errorclk;
+ u8 fc_security;
+ struct kobject kobj;
+ bool in_sysfs;
};
+#define to_dasd_path(path) container_of(path, struct dasd_path, kobj)
+
+static inline void dasd_path_release(struct kobject *kobj)
+{
+/* Memory for the dasd_path kobject is freed when dasd_free_device() is called */
+}
+
struct dasd_profile_info {
/* legacy part of profile data, as in dasd_profile_info_t */
@@ -542,6 +583,7 @@ struct dasd_device {
struct dentry *hosts_dentry;
struct dasd_profile profile;
struct dasd_format_entry format_entry;
+ struct kset *paths_info;
};
struct dasd_block {
@@ -766,7 +808,7 @@ void dasd_block_set_timer(struct dasd_block *, int);
void dasd_block_clear_timer(struct dasd_block *);
int dasd_cancel_req(struct dasd_ccw_req *);
int dasd_flush_device_queue(struct dasd_device *);
-int dasd_generic_probe (struct ccw_device *, struct dasd_discipline *);
+int dasd_generic_probe(struct ccw_device *);
void dasd_generic_free_discipline(struct dasd_device *);
void dasd_generic_remove (struct ccw_device *cdev);
int dasd_generic_set_online(struct ccw_device *, struct dasd_discipline *);
@@ -814,6 +856,9 @@ int dasd_set_feature(struct ccw_device *, int, int);
int dasd_add_sysfs_files(struct ccw_device *);
void dasd_remove_sysfs_files(struct ccw_device *);
+void dasd_path_create_kobj(struct dasd_device *, int);
+void dasd_path_create_kobjects(struct dasd_device *);
+void dasd_path_remove_kobj(struct dasd_device *, int);
struct dasd_device *dasd_device_from_cdev(struct ccw_device *);
struct dasd_device *dasd_device_from_cdev_locked(struct ccw_device *);
@@ -912,6 +957,29 @@ static inline void dasd_path_clear_all_verify(struct dasd_device *device)
dasd_path_clear_verify(device, chp);
}
+static inline void dasd_path_fcsec(struct dasd_device *device, int chp)
+{
+ __set_bit(DASD_PATH_FCSEC, &device->path[chp].flags);
+}
+
+static inline void dasd_path_clear_fcsec(struct dasd_device *device, int chp)
+{
+ __clear_bit(DASD_PATH_FCSEC, &device->path[chp].flags);
+}
+
+static inline int dasd_path_need_fcsec(struct dasd_device *device, int chp)
+{
+ return test_bit(DASD_PATH_FCSEC, &device->path[chp].flags);
+}
+
+static inline void dasd_path_clear_all_fcsec(struct dasd_device *device)
+{
+ int chp;
+
+ for (chp = 0; chp < 8; chp++)
+ dasd_path_clear_fcsec(device, chp);
+}
+
static inline void dasd_path_operational(struct dasd_device *device, int chp)
{
__set_bit(DASD_PATH_OPERATIONAL, &device->path[chp].flags);
@@ -1037,6 +1105,17 @@ static inline __u8 dasd_path_get_tbvpm(struct dasd_device *device)
return tbvpm;
}
+static inline int dasd_path_get_fcsecpm(struct dasd_device *device)
+{
+ int chp;
+
+ for (chp = 0; chp < 8; chp++)
+ if (dasd_path_need_fcsec(device, chp))
+ return 1;
+
+ return 0;
+}
+
static inline __u8 dasd_path_get_nppm(struct dasd_device *device)
{
int chp;
@@ -1104,6 +1183,31 @@ static inline __u8 dasd_path_get_hpfpm(struct dasd_device *device)
return hpfpm;
}
+static inline u8 dasd_path_get_fcs_path(struct dasd_device *device, int chp)
+{
+ return device->path[chp].fc_security;
+}
+
+static inline int dasd_path_get_fcs_device(struct dasd_device *device)
+{
+ u8 fc_sec = 0;
+ int chp;
+
+ for (chp = 0; chp < 8; chp++) {
+ if (device->opm & (0x80 >> chp)) {
+ fc_sec = device->path[chp].fc_security;
+ break;
+ }
+ }
+ for (; chp < 8; chp++) {
+ if (device->opm & (0x80 >> chp))
+ if (device->path[chp].fc_security != fc_sec)
+ return -EINVAL;
+ }
+
+ return fc_sec;
+}
+
/*
* add functions for path masks
* the existing path mask will be extended by the given path mask
@@ -1269,6 +1373,11 @@ static inline void dasd_path_notoper(struct dasd_device *device, int chp)
dasd_path_clear_nonpreferred(device, chp);
}
+static inline void dasd_path_fcsec_update(struct dasd_device *device, int chp)
+{
+ dasd_path_fcsec(device, chp);
+}
+
/*
* remove all paths from normal operation
*/