^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Inline routines shareable across OS platforms.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (c) 1994-2001 Justin T. Gibbs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2000-2001 Adaptec Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * 1. Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * notice, this list of conditions, and the following disclaimer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * without modification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * 2. Redistributions in binary form must reproduce at minimum a disclaimer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * substantially similar to the "NO WARRANTY" disclaimer below
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * ("Disclaimer") and any redistribution must be conditioned upon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * including a substantially similar Disclaimer requirement for further
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * binary redistribution.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * 3. Neither the names of the above-listed copyright holders nor the names
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * of any contributors may be used to endorse or promote products derived
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * from this software without specific prior written permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * Alternatively, this software may be distributed under the terms of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * GNU General Public License ("GPL") version 2 as published by the Free
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * NO WARRANTY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * POSSIBILITY OF SUCH DAMAGES.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_inline.h#43 $
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * $FreeBSD$
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #ifndef _AIC7XXX_INLINE_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define _AIC7XXX_INLINE_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) /************************* Sequencer Execution Control ************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) int ahc_is_paused(struct ahc_softc *ahc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) void ahc_pause(struct ahc_softc *ahc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) void ahc_unpause(struct ahc_softc *ahc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /************************** Memory mapping routines ***************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) void ahc_sync_sglist(struct ahc_softc *ahc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct scb *scb, int op);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) /******************************** Debugging ***********************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) static inline char *ahc_name(struct ahc_softc *ahc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) static inline char *ahc_name(struct ahc_softc *ahc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) return (ahc->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /*********************** Miscellaneous Support Functions ***********************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) struct ahc_initiator_tinfo *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ahc_fetch_transinfo(struct ahc_softc *ahc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) char channel, u_int our_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) u_int remote_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) struct ahc_tmode_tstate **tstate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) uint16_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) ahc_inw(struct ahc_softc *ahc, u_int port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) void ahc_outw(struct ahc_softc *ahc, u_int port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) u_int value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) uint32_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) ahc_inl(struct ahc_softc *ahc, u_int port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) void ahc_outl(struct ahc_softc *ahc, u_int port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) uint32_t value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) uint64_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ahc_inq(struct ahc_softc *ahc, u_int port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) void ahc_outq(struct ahc_softc *ahc, u_int port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) uint64_t value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) struct scb*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) ahc_get_scb(struct ahc_softc *ahc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) struct scb *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) ahc_lookup_scb(struct ahc_softc *ahc, u_int tag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) struct scsi_sense_data *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) ahc_get_sense_buf(struct ahc_softc *ahc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) struct scb *scb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) /************************** Interrupt Processing ******************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) int ahc_intr(struct ahc_softc *ahc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) #endif /* _AIC7XXX_INLINE_H_ */