aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/chp.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-07-14 03:58:45 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-07-14 04:02:05 -0400
commitc820de39bd083222f5be2563181c87493e436f7c (patch)
tree4861db1aeca00d55d76b5844ad209d81a2795105 /drivers/s390/cio/chp.c
parent7e9db9eaefdb8798730790214ff1b7746006ec98 (diff)
[S390] cio: Rework css driver.
Rework the css driver methods to provide sane callbacks for subchannels of all types. As a bonus, this cleans up and simplyfies the machine check handling for I/O subchannels a lot. Signed-off-by: Cornelia Huck <cornelia.huck@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/chp.c')
-rw-r--r--drivers/s390/cio/chp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 297cdceb0ca4..297f1653b52b 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -496,6 +496,26 @@ void chp_process_crw(int id, int status)
496 chsc_chp_offline(chpid); 496 chsc_chp_offline(chpid);
497} 497}
498 498
499int chp_ssd_get_mask(struct chsc_ssd_info *ssd, struct res_acc_data *data)
500{
501 int i;
502 int mask;
503
504 for (i = 0; i < 8; i++) {
505 mask = 0x80 >> i;
506 if (!(ssd->path_mask & mask))
507 continue;
508 if (!chp_id_is_equal(&ssd->chpid[i], &data->chpid))
509 continue;
510 if ((ssd->fla_valid_mask & mask) &&
511 ((ssd->fla[i] & data->fla_mask) != data->fla))
512 continue;
513 return mask;
514 }
515 return 0;
516}
517EXPORT_SYMBOL_GPL(chp_ssd_get_mask);
518
499static inline int info_bit_num(struct chp_id id) 519static inline int info_bit_num(struct chp_id id)
500{ 520{
501 return id.id + id.cssid * (__MAX_CHPID + 1); 521 return id.id + id.cssid * (__MAX_CHPID + 1);