Deleted Added
full compact
isp_sbus.c (167992) isp_sbus.c (168240)
1/*-
2 * Copyright (c) 1997-2006 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * SUCH DAMAGE.
25 */
26/*
27 * SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
28 * FreeBSD Version.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2006 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * SUCH DAMAGE.
25 */
26/*
27 * SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
28 * FreeBSD Version.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 167992 2007-03-28 16:34:11Z mjacob $");
32__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 168240 2007-04-02 01:04:20Z mjacob $");
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#if __FreeBSD_version >= 700000
37#include <sys/linker.h>
38#include <sys/firmware.h>
39#endif
40#include <sys/bus.h>

--- 578 unchanged lines hidden (view full) ---

619 isp_prt(mp->isp, ISP_LOGERR, "bad segment count (%d)", nseg);
620 mp->error = EFAULT;
621 return;
622 }
623 csio = mp->cmd_token;
624 isp = mp->isp;
625 rq = mp->rq;
626 sbs = (struct isp_sbussoftc *)mp->isp;
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#if __FreeBSD_version >= 700000
37#include <sys/linker.h>
38#include <sys/firmware.h>
39#endif
40#include <sys/bus.h>

--- 578 unchanged lines hidden (view full) ---

619 isp_prt(mp->isp, ISP_LOGERR, "bad segment count (%d)", nseg);
620 mp->error = EFAULT;
621 return;
622 }
623 csio = mp->cmd_token;
624 isp = mp->isp;
625 rq = mp->rq;
626 sbs = (struct isp_sbussoftc *)mp->isp;
627 dp = &sbs->dmaps[isp_handle_index(rq->req_handle)];
627 dp = &sbs->dmaps[isp_handle_index(rq->req_handle & ISP_HANDLE_MASK)];
628 nxti = *mp->nxtip;
629
630 if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
631 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_PREREAD);
632 } else {
633 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_PREWRITE);
634 }
635

--- 94 unchanged lines hidden (view full) ---

730 mp->rq = rq;
731 mp->nxtip = nxtip;
732 mp->optr = optr;
733 mp->error = 0;
734
735 if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
736 if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) {
737 int error, s;
628 nxti = *mp->nxtip;
629
630 if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
631 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_PREREAD);
632 } else {
633 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_PREWRITE);
634 }
635

--- 94 unchanged lines hidden (view full) ---

730 mp->rq = rq;
731 mp->nxtip = nxtip;
732 mp->optr = optr;
733 mp->error = 0;
734
735 if ((csio->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
736 if ((csio->ccb_h.flags & CAM_DATA_PHYS) == 0) {
737 int error, s;
738 dp = &sbs->dmaps[isp_handle_index(rq->req_handle)];
738 dp = &sbs->dmaps[isp_handle_index(
739 rq->req_handle & ISP_HANDLE_MASK)];
739 s = splsoftvm();
740 error = bus_dmamap_load(sbs->dmat, *dp,
741 csio->data_ptr, csio->dxfer_len, eptr, mp, 0);
742 if (error == EINPROGRESS) {
743 bus_dmamap_unload(sbs->dmat, *dp);
744 mp->error = EINVAL;
745 isp_prt(isp, ISP_LOGERR,
746 "deferred dma allocation not supported");

--- 57 unchanged lines hidden (view full) ---

804 }
805 return (CMD_QUEUED);
806}
807
808static void
809isp_sbus_dmateardown(ispsoftc_t *isp, XS_T *xs, uint32_t handle)
810{
811 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp;
740 s = splsoftvm();
741 error = bus_dmamap_load(sbs->dmat, *dp,
742 csio->data_ptr, csio->dxfer_len, eptr, mp, 0);
743 if (error == EINPROGRESS) {
744 bus_dmamap_unload(sbs->dmat, *dp);
745 mp->error = EINVAL;
746 isp_prt(isp, ISP_LOGERR,
747 "deferred dma allocation not supported");

--- 57 unchanged lines hidden (view full) ---

805 }
806 return (CMD_QUEUED);
807}
808
809static void
810isp_sbus_dmateardown(ispsoftc_t *isp, XS_T *xs, uint32_t handle)
811{
812 struct isp_sbussoftc *sbs = (struct isp_sbussoftc *)isp;
812 bus_dmamap_t *dp = &sbs->dmaps[isp_handle_index(handle)];
813 bus_dmamap_t *dp;
814 dp = &sbs->dmaps[isp_handle_index(handle & ISP_HANDLE_MASK)];
813 if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
814 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_POSTREAD);
815 } else {
816 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_POSTWRITE);
817 }
818 bus_dmamap_unload(sbs->dmat, *dp);
819}
820

--- 42 unchanged lines hidden ---
815 if ((xs->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
816 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_POSTREAD);
817 } else {
818 bus_dmamap_sync(sbs->dmat, *dp, BUS_DMASYNC_POSTWRITE);
819 }
820 bus_dmamap_unload(sbs->dmat, *dp);
821}
822

--- 42 unchanged lines hidden ---