Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23d805b6 authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Heiko Carstens
Browse files

[S390] cio: introduce fcx enabled scsw format



Extend the scsw data structure to the format required by fcx. Also
provide helper functions for easier access to fields which are present
in both the traditional as well as the modified format.

Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent 4f2bd92e
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -995,14 +995,14 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
	now = get_clock();

	DBF_EVENT(DBF_ERR, "Interrupt: bus_id %s CS/DS %04x ip %08x",
		  cdev->dev.bus_id, ((irb->scsw.cstat<<8)|irb->scsw.dstat),
		  (unsigned int) intparm);
		  cdev->dev.bus_id, ((irb->scsw.cmd.cstat << 8) |
		  irb->scsw.cmd.dstat), (unsigned int) intparm);

	/* check for unsolicited interrupts */
	cqr = (struct dasd_ccw_req *) intparm;
	if (!cqr || ((irb->scsw.cc == 1) &&
		     (irb->scsw.fctl & SCSW_FCTL_START_FUNC) &&
		     (irb->scsw.stctl & SCSW_STCTL_STATUS_PEND)) ) {
	if (!cqr || ((irb->scsw.cmd.cc == 1) &&
		     (irb->scsw.cmd.fctl & SCSW_FCTL_START_FUNC) &&
		     (irb->scsw.cmd.stctl & SCSW_STCTL_STATUS_PEND))) {
		if (cqr && cqr->status == DASD_CQR_IN_IO)
			cqr->status = DASD_CQR_QUEUED;
		device = dasd_device_from_cdev_locked(cdev);
@@ -1025,7 +1025,7 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,

	/* Check for clear pending */
	if (cqr->status == DASD_CQR_CLEAR_PENDING &&
	    irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) {
	    irb->scsw.cmd.fctl & SCSW_FCTL_CLEAR_FUNC) {
		cqr->status = DASD_CQR_CLEARED;
		dasd_device_clear_timer(device);
		wake_up(&dasd_flush_wq);
@@ -1041,11 +1041,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
		return;
	}
	DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x for cqr %p",
		      ((irb->scsw.cstat << 8) | irb->scsw.dstat), cqr);
		      ((irb->scsw.cmd.cstat << 8) | irb->scsw.cmd.dstat), cqr);
	next = NULL;
	expires = 0;
	if (irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
	    irb->scsw.cstat == 0 && !irb->esw.esw0.erw.cons) {
	if (irb->scsw.cmd.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
	    irb->scsw.cmd.cstat == 0 && !irb->esw.esw0.erw.cons) {
		/* request was completed successfully */
		cqr->status = DASD_CQR_SUCCESS;
		cqr->stopclk = now;
+8 −7
Original line number Diff line number Diff line
@@ -1572,7 +1572,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)

	/* determine the address of the CCW to be restarted */
	/* Imprecise ending is not set -> addr from IRB-SCSW */
	cpa = default_erp->refers->irb.scsw.cpa;
	cpa = default_erp->refers->irb.scsw.cmd.cpa;

	if (cpa == 0) {

@@ -1725,7 +1725,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)

	/* determine the address of the CCW to be restarted */
	/* Imprecise ending is not set -> addr from IRB-SCSW */
	cpa = previous_erp->irb.scsw.cpa;
	cpa = previous_erp->irb.scsw.cmd.cpa;

	if (cpa == 0) {

@@ -2171,7 +2171,7 @@ dasd_3990_erp_control_check(struct dasd_ccw_req *erp)
{
	struct dasd_device *device = erp->startdev;

	if (erp->refers->irb.scsw.cstat & (SCHN_STAT_INTF_CTRL_CHK
	if (erp->refers->irb.scsw.cmd.cstat & (SCHN_STAT_INTF_CTRL_CHK
					   | SCHN_STAT_CHN_CTRL_CHK)) {
		DEV_MESSAGE(KERN_DEBUG, device, "%s",
			    "channel or interface control check");
@@ -2352,9 +2352,9 @@ dasd_3990_erp_error_match(struct dasd_ccw_req *cqr1, struct dasd_ccw_req *cqr2)

	if ((cqr1->irb.esw.esw0.erw.cons == 0) &&
	    (cqr2->irb.esw.esw0.erw.cons == 0))	{
		if ((cqr1->irb.scsw.cstat & (SCHN_STAT_INTF_CTRL_CHK |
		if ((cqr1->irb.scsw.cmd.cstat & (SCHN_STAT_INTF_CTRL_CHK |
					     SCHN_STAT_CHN_CTRL_CHK)) ==
		    (cqr2->irb.scsw.cstat & (SCHN_STAT_INTF_CTRL_CHK |
		    (cqr2->irb.scsw.cmd.cstat & (SCHN_STAT_INTF_CTRL_CHK |
					     SCHN_STAT_CHN_CTRL_CHK)))
			return 1; /* match with ifcc*/
	}
@@ -2622,8 +2622,9 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
	}

	/* double-check if current erp/cqr was successfull */
	if ((cqr->irb.scsw.cstat == 0x00) &&
	    (cqr->irb.scsw.dstat == (DEV_STAT_CHN_END|DEV_STAT_DEV_END))) {
	if ((cqr->irb.scsw.cmd.cstat == 0x00) &&
	    (cqr->irb.scsw.cmd.dstat ==
	     (DEV_STAT_CHN_END | DEV_STAT_DEV_END))) {

		DEV_MESSAGE(KERN_DEBUG, device,
			    "ERP called for successful request %p"
+7 −5
Original line number Diff line number Diff line
@@ -1404,13 +1404,14 @@ static void dasd_eckd_handle_unsolicited_interrupt(struct dasd_device *device,

	/* first of all check for state change pending interrupt */
	mask = DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP;
	if ((irb->scsw.dstat & mask) == mask) {
	if ((irb->scsw.cmd.dstat & mask) == mask) {
		dasd_generic_handle_state_change(device);
		return;
	}

	/* summary unit check */
	if ((irb->scsw.dstat & DEV_STAT_UNIT_CHECK) && irb->ecw[7] == 0x0D) {
	if ((irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) &&
	    (irb->ecw[7] == 0x0D)) {
		dasd_alias_handle_summary_unit_check(device, irb);
		return;
	}
@@ -2068,11 +2069,11 @@ static void dasd_eckd_dump_sense(struct dasd_device *device,
		      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);
		       irb->scsw.cmd.cstat, irb->scsw.cmd.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);
		       (void *) (addr_t) irb->scsw.cmd.cpa);
	if (irb->esw.esw0.erw.cons) {
		for (sl = 0; sl < 4; sl++) {
			len += sprintf(page + len, KERN_ERR PRINTK_HEADER
@@ -2122,7 +2123,8 @@ static void dasd_eckd_dump_sense(struct dasd_device *device,
		/* scsw->cda is either valid or zero  */
		len = 0;
		from = ++to;
		fail = (struct ccw1 *)(addr_t) irb->scsw.cpa; /* failing CCW */
		fail = (struct ccw1 *)(addr_t)
				irb->scsw.cmd.cpa; /* failing CCW */
		if (from <  fail - 2) {
			from = fail - 2;     /* there is a gap - print header */
			len += sprintf(page, KERN_ERR PRINTK_HEADER "......\n");
+6 −6
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device,

	/* first of all check for state change pending interrupt */
	mask = DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP;
	if ((irb->scsw.dstat & mask) == mask) {
	if ((irb->scsw.cmd.dstat & mask) == mask) {
		dasd_generic_handle_state_change(device);
		return;
	}
@@ -449,11 +449,11 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
		      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);
		       irb->scsw.cmd.cstat, irb->scsw.cmd.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);
		       (void *) (addr_t) irb->scsw.cmd.cpa);
	if (irb->esw.esw0.erw.cons) {
		for (sl = 0; sl < 4; sl++) {
			len += sprintf(page + len, KERN_ERR PRINTK_HEADER
@@ -498,11 +498,11 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,

	/* print failing CCW area */
	len = 0;
	if (act <  ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2) {
		act = ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2;
	if (act <  ((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa) - 2) {
		act = ((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa) - 2;
		len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
	}
	end = min((struct ccw1 *)(addr_t) irb->scsw.cpa + 2, last);
	end = min((struct ccw1 *)(addr_t) irb->scsw.cmd.cpa + 2, last);
	while (act <= end) {
		len += sprintf(page + len, KERN_ERR PRINTK_HEADER
			       " CCW %p: %08X %08X DAT:",
+3 −3
Original line number Diff line number Diff line
@@ -385,8 +385,8 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)

	raw = cdev->dev.driver_data;
	req = (struct raw3215_req *) intparm;
	cstat = irb->scsw.cstat;
	dstat = irb->scsw.dstat;
	cstat = irb->scsw.cmd.cstat;
	dstat = irb->scsw.cmd.dstat;
	if (cstat != 0) {
		raw->message = KERN_WARNING
			"Got nonzero channel status in raw3215_irq "
@@ -415,7 +415,7 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
			return;		     /* That shouldn't happen ... */
		if (req->type == RAW3215_READ) {
			/* store residual count, then wait for device end */
			req->residual = irb->scsw.count;
			req->residual = irb->scsw.cmd.count;
		}
		if (dstat == 0x08)
			break;
Loading