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/dev/ic/daicvar.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /* $NetBSD: daicvar.h,v 1.10 2008/04/28 20:23:49 martin Exp $ */
    2 
    3 /*-
    4  * Copyright (c) 2002 The NetBSD Foundation, Inc.
    5  * All rights reserved.
    6  *
    7  * This code is derived from software contributed to The NetBSD Foundation
    8  * by Martin Husemann <martin@NetBSD.org>.
    9  *
   10  * Redistribution and use in source and binary forms, with or without
   11  * modification, are permitted provided that the following conditions
   12  * are met:
   13  * 1. Redistributions of source code must retain the above copyright
   14  *    notice, this list of conditions and the following disclaimer.
   15  * 2. Redistributions in binary form must reproduce the above copyright
   16  *    notice, this list of conditions and the following disclaimer in the
   17  *    documentation and/or other materials provided with the distribution.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   29  * POSSIBILITY OF SUCH DAMAGE.
   30  */
   31 
   32 #ifndef DIEHLISDNVAR
   33 #define DIEHLISDNVAR
   34 #if defined(KERNEL) || defined(_KERNEL)
   35 
   36 #define DAIC_MAX_PORT           4
   37 #define DAIC_ISA_MEMSIZE        2048
   38 #define DAIC_ISA_QUADSIZE       (DAIC_MAX_PORT*DAIC_ISA_MEMSIZE)
   39 #define DAIC_MAX_ACTIVE         (2*DAIC_MAX_PORT)       /* simlutaneous connections on one instance */
   40 
   41 /* A queue of pending outgoing calls */
   42 struct outcallentry {
   43         TAILQ_ENTRY(outcallentry) queue;
   44         unsigned int cdid;      /* call descriptor id for layer 4 */
   45         u_int8_t dchan_id;      /* task id for microcode */
   46         u_int8_t rc;            /* return code */
   47 };
   48 
   49 /* One active connection */
   50 struct daic_connection {
   51         u_int cdid;                     /* layer 4 call descriptor id */
   52         struct ifqueue tx_queue;        /* outgoing data */
   53         struct ifqueue rx_queue;        /* incoming data */
   54         isdn_link_t isdn_linktab;       /* description of ourself */
   55         const struct isdn_l4_driver_functions
   56                         *l4_driver;             /* layer 4 driver               */
   57         void            *l4_driver_softc;       /* layer 4 driver instance      */
   58         u_int8_t dchan_inst;            /* d-channel instance */
   59         u_int8_t dchan_rc;              /* return code for dchannel requests */
   60         u_int8_t bchan_inst;            /* b-channel instance */
   61         u_int8_t bchan_rc;              /* return code for bchannel requests */
   62 };
   63 
   64 /*
   65  * One BRI as exposed to the upper layers, with all the internal management
   66  * information we need for it. A pointer to this is passed as the driver
   67  * token.
   68  */
   69 struct daic_unit {
   70         struct daic_softc *du_sc;       /* pointer to softc */
   71         const struct isdn_l3_driver *du_l3;
   72         int du_port;                    /* port number (on multi BRI cards) */
   73         int du_state;                   /* state of board, see below */
   74 #define DAIC_STATE_COLD         0       /* nothing happened to the board */
   75 #define DAIC_STATE_DOWNLOAD     1       /* the card is waiting for protocol code */
   76 #define DAIC_STATE_TESTING      2       /* waiting for first interrupt from card */
   77 #define DAIC_STATE_RUNNING      3       /* the protocol is running */
   78 #define DAIC_STATE_DIAGNOSTIC   4       /* temporary disabled for diagnostics */
   79 
   80         int du_assign;                  /* allocate new protocol instance */
   81 #define DAIC_ASSIGN_PENDING     1       /* we are awaiting a new ID */
   82 #define DAIC_ASSIGN_SLEEPING    2       /* somebody sleeping, wakeup after we got the ID */
   83 #define DAIC_ASSIGN_GLOBAL      4       /* result is a global d-channel id */
   84 #define DAIC_ASSIGN_NOGLOBAL    8       /* need to assign a global d-channel id */
   85 
   86         u_int8_t du_global_dchan;       /* handle of global dchannel instance */
   87         u_int8_t du_request_res;        /* result of requests */
   88         u_int8_t du_assign_res;         /* result of assigns */
   89 };
   90 
   91 /* superclass of all softc structs for attachments, you should
   92  * always be able to cast an attachments struct device *self to this. */
   93 struct daic_softc {
   94         struct device sc_dev;
   95         bus_space_tag_t sc_iot;         /* bus identifier */
   96         bus_space_handle_t sc_ioh;      /* mem handle */
   97         int sc_cardtype;                /* variant of card */
   98 #define DAIC_TYPE_S     0
   99 #define DAIC_TYPE_SX    1
  100 #define DAIC_TYPE_SCOM  2
  101 #define DAIC_TYPE_QUAD  3
  102 
  103         struct daic_unit sc_port[DAIC_MAX_PORT];
  104 
  105         /* one record for each b-channel we could handle concurrently */
  106         struct daic_connection sc_con[DAIC_MAX_ACTIVE];
  107 
  108         /* a tailq of ougoing calls no yet assigned to any b-channel */
  109         TAILQ_HEAD(outcallhead, outcallentry) sc_outcalls[DAIC_MAX_PORT];
  110 };
  111 
  112 /*
  113  * functions exported from MI part
  114  */
  115 extern int daic_probe(bus_space_tag_t bus, bus_space_handle_t io);
  116 extern void daic_attach(struct device *self, struct daic_softc *sc);
  117 extern int daic_intr(struct daic_softc *);
  118 
  119 #endif
  120 #endif

Cache object: c213b45e6abca338a2004a2eef0d13b5


[ 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.