Skip to content

Commit

Permalink
[S390] cio: move options to io_sch_private
Browse files Browse the repository at this point in the history
Move the options member from struct subchannel to
io_subchannel_private since it's I/O subchannel specific.
Also remove the unused cio_get_options function.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Mar 15, 2011
1 parent dbda8ce commit c513d07
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 35 deletions.
37 changes: 11 additions & 26 deletions drivers/s390/cio/cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,14 @@ static int __init cio_debug_init(void)

arch_initcall (cio_debug_init);

int
cio_set_options (struct subchannel *sch, int flags)
int cio_set_options(struct subchannel *sch, int flags)
{
sch->options.suspend = (flags & DOIO_ALLOW_SUSPEND) != 0;
sch->options.prefetch = (flags & DOIO_DENY_PREFETCH) != 0;
sch->options.inter = (flags & DOIO_SUPPRESS_INTER) != 0;
return 0;
}
struct io_subchannel_private *priv = to_io_private(sch);

/* FIXME: who wants to use this? */
int
cio_get_options (struct subchannel *sch)
{
int flags;

flags = 0;
if (sch->options.suspend)
flags |= DOIO_ALLOW_SUSPEND;
if (sch->options.prefetch)
flags |= DOIO_DENY_PREFETCH;
if (sch->options.inter)
flags |= DOIO_SUPPRESS_INTER;
return flags;
priv->options.suspend = (flags & DOIO_ALLOW_SUSPEND) != 0;
priv->options.prefetch = (flags & DOIO_DENY_PREFETCH) != 0;
priv->options.inter = (flags & DOIO_SUPPRESS_INTER) != 0;
return 0;
}

static int
Expand Down Expand Up @@ -139,21 +124,21 @@ cio_start_key (struct subchannel *sch, /* subchannel structure */
__u8 lpm, /* logical path mask */
__u8 key) /* storage key */
{
struct io_subchannel_private *priv = to_io_private(sch);
union orb *orb = &priv->orb;
int ccode;
union orb *orb;

CIO_TRACE_EVENT(5, "stIO");
CIO_TRACE_EVENT(5, dev_name(&sch->dev));

orb = &to_io_private(sch)->orb;
memset(orb, 0, sizeof(union orb));
/* sch is always under 2G. */
orb->cmd.intparm = (u32)(addr_t)sch;
orb->cmd.fmt = 1;

orb->cmd.pfch = sch->options.prefetch == 0;
orb->cmd.spnd = sch->options.suspend;
orb->cmd.ssic = sch->options.suspend && sch->options.inter;
orb->cmd.pfch = priv->options.prefetch == 0;
orb->cmd.spnd = priv->options.suspend;
orb->cmd.ssic = priv->options.suspend && priv->options.inter;
orb->cmd.lpm = (lpm != 0) ? lpm : sch->lpm;
#ifdef CONFIG_64BIT
/*
Expand Down
8 changes: 0 additions & 8 deletions drivers/s390/cio/cio.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ struct subchannel {
SUBCHANNEL_TYPE_MSG = 2,
SUBCHANNEL_TYPE_ADM = 3,
} st; /* subchannel type */

struct {
unsigned int suspend:1; /* allow suspend */
unsigned int prefetch:1;/* deny prefetch */
unsigned int inter:1; /* suppress intermediate interrupts */
} __attribute__ ((packed)) options;

__u8 vpm; /* verified path mask */
__u8 lpm; /* logical path mask */
__u8 opm; /* operational path mask */
Expand Down Expand Up @@ -118,7 +111,6 @@ extern int cio_start (struct subchannel *, struct ccw1 *, __u8);
extern int cio_start_key (struct subchannel *, struct ccw1 *, __u8, __u8);
extern int cio_cancel (struct subchannel *);
extern int cio_set_options (struct subchannel *, int);
extern int cio_get_options (struct subchannel *);
extern int cio_update_schib(struct subchannel *sch);
extern int cio_commit_config(struct subchannel *sch);

Expand Down
7 changes: 6 additions & 1 deletion drivers/s390/cio/io_sch.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
struct io_subchannel_private {
union orb orb; /* operation request block */
struct ccw1 sense_ccw; /* static ccw for sense command */
} __attribute__ ((aligned(8)));
struct {
unsigned int suspend:1; /* allow suspend */
unsigned int prefetch:1;/* deny prefetch */
unsigned int inter:1; /* suppress intermediate interrupts */
} __packed options;
} __aligned(8);

#define to_io_private(n) ((struct io_subchannel_private *)n->private)
#define sch_get_cdev(n) (dev_get_drvdata(&n->dev))
Expand Down

0 comments on commit c513d07

Please sign in to comment.