Fix argument lists of locking primitives (thereby fixing some compilation
authorSascha Wildner <swildner@dragonflybsd.org>
Sat, 27 Jan 2007 15:03:25 +0000 (15:03 +0000)
committerSascha Wildner <swildner@dragonflybsd.org>
Sat, 27 Jan 2007 15:03:25 +0000 (15:03 +0000)
warnings).

While I'm here, remove several empty functions.

sys/dev/disk/aic7xxx/aic7770.c
sys/dev/disk/aic7xxx/aic79xx.c
sys/dev/disk/aic7xxx/aic79xx_osm.c
sys/dev/disk/aic7xxx/aic79xx_osm.h
sys/dev/disk/aic7xxx/aic79xx_pci.c
sys/dev/disk/aic7xxx/aic7xxx.c
sys/dev/disk/aic7xxx/aic7xxx_osm.c
sys/dev/disk/aic7xxx/aic7xxx_osm.h
sys/dev/disk/aic7xxx/aic7xxx_pci.c

index 62ff171..709b245 100644 (file)
@@ -40,7 +40,7 @@
  * $Id: //depot/aic7xxx/aic7xxx/aic7770.c#32 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7770.c,v 1.1.2.9 2003/06/10 03:26:07 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7770.c,v 1.6 2006/12/22 23:26:15 swildner Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7770.c,v 1.7 2007/01/27 15:03:25 swildner Exp $
  */
 
 #ifdef __linux__
@@ -127,7 +127,6 @@ aic7770_find_device(uint32_t id)
 int
 aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
 {
-       u_long  l;
        int     error;
        int     have_seeprom;
        u_int   hostconf;
@@ -255,7 +254,6 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
        if (error != 0)
                return (error);
 
-       ahc_list_lock(&l);
        /*
         * Link this softc in with all other ahc instances.
         */
@@ -266,8 +264,6 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
         */
        ahc_outb(ahc, BCTL, ENABLE);
 
-       ahc_list_unlock(&l);
-
        return (0);
 }
 
index 5aa7bba..cc6ec10 100644 (file)
@@ -40,7 +40,7 @@
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#198 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.3.2.5 2003/06/10 03:26:07 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.12 2006/12/22 23:26:15 swildner Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.13 2007/01/27 15:03:25 swildner Exp $
  */
 
 #include "aic79xx_osm.h"
@@ -7527,17 +7527,13 @@ ahd_reset_poll(void *arg)
 {
        struct  ahd_softc *ahd;
        u_int   scsiseq1;
-       u_long  l;
-       u_long  s;
        
-       ahd_list_lock(&l);
        ahd = ahd_find_softc((struct ahd_softc *)arg);
        if (ahd == NULL) {
                kprintf("ahd_reset_poll: Instance %p no longer exists\n", arg);
-               ahd_list_unlock(&l);
                return;
        }
-       ahd_lock(ahd, &s);
+       ahd_lock();
        ahd_pause(ahd);
        ahd_update_modes(ahd);
        ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
@@ -7546,8 +7542,7 @@ ahd_reset_poll(void *arg)
                ahd_timer_reset(&ahd->reset_timer, AHD_RESET_POLL_US,
                                ahd_reset_poll, ahd);
                ahd_unpause(ahd);
-               ahd_unlock(ahd, &s);
-               ahd_list_unlock(&l);
+               ahd_unlock();
                return;
        }
 
@@ -7557,9 +7552,8 @@ ahd_reset_poll(void *arg)
        ahd_outb(ahd, SCSISEQ1, scsiseq1 & (ENSELI|ENRSELI|ENAUTOATNP));
        ahd_unpause(ahd);
        ahd->flags &= ~AHD_RESET_POLL_ACTIVE;
-       ahd_unlock(ahd, &s);
+       ahd_unlock();
        ahd_release_simq(ahd);
-       ahd_list_unlock(&l);
 }
 
 /**************************** Statistics Processing ***************************/
@@ -7567,18 +7561,14 @@ static void
 ahd_stat_timer(void *arg)
 {
        struct  ahd_softc *ahd;
-       u_long  l;
-       u_long  s;
        int     enint_coal;
        
-       ahd_list_lock(&l);
        ahd = ahd_find_softc((struct ahd_softc *)arg);
        if (ahd == NULL) {
                kprintf("ahd_stat_timer: Instance %p no longer exists\n", arg);
-               ahd_list_unlock(&l);
                return;
        }
-       ahd_lock(ahd, &s);
+       ahd_lock();
 
        enint_coal = ahd->hs_mailbox & ENINT_COALESCE;
        if (ahd->cmdcmplt_total > ahd->int_coalescing_threshold)
@@ -7603,8 +7593,7 @@ ahd_stat_timer(void *arg)
        ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket] = 0;
        ahd_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_US,
                        ahd_stat_timer, ahd);
