18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Inline routines shareable across OS platforms.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (c) 1994-2001 Justin T. Gibbs.
58c2ecf20Sopenharmony_ci * Copyright (c) 2000-2001 Adaptec Inc.
68c2ecf20Sopenharmony_ci * All rights reserved.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
98c2ecf20Sopenharmony_ci * modification, are permitted provided that the following conditions
108c2ecf20Sopenharmony_ci * are met:
118c2ecf20Sopenharmony_ci * 1. Redistributions of source code must retain the above copyright
128c2ecf20Sopenharmony_ci *    notice, this list of conditions, and the following disclaimer,
138c2ecf20Sopenharmony_ci *    without modification.
148c2ecf20Sopenharmony_ci * 2. Redistributions in binary form must reproduce at minimum a disclaimer
158c2ecf20Sopenharmony_ci *    substantially similar to the "NO WARRANTY" disclaimer below
168c2ecf20Sopenharmony_ci *    ("Disclaimer") and any redistribution must be conditioned upon
178c2ecf20Sopenharmony_ci *    including a substantially similar Disclaimer requirement for further
188c2ecf20Sopenharmony_ci *    binary redistribution.
198c2ecf20Sopenharmony_ci * 3. Neither the names of the above-listed copyright holders nor the names
208c2ecf20Sopenharmony_ci *    of any contributors may be used to endorse or promote products derived
218c2ecf20Sopenharmony_ci *    from this software without specific prior written permission.
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci * Alternatively, this software may be distributed under the terms of the
248c2ecf20Sopenharmony_ci * GNU General Public License ("GPL") version 2 as published by the Free
258c2ecf20Sopenharmony_ci * Software Foundation.
268c2ecf20Sopenharmony_ci *
278c2ecf20Sopenharmony_ci * NO WARRANTY
288c2ecf20Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
298c2ecf20Sopenharmony_ci * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
308c2ecf20Sopenharmony_ci * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
318c2ecf20Sopenharmony_ci * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
328c2ecf20Sopenharmony_ci * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
338c2ecf20Sopenharmony_ci * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
348c2ecf20Sopenharmony_ci * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
358c2ecf20Sopenharmony_ci * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
368c2ecf20Sopenharmony_ci * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
378c2ecf20Sopenharmony_ci * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
388c2ecf20Sopenharmony_ci * POSSIBILITY OF SUCH DAMAGES.
398c2ecf20Sopenharmony_ci *
408c2ecf20Sopenharmony_ci * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_inline.h#43 $
418c2ecf20Sopenharmony_ci *
428c2ecf20Sopenharmony_ci * $FreeBSD$
438c2ecf20Sopenharmony_ci */
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#ifndef _AIC7XXX_INLINE_H_
468c2ecf20Sopenharmony_ci#define _AIC7XXX_INLINE_H_
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/************************* Sequencer Execution Control ************************/
498c2ecf20Sopenharmony_ciint  ahc_is_paused(struct ahc_softc *ahc);
508c2ecf20Sopenharmony_civoid ahc_pause(struct ahc_softc *ahc);
518c2ecf20Sopenharmony_civoid ahc_unpause(struct ahc_softc *ahc);
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci/************************** Memory mapping routines ***************************/
548c2ecf20Sopenharmony_civoid	ahc_sync_sglist(struct ahc_softc *ahc,
558c2ecf20Sopenharmony_ci			struct scb *scb, int op);
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci/******************************** Debugging ***********************************/
588c2ecf20Sopenharmony_cistatic inline char *ahc_name(struct ahc_softc *ahc);
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_cistatic inline char *ahc_name(struct ahc_softc *ahc)
618c2ecf20Sopenharmony_ci{
628c2ecf20Sopenharmony_ci	return (ahc->name);
638c2ecf20Sopenharmony_ci}
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci/*********************** Miscellaneous Support Functions ***********************/
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_cistruct ahc_initiator_tinfo *
688c2ecf20Sopenharmony_ci	ahc_fetch_transinfo(struct ahc_softc *ahc,
698c2ecf20Sopenharmony_ci			    char channel, u_int our_id,
708c2ecf20Sopenharmony_ci			    u_int remote_id,
718c2ecf20Sopenharmony_ci			    struct ahc_tmode_tstate **tstate);
728c2ecf20Sopenharmony_ciuint16_t
738c2ecf20Sopenharmony_ci	ahc_inw(struct ahc_softc *ahc, u_int port);
748c2ecf20Sopenharmony_civoid	ahc_outw(struct ahc_softc *ahc, u_int port,
758c2ecf20Sopenharmony_ci		 u_int value);
768c2ecf20Sopenharmony_ciuint32_t
778c2ecf20Sopenharmony_ci	ahc_inl(struct ahc_softc *ahc, u_int port);
788c2ecf20Sopenharmony_civoid	ahc_outl(struct ahc_softc *ahc, u_int port,
798c2ecf20Sopenharmony_ci		 uint32_t value);
808c2ecf20Sopenharmony_ciuint64_t
818c2ecf20Sopenharmony_ci	ahc_inq(struct ahc_softc *ahc, u_int port);
828c2ecf20Sopenharmony_civoid	ahc_outq(struct ahc_softc *ahc, u_int port,
838c2ecf20Sopenharmony_ci		 uint64_t value);
848c2ecf20Sopenharmony_cistruct scb*
858c2ecf20Sopenharmony_ci	ahc_get_scb(struct ahc_softc *ahc);
868c2ecf20Sopenharmony_civoid	ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
878c2ecf20Sopenharmony_cistruct scb *
888c2ecf20Sopenharmony_ci	ahc_lookup_scb(struct ahc_softc *ahc, u_int tag);
898c2ecf20Sopenharmony_civoid	ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
908c2ecf20Sopenharmony_cistruct scsi_sense_data *
918c2ecf20Sopenharmony_ci	ahc_get_sense_buf(struct ahc_softc *ahc,
928c2ecf20Sopenharmony_ci			  struct scb *scb);
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci/************************** Interrupt Processing ******************************/
958c2ecf20Sopenharmony_ciint	ahc_intr(struct ahc_softc *ahc);
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#endif  /* _AIC7XXX_INLINE_H_ */
98