mi.h revision 0f1702c5201310f0529cd5abb77652e5e9b241b6
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1990 Mentat Inc. */
#ifndef _INET_MI_H
#define _INET_MI_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#define MI_COPY_IN 1
#define MI_COPY_OUT 2
#ifdef __lint
/* Lint complains about %p with field width specifiers. */
#define MI_COL_PTRFMT_STR "%p "
#define MI_COL_HDRPAD_STR ""
#else
#ifdef _ILP32
#if defined(__GNUC__)
#define MI_COL_PTRFMT_STR "%8p "
#else
#define MI_COL_PTRFMT_STR "%08p "
#endif /* __GNUC__ */
#define MI_COL_HDRPAD_STR ""
#else
#define MI_COL_PTRFMT_STR "%16p "
#define MI_COL_HDRPAD_STR " "
#endif
#endif
/*
* Double linked list of type MI_O with a mi_head_t as the head.
* Used for mi_open_comm etc.
*/
typedef struct mi_o_s {
/*
* List head for MI_O doubly linked list.
* The list contains unsorted driver, module and detached instances.
*
* Minor numbers are allocated from mh_arena which initially contains
* [MI_MIN_DEV, mh_maxminor] numbers. When this arena is fully allocated, it is
* extended to MAXMIN32.
*
* The module_dev is used to give almost unique numbers to module instances.
* This is only needed for mi_strlog which uses the mi_o_dev field when
* logging messages.
*/
typedef struct mi_head_s {
int mh_module_dev; /* Wraparound number for use when MODOPEN */
} mi_head_t;
/*PRINTFLIKE2*/
__KPRINTFLIKE(2);
/*PRINTFLIKE2*/
__KPRINTFLIKE(2);
/*PRINTFLIKE2*/
__KPRINTFLIKE(2);
/*PRINTFLIKE4*/
#pragma rarely_called(mi_strlog)
extern void mi_timer_stop(mblk_t *);
extern MBLKP mi_tpi_ordrel_ind(void);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _INET_MI_H */