-       ahd_unlock(ahd, &s);
-       ahd_list_unlock(&l);
+       ahd_unlock();
 }
 
 /****************************** Status Processing *****************************/
@@ -9047,10 +9036,10 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                u_long  s;
 
                kprintf("Configuring Target Mode\n");
-               ahd_lock(ahd, &s);
+               ahd_lock();
                if (LIST_FIRST(&ahd->pending_scbs) != NULL) {
                        ccb->ccb_h.status = CAM_BUSY;
-                       ahd_unlock(ahd, &s);
+                       ahd_unlock();
                        return;
                }
                ahd->flags |= AHD_TARGETROLE;
@@ -9059,7 +9048,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                ahd_pause(ahd);
                ahd_loadseq(ahd);
                ahd_restart(ahd);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
        }
        cel = &ccb->cel;
        target = ccb->ccb_h.target_id;
@@ -9118,7 +9107,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                }
                SLIST_INIT(&lstate->accept_tios);
                SLIST_INIT(&lstate->immed_notifies);
-               ahd_lock(ahd, &s);
+               ahd_lock();
                ahd_pause(ahd);
                if (target != CAM_TARGET_WILDCARD) {
                        tstate->enabled_luns[lun] = lstate;
@@ -9181,7 +9170,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                        ahd_outb(ahd, SCSISEQ1, scsiseq1);
                }
                ahd_unpause(ahd);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_print_path(ccb->ccb_h.path);
                kprintf("Lun now enabled for target mode\n");
@@ -9194,7 +9183,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                        return;
                }
 
-               ahd_lock(ahd, &s);
+               ahd_lock();
                
                ccb->ccb_h.status = CAM_REQ_CMP;
                LIST_FOREACH(scb, &ahd->pending_scbs, pending_links) {
@@ -9205,7 +9194,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                         && !xpt_path_comp(ccbh->path, ccb->ccb_h.path)){
                                kprintf("CTIO pending\n");
                                ccb->ccb_h.status = CAM_REQ_INVALID;
-                               ahd_unlock(ahd, &s);
+                               ahd_unlock();
                                return;
                        }
                }
@@ -9221,7 +9210,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                }
 
                if (ccb->ccb_h.status != CAM_REQ_CMP) {
-                       ahd_unlock(ahd, &s);
+                       ahd_unlock();
                        return;
                }
 
@@ -9293,7 +9282,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb)
                        }
                }
                ahd_unpause(ahd);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
        }
 #endif
 }
index 3f1c7c8..678f10a 100644 (file)
@@ -32,7 +32,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.c#27 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.3.2.4 2003/06/10 03:26:07 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.11 2006/12/22 23:26:15 swildner Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.12 2007/01/27 15:03:25 swildner Exp $
  */
 
 #include "aic79xx_osm.h"
@@ -117,7 +117,6 @@ ahd_attach(struct ahd_softc *ahd)
        struct ccb_setasync csa;
        struct cam_sim *sim;
        struct cam_path *path;
-       long s;
        int count;
 
        count = 0;
@@ -125,7 +124,7 @@ ahd_attach(struct ahd_softc *ahd)
 
        ahd_controller_info(ahd, ahd_info);
        kprintf("%s\n", ahd_info);
-       ahd_lock(ahd, &s);
+       ahd_lock();
 
        /*
         * Construct our SIM entry
@@ -170,7 +169,7 @@ fail:
                ahd_intr_enable(ahd, TRUE);
        }
 
-       ahd_unlock(ahd, &s);
+       ahd_unlock();
 
        return (count);
 }
@@ -340,7 +339,6 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
 #endif
        u_int   target_id;
        u_int   our_id;
-       long    s;
 
        CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahd_action\n"));
        
@@ -374,13 +372,13 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
                }
                if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) {
 
-                       ahd_lock(ahd, &s);
+                       ahd_lock();
                        SLIST_INSERT_HEAD(&lstate->accept_tios, &ccb->ccb_h,
                                          sim_links.sle);
                        ccb->ccb_h.status = CAM_REQ_INPROG;
                        if ((ahd->flags & AHD_TQINFIFO_BLOCKED) != 0)
                                ahd_run_tqinfifo(ahd, /*paused*/FALSE);
-                       ahd_unlock(ahd, &s);
+                       ahd_unlock();
                        break;
                }
 
@@ -414,7 +412,7 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
                /*
                 * get an scb to use.
                 */
-               ahd_lock(ahd, &s);
+               ahd_lock();
                tinfo = ahd_fetch_transinfo(ahd, 'A', our_id,
                                            target_id, &tstate);
                if ((ccb->ccb_h.flags & CAM_TAG_ACTION_VALID) == 0
@@ -429,12 +427,12 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
        
                        xpt_freeze_simq(sim, /*count*/1);
                        ahd->flags |= AHD_RESOURCE_SHORTAGE;
-                       ahd_unlock(ahd, &s);
+                       ahd_unlock();
                        ccb->ccb_h.status = CAM_REQUEUE_REQ;
                        xpt_done(ccb);
                        return;
                }
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                
                hscb = scb->hscb;
                
