Commit e6b6e10a authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Martin Schwidefsky

[S390] cio: Introduce separate files for channel-path related code.

Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent d120b2a4
......@@ -2,7 +2,7 @@
# Makefile for the S/390 common i/o drivers
#
obj-y += airq.o blacklist.o chsc.o cio.o css.o
obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o
ccw_device-objs += device.o device_fsm.o device_ops.o
ccw_device-objs += device_id.o device_pgid.o device_status.o
obj-y += ccw_device.o cmf.o
......
This diff is collapsed.
/*
* drivers/s390/cio/chp.h
*
* Copyright IBM Corp. 2007
* Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
*/
#ifndef S390_CHP_H
#define S390_CHP_H S390_CHP_H
#include <linux/types.h>
#include <linux/device.h>
#include "chpid.h"
#include "chsc.h"
struct channel_path {
struct chp_id chpid;
int state;
struct channel_path_desc desc;
/* Channel-measurement related stuff: */
int cmg;
int shared;
void *cmg_chars;
struct device dev;
};
int chp_get_status(struct chp_id chpid);
u8 chp_get_sch_opm(struct subchannel *sch);
int chp_is_registered(struct chp_id chpid);
void *chp_get_chp_desc(struct chp_id chpid);
int chp_process_crw(int id, int available);
void chp_remove_cmg_attr(struct channel_path *chp);
int chp_add_cmg_attr(struct channel_path *chp);
int chp_new(struct chp_id chpid);
#endif /* S390_CHP_H */
This diff is collapsed.
......@@ -5,10 +5,6 @@
#include <linux/device.h>
#include "chpid.h"
#define CHSC_SEI_ACC_CHPID 1
#define CHSC_SEI_ACC_LINKADDR 2
#define CHSC_SEI_ACC_FULLLINKADDR 3
#define CHSC_SDA_OC_MSS 0x2
struct chsc_header {
......@@ -37,23 +33,10 @@ struct channel_path_desc {
u8 chpp;
} __attribute__ ((packed));
struct channel_path {
struct chp_id chpid;
int state;
struct channel_path_desc desc;
/* Channel-measurement related stuff: */
int cmg;
int shared;
void *cmg_chars;
struct device dev;
};
struct channel_path;
extern void s390_process_css( void );
extern void chsc_validate_chpids(struct subchannel *);
extern void chpid_is_actually_online(struct chp_id);
extern int css_get_ssd_info(struct subchannel *);
extern int chsc_process_crw(void);
extern int chp_process_crw(int, int);
struct css_general_char {
u64 : 41;
......@@ -89,12 +72,15 @@ extern struct css_chsc_char css_chsc_characteristics;
extern int chsc_determine_css_characteristics(void);
extern int css_characteristics_avail;
extern void *chsc_get_chp_desc(struct subchannel*, int);
extern int chsc_enable_facility(int);
struct channel_subsystem;
extern int chsc_secm(struct channel_subsystem *, int);
#define to_channelpath(device) container_of(device, struct channel_path, dev)
int chsc_chp_vary(struct chp_id chpid, int on);
int chsc_determine_channel_path_description(struct chp_id chpid,
struct channel_path_desc *desc);
int chsc_chp_online(struct chp_id chpid);
void chsc_chp_offline(struct chp_id chpid);
int chsc_get_channel_measurement_chars(struct channel_path *chp);
#endif
......@@ -29,6 +29,7 @@
#include "ioasm.h"
#include "blacklist.h"
#include "cio_debug.h"
#include "chp.h"
#include "../s390mach.h"
debug_info_t *cio_debug_msg_id;
......@@ -592,9 +593,10 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
err = -ENODEV;
goto out;
}
sch->opm = 0xff;
if (!cio_is_console(sch->schid))
chsc_validate_chpids(sch);
if (cio_is_console(sch->schid))
sch->opm = 0xff;
else
sch->opm = chp_get_sch_opm(sch);
sch->lpm = sch->schib.pmcw.pam & sch->opm;
CIO_DEBUG(KERN_INFO, 0,
......
......@@ -4,6 +4,7 @@
#include <linux/mutex.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/device.h>
#include <asm/cio.h>
......
......@@ -23,6 +23,7 @@
#include "chsc.h"
#include "ioasm.h"
#include "chpid.h"
#include "chp.h"
int
device_is_online(struct subchannel *sch)
......@@ -221,7 +222,10 @@ __recover_lost_chpids(struct subchannel *sch, int old_lpm)
if (old_lpm & mask)
continue;
chpid.id = sch->schib.pmcw.chpid[i];
chpid_is_actually_online(chpid);
if (!chp_is_registered(chpid)) {
need_rescan = 1;
queue_work(slow_path_wq, &slow_path_work);
}
}
}
......
......@@ -22,6 +22,8 @@
#include "css.h"
#include "chsc.h"
#include "device.h"
#include "chpid.h"
#include "chp.h"
int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
{
......@@ -606,9 +608,12 @@ void *
ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
{
struct subchannel *sch;
struct chp_id chpid;
sch = to_subchannel(cdev->dev.parent);
return chsc_get_chp_desc(sch, chp_no);
chp_id_init(&chpid);
chpid.id = sch->schib.pmcw.chpid[chp_no];
return chp_get_chp_desc(chpid);
}
// FIXME: these have to go:
......
......@@ -21,6 +21,7 @@
#include "cio/cio.h"
#include "cio/chsc.h"
#include "cio/css.h"
#include "cio/chp.h"
#include "s390mach.h"
static struct semaphore m_sem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment