FreeBSD/sys/cam/ctl/ctl_ha.c
/*
 * Issue a DMA request for a single buffer.
 */
Issue a DMA request for a single buffer.
Issue a DMA request for a single buffer .
ctl_ha_status
ctl_dt_single(struct ctl_ha_dt_req *req)
{
	struct ha_softc *softc = &ha_softc;
	struct ha_dt_msg_wire wire_dt;
	ctl_ha_status status;
	wire_dt.command = req->command;
	wire_dt.size = req->size;
	wire_dt.local = req->local;
	wire_dt.remote = req->remote;
	if (req->command == CTL_HA_DT_CMD_READ && req->callback != NULL) {
		mtx_lock(&softc->ha_lock);
		TAILQ_INSERT_TAIL(&softc->ha_dts, req, links);
		mtx_unlock(&softc->ha_lock);
		ctl_ha_msg_send(CTL_HA_CHAN_DATA, &wire_dt, sizeof(wire_dt),
		    M_WAITOK);
		return (CTL_HA_STATUS_WAIT);
	}
	if (req->command == CTL_HA_DT_CMD_READ) {
		status = ctl_ha_msg_send(CTL_HA_CHAN_DATA, &wire_dt,
		    sizeof(wire_dt), M_WAITOK);
	} else {
		status = ctl_ha_msg_send2(CTL_HA_CHAN_DATA, &wire_dt,
		    sizeof(wire_dt), req->local, req->size, M_WAITOK);
	}
	return (status);
}
ctl_ha_status ctl_dt_single ( struct ctl_ha_dt_req * req ) { struct ha_softc * softc = & ha_softc ; struct ha_dt_msg_wire wire_dt ; ctl_ha_status status ; wire_dt . command = req -> command ; wire_dt . size = req -> size ; wire_dt . local = req -> local ; wire_dt . remote = req -> remote ; if ( req -> command == CTL_HA_DT_CMD_READ && req -> callback != NULL ) { mtx_lock ( & softc -> ha_lock ) ; TAILQ_INSERT_TAIL ( & softc -> ha_dts , req , links ) ; mtx_unlock ( & softc -> ha_lock ) ; ctl_ha_msg_send ( CTL_HA_CHAN_DATA , & wire_dt , sizeof ( wire_dt ) , M_WAITOK ) ; return ( CTL_HA_STATUS_WAIT ) ; } if ( req -> command == CTL_HA_DT_CMD_READ ) { status = ctl_ha_msg_send ( CTL_HA_CHAN_DATA , & wire_dt , sizeof ( wire_dt ) , M_WAITOK ) ; } else { status = ctl_ha_msg_send2 ( CTL_HA_CHAN_DATA , & wire_dt , sizeof ( wire_dt ) , req -> local , req -> size , M_WAITOK ) ; } return ( status ) ; }
Issue a DMA request for a single buffer.
Issue a DMA request for a single buffer .