@@ -522,20 +520,20 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
        }
        case XPT_SET_TRAN_SETTINGS:
        {
-               ahd_lock(ahd, &s);
+               ahd_lock();
                ahd_set_tran_settings(ahd, SIM_SCSI_ID(ahd, sim),
                                      SIM_CHANNEL(ahd, sim), &ccb->cts);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                xpt_done(ccb);
                break;
        }
        case XPT_GET_TRAN_SETTINGS:
        /* Get default/user set transfer settings for the target */
        {
-               ahd_lock(ahd, &s);
+               ahd_lock();
                ahd_get_tran_settings(ahd, SIM_SCSI_ID(ahd, sim),
                                      SIM_CHANNEL(ahd, sim), &ccb->cts);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                xpt_done(ccb);
                break;
        }
@@ -568,10 +566,10 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
        {
                int  found;
                
-               ahd_lock(ahd, &s);
+               ahd_lock();
                found = ahd_reset_channel(ahd, SIM_CHANNEL(ahd, sim),
                                          /*initiate reset*/TRUE);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                if (bootverbose) {
                        xpt_print_path(SIM_PATH(ahd, sim));
                        kprintf("SCSI bus reset delivered. "
@@ -989,7 +987,6 @@ ahd_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
        case AC_LOST_DEVICE:
        {
                struct  ahd_devinfo devinfo;
-               long    s;
 
                ahd_compile_devinfo(&devinfo, SIM_SCSI_ID(ahd, sim),
                                    xpt_path_target_id(path),
@@ -1001,13 +998,13 @@ ahd_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
                 * Revert to async/narrow transfers
                 * for the next device.
                 */
-               ahd_lock(ahd, &s);
+               ahd_lock();
                ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
                              AHD_TRANS_GOAL|AHD_TRANS_CUR, /*paused*/FALSE);
                ahd_set_syncrate(ahd, &devinfo, /*period*/0, /*offset*/0,
                                 /*ppr_options*/0, AHD_TRANS_GOAL|AHD_TRANS_CUR,
                                 /*paused*/FALSE);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                break;
        }
        default:
@@ -1025,7 +1022,6 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
        struct  ahd_initiator_tinfo *tinfo;
        struct  ahd_tmode_tstate *tstate;
        u_int   mask;
-       u_long  s;
 
        scb = (struct scb *)arg;
        ccb = scb->io_ctx;
@@ -1038,9 +1034,9 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                        ahd_set_transaction_status(scb, CAM_REQ_CMP_ERR);
                if (nsegments != 0)
                        bus_dmamap_unload(ahd->buffer_dmat, scb->dmamap);
-               ahd_lock(ahd, &s);
+               ahd_lock();
                ahd_free_scb(ahd, scb);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                xpt_done(ccb);
                return;
        }
@@ -1078,7 +1074,7 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                }
        }
 
-       ahd_lock(ahd, &s);
+       ahd_lock();
 
        /*
         * Last time we need to check if this SCB needs to
@@ -1089,7 +1085,7 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                        bus_dmamap_unload(ahd->buffer_dmat,
                                          scb->dmamap);
                ahd_free_scb(ahd, scb);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                xpt_done(ccb);
                return;
        }
@@ -1149,7 +1145,7 @@ ahd_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                ahd_queue_scb(ahd, scb);
        }
 
-       ahd_unlock(ahd, &s);
+       ahd_unlock();
 }
 
 static void
@@ -1176,8 +1172,6 @@ ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
 
                        if (hscb->cdb_len > MAX_CDB_LEN
                         && (ccb_h->flags & CAM_CDB_PHYS) == 0) {
-                               u_long s;
-
                                /*
                                 * Should CAM start to support CDB sizes
                                 * greater than 16 bytes, we could use
@@ -1185,9 +1179,9 @@ ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
                                 */
                                ahd_set_transaction_status(scb,
                                                           CAM_REQ_INVALID);
-                               ahd_lock(ahd, &s);
+                               ahd_lock();
                                ahd_free_scb(ahd, scb);
-                               ahd_unlock(ahd, &s);
+                               ahd_unlock();
                                xpt_done((union ccb *)csio);
                                return;
                        }
