+ len = sprintf(page, KERN_ERR PRINTK_HEADER
+ " I/O status report for device %s:\n",
+ device->cdev->dev.bus_id);
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " in req: %p CS: 0x%02X DS: 0x%02X\n", req,
+ irb->scsw.cstat, irb->scsw.dstat);
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " device %s: Failing CCW: %p\n",
+ device->cdev->dev.bus_id,
+ (void *) (addr_t) irb->scsw.cpa);
+ if (irb->esw.esw0.erw.cons) {
+ for (sl = 0; sl < 4; sl++) {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " Sense(hex) %2d-%2d:",
+ (8 * sl), ((8 * sl) + 7));
+
+ for (sct = 0; sct < 8; sct++) {
+ len += sprintf(page + len, " %02x",
+ irb->ecw[8 * sl + sct]);
+ }
+ len += sprintf(page + len, "\n");
+ }
+ } else {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " SORRY - NO VALID SENSE AVAILABLE\n");
+ }
+ MESSAGE_LOG(KERN_ERR, "%s",
+ page + sizeof(KERN_ERR PRINTK_HEADER));
+
+ /* dump the Channel Program */
+ /* print first CCWs (maximum 8) */
+ act = req->cpaddr;
+ for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
+ end = min(act + 8, last);
+ len = sprintf(page, KERN_ERR PRINTK_HEADER
+ " Related CP in req: %p\n", req);
+ while (act <= end) {
+ len += sprintf(page + len, KERN_ERR PRINTK_HEADER
+ " CCW %p: %08X %08X DAT:",
+ act, ((int *) act)[0], ((int *) act)[1]);
+ for (count = 0; count < 32 && count < act->count;
+ count += sizeof(int))
+ len += sprintf(page + len, " %08X",
+ ((int *) (addr_t) act->cda)
+ [(count>>2)]);
+ len += sprintf(page + len, "\n");
+ act++;
+ }
+ MESSAGE_LOG(KERN_ERR, "%s",
+ page + sizeof(KERN_ERR PRINTK_HEADER));