aic7xxx_inline.h (102678) | aic7xxx_inline.h (109590) |
---|---|
1/* 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 --- 23 unchanged lines hidden (view full) --- 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 * | 1/* 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 --- 23 unchanged lines hidden (view full) --- 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#38 $ | 40 * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_inline.h#39 $ |
41 * | 41 * |
42 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx_inline.h 102678 2002-08-31 06:46:37Z gibbs $ | 42 * $FreeBSD: head/sys/dev/aic7xxx/aic7xxx_inline.h 109590 2003-01-20 20:44:55Z gibbs $ |
43 */ 44 45#ifndef _AIC7XXX_INLINE_H_ 46#define _AIC7XXX_INLINE_H_ 47 48/************************* Sequencer Execution Control ************************/ 49static __inline void ahc_pause_bug_fix(struct ahc_softc *ahc); 50static __inline int ahc_is_paused(struct ahc_softc *ahc); --- 182 unchanged lines hidden (view full) --- 233 234static __inline void ahc_update_residual(struct ahc_softc *ahc, 235 struct scb *scb); 236static __inline struct ahc_initiator_tinfo * 237 ahc_fetch_transinfo(struct ahc_softc *ahc, 238 char channel, u_int our_id, 239 u_int remote_id, 240 struct ahc_tmode_tstate **tstate); | 43 */ 44 45#ifndef _AIC7XXX_INLINE_H_ 46#define _AIC7XXX_INLINE_H_ 47 48/************************* Sequencer Execution Control ************************/ 49static __inline void ahc_pause_bug_fix(struct ahc_softc *ahc); 50static __inline int ahc_is_paused(struct ahc_softc *ahc); --- 182 unchanged lines hidden (view full) --- 233 234static __inline void ahc_update_residual(struct ahc_softc *ahc, 235 struct scb *scb); 236static __inline struct ahc_initiator_tinfo * 237 ahc_fetch_transinfo(struct ahc_softc *ahc, 238 char channel, u_int our_id, 239 u_int remote_id, 240 struct ahc_tmode_tstate **tstate); |
241static __inline uint16_t 242 ahc_inw(struct ahc_softc *ahc, u_int port); 243static __inline void ahc_outw(struct ahc_softc *ahc, u_int port, 244 u_int value); 245static __inline uint32_t 246 ahc_inl(struct ahc_softc *ahc, u_int port); 247static __inline void ahc_outl(struct ahc_softc *ahc, u_int port, 248 uint32_t value); 249static __inline uint64_t 250 ahc_inq(struct ahc_softc *ahc, u_int port); 251static __inline void ahc_outq(struct ahc_softc *ahc, u_int port, 252 uint64_t value); |
|
241static __inline struct scb* 242 ahc_get_scb(struct ahc_softc *ahc); 243static __inline void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb); 244static __inline void ahc_swap_with_next_hscb(struct ahc_softc *ahc, 245 struct scb *scb); 246static __inline void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb); 247static __inline struct scsi_sense_data * 248 ahc_get_sense_buf(struct ahc_softc *ahc, --- 31 unchanged lines hidden (view full) --- 280 * when the roles are reversed, we pretend we are the target. 281 */ 282 if (channel == 'B') 283 our_id += 8; 284 *tstate = ahc->enabled_targets[our_id]; 285 return (&(*tstate)->transinfo[remote_id]); 286} 287 | 253static __inline struct scb* 254 ahc_get_scb(struct ahc_softc *ahc); 255static __inline void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb); 256static __inline void ahc_swap_with_next_hscb(struct ahc_softc *ahc, 257 struct scb *scb); 258static __inline void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb); 259static __inline struct scsi_sense_data * 260 ahc_get_sense_buf(struct ahc_softc *ahc, --- 31 unchanged lines hidden (view full) --- 292 * when the roles are reversed, we pretend we are the target. 293 */ 294 if (channel == 'B') 295 our_id += 8; 296 *tstate = ahc->enabled_targets[our_id]; 297 return (&(*tstate)->transinfo[remote_id]); 298} 299 |
300static __inline uint16_t 301ahc_inw(struct ahc_softc *ahc, u_int port) 302{ 303 return ((ahc_inb(ahc, port+1) << 8) | ahc_inb(ahc, port)); 304} 305 306static __inline void 307ahc_outw(struct ahc_softc *ahc, u_int port, u_int value) 308{ 309 ahc_outb(ahc, port, value & 0xFF); 310 ahc_outb(ahc, port+1, (value >> 8) & 0xFF); 311} 312 313static __inline uint32_t 314ahc_inl(struct ahc_softc *ahc, u_int port) 315{ 316 return ((ahc_inb(ahc, port)) 317 | (ahc_inb(ahc, port+1) << 8) 318 | (ahc_inb(ahc, port+2) << 16) 319 | (ahc_inb(ahc, port+3) << 24)); 320} 321 322static __inline void 323ahc_outl(struct ahc_softc *ahc, u_int port, uint32_t value) 324{ 325 ahc_outb(ahc, port, (value) & 0xFF); 326 ahc_outb(ahc, port+1, ((value) >> 8) & 0xFF); 327 ahc_outb(ahc, port+2, ((value) >> 16) & 0xFF); 328 ahc_outb(ahc, port+3, ((value) >> 24) & 0xFF); 329} 330 331static __inline uint64_t 332ahc_inq(struct ahc_softc *ahc, u_int port) 333{ 334 return ((ahc_inb(ahc, port)) 335 | (ahc_inb(ahc, port+1) << 8) 336 | (ahc_inb(ahc, port+2) << 16) 337 | (ahc_inb(ahc, port+3) << 24) 338 | (((uint64_t)ahc_inb(ahc, port+4)) << 32) 339 | (((uint64_t)ahc_inb(ahc, port+5)) << 40) 340 | (((uint64_t)ahc_inb(ahc, port+6)) << 48) 341 | (((uint64_t)ahc_inb(ahc, port+7)) << 56)); 342} 343 344static __inline void 345ahc_outq(struct ahc_softc *ahc, u_int port, uint64_t value) 346{ 347 ahc_outb(ahc, port, value & 0xFF); 348 ahc_outb(ahc, port+1, (value >> 8) & 0xFF); 349 ahc_outb(ahc, port+2, (value >> 16) & 0xFF); 350 ahc_outb(ahc, port+3, (value >> 24) & 0xFF); 351 ahc_outb(ahc, port+4, (value >> 32) & 0xFF); 352 ahc_outb(ahc, port+5, (value >> 40) & 0xFF); 353 ahc_outb(ahc, port+6, (value >> 48) & 0xFF); 354 ahc_outb(ahc, port+7, (value >> 56) & 0xFF); 355} 356 |
|
288/* 289 * Get a free scb. If there are none, see if we can allocate a new SCB. 290 */ 291static __inline struct scb * 292ahc_get_scb(struct ahc_softc *ahc) 293{ 294 struct scb *scb; 295 --- 277 unchanged lines hidden --- | 357/* 358 * Get a free scb. If there are none, see if we can allocate a new SCB. 359 */ 360static __inline struct scb * 361ahc_get_scb(struct ahc_softc *ahc) 362{ 363 struct scb *scb; 364 --- 277 unchanged lines hidden --- |