@@ -1204,13 +1198,11 @@ ahd_setup_data(struct ahd_softc *ahd, struct cam_sim *sim,
                        }
                } else {
                        if (hscb->cdb_len > MAX_CDB_LEN) {
-                               u_long s;
-
                                ahd_set_transaction_status(scb,
                                                           CAM_REQ_INVALID);
-                               ahd_lock(ahd, &s);
+                               ahd_lock();
                                ahd_free_scb(ahd, scb);
-                               ahd_unlock(ahd, &s);
+                               ahd_unlock();
                                xpt_done((union ccb *)csio);
                                return;
                        }
@@ -1319,7 +1311,6 @@ ahd_timeout(void *arg)
        struct  scb       *scb;
        struct  ahd_softc *ahd;
        ahd_mode_state     saved_modes;
-       long               s;
        int                target;
        int                lun;
        char               channel;
@@ -1333,7 +1324,7 @@ ahd_timeout(void *arg)
        scb = (struct scb *)arg; 
        ahd = (struct ahd_softc *)scb->ahd_softc;
 
-       ahd_lock(ahd, &s);
+       ahd_lock();
 
        ahd_pause_and_flushwork(ahd);
 
@@ -1351,7 +1342,7 @@ ahd_timeout(void *arg)
                kprintf("%s: Timedout SCB already complete. "
                       "Interrupts may not be functioning.\n", ahd_name(ahd));
                ahd_unpause(ahd);
-               ahd_unlock(ahd, &s);
+               ahd_unlock();
                return;
        }
 
@@ -1364,7 +1355,7 @@ ahd_timeout(void *arg)
        ahd_dump_card_state(ahd);
        ahd_reset_channel(ahd, SIM_CHANNEL(ahd, sim),
                          /*initiate reset*/TRUE);
-       ahd_unlock(ahd, &s);
+       ahd_unlock();
        return;
 #if NOT_YET
        last_phase = ahd_inb(ahd, LASTPHASE);
@@ -1446,7 +1437,7 @@ bus_reset:
                                callout_reset(&scb->io_ctx->ccb_h.timeout_ch,
                                    newtimeout, ahd_timeout, scb);
                                ahd_unpause(ahd);
-                               ahd_unlock(ahd, &s);
+                               ahd_unlock();
                                return;
                        } 
 
@@ -1466,7 +1457,7 @@ bus_reset:
 
                                /* Will clear us from the bus */
                                ahd_restart(ahd);
-                               ahd_unlock(ahd, &s);
+                               ahd_unlock();
                                return;
                        }
 
@@ -1493,7 +1484,7 @@ bus_reset:
                                kprintf("%s: Hung target selection\n",
                                       ahd_name(ahd));
                                ahd_restart(ahd);
-                               ahd_unlock(ahd, &s);
+                               ahd_unlock();
                                return;
                        }
 
@@ -1568,7 +1559,7 @@ bus_reset:
                        }
                }
        }
-       ahd_unlock(ahd, &s);
+       ahd_unlock();
 #endif
 }
 
@@ -1784,24 +1775,19 @@ int
 ahd_detach(device_t dev)
 {
        struct ahd_softc *ahd;
-       u_long l;
-       u_long s;
 
-       ahd_list_lock(&l);
        device_printf(dev, "detaching device\n");
        ahd = device_get_softc(dev);
        ahd = ahd_find_softc(ahd);
        if (ahd == NULL) {
                device_printf(dev, "aic7xxx already detached\n");
-               ahd_list_unlock(&l);
                return (ENOENT);
        }
-       ahd_lock(ahd, &s);
+       ahd_lock();
        ahd_intr_enable(ahd, FALSE);
        bus_teardown_intr(dev, ahd->platform_data->irq, ahd->platform_data->ih);
-       ahd_unlock(ahd, &s);
+       ahd_unlock();
        ahd_free(ahd);
-       ahd_list_unlock(&l);
        return (0);
 }
 
index f00453f..7ac9ddd 100644 (file)
@@ -33,7 +33,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.h#20 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.h,v 1.4.2.3 2003/06/10 03:26:07 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.h,v 1.7 2006/10/25 20:55:53 dillon Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.h,v 1.8 2007/01/27 15:03:25 swildner Exp $
  */
 
 #ifndef _AIC79XX_FREEBSD_H_
@@ -280,68 +280,21 @@ ahd_flush_device_writes(struct ahd_softc *ahd)
 
 /**************************** Locking Primitives ******************************/
 /* Lock protecting internal data structures */
-static __inline void ahd_lockinit(struct ahd_softc *);
-static __inline void ahd_lock(struct ahd_softc *, unsigned long *flags);
-static __inline void ahd_unlock(struct ahd_softc *, unsigned long *flags);
-
-/* Lock held during command compeletion to the upper layer */
-static __inline void ahd_done_lockinit(struct ahd_softc *);
-static __inline void ahd_done_lock(struct ahd_softc *, unsigned long *flags);
-static __inline void ahd_done_unlock(struct ahd_softc *, unsigned long *flags);
-
-/* Lock held during ahd_list manipulation and ahd softc frees */
-static __inline void ahd_list_lockinit(void);
-static __inline void ahd_list_lock(unsigned long *flags);
-static __inline void ahd_list_unlock(unsigned long *flags);
-
-static __inline void
-ahd_lockinit(struct ahd_softc *ahd)
-{
-}
+static __inline void ahd_lock(void);
+static __inline void ahd_unlock(void);
 
 static __inline void
