aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2017-06-29 07:27:22 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-03-26 10:13:11 -0400
commitded27d8d2eae2aefe7d03d3e7c3fbdcd1fd501fc (patch)
treedc5ef06e6909f79b3166b9bed78ac2023b4d296a
parent135a8b4ce5d737115571f08c6d0649f1aed6a48a (diff)
s390/cio: rename struct channel_path_desc
Rename struct channel_path_desc to struct channel_path_desc_fmt0 to fit the scheme. Provide a macro for the function wrappers that gather this and related data from firmware. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/include/asm/ccwdev.h2
-rw-r--r--arch/s390/include/asm/chpid.h2
-rw-r--r--drivers/s390/block/dasd_eckd.c2
-rw-r--r--drivers/s390/cio/chp.c10
-rw-r--r--drivers/s390/cio/chp.h4
-rw-r--r--drivers/s390/cio/chsc.c56
-rw-r--r--drivers/s390/cio/chsc.h4
-rw-r--r--drivers/s390/cio/device_ops.c4
-rw-r--r--drivers/s390/net/qeth_core_main.c2
9 files changed, 36 insertions, 50 deletions
diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h
index 633f8da86137..20bce136b2e5 100644
--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -230,5 +230,5 @@ int ccw_device_siosl(struct ccw_device *);
230 230
231extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *); 231extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
232 232
233struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *, int); 233struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *, int);
234#endif /* _S390_CCWDEV_H_ */ 234#endif /* _S390_CCWDEV_H_ */
diff --git a/arch/s390/include/asm/chpid.h b/arch/s390/include/asm/chpid.h
index 4773f747915c..20e0d22f29e9 100644
--- a/arch/s390/include/asm/chpid.h
+++ b/arch/s390/include/asm/chpid.h
@@ -9,7 +9,7 @@
9#include <uapi/asm/chpid.h> 9#include <uapi/asm/chpid.h>
10#include <asm/cio.h> 10#include <asm/cio.h>
11 11
12struct channel_path_desc { 12struct channel_path_desc_fmt0 {
13 u8 flags; 13 u8 flags;
14 u8 lsn; 14 u8 lsn;
15 u8 desc; 15 u8 desc;
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 85b6a70ce334..be208e7adcb4 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -994,7 +994,7 @@ static int dasd_eckd_read_conf(struct dasd_device *device)
994 struct dasd_eckd_private *private, path_private; 994 struct dasd_eckd_private *private, path_private;
995 struct dasd_uid *uid; 995 struct dasd_uid *uid;
996 char print_path_uid[60], print_device_uid[60]; 996 char print_path_uid[60], print_device_uid[60];
997 struct channel_path_desc *chp_desc; 997 struct channel_path_desc_fmt0 *chp_desc;
998 struct subchannel_id sch_id; 998 struct subchannel_id sch_id;
999 999
1000 private = device->private; 1000 private = device->private;
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index f95b452b8bbc..34315e65c1c8 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -422,7 +422,7 @@ int chp_update_desc(struct channel_path *chp)
422{ 422{
423 int rc; 423 int rc;
424 424
425 rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc); 425 rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc);
426 if (rc) 426 if (rc)
427 return rc; 427 return rc;
428 428
@@ -506,20 +506,20 @@ out:
506 * On success return a newly allocated copy of the channel-path description 506 * On success return a newly allocated copy of the channel-path description
507 * data associated with the given channel-path ID. Return %NULL on error. 507 * data associated with the given channel-path ID. Return %NULL on error.
508 */ 508 */
509struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid) 509struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid)
510{ 510{
511 struct channel_path *chp; 511 struct channel_path *chp;
512 struct channel_path_desc *desc; 512 struct channel_path_desc_fmt0 *desc;
513 513
514 chp = chpid_to_chp(chpid); 514 chp = chpid_to_chp(chpid);
515 if (!chp) 515 if (!chp)
516 return NULL; 516 return NULL;
517 desc = kmalloc(sizeof(struct channel_path_desc), GFP_KERNEL); 517 desc = kmalloc(sizeof(*desc), GFP_KERNEL);
518 if (!desc) 518 if (!desc)
519 return NULL; 519 return NULL;
520 520
521 mutex_lock(&chp->lock); 521 mutex_lock(&chp->lock);
522 memcpy(desc, &chp->desc, sizeof(struct channel_path_desc)); 522 memcpy(desc, &chp->desc, sizeof(*desc));
523 mutex_unlock(&chp->lock); 523 mutex_unlock(&chp->lock);
524 return desc; 524 return desc;
525} 525}
diff --git a/drivers/s390/cio/chp.h b/drivers/s390/cio/chp.h
index 7e80323cd261..6d2bfbbead66 100644
--- a/drivers/s390/cio/chp.h
+++ b/drivers/s390/cio/chp.h
@@ -44,7 +44,7 @@ struct channel_path {
44 struct chp_id chpid; 44 struct chp_id chpid;
45 struct mutex lock; /* Serialize access to below members. */ 45 struct mutex lock; /* Serialize access to below members. */
46 int state; 46 int state;
47 struct channel_path_desc desc; 47 struct channel_path_desc_fmt0 desc;
48 struct channel_path_desc_fmt1 desc_fmt1; 48 struct channel_path_desc_fmt1 desc_fmt1;
49 /* Channel-measurement related stuff: */ 49 /* Channel-measurement related stuff: */
50 int cmg; 50 int cmg;
@@ -61,7 +61,7 @@ static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
61int chp_get_status(struct chp_id chpid); 61int chp_get_status(struct chp_id chpid);
62u8 chp_get_sch_opm(struct subchannel *sch); 62u8 chp_get_sch_opm(struct subchannel *sch);
63int chp_is_registered(struct chp_id chpid); 63int chp_is_registered(struct chp_id chpid);
64struct channel_path_desc *chp_get_chp_desc(struct chp_id chpid); 64struct channel_path_desc_fmt0 *chp_get_chp_desc(struct chp_id chpid);
65void chp_remove_cmg_attr(struct channel_path *chp); 65void chp_remove_cmg_attr(struct channel_path *chp);
66int chp_add_cmg_attr(struct channel_path *chp); 66int chp_add_cmg_attr(struct channel_path *chp);
67int chp_update_desc(struct channel_path *chp); 67int chp_update_desc(struct channel_path *chp);
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index c08fc5a8df0c..65290e5ac854 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -940,43 +940,29 @@ int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
940} 940}
941EXPORT_SYMBOL_GPL(chsc_determine_channel_path_desc); 941EXPORT_SYMBOL_GPL(chsc_determine_channel_path_desc);
942 942
943int chsc_determine_base_channel_path_desc(struct chp_id chpid, 943#define chsc_det_chp_desc(FMT, c) \
944 struct channel_path_desc *desc) 944int chsc_determine_fmt##FMT##_channel_path_desc( \
945{ 945 struct chp_id chpid, struct channel_path_desc_fmt##FMT *desc) \
946 struct chsc_scpd *scpd_area; 946{ \
947 unsigned long flags; 947 struct chsc_scpd *scpd_area; \
948 int ret; 948 unsigned long flags; \
949 949 int ret; \
950 spin_lock_irqsave(&chsc_page_lock, flags); 950 \
951 scpd_area = chsc_page; 951 spin_lock_irqsave(&chsc_page_lock, flags); \
952 ret = chsc_determine_channel_path_desc(chpid, 0, 0, 0, 0, scpd_area); 952 scpd_area = chsc_page; \
953 if (ret) 953 ret = chsc_determine_channel_path_desc(chpid, 0, FMT, c, 0, \
954 goto out; 954 scpd_area); \
955 955 if (ret) \
956 memcpy(desc, scpd_area->data, sizeof(*desc)); 956 goto out; \
957out: 957 \
958 spin_unlock_irqrestore(&chsc_page_lock, flags); 958 memcpy(desc, scpd_area->data, sizeof(*desc)); \
959 return ret; 959out: \
960 spin_unlock_irqrestore(&chsc_page_lock, flags); \
961 return ret; \
960} 962}
961 963
962int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid, 964chsc_det_chp_desc(0, 0)
963 struct channel_path_desc_fmt1 *desc) 965chsc_det_chp_desc(1, 1)
964{
965 struct chsc_scpd *scpd_area;
966 unsigned long flags;
967 int ret;
968
969 spin_lock_irqsave(&chsc_page_lock, flags);
970 scpd_area = chsc_page;
971 ret = chsc_determine_channel_path_desc(chpid, 0, 1, 1, 0, scpd_area);
972 if (ret)
973 goto out;
974
975 memcpy(desc, scpd_area->data, sizeof(*desc));
976out:
977 spin_unlock_irqrestore(&chsc_page_lock, flags);
978 return ret;
979}
980 966
981static void 967static void
982chsc_initialize_cmg_chars(struct channel_path *chp, u8 cmcv, 968chsc_initialize_cmg_chars(struct channel_path *chp, u8 cmcv,
diff --git a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h
index dda5953534b7..bdf2cc90e5ef 100644
--- a/drivers/s390/cio/chsc.h
+++ b/drivers/s390/cio/chsc.h
@@ -147,8 +147,8 @@ int __chsc_do_secm(struct channel_subsystem *css, int enable);
147int chsc_chp_vary(struct chp_id chpid, int on); 147int chsc_chp_vary(struct chp_id chpid, int on);
148int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt, 148int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
149 int c, int m, void *page); 149 int c, int m, void *page);
150int chsc_determine_base_channel_path_desc(struct chp_id chpid, 150int chsc_determine_fmt0_channel_path_desc(struct chp_id chpid,
151 struct channel_path_desc *desc); 151 struct channel_path_desc_fmt0 *desc);
152int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid, 152int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
153 struct channel_path_desc_fmt1 *desc); 153 struct channel_path_desc_fmt1 *desc);
154void chsc_chp_online(struct chp_id chpid); 154void chsc_chp_online(struct chp_id chpid);
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 75ce12a24dc2..aecfebb74157 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -460,8 +460,8 @@ __u8 ccw_device_get_path_mask(struct ccw_device *cdev)
460 * On success return a newly allocated copy of the channel-path description 460 * On success return a newly allocated copy of the channel-path description
461 * data associated with the given channel path. Return %NULL on error. 461 * data associated with the given channel path. Return %NULL on error.
462 */ 462 */
463struct channel_path_desc *ccw_device_get_chp_desc(struct ccw_device *cdev, 463struct channel_path_desc_fmt0 *ccw_device_get_chp_desc(struct ccw_device *cdev,
464 int chp_idx) 464 int chp_idx)
465{ 465{
466 struct subchannel *sch; 466 struct subchannel *sch;
467 struct chp_id chpid; 467 struct chp_id chpid;
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index ca72f3311004..5f10e3aee7ed 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1361,7 +1361,7 @@ static void qeth_set_multiple_write_queues(struct qeth_card *card)
1361static void qeth_update_from_chp_desc(struct qeth_card *card) 1361static void qeth_update_from_chp_desc(struct qeth_card *card)
1362{ 1362{
1363 struct ccw_device *ccwdev; 1363 struct ccw_device *ccwdev;
1364 struct channel_path_desc *chp_dsc; 1364 struct channel_path_desc_fmt0 *chp_dsc;
1365 1365
1366 QETH_DBF_TEXT(SETUP, 2, "chp_desc"); 1366 QETH_DBF_TEXT(SETUP, 2, "chp_desc");
1367 1367