dp = dvma_kvtopa((long)iorq->dbuf, BUS_VME32); iopb->daddr = dp = (iorq->dbuf == NULL) ? 0 : dp;
iopb->daddr = dp = (iorq->dbuf == NULL) ? 0 : dvma_kvtopa((long)iorq->dbuf, BUS_VME32);
xdc_rqtopb(iorq, iopb, cmd, subfun)	struct xd_iorq *iorq;	struct xd_iopb *iopb;	int     cmd, subfun;{	u_long  block, dp;	/* standard stuff */	iopb->errs = iopb->done = 0;	iopb->comm = cmd;	iopb->errno = iopb->status = 0;	iopb->subfun = subfun;	if (iorq->xd)		iopb->unit = iorq->xd->xd_drive;	else		iopb->unit = 0;	/* check for alternate IOPB format */	if (cmd == XDCMD_WRP) {		switch (subfun) {		case XDFUN_CTL:{			struct xd_iopb_ctrl *ctrl =				(struct xd_iopb_ctrl *) iopb;			iopb->lll = 0;			iopb->intl = (XD_STATE(iorq->mode) == XD_SUB_POLL)					? 0					: iorq->xdc->ipl;			ctrl->param_a = XDPA_TMOD | XDPA_DACF;			ctrl->param_b = XDPB_ROR | XDPB_TDT_3_2USEC;			ctrl->param_c = XDPC_OVS | XDPC_COP | XDPC_ASR |					XDPC_RBC | XDPC_ECC2;			ctrl->throttle = XDC_THROTTLE;#ifdef sparc			if (cputyp == CPU_SUN4 && cpumod == SUN4_300)				ctrl->delay = XDC_DELAY_4_300;			else				ctrl->delay = XDC_DELAY_SPARC;#endif#ifdef sun3			ctrl->delay = XDC_DELAY_SUN3;#endif			break;			}		case XDFUN_DRV:{			struct xd_iopb_drive *drv =				(struct xd_iopb_drive *)iopb;			/* we assume that the disk label has the right			 * info */			if (XD_STATE(iorq->mode) == XD_SUB_POLL)				drv->dparam_ipl = (XDC_DPARAM << 3);			else				drv->dparam_ipl = (XDC_DPARAM << 3) |						  iorq->xdc->ipl;			drv->maxsect = iorq->xd->nsect - 1;			drv->maxsector = drv->maxsect;			/* note: maxsector != maxsect only if you are			 * doing cyl sparing */			drv->headoff = 0;			drv->maxcyl = iorq->xd->pcyl - 1;			drv->maxhead = iorq->xd->nhead - 1;			break;			}		case XDFUN_FMT:{			struct xd_iopb_format *form =					(struct xd_iopb_format *) iopb;			if (XD_STATE(iorq->mode) == XD_SUB_POLL)				form->interleave_ipl = (XDC_INTERLEAVE << 3);			else				form->interleave_ipl = (XDC_INTERLEAVE << 3) |						       iorq->xdc->ipl;			form->field1 = XDFM_FIELD1;			form->field2 = XDFM_FIELD2;			form->field3 = XDFM_FIELD3;			form->field4 = XDFM_FIELD4;			form->bytespersec = XDFM_BPS;			form->field6 = XDFM_FIELD6;			form->field7 = XDFM_FIELD7;			break;			}		}	} else {		/* normal IOPB case (harmless to RDP command) */		iopb->lll = 0;		iopb->intl = (XD_STATE(iorq->mode) == XD_SUB_POLL)				? 0				: iorq->xdc->ipl;		iopb->sectcnt = iorq->sectcnt;		block = iorq->blockno;		if (iorq->xd == NULL || block == 0) {			iopb->sectno = iopb->headno = iopb->cylno = 0;		} else {			iopb->sectno = block % iorq->xd->nsect;			block = block / iorq->xd->nsect;			iopb->headno = block % iorq->xd->nhead;			block = block / iorq->xd->nhead;			iopb->cylno = block;		}		dp = dvma_kvtopa((long)iorq->dbuf, BUS_VME32);		iopb->daddr = dp = (iorq->dbuf == NULL) ? 0 : dp;		iopb->addrmod = XDC_ADDRMOD;	}}