-ahd_lock(struct ahd_softc *ahd, unsigned long *flags __unused)
+ahd_lock(void)
 {
        crit_enter();
 }
 
 static __inline void
-ahd_unlock(struct ahd_softc *ahd, unsigned long *flags __unused)
+ahd_unlock(void)
 {
        crit_exit();
 }
 
-/* Lock held during command compeletion to the upper layer */
-static __inline void
-ahd_done_lockinit(struct ahd_softc *ahd)
-{
-}
-
-static __inline void
-ahd_done_lock(struct ahd_softc *ahd, unsigned long *flags)
-{
-}
-
-static __inline void
-ahd_done_unlock(struct ahd_softc *ahd, unsigned long *flags)
-{
-}
-
-/* Lock held during ahd_list manipulation and ahd softc frees */
-static __inline void
-ahd_list_lockinit(void)
-{
-}
-
-static __inline void
-ahd_list_lock(unsigned long *flags)
-{
-}
-
-static __inline void
-ahd_list_unlock(unsigned long *flags)
-{
-}
 /****************************** OS Primitives *********************************/
 #define ahd_delay DELAY
 
index 0d65615..4ebb8a5 100644 (file)
@@ -41,7 +41,7 @@
  * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#75 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_pci.c,v 1.3.2.5 2003/06/10 03:26:07 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_pci.c,v 1.5 2006/12/22 23:26:15 swildner Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_pci.c,v 1.6 2007/01/27 15:03:25 swildner Exp $
  */
 
 #ifdef __linux__
@@ -310,7 +310,6 @@ int
 ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
 {
        struct scb_data *shared_scb_data;
-       u_long           l;
        u_int            command;
        uint32_t         devconfig;
        uint16_t         subvendor; 
@@ -403,12 +402,10 @@ ahd_pci_config(struct ahd_softc *ahd, struct ahd_pci_identity *entry)
        if (error != 0)
                return (error);
 
-       ahd_list_lock(&l);
        /*
         * Link this softc in with all other ahd instances.
         */
        ahd_softc_insert(ahd);
-       ahd_list_unlock(&l);
        return (0);
 }
 
index b29f440..8eb7d42 100644 (file)
@@ -40,7 +40,7 @@
  * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#134 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.41.2.27 2003/06/10 03:26:08 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.12 2007/01/06 08:27:54 dillon Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.13 2007/01/27 15:03:25 swildner Exp $
  */
 
 #include "aic7xxx_osm.h"
@@ -6842,7 +6842,6 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
        struct     ahc_tmode_lstate *lstate;
        struct     ccb_en_lun *cel;
        cam_status status;
-       u_long     s;
        u_int      target;
        u_int      lun;
        u_int      target_mask;
@@ -6924,14 +6923,13 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
         */
        if ((ahc->flags & AHC_TARGETROLE) == 0
         && ccb->ccb_h.target_id != CAM_TARGET_WILDCARD) {
-               u_long   s;
                ahc_flag saved_flags;
 
                kprintf("Configuring Target Mode\n");
-               ahc_lock(ahc, &s);
+               ahc_lock();
                if (LIST_FIRST(&ahc->pending_scbs) != NULL) {
                        ccb->ccb_h.status = CAM_BUSY;
-                       ahc_unlock(ahc, &s);
+                       ahc_unlock();
                        return;
                }
                saved_flags = ahc->flags;
@@ -6952,12 +6950,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);
+                       ahc_unlock();
                        ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
                        return;
                }
                ahc_restart(ahc);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
        }
        cel = &ccb->cel;
        target = ccb->ccb_h.target_id;
@@ -7016,7 +7014,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);
+               ahc_lock();
                ahc_pause(ahc);
                if (target != CAM_TARGET_WILDCARD) {
                        tstate->enabled_luns[lun] = lstate;
@@ -7082,7 +7080,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);
+               ahc_unlock();
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_print_path(ccb->ccb_h.path);
                kprintf("Lun now enabled for target mode\n");
@@ -7095,7 +7093,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
                        return;
                }
 
-               ahc_lock(ahc, &s);
+               ahc_lock();
                
                ccb->ccb_h.status = CAM_REQ_CMP;
                LIST_FOREACH(scb, &ahc->pending_scbs, pending_links) {
@@ -7106,7 +7104,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)){
                                kprintf("CTIO pending\n");
                                ccb->ccb_h.status = CAM_REQ_INVALID;
-                               ahc_unlock(ahc, &s);
+                               ahc_unlock();
                                return;
                        }
                }
@@ -7122,7 +7120,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);
+                       ahc_unlock();
                        return;
                }
 
