Lines Matching refs:irb
29 ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb) in ccw_device_msg_control_check() argument
34 if (!scsw_is_valid_cstat(&irb->scsw) || in ccw_device_msg_control_check()
35 !(scsw_cstat(&irb->scsw) & (SCHN_STAT_CHN_DATA_CHK | in ccw_device_msg_control_check()
44 scsw_dstat(&irb->scsw), scsw_cstat(&irb->scsw)); in ccw_device_msg_control_check()
47 CIO_HEX_EVENT(0, irb, sizeof(struct irb)); in ccw_device_msg_control_check()
76 ccw_device_accumulate_ecw(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_ecw() argument
83 cdev->private->dma_area->irb.scsw.cmd.ectl = 0; in ccw_device_accumulate_ecw()
84 if ((irb->scsw.cmd.stctl & SCSW_STCTL_ALERT_STATUS) && in ccw_device_accumulate_ecw()
85 !(irb->scsw.cmd.stctl & SCSW_STCTL_INTER_STATUS)) in ccw_device_accumulate_ecw()
86 cdev->private->dma_area->irb.scsw.cmd.ectl = irb->scsw.cmd.ectl; in ccw_device_accumulate_ecw()
88 if (!cdev->private->dma_area->irb.scsw.cmd.ectl) in ccw_device_accumulate_ecw()
91 memcpy(&cdev->private->dma_area->irb.ecw, irb->ecw, sizeof(irb->ecw)); in ccw_device_accumulate_ecw()
98 ccw_device_accumulate_esw_valid(struct irb *irb) in ccw_device_accumulate_esw_valid() argument
100 if (!irb->scsw.cmd.eswf && in ccw_device_accumulate_esw_valid()
101 (irb->scsw.cmd.stctl == SCSW_STCTL_STATUS_PEND)) in ccw_device_accumulate_esw_valid()
103 if (irb->scsw.cmd.stctl == in ccw_device_accumulate_esw_valid()
105 !(irb->scsw.cmd.actl & SCSW_ACTL_SUSPENDED)) in ccw_device_accumulate_esw_valid()
114 ccw_device_accumulate_esw(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_esw() argument
116 struct irb *cdev_irb; in ccw_device_accumulate_esw()
119 if (!ccw_device_accumulate_esw_valid(irb)) in ccw_device_accumulate_esw()
122 cdev_irb = &cdev->private->dma_area->irb; in ccw_device_accumulate_esw()
125 cdev_irb->esw.esw1.lpum = irb->esw.esw1.lpum; in ccw_device_accumulate_esw()
128 if (irb->scsw.cmd.eswf) { in ccw_device_accumulate_esw()
130 sublog = &irb->esw.esw0.sublog; in ccw_device_accumulate_esw()
137 if (irb->scsw.cmd.cstat & (SCHN_STAT_CHN_DATA_CHK | in ccw_device_accumulate_esw()
158 if (irb->scsw.cmd.cstat & SCHN_STAT_INTF_CTRL_CHK) in ccw_device_accumulate_esw()
159 cdev_irb->esw.esw0.erw.cpt = irb->esw.esw0.erw.cpt; in ccw_device_accumulate_esw()
161 cdev_irb->esw.esw0.erw.fsavf = irb->esw.esw0.erw.fsavf; in ccw_device_accumulate_esw()
164 memcpy(cdev_irb->esw.esw0.faddr, irb->esw.esw0.faddr, in ccw_device_accumulate_esw()
165 sizeof (irb->esw.esw0.faddr)); in ccw_device_accumulate_esw()
167 cdev_irb->esw.esw0.erw.fsaf = irb->esw.esw0.erw.fsaf; in ccw_device_accumulate_esw()
170 cdev_irb->esw.esw0.erw.scavf = irb->esw.esw0.erw.scavf; in ccw_device_accumulate_esw()
171 if (irb->esw.esw0.erw.scavf) in ccw_device_accumulate_esw()
173 cdev_irb->esw.esw0.saddr = irb->esw.esw0.saddr; in ccw_device_accumulate_esw()
179 cdev_irb->esw.esw0.erw.auth = irb->esw.esw0.erw.auth; in ccw_device_accumulate_esw()
181 cdev_irb->esw.esw0.erw.pvrf = irb->esw.esw0.erw.pvrf; in ccw_device_accumulate_esw()
182 if (irb->esw.esw0.erw.pvrf) in ccw_device_accumulate_esw()
185 cdev_irb->esw.esw0.erw.cons = irb->esw.esw0.erw.cons; in ccw_device_accumulate_esw()
186 if (irb->esw.esw0.erw.cons) in ccw_device_accumulate_esw()
187 cdev_irb->esw.esw0.erw.scnt = irb->esw.esw0.erw.scnt; in ccw_device_accumulate_esw()
194 ccw_device_accumulate_irb(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_irb() argument
196 struct irb *cdev_irb; in ccw_device_accumulate_irb()
203 if (!(scsw_stctl(&irb->scsw) & SCSW_STCTL_STATUS_PEND)) in ccw_device_accumulate_irb()
207 ccw_device_msg_control_check(cdev, irb); in ccw_device_accumulate_irb()
210 if (scsw_is_valid_pno(&irb->scsw) && scsw_pno(&irb->scsw)) in ccw_device_accumulate_irb()
213 if (scsw_is_tm(&irb->scsw)) { in ccw_device_accumulate_irb()
214 memcpy(&cdev->private->dma_area->irb, irb, sizeof(struct irb)); in ccw_device_accumulate_irb()
220 if (!scsw_is_solicited(&irb->scsw)) in ccw_device_accumulate_irb()
223 cdev_irb = &cdev->private->dma_area->irb; in ccw_device_accumulate_irb()
230 if (irb->scsw.cmd.fctl & SCSW_FCTL_CLEAR_FUNC) in ccw_device_accumulate_irb()
231 memset(&cdev->private->dma_area->irb, 0, sizeof(struct irb)); in ccw_device_accumulate_irb()
234 if (irb->scsw.cmd.fctl & SCSW_FCTL_START_FUNC) { in ccw_device_accumulate_irb()
236 cdev_irb->scsw.cmd.key = irb->scsw.cmd.key; in ccw_device_accumulate_irb()
238 cdev_irb->scsw.cmd.sctl = irb->scsw.cmd.sctl; in ccw_device_accumulate_irb()
240 cdev_irb->scsw.cmd.cc |= irb->scsw.cmd.cc; in ccw_device_accumulate_irb()
242 cdev_irb->scsw.cmd.fmt = irb->scsw.cmd.fmt; in ccw_device_accumulate_irb()
244 cdev_irb->scsw.cmd.pfch = irb->scsw.cmd.pfch; in ccw_device_accumulate_irb()
246 cdev_irb->scsw.cmd.isic = irb->scsw.cmd.isic; in ccw_device_accumulate_irb()
248 cdev_irb->scsw.cmd.alcc = irb->scsw.cmd.alcc; in ccw_device_accumulate_irb()
250 cdev_irb->scsw.cmd.ssi = irb->scsw.cmd.ssi; in ccw_device_accumulate_irb()
254 ccw_device_accumulate_ecw(cdev, irb); in ccw_device_accumulate_irb()
257 cdev_irb->scsw.cmd.fctl |= irb->scsw.cmd.fctl; in ccw_device_accumulate_irb()
259 cdev_irb->scsw.cmd.actl = irb->scsw.cmd.actl; in ccw_device_accumulate_irb()
261 cdev_irb->scsw.cmd.stctl |= irb->scsw.cmd.stctl; in ccw_device_accumulate_irb()
266 if ((irb->scsw.cmd.stctl & SCSW_STCTL_PRIM_STATUS) || in ccw_device_accumulate_irb()
267 ((irb->scsw.cmd.stctl == in ccw_device_accumulate_irb()
269 (irb->scsw.cmd.actl & SCSW_ACTL_DEVACT) && in ccw_device_accumulate_irb()
270 (irb->scsw.cmd.actl & SCSW_ACTL_SCHACT)) || in ccw_device_accumulate_irb()
271 (irb->scsw.cmd.actl & SCSW_ACTL_SUSPENDED)) in ccw_device_accumulate_irb()
272 cdev_irb->scsw.cmd.cpa = irb->scsw.cmd.cpa; in ccw_device_accumulate_irb()
276 if (irb->scsw.cmd.stctl & in ccw_device_accumulate_irb()
279 cdev_irb->scsw.cmd.dstat |= irb->scsw.cmd.dstat; in ccw_device_accumulate_irb()
281 cdev_irb->scsw.cmd.cstat |= irb->scsw.cmd.cstat; in ccw_device_accumulate_irb()
283 if ((irb->scsw.cmd.stctl & SCSW_STCTL_PRIM_STATUS) && in ccw_device_accumulate_irb()
284 (irb->scsw.cmd.cstat & ~(SCHN_STAT_PCI | SCHN_STAT_INCORR_LEN)) in ccw_device_accumulate_irb()
286 cdev_irb->scsw.cmd.count = irb->scsw.cmd.count; in ccw_device_accumulate_irb()
289 ccw_device_accumulate_esw(cdev, irb); in ccw_device_accumulate_irb()
312 ccw_device_do_sense(struct ccw_device *cdev, struct irb *irb) in ccw_device_do_sense() argument
321 if (scsw_actl(&irb->scsw) & (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) in ccw_device_do_sense()
335 sense_ccw->cda = virt_to_dma32(cdev->private->dma_area->irb.ecw); in ccw_device_do_sense()
349 ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_basic_sense() argument
356 if (!(scsw_stctl(&irb->scsw) & SCSW_STCTL_STATUS_PEND)) in ccw_device_accumulate_basic_sense()
360 ccw_device_msg_control_check(cdev, irb); in ccw_device_accumulate_basic_sense()
363 if (scsw_is_valid_pno(&irb->scsw) && scsw_pno(&irb->scsw)) in ccw_device_accumulate_basic_sense()
366 if (!(irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) && in ccw_device_accumulate_basic_sense()
367 (irb->scsw.cmd.dstat & DEV_STAT_CHN_END)) { in ccw_device_accumulate_basic_sense()
368 cdev->private->dma_area->irb.esw.esw0.erw.cons = 1; in ccw_device_accumulate_basic_sense()
372 if (ccw_device_accumulate_esw_valid(irb) && in ccw_device_accumulate_basic_sense()
373 irb->esw.esw0.erw.pvrf) in ccw_device_accumulate_basic_sense()
382 ccw_device_accumulate_and_sense(struct ccw_device *cdev, struct irb *irb) in ccw_device_accumulate_and_sense() argument
384 ccw_device_accumulate_irb(cdev, irb); in ccw_device_accumulate_and_sense()
385 if ((irb->scsw.cmd.actl & (SCSW_ACTL_DEVACT | SCSW_ACTL_SCHACT)) != 0) in ccw_device_accumulate_and_sense()
389 !(irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK)) { in ccw_device_accumulate_and_sense()
390 cdev->private->dma_area->irb.esw.esw0.erw.cons = 1; in ccw_device_accumulate_and_sense()
395 ccw_device_do_sense(cdev, irb); in ccw_device_accumulate_and_sense()