The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netisdn/i4b_global.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer.
    9  * 2. Redistributions in binary form must reproduce the above copyright
   10  *    notice, this list of conditions and the following disclaimer in the
   11  *    documentation and/or other materials provided with the distribution.
   12  *
   13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   23  * SUCH DAMAGE.
   24  *
   25  *---------------------------------------------------------------------------
   26  *
   27  *      i4b_global.h - i4b global include file
   28  *      --------------------------------------
   29  *
   30  *      $Id: i4b_global.h,v 1.8 2007/10/14 23:44:49 martin Exp $
   31  *
   32  * $FreeBSD$
   33  *
   34  *      last edit-date: [Thu Aug 24 12:38:50 2000]
   35  *
   36  *---------------------------------------------------------------------------*/
   37 
   38 #ifndef _NETISDN_I4B_GLOBAL_H_
   39 #define _NETISDN_I4B_GLOBAL_H_
   40 
   41 /*---------------------------------------------------------------------------*
   42  *      hiding OS differences in the kernel
   43  *---------------------------------------------------------------------------*/
   44 
   45 /*---------------*/
   46 /* time handling */
   47 /*---------------*/
   48 
   49 #ifdef __FreeBSD__
   50 #include <sys/param.h>
   51 
   52 #if defined(__FreeBSD_version) && __FreeBSD_version >= 400000 && __FreeBSD_version < 400011
   53 #error "Unsupported FreeBSD-current version,"
   54 #error "you need a FreeBSD-current >= 400011"
   55 #endif
   56 
   57 #if defined(__FreeBSD_version) && __FreeBSD_version >= 300001
   58 
   59 #define TIMEOUT_FUNC_T  timeout_t *
   60 #define SECOND          time_second
   61 #define MICROTIME(x)    getmicrotime(&(x))
   62 
   63 #else /* FreeBSD < 3 */
   64 
   65 #define TIMEOUT_FUNC_T  timeout_func_t
   66 #define SECOND          time.tv_sec
   67 #define MICROTIME(x)    microtime(&(x))
   68 
   69 #endif /* >= 3 */
   70 #endif /* __FreeBSD__ */
   71 
   72 #if defined(__NetBSD__) /* after timecounter merge */
   73 
   74 #define TIMEOUT_FUNC_T  void *
   75 #define SECOND          time_uptime
   76 #define MICROTIME(x)    getmicrotime(&(x))
   77 
   78 #endif /* __NetBSD__ */
   79 
   80 #if defined (__OpenBSD__) || defined(__bsdi__)
   81 
   82 #define TIMEOUT_FUNC_T  void *
   83 #define SECOND          time.tv_sec
   84 #define MICROTIME(x)    microtime(&(x))
   85 
   86 #endif /* __OpenBSD__ */
   87 
   88 /*----------------*/
   89 /* timer handling */
   90 /*----------------*/
   91 
   92 #if defined(__NetBSD__)
   93 
   94 #if __NetBSD_Version__ >= 104230000
   95 #define START_TIMER(XHANDLE, XF, XSC, XTIME) callout_reset(&XHANDLE, XTIME, (TIMEOUT_FUNC_T)XF, (void*)XSC)
   96 #define STOP_TIMER(XHANDLE, XF, XSC) callout_stop(&XHANDLE)
   97 #else
   98 #define START_TIMER(XHANDLE, XF, XSC, XTIME) timeout((TIMEOUT_FUNC_T)XF, (void*)XSC, XTIME)
   99 #define STOP_TIMER(XHANDLE, XF, XSC)    untimeout((TIMEOUT_FUNC_T)XF, (void*)XSC)
  100 #endif
  101 
  102 #else
  103 #define START_TIMER(XHANDLE, XF, XSC, XTIME) XHANDLE = timeout((TIMEOUT_FUNC_T)XF, (void*)XSC, XTIME)
  104 #ifdef __FreeBSD__
  105 #define STOP_TIMER(XHANDLE, XF, XSC)    untimeout((TIMEOUT_FUNC_T)XF, (void*)XSC, XHANDLE)
  106 #else
  107 #define STOP_TIMER(XHANDLE, XF, XSC)    untimeout((TIMEOUT_FUNC_T)XF, (void*)XSC)
  108 #endif
  109 #endif
  110 
  111 /*----------------------*/
  112 /* poll/select handling */
  113 /*----------------------*/
  114 
  115 #if (defined(__FreeBSD__) && \
  116         (!defined(__FreeBSD_version) || (__FreeBSD_version < 300001))) \
  117                 || defined (__OpenBSD__) || defined(__bsdi__)
  118 #define OS_USES_SELECT
  119 #else
  120 #define OS_USES_POLL
  121 #endif
  122 
  123 /*---------------------------------------------------------------------------*
  124  *      misc globally used things in the kernel
  125  *---------------------------------------------------------------------------*/
  126 
  127 /* timer states */
  128 
  129 #define TIMER_IDLE      1               /* a timer is running   */
  130 #define TIMER_ACTIVE    2               /* a timer is idle      */
  131 
  132 /* definitions for the STATUS indications L1 -> L2 -> L3 */
  133 
  134 #define STI_ATTACH      0       /* attach at boot time                  */
  135 #define STI_L1STAT      1       /* layer 1 status                       */
  136 #define STI_L2STAT      2       /* layer 2 status                       */
  137 #define STI_TEIASG      3       /* TEI assignments                      */
  138 #define STI_PDEACT      4       /* Layer 1 T4 expired = persistent deactivation */
  139 #define STI_NOL1ACC     5       /* no outgoing L1 access possible       */
  140 
  141 /* definitions for the COMMAND requests L3 -> L2 -> L1 */
  142 
  143 #define CMR_DOPEN       0       /* daemon opened /dev/i4b               */
  144 #define CMR_DCLOSE      1       /* daemon closed /dev/i4b               */
  145 #define CMR_SETTRACE    2       /* set D-channel and B-channel trace    */
  146 #define CMR_GCST        3       /* get chipset statistics               */
  147 #define CMR_CCST        4       /* clear chipset statistics             */
  148 #define CMR_SETLEDS     5       /* set LEDs (if available)              */
  149 
  150 /* param for CMR_SETLEDS: */
  151 #define CMRLEDS_TEI     1       /* this controller has a TEI */
  152 #define CMRLEDS_B0      2       /* first B channel is in use */
  153 #define CMRLEDS_B0_IN   4       /* first B channel handles an incoming call */
  154 #define CMRLEDS_B1      8       /* second B channel is in use */
  155 #define CMRLEDS_B1_IN   16      /* second B channel handles an incoming call */
  156 
  157 #endif /* !_NETISDN_I4B_GLOBAL_H_ */

Cache object: fbce988e2b50147e8690f0451d1c3986


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.