@@ -7197,7 +7195,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb)
                        }
                }
                ahc_unpause(ahc);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
        }
 }
 
index 477d420..8ec2db8 100644 (file)
@@ -31,7 +31,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.c#13 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.27.2.6 2003/06/10 03:26:09 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.11 2006/12/22 23:26:15 swildner Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.12 2007/01/27 15:03:25 swildner Exp $
  */
 
 #include "aic7xxx_osm.h"
@@ -113,7 +113,6 @@ ahc_attach(struct ahc_softc *ahc)
        struct cam_sim *sim2;
        struct cam_path *path;
        struct cam_path *path2;
-       long s;
        int count;
 
        count = 0;
@@ -122,7 +121,7 @@ ahc_attach(struct ahc_softc *ahc)
 
        ahc_controller_info(ahc, ahc_info);
        kprintf("%s\n", ahc_info);
-       ahc_lock(ahc, &s);
+       ahc_lock();
        /*
         * Attach secondary channel first if the user has
         * declared it the primary channel.
@@ -230,7 +229,7 @@ fail:
                ahc_intr_enable(ahc, TRUE);
        }
 
-       ahc_unlock(ahc, &s);
+       ahc_unlock();
        return (count);
 }
 
@@ -385,7 +384,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
        struct  ahc_tmode_lstate *lstate;
        u_int   target_id;
        u_int   our_id;
-       long    s;
 
        CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahc_action\n"));
        
@@ -418,13 +416,13 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                }
                if (ccb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO) {
 
-                       ahc_lock(ahc, &s);
+                       ahc_lock();
                        SLIST_INSERT_HEAD(&lstate->accept_tios, &ccb->ccb_h,
                                          sim_links.sle);
                        ccb->ccb_h.status = CAM_REQ_INPROG;
                        if ((ahc->flags & AHC_TQINFIFO_BLOCKED) != 0)
                                ahc_run_tqinfifo(ahc, /*paused*/FALSE);
-                       ahc_unlock(ahc, &s);
+                       ahc_unlock();
                        break;
                }
 
@@ -454,17 +452,17 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                /*
                 * get an scb to use.
                 */
-               ahc_lock(ahc, &s);
+               ahc_lock();
                if ((scb = ahc_get_scb(ahc)) == NULL) {
        
                        xpt_freeze_simq(sim, /*count*/1);
                        ahc->flags |= AHC_RESOURCE_SHORTAGE;
-                       ahc_unlock(ahc, &s);
+                       ahc_unlock();
                        ccb->ccb_h.status = CAM_REQUEUE_REQ;
                        xpt_done(ccb);
                        return;
                }
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                
                hscb = scb->hscb;
                
@@ -595,7 +593,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                        break;
                }
                
-               ahc_lock(ahc, &s);
+               ahc_lock();
 
                if ((spi->valid & CTS_SPI_VALID_DISC) != 0) {
                        if ((spi->flags & CTS_SPI_FLAGS_DISC_ENB) != 0)
@@ -672,7 +670,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                                         spi->ppr_options, update_type,
                                         /*paused*/FALSE);
                }
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
 #else
@@ -683,7 +681,6 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                uint16_t *discenable;
                uint16_t *tagenable;
                u_int     update_type;
-               long      s;
 
                cts = &ccb->cts;
                ahc_compile_devinfo(&devinfo, SIM_SCSI_ID(ahc, sim),
@@ -709,7 +706,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                        break;
                }
                
-               ahc_lock(ahc, &s);
+               ahc_lock();
 
                if ((cts->valid & CCB_TRANS_DISC_VALID) != 0) {
                        if ((cts->flags & CCB_TRANS_DISC_ENB) != 0)
@@ -791,7 +788,7 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
                                         ppr_options, update_type,
                                         /*paused*/FALSE);
                }
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
 #endif
@@ -801,10 +798,10 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
        /* Get default/user set transfer settings for the target */
        {
 
-               ahc_lock(ahc, &s);
+               ahc_lock();
                ahc_get_tran_settings(ahc, SIM_SCSI_ID(ahc, sim),
                                      SIM_CHANNEL(ahc, sim), &ccb->cts);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                xpt_done(ccb);
                break;
        }
