aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/cio.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-01-26 08:10:43 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-01-26 08:10:59 -0500
commitcd6b4f27b9bb2a6a5ec82b96b87c85421257be6c (patch)
treebf5ac3d351242de6438ab1453a7f1b007f24c29f /drivers/s390/cio/cio.c
parentbc698bcf8897363732226dc9ecba044771679996 (diff)
[S390] cio: Introduce subchannel->private.
Introduce a private pointer in struct subchannel to store per-subchannel type data (cannot use dev->priv since this is already used for something else). Create a new header io_sch.h for I/O subchannel specific structures and instructions. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/cio.c')
-rw-r--r--drivers/s390/cio/cio.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index cd5475b82420..d0bcebde3fa2 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -28,6 +28,7 @@
28#include "css.h" 28#include "css.h"
29#include "chsc.h" 29#include "chsc.h"
30#include "ioasm.h" 30#include "ioasm.h"
31#include "io_sch.h"
31#include "blacklist.h" 32#include "blacklist.h"
32#include "cio_debug.h" 33#include "cio_debug.h"
33#include "chp.h" 34#include "chp.h"
@@ -182,33 +183,35 @@ cio_start_key (struct subchannel *sch, /* subchannel structure */
182{ 183{
183 char dbf_txt[15]; 184 char dbf_txt[15];
184 int ccode; 185 int ccode;
186 struct orb *orb;
185 187
186 CIO_TRACE_EVENT (4, "stIO"); 188 CIO_TRACE_EVENT(4, "stIO");
187 CIO_TRACE_EVENT (4, sch->dev.bus_id); 189 CIO_TRACE_EVENT(4, sch->dev.bus_id);
188 190
191 orb = &to_io_private(sch)->orb;
189 /* sch is always under 2G. */ 192 /* sch is always under 2G. */
190 sch->orb.intparm = (__u32)(unsigned long)sch; 193 orb->intparm = (u32)(addr_t)sch;
191 sch->orb.fmt = 1; 194 orb->fmt = 1;
192 195
193 sch->orb.pfch = sch->options.prefetch == 0; 196 orb->pfch = sch->options.prefetch == 0;
194 sch->orb.spnd = sch->options.suspend; 197 orb->spnd = sch->options.suspend;
195 sch->orb.ssic = sch->options.suspend && sch->options.inter; 198 orb->ssic = sch->options.suspend && sch->options.inter;
196 sch->orb.lpm = (lpm != 0) ? lpm : sch->lpm; 199 orb->lpm = (lpm != 0) ? lpm : sch->lpm;
197#ifdef CONFIG_64BIT 200#ifdef CONFIG_64BIT
198 /* 201 /*
199 * for 64 bit we always support 64 bit IDAWs with 4k page size only 202 * for 64 bit we always support 64 bit IDAWs with 4k page size only
200 */ 203 */
201 sch->orb.c64 = 1; 204 orb->c64 = 1;
202 sch->orb.i2k = 0; 205 orb->i2k = 0;
203#endif 206#endif
204 sch->orb.key = key >> 4; 207 orb->key = key >> 4;
205 /* issue "Start Subchannel" */ 208 /* issue "Start Subchannel" */
206 sch->orb.cpa = (__u32) __pa (cpa); 209 orb->cpa = (__u32) __pa(cpa);
207 ccode = ssch (sch->schid, &sch->orb); 210 ccode = ssch(sch->schid, orb);
208 211
209 /* process condition code */ 212 /* process condition code */
210 sprintf (dbf_txt, "ccode:%d", ccode); 213 sprintf(dbf_txt, "ccode:%d", ccode);
211 CIO_TRACE_EVENT (4, dbf_txt); 214 CIO_TRACE_EVENT(4, dbf_txt);
212 215
213 switch (ccode) { 216 switch (ccode) {
214 case 0: 217 case 0:
@@ -423,7 +426,7 @@ cio_enable_subchannel (struct subchannel *sch, unsigned int isc)
423 for (retry = 5, ret = 0; retry > 0; retry--) { 426 for (retry = 5, ret = 0; retry > 0; retry--) {
424 sch->schib.pmcw.ena = 1; 427 sch->schib.pmcw.ena = 1;
425 sch->schib.pmcw.isc = isc; 428 sch->schib.pmcw.isc = isc;
426 sch->schib.pmcw.intparm = (__u32)(unsigned long)sch; 429 sch->schib.pmcw.intparm = (u32)(addr_t)sch;
427 ret = cio_modify(sch); 430 ret = cio_modify(sch);
428 if (ret == -ENODEV) 431 if (ret == -ENODEV)
429 break; 432 break;
@@ -696,8 +699,14 @@ do_IRQ (struct pt_regs *regs)
696 699
697#ifdef CONFIG_CCW_CONSOLE 700#ifdef CONFIG_CCW_CONSOLE
698static struct subchannel console_subchannel; 701static struct subchannel console_subchannel;
702static struct io_subchannel_private console_priv;
699static int console_subchannel_in_use; 703static int console_subchannel_in_use;
700 704
705void *cio_get_console_priv(void)
706{
707 return &console_priv;
708}
709
701/* 710/*
702 * busy wait for the next interrupt on the console 711 * busy wait for the next interrupt on the console
703 */ 712 */
@@ -802,7 +811,7 @@ cio_probe_console(void)
802 ctl_set_bit(6, 24); 811 ctl_set_bit(6, 24);
803 console_subchannel.schib.pmcw.isc = 7; 812 console_subchannel.schib.pmcw.isc = 7;
804 console_subchannel.schib.pmcw.intparm = 813 console_subchannel.schib.pmcw.intparm =
805 (__u32)(unsigned long)&console_subchannel; 814 (u32)(addr_t)&console_subchannel;
806 ret = cio_modify(&console_subchannel); 815 ret = cio_modify(&console_subchannel);
807 if (ret) { 816 if (ret) {
808 console_subchannel_in_use = 0; 817 console_subchannel_in_use = 0;