Commit 7ea9e313 authored by Thomas Spatzier's avatar Thomas Spatzier Committed by Linus Torvalds

[PATCH] s390: key protected i/o

Add interface for key protected i/o.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6cbe3910
...@@ -175,9 +175,10 @@ cio_start_handle_notoper(struct subchannel *sch, __u8 lpm) ...@@ -175,9 +175,10 @@ cio_start_handle_notoper(struct subchannel *sch, __u8 lpm)
} }
int int
cio_start (struct subchannel *sch, /* subchannel structure */ cio_start_key (struct subchannel *sch, /* subchannel structure */
struct ccw1 * cpa, /* logical channel prog addr */ struct ccw1 * cpa, /* logical channel prog addr */
__u8 lpm) /* logical path mask */ __u8 lpm, /* logical path mask */
__u8 key) /* storage key */
{ {
char dbf_txt[15]; char dbf_txt[15];
int ccode; int ccode;
...@@ -200,12 +201,12 @@ cio_start (struct subchannel *sch, /* subchannel structure */ ...@@ -200,12 +201,12 @@ cio_start (struct subchannel *sch, /* subchannel structure */
sch->orb.c64 = 1; sch->orb.c64 = 1;
sch->orb.i2k = 0; sch->orb.i2k = 0;
#endif #endif
sch->orb.key = key >> 4;
/* issue "Start Subchannel" */
sch->orb.cpa = (__u32) __pa (cpa); sch->orb.cpa = (__u32) __pa (cpa);
/*
* Issue "Start subchannel" and process condition code
*/
ccode = ssch (sch->irq, &sch->orb); ccode = ssch (sch->irq, &sch->orb);
/* process condition code */
sprintf (dbf_txt, "ccode:%d", ccode); sprintf (dbf_txt, "ccode:%d", ccode);
CIO_TRACE_EVENT (4, dbf_txt); CIO_TRACE_EVENT (4, dbf_txt);
...@@ -224,6 +225,12 @@ cio_start (struct subchannel *sch, /* subchannel structure */ ...@@ -224,6 +225,12 @@ cio_start (struct subchannel *sch, /* subchannel structure */
} }
} }
int
cio_start (struct subchannel *sch, struct ccw1 *cpa, __u8 lpm)
{
return cio_start_key(sch, cpa, lpm, default_storage_key);
}
/* /*
* resume suspended I/O operation * resume suspended I/O operation
*/ */
......
...@@ -122,6 +122,7 @@ extern int cio_clear (struct subchannel *); ...@@ -122,6 +122,7 @@ extern int cio_clear (struct subchannel *);
extern int cio_resume (struct subchannel *); extern int cio_resume (struct subchannel *);
extern int cio_halt (struct subchannel *); extern int cio_halt (struct subchannel *);
extern int cio_start (struct subchannel *, struct ccw1 *, __u8); extern int cio_start (struct subchannel *, struct ccw1 *, __u8);
extern int cio_start_key (struct subchannel *, struct ccw1 *, __u8, __u8);
extern int cio_cancel (struct subchannel *); extern int cio_cancel (struct subchannel *);
extern int cio_set_options (struct subchannel *, int); extern int cio_set_options (struct subchannel *, int);
extern int cio_get_options (struct subchannel *); extern int cio_get_options (struct subchannel *);
......
...@@ -67,8 +67,9 @@ ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) ...@@ -67,8 +67,9 @@ ccw_device_clear(struct ccw_device *cdev, unsigned long intparm)
} }
int int
ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa, ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
unsigned long intparm, __u8 lpm, unsigned long flags) unsigned long intparm, __u8 lpm, __u8 key,
unsigned long flags)
{ {
struct subchannel *sch; struct subchannel *sch;
int ret; int ret;
...@@ -88,28 +89,48 @@ ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa, ...@@ -88,28 +89,48 @@ ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa,
ret = cio_set_options (sch, flags); ret = cio_set_options (sch, flags);
if (ret) if (ret)
return ret; return ret;
ret = cio_start (sch, cpa, lpm); ret = cio_start_key (sch, cpa, lpm, key);
if (ret == 0) if (ret == 0)
cdev->private->intparm = intparm; cdev->private->intparm = intparm;
return ret; return ret;
} }
int int
ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa, ccw_device_start_timeout_key(struct ccw_device *cdev, struct ccw1 *cpa,
unsigned long intparm, __u8 lpm, unsigned long flags, unsigned long intparm, __u8 lpm, __u8 key,
int expires) unsigned long flags, int expires)
{ {
int ret; int ret;
if (!cdev) if (!cdev)
return -ENODEV; return -ENODEV;
ccw_device_set_timeout(cdev, expires); ccw_device_set_timeout(cdev, expires);
ret = ccw_device_start(cdev, cpa, intparm, lpm, flags); ret = ccw_device_start_key(cdev, cpa, intparm, lpm, key, flags);
if (ret != 0) if (ret != 0)
ccw_device_set_timeout(cdev, 0); ccw_device_set_timeout(cdev, 0);
return ret; return ret;
} }
int
ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa,
unsigned long intparm, __u8 lpm, unsigned long flags)
{
return ccw_device_start_key(cdev, cpa, intparm, lpm,
default_storage_key, flags);
}
int
ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa,
unsigned long intparm, __u8 lpm, unsigned long flags,
int expires)
{
return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm,
default_storage_key, flags,
expires);
}
int int
ccw_device_halt(struct ccw_device *cdev, unsigned long intparm) ccw_device_halt(struct ccw_device *cdev, unsigned long intparm)
{ {
...@@ -541,6 +562,8 @@ EXPORT_SYMBOL(ccw_device_halt); ...@@ -541,6 +562,8 @@ EXPORT_SYMBOL(ccw_device_halt);
EXPORT_SYMBOL(ccw_device_resume); EXPORT_SYMBOL(ccw_device_resume);
EXPORT_SYMBOL(ccw_device_start_timeout); EXPORT_SYMBOL(ccw_device_start_timeout);
EXPORT_SYMBOL(ccw_device_start); EXPORT_SYMBOL(ccw_device_start);
EXPORT_SYMBOL(ccw_device_start_timeout_key);
EXPORT_SYMBOL(ccw_device_start_key);
EXPORT_SYMBOL(ccw_device_get_ciw); EXPORT_SYMBOL(ccw_device_get_ciw);
EXPORT_SYMBOL(ccw_device_get_path_mask); EXPORT_SYMBOL(ccw_device_get_path_mask);
EXPORT_SYMBOL(read_conf_data); EXPORT_SYMBOL(read_conf_data);
......
...@@ -144,6 +144,19 @@ extern int ccw_device_start(struct ccw_device *, struct ccw1 *, ...@@ -144,6 +144,19 @@ extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
*/ */
extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *, extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *,
unsigned long, __u8, unsigned long, int); unsigned long, __u8, unsigned long, int);
/*
* ccw_device_start_key()
* ccw_device_start_key_timeout()
*
* Same as ccw_device_start() and ccw_device_start_timeout(), except a
* storage key != default key can be provided for the I/O.
*/
extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *,
unsigned long, __u8, __u8, unsigned long);
extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *,
unsigned long, __u8, __u8,
unsigned long, int);
extern int ccw_device_resume(struct ccw_device *); extern int ccw_device_resume(struct ccw_device *);
extern int ccw_device_halt(struct ccw_device *, unsigned long); extern int ccw_device_halt(struct ccw_device *, unsigned long);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment