2 * Copyright (c) 1999, 2000 Dave Boyce. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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
25 *---------------------------------------------------------------------------
27 * i4b_iwic - isdn4bsd Winbond W6692 driver
28 * ----------------------------------------
30 * $FreeBSD: src/sys/i4b/layer1/iwic/i4b_iwic_l1if.c,v 1.5.2.1 2001/08/10 14:08:40 obrien Exp $
31 * $DragonFly: src/sys/net/i4b/layer1/iwic/i4b_iwic_l1if.c,v 1.3 2003/08/07 21:17:28 dillon Exp $
33 * last edit-date: [Sun Jan 21 11:09:33 2001]
35 *---------------------------------------------------------------------------*/
41 #if (NIWIC > 0) && (NPCI > 0)
43 #include <sys/param.h>
44 #include <sys/systm.h>
45 #include <sys/socket.h>
48 #include <net/i4b/include/machine/i4b_debug.h>
49 #include <net/i4b/include/machine/i4b_ioctl.h>
50 #include <net/i4b/include/machine/i4b_trace.h>
52 #include "../../include/i4b_global.h"
53 #include "../../include/i4b_l3l4.h"
54 #include "../i4b_l1.h"
57 #include "i4b_iwic_ext.h"
59 /* jump table for multiplex routines */
61 struct i4b_l1mux_func iwic_l1mux_func = {
69 /*---------------------------------------------------------------------------*
71 *---------------------------------------------------------------------------*/
73 iwic_ph_data_req(int unit, struct mbuf *m, int freeflag)
75 struct iwic_softc *sc = iwic_find_sc(unit);
77 return iwic_dchan_data_req(sc, m, freeflag);
80 /*---------------------------------------------------------------------------*
82 *---------------------------------------------------------------------------*/
84 iwic_ph_activate_req(int unit)
86 struct iwic_softc *sc = iwic_find_sc(unit);
88 iwic_next_state(sc, EV_PHAR);
93 /*---------------------------------------------------------------------------*
95 *---------------------------------------------------------------------------*/
97 iwic_mph_command_req(int unit, int command, void *parm)
99 struct iwic_softc *sc = iwic_find_sc(unit);
103 case CMR_DOPEN: /* Daemon running */
104 NDBGL1(L1_PRIM, "CMR_DOPEN");
108 case CMR_DCLOSE: /* Daemon not running */
109 NDBGL1(L1_PRIM, "CMR_DCLOSE");
114 NDBGL1(L1_PRIM, "CMR_SETTRACE, parm = %d", (unsigned int)parm);
115 sc->sc_trace = (unsigned int)parm;
119 NDBGL1(L1_PRIM, "unknown command = %d", command);
126 /*---------------------------------------------------------------------------*
128 *---------------------------------------------------------------------------*/
130 iwic_ret_linktab(int unit, int channel)
132 struct iwic_softc *sc = iwic_find_sc(unit);
133 struct iwic_bchan *bchan = &sc->sc_bchan[channel];
135 return &bchan->iwic_isdn_linktab;
138 /*---------------------------------------------------------------------------*
140 *---------------------------------------------------------------------------*/
142 iwic_set_linktab (int unit, int channel, drvr_link_t *dlt)
144 struct iwic_softc *sc = iwic_find_sc(unit);
145 struct iwic_bchan *bchan = &sc->sc_bchan[channel];
147 bchan->iwic_drvr_linktab = dlt;