162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Inline routines shareable across OS platforms.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (c) 1994-2001 Justin T. Gibbs.
562306a36Sopenharmony_ci * Copyright (c) 2000-2001 Adaptec Inc.
662306a36Sopenharmony_ci * All rights reserved.
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
962306a36Sopenharmony_ci * modification, are permitted provided that the following conditions
1062306a36Sopenharmony_ci * are met:
1162306a36Sopenharmony_ci * 1. Redistributions of source code must retain the above copyright
1262306a36Sopenharmony_ci *    notice, this list of conditions, and the following disclaimer,
1362306a36Sopenharmony_ci *    without modification.
1462306a36Sopenharmony_ci * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1562306a36Sopenharmony_ci *    substantially similar to the "NO WARRANTY" disclaimer below
1662306a36Sopenharmony_ci *    ("Disclaimer") and any redistribution must be conditioned upon
1762306a36Sopenharmony_ci *    including a substantially similar Disclaimer requirement for further
1862306a36Sopenharmony_ci *    binary redistribution.
1962306a36Sopenharmony_ci * 3. Neither the names of the above-listed copyright holders nor the names
2062306a36Sopenharmony_ci *    of any contributors may be used to endorse or promote products derived
2162306a36Sopenharmony_ci *    from this software without specific prior written permission.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * Alternatively, this software may be distributed under the terms of the
2462306a36Sopenharmony_ci * GNU General Public License ("GPL") version 2 as published by the Free
2562306a36Sopenharmony_ci * Software Foundation.
2662306a36Sopenharmony_ci *
2762306a36Sopenharmony_ci * NO WARRANTY
2862306a36Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2962306a36Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3062306a36Sopenharmony_ci * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
3162306a36Sopenharmony_ci * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3262306a36Sopenharmony_ci * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3362306a36Sopenharmony_ci * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3462306a36Sopenharmony_ci * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3562306a36Sopenharmony_ci * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3662306a36Sopenharmony_ci * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
3762306a36Sopenharmony_ci * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3862306a36Sopenharmony_ci * POSSIBILITY OF SUCH DAMAGES.
3962306a36Sopenharmony_ci *
4062306a36Sopenharmony_ci * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_inline.h#43 $
4162306a36Sopenharmony_ci *
4262306a36Sopenharmony_ci * $FreeBSD$
4362306a36Sopenharmony_ci */
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#ifndef _AIC7XXX_INLINE_H_
4662306a36Sopenharmony_ci#define _AIC7XXX_INLINE_H_
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/************************* Sequencer Execution Control ************************/
4962306a36Sopenharmony_ciint  ahc_is_paused(struct ahc_softc *ahc);
5062306a36Sopenharmony_civoid ahc_pause(struct ahc_softc *ahc);
5162306a36Sopenharmony_civoid ahc_unpause(struct ahc_softc *ahc);
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci/************************** Memory mapping routines ***************************/
5462306a36Sopenharmony_civoid	ahc_sync_sglist(struct ahc_softc *ahc,
5562306a36Sopenharmony_ci			struct scb *scb, int op);
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci/******************************** Debugging ***********************************/
5862306a36Sopenharmony_cistatic inline char *ahc_name(struct ahc_softc *ahc);
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_cistatic inline char *ahc_name(struct ahc_softc *ahc)
6162306a36Sopenharmony_ci{
6262306a36Sopenharmony_ci	return (ahc->name);
6362306a36Sopenharmony_ci}
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci/*********************** Miscellaneous Support Functions ***********************/
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_cistruct ahc_initiator_tinfo *
6862306a36Sopenharmony_ci	ahc_fetch_transinfo(struct ahc_softc *ahc,
6962306a36Sopenharmony_ci			    char channel, u_int our_id,
7062306a36Sopenharmony_ci			    u_int remote_id,
7162306a36Sopenharmony_ci			    struct ahc_tmode_tstate **tstate);
7262306a36Sopenharmony_ciuint16_t
7362306a36Sopenharmony_ci	ahc_inw(struct ahc_softc *ahc, u_int port);
7462306a36Sopenharmony_civoid	ahc_outw(struct ahc_softc *ahc, u_int port,
7562306a36Sopenharmony_ci		 u_int value);
7662306a36Sopenharmony_ciuint32_t
7762306a36Sopenharmony_ci	ahc_inl(struct ahc_softc *ahc, u_int port);
7862306a36Sopenharmony_civoid	ahc_outl(struct ahc_softc *ahc, u_int port,
7962306a36Sopenharmony_ci		 uint32_t value);
8062306a36Sopenharmony_ciuint64_t
8162306a36Sopenharmony_ci	ahc_inq(struct ahc_softc *ahc, u_int port);
8262306a36Sopenharmony_civoid	ahc_outq(struct ahc_softc *ahc, u_int port,
8362306a36Sopenharmony_ci		 uint64_t value);
8462306a36Sopenharmony_cistruct scb*
8562306a36Sopenharmony_ci	ahc_get_scb(struct ahc_softc *ahc);
8662306a36Sopenharmony_civoid	ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
8762306a36Sopenharmony_cistruct scb *
8862306a36Sopenharmony_ci	ahc_lookup_scb(struct ahc_softc *ahc, u_int tag);
8962306a36Sopenharmony_civoid	ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
9062306a36Sopenharmony_cistruct scsi_sense_data *
9162306a36Sopenharmony_ci	ahc_get_sense_buf(struct ahc_softc *ahc,
9262306a36Sopenharmony_ci			  struct scb *scb);
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci/************************** Interrupt Processing ******************************/
9562306a36Sopenharmony_ciint	ahc_intr(struct ahc_softc *ahc);
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci#endif  /* _AIC7XXX_INLINE_H_ */
98