1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-01 12:19:28 +00:00

Use the new ahc_scb_timer_reset API

Remove AHC_ALLOW_MEMIO

Approved by:	re (blanket)
This commit is contained in:
Scott Long 2002-11-30 19:06:24 +00:00
parent 31574422a3
commit 3cb8be933d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107416

View File

@ -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);