@@ -839,10 +836,10 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
        {
                int  found;
                
-               ahc_lock(ahc, &s);
+               ahc_lock();
                found = ahc_reset_channel(ahc, SIM_CHANNEL(ahc, sim),
                                          /*initiate reset*/TRUE);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                if (bootverbose) {
                        xpt_print_path(SIM_PATH(ahc, sim));
                        kprintf("SCSI bus reset delivered. "
@@ -1039,7 +1036,6 @@ ahc_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
        case AC_LOST_DEVICE:
        {
                struct  ahc_devinfo devinfo;
-               long    s;
 
                ahc_compile_devinfo(&devinfo, SIM_SCSI_ID(ahc, sim),
                                    xpt_path_target_id(path),
@@ -1051,14 +1047,14 @@ ahc_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
                 * Revert to async/narrow transfers
                 * for the next device.
                 */
-               ahc_lock(ahc, &s);
+               ahc_lock();
                ahc_set_width(ahc, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
                              AHC_TRANS_GOAL|AHC_TRANS_CUR, /*paused*/FALSE);
                ahc_set_syncrate(ahc, &devinfo, /*syncrate*/NULL,
                                 /*period*/0, /*offset*/0, /*ppr_options*/0,
                                 AHC_TRANS_GOAL|AHC_TRANS_CUR,
                                 /*paused*/FALSE);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                break;
        }
        default:
@@ -1076,7 +1072,6 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
        struct  ahc_initiator_tinfo *tinfo;
        struct  ahc_tmode_tstate *tstate;
        u_int   mask;
-       long    s;
 
        scb = (struct scb *)arg;
        ccb = scb->io_ctx;
@@ -1089,9 +1084,9 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                        ahc_set_transaction_status(scb, CAM_REQ_CMP_ERR);
                if (nsegments != 0)
                        bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
-               ahc_lock(ahc, &s);
+               ahc_lock();
                ahc_free_scb(ahc, scb);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                xpt_done(ccb);
                return;
        }
@@ -1161,9 +1156,9 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                                            CAM_REQ_TOO_BIG);
                                        bus_dmamap_unload(ahc->buffer_dmat,
                                                          scb->dmamap);
-                                       ahc_lock(ahc, &s);
+                                       ahc_lock();
                                        ahc_free_scb(ahc, scb);
-                                       ahc_unlock(ahc, &s);
+                                       ahc_unlock();
                                        xpt_done(ccb);
                                        return;
                                }
@@ -1186,7 +1181,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
        
        scb->sg_count = nsegments;
 
-       ahc_lock(ahc, &s);
+       ahc_lock();
 
        /*
         * Last time we need to check if this SCB needs to
@@ -1196,7 +1191,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                if (nsegments != 0)
                        bus_dmamap_unload(ahc->buffer_dmat, scb->dmamap);
                ahc_free_scb(ahc, scb);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                xpt_done(ccb);
                return;
        }
@@ -1259,7 +1254,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                TAILQ_INSERT_TAIL(untagged_q, scb, links.tqe);
                scb->flags |= SCB_UNTAGGEDQ;
                if (TAILQ_FIRST(untagged_q) != scb) {
-                       ahc_unlock(ahc, &s);
+                       ahc_unlock();
                        return;
                }
        }
@@ -1277,7 +1272,7 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
                ahc_queue_scb(ahc, scb);
        }
 
-       ahc_unlock(ahc, &s);
+       ahc_unlock();
 }
 
 static void
@@ -1307,13 +1302,11 @@ ahc_setup_data(struct ahc_softc *ahc, struct cam_sim *sim,
 
                        if (hscb->cdb_len > sizeof(hscb->cdb32)
                         || (ccb_h->flags & CAM_CDB_PHYS) != 0) {
-                               u_long s;
-
                                ahc_set_transaction_status(scb,
                                                           CAM_REQ_INVALID);
-                               ahc_lock(ahc, &s);
+                               ahc_lock();
                                ahc_free_scb(ahc, scb);
-                               ahc_unlock(ahc, &s);
+                               ahc_unlock();
                                xpt_done((union ccb *)csio);
                                return;
                        }
@@ -1437,7 +1430,6 @@ ahc_timeout(void *arg)
 {
        struct  scb *scb;
        struct  ahc_softc *ahc;
-       long    s;
        int     found;
        u_int   last_phase;
        int     target;
@@ -1448,7 +1440,7 @@ ahc_timeout(void *arg)
        scb = (struct scb *)arg; 
        ahc = (struct ahc_softc *)scb->ahc_softc;
 
-       ahc_lock(ahc, &s);
+       ahc_lock();
 
        ahc_pause_and_flushwork(ahc);
 
@@ -1457,7 +1449,7 @@ ahc_timeout(void *arg)
                kprintf("%s: Timedout SCB already complete. "
                       "Interrupts may not be functioning.\n", ahc_name(ahc));
                ahc_unpause(ahc);
-               ahc_unlock(ahc, &s);
+               ahc_unlock();
                return;
        }
 
@@ -1545,7 +1537,7 @@ bus_reset:
                                callout_reset(&scb->io_ctx->ccb_h.timeout_ch,
                                    newtimeout, ahc_timeout, scb);
                                ahc_unpause(ahc);
-                               ahc_unlock(ahc, &s);
+                               ahc_unlock();
                                return;
                        } 
 
@@ -1565,7 +1557,7 @@ bus_reset:
 
                                /* Will clear us from the bus */
                                ahc_restart(ahc);
-                               ahc_unlock(ahc, &s);
+                               ahc_unlock();
                                return;
                        }
 
