]> err.no Git - linux-2.6/blobdiff - drivers/s390/cio/cio.c
[S390] cio: Introduce struct chp_id.
[linux-2.6] / drivers / s390 / cio / cio.c
index 9cb129ab5be5092ae421b7f104a39cbb48ff9ec9..bab729202f4989430c897c107c121e2820024dea 100644 (file)
@@ -954,6 +954,7 @@ static void css_reset(void)
 {
        int i, ret;
        unsigned long long timeout;
+       struct chp_id chpid;
 
        /* Reset subchannels. */
        for_each_subchannel(__shutdown_subchannel_easy,  NULL);
@@ -963,8 +964,10 @@ static void css_reset(void)
        __ctl_set_bit(14, 28);
        /* Temporarily reenable machine checks. */
        local_mcck_enable();
+       chp_id_init(&chpid);
        for (i = 0; i <= __MAX_CHPID; i++) {
-               ret = rchp(i);
+               chpid.id = i;
+               ret = rchp(chpid);
                if ((ret == 0) || (ret == 2))
                        /*
                         * rchp either succeeded, or another rchp is already
@@ -1048,37 +1051,19 @@ void reipl_ccw_dev(struct ccw_dev_id *devid)
        do_reipl_asm(*((__u32*)&schid));
 }
 
-static struct schib __initdata ipl_schib;
-
-/*
- * ipl_save_parameters gets called very early. It is not allowed to access
- * anything in the bss section at all. The bss section is not cleared yet,
- * but may contain some ipl parameters written by the firmware.
- * These parameters (if present) are copied to 0x2000.
- * To avoid corruption of the ipl parameters, all variables used by this
- * function must reside on the stack or in the data section.
- */
-void ipl_save_parameters(void)
+int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo)
 {
        struct subchannel_id schid;
-       unsigned int *ipl_ptr;
-       void *src, *dst;
+       struct schib schib;
 
        schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID;
        if (!schid.one)
-               return;
-       if (stsch(schid, &ipl_schib))
-               return;
-       if (!ipl_schib.pmcw.dnv)
-               return;
-       ipl_devno = ipl_schib.pmcw.dev;
-       ipl_flags |= IPL_DEVNO_VALID;
-       if (!ipl_schib.pmcw.qf)
-               return;
-       ipl_flags |= IPL_PARMBLOCK_VALID;
-       ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR;
-       src = (void *)(unsigned long)*ipl_ptr;
-       dst = (void *)IPL_PARMBLOCK_ORIGIN;
-       memmove(dst, src, PAGE_SIZE);
-       *ipl_ptr = IPL_PARMBLOCK_ORIGIN;
+               return -ENODEV;
+       if (stsch(schid, &schib))
+               return -ENODEV;
+       if (!schib.pmcw.dnv)
+               return -ENODEV;
+       iplinfo->devno = schib.pmcw.dev;
+       iplinfo->is_qdio = schib.pmcw.qf;
+       return 0;
 }