1/* $NetBSD: pdqvar.h,v 1.27 2000/05/03 19:17:54 thorpej Exp $ */ 2 3/*- 4 * Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 10 unchanged lines hidden (view full) --- 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * 26 * Id: pdqvar.h,v 1.21 1997/03/21 21:16:04 thomas Exp |
27 * $FreeBSD: head/sys/dev/pdq/pdq_freebsd.h 109623 2003-01-21 08:56:16Z alfred $ |
28 * 29 */ 30 31/* 32 * DEC PDQ FDDI Controller; PDQ O/S dependent definitions 33 * 34 * Written by Matt Thomas 35 * --- 145 unchanged lines hidden (view full) --- 181#define PDQ_OS_DATABUF_LEN(b) ((b)->m_len) 182#define PDQ_OS_DATABUF_LEN_SET(b, n) ((b)->m_len = (n)) 183/* #define PDQ_OS_DATABUF_LEN_ADJ(b, n) ((b)->m_len += (n)) */ 184#define PDQ_OS_DATABUF_PTR(b) (mtod((b), pdq_uint8_t *)) 185#define PDQ_OS_DATABUF_ADJ(b, n) ((b)->m_data += (n), (b)->m_len -= (n)) 186 187#define PDQ_OS_DATABUF_ALLOC(pdq, b) do { \ 188 PDQ_OS_DATABUF_T *x_m0; \ |
189 MGETHDR(x_m0, M_NOWAIT, MT_DATA); \ |
190 if (x_m0 != NULL) { \ |
191 MCLGET(x_m0, M_NOWAIT); \ |
192 if ((x_m0->m_flags & M_EXT) == 0) { \ 193 m_free(x_m0); \ 194 (b) = NULL; \ 195 } else { \ 196 (b) = x_m0; \ 197 x_m0->m_len = PDQ_OS_DATABUF_SIZE; \ 198 } \ 199 } else { \ --- 72 unchanged lines hidden --- |