@@ -1592,7 +1584,7 @@ bus_reset:
                                kprintf("%s: Hung target selection\n",
                                       ahc_name(ahc));
                                ahc_restart(ahc);
-                               ahc_unlock(ahc, &s);
+                               ahc_unlock();
                                return;
                        }
 
@@ -1684,7 +1676,7 @@ bus_reset:
                        }
                }
        }
-       ahc_unlock(ahc, &s);
+       ahc_unlock();
 }
 
 static void
@@ -1893,24 +1885,19 @@ int
 ahc_detach(device_t dev)
 {
        struct ahc_softc *ahc;
-       u_long l;
-       u_long s;
 
-       ahc_list_lock(&l);
        device_printf(dev, "detaching device\n");
        ahc = device_get_softc(dev);
        ahc = ahc_find_softc(ahc);
        if (ahc == NULL) {
                device_printf(dev, "aic7xxx already detached\n");
-               ahc_list_unlock(&l);
                return (ENOENT);
        }
-       ahc_lock(ahc, &s);
+       ahc_lock();
        ahc_intr_enable(ahc, FALSE);
        bus_teardown_intr(dev, ahc->platform_data->irq, ahc->platform_data->ih);
-       ahc_unlock(ahc, &s);
+       ahc_unlock();
        ahc_free(ahc);
-       ahc_list_unlock(&l);
        return (0);
 }
 
index ec20f74..2f74f5c 100644 (file)
@@ -32,7 +32,7 @@
  * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.h#15 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.h,v 1.14.2.6 2003/06/10 03:26:09 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.h,v 1.8 2006/10/25 20:55:53 dillon Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.h,v 1.9 2007/01/27 15:03:25 swildner Exp $
  */
 
 #ifndef _AIC7XXX_FREEBSD_H_
@@ -276,68 +276,21 @@ 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 *, unsigned long *flags);
-static __inline void ahc_unlock(struct ahc_softc *, unsigned long *flags);
-
-/* Lock held during command compeletion to the upper layer */
-static __inline void ahc_done_lockinit(struct ahc_softc *);
-static __inline void ahc_done_lock(struct ahc_softc *, unsigned long *flags);
-static __inline void ahc_done_unlock(struct ahc_softc *, unsigned long *flags);
-
-/* Lock held during ahc_list manipulation and ahc softc frees */
-static __inline void ahc_list_lockinit(void);
-static __inline void ahc_list_lock(unsigned long *flags);
-static __inline void ahc_list_unlock(unsigned long *flags);
-
-static __inline void
-ahc_lockinit(struct ahc_softc *ahc)
-{
-}
+static __inline void ahc_lock(void);
+static __inline void ahc_unlock(void);
 
 static __inline void
-ahc_lock(struct ahc_softc *ahc, unsigned long *flags __unused)
+ahc_lock(void)
 {
        crit_enter_id("ahc");
 }
 
 static __inline void
-ahc_unlock(struct ahc_softc *ahc, unsigned long *flags __unused)
+ahc_unlock(void)
 {
        crit_exit_id("ahc");
 }
 
-/* Lock held during command compeletion to the upper layer */
-static __inline void
-ahc_done_lockinit(struct ahc_softc *ahc)
-{
-}
-
-static __inline void
-ahc_done_lock(struct ahc_softc *ahc, unsigned long *flags)
-{
-}
-
-static __inline void
-ahc_done_unlock(struct ahc_softc *ahc, unsigned long *flags)
-{
-}
-
-/* Lock held during ahc_list manipulation and ahc softc frees */
-static __inline void
-ahc_list_lockinit(void)
-{
-}
-
-static __inline void
-ahc_list_lock(unsigned long *flags)
-{
-}
-
-static __inline void
-ahc_list_unlock(unsigned long *flags)
-{
-}
 /****************************** OS Primitives *********************************/
 #define ahc_delay DELAY
 
index 59d23b9..8a796af 100644 (file)
@@ -42,7 +42,7 @@
  * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#69 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_pci.c,v 1.2.2.17 2003/06/10 03:26:09 gibbs Exp $
- * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_pci.c,v 1.6 2006/12/22 23:26:15 swildner Exp $
+ * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_pci.c,v 1.7 2007/01/27 15:03:25 swildner Exp $
  */
 
 #ifdef __linux__
@@ -784,7 +784,6 @@ ahc_find_pci_device(ahc_dev_softc_t pci)
 int
 ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
 {
-       u_long   l;
        u_int    command;
        u_int    our_id;
        u_int    sxfrctl1;
@@ -1044,12 +1043,10 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
        if (error != 0)
                return (error);
 
-       ahc_list_lock(&l);
        /*
         * Link this softc in with all other ahc instances.
         */
        ahc_softc_insert(ahc);
-       ahc_list_unlock(&l);
        return (0);
 }