Lines Matching defs:sch

60 static int eadm_subchannel_start(struct subchannel *sch, struct aob *aob)
62 union orb *orb = &get_eadm_private(sch)->orb;
67 orb->eadm.intparm = (u32)virt_to_phys(sch);
71 EADM_LOG_HEX(6, &sch->schid, sizeof(sch->schid));
73 cc = ssch(sch->schid, orb);
76 sch->schib.scsw.eadm.actl |= SCSW_ACTL_START_PEND;
87 static int eadm_subchannel_clear(struct subchannel *sch)
91 cc = csch(sch->schid);
95 sch->schib.scsw.eadm.actl |= SCSW_ACTL_CLEAR_PEND;
102 struct subchannel *sch = private->sch;
104 spin_lock_irq(&sch->lock);
106 EADM_LOG_HEX(1, &sch->schid, sizeof(sch->schid));
107 if (eadm_subchannel_clear(sch))
109 spin_unlock_irq(&sch->lock);
112 static void eadm_subchannel_set_timeout(struct subchannel *sch, int expires)
114 struct eadm_private *private = get_eadm_private(sch);
122 static void eadm_subchannel_irq(struct subchannel *sch)
124 struct eadm_private *private = get_eadm_private(sch);
125 struct eadm_scsw *scsw = &sch->schib.scsw.eadm;
141 eadm_subchannel_set_timeout(sch, 0);
147 css_sched_sch_todo(sch, SCH_TODO_EVAL);
160 struct subchannel *sch;
165 sch = private->sch;
166 spin_lock(&sch->lock);
170 spin_unlock(&sch->lock);
173 return sch;
175 spin_unlock(&sch->lock);
185 struct subchannel *sch;
189 sch = eadm_get_idle_sch();
190 if (!sch)
193 spin_lock_irqsave(&sch->lock, flags);
194 eadm_subchannel_set_timeout(sch, EADM_TIMEOUT);
195 ret = eadm_subchannel_start(sch, aob);
200 eadm_subchannel_set_timeout(sch, 0);
201 private = get_eadm_private(sch);
203 css_sched_sch_todo(sch, SCH_TODO_EVAL);
206 spin_unlock_irqrestore(&sch->lock, flags);
212 static int eadm_subchannel_probe(struct subchannel *sch)
224 spin_lock_irq(&sch->lock);
225 set_eadm_private(sch, private);
227 private->sch = sch;
228 sch->isc = EADM_SCH_ISC;
229 ret = cio_enable_subchannel(sch, (u32)virt_to_phys(sch));
231 set_eadm_private(sch, NULL);
232 spin_unlock_irq(&sch->lock);
236 spin_unlock_irq(&sch->lock);
245 static void eadm_quiesce(struct subchannel *sch)
247 struct eadm_private *private = get_eadm_private(sch);
251 spin_lock_irq(&sch->lock);
255 if (eadm_subchannel_clear(sch))
259 spin_unlock_irq(&sch->lock);
263 spin_lock_irq(&sch->lock);
267 eadm_subchannel_set_timeout(sch, 0);
269 ret = cio_disable_subchannel(sch);
272 spin_unlock_irq(&sch->lock);
275 static void eadm_subchannel_remove(struct subchannel *sch)
277 struct eadm_private *private = get_eadm_private(sch);
283 eadm_quiesce(sch);
285 spin_lock_irq(&sch->lock);
286 set_eadm_private(sch, NULL);
287 spin_unlock_irq(&sch->lock);
292 static void eadm_subchannel_shutdown(struct subchannel *sch)
294 eadm_quiesce(sch);
299 * @sch: subchannel
307 static int eadm_subchannel_sch_event(struct subchannel *sch, int process)
312 spin_lock_irqsave(&sch->lock, flags);
313 if (!device_is_registered(&sch->dev))
316 if (work_pending(&sch->todo_work))
319 if (cio_update_schib(sch)) {
320 css_sched_sch_todo(sch, SCH_TODO_UNREG);
323 private = get_eadm_private(sch);
328 spin_unlock_irqrestore(&sch->lock, flags);