diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2007-04-27 10:01:31 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-04-27 10:01:39 -0400 |
commit | e5854a5839fa426a7873f038080f63587de5f1f1 (patch) | |
tree | c0a3705df925e652ff0694a47e7acb98e5f7d7bd /drivers/s390/cio/chsc.c | |
parent | f5ba6c863617c15d22cce5f8666ff4c832773025 (diff) |
[S390] cio: Channel-path configure function.
Add a new attribute to the channel-path sysfs directory through which
channel-path configure operations can be triggered. Also listen for
hardware events requesting channel-path configure operations and
process them accordingly.
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/chsc.c')
-rw-r--r-- | drivers/s390/cio/chsc.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index d99f525eac08..3dec460bba27 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -15,12 +15,12 @@ | |||
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | 16 | ||
17 | #include <asm/cio.h> | 17 | #include <asm/cio.h> |
18 | #include <asm/chpid.h> | ||
18 | 19 | ||
19 | #include "css.h" | 20 | #include "css.h" |
20 | #include "cio.h" | 21 | #include "cio.h" |
21 | #include "cio_debug.h" | 22 | #include "cio_debug.h" |
22 | #include "ioasm.h" | 23 | #include "ioasm.h" |
23 | #include "chpid.h" | ||
24 | #include "chp.h" | 24 | #include "chp.h" |
25 | #include "chsc.h" | 25 | #include "chsc.h" |
26 | 26 | ||
@@ -498,6 +498,45 @@ static int chsc_process_sei_res_acc(struct chsc_sei_area *sei_area) | |||
498 | return rc; | 498 | return rc; |
499 | } | 499 | } |
500 | 500 | ||
501 | struct chp_config_data { | ||
502 | u8 map[32]; | ||
503 | u8 op; | ||
504 | u8 pc; | ||
505 | }; | ||
506 | |||
507 | static int chsc_process_sei_chp_config(struct chsc_sei_area *sei_area) | ||
508 | { | ||
509 | struct chp_config_data *data; | ||
510 | struct chp_id chpid; | ||
511 | int num; | ||
512 | |||
513 | CIO_CRW_EVENT(4, "chsc: channel-path-configuration notification\n"); | ||
514 | if (sei_area->rs != 0) | ||
515 | return 0; | ||
516 | data = (struct chp_config_data *) &(sei_area->ccdf); | ||
517 | chp_id_init(&chpid); | ||
518 | for (num = 0; num <= __MAX_CHPID; num++) { | ||
519 | if (!chp_test_bit(data->map, num)) | ||
520 | continue; | ||
521 | chpid.id = num; | ||
522 | printk(KERN_WARNING "cio: processing configure event %d for " | ||
523 | "chpid %x.%02x\n", data->op, chpid.cssid, chpid.id); | ||
524 | switch (data->op) { | ||
525 | case 0: | ||
526 | chp_cfg_schedule(chpid, 1); | ||
527 | break; | ||
528 | case 1: | ||
529 | chp_cfg_schedule(chpid, 0); | ||
530 | break; | ||
531 | case 2: | ||
532 | chp_cfg_cancel_deconfigure(chpid); | ||
533 | break; | ||
534 | } | ||
535 | } | ||
536 | |||
537 | return 0; | ||
538 | } | ||
539 | |||
501 | static int chsc_process_sei(struct chsc_sei_area *sei_area) | 540 | static int chsc_process_sei(struct chsc_sei_area *sei_area) |
502 | { | 541 | { |
503 | int rc; | 542 | int rc; |
@@ -514,6 +553,9 @@ static int chsc_process_sei(struct chsc_sei_area *sei_area) | |||
514 | case 2: /* i/o resource accessibiliy */ | 553 | case 2: /* i/o resource accessibiliy */ |
515 | rc = chsc_process_sei_res_acc(sei_area); | 554 | rc = chsc_process_sei_res_acc(sei_area); |
516 | break; | 555 | break; |
556 | case 8: /* channel-path-configuration notification */ | ||
557 | rc = chsc_process_sei_chp_config(sei_area); | ||
558 | break; | ||
517 | default: /* other stuff */ | 559 | default: /* other stuff */ |
518 | CIO_CRW_EVENT(4, "chsc: unhandled sei content code %d\n", | 560 | CIO_CRW_EVENT(4, "chsc: unhandled sei content code %d\n", |
519 | sei_area->cc); | 561 | sei_area->cc); |