twa(4): Pass INTR_MPSAFE when setting up the interrupt.
authorSascha Wildner <saw@online.de>
Sun, 8 Jul 2012 20:39:48 +0000 (22:39 +0200)
committerSascha Wildner <saw@online.de>
Sun, 8 Jul 2012 20:39:48 +0000 (22:39 +0200)
I removed it by mistake during porting.

While here, add some little fixes from FreeBSD.

Tested-with: 3ware 9650SE-2LP

sys/dev/raid/twa/tw_osl.h
sys/dev/raid/twa/tw_osl_cam.c
sys/dev/raid/twa/tw_osl_freebsd.c

index 5989065..28a9144 100644 (file)
@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     $FreeBSD: src/sys/dev/twa/tw_osl.h,v 1.9 2010/08/30 19:15:04 delphij Exp $
+ *     $FreeBSD: src/sys/dev/twa/tw_osl.h,v 1.10 2011/12/15 06:29:13 kevlo Exp $
  */
 
 /*
@@ -153,7 +153,7 @@ struct twa_softc {
        struct lock             sim_lock_handle;/* sim lock shared with cam */
        struct lock             *sim_lock;/* ptr to sim lock */
 
-       struct callout          watchdog_callout[2]; /* For command timout */
+       struct callout          watchdog_callout[2]; /* For command timeout */
        TW_UINT32               watchdog_index;
 
 #ifdef TW_OSL_DEBUG
index 6b31fc1..1f2e46d 100644 (file)
@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     $FreeBSD: src/sys/dev/twa/tw_osl_cam.c,v 1.15 2010/08/30 19:15:04 delphij Exp $
+ *     $FreeBSD: src/sys/dev/twa/tw_osl_cam.c,v 1.16 2012/06/22 21:46:41 mav Exp $
  */
 
 /*
@@ -712,9 +712,9 @@ tw_osl_complete_io(struct tw_cl_req_handle *req_handle)
                        ccb->ccb_h.status = CAM_REQ_CMP;
                else {
                        if (req_pkt->status & TW_CL_ERR_REQ_INVALID_TARGET)
-                               ccb->ccb_h.status |= CAM_TID_INVALID;
+                               ccb->ccb_h.status |= CAM_SEL_TIMEOUT;
                        else if (req_pkt->status & TW_CL_ERR_REQ_INVALID_LUN)
-                               ccb->ccb_h.status |= CAM_LUN_INVALID;
+                               ccb->ccb_h.status |= CAM_DEV_NOT_THERE;
                        else if (req_pkt->status & TW_CL_ERR_REQ_SCSI_ERROR)
                                ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
                        else if (req_pkt->status & TW_CL_ERR_REQ_BUS_RESET)
index 20a6b4f..5feeb75 100644 (file)
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     $FreeBSD: src/sys/dev/twa/tw_osl_freebsd.c,v 1.18 2010/09/04 16:27:14 bz Exp $
+ *     $FreeBSD: src/sys/dev/twa/tw_osl_freebsd.c,v 1.19 2011/11/07 06:44:47 ed Exp $
  */
 
 /*
@@ -54,7 +54,7 @@ TW_INT32      TW_DEBUG_LEVEL_FOR_OSL = TW_OSL_DEBUG;
 TW_INT32       TW_OSL_DEBUG_LEVEL_FOR_CL = TW_OSL_DEBUG;
 #endif /* TW_OSL_DEBUG */
 
-MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands");
+static MALLOC_DEFINE(TW_OSLI_MALLOC_CLASS, "twa_commands", "twa commands");
 
 
 static d_open_t                twa_open;
@@ -253,7 +253,7 @@ int twa_setup_intr(struct twa_softc *sc)
 
        if (!(sc->intr_handle) && (sc->irq_res)) {
                error = bus_setup_intr(sc->bus_dev, sc->irq_res,
-                                       0,
+                                       INTR_MPSAFE,
                                        twa_pci_intr,
                                        sc, &sc->intr_handle, NULL);
        }