Lines Matching refs:irb
28 ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb) in ccw_device_msg_control_check() argument
33 if (!scsw_is_valid_cstat(&irb->scsw) || in ccw_device_msg_control_check()
34 !(scsw_cstat(&irb->scsw) & (SCHN_STAT_CHN_DATA_CHK | in ccw_device_msg_control_check()
43 scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw)); in ccw_device_msg_control_check()
46 CIO_HEX_EVENT(0, irb, sizeof(struct irb)); in ccw_device_msg_control_check()
75 ccw_device_accumulate_ecw(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_ecw() argument
82 cdev->private->dma_area->irb.scsw.cmd.ectl = 0; in ccw_device_accumulate_ecw()
83 if ((irb->scsw.cmd.stctl & SCSW_STCTL_ALERT_STATUS) && in ccw_device_accumulate_ecw()
84 !(irb->scsw.cmd.stctl & SCSW_STCTL_INTER_STATUS)) in ccw_device_accumulate_ecw()
85 cdev->private->dma_area->irb.scsw.cmd.ectl = irb->scsw.cmd.ectl; in ccw_device_accumulate_ecw()
87 if (!cdev->private->dma_area->irb.scsw.cmd.ectl) in ccw_device_accumulate_ecw()
90 memcpy(&cdev->private->dma_area->irb.ecw, irb->ecw, sizeof(irb->ecw)); in ccw_device_accumulate_ecw()
97 ccw_device_accumulate_esw_valid(struct irb *irb) in ccw_device_accumulate_esw_valid() argument
99 if (!irb->scsw.cmd.eswf && in ccw_device_accumulate_esw_valid()
100 (irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND)) in ccw_device_accumulate_esw_valid()
102 if (irb->scsw.cmd.stctl == in ccw_device_accumulate_esw_valid()
104 !(irb->scsw.cmd.actl & SCSW_ACTL_SUSPENDED)) in ccw_device_accumulate_esw_valid()
113 ccw_device_accumulate_esw(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_esw() argument
115 struct irb *cdev_irb; in ccw_device_accumulate_esw()
118 if (!ccw_device_accumulate_esw_valid(irb)) in ccw_device_accumulate_esw()
121 cdev_irb = &cdev->private->dma_area->irb; in ccw_device_accumulate_esw()
124 cdev_irb->esw.esw1.lpum = irb->esw.esw1.lpum; in ccw_device_accumulate_esw()
127 if (irb->scsw.cmd.eswf) { in ccw_device_accumulate_esw()
129 sublog = &irb->esw.esw0.sublog; in ccw_device_accumulate_esw()
136 if (irb->scsw.cmd.cstat & (SCHN_STAT_CHN_DATA_CHK | in ccw_device_accumulate_esw()
157 if (irb->scsw.cmd.cstat & SCHN_STAT_INTF_CTRL_CHK) in ccw_device_accumulate_esw()
158 cdev_irb->esw.esw0.erw.cpt = irb->esw.esw0.erw.cpt; in ccw_device_accumulate_esw()
160 cdev_irb->esw.esw0.erw.fsavf = irb->esw.esw0.erw.fsavf; in ccw_device_accumulate_esw()
163 memcpy(cdev_irb->esw.esw0.faddr, irb->esw.esw0.faddr, in ccw_device_accumulate_esw()
164 sizeof (irb->esw.esw0.faddr)); in ccw_device_accumulate_esw()
166 cdev_irb->esw.esw0.erw.fsaf = irb->esw.esw0.erw.fsaf; in ccw_device_accumulate_esw()
169 cdev_irb->esw.esw0.erw.scavf = irb->esw.esw0.erw.scavf; in ccw_device_accumulate_esw()
170 if (irb->esw.esw0.erw.scavf) in ccw_device_accumulate_esw()
172 cdev_irb->esw.esw0.saddr = irb->esw.esw0.saddr; in ccw_device_accumulate_esw()
178 cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth; in ccw_device_accumulate_esw()
180 cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf; in ccw_device_accumulate_esw()
181 if (irb->esw.esw0.erw.pvrf) in ccw_device_accumulate_esw()
184 cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons; in ccw_device_accumulate_esw()
185 if (irb->esw.esw0.erw.cons) in ccw_device_accumulate_esw()
186 cdev_irb->esw.esw0.erw.scnt = irb->esw.esw0.erw.scnt; in ccw_device_accumulate_esw()
193 ccw_device_accumulate_irb(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_irb() argument
195 struct irb *cdev_irb; in ccw_device_accumulate_irb()
202 if (!(scsw_stctl(&irb->scsw) & SCSW_STCTL_STATUS_PEND)) in ccw_device_accumulate_irb()
206 ccw_device_msg_control_check(cdev, irb); in ccw_device_accumulate_irb()
209 if (scsw_is_valid_pno(&irb->scsw) && scsw_pno(&irb->scsw)) in ccw_device_accumulate_irb()
212 if (scsw_is_tm(&irb->scsw)) { in ccw_device_accumulate_irb()
213 memcpy(&cdev->private->dma_area->irb, irb, sizeof(struct irb)); in ccw_device_accumulate_irb()
219 if (!scsw_is_solicited(&irb->scsw)) in ccw_device_accumulate_irb()
222 cdev_irb = &cdev->private->dma_area->irb; in ccw_device_accumulate_irb()
229 if (irb->scsw.cmd.fctl & SCSW_FCTL_CLEAR_FUNC) in ccw_device_accumulate_irb()
230 memset(&cdev->private->dma_area->irb, 0, sizeof(struct irb)); in ccw_device_accumulate_irb()
233 if (irb->scsw.cmd.fctl & SCSW_FCTL_START_FUNC) { in ccw_device_accumulate_irb()
235 cdev_irb->scsw.cmd.key = irb->scsw.cmd.key; in ccw_device_accumulate_irb()
237 cdev_irb->scsw.cmd.sctl = irb->scsw.cmd.sctl; in ccw_device_accumulate_irb()
239 cdev_irb->scsw.cmd.cc |= irb->scsw.cmd.cc; in ccw_device_accumulate_irb()
241 cdev_irb->scsw.cmd.fmt = irb->scsw.cmd.fmt; in ccw_device_accumulate_irb()
243 cdev_irb->scsw.cmd.pfch = irb->scsw.cmd.pfch; in ccw_device_accumulate_irb()
245 cdev_irb->scsw.cmd.isic = irb->scsw.cmd.isic; in ccw_device_accumulate_irb()
247 cdev_irb->scsw.cmd.alcc = irb->scsw.cmd.alcc; in ccw_device_accumulate_irb()
249 cdev_irb->scsw.cmd.ssi = irb->scsw.cmd.ssi; in ccw_device_accumulate_irb()
253 ccw_device_accumulate_ecw(cdev, irb); in ccw_device_accumulate_irb()
256 cdev_irb->scsw.cmd.fctl |= irb->scsw.cmd.fctl; in ccw_device_accumulate_irb()
258 cdev_irb->scsw.cmd.actl = irb->scsw.cmd.actl; in ccw_device_accumulate_irb()
260 cdev_irb->scsw.cmd.stctl |= irb->scsw.cmd.stctl; in ccw_device_accumulate_irb()
265 if ((irb->scsw.cmd.stctl & SCSW_STCTL_PRIM_STATUS) || in ccw_device_accumulate_irb()
266 ((irb->scsw.cmd.stctl == in ccw_device_accumulate_irb()
268 (irb->scsw.cmd.actl & SCSW_ACTL_DEVACT) && in ccw_device_accumulate_irb()
269 (irb->scsw.cmd.actl & SCSW_ACTL_SCHACT)) || in ccw_device_accumulate_irb()
270 (irb->scsw.cmd.actl & SCSW_ACTL_SUSPENDED)) in ccw_device_accumulate_irb()
271 cdev_irb->scsw.cmd.cpa = irb->scsw.cmd.cpa; in ccw_device_accumulate_irb()
275 if (irb->scsw.cmd.stctl & in ccw_device_accumulate_irb()
278 cdev_irb->scsw.cmd.dstat |= irb->scsw.cmd.dstat; in ccw_device_accumulate_irb()
280 cdev_irb->scsw.cmd.cstat |= irb->scsw.cmd.cstat; in ccw_device_accumulate_irb()
282 if ((irb->scsw.cmd.stctl & SCSW_STCTL_PRIM_STATUS) && in ccw_device_accumulate_irb()
283 (irb->scsw.cmd.cstat & ~(SCHN_STAT_PCI | SCHN_STAT_INCORR_LEN)) in ccw_device_accumulate_irb()
285 cdev_irb->scsw.cmd.count = irb->scsw.cmd.count; in ccw_device_accumulate_irb()
288 ccw_device_accumulate_esw(cdev, irb); in ccw_device_accumulate_irb()
311 ccw_device_do_sense(struct ccw_device *cdev, struct irb *irb) in ccw_device_do_sense() argument
320 if (scsw_actl(&irb->scsw) & (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) in ccw_device_do_sense()
334 sense_ccw->cda = (__u32) __pa(cdev->private->dma_area->irb.ecw); in ccw_device_do_sense()
348 ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_basic_sense() argument
355 if (!(scsw_stctl(&irb->scsw) & SCSW_STCTL_STATUS_PEND)) in ccw_device_accumulate_basic_sense()
359 ccw_device_msg_control_check(cdev, irb); in ccw_device_accumulate_basic_sense()
362 if (scsw_is_valid_pno(&irb->scsw) && scsw_pno(&irb->scsw)) in ccw_device_accumulate_basic_sense()
365 if (!(irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) && in ccw_device_accumulate_basic_sense()
366 (irb->scsw.cmd.dstat & DEV_STAT_CHN_END)) { in ccw_device_accumulate_basic_sense()
367 cdev->private->dma_area->irb.esw.esw0.erw.cons = 1; in ccw_device_accumulate_basic_sense()
371 if (ccw_device_accumulate_esw_valid(irb) && in ccw_device_accumulate_basic_sense()
372 irb->esw.esw0.erw.pvrf) in ccw_device_accumulate_basic_sense()
381 ccw_device_accumulate_and_sense(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_and_sense() argument
383 ccw_device_accumulate_irb(cdev, irb); in ccw_device_accumulate_and_sense()
384 if ((irb->scsw.cmd.actl & (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) != 0) in ccw_device_accumulate_and_sense()
388 !(irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK)) { in ccw_device_accumulate_and_sense()
389 cdev->private->dma_area->irb.esw.esw0.erw.cons = 1; in ccw_device_accumulate_and_sense()
394 ccw_device_do_sense(cdev, irb); in ccw_device_accumulate_and_sense()