diff options
author | scottl <scottl@FreeBSD.org> | 2002-11-30 19:06:24 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2002-11-30 19:06:24 +0000 |
commit | dc217ec7ea4f832d0dc316265d6106767054c253 (patch) | |
tree | 18c63aa03b5834bc7754b7e76fbb8b786db0532d /sys | |
parent | 69c6a0dc687e0f11c69951c8c320ced702e379c2 (diff) | |
download | FreeBSD-src-dc217ec7ea4f832d0dc316265d6106767054c253.zip FreeBSD-src-dc217ec7ea4f832d0dc316265d6106767054c253.tar.gz |
Use the new ahc_scb_timer_reset API
Remove AHC_ALLOW_MEMIO
Approved by: re (blanket)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx_osm.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.h b/sys/dev/aic7xxx/aic7xxx_osm.h index 1219c54..ff80362 100644 --- a/sys/dev/aic7xxx/aic7xxx_osm.h +++ b/sys/dev/aic7xxx/aic7xxx_osm.h @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.h#11 $ + * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.h#13 $ * * $FreeBSD$ */ @@ -58,10 +58,8 @@ #if NPCI > 0 #define AHC_PCI_CONFIG 1 -#ifdef AHC_ALLOW_MEMIO #include <machine/bus_memio.h> #endif -#endif #include <machine/bus_pio.h> #include <machine/bus.h> #include <machine/endian.h> @@ -223,6 +221,9 @@ struct scb_platform_data { #define ahc_le64toh(x) (x) #endif +/************************** Timer DataStructures ******************************/ +typedef struct callout ahc_timer_t; + /***************************** Core Includes **********************************/ #if AHC_REG_PRETTY_PRINT #define AIC_DEBUG_REGISTERS 1 @@ -231,6 +232,29 @@ struct scb_platform_data { #endif #include <dev/aic7xxx/aic7xxx.h> +/***************************** Timer Facilities *******************************/ +timeout_t ahc_timeout; + +#if __FreeBSD_version >= 500000 +#define ahc_timer_init(timer) callout_init(timer, /*mpsafe*/0) +#else +#define ahc_timer_init callout_init +#endif +#define ahc_timer_stop callout_stop + +static __inline void +ahc_timer_reset(ahc_timer_t *timer, u_int usec, ahc_callback_t *func, void *arg) +{ + callout_reset(timer, (usec * hz)/1000000, func, arg); +} + +static __inline void +ahc_scb_timer_reset(struct scb *scb, u_int usec) +{ + callout_reset(scb->io_ctx->ccb_h.timeout_ch.callout, + (usec * hz)/1000000, ahc_timeout, scb); +} + /*************************** Device Access ************************************/ #define ahc_inb(ahc, port) \ bus_space_read_1((ahc)->tag, (ahc)->bsh, port) @@ -557,7 +581,6 @@ ahc_platform_flushwork(struct ahc_softc *ahc) } /************************ Misc Function Declarations **************************/ -timeout_t ahc_timeout; void ahc_done(struct ahc_softc *ahc, struct scb *scb); void ahc_send_async(struct ahc_softc *, char /*channel*/, u_int /*target*/, u_int /*lun*/, ac_code, void *arg); |