aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index e22813db74a2..0ed5a81260bc 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -24,6 +24,7 @@
24#include <asm/param.h> /* HZ */ 24#include <asm/param.h> /* HZ */
25#include <asm/cmb.h> 25#include <asm/cmb.h>
26 26
27#include "chp.h"
27#include "cio.h" 28#include "cio.h"
28#include "cio_debug.h" 29#include "cio_debug.h"
29#include "css.h" 30#include "css.h"
@@ -1037,7 +1038,6 @@ io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch)
1037 struct ccw_device_private *priv; 1038 struct ccw_device_private *priv;
1038 1039
1039 sch_set_cdev(sch, cdev); 1040 sch_set_cdev(sch, cdev);
1040 sch->driver = &io_subchannel_driver;
1041 cdev->ccwlock = sch->lock; 1041 cdev->ccwlock = sch->lock;
1042 1042
1043 /* Init private data. */ 1043 /* Init private data. */
@@ -1122,8 +1122,33 @@ static void io_subchannel_irq(struct subchannel *sch)
1122 dev_fsm_event(cdev, DEV_EVENT_INTERRUPT); 1122 dev_fsm_event(cdev, DEV_EVENT_INTERRUPT);
1123} 1123}
1124 1124
1125static int 1125static void io_subchannel_init_fields(struct subchannel *sch)
1126io_subchannel_probe (struct subchannel *sch) 1126{
1127 if (cio_is_console(sch->schid))
1128 sch->opm = 0xff;
1129 else
1130 sch->opm = chp_get_sch_opm(sch);
1131 sch->lpm = sch->schib.pmcw.pam & sch->opm;
1132 sch->isc = cio_is_console(sch->schid) ? 1 : 3;
1133
1134 CIO_MSG_EVENT(6, "Detected device %04x on subchannel 0.%x.%04X"
1135 " - PIM = %02X, PAM = %02X, POM = %02X\n",
1136 sch->schib.pmcw.dev, sch->schid.ssid,
1137 sch->schid.sch_no, sch->schib.pmcw.pim,
1138 sch->schib.pmcw.pam, sch->schib.pmcw.pom);
1139 /* Initially set up some fields in the pmcw. */
1140 sch->schib.pmcw.ena = 0;
1141 sch->schib.pmcw.csense = 1; /* concurrent sense */
1142 if ((sch->lpm & (sch->lpm - 1)) != 0)
1143 sch->schib.pmcw.mp = 1; /* multipath mode */
1144 /* clean up possible residual cmf stuff */
1145 sch->schib.pmcw.mme = 0;
1146 sch->schib.pmcw.mbfc = 0;
1147 sch->schib.pmcw.mbi = 0;
1148 sch->schib.mba = 0;
1149}
1150
1151static int io_subchannel_probe(struct subchannel *sch)
1127{ 1152{
1128 struct ccw_device *cdev; 1153 struct ccw_device *cdev;
1129 int rc; 1154 int rc;
@@ -1152,6 +1177,7 @@ io_subchannel_probe (struct subchannel *sch)
1152 get_device(&cdev->dev); 1177 get_device(&cdev->dev);
1153 return 0; 1178 return 0;
1154 } 1179 }
1180 io_subchannel_init_fields(sch);
1155 /* 1181 /*
1156 * First check if a fitting device may be found amongst the 1182 * First check if a fitting device may be found amongst the
1157 * disconnected devices or in the orphanage. 1183 * disconnected devices or in the orphanage.
@@ -1297,14 +1323,16 @@ spinlock_t * cio_get_console_lock(void)
1297 return &ccw_console_lock; 1323 return &ccw_console_lock;
1298} 1324}
1299 1325
1300static int 1326static int ccw_device_console_enable(struct ccw_device *cdev,
1301ccw_device_console_enable (struct ccw_device *cdev, struct subchannel *sch) 1327 struct subchannel *sch)
1302{ 1328{
1303 int rc; 1329 int rc;
1304 1330
1305 /* Attach subchannel private data. */ 1331 /* Attach subchannel private data. */
1306 sch->private = cio_get_console_priv(); 1332 sch->private = cio_get_console_priv();
1307 memset(sch->private, 0, sizeof(struct io_subchannel_private)); 1333 memset(sch->private, 0, sizeof(struct io_subchannel_private));
1334 io_subchannel_init_fields(sch);
1335 sch->driver = &io_subchannel_driver;
1308 /* Initialize the ccw_device structure. */ 1336 /* Initialize the ccw_device structure. */
1309 cdev->dev.parent= &sch->dev; 1337 cdev->dev.parent= &sch->dev;
1310 rc = io_subchannel_recog(cdev, sch); 1338 rc = io_subchannel_recog(cdev, sch);