summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/aic7xxx.c26
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c38
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.h74
3 files changed, 38 insertions, 100 deletions
diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c
index 7853327eea3..b6bce03ac1e 100644
--- a/sys/dev/ic/aic7xxx.c
+++ b/sys/dev/ic/aic7xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx.c,v 1.73 2006/07/30 14:21:14 krw Exp $ */
+/* $OpenBSD: aic7xxx.c,v 1.74 2007/05/02 02:20:36 krw Exp $ */
/* $NetBSD: aic7xxx.c,v 1.108 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -40,7 +40,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: aic7xxx.c,v 1.73 2006/07/30 14:21:14 krw Exp $
+ * $Id: aic7xxx.c,v 1.74 2007/05/02 02:20:36 krw Exp $
*/
/*
* Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. - April 2003
@@ -6898,10 +6898,10 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
ahc_flag saved_flags;
printf("Configuring Target Mode\n");
- ahc_lock(ahc, &s);
+ s = splbio();
if (LIST_FIRST(&ahc->pending_scbs) != NULL) {
ccb->ccb_h.status = CAM_BUSY;
- ahc_unlock(ahc, &s);
+ splx(s);
return;
}
saved_flags = ahc->flags;
@@ -6922,12 +6922,12 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
ahc->flags = saved_flags;
(void)ahc_loadseq(ahc);
ahc_restart(ahc);
- ahc_unlock(ahc, &s);
+ splx(s);
ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
return;
}
ahc_restart(ahc);
- ahc_unlock(ahc, &s);
+ splx(s);
}
cel = &ccb->cel;
target = ccb->ccb_h.target_id;
@@ -6993,7 +6993,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
}
SLIST_INIT(&lstate->accept_tios);
SLIST_INIT(&lstate->immed_notifies);
- ahc_lock(ahc, &s);
+ s = splbio();
ahc_pause(ahc);
if (target != CAM_TARGET_WILDCARD) {
tstate->enabled_luns[lun] = lstate;
@@ -7059,7 +7059,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
ahc_outb(ahc, SCSISEQ, scsiseq);
}
ahc_unpause(ahc);
- ahc_unlock(ahc, &s);
+ splx(s);
ccb->ccb_h.status = CAM_REQ_CMP;
xpt_print_path(ccb->ccb_h.path);
printf("Lun now enabled for target mode\n");
@@ -7072,8 +7072,8 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
return;
}
- ahc_lock(ahc, &s);
-
+ s = splbio();
+
ccb->ccb_h.status = CAM_REQ_CMP;
LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) {
struct ccb_hdr *ccbh;
@@ -7083,7 +7083,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
&& !xpt_path_comp(ccbh->path, ccb->ccb_h.path)){
printf("CTIO pending\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
- ahc_unlock(ahc, &s);
+ splx(s);
return;
}
}
@@ -7099,7 +7099,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
}
if (ccb->ccb_h.status != CAM_REQ_CMP) {
- ahc_unlock(ahc, &s);
+ splx(s);
return;
}
@@ -7174,7 +7174,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
}
}
ahc_unpause(ahc);
- ahc_unlock(ahc, &s);
+ splx(s);
}
}
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index 693bf2bd4ee..11b69aa5305 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.33 2006/11/28 23:59:45 dlg Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.34 2007/05/02 02:20:37 krw Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -91,7 +91,7 @@ ahc_attach(struct ahc_softc *ahc)
char ahc_info[256];
int s;
- ahc_lock(ahc, &s);
+ s = splbio();
/*
* fill in the prototype scsi_links.
@@ -143,7 +143,7 @@ ahc_attach(struct ahc_softc *ahc)
&saa, scsiprint);
}
- ahc_unlock(ahc, &s);
+ splx(s);
return (1);
}
@@ -277,9 +277,9 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
xs->error = XS_SENSE;
}
- ahc_lock(ahc, &s);
+ s = splbio();
ahc_free_scb(ahc, scb);
- ahc_unlock(ahc, &s);
+ splx(s);
xs->flags |= ITSDONE;
scsi_done(xs);
@@ -325,12 +325,12 @@ ahc_action(struct scsi_xfer *xs)
/*
* get an scb to use.
*/
- ahc_lock(ahc, &s);
+ s = splbio();
if ((scb = ahc_get_scb(ahc)) == NULL) {
- ahc_unlock(ahc, &s);
+ splx(s);
return (TRY_AGAIN_LATER);
}
- ahc_unlock(ahc, &s);
+ splx(s);
hscb = scb->hscb;
@@ -426,7 +426,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments)
scb->sg_count = nsegments;
- ahc_lock(ahc, &s);
+ s = splbio();
/*
* Last time we need to check if this SCB needs to
@@ -437,7 +437,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments)
bus_dmamap_unload(ahc->parent_dmat, scb->dmamap);
ahc_free_scb(ahc, scb);
- ahc_unlock(ahc, &s);
+ splx(s);
return (COMPLETE);
}
@@ -496,7 +496,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments)
if (xs->flags & SCSI_POLL)
goto poll;
else {
- ahc_unlock(ahc, &s);
+ splx(s);
return (SUCCESSFULLY_QUEUED);
}
}
@@ -526,7 +526,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments)
ahc->inited_target[xs->sc_link->target] = 1;
}
- ahc_unlock(ahc, &s);
+ splx(s);
return (SUCCESSFULLY_QUEUED);
}
@@ -545,7 +545,7 @@ poll:
}
} while (!(xs->flags & ITSDONE));
- ahc_unlock(ahc, &s);
+ splx(s);
return (COMPLETE);
}
@@ -580,9 +580,9 @@ ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
hscb->cdb_len = xs->cmdlen;
if (hscb->cdb_len > sizeof(hscb->cdb32)) {
- ahc_lock(ahc, &s);
+ s = splbio();
ahc_free_scb(ahc, scb);
- ahc_unlock(ahc, &s);
+ splx(s);
xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
@@ -611,9 +611,9 @@ ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
"= %d\n",
ahc_name(ahc), error);
#endif
- ahc_lock(ahc, &s);
+ s = splbio();
ahc_free_scb(ahc, scb);
- ahc_unlock(ahc, &s);
+ splx(s);
return (TRY_AGAIN_LATER); /* XXX fvdl */
}
error = ahc_execute_scb(scb,
@@ -637,7 +637,7 @@ ahc_timeout(void *arg)
scb = (struct scb *)arg;
ahc = (struct ahc_softc *)scb->xs->sc_link->adapter_softc;
- ahc_lock(ahc, &s);
+ s = splbio();
#ifdef AHC_DEBUG
printf("%s: SCB %d timed out\n", ahc_name(ahc), scb->hscb->tag);
@@ -666,7 +666,7 @@ ahc_timeout(void *arg)
}
ahc_unpause(ahc);
- ahc_unlock(ahc, &s);
+ splx(s);
}
diff --git a/sys/dev/ic/aic7xxx_openbsd.h b/sys/dev/ic/aic7xxx_openbsd.h
index d9c140859d5..f697ba71116 100644
--- a/sys/dev/ic/aic7xxx_openbsd.h
+++ b/sys/dev/ic/aic7xxx_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.h,v 1.17 2005/12/28 03:05:39 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.h,v 1.18 2007/05/02 02:20:37 krw Exp $ */
/* $NetBSD: aic7xxx_osm.h,v 1.7 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -198,69 +198,7 @@ ahc_flush_device_writes(struct ahc_softc *ahc)
}
/**************************** Locking Primitives ******************************/
-/* Lock protecting internal data structures */
-static __inline void ahc_lockinit(struct ahc_softc *);
-static __inline void ahc_lock(struct ahc_softc *, int *);
-static __inline void ahc_unlock(struct ahc_softc *, int *);
-/* Lock held during command completion to the upper layer */
-static __inline void ahc_done_lockinit(struct ahc_softc *);
-static __inline void ahc_done_lock(struct ahc_softc *, int *);
-static __inline void ahc_done_unlock(struct ahc_softc *, int *);
-
-/* Lock held during ahc_list manipulation and ahc softc frees */
-static __inline void ahc_list_lockinit(void);
-static __inline void ahc_list_lock(int *);
-static __inline void ahc_list_unlock(int *);
-
-static __inline void
-ahc_lockinit(struct ahc_softc *ahc)
-{
-}
-
-static __inline void
-ahc_lock(struct ahc_softc *ahc, int *flags)
-{
- *flags = splbio();
-}
-
-static __inline void
-ahc_unlock(struct ahc_softc *ahc, int *flags)
-{
- splx(*flags);
-}
-
-/* Lock held during command completion to the upper layer */
-static __inline void
-ahc_done_lockinit(struct ahc_softc *ahc)
-{
-}
-
-static __inline void
-ahc_done_lock(struct ahc_softc *ahc, int *flags)
-{
-}
-
-static __inline void
-ahc_done_unlock(struct ahc_softc *ahc, int *flags)
-{
-}
-
-/* Lock held during ahc_list manipulation and ahc softc frees */
-static __inline void
-ahc_list_lockinit()
-{
-}
-
-static __inline void
-ahc_list_lock(int *flags)
-{
-}
-
-static __inline void
-ahc_list_unlock(int *flags)
-{
-}
/****************************** OS Primitives *********************************/
/************************** Transaction Operations ****************************/
@@ -380,15 +318,15 @@ ahc_platform_scb_free(struct ahc_softc *ahc, struct scb *scb)
{
int s;
- ahc_lock(ahc, &s);
-
+ s = splbio();
+
if ((ahc->flags & AHC_RESOURCE_SHORTAGE) != 0) {
ahc->flags &= ~AHC_RESOURCE_SHORTAGE;
}
-
+
timeout_del(&scb->xs->stimeout);
-
- ahc_unlock(ahc, &s);
+
+ splx(s);
}
/********************************** PCI ***************************************/