Lines Matching refs:sch

90 int cio_set_options(struct subchannel *sch, int flags)
92 struct io_subchannel_private *priv = to_io_private(sch);
101 cio_start_handle_notoper(struct subchannel *sch, __u8 lpm)
106 sch->lpm &= ~lpm;
108 sch->lpm = 0;
111 "subchannel 0.%x.%04x!\n", sch->schid.ssid,
112 sch->schid.sch_no);
114 if (cio_update_schib(sch))
117 sprintf(dbf_text, "no%s", dev_name(&sch->dev));
119 CIO_HEX_EVENT(0, &sch->schib, sizeof (struct schib));
121 return (sch->lpm ? -EACCES : -ENODEV);
125 cio_start_key (struct subchannel *sch, /* subchannel structure */
130 struct io_subchannel_private *priv = to_io_private(sch);
135 CIO_TRACE_EVENT(5, dev_name(&sch->dev));
138 /* sch is always under 2G. */
139 orb->cmd.intparm = (u32)(addr_t)sch;
145 orb->cmd.lpm = (lpm != 0) ? lpm : sch->lpm;
156 ccode = ssch(sch->schid, orb);
166 sch->schib.scsw.cmd.actl |= SCSW_ACTL_START_PEND;
172 return cio_start_handle_notoper(sch, lpm);
179 cio_start (struct subchannel *sch, struct ccw1 *cpa, __u8 lpm)
181 return cio_start_key(sch, cpa, lpm, PAGE_DEFAULT_KEY);
188 cio_resume (struct subchannel *sch)
193 CIO_TRACE_EVENT(4, dev_name(&sch->dev));
195 ccode = rsch (sch->schid);
201 sch->schib.scsw.cmd.actl |= SCSW_ACTL_RESUME_PEND;
220 cio_halt(struct subchannel *sch)
224 if (!sch)
228 CIO_TRACE_EVENT(2, dev_name(&sch->dev));
233 ccode = hsch (sch->schid);
239 sch->schib.scsw.cmd.actl |= SCSW_ACTL_HALT_PEND;
253 cio_clear(struct subchannel *sch)
257 if (!sch)
261 CIO_TRACE_EVENT(2, dev_name(&sch->dev));
266 ccode = csch (sch->schid);
272 sch->schib.scsw.cmd.actl |= SCSW_ACTL_CLEAR_PEND;
287 cio_cancel (struct subchannel *sch)
291 if (!sch)
295 CIO_TRACE_EVENT(2, dev_name(&sch->dev));
297 ccode = xsch (sch->schid);
304 if (cio_update_schib(sch))
317 static void cio_apply_config(struct subchannel *sch, struct schib *schib)
319 schib->pmcw.intparm = sch->config.intparm;
320 schib->pmcw.mbi = sch->config.mbi;
321 schib->pmcw.isc = sch->config.isc;
322 schib->pmcw.ena = sch->config.ena;
323 schib->pmcw.mme = sch->config.mme;
324 schib->pmcw.mp = sch->config.mp;
325 schib->pmcw.csense = sch->config.csense;
326 schib->pmcw.mbfc = sch->config.mbfc;
327 if (sch->config.mbfc)
328 schib->mba = sch->config.mba;
331 static int cio_check_config(struct subchannel *sch, struct schib *schib)
333 return (schib->pmcw.intparm == sch->config.intparm) &&
334 (schib->pmcw.mbi == sch->config.mbi) &&
335 (schib->pmcw.isc == sch->config.isc) &&
336 (schib->pmcw.ena == sch->config.ena) &&
337 (schib->pmcw.mme == sch->config.mme) &&
338 (schib->pmcw.mp == sch->config.mp) &&
339 (schib->pmcw.csense == sch->config.csense) &&
340 (schib->pmcw.mbfc == sch->config.mbfc) &&
341 (!sch->config.mbfc || (schib->mba == sch->config.mba));
347 int cio_commit_config(struct subchannel *sch)
353 if (stsch_err(sch->schid, &schib) || !css_sch_is_valid(&schib))
358 cio_apply_config(sch, &schib);
359 ccode = msch_err(sch->schid, &schib);
364 if (stsch_err(sch->schid, &schib) ||
367 if (cio_check_config(sch, &schib)) {
369 memcpy(&sch->schib, &schib, sizeof(schib));
376 if (tsch(sch->schid, &irb))
392 * @sch: subchannel on which to perform stsch
395 int cio_update_schib(struct subchannel *sch)
399 if (stsch_err(sch->schid, &schib) || !css_sch_is_valid(&schib))
402 memcpy(&sch->schib, &schib, sizeof(schib));
409 * @sch: subchannel to be enabled
412 int cio_enable_subchannel(struct subchannel *sch, u32 intparm)
417 CIO_TRACE_EVENT(2, dev_name(&sch->dev));
419 if (sch_is_pseudo_sch(sch))
421 if (cio_update_schib(sch))
424 sch->config.ena = 1;
425 sch->config.isc = sch->isc;
426 sch->config.intparm = intparm;
428 ret = cio_commit_config(sch);
434 sch->config.csense = 0;
435 ret = cio_commit_config(sch);
444 * @sch: subchannel to disable
446 int cio_disable_subchannel(struct subchannel *sch)
451 CIO_TRACE_EVENT(2, dev_name(&sch->dev));
453 if (sch_is_pseudo_sch(sch))
455 if (cio_update_schib(sch))
458 sch->config.ena = 0;
459 ret = cio_commit_config(sch);
466 static int cio_check_devno_blacklisted(struct subchannel *sch)
468 if (is_blacklisted(sch->schid.ssid, sch->schib.pmcw.dev)) {
475 sch->schib.pmcw.dev, sch->schid.ssid);
481 static int cio_validate_io_subchannel(struct subchannel *sch)
484 if (!css_sch_is_valid(&sch->schib))
488 return cio_check_devno_blacklisted(sch);
491 static int cio_validate_msg_subchannel(struct subchannel *sch)
494 if (!css_sch_is_valid(&sch->schib))
498 return cio_check_devno_blacklisted(sch);
503 * @sch: subchannel structure to be filled out
513 int cio_validate_subchannel(struct subchannel *sch, struct subchannel_id schid)
528 ccode = stsch_err(schid, &sch->schib);
533 sch->st = sch->schib.pmcw.st;
534 sch->schid = schid;
536 switch (sch->st) {
538 err = cio_validate_io_subchannel(sch);
541 err = cio_validate_msg_subchannel(sch);
550 sch->schid.ssid, sch->schid.sch_no, sch->st);
561 struct subchannel *sch;
567 sch = (struct subchannel *)(unsigned long) tpi_info->intparm;
568 if (!sch) {
574 spin_lock(sch->lock);
578 memcpy (&sch->schib.scsw, &irb->scsw, sizeof (irb->scsw));
580 if (sch->driver && sch->driver->irq)
581 sch->driver->irq(sch);
586 spin_unlock(sch->lock);
611 void cio_tsch(struct subchannel *sch)
618 if (tsch(sch->schid, irb) != 0)
621 memcpy(&sch->schib.scsw, &irb->scsw, sizeof(union scsw));
629 if (sch->driver && sch->driver->irq)
630 sch->driver->irq(sch);
676 struct subchannel *sch;
686 sch = css_alloc_subchannel(schid);
687 if (IS_ERR(sch))
688 return sch;
690 lockdep_set_class(sch->lock, &console_sch_key);
692 sch->config.isc = CONSOLE_ISC;
693 sch->config.intparm = (u32)(addr_t)sch;
694 ret = cio_commit_config(sch);
697 put_device(&sch->dev);
700 console_sch = sch;
701 return sch;
968 * @sch: subchannel on which to perform the start function
976 int cio_tm_start_key(struct subchannel *sch, struct tcw *tcw, u8 lpm, u8 key)
979 union orb *orb = &to_io_private(sch)->orb;
982 orb->tm.intparm = (u32) (addr_t) sch;
985 orb->tm.lpm = lpm ? lpm : sch->lpm;
987 cc = ssch(sch->schid, orb);
995 return cio_start_handle_notoper(sch, lpm);
1001 * @sch - subchannel on which to perform the interrogate function
1006 int cio_tm_intrg(struct subchannel *sch)
1010 if (!to_io_private(sch)->orb.tm.b)
1012 cc = xsch(sch->schid);