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